Fix cast check (#4813)

This commit is contained in:
Josh Roy 2020-11-27 13:07:41 -05:00 committed by GitHub
parent b8e375fc40
commit 7a154d5c50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,7 +23,7 @@ index d86474a1a97597c14ea8a28444e2a5d82fcda2a7..e0422471776f34b8e3c753d855aa06f0
public static int maxPlayerAutoSavePerTick = 10;
private static void playerAutoSaveRate() {
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
index 72de544c0782e4daff222a0ca04e5bc870cf148c..fe513a9470a0c474ca436ede4a5a7da476cf6c8d 100644
index 72de544c0782e4daff222a0ca04e5bc870cf148c..5ca4d03215c979a4d122a32178a1859b4d9c3334 100644
--- a/src/main/java/net/minecraft/server/Explosion.java
+++ b/src/main/java/net/minecraft/server/Explosion.java
@@ -135,6 +135,15 @@ public class Explosion {
@ -32,8 +32,8 @@ index 72de544c0782e4daff222a0ca04e5bc870cf148c..fe513a9470a0c474ca436ede4a5a7da4
set.add(blockposition);
+ // Paper start - prevent headless pistons from forming
+ if (!com.destroystokyo.paper.PaperConfig.allowHeadlessPistons && iblockdata.getBlock() == Blocks.MOVING_PISTON) {
+ TileEntityPiston extension = (TileEntityPiston)this.world.getTileEntity(blockposition);
+ if (extension.isHead()) {
+ TileEntity extension = this.world.getTileEntity(blockposition);
+ if (extension instanceof TileEntityPiston && ((TileEntityPiston) extension).isHead()) {
+ EnumDirection direction = iblockdata.get(BlockPistonExtension.FACING);
+ set.add(blockposition.shift(direction.opposite()));
+ }