mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 06:24:06 +01:00
29 lines
1.1 KiB
Diff
29 lines
1.1 KiB
Diff
--- a/net/minecraft/server/BlockMinecartDetector.java
|
|
+++ b/net/minecraft/server/BlockMinecartDetector.java
|
|
@@ -6,6 +6,8 @@
|
|
import java.util.function.Predicate;
|
|
import javax.annotation.Nullable;
|
|
|
|
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
|
|
+
|
|
public class BlockMinecartDetector extends BlockMinecartTrackAbstract {
|
|
|
|
public static final BlockStateEnum<BlockPropertyTrackPosition> SHAPE = BlockProperties.X;
|
|
@@ -62,6 +64,16 @@
|
|
}
|
|
|
|
IBlockData iblockdata1;
|
|
+ // CraftBukkit start
|
|
+ if (flag != flag1) {
|
|
+ org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
|
+
|
|
+ BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, flag ? 15 : 0, flag1 ? 15 : 0);
|
|
+ world.getServer().getPluginManager().callEvent(eventRedstone);
|
|
+
|
|
+ flag1 = eventRedstone.getNewCurrent() > 0;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
|
|
if (flag1 && !flag) {
|
|
iblockdata1 = (IBlockData) iblockdata.set(BlockMinecartDetector.POWERED, true);
|