summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/WSSAnvil.cpp
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-05-01 20:50:40 +0200
committerTycho <work.tycho+git@gmail.com>2014-05-01 20:50:40 +0200
commit8780b324ff075f17358b01bc3615da0397fbe8be (patch)
treed448ab665fd50cca3861e06654f8668a89c8d953 /src/WorldStorage/WSSAnvil.cpp
parentAdded Testing capability (diff)
parentFixed MSVC2013 compilation. (diff)
downloadcuberite-8780b324ff075f17358b01bc3615da0397fbe8be.tar
cuberite-8780b324ff075f17358b01bc3615da0397fbe8be.tar.gz
cuberite-8780b324ff075f17358b01bc3615da0397fbe8be.tar.bz2
cuberite-8780b324ff075f17358b01bc3615da0397fbe8be.tar.lz
cuberite-8780b324ff075f17358b01bc3615da0397fbe8be.tar.xz
cuberite-8780b324ff075f17358b01bc3615da0397fbe8be.tar.zst
cuberite-8780b324ff075f17358b01bc3615da0397fbe8be.zip
Diffstat (limited to 'src/WorldStorage/WSSAnvil.cpp')
-rw-r--r--src/WorldStorage/WSSAnvil.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp
index 66144dbd5..f33178173 100644
--- a/src/WorldStorage/WSSAnvil.cpp
+++ b/src/WorldStorage/WSSAnvil.cpp
@@ -27,7 +27,6 @@
#include "../BlockEntities/MobHeadEntity.h"
#include "../BlockEntities/FlowerPotEntity.h"
-
#include "../Mobs/Monster.h"
#include "../Mobs/IncludeAllMonsters.h"
@@ -36,7 +35,12 @@
#include "../Entities/FallingBlock.h"
#include "../Entities/Minecart.h"
#include "../Entities/Pickup.h"
-#include "../Entities/ProjectileEntity.h"
+#include "../Entities/ArrowEntity.h"
+#include "../Entities/ThrownEggEntity.h"
+#include "../Entities/ThrownEnderPearlEntity.h"
+#include "../Entities/ThrownSnowballEntity.h"
+#include "../Entities/FireChargeEntity.h"
+#include "../Entities/GhastFireballEntity.h"
#include "../Entities/TNTEntity.h"
#include "../Entities/ExpOrb.h"
#include "../Entities/HangingEntity.h"
@@ -2272,7 +2276,7 @@ void cWSSAnvil::LoadWitherFromNBT(cEntityList & a_Entities, const cParsedNBT & a
int CurrLine = a_NBT.FindChildByName(a_TagIdx, "Invul");
if (CurrLine > 0)
{
- Monster->SetNumInvulnerableTicks(a_NBT.GetInt(CurrLine));
+ Monster->SetWitherInvulnerableTicks(a_NBT.GetInt(CurrLine));
}
a_Entities.push_back(Monster.release());
@@ -2668,6 +2672,11 @@ bool cWSSAnvil::cMCAFile::SetChunkData(const cChunkCoords & a_Chunk, const AStri
return false;
}
+ // Add padding to 4K boundary:
+ size_t BytesWritten = a_Data.size() + MCA_CHUNK_HEADER_LENGTH;
+ static const char Padding[4095] = {0};
+ m_File.Write(Padding, 4096 - (BytesWritten % 4096));
+
// Store the header:
ChunkSize = (a_Data.size() + MCA_CHUNK_HEADER_LENGTH + 4095) / 4096; // Round data size *up* to nearest 4KB sector, make it a sector number
ASSERT(ChunkSize < 256);