Dateien nach "MAIN/nms-patches/1.12.2" hochladen
This commit is contained in:
31
MAIN/nms-patches/1.12.2/BlockRedstoneComparator.patch
Normal file
31
MAIN/nms-patches/1.12.2/BlockRedstoneComparator.patch
Normal file
@@ -0,0 +1,31 @@
|
||||
--- a/minecraft/server/BlockRedstoneComparator.java
|
||||
+++ b/minecraft/server/BlockRedstoneComparator.java
|
||||
@@ -5,6 +5,8 @@
|
||||
import java.util.Random;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
||||
+
|
||||
public class BlockRedstoneComparator extends BlockDiodeAbstract implements ITileEntity {
|
||||
|
||||
public static final BlockStateBoolean POWERED = BlockStateBoolean.of("powered");
|
||||
@@ -164,8 +166,18 @@
|
||||
boolean flag1 = this.A(iblockdata);
|
||||
|
||||
if (flag1 && !flag) {
|
||||
+ // CraftBukkit start
|
||||
+ if (CraftEventFactory.callRedstoneChange(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), 15, 0).getNewCurrent() != 0) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
world.setTypeAndData(blockposition, iblockdata.set(BlockRedstoneComparator.POWERED, Boolean.valueOf(false)), 2);
|
||||
} else if (!flag1 && flag) {
|
||||
+ // CraftBukkit start
|
||||
+ if (CraftEventFactory.callRedstoneChange(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), 0, 15).getNewCurrent() != 15) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
world.setTypeAndData(blockposition, iblockdata.set(BlockRedstoneComparator.POWERED, Boolean.valueOf(true)), 2);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user