PaperMC/paper-server/patches/sources/net/minecraft/world/food/FoodInfo.patch
CraftBukkit/Spigot a265d64138 Move CraftBukkit per-file patches
By: Initial <noreply+automated@papermc.io>
2024-12-11 22:26:36 +01:00

22 lines
1.2 KiB
Diff

--- a/net/minecraft/world/food/FoodInfo.java
+++ b/net/minecraft/world/food/FoodInfo.java
@@ -18,6 +18,10 @@
import net.minecraft.world.item.component.ConsumableListener;
import net.minecraft.world.level.World;
+// CraftBukkit start
+import net.minecraft.server.level.EntityPlayer;
+// CraftBukkit end
+
public record FoodInfo(int nutrition, float saturation, boolean canAlwaysEat) implements ConsumableListener {
public static final Codec<FoodInfo> DIRECT_CODEC = RecordCodecBuilder.create((instance) -> {
@@ -31,7 +35,7 @@
world.playSound((EntityHuman) null, entityliving.getX(), entityliving.getY(), entityliving.getZ(), (SoundEffect) consumable.sound().value(), SoundCategory.NEUTRAL, 1.0F, randomsource.triangle(1.0F, 0.4F));
if (entityliving instanceof EntityHuman entityhuman) {
- entityhuman.getFoodData().eat(this);
+ entityhuman.getFoodData().eat(this, itemstack, (EntityPlayer) entityhuman); // CraftBukkit
world.playSound((EntityHuman) null, entityhuman.getX(), entityhuman.getY(), entityhuman.getZ(), SoundEffects.PLAYER_BURP, SoundCategory.PLAYERS, 0.5F, MathHelper.randomBetween(randomsource, 0.9F, 1.0F));
}