Skip to content

Commit

Permalink
Improve ChangeOwnerListener.
Browse files Browse the repository at this point in the history
Remove hardcoded AcidIsland and BSkyBlock support and add generic any GameMode support.
  • Loading branch information
BONNe committed Jun 12, 2019
1 parent b4f396b commit 4798954
Showing 1 changed file with 14 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,26 +59,24 @@ public void onTeamSetOwnerEvent(TeamSetownerEvent event)
defaultBiome = "";
}

// It is assumed that biomes.set permission is required to change biome.
if (!hasPermissions)
{
BiomesObject defaultBiomeObject = this.addon.getAddonManager().getBiomeFromString(defaultBiome);
BiomesObject defaultBiomeObject;

if (!defaultBiome.isEmpty() && defaultBiomeObject == null)
Biome biome = BiomesAddonManager.getBiomeNameMap().getOrDefault(defaultBiome.toUpperCase(), null);

if (biome == null)
{
this.addon.logError("Biome defined in GameMode addon is not valid!!!");
return;
}
else
{
Biome biome = BiomesAddonManager.getBiomeNameMap().getOrDefault(defaultBiome.toUpperCase(), null);

if (biome == null)
{
this.addon.logError("Biome defined in GameMode addon is not valid!!!");
return;
}
else
{
defaultBiomeObject = new BiomesObject();
defaultBiomeObject.setBiome(biome);
defaultBiomeObject.setRequiredCost(0);
defaultBiomeObject.setRequiredLevel(0);
}
defaultBiomeObject = new BiomesObject();
defaultBiomeObject.setBiome(biome);
defaultBiomeObject.setRequiredCost(0);
defaultBiomeObject.setRequiredLevel(0);
}

// Forcefully update biome on whole user island.
Expand Down

0 comments on commit 4798954

Please sign in to comment.