Cuberite
A lightweight, fast and extensible game server for Minecraft
|
Go to the source code of this file.
Functions | |
int | BlockStringToType (const AString &a_BlockTypeString) |
Translates a blocktype string into blocktype. More... | |
AString | DamageTypeToString (eDamageType a_DamageType) |
Translates damage type constant to a string representation (built-in). More... | |
AString | DimensionToString (eDimension a_Dimension) |
Translates a dimension enum to dimension string. More... | |
cItem | GetIniItemSet (cIniFile &a_IniFile, const char *a_Section, const char *a_Key, const char *a_Default) |
Returns a cItem representing the item described in an IniFile's value; if the value doesn't exist, creates it with the provided default. More... | |
template<class = void> | |
bool | IsOneOf (BLOCKTYPE a_BlockType) |
Base case for IsOneOf to handle empty template aguments. More... | |
template<BLOCKTYPE Head, BLOCKTYPE... Tail> | |
bool | IsOneOf (BLOCKTYPE a_BlockType) |
Returns true if a_BlockType is equal to any of the variadic template arguments. More... | |
AString | ItemToFullString (const cItem &a_Item) |
Translates a full item into a fully-specified string (including meta and count). More... | |
AString | ItemToString (const cItem &a_Item) |
Translates a full item into a string. More... | |
AString | ItemTypeToString (short a_ItemType) |
Translates itemtype into a string. More... | |
eDamageType | StringToDamageType (const AString &a_DamageString) |
Translates a damage type string to damage type. More... | |
eDimension | StringToDimension (const AString &a_DimensionString) |
Translates a dimension string to dimension enum. More... | |
bool | StringToItem (const AString &a_ItemTypeString, cItem &a_Item) |
Translates an itemtype string into an item. More... | |
enum eDamageType |
Damage type, used in the TakeDamageInfo structure and related functions.
enum eDimension |
enum eExplosionSource |
The source of an explosion.
Also dictates the type of the additional data passed to the explosion handlers: | esBed | Vector3i * | Bed exploding in the Nether or in the End | esEnderCrystal | cEnderCrystal * | | esGhastFireball | cGhastFireballEntity * | | esMonster | cMonster * | | esOther | nullptr | Any other explosion unaccounted for | esPlugin | nullptr | Explosion primarily attributed to a plugin | esPrimedTNT | cTNTEntity * | | esWitherBirth | cMonster * | | esWitherSkull | cProjectileEntity * |
Enumerator | |
---|---|
esBed | |
esEnderCrystal | |
esGhastFireball | |
esMonster | |
esOther | |
esPlugin | |
esPrimedTNT | |
esWitherBirth | |
esWitherSkull | |
esMax |
enum ENUM_BLOCK_ID : BLOCKTYPE |
enum ENUM_BLOCK_META : NIBBLETYPE |
enum ENUM_ITEM_ID : short |
enum ENUM_ITEM_META : short |
enum eShrapnelLevel |
enum eSpreadSource |
int BlockStringToType | ( | const AString & | a_BlockTypeString | ) |
Translates a blocktype string into blocktype.
Takes either a number or an items.ini alias as input. Returns -1 on failure.
Definition at line 218 of file BlockID.cpp.
AString DamageTypeToString | ( | eDamageType | a_DamageType | ) |
Translates damage type constant to a string representation (built-in).
Translates damage type constant to a string representation (built-in).
Definition at line 368 of file BlockID.cpp.
AString DimensionToString | ( | eDimension | a_Dimension | ) |
Translates a dimension enum to dimension string.
Takes an eDimension enum value and returns "Overworld" on failure.
Definition at line 336 of file BlockID.cpp.
cItem GetIniItemSet | ( | cIniFile & | a_IniFile, |
const char * | a_Section, | ||
const char * | a_Key, | ||
const char * | a_Default | ||
) |
Returns a cItem representing the item described in an IniFile's value; if the value doesn't exist, creates it with the provided default.
Definition at line 476 of file BlockID.cpp.
bool IsOneOf | ( | BLOCKTYPE | a_BlockType | ) |
bool IsOneOf | ( | BLOCKTYPE | a_BlockType | ) |
Returns true if a_BlockType is equal to any of the variadic template arguments.
Some example usage:
The implementation is ugly but it is equivalent to this C++17 fold expression:
Just written to be valid without fold expressions or SFINAE.
Translates a full item into a fully-specified string (including meta and count).
If the ItemType is not recognized, the ItemType number is output into the string.
Definition at line 283 of file BlockID.cpp.
Translates a full item into a string.
If the ItemType is not recognized, the ItemType number is output into the string.
Definition at line 257 of file BlockID.cpp.
AString ItemTypeToString | ( | short | a_ItemType | ) |
Translates itemtype into a string.
If the type is not recognized, the itemtype number is output into the string.
Definition at line 270 of file BlockID.cpp.
eDamageType StringToDamageType | ( | const AString & | a_DamageTypeString | ) |
Translates a damage type string to damage type.
Takes either a number or a damage type alias (built-in). Returns -1 on failure
Takes either a number or a damage type alias (built-in). Returns -1 on failure.
Definition at line 401 of file BlockID.cpp.
eDimension StringToDimension | ( | const AString & | a_DimensionString | ) |
Translates a dimension string to dimension enum.
Takes either a number or a dimension alias (built-in). Returns dimOverworld on failure
Definition at line 294 of file BlockID.cpp.
Translates an itemtype string into an item.
Takes either a number, number^number, number:number or an items.ini alias as input. Returns true if successful.
Definition at line 238 of file BlockID.cpp.