PaperMC/paper-server/nms-patches/net/minecraft/world/level/block/BlockDispenser.patch
CraftBukkit/Spigot 65bc2541a3 Update to Minecraft 1.20.5
By: md_5 <git@md-5.net>
2024-04-24 01:15:00 +10:00

27 lines
1.5 KiB
Diff

--- a/net/minecraft/world/level/block/BlockDispenser.java
+++ b/net/minecraft/world/level/block/BlockDispenser.java
@@ -51,6 +51,7 @@
object2objectopenhashmap.defaultReturnValue(BlockDispenser.DEFAULT_BEHAVIOR);
});
private static final int TRIGGER_DURATION = 4;
+ public static boolean eventFired = false; // CraftBukkit
@Override
public MapCodec<? extends BlockDispenser> codec() {
@@ -91,7 +92,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);
@@ -107,6 +108,7 @@
IDispenseBehavior idispensebehavior = this.getDispenseMethod(worldserver, itemstack);
if (idispensebehavior != IDispenseBehavior.NOOP) {
+ eventFired = false; // CraftBukkit - reset event status
tileentitydispenser.setItem(i, idispensebehavior.dispense(sourceblock, itemstack));
}