2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/level/block/BlockFenceGate.java
|
|
|
|
+++ b/net/minecraft/world/level/block/BlockFenceGate.java
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -130,6 +130,17 @@
|
2020-03-15 09:05:50 +01:00
|
|
|
public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) {
|
|
|
|
if (!world.isClientSide) {
|
|
|
|
boolean flag1 = world.isBlockIndirectlyPowered(blockposition);
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ boolean oldPowered = iblockdata.get(BlockFenceGate.POWERED);
|
|
|
|
+ if (oldPowered != flag1) {
|
|
|
|
+ int newPower = flag1 ? 15 : 0;
|
|
|
|
+ int oldPower = oldPowered ? 15 : 0;
|
|
|
|
+ org.bukkit.block.Block bukkitBlock = org.bukkit.craftbukkit.block.CraftBlock.at(world, blockposition);
|
|
|
|
+ org.bukkit.event.block.BlockRedstoneEvent eventRedstone = new org.bukkit.event.block.BlockRedstoneEvent(bukkitBlock, oldPower, newPower);
|
2021-06-11 13:33:49 +02:00
|
|
|
+ world.getCraftServer().getPluginManager().callEvent(eventRedstone);
|
2020-03-15 09:05:50 +01:00
|
|
|
+ flag1 = eventRedstone.getNewCurrent() > 0;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
|
|
|
|
if ((Boolean) iblockdata.get(BlockFenceGate.POWERED) != flag1) {
|
|
|
|
world.setTypeAndData(blockposition, (IBlockData) ((IBlockData) iblockdata.set(BlockFenceGate.POWERED, flag1)).set(BlockFenceGate.OPEN, flag1), 2);
|