From 4b46a36a945693051b47be34d5e65c28ec6831bd Mon Sep 17 00:00:00 2001 From: Warrior <50800980+Warriorrrr@users.noreply.github.com> Date: Fri, 18 Aug 2023 08:07:38 +0200 Subject: [PATCH] Limit setBurnTime to valid short values --- .../java/org/bukkit/event/inventory/FurnaceBurnEvent.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java b/paper-api/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java index ba4dc8aed..2f80910dd 100644 --- a/paper-api/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java @@ -52,8 +52,8 @@ public class FurnaceBurnEvent extends BlockEvent implements Cancellable { * * @param burnTime the burn time for this fuel */ - public void setBurnTime(int burnTime) { - this.burnTime = burnTime; + public void setBurnTime(@org.jetbrains.annotations.Range(from = Short.MIN_VALUE, to = Short.MAX_VALUE) int burnTime) { // Paper + this.burnTime = Math.max(Short.MIN_VALUE, Math.min(Short.MAX_VALUE, burnTime)); // Paper } /**