Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert skull hashes back to lower case #54

Merged
merged 2 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/io/ncbpfluffybear/slimecustomizer/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public static ItemStack getBlockFromConfig(String key, String materialString) {
} else if (material != null && material.isBlock()) {
block = new ItemStack(material);
} else if (materialString.startsWith("SKULL")) {
block = SlimefunUtils.getCustomHead(materialString.replace("SKULL", ""));
block = SlimefunUtils.getCustomHead(materialString.replace("SKULL", "").toLowerCase());
}

return block;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.bukkit.inventory.ItemStack;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;


Expand All @@ -34,11 +34,11 @@ public class CustomMachine extends AContainer implements RecipeDisplayItem {
private final ItemStack progressItem;
private final int energyConsumption;
private final int energyBuffer;
private final HashMap<Pair<ItemStack[], ItemStack[]>, Integer> customRecipes;
private final LinkedHashMap<Pair<ItemStack[], ItemStack[]>, Integer> customRecipes;

public CustomMachine(ItemGroup category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe,
String id, Material progressItem, int energyConsumption, int energyBuffer,
HashMap<Pair<ItemStack[], ItemStack[]>, Integer> customRecipes) {
LinkedHashMap<Pair<ItemStack[], ItemStack[]>, Integer> customRecipes) {
super(category, item, recipeType, recipe);

this.id = id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private void validateMachineSettings() {
} else if (material != null && material.isBlock()) {
block = new ItemStack(material);
} else if (materialString.startsWith("SKULL")) {
block = SlimefunUtils.getCustomHead(materialString.replace("SKULL", ""));
block = SlimefunUtils.getCustomHead(materialString.replace("SKULL", "").toLowerCase());
}

/* Progress bar type */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static boolean register(Config categories) {
} else if (material != null) {
item = new ItemStack(material);
} else if (materialString.startsWith("SKULL")) {
item = SlimefunUtils.getCustomHead(materialString.replace("SKULL", ""));
item = SlimefunUtils.getCustomHead(materialString.replace("SKULL", "").toLowerCase());
}
item = new CustomItemStack(item, name);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static boolean register(Config items) {
} else if (material != null) {
item = new ItemStack(material);
} else if (materialString.startsWith("SKULL")) {
item = SlimefunUtils.getCustomHead(materialString.replace("SKULL", ""));
item = SlimefunUtils.getCustomHead(materialString.replace("SKULL", "").toLowerCase());
}

item.setAmount(amount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.logging.Level;

/**
Expand All @@ -38,7 +38,7 @@ public static boolean register(Config machines) {
// Update to new dual input/output system
Utils.updateInputAndOutputFormat(machines, machineKey);

HashMap<Pair<ItemStack[], ItemStack[]>, Integer> customRecipe = new HashMap<>();
LinkedHashMap<Pair<ItemStack[], ItemStack[]>, Integer> customRecipe = new LinkedHashMap<>();

/* Machine recipes */
for (String recipeKey : machines.getKeys(machineKey + ".recipes")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static boolean register(Config drops) {
} else if (material != null) {
item = new ItemStack(material);
} else if (materialString.startsWith("SKULL")) {
item = SlimefunUtils.getCustomHead(materialString.replace("SKULL", ""));
item = SlimefunUtils.getCustomHead(materialString.replace("SKULL", "").toLowerCase());
}

item.setAmount(amount);
Expand Down
Loading