Skip to content

Commit

Permalink
Fixed islands not having worth value calculated again on startup (#849)
Browse files Browse the repository at this point in the history
  • Loading branch information
OmerBenGera committed Jan 20, 2022
1 parent 003ed9c commit da68bc4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Expand Up @@ -8,7 +8,6 @@
import com.bgsoftware.superiorskyblock.api.island.IslandFlag;
import com.bgsoftware.superiorskyblock.api.island.IslandPrivilege;
import com.bgsoftware.superiorskyblock.api.island.PlayerRole;
import com.bgsoftware.superiorskyblock.api.island.algorithms.IslandBlocksTrackerAlgorithm;
import com.bgsoftware.superiorskyblock.api.island.warps.IslandWarp;
import com.bgsoftware.superiorskyblock.api.island.warps.WarpCategory;
import com.bgsoftware.superiorskyblock.api.missions.Mission;
Expand Down Expand Up @@ -155,7 +154,7 @@ public static void deserializeWarps(Island island) {
});
}

public static void deserializeBlockCounts(String blocks, IslandBlocksTrackerAlgorithm blocksTrackerAlgorithm) {
public static void deserializeBlockCounts(String blocks, Island island) {
if (blocks == null || blocks.isEmpty())
return;

Expand All @@ -171,7 +170,7 @@ public static void deserializeBlockCounts(String blocks, IslandBlocksTrackerAlgo
JsonObject blockCountObject = blockCountElement.getAsJsonObject();
Key blockKey = Key.of(blockCountObject.get("id").getAsString());
BigInteger amount = new BigInteger(blockCountObject.get("amount").getAsString());
blocksTrackerAlgorithm.trackBlock(blockKey, amount);
island.handleBlockPlace(blockKey, amount, false, false);
});
}

Expand Down
Expand Up @@ -3222,7 +3222,7 @@ private void assignIslandChest() {
private void deserializeBlockCounts(String blockCounts) {
try {
this.blocksTracker.setLoadingDataMode(true);
IslandsDeserializer.deserializeBlockCounts(blockCounts, this.blocksTracker);
IslandsDeserializer.deserializeBlockCounts(blockCounts, this);
} finally {
this.blocksTracker.setLoadingDataMode(false);
}
Expand Down

0 comments on commit da68bc4

Please sign in to comment.