Skip to content

Commit

Permalink
Prevent null biomes causing errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Aug 15, 2023
1 parent 7a61531 commit 9176505
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ void initBlock(String blockNumber, OneBlockPhase obPhase, ConfigurationSection p
if (obPhase.getPhaseName() != null) {
throw new IOException("Block " + blockNumber + ": Phase name trying to be set to " + phase.getString(NAME) + " but already set to " + obPhase.getPhaseName() + ". Duplicate phase file?");
}
System.out.println("name");
// name
obPhase.setPhaseName(phase.getString(NAME, blockNumber));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,11 @@ private PanelItem createPhaseButton(ItemTemplateRecord template, Map.Entry<Integ

if (template.description() != null)
{
String biomeText = phase.getPhaseBiome() == null ? "" : LangUtilsHook.getBiomeName(phase.getPhaseBiome(), this.user);

descriptionText = this.user.getTranslationOrNothing(template.description(),
TextVariables.NUMBER, phase.getBlockNumber(),
BIOME, LangUtilsHook.getBiomeName(phase.getPhaseBiome(), this.user),
BIOME, biomeText,
BANK, bankText.toString(),
ECONOMY, economyText.toString(),
LEVEL, levelText.toString(),
Expand All @@ -421,7 +423,7 @@ private PanelItem createPhaseButton(ItemTemplateRecord template, Map.Entry<Integ
// Null description, so we make our own
String blockText = this.user.getTranslationOrNothing(reference + "starting-block",
TextVariables.NUMBER, phase.getBlockNumber());
String biomeText = this.user.getTranslationOrNothing(reference + "biome",
String biomeText = phase.getPhaseBiome() == null ? "" : this.user.getTranslationOrNothing(reference + "biome",
BIOME, LangUtilsHook.getBiomeName(phase.getPhaseBiome(), this.user));

descriptionText = this.user.getTranslationOrNothing(reference + "description",
Expand Down

0 comments on commit 9176505

Please sign in to comment.