mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 18:27:41 +01:00
8a3c8cfcd4
By: md_5 <git@md-5.net>
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
|
|
@@ -48,6 +48,7 @@
|
|
object2objectopenhashmap.defaultReturnValue(new DispenseBehaviorItem());
|
|
});
|
|
private static final int TRIGGER_DURATION = 4;
|
|
+ public static boolean eventFired = false; // CraftBukkit
|
|
|
|
public static void registerBehavior(IMaterial imaterial, IDispenseBehavior idispensebehavior) {
|
|
BlockDispenser.DISPENSER_REGISTRY.put(imaterial.asItem(), idispensebehavior);
|
|
@@ -79,7 +80,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);
|
|
@@ -95,6 +96,7 @@
|
|
IDispenseBehavior idispensebehavior = this.getDispenseMethod(itemstack);
|
|
|
|
if (idispensebehavior != IDispenseBehavior.NOOP) {
|
|
+ eventFired = false; // CraftBukkit - reset event status
|
|
tileentitydispenser.setItem(i, idispensebehavior.dispense(sourceblock, itemstack));
|
|
}
|
|
|