Package software.bluelib.utils.minecraft
Class ChunkUtils
java.lang.Object
software.bluelib.utils.minecraft.ChunkUtils
A
class providing methods to interact with Minecraft chunks,
specifically for retrieving biome and tile entity information.
Key Methods:
getBiomeOfChunk(Level, ChunkPos)- Retrieves theBiomeof the specified chunk.getBiomeRegistryNameOfChunk(Level, ChunkPos)- Retrieves the biome registry name of the specified chunk.getBiomeSimpleNameOfChunk(Level, ChunkPos)- Retrieves the simple name of the biome in the specified chunk.getChunkTileEntities(Level, ChunkPos)- Retrieves the tile entities within the specified chunk.getChunkTileEntitiesRegistryNames(Level, ChunkPos)- Retrieves the registry names of tile entities in the specified chunk.getChunkTileEntitiesSimpleNames(Level, ChunkPos)- Retrieves the simple names of tile entities in the specified chunk.getChunkBlockCount(Level, ChunkPos)- Counts the number of non-air blocks in the specified chunk.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.world.level.biome.BiomegetBiomeOfChunk(net.minecraft.world.level.Level pLevel, net.minecraft.world.level.ChunkPos pChunkPos) ABiomethat retrieves theBiomeof the specified chunk.static StringgetBiomeRegistryNameOfChunk(net.minecraft.world.level.Level pLevel, net.minecraft.world.level.ChunkPos pChunkPos) AStringthat retrieves the biome registry name of the specified chunk.static StringgetBiomeSimpleNameOfChunk(net.minecraft.world.level.Level pLevel, net.minecraft.world.level.ChunkPos pChunkPos) AStringthat retrieves the simple name of the biome in the specified chunk.static intgetChunkBlockCount(net.minecraft.world.level.Level pLevel, net.minecraft.world.level.ChunkPos pChunkPos) AIntegerthat counts the number of non-air blocks in the specified chunk.static Collection<net.minecraft.world.level.block.entity.BlockEntity> getChunkTileEntities(net.minecraft.world.level.Level pLevel, net.minecraft.world.level.ChunkPos pChunkPos) ACollection<net.minecraft.world.level.block.entity.BlockEntity>that retrieves the tile entities within the specified chunk.static StringgetChunkTileEntitiesRegistryNames(net.minecraft.world.level.Level pLevel, net.minecraft.world.level.ChunkPos pChunkPos) AStringthat retrieves the registry names of tile entities in the specified chunk.static StringgetChunkTileEntitiesSimpleNames(net.minecraft.world.level.Level pLevel, net.minecraft.world.level.ChunkPos pChunkPos) AStringthat retrieves the simple names of tile entities in the specified chunk.
-
Method Details
-
getBiomeOfChunk
public static net.minecraft.world.level.biome.Biome getBiomeOfChunk(net.minecraft.world.level.Level pLevel, net.minecraft.world.level.ChunkPos pChunkPos) ABiomethat retrieves theBiomeof the specified chunk.Logs a success message if the biome is retrieved successfully, and an error message if an exception occurs.
- Parameters:
pLevel-Level- The game world level.pChunkPos-ChunkPos- The position of the chunk.- Returns:
- The
Biomeassociated with the specified chunk. - Throws:
RuntimeException- if there is an error retrieving the biome.- Since:
- 1.0.0
-
getBiomeRegistryNameOfChunk
public static String getBiomeRegistryNameOfChunk(net.minecraft.world.level.Level pLevel, net.minecraft.world.level.ChunkPos pChunkPos) AStringthat retrieves the biome registry name of the specified chunk.Example: "minecraft:plains", "minecraft:desert"
- Parameters:
pLevel-Level- The game world level.pChunkPos-ChunkPos- The position of the chunk.- Returns:
- The registry name of the chunk's biome as a
String. - Throws:
RuntimeException- if there is an error retrieving the biome registry name.- Since:
- 1.0.0
-
getBiomeSimpleNameOfChunk
public static String getBiomeSimpleNameOfChunk(net.minecraft.world.level.Level pLevel, net.minecraft.world.level.ChunkPos pChunkPos) AStringthat retrieves the simple name of the biome in the specified chunk.Example: "plains", "desert"
- Parameters:
pLevel-Level- The game world level.pChunkPos-ChunkPos- The position of the chunk.- Returns:
- The simple name of the chunk's biome.
- Since:
- 1.0.0
-
getChunkTileEntities
public static Collection<net.minecraft.world.level.block.entity.BlockEntity> getChunkTileEntities(net.minecraft.world.level.Level pLevel, net.minecraft.world.level.ChunkPos pChunkPos) ACollection<net.minecraft.world.level.block.entity.BlockEntity>that retrieves the tile entities within the specified chunk.Logs a success message with the number of tile entities retrieved, and an error message if an exception occurs.
- Parameters:
pLevel-Level- The game world level.pChunkPos-ChunkPos- The position of the chunk.- Returns:
- A collection of tile entities present in the specified chunk.
- Throws:
RuntimeException- if there is an error retrieving tile entities.- Since:
- 1.0.0
-
getChunkTileEntitiesRegistryNames
public static String getChunkTileEntitiesRegistryNames(net.minecraft.world.level.Level pLevel, net.minecraft.world.level.ChunkPos pChunkPos) AStringthat retrieves the registry names of tile entities in the specified chunk.Example: "minecraft:chest, minecraft:furnace"
- Parameters:
pLevel-Level- The game world level.pChunkPos-ChunkPos- The position of the chunk.- Returns:
- A comma-separated string of tile entity registry names in the chunk.
- Throws:
RuntimeException- if there is an error retrieving tile entity registry names.- Since:
- 1.0.0
-
getChunkTileEntitiesSimpleNames
public static String getChunkTileEntitiesSimpleNames(net.minecraft.world.level.Level pLevel, net.minecraft.world.level.ChunkPos pChunkPos) AStringthat retrieves the simple names of tile entities in the specified chunk.Example: "chest, furnace"
- Parameters:
pLevel-Level- The game world level.pChunkPos-ChunkPos- The position of the chunk.- Returns:
- A comma-separated string of tile entity simple names in the chunk.
- Since:
- 1.0.0
-
getChunkBlockCount
public static int getChunkBlockCount(net.minecraft.world.level.Level pLevel, net.minecraft.world.level.ChunkPos pChunkPos) AIntegerthat counts the number of non-air blocks in the specified chunk.Logs a success message with the block count, and an error message if an exception occurs.
- Parameters:
pLevel-Level- The game world level.pChunkPos-ChunkPos- The position of the chunk.- Returns:
- The number of non-air blocks in the specified chunk.
- Throws:
RuntimeException- if there is an error counting blocks.- Since:
- 1.0.0
-