Cuberite
A lightweight, fast and extensible game server for Minecraft
Namespaces | Typedefs | Enumerations | Functions
Defines.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 ItemCategory
 

Typedefs

typedef std::vector< int > cSlotNums
 List of slot numbers, used for inventory-painting. More...
 

Enumerations

enum  {
  DIG_STATUS_STARTED = 0, DIG_STATUS_CANCELLED = 1, DIG_STATUS_FINISHED = 2, DIG_STATUS_DROP_STACK = 3,
  DIG_STATUS_DROP_HELD = 4, DIG_STATUS_SHOOT_EAT = 5, DIG_STATUS_SWAP_ITEM_IN_HAND = 6
}
 PlayerDigging status constants. More...
 
enum  { MAX_EXPERIENCE_ORB_SIZE = 2000 }
 Experience Orb setup. More...
 
enum  eBlockFace {
  BLOCK_FACE_NONE = -1, BLOCK_FACE_XM = 4, BLOCK_FACE_XP = 5, BLOCK_FACE_YM = 0,
  BLOCK_FACE_YP = 1, BLOCK_FACE_ZM = 2, BLOCK_FACE_ZP = 3, BLOCK_FACE_BOTTOM = BLOCK_FACE_YM,
  BLOCK_FACE_TOP = BLOCK_FACE_YP, BLOCK_FACE_NORTH = BLOCK_FACE_ZM, BLOCK_FACE_SOUTH = BLOCK_FACE_ZP, BLOCK_FACE_WEST = BLOCK_FACE_XM,
  BLOCK_FACE_EAST = BLOCK_FACE_XP, BLOCK_FACE_MIN = -1, BLOCK_FACE_MAX = 5
}
 Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc. More...
 
enum  eChatType { ctChatBox = 0, ctSystem = 1, ctAboveActionBar = 2 }
 
enum  eClickAction {
  caLeftClick, caRightClick, caShiftLeftClick, caShiftRightClick,
  caNumber1, caNumber2, caNumber3, caNumber4,
  caNumber5, caNumber6, caNumber7, caNumber8,
  caNumber9, caMiddleClick, caDropKey, caCtrlDropKey,
  caLeftClickOutside, caRightClickOutside, caLeftClickOutsideHoldNothing, caRightClickOutsideHoldNothing,
  caLeftPaintBegin, caRightPaintBegin, caMiddlePaintBegin, caLeftPaintProgress,
  caRightPaintProgress, caMiddlePaintProgress, caLeftPaintEnd, caRightPaintEnd,
  caMiddlePaintEnd, caDblClick, caUnknown = 255
}
 Individual actions sent in the WindowClick packet. More...
 
enum  eGameMode {
  eGameMode_NotSet = -1, eGameMode_Survival = 0, eGameMode_Creative = 1, eGameMode_Adventure = 2,
  eGameMode_Spectator = 3, gmNotSet = eGameMode_NotSet, gmSurvival = eGameMode_Survival, gmCreative = eGameMode_Creative,
  gmAdventure = eGameMode_Adventure, gmSpectator = eGameMode_Spectator, gmMax, gmMin = 0
}
 
enum  eHand { hMain = 0, hOff = 1 }
 
enum  eMainHand { mhLeft = 0, mhRight = 1 }
 
enum  eMessageType {
  mtCustom, mtFailure, mtInformation, mtSuccess,
  mtWarning, mtFatal, mtDeath, mtPrivateMessage,
  mtJoin, mtLeave, mtMaxPlusOne, mtFail = mtFailure,
  mtError = mtFailure, mtInfo = mtInformation, mtPM = mtPrivateMessage
}
 
enum  eMobHeadRotation {
  SKULL_ROTATION_NORTH = 0, SKULL_ROTATION_NORTH_NORTH_EAST = 1, SKULL_ROTATION_NORTH_EAST = 2, SKULL_ROTATION_EAST_NORTH_EAST = 3,
  SKULL_ROTATION_EAST = 4, SKULL_ROTATION_EAST_SOUTH_EAST = 5, SKULL_ROTATION_SOUTH_EAST = 6, SKULL_ROTATION_SOUTH_SOUTH_EAST = 7,
  SKULL_ROTATION_SOUTH = 8, SKULL_ROTATION_SOUTH_SOUTH_WEST = 9, SKULL_ROTATION_SOUTH_WEST = 10, SKULL_ROTATION_WEST_SOUTH_WEST = 11,
  SKULL_ROTATION_WEST = 12, SKULL_ROTATION_WEST_NORTH_WEST = 13, SKULL_ROTATION_NORTH_WEST = 14, SKULL_ROTATION_NORTH_NORTH_WEST = 15
}
 
enum  eMobHeadType {
  SKULL_TYPE_SKELETON = 0, SKULL_TYPE_WITHER = 1, SKULL_TYPE_ZOMBIE = 2, SKULL_TYPE_PLAYER = 3,
  SKULL_TYPE_CREEPER = 4, SKULL_TYPE_DRAGON = 5
}
 
enum  eSkinPart {
  spCape = 0x01, spJacket = 0x02, spLeftSleeve = 0x04, spRightSleeve = 0x08,
  spLeftPants = 0x10, spRightPants = 0x20, spHat = 0x40, spMask = 0x7F
}
 
enum  eWeather {
  eWeather_Sunny = 0, eWeather_Rain = 1, eWeather_ThunderStorm = 2, wSunny = eWeather_Sunny,
  wRain = eWeather_Rain, wThunderstorm = eWeather_ThunderStorm, wStorm = wThunderstorm
}
 

Functions

void AddFaceDirection (int &a_BlockX, int &a_BlockY, int &a_BlockZ, eBlockFace a_BlockFace, bool a_bInverse=false)
 
void AddFaceDirection (int &a_BlockX, unsigned char &a_BlockY, int &a_BlockZ, eBlockFace a_BlockFace, bool a_bInverse=false)
 
AString BlockFaceToString (eBlockFace a_BlockFace)
 Returns the textual representation of the BlockFace constant. More...
 
const char * ClickActionToString (int a_ClickAction)
 
template<class T >
Diff (T a_Val1, T a_Val2)
 
void EulerToVector (double a_Pan, double a_Pitch, double &a_X, double &a_Y, double &a_Z)
 
float GetSignf (float a_Val)
 
float GetSpecialSignf (float a_Val)
 
bool ItemCategory::IsArmor (short a_ItemType)
 
bool ItemCategory::IsAxe (short a_ItemID)
 
bool IsBlockFence (BLOCKTYPE a_BlockType)
 
bool IsBlockIce (BLOCKTYPE a_BlockType)
 
bool IsBlockLava (BLOCKTYPE a_BlockType)
 
bool IsBlockLiquid (BLOCKTYPE a_BlockType)
 
bool IsBlockMaterialAnvil (BLOCKTYPE a_BlockType)
 
bool IsBlockMaterialCoral (BLOCKTYPE a_BlockType)
 
bool IsBlockMaterialGourd (BLOCKTYPE a_BlockType)
 
bool IsBlockMaterialIron (BLOCKTYPE a_BlockType)
 
bool IsBlockMaterialLeaves (BLOCKTYPE a_BlockType)
 
bool IsBlockMaterialPlants (BLOCKTYPE a_BlockType)
 
bool IsBlockMaterialRock (BLOCKTYPE a_BlockType)
 
bool IsBlockMaterialVine (BLOCKTYPE a_BlockType)
 
bool IsBlockMaterialWood (BLOCKTYPE a_BlockType)
 
bool IsBlockRail (BLOCKTYPE a_BlockType)
 
bool IsBlocksWeb (BLOCKTYPE a_BlockType)
 
bool IsBlocksWool (BLOCKTYPE a_BlockType)
 
bool IsBlockTypeOfDirt (BLOCKTYPE a_BlockType)
 
bool IsBlockWater (BLOCKTYPE a_BlockType)
 
bool IsBlockWaterOrIce (BLOCKTYPE a_BlockType)
 
bool ItemCategory::IsBoots (short a_ItemType)
 
bool ItemCategory::IsChestPlate (short a_ItemType)
 
bool ItemCategory::IsHelmet (short a_ItemType)
 
bool ItemCategory::IsHoe (short a_ItemID)
 
bool ItemCategory::IsHorseArmor (short a_ItemType)
 
bool ItemCategory::IsLeggings (short a_ItemType)
 
bool ItemCategory::IsMinecart (short a_ItemType)
 
bool ItemCategory::IsPickaxe (short a_ItemID)
 
bool ItemCategory::IsShovel (short a_ItemID)
 
bool ItemCategory::IsSword (short a_ItemID)
 
bool ItemCategory::IsTool (short a_ItemID)
 
bool IsValidBlock (int a_BlockType)
 
bool IsValidItem (int a_ItemType)
 
eBlockFace MirrorBlockFaceY (eBlockFace a_BlockFace)
 Returns a blockface mirrored around the Y axis (doesn't change up / down). More...
 
double NormalizeAngleDegrees (const double a_Degrees)
 Normalizes an angle in degrees to the [-180, +180) range: More...
 
eBlockFace ReverseBlockFace (eBlockFace a_BlockFace)
 
eBlockFace RotateBlockFaceCCW (eBlockFace a_BlockFace)
 Returns a blockface rotated around the Y axis counter-clockwise. More...
 
eBlockFace RotateBlockFaceCW (eBlockFace a_BlockFace)
 
void VectorToEuler (double a_X, double a_Y, double a_Z, double &a_Pan, double &a_Pitch)
 

Typedef Documentation

typedef std::vector<int> cSlotNums

List of slot numbers, used for inventory-painting.

Definition at line 9 of file Defines.h.

Enumeration Type Documentation

anonymous enum

PlayerDigging status constants.

Enumerator
DIG_STATUS_STARTED 
DIG_STATUS_CANCELLED 
DIG_STATUS_FINISHED 
DIG_STATUS_DROP_STACK 
DIG_STATUS_DROP_HELD 
DIG_STATUS_SHOOT_EAT 
DIG_STATUS_SWAP_ITEM_IN_HAND 

Definition at line 57 of file Defines.h.

anonymous enum

Experience Orb setup.

Enumerator
MAX_EXPERIENCE_ORB_SIZE 

Definition at line 18 of file Defines.h.

enum eBlockFace

Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc.

Enumerator
BLOCK_FACE_NONE 
BLOCK_FACE_XM 
BLOCK_FACE_XP 
BLOCK_FACE_YM 
BLOCK_FACE_YP 
BLOCK_FACE_ZM 
BLOCK_FACE_ZP 
BLOCK_FACE_BOTTOM 
BLOCK_FACE_TOP 
BLOCK_FACE_NORTH 
BLOCK_FACE_SOUTH 
BLOCK_FACE_WEST 
BLOCK_FACE_EAST 
BLOCK_FACE_MIN 
BLOCK_FACE_MAX 

Definition at line 29 of file Defines.h.

enum eChatType
Enumerator
ctChatBox 
ctSystem 
ctAboveActionBar 

Definition at line 140 of file Defines.h.

Individual actions sent in the WindowClick packet.

Enumerator
caLeftClick 
caRightClick 
caShiftLeftClick 
caShiftRightClick 
caNumber1 
caNumber2 
caNumber3 
caNumber4 
caNumber5 
caNumber6 
caNumber7 
caNumber8 
caNumber9 
caMiddleClick 
caDropKey 
caCtrlDropKey 
caLeftClickOutside 
caRightClickOutside 
caLeftClickOutsideHoldNothing 
caRightClickOutsideHoldNothing 
caLeftPaintBegin 
caRightPaintBegin 
caMiddlePaintBegin 
caLeftPaintProgress 
caRightPaintProgress 
caMiddlePaintProgress 
caLeftPaintEnd 
caRightPaintEnd 
caMiddlePaintEnd 
caDblClick 
caUnknown 

Definition at line 73 of file Defines.h.

enum eGameMode
Enumerator
eGameMode_NotSet 
eGameMode_Survival 
eGameMode_Creative 
eGameMode_Adventure 
eGameMode_Spectator 
gmNotSet 
gmSurvival 
gmCreative 
gmAdventure 
gmSpectator 
gmMax 
gmMin 

Definition at line 116 of file Defines.h.

enum eHand
Enumerator
hMain 
hOff 

Definition at line 206 of file Defines.h.

enum eMainHand
Enumerator
mhLeft 
mhRight 

Definition at line 216 of file Defines.h.

Enumerator
mtCustom 
mtFailure 
mtInformation 
mtSuccess 
mtWarning 
mtFatal 
mtDeath 
mtPrivateMessage 
mtJoin 
mtLeave 
mtMaxPlusOne 
mtFail 
mtError 
mtInfo 
mtPM 

Definition at line 976 of file Defines.h.

Enumerator
SKULL_ROTATION_NORTH 
SKULL_ROTATION_NORTH_NORTH_EAST 
SKULL_ROTATION_NORTH_EAST 
SKULL_ROTATION_EAST_NORTH_EAST 
SKULL_ROTATION_EAST 
SKULL_ROTATION_EAST_SOUTH_EAST 
SKULL_ROTATION_SOUTH_EAST 
SKULL_ROTATION_SOUTH_SOUTH_EAST 
SKULL_ROTATION_SOUTH 
SKULL_ROTATION_SOUTH_SOUTH_WEST 
SKULL_ROTATION_SOUTH_WEST 
SKULL_ROTATION_WEST_SOUTH_WEST 
SKULL_ROTATION_WEST 
SKULL_ROTATION_WEST_NORTH_WEST 
SKULL_ROTATION_NORTH_WEST 
SKULL_ROTATION_NORTH_NORTH_WEST 

Definition at line 182 of file Defines.h.

Enumerator
SKULL_TYPE_SKELETON 
SKULL_TYPE_WITHER 
SKULL_TYPE_ZOMBIE 
SKULL_TYPE_PLAYER 
SKULL_TYPE_CREEPER 
SKULL_TYPE_DRAGON 

Definition at line 168 of file Defines.h.

enum eSkinPart
Enumerator
spCape 
spJacket 
spLeftSleeve 
spRightSleeve 
spLeftPants 
spRightPants 
spHat 
spMask 

Definition at line 226 of file Defines.h.

enum eWeather
Enumerator
eWeather_Sunny 
eWeather_Rain 
eWeather_ThunderStorm 
wSunny 
wRain 
wThunderstorm 
wStorm 

Definition at line 151 of file Defines.h.

Function Documentation

void AddFaceDirection ( int &  a_BlockX,
int &  a_BlockY,
int &  a_BlockZ,
eBlockFace  a_BlockFace,
bool  a_bInverse = false 
)
inline

Definition at line 859 of file Defines.h.

void AddFaceDirection ( int &  a_BlockX,
unsigned char &  a_BlockY,
int &  a_BlockZ,
eBlockFace  a_BlockFace,
bool  a_bInverse = false 
)
inline

Definition at line 903 of file Defines.h.

AString BlockFaceToString ( eBlockFace  a_BlockFace)
inline

Returns the textual representation of the BlockFace constant.

Definition at line 374 of file Defines.h.

const char* ClickActionToString ( int  a_ClickAction)
inline

Definition at line 242 of file Defines.h.

template<class T >
T Diff ( a_Val1,
a_Val2 
)
inline

Definition at line 965 of file Defines.h.

void EulerToVector ( double  a_Pan,
double  a_Pitch,
double &  a_X,
double &  a_Y,
double &  a_Z 
)
inline

Definition at line 914 of file Defines.h.

float GetSignf ( float  a_Val)
inline

Definition at line 947 of file Defines.h.

float GetSpecialSignf ( float  a_Val)
inline

Definition at line 956 of file Defines.h.

bool IsBlockFence ( BLOCKTYPE  a_BlockType)
inline

Definition at line 529 of file Defines.h.

bool IsBlockIce ( BLOCKTYPE  a_BlockType)
inline

Definition at line 445 of file Defines.h.

bool IsBlockLava ( BLOCKTYPE  a_BlockType)
inline

Definition at line 475 of file Defines.h.

bool IsBlockLiquid ( BLOCKTYPE  a_BlockType)
inline

Definition at line 484 of file Defines.h.

bool IsBlockMaterialAnvil ( BLOCKTYPE  a_BlockType)
inline

Definition at line 717 of file Defines.h.

bool IsBlockMaterialCoral ( BLOCKTYPE  a_BlockType)
inline

Definition at line 774 of file Defines.h.

bool IsBlockMaterialGourd ( BLOCKTYPE  a_BlockType)
inline

Definition at line 753 of file Defines.h.

bool IsBlockMaterialIron ( BLOCKTYPE  a_BlockType)
inline

Definition at line 681 of file Defines.h.

bool IsBlockMaterialLeaves ( BLOCKTYPE  a_BlockType)
inline

Definition at line 735 of file Defines.h.

bool IsBlockMaterialPlants ( BLOCKTYPE  a_BlockType)
inline

Definition at line 624 of file Defines.h.

bool IsBlockMaterialRock ( BLOCKTYPE  a_BlockType)
inline

Definition at line 783 of file Defines.h.

bool IsBlockMaterialVine ( BLOCKTYPE  a_BlockType)
inline

Definition at line 659 of file Defines.h.

bool IsBlockMaterialWood ( BLOCKTYPE  a_BlockType)
inline

Definition at line 561 of file Defines.h.

bool IsBlockRail ( BLOCKTYPE  a_BlockType)
inline

Definition at line 492 of file Defines.h.

bool IsBlocksWeb ( BLOCKTYPE  a_BlockType)
inline

Definition at line 726 of file Defines.h.

bool IsBlocksWool ( BLOCKTYPE  a_BlockType)
inline

Definition at line 744 of file Defines.h.

bool IsBlockTypeOfDirt ( BLOCKTYPE  a_BlockType)
inline

Definition at line 511 of file Defines.h.

bool IsBlockWater ( BLOCKTYPE  a_BlockType)
inline

Definition at line 436 of file Defines.h.

bool IsBlockWaterOrIce ( BLOCKTYPE  a_BlockType)
inline

Definition at line 466 of file Defines.h.

bool IsValidBlock ( int  a_BlockType)
inline

Definition at line 393 of file Defines.h.

bool IsValidItem ( int  a_ItemType)
inline

Definition at line 412 of file Defines.h.

eBlockFace MirrorBlockFaceY ( eBlockFace  a_BlockFace)
inline

Returns a blockface mirrored around the Y axis (doesn't change up / down).

Definition at line 287 of file Defines.h.

double NormalizeAngleDegrees ( const double  a_Degrees)
inline

Normalizes an angle in degrees to the [-180, +180) range:

Definition at line 1005 of file Defines.h.

eBlockFace ReverseBlockFace ( eBlockFace  a_BlockFace)
inline

Definition at line 354 of file Defines.h.

eBlockFace RotateBlockFaceCCW ( eBlockFace  a_BlockFace)
inline

Returns a blockface rotated around the Y axis counter-clockwise.

Definition at line 310 of file Defines.h.

eBlockFace RotateBlockFaceCW ( eBlockFace  a_BlockFace)
inline

Definition at line 332 of file Defines.h.

void VectorToEuler ( double  a_X,
double  a_Y,
double  a_Z,
double &  a_Pan,
double &  a_Pitch 
)
inline

Definition at line 928 of file Defines.h.