2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/BlockLever.java
|
|
|
|
+++ b/net/minecraft/server/BlockLever.java
|
2018-07-15 02:00:00 +02:00
|
|
|
@@ -1,5 +1,7 @@
|
|
|
|
package net.minecraft.server;
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
|
|
|
|
+
|
2018-07-15 02:00:00 +02:00
|
|
|
public class BlockLever extends BlockAttachable {
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
public static final BlockStateBoolean POWERED = BlockProperties.w;
|
|
|
|
@@ -64,6 +66,20 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
+ // CraftBukkit start - Interact Lever
|
2018-11-27 23:09:56 +01:00
|
|
|
+ boolean powered = !flag; // Old powered state
|
2014-11-25 22:32:16 +01:00
|
|
|
+ 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.getServer().getPluginManager().callEvent(eventRedstone);
|
|
|
|
+
|
|
|
|
+ if ((eventRedstone.getNewCurrent() > 0) != (!powered)) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2016-02-29 22:32:46 +01:00
|
|
|
+
|
2014-11-25 22:32:16 +01:00
|
|
|
world.setTypeAndData(blockposition, iblockdata, 3);
|
2019-04-23 04:00:00 +02:00
|
|
|
float f = flag ? 0.6F : 0.5F;
|
2018-07-15 02:00:00 +02:00
|
|
|
|