mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-03 23:07:40 +01:00
Validate tripwire hook placement before update
This commit is contained in:
parent
4bff4be120
commit
26067ca04b
@ -11,19 +11,24 @@
|
||||
|
||||
public class TripWireHookBlock extends Block {
|
||||
|
||||
@@ -176,6 +180,15 @@
|
||||
@@ -174,10 +178,20 @@
|
||||
world.setBlock(blockposition1, (BlockState) iblockdata3.setValue(TripWireHookBlock.FACING, enumdirection1), 3);
|
||||
TripWireHookBlock.notifyNeighbors(block, world, blockposition1, enumdirection1);
|
||||
TripWireHookBlock.emitState(world, blockposition1, flag4, flag5, flag2, flag3);
|
||||
}
|
||||
|
||||
+ }
|
||||
+
|
||||
+ // CraftBukkit start
|
||||
+ BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(CraftBlock.at(world, pos), 15, 0);
|
||||
+ world.getCraftServer().getPluginManager().callEvent(eventRedstone);
|
||||
+
|
||||
+ if (eventRedstone.getNewCurrent() > 0) {
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
|
||||
TripWireHookBlock.emitState(world, pos, flag4, flag5, flag2, flag3);
|
||||
if (!flag) {
|
||||
+ if (world.getBlockState(pos).getBlock() == Blocks.TRIPWIRE_HOOK) // Paper - Validate tripwire hook placement before update
|
||||
world.setBlock(pos, (BlockState) iblockdata3.setValue(TripWireHookBlock.FACING, enumdirection), 3);
|
||||
if (flag1) {
|
||||
TripWireHookBlock.notifyNeighbors(block, world, pos, enumdirection);
|
||||
|
Loading…
Reference in New Issue
Block a user