Remove extra shrink in ProjectileDispenseBehavior

This commit is contained in:
Nassim Jahnke 2024-12-15 16:58:28 +01:00
parent da1947b2ad
commit a67d7adcc9
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java
+++ b/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java
@@ -27,16 +_,39 @@
@@ -27,17 +_,39 @@
ServerLevel serverLevel = blockSource.level();
Direction direction = blockSource.state().getValue(DispenserBlock.FACING);
Position dispensePosition = this.dispenseConfig.positionFunction().getDispensePosition(blockSource, direction);
@ -14,6 +14,7 @@
- this.dispenseConfig.power(),
- this.dispenseConfig.uncertainty()
- );
- item.shrink(1);
+ ItemStack itemstack1 = item.copyWithCount(1); // Paper - shrink below and single item in event
+ org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(serverLevel, blockSource.pos());
+ org.bukkit.craftbukkit.inventory.CraftItemStack craftItem = org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack1);
@ -47,6 +48,6 @@
+ }
+ if (shrink) item.shrink(1); // Paper - actually handle here
+ // CraftBukkit end
item.shrink(1);
return item;
}