Call BlockRedstoneEvents properly

Call BlockRedstoneEvents for lecterns.
Fix previous power level for experimental redstone wire.
This commit is contained in:
Warrior
2023-09-13 05:46:10 +02:00
parent 5688b5cf50
commit d4ab21c047
2 changed files with 19 additions and 2 deletions

View File

@@ -17,7 +17,7 @@
- if (iblockdata1.is((Block) this.wireBlock) && !((Integer) iblockdata1.getValue(RedStoneWireBlock.POWER)).equals(j)) {
+ // CraftBukkit start
+ int oldPower = state.getValue(RedStoneWireBlock.POWER);
+ int oldPower = iblockdata1.getValue(RedStoneWireBlock.POWER); // Paper - Call BlockRedstoneEvent properly; get the previous power from the right state
+ if (oldPower != j) {
+ BlockRedstoneEvent event = new BlockRedstoneEvent(CraftBlock.at(world, blockposition1), oldPower, j);
+ world.getCraftServer().getPluginManager().callEvent(event);