mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
32 lines
2.2 KiB
Diff
32 lines
2.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
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
|
|
|
|
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
|
|
--- a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java
|
|
@@ -0,0 +0,0 @@ import net.minecraft.world.Clearable;
|
|
import net.minecraft.world.ContainerHelper;
|
|
import net.minecraft.world.Containers;
|
|
import net.minecraft.world.SimpleContainer;
|
|
+import net.minecraft.world.entity.item.ItemEntity;
|
|
import net.minecraft.world.item.ItemStack;
|
|
import net.minecraft.world.item.crafting.CampfireCookingRecipe;
|
|
import net.minecraft.world.item.crafting.RecipeType;
|
|
@@ -0,0 +0,0 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable, Ticka
|
|
result = blockCookEvent.getResult();
|
|
itemstack1 = CraftItemStack.asNMSCopy(result);
|
|
// CraftBukkit end
|
|
- Containers.dropItemStack(this.level, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), itemstack1);
|
|
+ // Paper start
|
|
+ ItemEntity droppedItem = new ItemEntity(this.level, blockposition.getX() + 0.5D, blockposition.getY() + 0.5D, blockposition.getZ() + 0.5D, itemstack1.split(this.level.random.nextInt(21) + 10));
|
|
+ droppedItem.setDeltaMovement(this.level.random.nextGaussian() * 0.05D, this.level.random.nextGaussian() * 0.05D + 0.2D, this.level.random.nextGaussian() * 0.05D);
|
|
+ this.level.addFreshEntity(droppedItem);
|
|
+ // Paper end
|
|
this.items.set(i, ItemStack.EMPTY);
|
|
this.markUpdated();
|
|
}
|