SPIGOT-5965: BlockRedstoneEvent.setNewCurrent(0) crashes server

This commit is contained in:
md_5 2020-07-09 09:12:57 +10:00
parent 60f8a29d12
commit 72f3689092
No known key found for this signature in database
GPG key ID: E8E901AC7C617C11

View file

@ -9,7 +9,7 @@
public class BlockRedstoneWire extends Block {
public static final BlockStateEnum<BlockPropertyRedstoneSide> NORTH = BlockProperties.X;
@@ -213,7 +215,14 @@
@@ -213,7 +215,16 @@
private void a(World world, BlockPosition blockposition, IBlockData iblockdata) {
int i = this.a(world, blockposition);
@ -21,6 +21,8 @@
+ world.getServer().getPluginManager().callEvent(event);
+
+ i = event.getNewCurrent();
+ }
+ if (oldPower != i) {
+ // CraftBukkit end
if (world.getType(blockposition) == iblockdata) {
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneWire.POWER, i), 2);