From 8de7a4c828f4c3033710655a1d3dd7c160e3ffa1 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Fri, 19 Nov 2021 09:10:06 +0100 Subject: [PATCH] Improve ceillog2 method --- .../ViaVersion/api/protocol/ProtocolVersion.java | 1 + .../protocol1_18to1_17_1/Protocol1_18To1_17_1.java | 14 +++++++------- .../com/viaversion/viaversion/util/MathUtil.java | 12 +++--------- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/api-legacy/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolVersion.java b/api-legacy/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolVersion.java index 8a1d8f48c..fa8f48de5 100644 --- a/api-legacy/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolVersion.java +++ b/api-legacy/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolVersion.java @@ -81,6 +81,7 @@ public class ProtocolVersion { public static final ProtocolVersion v1_16_4 = register(754, "1.16.4/5", new VersionRange("1.16", 4, 5)); public static final ProtocolVersion v1_17 = register(755, "1.17"); public static final ProtocolVersion v1_17_1 = register(756, "1.17.1"); + public static final ProtocolVersion v1_18 = register(757, "1.18"); public static final ProtocolVersion unknown = register(-1, "UNKNOWN"); public static ProtocolVersion register(int version, String name) { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_18to1_17_1/Protocol1_18To1_17_1.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_18to1_17_1/Protocol1_18To1_17_1.java index afdd8f4a4..c8e10af42 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_18to1_17_1/Protocol1_18To1_17_1.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_18to1_17_1/Protocol1_18To1_17_1.java @@ -46,6 +46,13 @@ public final class Protocol1_18To1_17_1 extends AbstractProtocol 0 ? 31 - Integer.numberOfLeadingZeros(i) : 0; } }