56 lines
2.9 KiB
Diff
56 lines
2.9 KiB
Diff
--- a/net/minecraft/block/PistonBlock.java
|
|
+++ b/net/minecraft/block/PistonBlock.java
|
|
@@ -158,6 +158,7 @@
|
|
}
|
|
|
|
if (p_189539_4_ == 0) {
|
|
+ if (net.minecraftforge.event.ForgeEventFactory.onPistonMovePre(p_189539_2_, p_189539_3_, direction, true)) return false;
|
|
if (!this.func_176319_a(p_189539_2_, p_189539_3_, direction, true)) {
|
|
return false;
|
|
}
|
|
@@ -165,6 +166,7 @@
|
|
p_189539_2_.func_180501_a(p_189539_3_, p_189539_1_.func_206870_a(field_176320_b, Boolean.valueOf(true)), 67);
|
|
p_189539_2_.func_184133_a((PlayerEntity)null, p_189539_3_, SoundEvents.field_187715_dR, SoundCategory.BLOCKS, 0.5F, p_189539_2_.field_73012_v.nextFloat() * 0.25F + 0.6F);
|
|
} else if (p_189539_4_ == 1 || p_189539_4_ == 2) {
|
|
+ if (net.minecraftforge.event.ForgeEventFactory.onPistonMovePre(p_189539_2_, p_189539_3_, direction, false)) return false;
|
|
TileEntity tileentity1 = p_189539_2_.func_175625_s(p_189539_3_.func_177972_a(direction));
|
|
if (tileentity1 instanceof PistonTileEntity) {
|
|
((PistonTileEntity)tileentity1).func_145866_f();
|
|
@@ -204,6 +206,7 @@
|
|
p_189539_2_.func_184133_a((PlayerEntity)null, p_189539_3_, SoundEvents.field_187712_dQ, SoundCategory.BLOCKS, 0.5F, p_189539_2_.field_73012_v.nextFloat() * 0.15F + 0.6F);
|
|
}
|
|
|
|
+ net.minecraftforge.event.ForgeEventFactory.onPistonMovePost(p_189539_2_, p_189539_3_, direction, (p_189539_4_ == 0));
|
|
return true;
|
|
}
|
|
|
|
@@ -234,7 +237,7 @@
|
|
return false;
|
|
}
|
|
|
|
- return !p_185646_0_.func_177230_c().func_235695_q_();
|
|
+ return !p_185646_0_.hasTileEntity();
|
|
}
|
|
} else {
|
|
return false;
|
|
@@ -273,7 +276,7 @@
|
|
for(int k = list2.size() - 1; k >= 0; --k) {
|
|
BlockPos blockpos2 = list2.get(k);
|
|
BlockState blockstate1 = p_176319_1_.func_180495_p(blockpos2);
|
|
- TileEntity tileentity = blockstate1.func_177230_c().func_235695_q_() ? p_176319_1_.func_175625_s(blockpos2) : null;
|
|
+ TileEntity tileentity = blockstate1.hasTileEntity() ? p_176319_1_.func_175625_s(blockpos2) : null;
|
|
func_220059_a(blockstate1, p_176319_1_, blockpos2, tileentity);
|
|
p_176319_1_.func_180501_a(blockpos2, Blocks.field_150350_a.func_176223_P(), 18);
|
|
ablockstate[j++] = blockstate1;
|
|
@@ -337,6 +340,10 @@
|
|
return p_185499_1_.func_206870_a(field_176387_N, p_185499_2_.func_185831_a(p_185499_1_.func_177229_b(field_176387_N)));
|
|
}
|
|
|
|
+ public BlockState rotate(BlockState state, net.minecraft.world.IWorld world, BlockPos pos, Rotation direction) {
|
|
+ return state.func_177229_b(field_176320_b) ? state : super.rotate(state, world, pos, direction);
|
|
+ }
|
|
+
|
|
public BlockState func_185471_a(BlockState p_185471_1_, Mirror p_185471_2_) {
|
|
return p_185471_1_.func_185907_a(p_185471_2_.func_185800_a(p_185471_1_.func_177229_b(field_176387_N)));
|
|
}
|