|
1 | 1 | --- a/net/minecraft/network/protocol/game/VecDeltaCodec.java |
2 | 2 | +++ 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 | + |
4 | 14 | 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); |
27 | 74 | - } |
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 | ++ }; |
31 | 83 | } |
| 84 | + |
| 85 | + public @Nullable VecDelta tryEncode(final Vec3 pos) { |
0 commit comments