1
0

Added dispensers (they can't dispense items yet)

Fixed crash when digging snow
Moved BlockPlace hook check, so Core plugin will no longer block item usage
Player chat messages are now visible in the console

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1081 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
luksor111@gmail.com
2012-12-19 21:19:36 +00:00
parent a10c4774f5
commit 05d71675f6
19 changed files with 533 additions and 59 deletions

View File

@@ -11,6 +11,7 @@
#include "../StringCompression.h"
#include "../ChestEntity.h"
#include "../SignEntity.h"
#include "../DispenserEntity.h"
#include "../FurnaceEntity.h"
#include "../NoteEntity.h"
#include "../JukeboxEntity.h"
@@ -71,12 +72,13 @@ void cJsonChunkSerializer::BlockEntity(cBlockEntity * a_BlockEntity)
const char * SaveInto = NULL;
switch (a_BlockEntity->GetBlockType())
{
case E_BLOCK_CHEST: SaveInto = "Chests"; break;
case E_BLOCK_FURNACE: SaveInto = "Furnaces"; break;
case E_BLOCK_SIGN_POST: SaveInto = "Signs"; break;
case E_BLOCK_WALLSIGN: SaveInto = "Signs"; break;
case E_BLOCK_NOTE_BLOCK: SaveInto = "Notes"; break;
case E_BLOCK_JUKEBOX: SaveInto = "Jukeboxes"; break;
case E_BLOCK_CHEST: SaveInto = "Chests"; break;
case E_BLOCK_DISPENSER: SaveInto = "Dispensers"; break;
case E_BLOCK_FURNACE: SaveInto = "Furnaces"; break;
case E_BLOCK_SIGN_POST: SaveInto = "Signs"; break;
case E_BLOCK_WALLSIGN: SaveInto = "Signs"; break;
case E_BLOCK_NOTE_BLOCK: SaveInto = "Notes"; break;
case E_BLOCK_JUKEBOX: SaveInto = "Jukeboxes"; break;
default:
{
@@ -281,6 +283,26 @@ void cWSSCompact::LoadEntitiesFromJson(Json::Value & a_Value, cEntityList & a_En
} // for itr - AllChests[]
}
// Load dispensers
Json::Value AllDispensers = a_Value.get("Dispensers", Json::nullValue);
if( !AllDispensers.empty() )
{
for( Json::Value::iterator itr = AllDispensers.begin(); itr != AllDispensers.end(); ++itr )
{
Json::Value & Dispenser = *itr;
cDispenserEntity * DispenserEntity = new cDispenserEntity(0,0,0, a_World);
if( !DispenserEntity->LoadFromJson( Dispenser ) )
{
LOGERROR("ERROR READING DISPENSER FROM JSON!" );
delete DispenserEntity;
}
else
{
a_BlockEntities.push_back( DispenserEntity );
}
} // for itr - AllDispensers[]
}
// Load furnaces
Json::Value AllFurnaces = a_Value.get("Furnaces", Json::nullValue);
if( !AllFurnaces.empty() )