Fixes some problems with getting scrapper data
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good
This commit is contained in:
parent
757fcdf139
commit
e956c7dda7
@ -183,7 +183,7 @@ public class BlacksmithNPCSettings implements TraitSettings<BlacksmithSetting> {
|
||||
*
|
||||
* @return <p>All items reforge-able by this NPC</p>
|
||||
*/
|
||||
public List<Material> getItems() {
|
||||
public List<Material> getReforgeAbleItems() {
|
||||
Object currentValue = currentValues.get(BlacksmithSetting.REFORGE_ABLE_ITEMS);
|
||||
if (currentValue == null || String.valueOf(currentValue).isEmpty()) {
|
||||
return globalBlacksmithSettings.getReforgeAbleItems();
|
||||
|
@ -68,7 +68,7 @@ public class BlacksmithTrait extends CustomTrait<BlacksmithSetting> {
|
||||
public void startSession(@NotNull Player player) {
|
||||
ItemStack hand = player.getInventory().getItemInMainHand();
|
||||
//Refuse if not repairable, or if reforge-able items is set, but doesn't include the held item
|
||||
List<Material> reforgeAbleItems = config.getItems();
|
||||
List<Material> reforgeAbleItems = config.getReforgeAbleItems();
|
||||
|
||||
boolean notHoldingAnvil = !this.config.getRepairAnvils() || !ItemHelper.isAnvil(hand.getType(), false);
|
||||
boolean notHoldingRepairable = !ItemHelper.isRepairable(hand) ||
|
||||
|
@ -40,6 +40,16 @@ public class ScrapperTrait extends CustomTrait<ScrapperSetting> {
|
||||
super.setTraitSettings(this.config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current settings for this NPC
|
||||
*
|
||||
* @return <p>The current settings for this NPC</p>
|
||||
*/
|
||||
@NotNull
|
||||
public ScrapperNPCSettings getSettings() {
|
||||
return config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads all config values stored in citizens' config file for this NPC
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user