mirror of
https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git
synced 2024-11-25 15:06:14 +00:00
28 lines
1.5 KiB
Diff
28 lines
1.5 KiB
Diff
--- a/net/minecraft/world/level/block/BlockDispenser.java
|
|
+++ b/net/minecraft/world/level/block/BlockDispenser.java
|
|
@@ -52,6 +52,7 @@
|
|
private static final DispenseBehaviorItem DEFAULT_BEHAVIOR = new DispenseBehaviorItem();
|
|
public static final Map<Item, IDispenseBehavior> DISPENSER_REGISTRY = new IdentityHashMap();
|
|
private static final int TRIGGER_DURATION = 4;
|
|
+ public static boolean eventFired = false; // CraftBukkit
|
|
|
|
@Override
|
|
public MapCodec<? extends BlockDispenser> codec() {
|
|
@@ -88,7 +89,7 @@
|
|
}
|
|
|
|
public void dispenseFrom(WorldServer worldserver, IBlockData iblockdata, BlockPosition blockposition) {
|
|
- TileEntityDispenser tileentitydispenser = (TileEntityDispenser) worldserver.getBlockEntity(blockposition, TileEntityTypes.DISPENSER).orElse((Object) null);
|
|
+ TileEntityDispenser tileentitydispenser = (TileEntityDispenser) worldserver.getBlockEntity(blockposition, TileEntityTypes.DISPENSER).orElse(null); // CraftBukkit - decompile error
|
|
|
|
if (tileentitydispenser == null) {
|
|
BlockDispenser.LOGGER.warn("Ignoring dispensing attempt for Dispenser without matching block entity at {}", blockposition);
|
|
@@ -104,6 +105,7 @@
|
|
IDispenseBehavior idispensebehavior = this.getDispenseMethod(worldserver, itemstack);
|
|
|
|
if (idispensebehavior != IDispenseBehavior.NOOP) {
|
|
+ eventFired = false; // CraftBukkit - reset event status
|
|
tileentitydispenser.setItem(i, idispensebehavior.dispense(sourceblock, itemstack));
|
|
}
|
|
|