Skip to content

Commit 0a8522b

Browse files
committed
Fix decompile patches for 26.4-snapshot-7
1 parent 578c0d3 commit 0a8522b

4 files changed

Lines changed: 108 additions & 51 deletions

File tree

‎versions/26.4-snapshot-7/patches/net/minecraft/network/protocol/game/VecDelta.java.patch‎

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 80 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,85 @@
11
--- a/net/minecraft/network/protocol/game/VecDeltaCodec.java
22
+++ b/net/minecraft/network/protocol/game/VecDeltaCodec.java
3-
@@ -43,27 +_,7 @@
3+
@@ -1,7 +_,6 @@
4+
package net.minecraft.network.protocol.game;
5+
6+
import com.google.common.annotations.VisibleForTesting;
7+
-import java.lang.runtime.SwitchBootstraps;
8+
import java.util.List;
9+
import net.minecraft.world.entity.PositionPath;
10+
import net.minecraft.world.entity.PositionStep;
11+
@@ -42,69 +_,11 @@
12+
}
13+
414
public @Nullable VecDelta tryEncode(final PositionPath position) {
5-
return switch (position) {
6-
case PositionPath.Linear(Vec3 pos) -> this.tryEncode(pos);
7-
- case PositionPath.Stepped var6 -> {
8-
- PositionPath.Stepped var10000 = var6;
9-
-
10-
- try {
11-
- var10000.endPosition();
12-
- } catch (Throwable var10) {
13-
- throw new MatchException(var10.toString(), var10);
14-
- }
15-
-
16-
- var10000 = var6;
17-
-
18-
- try {
19-
- var14 = var10000.steps();
20-
- } catch (Throwable var9) {
21-
- throw new MatchException(var9.toString(), var9);
22-
- }
23-
-
24-
- List var8 = var14;
25-
- List<PositionStep> steps = var8;
26-
- yield VecDelta.Stepped.tryEncode(this, steps);
15+
- PositionPath var2 = position;
16+
- byte var3 = 0;
17+
-
18+
- while (true) {
19+
- VecDelta var21;
20+
- switch (SwitchBootstraps.typeSwitch<"typeSwitch",PositionPath.Linear,PositionPath.Stepped>(var2, var3)) {
21+
- case 0:
22+
- PositionPath.Linear var4 = (PositionPath.Linear)var2;
23+
- PositionPath.Linear var22 = var4;
24+
-
25+
- try {
26+
- var23 = var22.endPosition();
27+
- } catch (Throwable var11) {
28+
- throw new MatchException(var11.toString(), var11);
29+
- }
30+
-
31+
- Vec3 var15 = var23;
32+
- Vec3 pos = var15;
33+
- var21 = this.tryEncode(pos);
34+
- break;
35+
- case 1:
36+
- PositionPath.Stepped var6 = (PositionPath.Stepped)var2;
37+
- PositionPath.Stepped var10000 = var6;
38+
-
39+
- try {
40+
- var10000.endPosition();
41+
- } catch (Throwable var14) {
42+
- throw new MatchException(var14.toString(), var14);
43+
- }
44+
-
45+
- PositionPath.Stepped var17 = var6;
46+
-
47+
- try {
48+
- var18 = var17.steps();
49+
- } catch (Throwable var13) {
50+
- throw new MatchException(var13.toString(), var13);
51+
- }
52+
-
53+
- List var9 = var18;
54+
- List<PositionStep> steps = var9;
55+
- PositionPath.Stepped var19 = var6;
56+
-
57+
- try {
58+
- var20 = var19.startImmediately();
59+
- } catch (Throwable var12) {
60+
- throw new MatchException(var12.toString(), var12);
61+
- }
62+
-
63+
- boolean var16 = var20;
64+
- if (false) {
65+
- var3 = 2;
66+
- continue;
67+
- }
68+
-
69+
- boolean startImmediately = var16;
70+
- var21 = VecDelta.Stepped.tryEncode(this, steps, startImmediately);
71+
- break;
72+
- default:
73+
- throw new MatchException(null, null);
2774
- }
28-
+ case PositionPath.Stepped(Vec3 _, List<PositionStep> steps) -> VecDelta.Stepped.tryEncode(this, steps);
29-
default -> throw new MatchException(null, null);
30-
};
75+
-
76+
- return var21;
77+
- }
78+
+ return switch (position) {
79+
+ case PositionPath.Linear(Vec3 pos) -> this.tryEncode(pos);
80+
+ case PositionPath.Stepped(Vec3 _, List<PositionStep> steps, boolean startImmediately) -> VecDelta.Stepped.tryEncode(this, steps, startImmediately);
81+
+ default -> throw new MatchException(null, null);
82+
+ };
3183
}
84+
85+
public @Nullable VecDelta tryEncode(final Vec3 pos) {

‎versions/26.4-snapshot-7/patches/net/minecraft/world/entity/SteppedInterpolationHandler.java.patch‎

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,52 @@
11
--- a/net/minecraft/world/entity/SteppedInterpolationHandler.java
22
+++ b/net/minecraft/world/entity/SteppedInterpolationHandler.java
3-
@@ -122,25 +_,7 @@
3+
@@ -157,33 +_,7 @@
44
case PositionPath.Linear(Vec3 pos):
5-
this.addStep(pos, yRot, xRot, interpolationSteps);
5+
this.addStep(pos, yRot, xRot, weight);
66
break;
7-
- case PositionPath.Stepped var9: {
7+
- case PositionPath.Stepped var9:
88
- PositionPath.Stepped var10000 = var9;
99
-
1010
- try {
1111
- var10000.endPosition();
12+
- } catch (Throwable var18) {
13+
- throw new MatchException(var18.toString(), var18);
14+
- }
15+
-
16+
- var10000 = var9;
17+
-
18+
- try {
19+
- var25 = var10000.steps();
1220
- } catch (Throwable var17) {
1321
- throw new MatchException(var17.toString(), var17);
1422
- }
1523
-
24+
- List totalInterpolationTicks = var25;
25+
- List<PositionStep> steps = totalInterpolationTicks;
1626
- var10000 = var9;
1727
-
1828
- try {
19-
- var24 = var10000.steps();
29+
- var10000.startImmediately();
2030
- } catch (Throwable var16) {
2131
- throw new MatchException(var16.toString(), var16);
2232
- }
2333
-
24-
- List totalInterpolationTicks = var24;
25-
- List<PositionStep> steps = totalInterpolationTicks;
26-
+ case PositionPath.Stepped(Vec3 _, List<PositionStep> steps):
34+
+ case PositionPath.Stepped(Vec3 _, List<PositionStep> steps, boolean _):
2735
if (yRot == this.yRot() && xRot == this.xRot()) {
2836
for (PositionStep step : steps) {
2937
this.addStep(step.position(), yRot, xRot, step.tickOffset());
30-
@@ -158,7 +_,6 @@
38+
@@ -192,12 +_,12 @@
39+
return;
40+
}
41+
42+
- int totalInterpolationTicksx = getInterpolationTicks(steps);
43+
+ int totalInterpolationTicks = getInterpolationTicks(steps);
44+
int offset = 0;
45+
46+
for (PositionStep step : steps) {
47+
offset += step.tickOffset();
48+
- float a = (float)offset / totalInterpolationTicksx;
49+
+ float a = (float)offset / totalInterpolationTicks;
3150
this.addStep(step.position(), Mth.rotLerp(a, this.yRot(), yRot), Mth.lerp(a, this.xRot(), xRot), step.tickOffset());
3251
}
3352
break;
34-
- }
35-
default:
36-
throw new MatchException(null, null);
37-
}

‎versions/26.4-snapshot-7/patches/net/minecraft/world/entity/animal/golem/CopperGolem.java.patch‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- a/net/minecraft/world/entity/animal/golem/CopperGolem.java
22
+++ b/net/minecraft/world/entity/animal/golem/CopperGolem.java
3-
@@ -154,7 +_,7 @@
3+
@@ -164,7 +_,7 @@
44

55
@Override
66
public Brain<CopperGolem> getBrain() {

0 commit comments

Comments
 (0)