Skip to content

Commit

Permalink
fix(game.world): fix getDimensionName method
Browse files Browse the repository at this point in the history
  • Loading branch information
WakelessSloth56 committed Nov 26, 2022
1 parent 674e6c5 commit b7c4ae4
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -4,6 +4,7 @@
import java.util.UUID;
import java.util.function.Function;
import java.util.stream.Collectors;
import javax.annotation.Nullable;
import org.auioc.mcmod.arnicalib.game.chat.TextUtils;
import org.auioc.mcmod.arnicalib.game.server.ServerUtils;
import net.minecraft.Util;
Expand Down Expand Up @@ -69,12 +70,18 @@ public static Component getMoonphaseName(Level level) {
}

public static Component getDimensionName(Level level) {
return TextUtils.translatable(Util.makeDescriptionId("dimension", level.dimension().getRegistryName()));
return TextUtils.translatable(Util.makeDescriptionId("dimension", level.dimension().location()));
}

public static Component getBiomeName(Level level, BlockPos pos) {
var id = getBiomeId(level, pos);
return (id != null) ? TextUtils.translatable(Util.makeDescriptionId("biome", id)) : TextUtils.empty();
}

@Nullable
public static ResourceLocation getBiomeId(Level level, BlockPos pos) {
var b = level.getBiome(pos).unwrapKey();
return (b.isPresent()) ? TextUtils.translatable(Util.makeDescriptionId("biome", b.get().location())) : TextUtils.empty();
return (b.isPresent()) ? b.get().location() : null;
}


Expand Down

0 comments on commit b7c4ae4

Please sign in to comment.