From 6556b08a43daf73df31473eb9874063ce48697fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=81=AA=E8=81=AA?= <178666380@qq.com> Date: Sun, 25 Jun 2017 19:11:11 +0800 Subject: [PATCH] fix getById can not get mod's potion --- patches/org/bukkit/potion/PotionEffectType.java.patch | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/patches/org/bukkit/potion/PotionEffectType.java.patch b/patches/org/bukkit/potion/PotionEffectType.java.patch index 9a04c2c..6305a34 100644 --- a/patches/org/bukkit/potion/PotionEffectType.java.patch +++ b/patches/org/bukkit/potion/PotionEffectType.java.patch @@ -9,19 +9,18 @@ private static final Map byName = new HashMap(); // will break on updates. private static boolean acceptingNew = true; -@@ -216,9 +216,9 @@ +@@ -216,9 +216,7 @@ */ @Deprecated public static PotionEffectType getById(int id) { - if (id >= byId.length || id < 0) -+ if (id >= byId.size() || id < 0) // Cauldron - return null; +- return null; - return byId[id]; + return byId.get(id); // Cauldron } /** -@@ -240,15 +240,18 @@ +@@ -240,15 +238,18 @@ * @param type PotionType to register */ public static void registerPotionEffectType(PotionEffectType type) { @@ -42,7 +41,7 @@ } /** -@@ -264,6 +267,11 @@ +@@ -264,6 +265,11 @@ * @return Array of types. */ public static PotionEffectType[] values() {