boiscljo / SBA

An addon to ScreamingSandals bedwars plugin to hypixelify it!
GNU General Public License v3.0
26 stars 15 forks source link

fix: cancel purchase if there are no upgradable spawners #69

Closed Misat11 closed 2 months ago

boiscljo commented 2 months ago

Fixed in https://github.com/boiscljo/SBA/commit/1adcb46a0aadb41992c25c54c5de6341c8f28630 Line 522(new) if (spawner.getCurrentLevel() < maxLevel) spawnersToUpgrade.add(spawner); Line 545 if (newLevel < maxLevelF) spawnersToUpgrade.add(closestSpawner);

Your implementation didn't work properly and added bugs of incomplete upgrades not being able to be purchased. 1.9(current) + 0.3(addLevels) > 2 (maxLevel) Hence not purchasable when 1.9 is not yet the max level. It should be purchasable.

Checking if (spawner.getCurrentLevel() < maxLevel) is a better solution as it allows them to fully stack the forge. Plus the bug only affected spawners assigned to a team as spawners unassigned worked properly with a max upgrade.