From f7de208151de293b0f82c8f7a5aa2e81048931c0 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Wed, 24 Apr 2024 02:32:48 +1000 Subject: [PATCH] #1379: Rename FoodMeta#get/setSaturationModifier() to #get/setSaturation() By: 2008Choco --- .../inventory/components/CraftFoodComponent.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftFoodComponent.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftFoodComponent.java index b54993dfd5..d30703aa35 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftFoodComponent.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftFoodComponent.java @@ -30,7 +30,7 @@ public final class CraftFoodComponent implements FoodComponent { public CraftFoodComponent(Map map) { Integer nutrition = SerializableMeta.getObject(Integer.class, map, "nutrition", false); - Float saturationModifier = SerializableMeta.getObject(Float.class, map, "saturation-modifier", false); + Float saturationModifier = SerializableMeta.getObject(Float.class, map, "saturation", false); Boolean canAlwaysEat = SerializableMeta.getBoolean(map, "can-always-eat"); Float eatSeconds = SerializableMeta.getObject(Float.class, map, "eat-seconds", true); @@ -54,7 +54,7 @@ public final class CraftFoodComponent implements FoodComponent { public Map serialize() { Map result = new LinkedHashMap<>(); result.put("nutrition", getNutrition()); - result.put("saturation-modifier", getSaturationModifier()); + result.put("saturation", getSaturation()); result.put("can-always-eat", canAlwaysEat()); result.put("eat-seconds", getEatSeconds()); result.put("effects", getEffects()); @@ -77,13 +77,13 @@ public final class CraftFoodComponent implements FoodComponent { } @Override - public float getSaturationModifier() { + public float getSaturation() { return handle.saturation(); } @Override - public void setSaturationModifier(float saturationModifier) { - handle = new FoodInfo(handle.nutrition(), saturationModifier, handle.canAlwaysEat(), handle.eatSeconds(), handle.effects()); + public void setSaturation(float saturation) { + handle = new FoodInfo(handle.nutrition(), saturation, handle.canAlwaysEat(), handle.eatSeconds(), handle.effects()); } @Override