Skip to content

Commit f9e19b8

Browse files
committed
Update to 1.19.3
Some V2 backend got in here Currently scissors in CScrollPanel.java and CPlainPanel.java are broken
1 parent a422cc8 commit f9e19b8

24 files changed

+114
-121
lines changed

gradle.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
org.gradle.jvmargs=-Xmx1G
33
# Fabric Properties
44
# check these on https://modmuss50.me/fabric.html
5-
minecraft_version=1.19.2
6-
yarn_mappings=1.19.2+build.1
7-
loader_version=0.14.8
5+
minecraft_version=1.19.3
6+
yarn_mappings=1.19.3+build.2
7+
loader_version=0.14.11
88
# Mod Properties
99
mod_version=1.0-SNAPSHOT
1010
maven_group=io.github.techstreet.dfscript
1111
archives_base_name=DFScript
1212
# Dependencies
13-
# check this on https://modmuss50.me/fabric.html
14-
fabric_version=0.58.6+1.19.2
13+
# check this on `https://modmuss50.me/fabric.html`
14+
fabric_version=0.68.1+1.19.3

src/main/java/io/github/techstreet/dfscript/event/RecieveSoundEvent.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
package io.github.techstreet.dfscript.event;
22

33
import io.github.techstreet.dfscript.event.system.CancellableEvent;
4-
import net.minecraft.client.sound.SoundInstance;
5-
import net.minecraft.network.packet.s2c.play.PlaySoundFromEntityS2CPacket;
6-
import net.minecraft.network.packet.s2c.play.PlaySoundIdS2CPacket;
7-
import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket;
8-
import net.minecraft.sound.SoundEvent;
94
import net.minecraft.util.Identifier;
105

116
public class RecieveSoundEvent implements CancellableEvent {

src/main/java/io/github/techstreet/dfscript/mixin/game/MClientPlayNetworkHandler.java

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,20 @@
22

33
import com.mojang.blaze3d.systems.RenderSystem;
44
import io.github.techstreet.dfscript.DFScript;
5-
import io.github.techstreet.dfscript.event.BuildModeEvent;
6-
import io.github.techstreet.dfscript.event.DevModeEvent;
7-
import io.github.techstreet.dfscript.event.PlayModeEvent;
8-
import io.github.techstreet.dfscript.event.ReceiveChatEvent;
9-
import io.github.techstreet.dfscript.event.RecieveSoundEvent;
10-
import io.github.techstreet.dfscript.event.ServerJoinEvent;
11-
import io.github.techstreet.dfscript.event.ServerLeaveEvent;
5+
import io.github.techstreet.dfscript.event.*;
126
import io.github.techstreet.dfscript.event.system.EventManager;
137
import io.github.techstreet.dfscript.util.hypercube.HypercubeRank;
148
import io.github.techstreet.dfscript.util.hypercube.HypercubeUtil;
159
import java.net.InetSocketAddress;
1610
import net.minecraft.client.network.ClientPlayNetworkHandler;
1711
import net.minecraft.network.ClientConnection;
1812
import net.minecraft.network.packet.s2c.play.*;
13+
import net.minecraft.text.Text;
1914
import org.spongepowered.asm.mixin.Mixin;
2015
import org.spongepowered.asm.mixin.injection.At;
2116
import org.spongepowered.asm.mixin.injection.Inject;
2217
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
18+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
2319

2420
@Mixin(ClientPlayNetworkHandler.class)
2521
public class MClientPlayNetworkHandler {
@@ -119,4 +115,24 @@ private void onPlaySoundId(PlaySoundIdS2CPacket packet, CallbackInfo ci) {
119115
ci.cancel();
120116
}
121117
}*/
118+
119+
// Moved from LocalPlayer
120+
@Inject(method = "sendChatMessage", at = @At("HEAD"), cancellable = true)
121+
private void chat(String message, CallbackInfo ci) {
122+
SendChatEvent event = new SendChatEvent(message);
123+
EventManager.getInstance().dispatch(event);
124+
if (event.isCancelled()) {
125+
ci.cancel();
126+
}
127+
}
128+
129+
@Inject(method = "sendCommand", at = @At("HEAD"), cancellable = true)
130+
private void command2(String command, CallbackInfoReturnable<Boolean> cir) {
131+
if(command.startsWith("scripts")) return;
132+
SendChatEvent event = new SendChatEvent("/"+command);
133+
EventManager.getInstance().dispatch(event);
134+
if (event.isCancelled()) {
135+
cir.cancel();
136+
}
137+
}
122138
}

src/main/java/io/github/techstreet/dfscript/mixin/player/MLocalPlayer.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,6 @@
1414
@Mixin(ClientPlayerEntity.class)
1515
public class MLocalPlayer {
1616

17-
@Inject(method = "sendChatMessage", at = @At("HEAD"), cancellable = true)
18-
private void chat(String message, Text preview, CallbackInfo ci) {
19-
SendChatEvent event = new SendChatEvent(message);
20-
EventManager.getInstance().dispatch(event);
21-
if (event.isCancelled()) {
22-
ci.cancel();
23-
}
24-
}
25-
26-
@Inject(method = "sendCommand(Ljava/lang/String;)Z", at = @At("HEAD"), cancellable = true)
27-
private void command(String command, CallbackInfoReturnable<Boolean> ci) {
28-
if(command.startsWith("scripts")) return;
29-
SendChatEvent event = new SendChatEvent("/"+command);
30-
EventManager.getInstance().dispatch(event);
31-
if (event.isCancelled()) {
32-
ci.cancel();
33-
}
34-
}
35-
36-
@Inject(method = "sendCommand(Ljava/lang/String;Lnet/minecraft/text/Text;)V", at = @At("HEAD"), cancellable = true)
37-
private void command2(String command, Text preview, CallbackInfo ci) {
38-
if(command.startsWith("scripts")) return;
39-
SendChatEvent event = new SendChatEvent("/"+command);
40-
EventManager.getInstance().dispatch(event);
41-
if (event.isCancelled()) {
42-
ci.cancel();
43-
}
44-
}
4517

4618
@Inject(method = "tick", at = @At("HEAD"))
4719
private void tick(CallbackInfo ci) {

src/main/java/io/github/techstreet/dfscript/mixin/sound/MSoundSystem.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@
22

33
import io.github.techstreet.dfscript.event.RecieveSoundEvent;
44
import io.github.techstreet.dfscript.event.system.EventManager;
5-
import io.github.techstreet.dfscript.util.chat.ChatUtil;
65
import net.minecraft.client.sound.Sound;
76
import net.minecraft.client.sound.SoundInstance;
87
import net.minecraft.client.sound.SoundSystem;
98
import net.minecraft.client.sound.WeightedSoundSet;
10-
import net.minecraft.network.packet.s2c.play.PlaySoundIdS2CPacket;
119
import net.minecraft.sound.SoundCategory;
1210
import net.minecraft.util.Identifier;
13-
import net.minecraft.util.math.MathHelper;
1411
import org.spongepowered.asm.mixin.Mixin;
1512
import org.spongepowered.asm.mixin.Shadow;
16-
import org.spongepowered.asm.mixin.gen.Invoker;
1713
import org.spongepowered.asm.mixin.injection.At;
1814
import org.spongepowered.asm.mixin.injection.Inject;
1915
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

src/main/java/io/github/techstreet/dfscript/screen/CScreen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ protected CScreen(int width, int height) {
2020
super(Text.literal("DFScript Screen"));
2121
this.width = width;
2222
this.height = height;
23-
DFScript.MC.keyboard.setRepeatEvents(true);
23+
// DFScript.MC.keyboard.setRepeatEvents(true);
2424
}
2525

2626
@Override

src/main/java/io/github/techstreet/dfscript/screen/script/ScriptEditActionScreen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public void render(MatrixStack stack, int mouseX, int mouseY, float tickDelta) {
8080
@Override
8181
public boolean mouseClicked(double x, double y, int button) {
8282
if (getBounds().contains(x, y)) {
83-
DFScript.MC.getSoundManager().play(PositionedSoundInstance.ambient(SoundEvents.UI_BUTTON_CLICK, 1f,1f));
83+
DFScript.MC.getSoundManager().play(PositionedSoundInstance.ambient(SoundEvents.UI_BUTTON_CLICK.value(), 1f,1f));
8484

8585
if (button != 0) {
8686
CButton insertBefore = new CButton((int) x, (int) y, 40, 8, "Insert Before", () -> {

src/main/java/io/github/techstreet/dfscript/screen/script/ScriptEditScreen.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public void render(MatrixStack stack, int mouseX, int mouseY, float tickDelta) {
8383
@Override
8484
public boolean mouseClicked(double x, double y, int button) {
8585
if (getBounds().contains(x, y)) {
86-
DFScript.MC.getSoundManager().play(PositionedSoundInstance.ambient(SoundEvents.UI_BUTTON_CLICK, 1f,1f));
86+
DFScript.MC.getSoundManager().play(PositionedSoundInstance.ambient(SoundEvents.UI_BUTTON_CLICK.value(), 1f,1f));
8787

8888
if (button != 0) {
8989
CButton insertBefore = new CButton((int) x, (int) y, 40, 8, "Insert Before", () -> {
@@ -145,7 +145,7 @@ public void render(MatrixStack stack, int mouseX, int mouseY, float tickDelta) {
145145
@Override
146146
public boolean mouseClicked(double x, double y, int button) {
147147
if (getBounds().contains(x, y)) {
148-
DFScript.MC.getSoundManager().play(PositionedSoundInstance.ambient(SoundEvents.UI_BUTTON_CLICK, 1f, 1f));
148+
DFScript.MC.getSoundManager().play(PositionedSoundInstance.ambient(SoundEvents.UI_BUTTON_CLICK.value(), 1f, 1f));
149149

150150
if (button == 0) {
151151
if (sa.getType() != ScriptActionType.CLOSE_BRACKET) {
@@ -208,7 +208,7 @@ public void render(MatrixStack stack, int mouseX, int mouseY, float tickDelta) {
208208
@Override
209209
public boolean mouseClicked(double x, double y, int button) {
210210
if (getBounds().contains(x, y)) {
211-
DFScript.MC.getSoundManager().play(PositionedSoundInstance.ambient(SoundEvents.UI_BUTTON_CLICK, 1f,1f));
211+
DFScript.MC.getSoundManager().play(PositionedSoundInstance.ambient(SoundEvents.UI_BUTTON_CLICK.value(), 1f,1f));
212212

213213
if (button != 0) {
214214
CButton insertBefore = new CButton((int) x, (int) y, 40, 8, "Insert Before", () -> {

src/main/java/io/github/techstreet/dfscript/screen/script/ScriptListScreen.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ public ScriptListScreen(boolean allowEditAndUpload) {
2525
CScrollPanel panel = new CScrollPanel(0, 5, 160, 94);
2626
widgets.add(panel);
2727

28+
CText test = new CText(0,0,Text.literal("Debug"));
29+
widgets.add(test);
30+
2831
int y = 0;
2932
for (Script s : ScriptManager.getInstance().getScripts()) {
3033
MutableText text = Text.literal(s.getName());

src/main/java/io/github/techstreet/dfscript/screen/script/ScriptSettingsScreen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public void render(MatrixStack stack, int mouseX, int mouseY, float tickDelta) {
9292
@Override
9393
public boolean mouseClicked(double x, double y, int button) {
9494
if (getBounds().contains(x, y)) {
95-
DFScript.MC.getSoundManager().play(PositionedSoundInstance.ambient(SoundEvents.UI_BUTTON_CLICK, 1f,1f));
95+
DFScript.MC.getSoundManager().play(PositionedSoundInstance.ambient(SoundEvents.UI_BUTTON_CLICK.value(), 1f,1f));
9696

9797
if (button != 0) {
9898
CButton insertBefore = new CButton((int) x, (int) y, 40, 8, "Insert Before", () -> {

0 commit comments

Comments
 (0)