mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 08:17:44 +01:00
#1379: Rename FoodMeta#get/setSaturationModifier() to #get/setSaturation()
By: 2008Choco <hawkeboyz2@hotmail.com>
This commit is contained in:
parent
85591014c5
commit
f7de208151
@ -30,7 +30,7 @@ public final class CraftFoodComponent implements FoodComponent {
|
|||||||
|
|
||||||
public CraftFoodComponent(Map<String, Object> map) {
|
public CraftFoodComponent(Map<String, Object> map) {
|
||||||
Integer nutrition = SerializableMeta.getObject(Integer.class, map, "nutrition", false);
|
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");
|
Boolean canAlwaysEat = SerializableMeta.getBoolean(map, "can-always-eat");
|
||||||
|
|
||||||
Float eatSeconds = SerializableMeta.getObject(Float.class, map, "eat-seconds", true);
|
Float eatSeconds = SerializableMeta.getObject(Float.class, map, "eat-seconds", true);
|
||||||
@ -54,7 +54,7 @@ public final class CraftFoodComponent implements FoodComponent {
|
|||||||
public Map<String, Object> serialize() {
|
public Map<String, Object> serialize() {
|
||||||
Map<String, Object> result = new LinkedHashMap<>();
|
Map<String, Object> result = new LinkedHashMap<>();
|
||||||
result.put("nutrition", getNutrition());
|
result.put("nutrition", getNutrition());
|
||||||
result.put("saturation-modifier", getSaturationModifier());
|
result.put("saturation", getSaturation());
|
||||||
result.put("can-always-eat", canAlwaysEat());
|
result.put("can-always-eat", canAlwaysEat());
|
||||||
result.put("eat-seconds", getEatSeconds());
|
result.put("eat-seconds", getEatSeconds());
|
||||||
result.put("effects", getEffects());
|
result.put("effects", getEffects());
|
||||||
@ -77,13 +77,13 @@ public final class CraftFoodComponent implements FoodComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getSaturationModifier() {
|
public float getSaturation() {
|
||||||
return handle.saturation();
|
return handle.saturation();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSaturationModifier(float saturationModifier) {
|
public void setSaturation(float saturation) {
|
||||||
handle = new FoodInfo(handle.nutrition(), saturationModifier, handle.canAlwaysEat(), handle.eatSeconds(), handle.effects());
|
handle = new FoodInfo(handle.nutrition(), saturation, handle.canAlwaysEat(), handle.eatSeconds(), handle.effects());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user