PaperMC/paper-server/nms-patches/net/minecraft/world/level/block/BlockDispenser.patch
CraftBukkit/Spigot b3a8254758 Update to Minecraft 1.17
By: md_5 <git@md-5.net>
2021-06-11 15:00:00 +10:00

23 lines
1.4 KiB
Diff

--- a/net/minecraft/world/level/block/BlockDispenser.java
+++ b/net/minecraft/world/level/block/BlockDispenser.java
@@ -41,10 +41,11 @@
public static final BlockStateDirection FACING = BlockDirectional.FACING;
public static final BlockStateBoolean TRIGGERED = BlockProperties.TRIGGERED;
- public static final Map<Item, IDispenseBehavior> DISPENSER_REGISTRY = (Map) SystemUtils.a((Object) (new Object2ObjectOpenHashMap()), (object2objectopenhashmap) -> {
+ public static final Map<Item, IDispenseBehavior> DISPENSER_REGISTRY = (Map) SystemUtils.a((new Object2ObjectOpenHashMap()), (object2objectopenhashmap) -> { // CraftBukkit - decompile error
object2objectopenhashmap.defaultReturnValue(new DispenseBehaviorItem());
});
private static final int TRIGGER_DURATION = 4;
+ public static boolean eventFired = false; // CraftBukkit
public static void a(IMaterial imaterial, IDispenseBehavior idispensebehavior) {
BlockDispenser.DISPENSER_REGISTRY.put(imaterial.getItem(), idispensebehavior);
@@ -88,6 +89,7 @@
IDispenseBehavior idispensebehavior = this.a(itemstack);
if (idispensebehavior != IDispenseBehavior.NOOP) {
+ eventFired = false; // CraftBukkit - reset event status
tileentitydispenser.setItem(i, idispensebehavior.dispense(sourceblock, itemstack));
}