From 99fa9a7c1d93f3f930cee37ca6a5a3b356cd996b Mon Sep 17 00:00:00 2001 From: SuperGamerTron Date: Tue, 26 Nov 2024 01:24:34 -0700 Subject: [PATCH] Fix FoodsDataGenerator for 1.20.5+ --- .../minecraftdatagenerator/generators/FoodsDataGenerator.java | 4 ++-- .../minecraftdatagenerator/generators/FoodsDataGenerator.java | 4 ++-- .../minecraftdatagenerator/generators/FoodsDataGenerator.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mc/1.20.5/src/main/java/dev/u9g/minecraftdatagenerator/generators/FoodsDataGenerator.java b/mc/1.20.5/src/main/java/dev/u9g/minecraftdatagenerator/generators/FoodsDataGenerator.java index ddb61fe9..d07b6564 100644 --- a/mc/1.20.5/src/main/java/dev/u9g/minecraftdatagenerator/generators/FoodsDataGenerator.java +++ b/mc/1.20.5/src/main/java/dev/u9g/minecraftdatagenerator/generators/FoodsDataGenerator.java @@ -25,8 +25,8 @@ public static JsonObject generateFoodDescriptor(Registry registry, Item fo FoodComponent foodComponent = Objects.requireNonNull(foodItem.getComponents().get(DataComponentTypes.FOOD)); float foodPoints = foodComponent.nutrition(); - float saturationRatio = foodComponent.saturation() * 2.0F; - float saturation = foodPoints * saturationRatio; + float saturation = foodComponent.saturation(); + float saturationRatio = saturation / foodPoints; foodDesc.addProperty("foodPoints", foodPoints); foodDesc.addProperty("saturation", saturation); diff --git a/mc/1.21.3/src/main/java/dev/u9g/minecraftdatagenerator/generators/FoodsDataGenerator.java b/mc/1.21.3/src/main/java/dev/u9g/minecraftdatagenerator/generators/FoodsDataGenerator.java index 9d2080f7..bd73d5cb 100644 --- a/mc/1.21.3/src/main/java/dev/u9g/minecraftdatagenerator/generators/FoodsDataGenerator.java +++ b/mc/1.21.3/src/main/java/dev/u9g/minecraftdatagenerator/generators/FoodsDataGenerator.java @@ -25,8 +25,8 @@ public static JsonObject generateFoodDescriptor(Registry registry, Item fo FoodComponent foodComponent = Objects.requireNonNull(foodItem.getComponents().get(DataComponentTypes.FOOD)); float foodPoints = foodComponent.nutrition(); - float saturationRatio = foodComponent.saturation() * 2.0F; - float saturation = foodPoints * saturationRatio; + float saturation = foodComponent.saturation(); + float saturationRatio = saturation / foodPoints; foodDesc.addProperty("foodPoints", foodPoints); foodDesc.addProperty("saturation", saturation); diff --git a/mc/1.21/src/main/java/dev/u9g/minecraftdatagenerator/generators/FoodsDataGenerator.java b/mc/1.21/src/main/java/dev/u9g/minecraftdatagenerator/generators/FoodsDataGenerator.java index ddb61fe9..d07b6564 100644 --- a/mc/1.21/src/main/java/dev/u9g/minecraftdatagenerator/generators/FoodsDataGenerator.java +++ b/mc/1.21/src/main/java/dev/u9g/minecraftdatagenerator/generators/FoodsDataGenerator.java @@ -25,8 +25,8 @@ public static JsonObject generateFoodDescriptor(Registry registry, Item fo FoodComponent foodComponent = Objects.requireNonNull(foodItem.getComponents().get(DataComponentTypes.FOOD)); float foodPoints = foodComponent.nutrition(); - float saturationRatio = foodComponent.saturation() * 2.0F; - float saturation = foodPoints * saturationRatio; + float saturation = foodComponent.saturation(); + float saturationRatio = saturation / foodPoints; foodDesc.addProperty("foodPoints", foodPoints); foodDesc.addProperty("saturation", saturation);