aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/RedstoneLampBlock.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/RedstoneLampBlock.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/RedstoneLampBlock.java.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/RedstoneLampBlock.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/RedstoneLampBlock.java.patch
new file mode 100644
index 0000000000..0e78eed83b
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/RedstoneLampBlock.java.patch
@@ -0,0 +1,43 @@
+--- a/net/minecraft/world/level/block/RedstoneLampBlock.java
++++ b/net/minecraft/world/level/block/RedstoneLampBlock.java
+@@ -11,6 +11,7 @@
+ import net.minecraft.world.level.block.state.BlockState;
+ import net.minecraft.world.level.block.state.StateDefinition;
+ import net.minecraft.world.level.block.state.properties.BooleanProperty;
++import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
+ public class RedstoneLampBlock extends Block {
+
+@@ -45,7 +43,12 @@
+ if (flag1) {
+ level.scheduleTick(blockpos, (Block) this, 4);
+ } else {
+- level.setBlock(blockpos, (BlockState) blockstate.cycle(RedstoneLampBlock.LIT), 2);
++ // CraftBukkit start
++ if (CraftEventFactory.callRedstoneChange(level, pos, 0, 15).getNewCurrent() != 15) {
++ return;
++ }
++ // CraftBukkit end
++ level.setBlock(pos, (IBlockData) state.cycle(RedstoneLampBlock.LIT), 2);
+ }
+ }
+
+@@ -53,10 +56,14 @@
+ }
+
+ @Override
+- @Override
+- public void tick(BlockState blockstate, ServerLevel serverlevel, BlockPos blockpos, RandomSource randomsource) {
+- if ((Boolean) blockstate.getValue(RedstoneLampBlock.LIT) && !serverlevel.hasNeighborSignal(blockpos)) {
+- serverlevel.setBlock(blockpos, (BlockState) blockstate.cycle(RedstoneLampBlock.LIT), 2);
++ public void tick(IBlockData state, ServerLevel level, BlockPos pos, RandomSource random) {
++ if ((Boolean) state.getValue(RedstoneLampBlock.LIT) && !level.hasNeighborSignal(pos)) {
++ // CraftBukkit start
++ if (CraftEventFactory.callRedstoneChange(level, pos, 15, 0).getNewCurrent() != 0) {
++ return;
++ }
++ // CraftBukkit end
++ level.setBlock(pos, (IBlockData) state.cycle(RedstoneLampBlock.LIT), 2);
+ }
+
+ }