Skip to content

Commit

Permalink
Fixed top islands not sorted on startup and when bonus for islands is…
Browse files Browse the repository at this point in the history
… changed (#1496)
  • Loading branch information
OmerBenGera committed Dec 9, 2022
1 parent f937d1f commit 405b133
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Expand Up @@ -557,6 +557,7 @@ public void reloadPlugin(boolean loadGrid) throws ManagerLoadException {
if (loadGrid) {
dataHandler.loadData();
stackedBlocksHandler.loadData();
plugin.getGrid().setForceSort(true);
SortingType.values().forEach(gridHandler::sortIslands);
modulesHandler.loadModulesData(this);
modulesHandler.enableModules(ModuleLoadTime.AFTER_MODULE_DATA_LOAD);
Expand Down
Expand Up @@ -2103,6 +2103,7 @@ public void setBonusWorth(BigDecimal bonusWorth) {

this.bonusWorth.set(bonusWorth);

plugin.getGrid().getIslandsContainer().notifyChange(SortingTypes.BY_WORTH, this);
plugin.getGrid().sortIslands(SortingTypes.BY_WORTH);

IslandsDatabaseBridge.saveBonusWorth(this);
Expand All @@ -2121,6 +2122,7 @@ public void setBonusLevel(BigDecimal bonusLevel) {

this.bonusLevel.set(bonusLevel);

plugin.getGrid().getIslandsContainer().notifyChange(SortingTypes.BY_LEVEL, this);
plugin.getGrid().sortIslands(SortingTypes.BY_LEVEL);

IslandsDatabaseBridge.saveBonusLevel(this);
Expand Down

0 comments on commit 405b133

Please sign in to comment.