death to more obfhelpers

This commit is contained in:
MiniDigger | Martin
2021-06-17 22:20:03 +02:00
parent 62fabeca0c
commit 4ac379cbd0
13 changed files with 28 additions and 132 deletions

View File

@@ -32,23 +32,13 @@ diff --git a/src/main/java/net/minecraft/world/level/block/RailState.java b/src/
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/block/RailState.java
+++ b/src/main/java/net/minecraft/world/level/block/RailState.java
@@ -0,0 +0,0 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.RailShape;
public class RailState {
- private final Level level;
- private final BlockPos pos;
+ private final Level level; @Deprecated public final Level getWorld() { return this.level; } // Paper - OBFHELPER
+ private final BlockPos pos; @Deprecated public final BlockPos getPos() { return this.pos; } // Paper - OBFHELPER
private final BaseRailBlock block;
- private BlockState state;
+ private BlockState state; @Deprecated public final BlockState getRailState() { return this.state; } // Paper - OBFHELPER
@@ -0,0 +0,0 @@ public class RailState {
private final boolean isStraight;
private final List<BlockPos> connections = Lists.newArrayList();
+ // Paper start - prevent desync
+ public boolean isValid() {
+ return this.getWorld().getBlockState(this.getPos()).getBlock() == this.getRailState().getBlock();
+ return this.level.getBlockState(this.pos).getBlock() == this.state.getBlock();
+ }
+ // Paper end - prevent desync
+
@@ -89,6 +79,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public BlockState getState() {
- return this.state;
+ return this.getWorld().getBlockState(this.getPos()); // Paper - prevent desync
+ return this.level.getBlockState(this.pos); // Paper - prevent desync
}
}