aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/1045-General-ItemMeta-fixes.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/1045-General-ItemMeta-fixes.patch')
-rw-r--r--patches/server/1045-General-ItemMeta-fixes.patch12
1 files changed, 12 insertions, 0 deletions
diff --git a/patches/server/1045-General-ItemMeta-fixes.patch b/patches/server/1045-General-ItemMeta-fixes.patch
index 65b160a69b..431872ab6c 100644
--- a/patches/server/1045-General-ItemMeta-fixes.patch
+++ b/patches/server/1045-General-ItemMeta-fixes.patch
@@ -251,6 +251,18 @@ index 05a4a06c0def28fc97e61b4712c45c8730fec60c..a86eb660d8f523cb99a0b668ef113053
+ }
+ // Paper end - General ItemMeta Fixes
}
+diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftFoodComponent.java b/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftFoodComponent.java
+index c68e85cca0f532a94545c0b7f6ed54451ce5a47e..eb08b3453738bffd1a6350dc56c18b9740be5a01 100644
+--- a/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftFoodComponent.java
++++ b/src/main/java/org/bukkit/craftbukkit/inventory/components/CraftFoodComponent.java
+@@ -103,6 +103,7 @@ public final class CraftFoodComponent implements FoodComponent {
+
+ @Override
+ public void setEatSeconds(float eatSeconds) {
++ Preconditions.checkArgument(eatSeconds > 0, "Eat seconds must be positive"); // Paper - validate eat_seconds
+ this.handle = new FoodProperties(this.handle.nutrition(), this.handle.saturation(), this.handle.canAlwaysEat(), eatSeconds, this.handle.effects());
+ }
+
diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/DeprecatedItemMetaCustomValueTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/DeprecatedItemMetaCustomValueTest.java
index 0b11d5ea89539decd2f6c60c5b581bbd78ff1fd6..74ebadacbbd11b5a0d8f8c6cd6409cce17cfa37d 100644
--- a/src/test/java/org/bukkit/craftbukkit/inventory/DeprecatedItemMetaCustomValueTest.java