Skip to content

Commit

Permalink
Merge pull request #304 from SeaifanAladdin/feature/RemoveBronzePicka…
Browse files Browse the repository at this point in the history
…xeFromStatue

Remove bronze pickaxe from pickaxe statue
  • Loading branch information
Thource authored Feb 8, 2025
2 parents 957031f + 23e7f56 commit 8ca54fc
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class PickaxeStatue extends WorldStorage {
protected PickaxeStatue(DudeWheresMyStuffPlugin plugin) {
super(WorldStorageType.PICKAXE_STATUE, plugin);

pickaxe = new ItemStack(PICKAXE_IDS[0], 1, plugin);
pickaxe = new ItemStack(PICKAXE_IDS[0], plugin);
items.add(pickaxe);
}

Expand All @@ -44,6 +44,7 @@ public boolean onVarbitChanged() {
int pickaxeId = getPickaxeId(plugin.getClient().getVarbitValue(14440));
if (pickaxe.getId() != pickaxeId) {
pickaxe.setId(pickaxeId, plugin);
pickaxe.setQuantity(pickaxe.getId() == PICKAXE_IDS[0] ? 0 : 1);
return true;
}

Expand All @@ -63,16 +64,20 @@ public void load(ConfigManager configManager, String managerConfigKey, String pr
super.load(configManager, managerConfigKey, profileKey);

if (items.isEmpty()) {
items.add(new ItemStack(PICKAXE_IDS[0], 1, plugin));
items.add(new ItemStack(PICKAXE_IDS[0], plugin));
}
pickaxe = items.get(0);
//Ensures bronze pickaxe removal changes are picked up on plugin update
if (pickaxe.getId() == PICKAXE_IDS[0]) {
pickaxe.setQuantity(0);
}
}

@Override
public void reset() {
super.reset();

pickaxe = new ItemStack(PICKAXE_IDS[0], 1, plugin);
pickaxe = new ItemStack(PICKAXE_IDS[0], plugin);
items.add(pickaxe);
}
}

0 comments on commit 8ca54fc

Please sign in to comment.