Closed katiebosch closed 6 months ago
I rewrote the method in the project's style, but I do not have write access. Here's the code, hopefully all you need to do is copy and paste:
private ItemStack checkRawMaterial() {
String materialID = this.configurationFile.getString(configLocation + ".item.raw-material");
Material material;
if (materialID == null) {
return null;
}
rawMaterial = true;
ItemStack stack;
if ((stack = getItemsAdderStack(materialID)) != null) {
return stack;
}
if ((material = Material.getMaterial(materialID.toUpperCase())) == null) {
EvenMoreFish.logger.severe(() -> String.format("%s has an incorrect assigned material: %s",
configLocation,
materialID));
material = Material.COD;
}
return new ItemStack(material);
}
Just a note, I compiled and tested the above on my server and it did not fix the issue. I'll see if I have time tomorrow to set something up locally so I can debug ☝️
I rewrote the method in the project's style, but I do not have write access. Here's the code, hopefully all you need to do is copy and paste:
private ItemStack checkRawMaterial() { String materialID = this.configurationFile.getString(configLocation + ".item.raw-material"); Material material; if (materialID == null) { return null; } rawMaterial = true; ItemStack stack; if ((stack = getItemsAdderStack(materialID)) != null) { return stack; } if ((material = Material.getMaterial(materialID.toUpperCase())) == null) { EvenMoreFish.logger.severe(() -> String.format("%s has an incorrect assigned material: %s", configLocation, materialID)); material = Material.COD; } return new ItemStack(material); }
Please create a fork and submit a pr :)
Apologies I've only just seen this - as sarhatabaot said the best way is to create a pull request, then you get credit on GitHub for your work too, if you need help just reply and I'm more than happy to assist 👍
Sorry I had made a fork but forgot to open the PR :) I tested this in a local server and it works. https://github.com/Oheers/EvenMoreFish/pull/198
Cheers for that, I've just merged your PR now.
Closed via #198
There is a check in the
checkRawMaterial
method that attempts to get the material from the Bukkit API based on the material name. This check will always return false because the ItemsAdder item value is not a vanilla value. This is preventing me from getting a fish if it has a raw-material with an ItemsAdder item populated.