Package net.risingworld.api.definitions
Class Definitions
java.lang.Object
net.risingworld.api.definitions.Definitions
A static class which provides access to various game definitions. Almost all definitions are stored in
the "definitions.db" SQLite database file (which is located in the
/Data/StreamingAssets/
folder
in the game directory).-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Clothing.ClothingDefinition[]
Gets an array containing all clothing definitions of the game.static Constructions.ConstructionDefinition[]
Gets an array containing all construction definitions of the game.static Items.ConsumeInfo[]
Gets an array containing all consume definitions of the game.static Crafting.CraftingStation[]
Gets an array containing all crafting station definitions of the game.static Items.ItemDefinition[]
Gets an array containing all item definitions of the game.static Items.ItemInfo[]
Gets an array containing all item info definitions of the game.static Npcs.NpcDefinition[]
Gets an array containing all npc definitions of the game.static Objects.ObjectDefinition[]
Gets an array containing all object definitions of the game.static Objects.ObjectInfoDefinition[]
static Items.PickingInfo[]
Gets an array containing all picking info definitions of the game.static Plants.PlantDefinition[]
Gets an array containing all plant definitions of the game.static Items.ProjectileDefinition[]
Gets an array containing all projectile definitions of the game.static Crafting.Recipe[]
Gets an array containing all crafting recipes of the game.static Objects.StorageDefinition[]
Gets an array containing all storage definitions of the game.static Vehicles.VehicleAssembly[]
Gets an array containing all vehicle assembly definitions of the game.static Vehicles.VehicleComponent[]
Gets an array containing all vehicle component definitions of the game.static Vehicles.VehicleDefinition[]
Gets an array containing all vehicle definitions of the game.static Items.WeaponDefinition[]
static WeatherDefs.Weather[]
Gets an array containing all weather definitions of the game.static Clothing.ClothingDefinition
getClothingDefinition
(int id) Gets a clothing definition by id.static Clothing.ClothingDefinition
getClothingDefinition
(String name) Gets a clothing definition by name, using the internal name (e.g "mininghelmet"), not the localized name!getConstructionDefinition
(int id) Gets a construction definition by id.Gets a construction definition by name, using the internal name (e.g "block").static Items.ConsumeInfo
getConsumeInfo
(String name) static Crafting.CraftingStation
getCraftingStation
(String name) Gets a crafting station definition by name.static Items.ItemDefinition
getItemDefinition
(int id) Gets an item definition by id.static Items.ItemDefinition
getItemDefinition
(String name) Gets an item definition by name, using the internal name (e.g "pickaxe"), not the localized name!static Items.ItemInfo
getItemInfo
(String name, Items.ItemInfoType type) static Items.ItemInfo
getItemInfo
(Items.ItemDefinition itemDefinition, Items.ItemInfoType type) static Items.ItemDefinition.Variant
getItemVariant
(String item, int variant) Gets an item variant definition, determines by the item definition name and the according variant.static Npcs.NpcDefinition
getNpcDefinition
(int id) Gets an npc definition by id.static Npcs.NpcDefinition
getNpcDefinition
(String name) Gets an npc definition by name, using the internal name (e.g "cow" or "goat" etc).static Objects.ObjectDefinition
getObjectDefinition
(int id) Gets an object definition by id.static Objects.ObjectDefinition
getObjectDefinition
(String name) Gets an object definition by name, using the internal name (e.g "workbench"), not the localized name!static Objects.ObjectInfoDefinition
static Objects.ObjectInfoDefinition
getObjectInfoDefinitionByTypeID
(int typeID) static Items.PickingInfo
getPickingInfo
(String name) static Plants.PlantDefinition
getPlantDefinition
(int id) Gets a plant definition by id.static Plants.PlantDefinition
getPlantDefinition
(String name) Gets a plant definition by name, using the internal name (e.g "tomato" or "spruceforest" etc).static Items.ProjectileDefinition
getProjectileDefinition
(int id) static Items.ProjectileDefinition
static Crafting.Recipe
Gets a crafting recipe by id.static Crafting.Recipe
Gets a crafting recipe by id and texture.static Objects.StorageDefinition
getStorageDefinition
(String name) Gets a storage definition by name, using the internal name (e.g "chest1" or "leathertrunk" etc).static Vehicles.VehicleAssembly
getVehicleAssembly
(String name, int constructionStage) Gets a vehicle assembly definition by vehicle name and construction stage.static Vehicles.VehicleDefinition
getVehicleDefinition
(int id) Gets a vehicle definition by id.static Vehicles.VehicleDefinition
getVehicleDefinition
(String name) Gets a vehicle definition by name.static Items.WeaponDefinition
getWeaponDefinition
(String name) static WeatherDefs.Weather
getWeather
(int id) Gets a weather definition by id.static WeatherDefs.Weather
getWeather
(String name) Gets a weather definition by name, using the internal name (e.g "overcast" or "default" etc).
-
Constructor Details
-
Definitions
public Definitions()
-
-
Method Details
-
getItemDefinition
Gets an item definition by id.- Parameters:
id
- the id of the item definition.- Returns:
- the definition, or null if no such definition exists.
-
getItemDefinition
Gets an item definition by name, using the internal name (e.g "pickaxe"), not the localized name!- Parameters:
name
- the internal name of the item definition.- Returns:
- the definition, or null if no such definition exists.
- Example: Get item definition by name
-
getAllItemDefinitions
Gets an array containing all item definitions of the game. Please note that the array may contain null entries!- Returns:
- a new array containing all item definitions.
- Example: Print names of all existing items
-
getItemVariant
Gets an item variant definition, determines by the item definition name and the according variant. Only few items actually have variants. Most items only have the default variant (0).- Parameters:
item
- the internal name of the item definition you want to get the variant for.variant
- the variant. Default variant is 0.- Returns:
- the variant definition, or null if no such variant/definition exists.
-
getObjectDefinition
Gets an object definition by id.- Parameters:
id
- the id of the object definition.- Returns:
- the definition, or null if no such definition exists.
-
getObjectDefinition
Gets an object definition by name, using the internal name (e.g "workbench"), not the localized name!- Parameters:
name
- the internal name of the object definition.- Returns:
- the definition, or null if no such definition exists.
-
getAllObjectDefinitions
Gets an array containing all object definitions of the game. Please note that the array may contain null entries!- Returns:
- a new array containing all object definitions.
-
getConstructionDefinition
Gets a construction definition by id.- Parameters:
id
- the id of the construction definition.- Returns:
- the definition, or null if no such definition exists.
-
getConstructionDefinition
Gets a construction definition by name, using the internal name (e.g "block").- Parameters:
name
- the internal name of the construction definition.- Returns:
- the definition, or null if no such definition exists.
-
getAllConstructionDefinitions
Gets an array containing all construction definitions of the game. Please note that the array may contain null entries!- Returns:
- a new array containing all construction definitions.
-
getPlantDefinition
Gets a plant definition by id.- Parameters:
id
- the id of the plant definition.- Returns:
- the definition, or null if no such definition exists.
-
getPlantDefinition
Gets a plant definition by name, using the internal name (e.g "tomato" or "spruceforest" etc).- Parameters:
name
- the internal name of the plant definition.- Returns:
- the definition, or null if no such definition exists.
-
getAllPlantDefinitions
Gets an array containing all plant definitions of the game. Please note that the array may contain null entries!- Returns:
- a new array containing all plant definitions.
-
getClothingDefinition
Gets a clothing definition by id.- Parameters:
id
- the id of the clothing definition.- Returns:
- the definition, or null if no such definition exists.
-
getClothingDefinition
Gets a clothing definition by name, using the internal name (e.g "mininghelmet"), not the localized name!- Parameters:
name
- the internal name of the clothing definition.- Returns:
- the definition, or null if no such definition exists.
-
getAllClothingDefinitions
Gets an array containing all clothing definitions of the game. Please note that the array may contain null entries!- Returns:
- a new array containing all clothing definitions.
-
getNpcDefinition
Gets an npc definition by id.- Parameters:
id
- the id of the npc definition.- Returns:
- the definition, or null if no such definition exists.
-
getNpcDefinition
Gets an npc definition by name, using the internal name (e.g "cow" or "goat" etc).- Parameters:
name
- the internal name of the npc definition.- Returns:
- the definition, or null if no such definition exists.
-
getAllNpcDefinitions
Gets an array containing all npc definitions of the game. Please note that the array may contain null entries!- Returns:
- a new array containing all npc definitions.
-
getStorageDefinition
Gets a storage definition by name, using the internal name (e.g "chest1" or "leathertrunk" etc).- Parameters:
name
- the internal name of the storage definition.- Returns:
- the definition, or null if no such definition exists.
-
getAllStorageDefinitions
Gets an array containing all storage definitions of the game. Please note that the array may contain null entries!- Returns:
- a new array containing all storage definitions.
-
getObjectInfoDefinition
-
getObjectInfoDefinitionByTypeID
-
getAllObjectInfoDefinitions
-
getCraftingStation
Gets a crafting station definition by name. The name is usually the internal name of the related object element (e.g. "workbench", "anvil" etc).- Parameters:
name
- the name of the crafting station (usually the internal object name).- Returns:
- the definition, or null if no such definition exists.
-
getAllCraftingStations
Gets an array containing all crafting station definitions of the game. Please note that the array may contain null entries!- Returns:
- a new array containing all crafting station definitions.
-
getRecipe
Gets a crafting recipe by id. The name is usually the internal name of the related item or object (e.g. "pickaxe", "table" etc). If the target item/object has multiple variants, this recipe always represents the default variant.- Parameters:
name
- the name of the recipe (usually the internal name of the item/object represented by this recipe).- Returns:
- the recipe, or null if no such recipe exists.
- See Also:
-
getRecipe
Gets a crafting recipe by id and texture. The name is usually the internal name of the related item or object (e.g. "pickaxe", "table" etc). The texture represents the item texture or variant.- Parameters:
name
- the name of the recipe (usually the internal name of the item/object represented by this recipe).itemTexture
- the target item/object texture/variant. For blocks, this is the target texture. For other items or objects, it's the optional variant.- Returns:
- the recipe, or null if no such recipe exists.
-
getAllRecipes
Gets an array containing all crafting recipes of the game. Please note that the array may contain null entries!- Returns:
- a new array containing all recipes.
-
getPickingInfo
-
getAllPickingInfos
Gets an array containing all picking info definitions of the game. Please note that the array may contain null entries!- Returns:
- a new array containing all picking info definitions.
-
getItemInfo
-
getItemInfo
public static Items.ItemInfo getItemInfo(Items.ItemDefinition itemDefinition, Items.ItemInfoType type) -
getAllItemInfos
Gets an array containing all item info definitions of the game. Please note that the array may contain null entries!- Returns:
- a new array containing all item info definitions.
-
getWeaponDefinition
-
getAllWeaponDefinitions
-
getConsumeInfo
-
getAllConsumeInfos
Gets an array containing all consume definitions of the game. Please note that the array may contain null entries!- Returns:
- a new array containing all consume definitions.
-
getProjectileDefinition
-
getProjectileDefinition
-
getAllProjectileDefinitions
Gets an array containing all projectile definitions of the game. Please note that the array may contain null entries!- Returns:
- a new array containing all projectile definitions.
-
getVehicleDefinition
Gets a vehicle definition by id.- Parameters:
id
- the id of the vehicle definition.- Returns:
- the definition, or null if no such definition exists.
-
getVehicleDefinition
Gets a vehicle definition by name.- Parameters:
name
- the internal name of the vehicle.- Returns:
- the definition, or null if no such definition exists.
-
getAllVehicleDefinitions
Gets an array containing all vehicle definitions of the game. Please note that the array may contain null entries!- Returns:
- a new array containing all vehicle definitions.
-
getAllVehicleComponents
Gets an array containing all vehicle component definitions of the game. Please note that the array may contain null entries!- Returns:
- a new array containing all vehicle components.
-
getVehicleAssembly
Gets a vehicle assembly definition by vehicle name and construction stage.- Parameters:
name
- the internal name of the vehicle.constructionStage
- the construction stage.- Returns:
- the vehicle assembly definition, or null if no such definition exists.
-
getAllVehicleAssemblies
Gets an array containing all vehicle assembly definitions of the game. Please note that the array may contain null entries!- Returns:
- a new array containing all vehicle assemblies.
-
getWeather
Gets a weather definition by id.- Parameters:
id
- the id of the weather definition.- Returns:
- the definition, or null if no such definition exists.
-
getWeather
Gets a weather definition by name, using the internal name (e.g "overcast" or "default" etc).- Parameters:
name
- the internal name of the weather definition.- Returns:
- the definition, or null if no such definition exists.
-
getAllWeathers
Gets an array containing all weather definitions of the game. Please note that the array may contain null entries!- Returns:
- a new array containing all weather definitions.
-