Reset food level on spawning

This commit is contained in:
tanyaofei 2024-12-04 15:49:50 +08:00
parent b472fe2938
commit b1a75c5fe2

View File

@ -168,6 +168,7 @@ public class Fakeplayer {
this.player.setHealth(Optional.ofNullable(this.player.getAttribute(Attribute.GENERIC_MAX_HEALTH)) this.player.setHealth(Optional.ofNullable(this.player.getAttribute(Attribute.GENERIC_MAX_HEALTH))
.map(AttributeInstance::getValue) .map(AttributeInstance::getValue)
.orElse(20D)); // 恢复生命值 .orElse(20D)); // 恢复生命值
this.player.setFoodLevel(20);
this.setupName(); this.setupName();
this.handle.setupClientOptions(); // 处理皮肤设置问题 this.handle.setupClientOptions(); // 处理皮肤设置问题