forked from Upstream/VillagerTradeLimiter
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:
parent
dd49756014
commit
f4a8ecd21c
@ -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()));
|
||||
}
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user