Waterfall/BungeeCord-Patches/0008-Fixup-ProtocolConstants.patch
Shane Freeder 1c8ea44393
move up Fixup ProtocolConstants to waterfall
This patch contains a trivial formatting fix, while while somewhat
pointless, I decided to keep, the main advantage is in the util
helpers which will aim to keep code cleaner (I've wished for this
to be included in waterfall for a while, and given future work, I
feel now is a good time to shift it over)
2018-10-27 22:18:13 +01:00

41 lines
1.4 KiB
Diff

From 2d75ec272a93dc6da8d56876fc5545b438c185ee Mon Sep 17 00:00:00 2001
From: Troy Frew <fuzzy_bot@arenaga.me>
Date: Tue, 15 Nov 2016 09:07:51 -0500
Subject: [PATCH] Fixup ProtocolConstants
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java
index 2cc86349..d9a3c7e5 100644
--- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java
@@ -28,7 +28,8 @@ public class ProtocolConstants
"1.12.x",
"1.13.x"
);
- public static final List<Integer> SUPPORTED_VERSION_IDS = Arrays.asList( ProtocolConstants.MINECRAFT_1_8,
+ public static final List<Integer> SUPPORTED_VERSION_IDS = Arrays.asList(
+ ProtocolConstants.MINECRAFT_1_8,
ProtocolConstants.MINECRAFT_1_9,
ProtocolConstants.MINECRAFT_1_9_1,
ProtocolConstants.MINECRAFT_1_9_2,
@@ -44,6 +45,16 @@ public class ProtocolConstants
ProtocolConstants.MINECRAFT_1_13_2
);
+ public static final boolean isBeforeOrEq(int before, int other)
+ {
+ return before <= other;
+ }
+
+ public static final boolean isAfterOrEq(int after, int other)
+ {
+ return after >= other;
+ }
+
public enum Direction
{
--
2.19.1