Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/mc-server/MCServer
Browse files Browse the repository at this point in the history
  • Loading branch information
NiLSPACE committed Dec 1, 2014
2 parents fa4a85c + 3bf9e97 commit cd0081b
Show file tree
Hide file tree
Showing 31 changed files with 638 additions and 182 deletions.
27 changes: 14 additions & 13 deletions MCServer/Plugins/APIDump/APIDesc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1668,13 +1668,14 @@ a_Player:OpenWindow(Window);
SetCustomName = { Params = "string", Return = "", Notes = "Sets the custom name of the monster. You see the name over the monster. If you want to disable the custom name, simply set an empty string." },
IsCustomNameAlwaysVisible = { Params = "", Return = "bool", Notes = "Is the custom name of this monster always visible? If not, you only see the name when you sight the mob." },
SetCustomNameAlwaysVisible = { Params = "bool", Return = "", Notes = "Sets the custom name visiblity of this monster. If it's false, you only see the name when you sight the mob. If it's true, you always see the custom name." },
FamilyFromType = { Params = "{{cMonster#MobType|MobType}}", Return = "{{cMonster#MobFamily|MobFamily}}", Notes = "(STATIC) Returns the mob family ({{cMonster#MobFamily|mfXXX}} constants) based on the mob type ({{cMonster#MobType|mtXXX}} constants)" },
FamilyFromType = { Params = "{{Globals#MobType|MobType}}", Return = "{{cMonster#MobFamily|MobFamily}}", Notes = "(STATIC) Returns the mob family ({{cMonster#MobFamily|mfXXX}} constants) based on the mob type ({{Globals#MobType|mtXXX}} constants)" },
GetMobFamily = { Params = "", Return = "{{cMonster#MobFamily|MobFamily}}", Notes = "Returns this mob's family ({{cMonster#MobFamily|mfXXX}} constant)" },
GetMobType = { Params = "", Return = "{{cMonster#MobType|MobType}}", Notes = "Returns the type of this mob ({{cMonster#MobType|mtXXX}} constant)" },
GetMobType = { Params = "", Return = "{{Globals#MobType|MobType}}", Notes = "Returns the type of this mob ({{Globals#MobType|mtXXX}} constant)" },
GetSpawnDelay = { Params = "{{cMonster#MobFamily|MobFamily}}", Return = "number", Notes = "(STATIC) Returns the spawn delay - the number of game ticks between spawn attempts - for the specified mob family." },
MobTypeToString = { Params = "{{cMonster#MobType|MobType}}", Return = "string", Notes = "(STATIC) Returns the string representing the given mob type ({{cMonster#MobType|mtXXX}} constant), or empty string if unknown type." },
MobTypeToString = { Params = "{{Globals#MobType|MobType}}", Return = "string", Notes = "(STATIC) Returns the string representing the given mob type ({{Globals#MobType|mtXXX}} constant), or empty string if unknown type." },
MobTypeToVanillaName = { Params = "{{Globals#MobType|MobType}}", Return = "string", Notes = "(STATIC) Returns the vanilla name of the given mob type, or empty string if unknown type." },
MoveToPosition = { Params = "Position", Return = "", Notes = "Moves mob to the specified position" },
StringToMobType = { Params = "string", Return = "{{cMonster#MobType|MobType}}", Notes = "(STATIC) Returns the mob type ({{cMonster#MobType|mtXXX}} constant) parsed from the string type (\"creeper\"), or mtInvalidType if unrecognized." },
StringToMobType = { Params = "string", Return = "{{Globals#MobType|MobType}}", Notes = "(STATIC) Returns the mob type ({{Globals#MobType|mtXXX}} constant) parsed from the string type (\"creeper\"), or mtInvalidType if unrecognized." },
GetRelativeWalkSpeed = { Params = "", Return = "number", Notes = "Returns the relative walk speed of this mob. Standard is 1.0" },
SetRelativeWalkSpeed = { Params = "number", Return = "", Notes = "Sets the relative walk speed of this mob. Standard is 1.0" },
},
Expand Down Expand Up @@ -1725,13 +1726,6 @@ a_Player:OpenWindow(Window);
Mobs are divided into families. The following constants are used for individual family types:
]],
},
MobType =
{
Include = "mt.*",
TextBefore = [[
The following constants are used for distinguishing between the individual mob types:
]],
},
},
Inherits = "cPawn",
}, -- cMonster
Expand Down Expand Up @@ -2571,7 +2565,7 @@ World:ForEachEntity(
return;
end
local Monster = tolua.cast(a_Entity, "cMonster"); -- Get the cMonster out of cEntity, now that we know the entity represents one.
if (Monster:GetMobType() == cMonster.mtSpider) then
if (Monster:GetMobType() == mtSpider) then
Monster:TeleportToCoords(Monster:GetPosX(), Monster:GetPosY() + 100, Monster:GetPosZ());
end
end
Expand Down Expand Up @@ -2928,7 +2922,7 @@ end
StringToDamageType = {Params = "string", Return = "{{Globals#DamageType|DamageType}}", Notes = "Converts a string representation to a {{Globals#DamageType|DamageType}} enumerated value."},
StringToDimension = {Params = "string", Return = "{{Globals#WorldDimension|Dimension}}", Notes = "Converts a string representation to a {{Globals#WorldDimension|Dimension}} enumerated value"},
StringToItem = {Params = "string, {{cItem|cItem}}", Return = "bool", Notes = "Parses the given string and sets the item; returns true if successful"},
StringToMobType = {Params = "string", Return = "{{cMonster#MobType|MobType}}", Notes = "<b>DEPRECATED!</b> Please use cMonster:StringToMobType(). Converts a string representation to a {{cMonster#MobType|MobType}} enumerated value"},
StringToMobType = {Params = "string", Return = "{{Globals#MobType|MobType}}", Notes = "<b>DEPRECATED!</b> Please use cMonster:StringToMobType(). Converts a string representation to a {{Globals#MobType|MobType}} enumerated value"},
StripColorCodes = {Params = "string", Return = "string", Notes = "Removes all control codes used by MC for colors and styles"},
TrimString = {Params = "string", Return = "string", Notes = "Trims whitespace at both ends of the string"},
md5 = {Params = "string", Return = "string", Notes = "converts a string to an md5 hash"},
Expand Down Expand Up @@ -3014,6 +3008,13 @@ end
gmXXX constants, the eGameMode_ constants are deprecated and will be removed from the API.
]],
},
MobType =
{
Include = { "^mt.*" },
TextBefore = [[
The following constants are used for distinguishing between the individual mob types:
]],
},
Weather =
{
Include = { "^eWeather_.*", "wSunny", "wRain", "wStorm", "wThunderstorm" },
Expand Down
37 changes: 37 additions & 0 deletions MCServer/Plugins/APIDump/Classes/BlockEntities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,43 @@ World:ForEachChestInChunk(Player:GetChunkX(), Player:GetChunkZ(),
},
}, -- cJukeboxEntity

cMobHeadEntity =
{
Desc = [[
This class represents a mob head block entity in the world.
]],
Inherits = "cBlockEntity",
Functions =
{
SetType = { Params = "eMobHeadType", Return = "", Notes = "Set the type of the mob head" },
SetRotation = { Params = "eMobHeadRotation", Return = "", Notes = "Sets the rotation of the mob head" },
SetOwner = { Params = "string", Return = "", Notes = "Set the player name for mob heads with player type" },
GetType = { Params = "", Return = "eMobHeadType", Notes = "Returns the type of the mob head" },
GetRotation = { Params = "", Return = "eMobHeadRotation", Notes = "Returns the rotation of the mob head" },
GetOwner = { Params = "", Return = "string", Notes = "Returns the player name of the mob head" },
},
}, -- cMobHeadEntity

cMobSpawnerEntity =
{
Desc = [[
This class represents a mob spawner block entity in the world.
]],
Inherits = "cBlockEntity",
Functions =
{
UpdateActiveState = { Params = "", Return = "", Notes = "Upate the active flag from the mob spawner. This function will called every 5 seconds from the Tick() function." },
ResetTimer = { Params = "", Return = "", Notes = "Sets the spawn delay to a new random value." },
SpawnEntity = { Params = "", Return = "", Notes = "Spawns the entity. This function automaticly change the spawn delay!" },
GetEntity = { Params = "", Return = "{{Globals#MobType|MobType}}", Notes = "Returns the entity type that will be spawn by this mob spawner." },
SetEntity = { Params = "{{Globals#MobType|MobType}}", Return = "", Notes = "Sets the entity type who will be spawn by this mob spawner." },
GetSpawnDelay = { Params = "", Return = "number", Notes = "Returns the spawn delay. This is the tick delay that is needed to spawn new monsters." },
SetSpawnDelay = { Params = "number", Return = "", Notes = "Sets the spawn delay." },
GetNearbyPlayersNum = { Params = "", Return = "number", Notes = "Returns the amount of the nearby players in a 16-block radius." },
GetNearbyMonsterNum = { Params = "", Return = "number", Notes = "Returns the amount of this monster type in a 8-block radius (Y: 4-block radius)." },
},
}, -- cMobSpawnerEntity

cNoteEntity =
{
Desc = [[
Expand Down
2 changes: 1 addition & 1 deletion MCServer/Plugins/Core
Submodule Core updated from 5b7a6d to 4183d6
1 change: 1 addition & 0 deletions src/Bindings/AllToLua.pkg
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ $cfile "../BlockEntities/JukeboxEntity.h"
$cfile "../BlockEntities/NoteEntity.h"
$cfile "../BlockEntities/SignEntity.h"
$cfile "../BlockEntities/MobHeadEntity.h"
$cfile "../BlockEntities/MobSpawnerEntity.h"
$cfile "../BlockEntities/FlowerPotEntity.h"
$cfile "../WebAdmin.h"
$cfile "../Root.h"
Expand Down
10 changes: 1 addition & 9 deletions src/BlockEntities/BeaconEntity.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

// BeaconEntity.h

// Declares the cBeaconEntity class representing a single beacon in the world
Expand All @@ -14,15 +15,6 @@



namespace Json
{
class Value;
}





// tolua_begin
class cBeaconEntity :
public cBlockEntityWithItems
Expand Down
4 changes: 3 additions & 1 deletion src/BlockEntities/BlockEntity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
#include "FlowerPotEntity.h"
#include "FurnaceEntity.h"
#include "HopperEntity.h"
#include "MobHeadEntity.h"
#include "MobSpawnerEntity.h"
#include "JukeboxEntity.h"
#include "NoteEntity.h"
#include "SignEntity.h"
#include "MobHeadEntity.h"



Expand All @@ -37,6 +38,7 @@ cBlockEntity * cBlockEntity::CreateByBlockType(BLOCKTYPE a_BlockType, NIBBLETYPE
case E_BLOCK_FURNACE: return new cFurnaceEntity (a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta, a_World);
case E_BLOCK_HEAD: return new cMobHeadEntity (a_BlockX, a_BlockY, a_BlockZ, a_World);
case E_BLOCK_HOPPER: return new cHopperEntity (a_BlockX, a_BlockY, a_BlockZ, a_World);
case E_BLOCK_MOB_SPAWNER: return new cMobSpawnerEntity (a_BlockX, a_BlockY, a_BlockZ, a_World);
case E_BLOCK_JUKEBOX: return new cJukeboxEntity (a_BlockX, a_BlockY, a_BlockZ, a_World);
case E_BLOCK_LIT_FURNACE: return new cFurnaceEntity (a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta, a_World);
case E_BLOCK_SIGN_POST: return new cSignEntity (a_BlockType, a_BlockX, a_BlockY, a_BlockZ, a_World);
Expand Down
7 changes: 1 addition & 6 deletions src/BlockEntities/BlockEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@



namespace Json
{
class Value;
};

class cChunk;
class cPlayer;
class cWorld;
Expand Down Expand Up @@ -115,7 +110,7 @@ class cBlockEntity
virtual void SendTo(cClientHandle & a_Client) = 0;

/// Ticks the entity; returns true if the chunk should be marked as dirty as a result of this ticking. By default does nothing.
virtual bool Tick(float a_Dt, cChunk & /* a_Chunk */)
virtual bool Tick(float a_Dt, cChunk & a_Chunk)
{
UNUSED(a_Dt);
return false;
Expand Down
2 changes: 2 additions & 0 deletions src/BlockEntities/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ SET (SRCS
HopperEntity.cpp
JukeboxEntity.cpp
MobHeadEntity.cpp
MobSpawnerEntity.cpp
NoteEntity.cpp
SignEntity.cpp)

Expand All @@ -36,6 +37,7 @@ SET (HDRS
HopperEntity.h
JukeboxEntity.h
MobHeadEntity.h
MobSpawnerEntity.h
NoteEntity.h
SignEntity.h)

Expand Down
5 changes: 0 additions & 5 deletions src/BlockEntities/ChestEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@



namespace Json
{
class Value;
};

class cClientHandle;


Expand Down
8 changes: 0 additions & 8 deletions src/BlockEntities/CommandBlockEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@



namespace Json
{
class Value;
}





// tolua_begin

Expand Down
4 changes: 0 additions & 4 deletions src/BlockEntities/DropSpenserEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@



namespace Json
{
class Value;
}

class cClientHandle;

Expand Down
10 changes: 0 additions & 10 deletions src/BlockEntities/FlowerPotEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@




namespace Json
{
class Value;
}





// tolua_begin

class cFlowerPotEntity :
Expand Down
5 changes: 0 additions & 5 deletions src/BlockEntities/FurnaceEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@



namespace Json
{
class Value;
}

class cClientHandle;


Expand Down
9 changes: 0 additions & 9 deletions src/BlockEntities/JukeboxEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@



namespace Json
{
class Value;
}





// tolua_begin

class cJukeboxEntity :
Expand Down
20 changes: 6 additions & 14 deletions src/BlockEntities/MobHeadEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@



namespace Json
{
class Value;
}





// tolua_begin

Expand All @@ -41,22 +33,22 @@ class cMobHeadEntity :

// tolua_begin

/** Set the Type */
/** Set the type of the mob head */
void SetType(const eMobHeadType & a_SkullType);

/** Set the Rotation */
/** Set the rotation of the mob head */
void SetRotation(eMobHeadRotation a_Rotation);

/** Set the Player Name for Mobheads with Player type */
/** Set the player name for mob heads with player type */
void SetOwner(const AString & a_Owner);

/** Get the Type */
/** Returns the type of the mob head */
eMobHeadType GetType(void) const { return m_Type; }

/** Get the Rotation */
/** Returns the rotation of the mob head */
eMobHeadRotation GetRotation(void) const { return m_Rotation; }

/** Get the setted Player Name */
/** Returns the player name of the mob head */
AString GetOwner(void) const { return m_Owner; }

// tolua_end
Expand Down

0 comments on commit cd0081b

Please sign in to comment.