mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Fix campfire recipes not always outputting full result (#8754)
This commit is contained in:
parent
addfcd57a1
commit
5e518056e2
1 changed files with 9 additions and 5 deletions
|
@ -4,6 +4,7 @@ Date: Sat, 3 Oct 2020 20:32:25 -0500
|
||||||
Subject: [PATCH] Fix item locations dropped from campfires
|
Subject: [PATCH] Fix item locations dropped from campfires
|
||||||
|
|
||||||
Fixes #4259 by not flooring the blockposition among other weirdness
|
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
|
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
@ -14,11 +15,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
itemstack1 = CraftItemStack.asNMSCopy(result);
|
itemstack1 = CraftItemStack.asNMSCopy(result);
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
- Containers.dropItemStack(world, (double) pos.getX(), (double) pos.getY(), (double) pos.getZ(), itemstack1);
|
- Containers.dropItemStack(world, (double) pos.getX(), (double) pos.getY(), (double) pos.getZ(), itemstack1);
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ 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));
|
+ double deviation = 0.05F * RandomSource.GAUSSIAN_SPREAD_FACTOR;
|
||||||
+ droppedItem.setDeltaMovement(world.random.nextGaussian() * 0.05D, world.random.nextGaussian() * 0.05D + 0.2D, world.random.nextGaussian() * 0.05D);
|
+ while (!itemstack1.isEmpty()) {
|
||||||
+ world.addFreshEntity(droppedItem);
|
+ 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));
|
||||||
+ // Paper end
|
+ 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
|
||||||
campfire.items.set(i, ItemStack.EMPTY);
|
campfire.items.set(i, ItemStack.EMPTY);
|
||||||
world.sendBlockUpdated(pos, state, state, 3);
|
world.sendBlockUpdated(pos, state, state, 3);
|
||||||
world.gameEvent(GameEvent.BLOCK_CHANGE, pos, GameEvent.Context.of(state));
|
world.gameEvent(GameEvent.BLOCK_CHANGE, pos, GameEvent.Context.of(state));
|
||||||
|
|
Loading…
Reference in a new issue