2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/level/block/BlockDispenser.java
|
|
|
|
+++ b/net/minecraft/world/level/block/BlockDispenser.java
|
2023-12-05 17:40:00 +01:00
|
|
|
@@ -49,6 +49,7 @@
|
2018-08-26 04:00:00 +02:00
|
|
|
object2objectopenhashmap.defaultReturnValue(new DispenseBehaviorItem());
|
|
|
|
});
|
2021-06-11 07:00:00 +02:00
|
|
|
private static final int TRIGGER_DURATION = 4;
|
2014-11-25 22:32:16 +01:00
|
|
|
+ public static boolean eventFired = false; // CraftBukkit
|
|
|
|
|
2023-12-05 17:40:00 +01:00
|
|
|
@Override
|
|
|
|
public MapCodec<? extends BlockDispenser> codec() {
|
|
|
|
@@ -85,7 +86,7 @@
|
2023-09-21 18:40:00 +02:00
|
|
|
}
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2023-09-21 18:40:00 +02:00
|
|
|
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);
|
2023-12-05 17:40:00 +01:00
|
|
|
@@ -101,6 +102,7 @@
|
2023-09-21 18:40:00 +02:00
|
|
|
IDispenseBehavior idispensebehavior = this.getDispenseMethod(itemstack);
|
|
|
|
|
|
|
|
if (idispensebehavior != IDispenseBehavior.NOOP) {
|
|
|
|
+ eventFired = false; // CraftBukkit - reset event status
|
|
|
|
tileentitydispenser.setItem(i, idispensebehavior.dispense(sourceblock, itemstack));
|
|
|
|
}
|
2016-11-17 02:41:03 +01:00
|
|
|
|