Version 1.5.1:

* Fixed an NBT error and missing items when config.yml had uppercase material names

To-do:
* Add enchantments, data, etc. to ingredients and result
* Add config editor GUI in-game
This commit is contained in:
PretzelJohn 2022-01-22 05:05:06 -05:00
parent dd49756014
commit f4a8ecd21c
2 changed files with 4 additions and 1 deletions

View File

@ -234,7 +234,7 @@ public class PlayerListener implements Listener {
*/
private void setIngredient(final ConfigurationSection item, final IngredientWrapper ingredient) {
if(item == null) return;
ingredient.setMaterialId("minecraft:"+item.getString("Material", ingredient.getMaterialId()).replace("minecraft:",""));
ingredient.setMaterialId("minecraft:"+item.getString("Material", ingredient.getMaterialId()).toLowerCase().replace("minecraft:",""));
ingredient.setAmount(item.getInt("Amount", ingredient.getAmount()));
}
}

View File

@ -168,6 +168,9 @@ public class Settings {
* @return True if a recipe matches an override section, false otherwise
*/
private boolean verify(final ItemStack buy, final ItemStack sell, final Material material) {
if(buy == null && sell == null) return false;
if(buy == null) return sell.getType() == material;
if(sell == null) return buy.getType() == material;
return ((buy.getType() == material) || (sell.getType() == material));
}
}