Cuberite
A lightweight, fast and extensible game server for Minecraft
Classes | Functions
BlockType.cpp File Reference
#include "Globals.h"
#include "IniFile.h"
#include "Item.h"
#include "Mobs/Monster.h"
Include dependency graph for BlockType.cpp:

Go to the source code of this file.

Classes

class  cBlockIDMap
 
struct  cBlockIDMap::Comparator
 

Functions

int BlockStringToType (const AString &a_BlockTypeString)
 Translates a blocktype string into blocktype. More...
 
static cBlockIDMapGetBlockIDMap ()
 
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...
 
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...
 
bool StringToItem (const AString &a_ItemTypeString, cItem &a_Item)
 Translates an itemtype string into an item. More...
 

Function Documentation

◆ BlockStringToType()

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 212 of file BlockType.cpp.

◆ GetBlockIDMap()

static cBlockIDMap& GetBlockIDMap ( )
static

Definition at line 183 of file BlockType.cpp.

◆ GetIniItemSet()

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 270 of file BlockType.cpp.

◆ ItemToFullString()

AString ItemToFullString ( const cItem a_Item)

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 261 of file BlockType.cpp.

◆ ItemToString()

AString ItemToString ( const cItem a_Item)

Translates a full item into a string.

If the ItemType is not recognized, the ItemType number is output into the string.

Definition at line 243 of file BlockType.cpp.

◆ ItemTypeToString()

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 252 of file BlockType.cpp.

◆ StringToItem()

bool StringToItem ( const AString a_ItemTypeString,
cItem a_Item 
)

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 228 of file BlockType.cpp.