mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 19:34:09 +01:00
SPIGOT-5965: BlockRedstoneEvent.setNewCurrent(0) crashes server
By: md_5 <git@md-5.net>
This commit is contained in:
parent
666f651058
commit
83b1ab97ca
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue