summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-02-19 14:45:09 +0100
committerHowaner <franzi.moos@googlemail.com>2014-02-19 14:45:09 +0100
commitd63ce62f3bbe4b8e89b8c54af4b71d77bcc7e052 (patch)
treee2a6645283f80bd664a4bc8d402f52f13824cd14 /src/WorldStorage
parentAdd break to Protocol17x.cpp and use new comment delimiter (diff)
downloadcuberite-d63ce62f3bbe4b8e89b8c54af4b71d77bcc7e052.tar
cuberite-d63ce62f3bbe4b8e89b8c54af4b71d77bcc7e052.tar.gz
cuberite-d63ce62f3bbe4b8e89b8c54af4b71d77bcc7e052.tar.bz2
cuberite-d63ce62f3bbe4b8e89b8c54af4b71d77bcc7e052.tar.lz
cuberite-d63ce62f3bbe4b8e89b8c54af4b71d77bcc7e052.tar.xz
cuberite-d63ce62f3bbe4b8e89b8c54af4b71d77bcc7e052.tar.zst
cuberite-d63ce62f3bbe4b8e89b8c54af4b71d77bcc7e052.zip
Diffstat (limited to 'src/WorldStorage')
-rw-r--r--src/WorldStorage/NBTChunkSerializer.cpp14
-rw-r--r--src/WorldStorage/NBTChunkSerializer.h4
-rw-r--r--src/WorldStorage/WSSAnvil.cpp16
-rw-r--r--src/WorldStorage/WSSAnvil.h2
4 files changed, 18 insertions, 18 deletions
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp
index 6da141728..cf6df114e 100644
--- a/src/WorldStorage/NBTChunkSerializer.cpp
+++ b/src/WorldStorage/NBTChunkSerializer.cpp
@@ -19,7 +19,7 @@
#include "../BlockEntities/JukeboxEntity.h"
#include "../BlockEntities/NoteEntity.h"
#include "../BlockEntities/SignEntity.h"
-#include "../BlockEntities/SkullEntity.h"
+#include "../BlockEntities/MobHeadEntity.h"
#include "../Entities/Entity.h"
#include "../Entities/FallingBlock.h"
@@ -261,13 +261,13 @@ void cNBTChunkSerializer::AddSignEntity(cSignEntity * a_Sign)
-void cNBTChunkSerializer::AddSkullEntity(cSkullEntity * a_Skull)
+void cNBTChunkSerializer::AddMobHeadEntity(cMobHeadEntity * a_MobHead)
{
m_Writer.BeginCompound("");
- AddBasicTileEntity(a_Skull, "Skull");
- m_Writer.AddByte ("SkullType", a_Skull->GetSkullType() & 0xFF);
- m_Writer.AddByte ("Rot", a_Skull->GetRotation() & 0xFF);
- m_Writer.AddString("ExtraType", a_Skull->GetOwner());
+ AddBasicTileEntity(a_MobHead, "Skull");
+ m_Writer.AddByte ("SkullType", a_MobHead->GetType() & 0xFF);
+ m_Writer.AddByte ("Rot", a_MobHead->GetRotation() & 0xFF);
+ m_Writer.AddString("ExtraType", a_MobHead->GetOwner());
m_Writer.EndCompound();
}
@@ -681,7 +681,7 @@ void cNBTChunkSerializer::BlockEntity(cBlockEntity * a_Entity)
case E_BLOCK_HOPPER: AddHopperEntity ((cHopperEntity *) a_Entity); break;
case E_BLOCK_SIGN_POST:
case E_BLOCK_WALLSIGN: AddSignEntity ((cSignEntity *) a_Entity); break;
- case E_BLOCK_HEAD: AddSkullEntity ((cSkullEntity *) a_Entity); break;
+ case E_BLOCK_HEAD: AddMobHeadEntity ((cMobHeadEntity *) a_Entity); break;
case E_BLOCK_NOTE_BLOCK: AddNoteEntity ((cNoteEntity *) a_Entity); break;
case E_BLOCK_JUKEBOX: AddJukeboxEntity ((cJukeboxEntity *) a_Entity); break;
case E_BLOCK_COMMAND_BLOCK: AddCommandBlockEntity((cCommandBlockEntity *) a_Entity); break;
diff --git a/src/WorldStorage/NBTChunkSerializer.h b/src/WorldStorage/NBTChunkSerializer.h
index fd5601e47..5f9e16ed1 100644
--- a/src/WorldStorage/NBTChunkSerializer.h
+++ b/src/WorldStorage/NBTChunkSerializer.h
@@ -29,7 +29,7 @@ class cHopperEntity;
class cJukeboxEntity;
class cNoteEntity;
class cSignEntity;
-class cSkullEntity;
+class cMobHeadEntity;
class cFallingBlock;
class cMinecart;
class cMinecartWithChest;
@@ -94,7 +94,7 @@ protected:
void AddJukeboxEntity (cJukeboxEntity * a_Jukebox);
void AddNoteEntity (cNoteEntity * a_Note);
void AddSignEntity (cSignEntity * a_Sign);
- void AddSkullEntity (cSkullEntity * a_Skull);
+ void AddMobHeadEntity (cMobHeadEntity * a_MobHead);
void AddCommandBlockEntity(cCommandBlockEntity * a_CmdBlock);
// Entities:
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp
index 58dc2e9e4..d4490c7fe 100644
--- a/src/WorldStorage/WSSAnvil.cpp
+++ b/src/WorldStorage/WSSAnvil.cpp
@@ -24,7 +24,7 @@
#include "../BlockEntities/JukeboxEntity.h"
#include "../BlockEntities/NoteEntity.h"
#include "../BlockEntities/SignEntity.h"
-#include "../BlockEntities/SkullEntity.h"
+#include "../BlockEntities/MobHeadEntity.h"
#include "../Mobs/Monster.h"
@@ -600,7 +600,7 @@ void cWSSAnvil::LoadBlockEntitiesFromNBT(cBlockEntityList & a_BlockEntities, con
}
else if (strncmp(a_NBT.GetData(sID), "Skull", a_NBT.GetDataLength(sID)) == 0)
{
- LoadSkullFromNBT(a_BlockEntities, a_NBT, Child);
+ LoadMobHeadFromNBT(a_BlockEntities, a_NBT, Child);
}
else if (strncmp(a_NBT.GetData(sID), "Trap", a_NBT.GetDataLength(sID)) == 0)
{
@@ -932,7 +932,7 @@ void cWSSAnvil::LoadSignFromNBT(cBlockEntityList & a_BlockEntities, const cParse
-void cWSSAnvil::LoadSkullFromNBT(cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx)
+void cWSSAnvil::LoadMobHeadFromNBT(cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx)
{
ASSERT(a_NBT.GetType(a_TagIdx) == TAG_Compound);
int x, y, z;
@@ -940,27 +940,27 @@ void cWSSAnvil::LoadSkullFromNBT(cBlockEntityList & a_BlockEntities, const cPars
{
return;
}
- std::auto_ptr<cSkullEntity> Skull(new cSkullEntity(x, y, z, m_World));
+ std::auto_ptr<cMobHeadEntity> MobHead(new cMobHeadEntity(x, y, z, m_World));
int currentLine = a_NBT.FindChildByName(a_TagIdx, "SkullType");
if (currentLine >= 0)
{
- Skull->SetSkullType(static_cast<eSkullType>(a_NBT.GetByte(currentLine)));
+ MobHead->SetType(static_cast<eMobHeadType>(a_NBT.GetByte(currentLine)));
}
currentLine = a_NBT.FindChildByName(a_TagIdx, "Rot");
if (currentLine >= 0)
{
- Skull->SetRotation(static_cast<eSkullRotation>(a_NBT.GetByte(currentLine)));
+ MobHead->SetRotation(static_cast<eMobHeadRotation>(a_NBT.GetByte(currentLine)));
}
currentLine = a_NBT.FindChildByName(a_TagIdx, "ExtraType");
if (currentLine >= 0)
{
- Skull->SetOwner(a_NBT.GetString(currentLine));
+ MobHead->SetOwner(a_NBT.GetString(currentLine));
}
- a_BlockEntities.push_back(Skull.release());
+ a_BlockEntities.push_back(MobHead.release());
}
diff --git a/src/WorldStorage/WSSAnvil.h b/src/WorldStorage/WSSAnvil.h
index 9c9e17258..541371560 100644
--- a/src/WorldStorage/WSSAnvil.h
+++ b/src/WorldStorage/WSSAnvil.h
@@ -139,7 +139,7 @@ protected:
void LoadJukeboxFromNBT (cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx);
void LoadNoteFromNBT (cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx);
void LoadSignFromNBT (cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx);
- void LoadSkullFromNBT (cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx);
+ void LoadMobHeadFromNBT (cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx);
void LoadCommandBlockFromNBT(cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx);
void LoadEntityFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_EntityTagIdx, const char * a_IDTag, int a_IDTagLength);