Files
CatServer/patches/net/minecraft/block/BlockTripWireHook.java.patch
2018-09-08 09:15:34 +08:00

29 lines
1016 B
Diff

--- ../src-base/minecraft/net/minecraft/block/BlockTripWireHook.java
+++ ../src-work/minecraft/net/minecraft/block/BlockTripWireHook.java
@@ -3,6 +3,9 @@
import com.google.common.base.Objects;
import java.util.Random;
import javax.annotation.Nullable;
+
+import org.bukkit.event.block.BlockRedstoneEvent;
+
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
@@ -192,6 +195,15 @@
this.playSound(worldIn, blockpos1, flag2, flag3, flag, flag1);
}
+ org.bukkit.block.Block block = worldIn.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ());
+
+ BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, 15, 0);
+ worldIn.getServer().getPluginManager().callEvent(eventRedstone);
+
+ if (eventRedstone.getNewCurrent() > 0) {
+ return;
+ }
+
this.playSound(worldIn, pos, flag2, flag3, flag, flag1);
if (!p_176260_4_)