From 2b6f3d7f79bbe684764cdc14ac21aae6dfcd9cad Mon Sep 17 00:00:00 2001 From: Bjarne Koll Date: Tue, 22 Jan 2019 16:29:09 +0100 Subject: [PATCH] SPIGOT-4586: Change PotionEffectType#value to not include null As the PotionEffectType class is containing a bunch of constant values the values method now fits the general idea of the Enum#values method as it no longer returns a null object at index 0 --- src/main/java/org/bukkit/potion/PotionEffectType.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bukkit/potion/PotionEffectType.java b/src/main/java/org/bukkit/potion/PotionEffectType.java index ffa5dcac..962d36f8 100644 --- a/src/main/java/org/bukkit/potion/PotionEffectType.java +++ b/src/main/java/org/bukkit/potion/PotionEffectType.java @@ -1,5 +1,6 @@ package org.bukkit.potion; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -303,11 +304,11 @@ public abstract class PotionEffectType { /** * Returns an array of all the registered {@link PotionEffectType}s. - * This array is not necessarily in any particular order and may contain null. + * This array is not necessarily in any particular order. * * @return Array of types. */ public static PotionEffectType[] values() { - return byId.clone(); + return Arrays.copyOfRange(byId, 1, byId.length); } }