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-12-25 22:00:00 +01:00
@@ -8,9 +8,10 @@
2018-08-26 04:00:00 +02:00
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);
2018-12-25 22:00:00 +01:00
@@ -56,6 +57,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