mirror of
https://github.com/exituser/Brewery.git
synced 2026-09-17 05:28:59 +00:00
No Material EnumSets
This commit is contained in:
@@ -20,8 +20,8 @@ public class BCauldronRecipe {
|
|||||||
public static List<BCauldronRecipe> recipes = new ArrayList<>();
|
public static List<BCauldronRecipe> recipes = new ArrayList<>();
|
||||||
public static int numConfigRecipes;
|
public static int numConfigRecipes;
|
||||||
public static List<RecipeItem> acceptedCustom = new ArrayList<>(); // All accepted custom and other items
|
public static List<RecipeItem> acceptedCustom = new ArrayList<>(); // All accepted custom and other items
|
||||||
public static Set<Material> acceptedSimple = EnumSet.noneOf(Material.class); // All accepted simple items
|
public static Set<Material> acceptedSimple = new HashSet<>(); // All accepted simple items
|
||||||
public static Set<Material> acceptedMaterials = EnumSet.noneOf(Material.class); // Fast cache for all accepted Materials
|
public static Set<Material> acceptedMaterials = new HashSet<>(); // Fast cache for all accepted Materials
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
private List<RecipeItem> ingredients;
|
private List<RecipeItem> ingredients;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import org.bukkit.material.Wood;
|
|||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.EnumSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import static com.dre.brewery.BCauldron.EMPTY;
|
import static com.dre.brewery.BCauldron.EMPTY;
|
||||||
@@ -42,7 +42,9 @@ public class LegacyUtil {
|
|||||||
} catch (ClassNotFoundException | NoSuchMethodException | SecurityException ignored) {
|
} catch (ClassNotFoundException | NoSuchMethodException | SecurityException ignored) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<Material> planks = EnumSet.noneOf(Material.class);
|
// EnumSet not supposed to be used anymore
|
||||||
|
// See https://www.spigotmc.org/threads/spigot-bungeecord-1-19.559742/
|
||||||
|
Set<Material> planks = new HashSet<>();
|
||||||
for (Material m : Material.values()) {
|
for (Material m : Material.values()) {
|
||||||
if (m.name().endsWith("PLANKS")) {
|
if (m.name().endsWith("PLANKS")) {
|
||||||
planks.add(m);
|
planks.add(m);
|
||||||
@@ -50,7 +52,7 @@ public class LegacyUtil {
|
|||||||
}
|
}
|
||||||
PLANKS = planks;
|
PLANKS = planks;
|
||||||
|
|
||||||
Set<Material> woodStairs = EnumSet.noneOf(Material.class);
|
Set<Material> woodStairs = new HashSet<>();
|
||||||
Material[] gotStairs = {
|
Material[] gotStairs = {
|
||||||
get("OAK_STAIRS", "WOOD_STAIRS"),
|
get("OAK_STAIRS", "WOOD_STAIRS"),
|
||||||
get("SPRUCE_STAIRS", "SPRUCE_WOOD_STAIRS"),
|
get("SPRUCE_STAIRS", "SPRUCE_WOOD_STAIRS"),
|
||||||
@@ -70,7 +72,7 @@ public class LegacyUtil {
|
|||||||
WOOD_STAIRS = woodStairs;
|
WOOD_STAIRS = woodStairs;
|
||||||
|
|
||||||
|
|
||||||
Set<Material> fences = EnumSet.noneOf(Material.class);
|
Set<Material> fences = new HashSet<>();
|
||||||
for (Material m : Material.values()) {
|
for (Material m : Material.values()) {
|
||||||
if (m.name().endsWith("FENCE")) {
|
if (m.name().endsWith("FENCE")) {
|
||||||
fences.add(m);
|
fences.add(m);
|
||||||
|
|||||||
Reference in New Issue
Block a user