3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-24 15:20:11 +01:00
Paper/nms-patches/BlockRedstoneLamp.patch

36 Zeilen
1.5 KiB
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/BlockRedstoneLamp.java
+++ b/net/minecraft/server/BlockRedstoneLamp.java
2018-07-15 02:00:00 +02:00
@@ -3,6 +3,8 @@
import java.util.Random;
2018-07-15 02:00:00 +02:00
import javax.annotation.Nullable;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockRedstoneLamp extends Block {
2018-07-15 02:00:00 +02:00
public static final BlockStateBoolean a = BlockRedstoneTorch.LIT;
2019-04-23 04:00:00 +02:00
@@ -37,6 +39,11 @@
if (flag1) {
2018-12-13 01:00:00 +01:00
world.getBlockTickList().a(blockposition, this, 4);
2018-07-15 02:00:00 +02:00
} else {
+ // CraftBukkit start
+ if (CraftEventFactory.callRedstoneChange(world, blockposition, 0, 15).getNewCurrent() != 15) {
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.a((IBlockState) BlockRedstoneLamp.a), 2);
}
}
2019-04-23 04:00:00 +02:00
@@ -48,6 +55,11 @@
public void tick(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
2015-02-26 23:41:06 +01:00
if (!world.isClientSide) {
2018-12-06 00:00:00 +01:00
if ((Boolean) iblockdata.get(BlockRedstoneLamp.a) && !world.isBlockIndirectlyPowered(blockposition)) {
2015-02-26 23:41:06 +01:00
+ // CraftBukkit start
2018-07-15 02:00:00 +02:00
+ if (CraftEventFactory.callRedstoneChange(world, blockposition, 15, 0).getNewCurrent() != 0) {
2015-02-26 23:41:06 +01:00
+ return;
+ }
+ // CraftBukkit end
2018-07-15 02:00:00 +02:00
world.setTypeAndData(blockposition, (IBlockData) iblockdata.a((IBlockState) BlockRedstoneLamp.a), 2);
}