mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-11 17:31:06 +01:00
RedstoneChange event thrown then the redstone *changes* not when it stays the same :D
This commit is contained in:
parent
9d9ad6bd1e
commit
1505b4bf3c
1 changed files with 8 additions and 6 deletions
|
@ -114,12 +114,14 @@ public class BlockPressurePlate extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
CraftWorld craftWorld = ((WorldServer) world).getWorld();
|
if (flag != flag1) {
|
||||||
CraftServer server = ((WorldServer) world).getServer();
|
CraftWorld craftWorld = ((WorldServer) world).getWorld();
|
||||||
CraftBlock block = (CraftBlock) craftWorld.getBlockAt(i, j, k);
|
CraftServer server = ((WorldServer) world).getServer();
|
||||||
BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, flag ? 1 : 0, flag1 ? 1 : 0);
|
CraftBlock block = (CraftBlock) craftWorld.getBlockAt(i, j, k);
|
||||||
server.getPluginManager().callEvent(eventRedstone);
|
BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, flag ? 1 : 0, flag1 ? 1 : 0);
|
||||||
flag1 = eventRedstone.getNewCurrent() > 0;
|
server.getPluginManager().callEvent(eventRedstone);
|
||||||
|
flag1 = eventRedstone.getNewCurrent() > 0;
|
||||||
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
if (flag1 && !flag) {
|
if (flag1 && !flag) {
|
||||||
|
|
Loading…
Reference in a new issue