ickerio / factions

Highly customizable, lightweight and fully featured factions mod for the Fabric loader in Minecraft
MIT License
25 stars 28 forks source link

Admin faction power isn't used for max power when using auto-claim #104

Closed DrSawickipedia closed 1 year ago

DrSawickipedia commented 1 year ago

Expected behavior

For the faction auto-claim feature to also correctly use the admin max power, like the standard /factions claim add does

Observed/actual behavior

When attempting to claim a new chunk, the text "Not enough faction power to claim chunk, autoclaim toggled off" is shown, even though there is enough max power

Steps/models to reproduce

Fill the maximum possible claimed chunks, and then add more via the admin command. Then, toggle on auto-claim and attempt to claim another chunk

Version

I built the mod myself using the current version of the code in the repository

Other

I believe this could be fixed by changing the line: https://github.com/ickerio/factions/blob/a828619e044afe4821be38fa900a30803db53087/src/main/java/io/icker/factions/core/WorldManager.java#L37 to use the same code as detailed in the commit fixing #103: https://github.com/ickerio/factions/commit/cdbebb9e4fa4500f7a688e51b278df96017d9269


To avoid this problem in other places, it may be a good idea to add a method that calculates the maxPower directly in the Faction class (e.g. it comes up for /factions info as well):

https://github.com/ickerio/factions/blob/a828619e044afe4821be38fa900a30803db53087/src/main/java/io/icker/factions/command/InfoCommand.java#L77

BlueZeeKing commented 1 year ago

Duplicate of #103