mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-04 22:14:40 +01:00
30 lines
1.5 KiB
Diff
30 lines
1.5 KiB
Diff
--- a/net/minecraft/server/BlockTrapdoor.java
|
|
+++ b/net/minecraft/server/BlockTrapdoor.java
|
|
@@ -1,6 +1,7 @@
|
|
package net.minecraft.server;
|
|
|
|
import javax.annotation.Nullable;
|
|
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
|
|
|
|
public class BlockTrapdoor extends BlockFacingHorizontal implements IBlockWaterlogged {
|
|
|
|
@@ -88,6 +89,19 @@
|
|
boolean flag1 = world.isBlockIndirectlyPowered(blockposition);
|
|
|
|
if (flag1 != (Boolean) iblockdata.get(BlockTrapdoor.c)) {
|
|
+ // CraftBukkit start
|
|
+ org.bukkit.World bworld = world.getWorld();
|
|
+ org.bukkit.block.Block bblock = bworld.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
|
+
|
|
+ int power = bblock.getBlockPower();
|
|
+ int oldPower = (Boolean) iblockdata.get(OPEN) ? 15 : 0;
|
|
+
|
|
+ if (oldPower == 0 ^ power == 0 || block.getBlockData().isPowerSource()) {
|
|
+ BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(bblock, oldPower, power);
|
|
+ world.getServer().getPluginManager().callEvent(eventRedstone);
|
|
+ flag1 = eventRedstone.getNewCurrent() > 0;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
if ((Boolean) iblockdata.get(BlockTrapdoor.OPEN) != flag1) {
|
|
iblockdata = (IBlockData) iblockdata.set(BlockTrapdoor.OPEN, flag1);
|
|
this.a((EntityHuman) null, world, blockposition, flag1);
|