9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-19 14:59:25 +00:00
Files
DivineMC/divinemc-server/minecraft-patches/features/0014-Use-Java-s-Math-functions.patch
NONPLAYT d9c4e8a199 Updated Upstream (Purpur)
Upstream has released updates that appear to apply and compile correctly

Purpur Changes:
PurpurMC/Purpur@efc76215 Add missing copper blocks to waxables and weatherables options (#1712)
PurpurMC/Purpur@3ca0d663 Updated Upstream (Paper)
PurpurMC/Purpur@917675d0 Updated Upstream (Paper)
PurpurMC/Purpur@ffe2f809 Add option to disable Warden Sonic Boom (#1713)
2025-10-28 03:51:29 +03:00

49 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sun, 6 Jul 2025 02:59:37 +0300
Subject: [PATCH] Use Java's Math functions
diff --git a/net/minecraft/util/Mth.java b/net/minecraft/util/Mth.java
index 0713d164851216483247da09ff7901f8bfbe2eb9..ed46863a244f4e23610a918f0692390130eaadaf 100644
--- a/net/minecraft/util/Mth.java
+++ b/net/minecraft/util/Mth.java
@@ -58,18 +58,15 @@ public class Mth {
}
public static int floor(float value) {
- int i = (int)value;
- return value < i ? i - 1 : i;
+ return (int) Math.floor(value); // DivineMC - Use Java's Math functions
}
public static int floor(double value) {
- int i = (int)value;
- return value < i ? i - 1 : i;
+ return (int) Math.floor(value); // DivineMC - Use Java's Math functions
}
public static long lfloor(double value) {
- long l = (long)value;
- return value < l ? l - 1L : l;
+ return (long) Math.floor(value); // DivineMC - Use Java's Math functions
}
public static float abs(float value) {
@@ -81,13 +78,11 @@ public class Mth {
}
public static int ceil(float value) {
- int i = (int)value;
- return value > i ? i + 1 : i;
+ return (int) Math.ceil(value); // DivineMC - Use Java's Math functions
}
public static int ceil(double value) {
- int i = (int)value;
- return value > i ? i + 1 : i;
+ return (int) Math.ceil(value); // DivineMC - Use Java's Math functions
}
public static long ceilLong(double value) {