mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2024-11-14 19:34:58 -05:00
Properly read/write food components (#843)
This commit is contained in:
parent
30309cefe2
commit
ab9bcbe151
1 changed files with 2 additions and 2 deletions
|
@ -233,7 +233,7 @@ public class ItemCodecHelper extends MinecraftCodecHelper {
|
|||
float saturationModifier = buf.readFloat();
|
||||
boolean canAlwaysEat = buf.readBoolean();
|
||||
float eatSeconds = buf.readFloat();
|
||||
ItemStack usingConvertsTo = this.readOptionalItemStack(buf);
|
||||
ItemStack usingConvertsTo = this.readNullable(buf, this::readOptionalItemStack);
|
||||
|
||||
List<FoodProperties.PossibleEffect> effects = this.readList(buf, (input) -> {
|
||||
MobEffectInstance effect = this.readEffectInstance(input);
|
||||
|
@ -249,7 +249,7 @@ public class ItemCodecHelper extends MinecraftCodecHelper {
|
|||
buf.writeFloat(properties.getSaturationModifier());
|
||||
buf.writeBoolean(properties.isCanAlwaysEat());
|
||||
buf.writeFloat(properties.getEatSeconds());
|
||||
this.writeOptionalItemStack(buf, properties.getUsingConvertsTo());
|
||||
this.writeNullable(buf, properties.getUsingConvertsTo(), this::writeOptionalItemStack);
|
||||
|
||||
this.writeList(buf, properties.getEffects(), (output, effect) -> {
|
||||
this.writeEffectInstance(output, effect.getEffect());
|
||||
|
|
Loading…
Reference in a new issue