From c0711407e96353e14bfa41f17db4e45c43f8ebb9 Mon Sep 17 00:00:00 2001 From: 12xx12 <44411062+12xx12@users.noreply.github.com> Date: Sat, 10 Oct 2020 21:31:44 +0200 Subject: Adding more customize options to mob spawners and improving the way to look for surrounding entities (#4955) * added nearly any customize option * fixed unnecessary diff added comments * removed unnecessary const qualifier * fixed build * changed to ForEachEntityInBox * added docs * updated lua api description * checkstyle * added changes suggested by @peterbell10 And now the player may break the server by setting ridiculous ranges * updated docs changed cast to static cast * fixed clang * fixed clang on WSSAnvil.cpp Co-authored-by: 12xx12 <12xx12100@gmail.com> --- src/WorldStorage/NBTChunkSerializer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/WorldStorage/NBTChunkSerializer.cpp') diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp index 70f07557f..f78f7029f 100644 --- a/src/WorldStorage/NBTChunkSerializer.cpp +++ b/src/WorldStorage/NBTChunkSerializer.cpp @@ -547,7 +547,13 @@ public: mWriter.BeginCompound(""); AddBasicTileEntity(a_MobSpawner, "MobSpawner"); mWriter.AddString("EntityId", cMonster::MobTypeToVanillaName(a_MobSpawner->GetEntity())); + mWriter.AddShort("SpawnCount", a_MobSpawner->GetSpawnCount()); + mWriter.AddShort("SpawnRange", a_MobSpawner->GetSpawnRange()); mWriter.AddShort("Delay", a_MobSpawner->GetSpawnDelay()); + mWriter.AddShort("MinSpawnDelay", a_MobSpawner->GetMinSpawnDelay()); + mWriter.AddShort("MaxSpawnDelay", a_MobSpawner->GetMaxSpawnDelay()); + mWriter.AddShort("MaxNearbyEntities", a_MobSpawner->GetMaxNearbyEntities()); + mWriter.AddShort("RequiredPlayerRange", a_MobSpawner->GetRequiredPlayerRange()); mWriter.EndCompound(); } -- cgit v1.2.3