diff options
author | MiniDigger | Martin <[email protected]> | 2024-01-14 11:04:49 +0100 |
---|---|---|
committer | MiniDigger | Martin <[email protected]> | 2024-01-14 11:04:49 +0100 |
commit | bee74680e607c2e29b038329f62181238911cd83 (patch) | |
tree | 708fd1a4a0227d9071243adf2a42d5e9e96cde4a /patch-remap/og/net/minecraft/world/level/block/BlockLever.patch | |
parent | 0a44692ef6ff6e255d48eb3ba1bb114166eafda9 (diff) | |
download | Paper-softspoon.tar.gz Paper-softspoon.zip |
add remapped patches as a testsoftspoon
Diffstat (limited to 'patch-remap/og/net/minecraft/world/level/block/BlockLever.patch')
-rw-r--r-- | patch-remap/og/net/minecraft/world/level/block/BlockLever.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/level/block/BlockLever.patch b/patch-remap/og/net/minecraft/world/level/block/BlockLever.patch new file mode 100644 index 0000000000..35959fa06a --- /dev/null +++ b/patch-remap/og/net/minecraft/world/level/block/BlockLever.patch @@ -0,0 +1,32 @@ +--- a/net/minecraft/world/level/block/BlockLever.java ++++ b/net/minecraft/world/level/block/BlockLever.java +@@ -28,6 +28,8 @@ + import net.minecraft.world.phys.shapes.VoxelShape; + import net.minecraft.world.phys.shapes.VoxelShapeCollision; + ++import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit ++ + public class BlockLever extends BlockAttachable { + + public static final MapCodec<BlockLever> CODEC = simpleCodec(BlockLever::new); +@@ -101,6 +103,20 @@ + + return EnumInteractionResult.SUCCESS; + } else { ++ // CraftBukkit start - Interact Lever ++ boolean powered = iblockdata.getValue(BlockLever.POWERED); // Old powered state ++ org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); ++ int old = (powered) ? 15 : 0; ++ int current = (!powered) ? 15 : 0; ++ ++ BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, old, current); ++ world.getCraftServer().getPluginManager().callEvent(eventRedstone); ++ ++ if ((eventRedstone.getNewCurrent() > 0) != (!powered)) { ++ return EnumInteractionResult.SUCCESS; ++ } ++ // CraftBukkit end ++ + iblockdata1 = this.pull(iblockdata, world, blockposition); + float f = (Boolean) iblockdata1.getValue(BlockLever.POWERED) ? 0.6F : 0.5F; + |