aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0424-Fix-item-locations-dropped-from-campfires.patch
diff options
context:
space:
mode:
authorSpottedleaf <[email protected]>2024-07-17 10:24:53 -0700
committerSpottedleaf <[email protected]>2024-07-17 10:28:32 -0700
commit00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6 (patch)
tree82639515bc5e9ae00c1e639e72137ed51e1ac688 /patches/server/0424-Fix-item-locations-dropped-from-campfires.patch
parent967f98aa81da851740aeb429778e46159fd188df (diff)
downloadPaper-00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6.tar.gz
Paper-00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6.zip
Remove Moonrise utils to MCUtils, remove duplicated/unused utils
Diffstat (limited to 'patches/server/0424-Fix-item-locations-dropped-from-campfires.patch')
-rw-r--r--patches/server/0424-Fix-item-locations-dropped-from-campfires.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/patches/server/0424-Fix-item-locations-dropped-from-campfires.patch b/patches/server/0424-Fix-item-locations-dropped-from-campfires.patch
new file mode 100644
index 0000000000..26a43eb186
--- /dev/null
+++ b/patches/server/0424-Fix-item-locations-dropped-from-campfires.patch
@@ -0,0 +1,28 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: William Blake Galbreath <[email protected]>
+Date: Sat, 3 Oct 2020 20:32:25 -0500
+Subject: [PATCH] Fix item locations dropped from campfires
+
+Fixes #4259 by not flooring the blockposition among other weirdness
+Vanilla Issue: MC-267622
+
+diff --git a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java
+index 391acc9dadc653e9e1285a71b4f1e7c063e8ca49..80f911692c97585a696a19ebbe616d6aa312b2d9 100644
+--- a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java
++++ b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java
+@@ -86,7 +86,14 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable {
+ result = blockCookEvent.getResult();
+ itemstack1 = CraftItemStack.asNMSCopy(result);
+ // CraftBukkit end
+- Containers.dropItemStack(world, (double) pos.getX(), (double) pos.getY(), (double) pos.getZ(), itemstack1);
++ // Paper start - Fix item locations dropped from campfires
++ double deviation = 0.05F * RandomSource.GAUSSIAN_SPREAD_FACTOR;
++ while (!itemstack1.isEmpty()) {
++ net.minecraft.world.entity.item.ItemEntity droppedItem = new net.minecraft.world.entity.item.ItemEntity(world, pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D, itemstack1.split(world.random.nextInt(21) + 10));
++ droppedItem.setDeltaMovement(world.random.triangle(0.0D, deviation), world.random.triangle(0.2D, deviation), world.random.triangle(0.0D, deviation));
++ world.addFreshEntity(droppedItem);
++ }
++ // Paper end - Fix item locations dropped from campfires
+ campfire.items.set(i, ItemStack.EMPTY);
+ world.sendBlockUpdated(pos, state, state, 3);
+ world.gameEvent((Holder) GameEvent.BLOCK_CHANGE, pos, GameEvent.Context.of(state));