mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 19:34:09 +01:00
23 lines
1.2 KiB
Diff
23 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));
|
||
|
}
|
||
|
|