Paper/nms-patches/BlockDispenser.patch

23 lines
1.2 KiB
Diff
Raw Normal View History

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/BlockDispenser.java
+++ b/net/minecraft/server/BlockDispenser.java
2018-08-26 04:00:00 +02:00
@@ -9,9 +9,10 @@
2018-07-15 02:00:00 +02:00
public static final BlockStateDirection FACING = BlockDirectional.FACING;
public static final BlockStateBoolean TRIGGERED = BlockProperties.w;
2018-08-26 04:00:00 +02:00
- public static final Map<Item, IDispenseBehavior> REGISTRY = (Map) SystemUtils.a((Object) (new Object2ObjectOpenHashMap()), (object2objectopenhashmap) -> {
+ public static final Map<Item, IDispenseBehavior> REGISTRY = (Map) SystemUtils.a((new Object2ObjectOpenHashMap()), (object2objectopenhashmap) -> { // CraftBukkit - decompile error
object2objectopenhashmap.defaultReturnValue(new DispenseBehaviorItem());
});
+ public static boolean eventFired = false; // CraftBukkit
2018-07-15 02:00:00 +02:00
public static void a(IMaterial imaterial, IDispenseBehavior idispensebehavior) {
2018-08-26 04:00:00 +02:00
BlockDispenser.REGISTRY.put(imaterial.getItem(), idispensebehavior);
@@ -57,6 +58,7 @@
2018-07-15 02:00:00 +02:00
IDispenseBehavior idispensebehavior = this.a(itemstack);
2018-07-15 02:00:00 +02:00
if (idispensebehavior != IDispenseBehavior.NONE) {
+ eventFired = false; // CraftBukkit - reset event status
tileentitydispenser.setItem(i, idispensebehavior.dispense(sourceblock, itemstack));
}
2016-11-17 02:41:03 +01:00