diff --git a/paper-api/src/main/java/org/bukkit/util/NumberConversions.java b/paper-api/src/main/java/org/bukkit/util/NumberConversions.java index e482ceeb61..dba11afb3a 100644 --- a/paper-api/src/main/java/org/bukkit/util/NumberConversions.java +++ b/paper-api/src/main/java/org/bukkit/util/NumberConversions.java @@ -11,6 +11,11 @@ public final class NumberConversions { return floor == num ? floor : floor - (int) (Double.doubleToRawLongBits(num) >>> 63); } + public static int ceil(final double num) { + final int floor = (int) num; + return floor == num ? floor : floor + (int) (~Double.doubleToRawLongBits(num) >>> 63); + } + public static int round(double num) { return floor(num + 0.5d); }