From 5c113e7369019475623a3e98c39937f1001f28b5 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot 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 By: Bjarne Koll --- .../src/main/java/org/bukkit/potion/PotionEffectType.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/potion/PotionEffectType.java b/paper-api/src/main/java/org/bukkit/potion/PotionEffectType.java index ffa5dcacf9..962d36f8f7 100644 --- a/paper-api/src/main/java/org/bukkit/potion/PotionEffectType.java +++ b/paper-api/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); } }