PaperMC/nms-patches/BlockDispenser.patch
2015-03-04 09:48:58 +00:00

27 lines
1.3 KiB
Diff

--- /home/matt/mc-dev-private//net/minecraft/server/BlockDispenser.java 2015-02-26 22:40:22.103608145 +0000
+++ src/main/java/net/minecraft/server/BlockDispenser.java 2015-02-26 22:40:22.103608145 +0000
@@ -8,6 +8,7 @@
public static final BlockStateBoolean TRIGGERED = BlockStateBoolean.of("triggered");
public static final RegistryDefault<Item, IDispenseBehavior> N = new RegistryDefault(new DispenseBehaviorItem());
protected Random O = new Random();
+ public static boolean eventFired = false; // CraftBukkit
protected BlockDispenser() {
super(Material.STONE);
@@ -68,7 +69,7 @@
}
}
- protected void dispense(World world, BlockPosition blockposition) {
+ public void dispense(World world, BlockPosition blockposition) { // CraftBukkit - public
SourceBlock sourceblock = new SourceBlock(world, blockposition);
TileEntityDispenser tileentitydispenser = (TileEntityDispenser) sourceblock.getTileEntity();
@@ -83,6 +84,7 @@
if (idispensebehavior != IDispenseBehavior.a) {
ItemStack itemstack1 = idispensebehavior.a(sourceblock, itemstack);
+ eventFired = false; // CraftBukkit - reset event status
tileentitydispenser.setItem(i, itemstack1.count == 0 ? null : itemstack1);
}