aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/DispenserBlock.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/DispenserBlock.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/DispenserBlock.java.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/DispenserBlock.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/DispenserBlock.java.patch
new file mode 100644
index 0000000000..e4f1362f72
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/DispenserBlock.java.patch
@@ -0,0 +1,27 @@
+--- a/net/minecraft/world/level/block/DispenserBlock.java
++++ b/net/minecraft/world/level/block/DispenserBlock.java
+@@ -48,6 +49,7 @@
+ new Object2ObjectOpenHashMap<>(), map -> map.defaultReturnValue(new DefaultDispenseItemBehavior())
+ );
+ private static final int TRIGGER_DURATION = 4;
++ public static boolean eventFired = false; // CraftBukkit
+
+ @Override
+ public MapCodec<? extends DispenserBlock> codec() {
+@@ -93,10 +98,12 @@
+ serverLevel.levelEvent(1001, blockPos, 0);
+ serverLevel.gameEvent(GameEvent.BLOCK_ACTIVATE, blockPos, GameEvent.Context.of(dispenserBlockEntity.getBlockState()));
+ } else {
+- ItemStack item = dispenserBlockEntity.getItem(randomSlot);
+- DispenseItemBehavior dispenseMethod = this.getDispenseMethod(item);
+- if (dispenseMethod != DispenseItemBehavior.NOOP) {
+- dispenserBlockEntity.setItem(randomSlot, dispenseMethod.dispense(blockSource, item));
++ ItemStack itemstack = tileentitydispenser.getItem(i);
++ DispenseItemBehavior idispensebehavior = this.getDispenseMethod(itemstack);
++
++ if (idispensebehavior != DispenseItemBehavior.NOOP) {
++ eventFired = false; // CraftBukkit - reset event status
++ tileentitydispenser.setItem(i, idispensebehavior.dispense(sourceblock, itemstack));
+ }
+ }
+ }