Skip to content

Commit

Permalink
Fixed 1.21.3 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
MeAlam1 committed Nov 4, 2024
1 parent 7854a41 commit 405166b
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static Biome getBiomeOfChunk(Level pLevel, ChunkPos pChunkPos) {
*/
public static String getBiomeRegistryNameOfChunk(Level pLevel, ChunkPos pChunkPos) {
ResourceLocation biomeKey = pLevel.registryAccess()
.registryOrThrow(Registries.BIOME)
.lookupOrThrow(Registries.BIOME)
.getKey(pLevel.getBiome(pChunkPos.getWorldPosition()).value());

if (biomeKey == null) {
Expand Down Expand Up @@ -152,7 +152,7 @@ public static String getChunkTileEntitiesRegistryNames(Level pLevel, ChunkPos pC
return blockEntities.stream()
.map(blockEntity -> {
ResourceLocation key = pLevel.registryAccess()
.registryOrThrow(Registries.BLOCK_ENTITY_TYPE)
.lookupOrThrow(Registries.BLOCK_ENTITY_TYPE)
.getKey(blockEntity.getType());

return key != null ? key.toString() : "unknown";
Expand Down Expand Up @@ -200,7 +200,7 @@ public static int getChunkBlockCount(Level pLevel, ChunkPos pChunkPos) {
int blockCount = 0;

for (int x = 0; x < 16; x++) {
for (int y = pLevel.getMinBuildHeight(); y < pLevel.getHeight(); y++) {
for (int y = pLevel.getMinY(); y < pLevel.getHeight(); y++) {
for (int z = 0; z < 16; z++) {
BlockPos worldPos = new BlockPos(pChunkPos.getMinBlockX() + x, y, pChunkPos.getMinBlockZ() + z);
if (!chunk.getBlockState(worldPos).isAir()) {
Expand All @@ -216,7 +216,7 @@ public static int getChunkBlockCount(Level pLevel, ChunkPos pChunkPos) {
}
}

/** FIXME: This method is not working as expected. It is not returning correctly.
/* FIXME: This method is not working as expected. It is not returning correctly.
public static boolean isChunkLoaded(final LevelAccessor pWorld, final int pX, final int pZ) {
try {
boolean isLoaded = pWorld.getChunk(pX, pZ, ChunkStatus.FULL, false) != null;
Expand Down

0 comments on commit 405166b

Please sign in to comment.