3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2025-01-11 15:40:51 +01:00
Paper/nms-patches/BlockCommand.patch

28 Zeilen
1.3 KiB
Diff

2015-05-25 20:37:24 +10:00
--- a/net/minecraft/server/BlockCommand.java
+++ b/net/minecraft/server/BlockCommand.java
2017-05-14 12:00:00 +10:00
@@ -4,6 +4,8 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
2016-03-01 08:32:46 +11:00
public class BlockCommand extends BlockTileEntity {
2017-05-14 12:00:00 +10:00
private static final Logger c = LogManager.getLogger();
@@ -30,6 +32,15 @@
TileEntityCommand tileentitycommand = (TileEntityCommand) tileentity;
boolean flag = world.isBlockIndirectlyPowered(blockposition);
2018-07-15 10:00:00 +10:00
boolean flag1 = tileentitycommand.d();
2017-05-14 12:00:00 +10:00
+ // CraftBukkit start
+ org.bukkit.block.Block bukkitBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
+ int old = flag1 ? 15 : 0;
+ int current = flag ? 15 : 0;
2015-02-26 22:41:06 +00:00
+
2017-05-14 12:00:00 +10:00
+ BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(bukkitBlock, old, current);
+ world.getServer().getPluginManager().callEvent(eventRedstone);
+ flag = eventRedstone.getNewCurrent() > 0;
+ // CraftBukkit end
2016-03-01 08:32:46 +11:00
2017-05-14 12:00:00 +10:00
tileentitycommand.a(flag);
2018-07-15 10:00:00 +10:00
if (!flag1 && !tileentitycommand.e() && tileentitycommand.j() != TileEntityCommand.Type.SEQUENCE) {