Class World

java.lang.Object
net.risingworld.api.World

public final class World extends Object
Represents the current server world. In provides some information about the world state, but is also used for any kind of modification you want to do.
  • Method Details

    • getName

      public static String getName()
      Gets the world name.
      Returns:
      the world name.
    • getSeed

      public static String getSeed()
      Gets the world seed, as a string.
      Returns:
      the world seed.
    • getCreationDate

      public static long getCreationDate()
      Gets the creation date of the world as a timestamp (millis).
      Returns:
      the creation date.
    • getWorldType

      public static String getWorldType()
      Gets the world type (e.g "Superflat").
      Returns:
      the world type.
    • getOreAmount

      public static int getOreAmount()
      Gets the ore amount (0-4).
      Returns:
      the ore amount.
    • getDisabledNpcs

      public static String[] getDisabledNpcs()
      Gets an array of all disabled npc, i.e npcs which were disabled upon world creation (preventing them from spawning naturally). Returns null if no npcs are disabled.
      Returns:
      an array containing all disabled npc names, or null if all npcs are enabled.
    • getWorldFolder

      public static File getWorldFolder()
    • getWorldsFolder

      public static File getWorldsFolder()
    • isInitialized

      public static boolean isInitialized()
      Gets whether the world is already initialized or not.
      Note: If the world isn't fully initialized yet, the world-functions may return invalid data.
      Returns:
      true if the the world is initialized (i.e the server has fully loaded it), false if not.
    • getTemperature

      public static int getTemperature(float x, float y, float z)
      Gets the current environment temperature at a given location.
      Parameters:
      x - the world x position.
      y - the world y position.
      z - the world z position.
      Returns:
      the current temperature (taking biome, weather and daytime into account) at a given location.
    • getDefaultGravity

      public static float getDefaultGravity()
      Gets the default world gravity, which is -9.81
      Returns:
      the default gravity (-9.81)
      See Also:
    • setSkyRotation

      public static void setSkyRotation(float rot)
      Sets the sky rotation. More precisely, this affects the sun and moon position. For instance, when setting a sky rotation of 90, the sun rises in the south (instead of east) and sets in the north (instead of west). When setting a rotation of 180, the sun rises in the west and sets in the east etc.
      Default sky rotation is 0.
      Parameters:
      rot - the sky rotation.
    • spawnItem

      public static WorldItem spawnItem(short itemID, int texture, int stack, Vector3f position, Quaternion rotation, boolean physical)
      Spawns an item in the world.
      Parameters:
      itemID - the item type id.
      texture - the texture/variant of the item. Typicall it's 0 for most items.
      stack - the stack size (i.e amount of items, but still represented by a single item instance).
      position - the world position of the item.
      rotation - the rotation of the item.
      physical - determines if the item should have physical behaviour, e.g fall to the ground etc. If false, the item will be static and immobile. Please note that it's necessary that a player is close to the item in order to provide accurate physical behaviour.
      Returns:
      a WorldItem representing the item.
    • spawnObjectItem

      public static WorldItem spawnObjectItem(short objectID, int variant, int stack, Vector3f position, Quaternion rotation, boolean physical)
      Spawns an object item in the world, i.e an item which represents an object.
      Parameters:
      objectID - the object type id.
      variant - the object variant. By default 0
      stack - the stack size (i.e amount of items, but still represented by a single item instance).
      position - the world position of the item.
      rotation - the rotation of the item.
      physical - determines if the item should have physical behaviour, e.g fall to the ground etc. If false, the item will be static and immobile. Please note that it's necessary that a player is close to the item in order to provide accurate physical behaviour.
      Returns:
      a WorldItem representing the object item.
    • spawnConstructionItem

      public static WorldItem spawnConstructionItem(byte constructionID, int texture, int stack, int color, Vector3f position, Quaternion rotation, boolean physical)
    • spawnClothingItem

      public static WorldItem spawnClothingItem(short clothingID, int variant, int stack, int color, long infoID, Vector3f position, Quaternion rotation, boolean physical)
      Spawns a global clothing item in the world, i.e an item which represents a garment.
      Parameters:
      clothingID - the clothing type id.
      variant - the clothing variant. By default 0
      stack - the stack size (i.e amount of items, but still represented by a single item instance).
      color - optional rgba color for the clothing piece.
      infoID - optional info id for the clothing piece.
      position - the world position of the item.
      rotation - the rotation of the item.
      physical - determines if the item should have physical behaviour, e.g fall to the ground etc. If false, the item will be static and immobile. Please note that it's necessary that a player is close to the item in order to provide accurate physical behaviour.
      Returns:
      a WorldItem representing the clothing item.
      Example: Spawn aviator sunglasses in front of a player
      1//Get position 10 blocks in front of player
      2Vector3f position = Utils.VectorUtils.getXYZInFrontOfPlayer(player, 10f);
      3
      4//Get def of aviator sunglasses (internally called "aviators")
      5Clothing.ClothingDefinition def = Definitions.getClothingDefinition("aviators");
      6
      7//Spawn item
      8World.spawnClothingItem(def.id, 0, 1, 0, 0, position, Quaternion.IDENTITY, true);
    • getItem

      public static WorldItem getItem(long globalID)
    • getAllItems

      public static WorldItem[] getAllItems()
      Gets all world items (i.e items that were either spawned through the spawnItem() method or items that have been dropped by players). The result is returned as a new array.
      Returns:
      a new array containing all world items. Never null.
      Example: Get all items and delete every item that is close to the player
      1//The player (delete all items in his proximity)
      2Player player = Server.findPlayer("Playername");
      3
      4//Continue only if we have an actual player object (i.e player != null)
      5if(player != null){
      6 //Get array of all world items
      7 WorldItem[] items = getAllItems();
      8
      9 //Iterate over array
      10 for(WorldItem item : items){
      11 //If distance between player and item is less than 10 units,
      12 //delete the item by calling "item.destroy()"
      13 if(item.getPosition().distance(player.getPosition()) <= 10){
      14 item.destroy();
      15 }
      16 }
      17}
    • getAllItemsInRange

      public static WorldItem[] getAllItemsInRange(Vector3f position, float range)
      Gets all world items (i.e items that were either spawned through the spawnItem() method or items that have been dropped by players) which are in range to a specific world position. The result is returned as a new array.
      Parameters:
      position - the world position where you want to look for items.
      range - the max range (only items within this range will be taken into account).
      Returns:
      a new array containing all world items which are in range to the given world position. Never null.
      Example: Apply impulse to all items close to the player
      1//Get all items close to the player
      2Vector3f position = player.getPosition();
      3WorldItem[] items = World.getAllItemsInRange(position, 20f);
      4
      5//Iterate through the array
      6for(WorldItem item : items){
      7 //Get item position
      8 Vector3f itemPosition = item.getPosition();
      9
      10 //Calculate vector from item pos to our world pos
      11 Vector3f impulse = position.subtract(itemPosition).normalizeLocal();
      12
      13 //Set impulse strength to 10 (by multiplying the vector)
      14 impulse.multLocal(10);
      15
      16 //Apply impulse to item
      17 item.applyPhysicalImpulse(impulse);
      18}
    • getAllItemsInArea

      public static WorldItem[] getAllItemsInArea(Area area)
    • findNearestItem

      public static WorldItem findNearestItem(Vector3f position)
      Gets the world item which has the shortest distance to a position.
      Parameters:
      position - the world position.
      Returns:
      the closest item, or null if no world item exists.
    • findNearestItem

      public static WorldItem findNearestItem(short itemID, Vector3f position)
    • getNumItems

      public static int getNumItems()
      Gets the current amount of global world items (i.e items that have either been spawned by calling spawnItem(short, int, int, net.risingworld.api.utils.Vector3f, net.risingworld.api.utils.Quaternion, boolean), or items that have been dropped by players).
      Returns:
      the current amount of global world items.
    • spawnNpc

      public static Npc spawnNpc(short typeID, Vector3f position, Quaternion rotation)
      Spawns a new npc in the world.
      Parameters:
      typeID - the npc type id.
      position - the global npc position.
      rotation - the rotation of the npc.
      Returns:
      the newly spawned npc.
      Example: Spawn npc by using definitions
      1//Get npc definition of a cow
      2Npcs.NpcDefinition npcDef = Definitions.getNpcDefinition("cow");
      3
      4//Get position in front of player
      5Vector3f position = Utils.VectorUtils.getXYZInFrontOfPlayer(player, 5f);
      6
      7//We want the npc to look towards the player. First we have to calculate the
      8//direction to the player (target - origin)
      9Vector3f playerPos = player.getPosition();
      10Vector3f direction = playerPos.subtract(position).normalizeLocal();
      11
      12//Calculate rotation (quaternion)
      13Quaternion rotation = new Quaternion();
      14rotation.lookAt(direction);
      15
      16//Spawn the npc
      17World.spawnNpc(npcDef.id, position, rotation);
    • spawnNpc

      public static Npc spawnNpc(short typeID, int variant, Vector3f position, Quaternion rotation)
      Spawns a new npc in the world.
      Parameters:
      typeID - the npc type id.
      variant - the variant of the npc. Only certain npc have different variants. Default is 0.
      position - the global npc position.
      rotation - the rotation of the npc.
      Returns:
      the newly spawned npc.
    • spawnNpc

      public static Npc spawnNpc(short typeID, int variant, Vector3f position, Quaternion rotation, boolean temporary)
      Spawns a new npc in the world.
      Parameters:
      typeID - the npc type id.
      variant - the variant of the npc. Only certain npc have different variants. Default is 0.
      position - the global npc position.
      rotation - the rotation of the npc.
      temporary - if set to true, the npc will not be stored in the world database. This means the npc will despawn if the server restarts.
      Returns:
      the newly spawned npc.
    • getNpc

      public static Npc getNpc(long globalID)
    • getAllNpcs

      public static Npc[] getAllNpcs()
      Gets all npcs which are spawned in this world. The result is returned as a new array.
      Returns:
      an array containing all npcs in the world. Never null.
      Example: Kill all npcs if their health is lower than 10 hp
      1Npc[] npcs = World.getAllNpcs();
      2for(Npc npc : npcs){
      3 if(npc.getHealth() < 10){
      4 npc.kill();
      5 }
      6}
    • getAllNpcsInRange

      public static Npc[] getAllNpcsInRange(Vector3f position, float range)
      Gets all npcs which are in range to a specific world position. The result is returned as a new array.
      Parameters:
      position - the world position where you want to look for npcs.
      range - the max range (only npcs within this range will be taken into account).
      Returns:
      an array containing all npcs which are in range to the given world position. Never null.
    • getAllNpcsInArea

      public static Npc[] getAllNpcsInArea(Area area)
      Gets all npcs which are inside an area. The result is returned as a new array.
      Parameters:
      area - the area.
      Returns:
      an array containing all npcs which are inside the provided area. Never null.
    • getNumNpcs

      public static int getNumNpcs()
      Gets the current amount of npcs in the world.
      Returns:
      the current amount of npcs.
    • getNextNpcGroupID

      public static int getNextNpcGroupID()
      Gets the next "free" (unused) group ID for npcs. Call this method to get an ID which hasn't been used.
      Returns:
      the next unuused group ID.
    • findNearestNpc

      public static Npc findNearestNpc(Vector3f position)
      Gets the npc (any npc) which has the shortest distance to a world position.
      Parameters:
      position - the world position.
      Returns:
      the closest npc, or null if no npc exists.
    • findNearestNpc

      public static Npc findNearestNpc(float x, float y, float z)
      Gets the npc (any npc) which has the shortest distance to a world position.
      Parameters:
      x - the world x position.
      y - the world y position.
      z - the world z position.
      Returns:
      the closest npc, or null if no npc exists.
    • findNearestNpc

      public static Npc findNearestNpc(short typeID, Vector3f position)
      Gets the npc (with a certain type id) which has the shortest distance to a world position.
      Parameters:
      typeID - the npc type id.
      position - the world position.
      Returns:
      the closest npc, or null if no npc exists.
    • findNearestNpc

      public static Npc findNearestNpc(short typeID, float x, float y, float z)
      Gets the npc (with a certain type id) which has the shortest distance to a world position.
      Parameters:
      typeID - the npc type id.
      x - the world x position.
      y - the world y position.
      z - the world z position.
      Returns:
      the closest npc, or null if no npc exists.
    • spawnNpc

      public static Npc spawnNpc(short typeID, byte variation, Vector3f position, Quaternion rotation, boolean temporary)
    • isNpcDisabled

      public static boolean isNpcDisabled(short typeID)
      Checks whether or not this npc is disabled on this world (i.e if this npc was disabled upon world creation). Please note: Even if an npc is disabled, this only affects natural spawns. It can still be spawned via command or through the API.
      Parameters:
      typeID - the npc type id.
      Returns:
      true if the npc was disabled on this world (which only prevents the npc from spawning naturally), false if not.
    • createObject

      public static ObjectElement createObject(int typeID, int variant, int color, Vector3f worldPosition, Quaternion rotation, Vector3f scale)
      Spawns a new object (e.g doors, furniture, lamps etc) at a given position. The newly created object instance is returned.
      Parameters:
      typeID - the object type id.
      variant - the optional object variant. By default 0.
      color - an optional rgba color for the object. Set to 0 for no color.
      worldPosition - the world position where you want to spawn the object.
      rotation - the object rotation. Set to Quaternion.IDENTITY for no rotation.
      scale - an optional scale for the object. By default 1 1 1 (or Vector3f.ONE).
      Returns:
      the newly created object instance (or null if the object could not be created).
      Example: Spawn a workbench at the player position
      1//Target position for our object
      2Vector3f pos = player.getPosition();
      3
      4//Get object definition
      5Objects.ObjectDefinition def = Definitions.getObjectDefinition("workbench");
      6
      7//Spawn object
      8World.createObject(def.id, 0, 0, pos, Quaternion.IDENTITY, Vector3f.ONE);
    • getObject

      public static ObjectElement getObject(long globalID, int cx, int cy, int cz)
      Gets an object element that is placed in the world. Objects are elements like furniture, doors, lamps etc. They are typically placed by players, but could also be naturally spawned (e.g in dungeons).
      Parameters:
      globalID - the unique global ID of the object.
      cx - the x coordinate of the chunk which holds the object.
      cy - the y coordinate of the chunk which holds the object.
      cz - the z coordinate of the chunk which holds the object.
      Returns:
      an object instance representing the object element in the world, or null if this object does not exist.
    • getMetaObject

      public static MetaObject getMetaObject(long globalID)
      Gets a meta object. This is typically any kind of processing station, like a furnace, a grinder, paper press etc. Usually a meta object is bound to an actual ObjectElement - in this case, the ID of the meta object is the global ID of the object.
      Parameters:
      globalID - the unique object ID.
      Returns:
      the meta object, or null if no such meta object was found.
      Example: Check the fuel level of a furnace
      1//Get any object
      2ObjectElement o = World.getObject(...);
      3
      4//Check if object is a furnace (which is a meta object)
      5Objects.ObjectDefinition def = o.getDefinition();
      6if(def.type == Type.Furnace){
      7 //Get meta object
      8 MetaObject furnace = World.getMetaObject(o.globalID);
      9
      10 //Check if meta object is not null and if this furnace requires fuel
      11 if(furnace != null && furnace.requiresFuel()){
      12 //Get fuel lvl
      13 int fuel = furnace.getFuel();
      14 }
      15}
    • removeObject

      public static void removeObject(long globalID, int cx, int cy, int cz, boolean destroy)
    • getSign

      public static Sign getSign(long globalID)
      Gets a sign instance. It's typically bound to an ObjectElement (i.e an actual sign object in the world).
      Parameters:
      globalID - the unique ID of the sign object (i.e the object global ID).
      Returns:
      a sign instance, or null if no such sign exists.
    • createConstructionElement

      public static ConstructionElement createConstructionElement(int shape, int texture, float textureScale, int color, Vector3f worldPosition, Quaternion rotation, Vector3f scale)
      Spawns a new construction element (i.e a block) at a given position. The newly created element instance is returned.
      Parameters:
      shape - the shape / type id you want to spawn.
      texture - the texture id for the construction element.
      textureScale - an optional scale factor for the texture. Default 1.
      color - an optional rgba color for the element. Set to 0 for no color.
      worldPosition - the world position where you want to spawn the element.
      rotation - the element rotation. Set to Quaternion.IDENTITY for no rotation.
      scale - an optional scale for the element. By default 1 1 1 (or Vector3f.ONE).
      Returns:
      the newly created construction element instance (or null if the element could not be created).
    • createConstructionElement

      public static ConstructionElement createConstructionElement(int shape, int texture, float textureScale, int color, Vector3f worldPosition, Quaternion rotation, Vector3f scale, Vector3f surfaceOffset, Vector3f surfaceScale)
      Spawns a new construction element (i.e a block) at a given position. The newly created element instance is returned.
      Parameters:
      shape - the shape / type id you want to spawn.
      texture - the texture id for the construction element.
      textureScale - an optional scale factor for the texture. Default 1.
      color - an optional rgba color for the element. Set to 0 for no color.
      worldPosition - the world position where you want to spawn the element.
      rotation - the element rotation. Set to Quaternion.IDENTITY for no rotation.
      scale - an optional scale for the element. By default 1 1 1 (or Vector3f.ONE).
      surfaceOffset - an optional offset for the upper surface. By default 0 0 0 (or Vector3f.ZERO).
      surfaceScale - an optional scale factor for the upper surface. By default 1 1 1 (or Vector3f.ONE).
      Returns:
      the newly created construction element instance (or null if the element could not be created).
    • createConstructionElement

      public static ConstructionElement createConstructionElement(int shape, int texture, float textureScale, int color, Vector3i chunkPosition, Vector3i blockPosition, Quaternion rotation, Vector3f scale)
      Spawns a new construction element (i.e a block) at a given position. The newly created element instance is returned.
      Parameters:
      shape - the shape / type id you want to spawn.
      texture - the texture id for the construction element.
      textureScale - an optional scale factor for the texture. Default 1.
      color - an optional rgba color for the element. Set to 0 for no color.
      chunkPosition - the coordinates of the chunk where you want to place the element.
      blockPosition - the block position inside that chunk where you want to place the element.
      rotation - the element rotation. Set to Quaternion.IDENTITY for no rotation.
      scale - an optional scale for the element. By default 1 1 1 (or Vector3f.ONE).
      Returns:
      the newly created construction element instance (or null if the element could not be created).
    • getConstructionElement

      public static ConstructionElement getConstructionElement(long globalID, int cx, int cy, int cz)
      Gets a construction element that is placed in the world. This covers all type of building elements like blocks, glass panes, window frames etc. Construction elements are typically placed by players, but could also be naturally spawned (e.g as dungeons).
      Parameters:
      globalID - the unique global ID of the construction element.
      cx - the x coordinate of the chunk which holds the construction element.
      cy - the y coordinate of the chunk which holds the construction element.
      cz - the z coordinate of the chunk which holds the construction element.
      Returns:
      an instance representing the construction element in the world, or null if this element does not exist.
    • removeConstructionElement

      public static void removeConstructionElement(long globalID, int cx, int cy, int cz, boolean destroy)
    • createPlant

      public static Plant createPlant(int typeID, Vector3f worldPosition, Quaternion rotation, Vector3f scale)
    • getPlant

      public static Plant getPlant(long globalID, int cx, int cy, int cz)
    • removePlant

      public static void removePlant(long globalID, int cx, int cy, int cz, boolean cutOnly, boolean destroy)
    • setTerrainData

      public static void setTerrainData(int terrainID, int cx, int cy, int cz, int bx, int by, int bz, EditRestriction restriction)
      Changes the terrain ID at a given position.
      Parameters:
      terrainID - the new terrain ID you want to set. Air is 0.
      cx - the chunk x coordinate.
      cy - the chunk y coordinate.
      cz - the chunk z coordinate.
      bx - the block x coordinate within the chunk (0-32).
      by - the block y coordinate within the chunk (0-64).
      bz - the block z coordinate within the chunk (0-32).
      restriction - an optional edit restriction. This allows you to modify certain terrain materials only (e.g only water or only solid materials etc). Set to null or None for no restriction.
    • setTerrainDataInArea

      public static void setTerrainDataInArea(int terrainID, Area area, EditRestriction restriction)
      Modifies terrain within a given area.
      Parameters:
      terrainID - the new terrain ID you want to set. Air is 0.
      area - the area you want to modify.
      restriction - an optional edit restriction. This allows you to modify certain terrain materials only (e.g only water or only solid materials etc). Set to null or None for no restriction.
    • setTerrainDataInArea

      public static void setTerrainDataInArea(int terrainID, Vector3i startChunk, Vector3i startBlock, Vector3i endChunk, Vector3i endBlock, EditRestriction restriction)
      Modifies terrain within a given area.
      Parameters:
      terrainID - the new terrain ID you want to set. Air is 0.
      startChunk - the start chunk position.
      startBlock - the start block position (within the start chunk).
      endChunk - the end chunk position.
      endBlock - the end block position (within the end chunk).
      restriction - an optional edit restriction. This allows you to modify certain terrain materials only (e.g only water or only solid materials etc). Set to null or None for no restriction.
    • setTerrainDataInRadius

      public static void setTerrainDataInRadius(int terrainID, int cx, int cy, int cz, int bx, int by, int bz, int radius, EditRestriction restriction)
      Modifies terrain at a given position within a certain radius (spherical). Note: If the block coordinates exceed the chunk bounds, the chunk coordinates will be recalculated.
      Parameters:
      terrainID - the new terrain ID you want to set. Air is 0.
      cx - the chunk x coordinate.
      cy - the chunk y coordinate.
      cz - the chunk z coordinate.
      bx - the block x coordinate within the chunk (0-32).
      by - the block y coordinate within the chunk (0-64).
      bz - the block z coordinate within the chunk (0-32).
      radius - the radius (in blocks) of the affected area.
      restriction - an optional edit restriction. This allows you to modify certain terrain materials only (e.g only water or only solid materials etc). Set to null or None for no restriction.
      Example: Create a hole around the player
      1//Get player chunk and block position
      2Vector3i chunkPos = player.getChunkPosition();
      3Vector3i blockPos = player.getBlockPosition();
      4
      5//Fill radius (16) around player with air (id 0)
      6World.setTerrainDataInRadius(0, chunkPos.x, chunkPos.y, chunkPos.z, blockPos.x, blockPos.y, blockPos.z, 16, EditRestriction.None);

      Example: Turn water around player into ice
      1//Get player chunk and block position
      2Vector3i chunkPos = player.getChunkPosition();
      3Vector3i blockPos = player.getBlockPosition();
      4
      5//Fill radius (32) around player with ice (id 26). Set EditRestriction to WaterOnly
      6World.setTerrainDataInRadius(26, chunkPos.x, chunkPos.y, chunkPos.z, blockPos.x, blockPos.y, blockPos.z, 32, EditRestriction.WaterOnly);
    • executeWorldEditBatch

      public static void executeWorldEditBatch(WorldEditBatch batch)
      Performs a world edit batch, i.e multiple world edits at once. If you want to perform multiple edits, this method is usually much more performant compared to single terrain edits.
      Parameters:
      batch - the WorldEditBatch object containing the batch data.
      Example: Clear a whole chunk (fill with air, id 0)
      1Vector3i c = player.getChunkPosition();
      2
      3//Create a batch object (it is reusable btw)
      4WorldEditBatch batch = new WorldEditBatch();
      5
      6//Populate the batch object with data
      7for (int x = 0; x < Chunk.SIZE_X; x++) {
      8 for (int y = 0; y < ChunkPart.SIZE_Y; y++) {
      9 for (int z = 0; z < Chunk.SIZE_Z; z++) {
      10 //Add the edit data to the batch (id 0, chunk and block pos)
      11 batch.add(0, c.x, c.y, c.z, x, y, z);
      12 }
      13 }
      14}
      15
      16//Execute the batch
      17World.executeWorldEditBatch(batch);

      Example: Create a hole with size 16x16x16 around the player
      1Vector3i c = player.getChunkPosition();
      2Vector3i b = player.getBlockPosition();
      3
      4//Create a batch object with optional initial capacity
      5WorldEditBatch batch = new WorldEditBatch(16 * 16 * 16);
      6
      7//Populate the batch object with data
      8for(int dx = -8; dx < 8; dx++) {
      9 for(int dy = -8; dy < 8; dy++) {
      10 for(int dz = -8; dz < 8; dz++) {
      11 //Check if delta is within 8 block radius
      12 if(Utils.MathUtils.length(dx, dy, dz) <= 8) {
      13 //Add to batch. We don't have to recalculate the chunk pos, that's done automatically
      14 batch.add(0, c.x, c.y, c.z, b.x + dx, b.y + dy, b.z + dz);
      15 }
      16 }
      17 }
      18}
      19
      20//Execute the batch
      21World.executeWorldEditBatch(batch);
    • getChunk

      public static Chunk getChunk(int cx, int cz)
      Gets a chunk.
      Parameters:
      cx - the chunk x offset.
      cz - the chunk z offset.
      Returns:
      the chunk object. Never null.
    • getChunkPart

      public static ChunkPart getChunkPart(int cx, int cy, int cz)
      Gets a chunk part.
      Parameters:
      cx - the chunk part x offset.
      cy - the chunk part y offset (vertical).
      cz - the chunk part z offset.
      Returns:
      the chunk object.