summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorr.ramazanov <r.ramazanov@servplus.ru>2014-04-23 16:15:28 +0200
committerr.ramazanov <r.ramazanov@servplus.ru>2014-04-23 16:15:28 +0200
commit103c867f1f42c38df3d2bfba2ffbc4c8e7ac2932 (patch)
treeb17cb676477be05abac7084bc0e1e49f651c2456 /src
parentMobs shouldn't burn when it's Raining #906 (diff)
parentMerge pull request #925 from archshift/master (diff)
downloadcuberite-103c867f1f42c38df3d2bfba2ffbc4c8e7ac2932.tar
cuberite-103c867f1f42c38df3d2bfba2ffbc4c8e7ac2932.tar.gz
cuberite-103c867f1f42c38df3d2bfba2ffbc4c8e7ac2932.tar.bz2
cuberite-103c867f1f42c38df3d2bfba2ffbc4c8e7ac2932.tar.lz
cuberite-103c867f1f42c38df3d2bfba2ffbc4c8e7ac2932.tar.xz
cuberite-103c867f1f42c38df3d2bfba2ffbc4c8e7ac2932.tar.zst
cuberite-103c867f1f42c38df3d2bfba2ffbc4c8e7ac2932.zip
Diffstat (limited to 'src')
-rw-r--r--src/BlockEntities/DispenserEntity.cpp9
-rw-r--r--src/BlockEntities/FurnaceEntity.cpp7
-rw-r--r--src/BlockEntities/HopperEntity.cpp11
-rw-r--r--src/Blocks/BlockChest.h1
-rw-r--r--src/Blocks/BlockRail.h2
-rw-r--r--src/BoundingBox.cpp2
-rw-r--r--src/Chunk.cpp4
-rw-r--r--src/Chunk.h4
-rw-r--r--src/ChunkMap.cpp40
-rw-r--r--src/ClientHandle.cpp14
-rw-r--r--src/CraftingRecipes.cpp12
-rw-r--r--src/Crypto.cpp2
-rw-r--r--src/DeadlockDetect.cpp13
-rw-r--r--src/Enchantments.cpp12
-rw-r--r--src/Enchantments.h37
-rw-r--r--src/Entities/Entity.cpp26
-rw-r--r--src/Entities/Entity.h8
-rw-r--r--src/Entities/Minecart.cpp2
-rw-r--r--src/Entities/Player.cpp11
-rw-r--r--src/Entities/Player.h2
-rw-r--r--src/FurnaceRecipe.cpp1
-rw-r--r--src/Generating/Caves.cpp36
-rw-r--r--src/Generating/Prefab.cpp9
-rw-r--r--src/Generating/Prefab.h6
-rw-r--r--src/Generating/Prefabs/NetherFortPrefabs.cpp1183
-rw-r--r--src/Generating/Ravines.cpp15
-rw-r--r--src/Group.cpp4
-rw-r--r--src/Group.h8
-rw-r--r--src/Item.cpp9
-rw-r--r--src/Items/ItemHandler.cpp1
-rw-r--r--src/Items/ItemHandler.h4
-rw-r--r--src/MobProximityCounter.cpp4
-rw-r--r--src/MobSpawner.cpp4
-rw-r--r--src/Mobs/Sheep.cpp7
-rw-r--r--src/Mobs/Wolf.h2
-rw-r--r--src/MonsterConfig.cpp3
-rw-r--r--src/Noise.cpp22
-rw-r--r--src/Protocol/Authenticator.cpp7
-rw-r--r--src/Protocol/Protocol125.cpp32
-rw-r--r--src/Protocol/Protocol132.cpp18
-rw-r--r--src/Protocol/Protocol14x.cpp12
-rw-r--r--src/Protocol/Protocol16x.cpp17
-rw-r--r--src/Protocol/Protocol17x.cpp85
-rw-r--r--src/Protocol/ProtocolRecognizer.cpp13
-rw-r--r--src/Server.cpp4
-rw-r--r--src/Server.h4
-rw-r--r--src/Simulator/FireSimulator.cpp2
-rw-r--r--src/Simulator/FluidSimulator.cpp2
-rw-r--r--src/StackWalker.cpp3
-rw-r--r--src/UI/SlotArea.cpp11
-rw-r--r--src/WebAdmin.cpp6
-rw-r--r--src/World.cpp10
-rw-r--r--src/World.h2
-rw-r--r--src/WorldStorage/FastNBT.cpp4
-rw-r--r--src/WorldStorage/WSSCompact.cpp2
-rw-r--r--src/WorldStorage/WSSCompact.h2
56 files changed, 1252 insertions, 521 deletions
diff --git a/src/BlockEntities/DispenserEntity.cpp b/src/BlockEntities/DispenserEntity.cpp
index e03bf776d..2a32f69d9 100644
--- a/src/BlockEntities/DispenserEntity.cpp
+++ b/src/BlockEntities/DispenserEntity.cpp
@@ -128,10 +128,11 @@ void cDispenserEntity::DropSpenseFromSlot(cChunk & a_Chunk, int a_SlotNum)
if (DispChunk->GetBlock(DispX, DispY, DispZ) == E_BLOCK_AIR)
{
DispChunk->SetBlock(DispX, DispY, DispZ, E_BLOCK_FIRE, 0);
- m_Contents.SetSlot(a_SlotNum, m_Contents.GetSlot(a_SlotNum).m_ItemType, m_Contents.GetSlot(a_SlotNum).m_ItemCount, m_Contents.GetSlot(a_SlotNum).m_ItemDamage + 1);
- // If the durability has run out destroy the item.
- if (m_Contents.GetSlot(a_SlotNum).m_ItemDamage > 64)
- {
+
+ bool ItemBroke = m_Contents.DamageItem(a_SlotNum, 1);
+
+ if (ItemBroke)
+ {
m_Contents.ChangeSlotCount(a_SlotNum, -1);
}
}
diff --git a/src/BlockEntities/FurnaceEntity.cpp b/src/BlockEntities/FurnaceEntity.cpp
index 7d6d1f89e..1b1741713 100644
--- a/src/BlockEntities/FurnaceEntity.cpp
+++ b/src/BlockEntities/FurnaceEntity.cpp
@@ -413,19 +413,20 @@ bool cFurnaceEntity::CanCookInputToOutput(void) const
return false;
}
- if (m_Contents.GetSlot(fsOutput).IsEmpty())
+ const cItem & Slot = m_Contents.GetSlot(fsOutput);
+ if (Slot.IsEmpty())
{
// The output is empty, can cook
return true;
}
- if (!m_Contents.GetSlot(fsOutput).IsEqual(*m_CurrentRecipe->Out))
+ if (!Slot.IsEqual(*m_CurrentRecipe->Out))
{
// The output slot is blocked with something that cannot be stacked with the recipe's output
return false;
}
- if (m_Contents.GetSlot(fsOutput).IsFullStack())
+ if (Slot.IsFullStack())
{
// Cannot add any more items to the output slot
return false;
diff --git a/src/BlockEntities/HopperEntity.cpp b/src/BlockEntities/HopperEntity.cpp
index 41fb9f811..7f001c739 100644
--- a/src/BlockEntities/HopperEntity.cpp
+++ b/src/BlockEntities/HopperEntity.cpp
@@ -234,24 +234,27 @@ bool cHopperEntity::MovePickupsIn(cChunk & a_Chunk, Int64 a_CurrentTick)
bool TrySuckPickupIn(cPickup * a_Pickup)
{
+ cItem & Item = a_Pickup->GetItem();
+
for (int i = 0; i < ContentsWidth * ContentsHeight; i++)
{
if (m_Contents.IsSlotEmpty(i))
{
m_bFoundPickupsAbove = true;
- m_Contents.SetSlot(i, a_Pickup->GetItem());
+ m_Contents.SetSlot(i, Item);
a_Pickup->Destroy(); // Kill pickup
return true;
}
- else if (m_Contents.GetSlot(i).IsEqual(a_Pickup->GetItem()) && !m_Contents.GetSlot(i).IsFullStack())
+ else if (m_Contents.GetSlot(i).IsEqual(Item) && !m_Contents.GetSlot(i).IsFullStack())
{
m_bFoundPickupsAbove = true;
int PreviousCount = m_Contents.GetSlot(i).m_ItemCount;
- a_Pickup->GetItem().m_ItemCount -= m_Contents.ChangeSlotCount(i, a_Pickup->GetItem().m_ItemCount) - PreviousCount; // Set count to however many items were added
- if (a_Pickup->GetItem().IsEmpty())
+ Item.m_ItemCount -= m_Contents.ChangeSlotCount(i, Item.m_ItemCount) - PreviousCount; // Set count to however many items were added
+
+ if (Item.IsEmpty())
{
a_Pickup->Destroy(); // Kill pickup if all items were added
}
diff --git a/src/Blocks/BlockChest.h b/src/Blocks/BlockChest.h
index a1ded4c26..c9a769c75 100644
--- a/src/Blocks/BlockChest.h
+++ b/src/Blocks/BlockChest.h
@@ -56,6 +56,7 @@ public:
(Area.GetRelBlockType(2, 0, 1) == E_BLOCK_CHEST)
)
{
+ // FIXME: This is unreachable, as the condition is the same as the above one
a_BlockMeta = (yaw < 0) ? 4 : 5;
return true;
}
diff --git a/src/Blocks/BlockRail.h b/src/Blocks/BlockRail.h
index ad78d290a..358b5ca11 100644
--- a/src/Blocks/BlockRail.h
+++ b/src/Blocks/BlockRail.h
@@ -141,7 +141,7 @@ public:
NIBBLETYPE Meta = 0;
char RailsCnt = 0;
bool Neighbors[8]; // 0 - EAST, 1 - WEST, 2 - NORTH, 3 - SOUTH, 4 - EAST UP, 5 - WEST UP, 6 - NORTH UP, 7 - SOUTH UP
- memset(Neighbors, false, sizeof(Neighbors));
+ memset(Neighbors, 0, sizeof(Neighbors));
Neighbors[0] = (IsUnstable(a_ChunkInterface, a_BlockX + 1, a_BlockY, a_BlockZ) || !IsNotConnected(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ, BLOCK_FACE_EAST, E_PURE_DOWN));
Neighbors[1] = (IsUnstable(a_ChunkInterface, a_BlockX - 1, a_BlockY, a_BlockZ) || !IsNotConnected(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ, BLOCK_FACE_WEST, E_PURE_DOWN));
Neighbors[2] = (IsUnstable(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ - 1) || !IsNotConnected(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ, BLOCK_FACE_NORTH, E_PURE_DOWN));
diff --git a/src/BoundingBox.cpp b/src/BoundingBox.cpp
index 482f9923f..ce831c200 100644
--- a/src/BoundingBox.cpp
+++ b/src/BoundingBox.cpp
@@ -288,7 +288,7 @@ bool cBoundingBox::CalcLineIntersection(const Vector3d & a_Min, const Vector3d &
Coeff = c;
}
c = a_Line1.LineCoeffToXZPlane(a_Line2, a_Max.y);
- if ((c >= 0) && (c >= 0) && (c < Coeff) && IsInside(a_Min, a_Max, a_Line1 + (a_Line2 - a_Line1) * c))
+ if ((c >= 0) && (c < Coeff) && IsInside(a_Min, a_Max, a_Line1 + (a_Line2 - a_Line1) * c))
{
Face = (a_Line1.y > a_Line2.y) ? BLOCK_FACE_YP : BLOCK_FACE_YM;
Coeff = c;
diff --git a/src/Chunk.cpp b/src/Chunk.cpp
index 4366111ef..8bd0985e9 100644
--- a/src/Chunk.cpp
+++ b/src/Chunk.cpp
@@ -452,7 +452,7 @@ void cChunk::CollectMobCensus(cMobCensus& toFill)
{
cMonster& Monster = (cMonster&)(**itr);
currentPosition = Monster.GetPosition();
- for (std::list<const Vector3d*>::const_iterator itr2 = playerPositions.begin(); itr2 != playerPositions.end(); itr2 ++)
+ for (std::list<const Vector3d*>::const_iterator itr2 = playerPositions.begin(); itr2 != playerPositions.end(); ++itr2)
{
toFill.CollectMob(Monster,*this,(currentPosition-**itr2).SqrLength());
}
@@ -600,7 +600,7 @@ void cChunk::Tick(float a_Dt)
delete ToDelete;
continue;
}
- itr++;
+ ++itr;
} // for itr - m_Entitites[]
// If any entity moved out of the chunk, move it to the neighbor:
diff --git a/src/Chunk.h b/src/Chunk.h
index b3fa563cc..f20134e66 100644
--- a/src/Chunk.h
+++ b/src/Chunk.h
@@ -382,14 +382,14 @@ private:
struct sSetBlockQueueItem
{
+ Int64 m_Tick;
int m_RelX, m_RelY, m_RelZ;
BLOCKTYPE m_BlockType;
NIBBLETYPE m_BlockMeta;
- Int64 m_Tick;
BLOCKTYPE m_PreviousType;
sSetBlockQueueItem(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Int64 a_Tick, BLOCKTYPE a_PreviousBlockType) :
- m_RelX(a_RelX), m_RelY(a_RelY), m_RelZ(a_RelZ), m_BlockType(a_BlockType), m_BlockMeta(a_BlockMeta), m_Tick(a_Tick), m_PreviousType(a_PreviousBlockType)
+ m_Tick(a_Tick), m_RelX(a_RelX), m_RelY(a_RelY), m_RelZ(a_RelZ), m_BlockType(a_BlockType), m_BlockMeta(a_BlockMeta), m_PreviousType(a_PreviousBlockType)
{
}
} ;
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp
index 83eae2665..ed9103174 100644
--- a/src/ChunkMap.cpp
+++ b/src/ChunkMap.cpp
@@ -1656,7 +1656,7 @@ void cChunkMap::AddEntity(cEntity * a_Entity)
{
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(a_Entity->GetChunkX(), ZERO_CHUNK_Y, a_Entity->GetChunkZ());
- if ((Chunk == NULL) && !Chunk->IsValid())
+ if ((Chunk == NULL) || !Chunk->IsValid())
{
LOGWARNING("Entity at %p (%s, ID %d) spawning in a non-existent chunk, the entity is lost.",
a_Entity, a_Entity->GetClass(), a_Entity->GetUniqueID()
@@ -1691,7 +1691,7 @@ void cChunkMap::RemoveEntity(cEntity * a_Entity)
{
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(a_Entity->GetChunkX(), ZERO_CHUNK_Y, a_Entity->GetChunkZ());
- if ((Chunk == NULL) && !Chunk->IsValid())
+ if ((Chunk == NULL) || !Chunk->IsValid())
{
return;
}
@@ -1723,7 +1723,7 @@ bool cChunkMap::ForEachEntityInChunk(int a_ChunkX, int a_ChunkZ, cEntityCallback
{
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(a_ChunkX, ZERO_CHUNK_Y, a_ChunkZ);
- if ((Chunk == NULL) && !Chunk->IsValid())
+ if ((Chunk == NULL) || !Chunk->IsValid())
{
return false;
}
@@ -1973,7 +1973,7 @@ bool cChunkMap::ForEachBlockEntityInChunk(int a_ChunkX, int a_ChunkZ, cBlockEnti
{
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(a_ChunkX, ZERO_CHUNK_Y, a_ChunkZ);
- if ((Chunk == NULL) && !Chunk->IsValid())
+ if ((Chunk == NULL) || !Chunk->IsValid())
{
return false;
}
@@ -1988,7 +1988,7 @@ bool cChunkMap::ForEachChestInChunk(int a_ChunkX, int a_ChunkZ, cChestCallback &
{
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(a_ChunkX, ZERO_CHUNK_Y, a_ChunkZ);
- if ((Chunk == NULL) && !Chunk->IsValid())
+ if ((Chunk == NULL) || !Chunk->IsValid())
{
return false;
}
@@ -2003,7 +2003,7 @@ bool cChunkMap::ForEachDispenserInChunk(int a_ChunkX, int a_ChunkZ, cDispenserCa
{
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(a_ChunkX, ZERO_CHUNK_Y, a_ChunkZ);
- if ((Chunk == NULL) && !Chunk->IsValid())
+ if ((Chunk == NULL) || !Chunk->IsValid())
{
return false;
}
@@ -2018,7 +2018,7 @@ bool cChunkMap::ForEachDropperInChunk(int a_ChunkX, int a_ChunkZ, cDropperCallba
{
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(a_ChunkX, ZERO_CHUNK_Y, a_ChunkZ);
- if ((Chunk == NULL) && !Chunk->IsValid())
+ if ((Chunk == NULL) || !Chunk->IsValid())
{
return false;
}
@@ -2033,7 +2033,7 @@ bool cChunkMap::ForEachDropSpenserInChunk(int a_ChunkX, int a_ChunkZ, cDropSpens
{
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(a_ChunkX, ZERO_CHUNK_Y, a_ChunkZ);
- if ((Chunk == NULL) && !Chunk->IsValid())
+ if ((Chunk == NULL) || !Chunk->IsValid())
{
return false;
}
@@ -2048,7 +2048,7 @@ bool cChunkMap::ForEachFurnaceInChunk(int a_ChunkX, int a_ChunkZ, cFurnaceCallba
{
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(a_ChunkX, ZERO_CHUNK_Y, a_ChunkZ);
- if ((Chunk == NULL) && !Chunk->IsValid())
+ if ((Chunk == NULL) || !Chunk->IsValid())
{
return false;
}
@@ -2066,7 +2066,7 @@ bool cChunkMap::DoWithBlockEntityAt(int a_BlockX, int a_BlockY, int a_BlockZ, cB
cChunkDef::AbsoluteToRelative(BlockX, BlockY, BlockZ, ChunkX, ChunkZ);
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(ChunkX, ZERO_CHUNK_Y, ChunkZ);
- if ((Chunk == NULL) && !Chunk->IsValid())
+ if ((Chunk == NULL) || !Chunk->IsValid())
{
return false;
}
@@ -2084,7 +2084,7 @@ bool cChunkMap::DoWithChestAt(int a_BlockX, int a_BlockY, int a_BlockZ, cChestCa
cChunkDef::AbsoluteToRelative(BlockX, BlockY, BlockZ, ChunkX, ChunkZ);
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(ChunkX, ZERO_CHUNK_Y, ChunkZ);
- if ((Chunk == NULL) && !Chunk->IsValid())
+ if ((Chunk == NULL) || !Chunk->IsValid())
{
return false;
}
@@ -2102,7 +2102,7 @@ bool cChunkMap::DoWithDispenserAt(int a_BlockX, int a_BlockY, int a_BlockZ, cDis
cChunkDef::AbsoluteToRelative(BlockX, BlockY, BlockZ, ChunkX, ChunkZ);
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(ChunkX, ZERO_CHUNK_Y, ChunkZ);
- if ((Chunk == NULL) && !Chunk->IsValid())
+ if ((Chunk == NULL) || !Chunk->IsValid())
{
return false;
}
@@ -2120,7 +2120,7 @@ bool cChunkMap::DoWithDropperAt(int a_BlockX, int a_BlockY, int a_BlockZ, cDropp
cChunkDef::AbsoluteToRelative(BlockX, BlockY, BlockZ, ChunkX, ChunkZ);
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(ChunkX, ZERO_CHUNK_Y, ChunkZ);
- if ((Chunk == NULL) && !Chunk->IsValid())
+ if ((Chunk == NULL) || !Chunk->IsValid())
{
return false;
}
@@ -2138,7 +2138,7 @@ bool cChunkMap::DoWithDropSpenserAt(int a_BlockX, int a_BlockY, int a_BlockZ, cD
cChunkDef::AbsoluteToRelative(BlockX, BlockY, BlockZ, ChunkX, ChunkZ);
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(ChunkX, ZERO_CHUNK_Y, ChunkZ);
- if ((Chunk == NULL) && !Chunk->IsValid())
+ if ((Chunk == NULL) || !Chunk->IsValid())
{
return false;
}
@@ -2156,7 +2156,7 @@ bool cChunkMap::DoWithFurnaceAt(int a_BlockX, int a_BlockY, int a_BlockZ, cFurna
cChunkDef::AbsoluteToRelative(BlockX, BlockY, BlockZ, ChunkX, ChunkZ);
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(ChunkX, ZERO_CHUNK_Y, ChunkZ);
- if ((Chunk == NULL) && !Chunk->IsValid())
+ if ((Chunk == NULL) || !Chunk->IsValid())
{
return false;
}
@@ -2173,7 +2173,7 @@ bool cChunkMap::DoWithNoteBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cNot
cChunkDef::AbsoluteToRelative(BlockX, BlockY, BlockZ, ChunkX, ChunkZ);
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(ChunkX, ZERO_CHUNK_Y, ChunkZ);
- if ((Chunk == NULL) && !Chunk->IsValid())
+ if ((Chunk == NULL) || !Chunk->IsValid())
{
return false;
}
@@ -2190,7 +2190,7 @@ bool cChunkMap::DoWithCommandBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, c
cChunkDef::AbsoluteToRelative(BlockX, BlockY, BlockZ, ChunkX, ChunkZ);
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(ChunkX, ZERO_CHUNK_Y, ChunkZ);
- if ((Chunk == NULL) && !Chunk->IsValid())
+ if ((Chunk == NULL) || !Chunk->IsValid())
{
return false;
}
@@ -2208,7 +2208,7 @@ bool cChunkMap::DoWithMobHeadAt(int a_BlockX, int a_BlockY, int a_BlockZ, cMobHe
cChunkDef::AbsoluteToRelative(BlockX, BlockY, BlockZ, ChunkX, ChunkZ);
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(ChunkX, ZERO_CHUNK_Y, ChunkZ);
- if ((Chunk == NULL) && !Chunk->IsValid())
+ if ((Chunk == NULL) || !Chunk->IsValid())
{
return false;
}
@@ -2226,7 +2226,7 @@ bool cChunkMap::DoWithFlowerPotAt(int a_BlockX, int a_BlockY, int a_BlockZ, cFlo
cChunkDef::AbsoluteToRelative(BlockX, BlockY, BlockZ, ChunkX, ChunkZ);
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(ChunkX, ZERO_CHUNK_Y, ChunkZ);
- if ((Chunk == NULL) && !Chunk->IsValid())
+ if ((Chunk == NULL) || !Chunk->IsValid())
{
return false;
}
@@ -2244,7 +2244,7 @@ bool cChunkMap::GetSignLines(int a_BlockX, int a_BlockY, int a_BlockZ, AString &
cChunkDef::AbsoluteToRelative(BlockX, BlockY, BlockZ, ChunkX, ChunkZ);
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(ChunkX, ZERO_CHUNK_Y, ChunkZ);
- if ((Chunk == NULL) && !Chunk->IsValid())
+ if ((Chunk == NULL) || !Chunk->IsValid())
{
return false;
}
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index c7805e4de..0f26d41e7 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -453,14 +453,16 @@ void cClientHandle::HandlePing(void)
{
// Somebody tries to retrieve information about the server
AString Reply;
+ const cServer & Server = *cRoot::Get()->GetServer();
+
Printf(Reply, "%s%s%i%s%i",
- cRoot::Get()->GetServer()->GetDescription().c_str(),
+ Server.GetDescription().c_str(),
cChatColor::Delimiter.c_str(),
- cRoot::Get()->GetServer()->GetNumPlayers(),
+ Server.GetNumPlayers(),
cChatColor::Delimiter.c_str(),
- cRoot::Get()->GetServer()->GetMaxPlayers()
+ Server.GetMaxPlayers()
);
- Kick(Reply.c_str());
+ Kick(Reply);
}
@@ -1216,8 +1218,8 @@ void cClientHandle::HandleChat(const AString & a_Message)
Color = AString("@") + Color[2];
}
else
- {
- Color.empty();
+ {
+ Color.clear();
}
Msg.AddTextPart(AString("<") + m_Player->GetName() + "> ", Color);
Msg.ParseText(a_Message);
diff --git a/src/CraftingRecipes.cpp b/src/CraftingRecipes.cpp
index 30e7a8733..b0af8f271 100644
--- a/src/CraftingRecipes.cpp
+++ b/src/CraftingRecipes.cpp
@@ -661,14 +661,16 @@ cCraftingRecipes::cRecipe * cCraftingRecipes::MatchRecipe(const cItem * a_Crafti
ASSERT(itrS->x + a_OffsetX < a_GridWidth);
ASSERT(itrS->y + a_OffsetY < a_GridHeight);
int GridID = (itrS->x + a_OffsetX) + a_GridStride * (itrS->y + a_OffsetY);
+
+ const cItem & Item = itrS->m_Item;
if (
(itrS->x >= a_GridWidth) ||
(itrS->y >= a_GridHeight) ||
- (itrS->m_Item.m_ItemType != a_CraftingGrid[GridID].m_ItemType) || // same item type?
- (itrS->m_Item.m_ItemCount > a_CraftingGrid[GridID].m_ItemCount) || // not enough items
+ (Item.m_ItemType != a_CraftingGrid[GridID].m_ItemType) || // same item type?
+ (Item.m_ItemCount > a_CraftingGrid[GridID].m_ItemCount) || // not enough items
(
- (itrS->m_Item.m_ItemDamage > 0) && // should compare damage values?
- (itrS->m_Item.m_ItemDamage != a_CraftingGrid[GridID].m_ItemDamage)
+ (Item.m_ItemDamage > 0) && // should compare damage values?
+ (Item.m_ItemDamage != a_CraftingGrid[GridID].m_ItemDamage)
)
)
{
@@ -824,7 +826,7 @@ void cCraftingRecipes::HandleFireworks(const cItem * a_CraftingGrid, cCraftingRe
case E_ITEM_DYE:
{
int GridID = (itr->x + a_OffsetX) + a_GridStride * (itr->y + a_OffsetY);
- DyeColours.push_back(cFireworkItem::GetVanillaColourCodeFromDye(a_CraftingGrid[GridID].m_ItemDamage));
+ DyeColours.push_back(cFireworkItem::GetVanillaColourCodeFromDye((NIBBLETYPE)(a_CraftingGrid[GridID].m_ItemDamage & 0x0f)));
break;
}
case E_ITEM_GUNPOWDER: break;
diff --git a/src/Crypto.cpp b/src/Crypto.cpp
index 26500f263..16be5ec35 100644
--- a/src/Crypto.cpp
+++ b/src/Crypto.cpp
@@ -206,7 +206,7 @@ int cRSAPrivateKey::Encrypt(const Byte * a_PlainData, size_t a_PlainLength, Byte
ASSERT(!"Invalid a_DecryptedMaxLength!");
return -1;
}
- if (a_EncryptedMaxLength < m_Rsa.len)
+ if (a_PlainLength < m_Rsa.len)
{
LOGD("%s: Invalid a_PlainLength: got %u, exp at least %u",
__FUNCTION__, (unsigned)a_PlainLength, (unsigned)(m_Rsa.len)
diff --git a/src/DeadlockDetect.cpp b/src/DeadlockDetect.cpp
index 322084dc4..38a3c369e 100644
--- a/src/DeadlockDetect.cpp
+++ b/src/DeadlockDetect.cpp
@@ -112,18 +112,21 @@ void cDeadlockDetect::CheckWorldAge(const AString & a_WorldName, Int64 a_Age)
ASSERT(!"Unknown world in cDeadlockDetect");
return;
}
- if (itr->second.m_Age == a_Age)
+
+ cDeadlockDetect::sWorldAge & WorldAge = itr->second;
+
+ if (WorldAge.m_Age == a_Age)
{
- itr->second.m_NumCyclesSame += 1;
- if (itr->second.m_NumCyclesSame > (1000 * m_IntervalSec) / CYCLE_MILLISECONDS)
+ WorldAge.m_NumCyclesSame += 1;
+ if (WorldAge.m_NumCyclesSame > (1000 * m_IntervalSec) / CYCLE_MILLISECONDS)
{
DeadlockDetected();
}
}
else
{
- itr->second.m_Age = a_Age;
- itr->second.m_NumCyclesSame = 0;
+ WorldAge.m_Age = a_Age;
+ WorldAge.m_NumCyclesSame = 0;
}
}
diff --git a/src/Enchantments.cpp b/src/Enchantments.cpp
index dad92dc91..64f89815b 100644
--- a/src/Enchantments.cpp
+++ b/src/Enchantments.cpp
@@ -29,6 +29,18 @@ cEnchantments::cEnchantments(const AString & a_StringSpec)
+void cEnchantments::Add(const cEnchantments & a_Other)
+{
+ for (cEnchantments::cMap::const_iterator itr = a_Other.m_Enchantments.begin(), end = a_Other.m_Enchantments.end(); itr != end; ++itr)
+ {
+ SetLevel(itr->first, itr->second);
+ } // for itr - a_Other.m_Enchantments[]
+}
+
+
+
+
+
void cEnchantments::AddFromString(const AString & a_StringSpec)
{
// Add enchantments in the stringspec; if a specified enchantment already exists, overwrites it
diff --git a/src/Enchantments.h b/src/Enchantments.h
index a376d27cf..dc5502702 100644
--- a/src/Enchantments.h
+++ b/src/Enchantments.h
@@ -40,7 +40,8 @@ Serialization will never put zero-level enchantments into the stringspec and wil
class cEnchantments
{
public:
- /// Individual enchantment IDs, corresponding to their NBT IDs ( http://www.minecraftwiki.net/wiki/Data_Values#Enchantment_IDs )
+ /** Individual enchantment IDs, corresponding to their NBT IDs ( http://www.minecraftwiki.net/wiki/Data_Values#Enchantment_IDs )
+ */
enum
{
@@ -70,34 +71,38 @@ public:
enchLure = 62,
} ;
- /// Creates an empty enchantments container
+ /** Creates an empty enchantments container */
cEnchantments(void);
- /// Creates an enchantments container filled with enchantments parsed from stringspec
+ /** Creates an enchantments container filled with enchantments parsed from stringspec */
cEnchantments(const AString & a_StringSpec);
- /// Adds enchantments in the stringspec; if a specified enchantment already exists, overwrites it
+ /** Adds the enchantments contained in a_Other into this object.
+ Existing enchantments are preserved, unless a_Other specifies a different level, in which case the level is changed. */
+ void Add(const cEnchantments & a_Other);
+
+ /** Adds enchantments in the stringspec; if a specified enchantment already exists, overwrites it */
void AddFromString(const AString & a_StringSpec);
- /// Serializes all the enchantments into a string
+ /** Serializes all the enchantments into a string */
AString ToString(void) const;
- /// Returns the level for the specified enchantment; 0 if not stored
+ /** Returns the level for the specified enchantment; 0 if not stored */
int GetLevel(int a_EnchantmentID) const;
- /// Sets the level for the specified enchantment, adding it if not stored before or removing it if level <= 0
+ /** Sets the level for the specified enchantment, adding it if not stored before or removing it if level <= 0 */
void SetLevel(int a_EnchantmentID, int a_Level);
- /// Removes all enchantments
+ /** Removes all enchantments */
void Clear(void);
- /// Returns true if there are no enchantments
+ /** Returns true if there are no enchantments */
bool IsEmpty(void) const;
- /// Converts enchantment name to the numeric representation; returns -1 if enchantment name not found; case insensitive
+ /** Converts enchantment name to the numeric representation; returns -1 if enchantment name not found; case insensitive */
static int StringToEnchantmentID(const AString & a_EnchantmentName);
- /// Returns true if a_Other contains exactly the same enchantments and levels
+ /** Returns true if a_Other contains exactly the same enchantments and levels */
bool operator ==(const cEnchantments & a_Other) const;
// tolua_end
@@ -120,20 +125,20 @@ public:
/** Gets random enchantment from Vector and returns it */
static cEnchantments GetRandomEnchantmentFromVector(cWeightedEnchantments & a_Enchantments);
- /// Returns true if a_Other doesn't contain exactly the same enchantments and levels
+ /** Returns true if a_Other doesn't contain exactly the same enchantments and levels */
bool operator !=(const cEnchantments & a_Other) const;
- /// Writes the enchantments into the specified NBT writer; begins with the LIST tag of the specified name ("ench" or "StoredEnchantments")
+ /** Writes the enchantments into the specified NBT writer; begins with the LIST tag of the specified name ("ench" or "StoredEnchantments") */
friend void EnchantmentSerializer::WriteToNBTCompound(cEnchantments const& a_Enchantments, cFastNBTWriter & a_Writer, const AString & a_ListTagName);
- /// Reads the enchantments from the specified NBT list tag (ench or StoredEnchantments)
+ /** Reads the enchantments from the specified NBT list tag (ench or StoredEnchantments) */
friend void EnchantmentSerializer::ParseFromNBT(cEnchantments& a_Enchantments, const cParsedNBT & a_NBT, int a_EnchListTagIdx);
protected:
- /// Maps enchantment ID -> enchantment level
+ /** Maps enchantment ID -> enchantment level */
typedef std::map<int, int> cMap;
- /// Currently stored enchantments
+ /** Currently stored enchantments */
cMap m_Enchantments;
} ; // tolua_export
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index 46bb499b4..c09317298 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -45,6 +45,7 @@ cEntity::cEntity(eEntityType a_EntityType, double a_X, double a_Y, double a_Z, d
, m_IsInitialized(false)
, m_EntityType(a_EntityType)
, m_World(NULL)
+ , m_IsFireproof(false)
, m_TicksSinceLastBurnDamage(0)
, m_TicksSinceLastLavaDamage(0)
, m_TicksSinceLastFireDamage(0)
@@ -816,7 +817,10 @@ void cEntity::TickBurning(cChunk & a_Chunk)
m_TicksSinceLastBurnDamage++;
if (m_TicksSinceLastBurnDamage >= BURN_TICKS_PER_DAMAGE)
{
- TakeDamage(dtOnFire, NULL, BURN_DAMAGE, 0);
+ if (!m_IsFireproof)
+ {
+ TakeDamage(dtOnFire, NULL, BURN_DAMAGE, 0);
+ }
m_TicksSinceLastBurnDamage = 0;
}
m_TicksLeftBurning--;
@@ -884,7 +888,10 @@ void cEntity::TickBurning(cChunk & a_Chunk)
m_TicksSinceLastLavaDamage++;
if (m_TicksSinceLastLavaDamage >= LAVA_TICKS_PER_DAMAGE)
{
- TakeDamage(dtLavaContact, NULL, LAVA_DAMAGE, 0);
+ if (!m_IsFireproof)
+ {
+ TakeDamage(dtLavaContact, NULL, LAVA_DAMAGE, 0);
+ }
m_TicksSinceLastLavaDamage = 0;
}
}
@@ -902,7 +909,10 @@ void cEntity::TickBurning(cChunk & a_Chunk)
m_TicksSinceLastFireDamage++;
if (m_TicksSinceLastFireDamage >= FIRE_TICKS_PER_DAMAGE)
{
- TakeDamage(dtFireContact, NULL, FIRE_DAMAGE, 0);
+ if (!m_IsFireproof)
+ {
+ TakeDamage(dtFireContact, NULL, FIRE_DAMAGE, 0);
+ }
m_TicksSinceLastFireDamage = 0;
}
}
@@ -1061,6 +1071,16 @@ void cEntity::SetMaxHealth(int a_MaxHealth)
+/// Sets whether the entity is fireproof
+void cEntity::SetIsFireproof(bool a_IsFireproof)
+{
+ m_IsFireproof = a_IsFireproof;
+}
+
+
+
+
+
/// Puts the entity on fire for the specified amount of ticks
void cEntity::StartBurning(int a_TicksLeftBurning)
{
diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h
index 8f3899e2f..86efc5a98 100644
--- a/src/Entities/Entity.h
+++ b/src/Entities/Entity.h
@@ -329,6 +329,11 @@ public:
int GetMaxHealth(void) const { return m_MaxHealth; }
+ /// Sets whether the entity is fireproof
+ void SetIsFireproof(bool a_IsFireproof);
+
+ bool IsFireproof(void) const { return m_IsFireproof; }
+
/// Puts the entity on fire for the specified amount of ticks
void StartBurning(int a_TicksLeftBurning);
@@ -435,6 +440,9 @@ protected:
cWorld * m_World;
+ /// Whether the entity is capable of taking fire or lava damage.
+ bool m_IsFireproof;
+
/// Time, in ticks, since the last damage dealt by being on fire. Valid only if on fire (IsOnFire())
int m_TicksSinceLastBurnDamage;
diff --git a/src/Entities/Minecart.cpp b/src/Entities/Minecart.cpp
index 6db13231d..db55eb058 100644
--- a/src/Entities/Minecart.cpp
+++ b/src/Entities/Minecart.cpp
@@ -795,7 +795,7 @@ bool cMinecart::TestBlockCollision(NIBBLETYPE a_RailMeta)
{
BLOCKTYPE BlockXM = m_World->GetBlock(POSX_TOINT - 1, POSY_TOINT, POSZ_TOINT);
BLOCKTYPE BlockXP = m_World->GetBlock(POSX_TOINT + 1, POSY_TOINT, POSZ_TOINT);
- BLOCKTYPE BlockZM = m_World->GetBlock(POSX_TOINT, POSY_TOINT, POSZ_TOINT + 1);
+ BLOCKTYPE BlockZM = m_World->GetBlock(POSX_TOINT, POSY_TOINT, POSZ_TOINT - 1);
BLOCKTYPE BlockZP = m_World->GetBlock(POSX_TOINT, POSY_TOINT, POSZ_TOINT + 1);
if (
(!IsBlockRail(BlockXM) && cBlockInfo::IsSolid(BlockXM)) ||
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index 2df0711b4..fedb62527 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -85,9 +85,10 @@ cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName)
if (!LoadFromDisk())
{
m_Inventory.Clear();
- SetPosX(cRoot::Get()->GetDefaultWorld()->GetSpawnX());
- SetPosY(cRoot::Get()->GetDefaultWorld()->GetSpawnY());
- SetPosZ(cRoot::Get()->GetDefaultWorld()->GetSpawnZ());
+ cWorld * DefaultWorld = cRoot::Get()->GetDefaultWorld();
+ SetPosX(DefaultWorld->GetSpawnX());
+ SetPosY(DefaultWorld->GetSpawnY());
+ SetPosZ(DefaultWorld->GetSpawnZ());
LOGD("Player \"%s\" is connecting for the first time, spawning at default world spawn {%.2f, %.2f, %.2f}",
a_PlayerName.c_str(), GetPosX(), GetPosY(), GetPosZ()
@@ -1165,9 +1166,9 @@ Vector3d cPlayer::GetThrowSpeed(double a_SpeedCoeff) const
-void cPlayer::ForceSetSpeed(Vector3d a_Direction)
+void cPlayer::ForceSetSpeed(const Vector3d & a_Speed)
{
- SetSpeed(a_Direction);
+ SetSpeed(a_Speed);
m_ClientHandle->SendEntityVelocity(*this);
}
diff --git a/src/Entities/Player.h b/src/Entities/Player.h
index 05377a117..78d661015 100644
--- a/src/Entities/Player.h
+++ b/src/Entities/Player.h
@@ -181,7 +181,7 @@ public:
void LoginSetGameMode(eGameMode a_GameMode);
/** Forces the player to move in the given direction. */
- void ForceSetSpeed(Vector3d a_Direction); // tolua_export
+ void ForceSetSpeed(const Vector3d & a_Speed); // tolua_export
/** Tries to move to a new position, with attachment-related checks (y == -999) */
void MoveTo(const Vector3d & a_NewPos); // tolua_export
diff --git a/src/FurnaceRecipe.cpp b/src/FurnaceRecipe.cpp
index 1810d7c49..bd7fd8079 100644
--- a/src/FurnaceRecipe.cpp
+++ b/src/FurnaceRecipe.cpp
@@ -56,7 +56,6 @@ void cFurnaceRecipe::ReloadRecipes(void)
std::ifstream f;
char a_File[] = "furnace.txt";
f.open(a_File, std::ios::in);
- std::string input;
if (!f.good())
{
diff --git a/src/Generating/Caves.cpp b/src/Generating/Caves.cpp
index 98b7c8681..5cad11d2a 100644
--- a/src/Generating/Caves.cpp
+++ b/src/Generating/Caves.cpp
@@ -200,13 +200,14 @@ void cCaveTunnel::Randomize(cNoise & a_Noise)
for (int i = 0; i < 4; i++)
{
// For each already present point, insert a point in between it and its predecessor, shifted randomly.
- int PrevX = m_Points.front().m_BlockX;
- int PrevY = m_Points.front().m_BlockY;
- int PrevZ = m_Points.front().m_BlockZ;
- int PrevR = m_Points.front().m_Radius;
+ cCaveDefPoint & Point = m_Points.front();
+ int PrevX = Point.m_BlockX;
+ int PrevY = Point.m_BlockY;
+ int PrevZ = Point.m_BlockZ;
+ int PrevR = Point.m_Radius;
cCaveDefPoints Pts;
Pts.reserve(m_Points.size() * 2 + 1);
- Pts.push_back(m_Points.front());
+ Pts.push_back(Point);
for (cCaveDefPoints::const_iterator itr = m_Points.begin() + 1, end = m_Points.end(); itr != end; ++itr)
{
int Random = a_Noise.IntNoise3DInt(PrevX, PrevY, PrevZ + i) / 11;
@@ -244,11 +245,12 @@ bool cCaveTunnel::RefineDefPoints(const cCaveDefPoints & a_Src, cCaveDefPoints &
a_Dst.clear();
a_Dst.reserve(Num * 2 + 2);
cCaveDefPoints::const_iterator itr = a_Src.begin() + 1;
- a_Dst.push_back(a_Src.front());
- int PrevX = a_Src.front().m_BlockX;
- int PrevY = a_Src.front().m_BlockY;
- int PrevZ = a_Src.front().m_BlockZ;
- int PrevR = a_Src.front().m_Radius;
+ const cCaveDefPoint & Source = a_Src.front();
+ a_Dst.push_back(Source);
+ int PrevX = Source.m_BlockX;
+ int PrevY = Source.m_BlockY;
+ int PrevZ = Source.m_BlockZ;
+ int PrevR = Source.m_Radius;
for (int i = 0; i <= Num; ++i, ++itr)
{
int dx = itr->m_BlockX - PrevX;
@@ -310,9 +312,10 @@ void cCaveTunnel::FinishLinear(void)
std::swap(Pts, m_Points);
m_Points.reserve(Pts.size() * 3);
- int PrevX = Pts.front().m_BlockX;
- int PrevY = Pts.front().m_BlockY;
- int PrevZ = Pts.front().m_BlockZ;
+ cCaveDefPoint & PrevPoint = Pts.front();
+ int PrevX = PrevPoint.m_BlockX;
+ int PrevY = PrevPoint.m_BlockY;
+ int PrevZ = PrevPoint.m_BlockZ;
for (cCaveDefPoints::const_iterator itr = Pts.begin() + 1, end = Pts.end(); itr != end; ++itr)
{
int x1 = itr->m_BlockX;
@@ -433,9 +436,10 @@ void cCaveTunnel::FinishLinear(void)
void cCaveTunnel::CalcBoundingBox(void)
{
- m_MinBlockX = m_MaxBlockX = m_Points.front().m_BlockX;
- m_MinBlockY = m_MaxBlockY = m_Points.front().m_BlockY;
- m_MinBlockZ = m_MaxBlockZ = m_Points.front().m_BlockZ;
+ cCaveDefPoint & Point = m_Points.front();
+ m_MinBlockX = m_MaxBlockX = Point.m_BlockX;
+ m_MinBlockY = m_MaxBlockY = Point.m_BlockY;
+ m_MinBlockZ = m_MaxBlockZ = Point.m_BlockZ;
for (cCaveDefPoints::const_iterator itr = m_Points.begin() + 1, end = m_Points.end(); itr != end; ++itr)
{
m_MinBlockX = std::min(m_MinBlockX, itr->m_BlockX - itr->m_Radius);
diff --git a/src/Generating/Prefab.cpp b/src/Generating/Prefab.cpp
index 7d1762036..c0c9e8a13 100644
--- a/src/Generating/Prefab.cpp
+++ b/src/Generating/Prefab.cpp
@@ -23,6 +23,10 @@ static const cPrefab::sDef g_TestPrefabDef =
// Size:
7, 6, 7, // SizeX = 7, SizeY = 6, SizeZ = 7
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 6, 5, 6, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* 0 */
"a:112: 0\n" /* netherbrick */
@@ -115,7 +119,10 @@ static cPrefab g_TestPrefab(g_TestPrefabDef);
cPrefab::cPrefab(const cPrefab::sDef & a_Def) :
m_Size(a_Def.m_SizeX, a_Def.m_SizeY, a_Def.m_SizeZ),
- m_HitBox(0, 0, 0, a_Def.m_SizeX - 1, a_Def.m_SizeY - 1, a_Def.m_SizeZ - 1),
+ m_HitBox(
+ a_Def.m_HitboxMinX, a_Def.m_HitboxMinY, a_Def.m_HitboxMinZ,
+ a_Def.m_HitboxMaxX, a_Def.m_HitboxMaxY, a_Def.m_HitboxMaxZ
+ ),
m_AllowedRotations(a_Def.m_AllowedRotations),
m_MergeStrategy(a_Def.m_MergeStrategy),
m_ShouldExtendFloor(a_Def.m_ShouldExtendFloor),
diff --git a/src/Generating/Prefab.h b/src/Generating/Prefab.h
index dbf882e21..37db2ff16 100644
--- a/src/Generating/Prefab.h
+++ b/src/Generating/Prefab.h
@@ -38,6 +38,10 @@ public:
int m_SizeY;
int m_SizeZ;
+ /** The hitbox used for collision-checking between prefabs. Relative to the bounds. */
+ int m_HitboxMinX, m_HitboxMinY, m_HitboxMinZ;
+ int m_HitboxMaxX, m_HitboxMaxY, m_HitboxMaxZ;
+
/** The mapping between characters in m_Image and the blocktype / blockmeta.
Format: "Char: BlockType: BlockMeta \n Char: BlockType : BlockMeta \n ..." */
const char * m_CharMap;
@@ -114,7 +118,7 @@ protected:
/** The size of the prefab */
Vector3i m_Size;
- /** The hitbox of the prefab. In first version is the same as the m_BlockArea dimensions */
+ /** The hitbox used for collision-checking between prefabs. */
cCuboid m_HitBox;
/** The connectors through which the piece connects to other pieces */
diff --git a/src/Generating/Prefabs/NetherFortPrefabs.cpp b/src/Generating/Prefabs/NetherFortPrefabs.cpp
index 7a46df5d8..20cee576c 100644
--- a/src/Generating/Prefabs/NetherFortPrefabs.cpp
+++ b/src/Generating/Prefabs/NetherFortPrefabs.cpp
@@ -22,6 +22,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
13, 7, 9, // SizeX = 13, SizeY = 7, SizeZ = 9
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 12, 6, 8, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -160,6 +164,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
13, 7, 11, // SizeX = 13, SizeY = 7, SizeZ = 11
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 12, 6, 10, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -313,6 +321,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
10, 7, 7, // SizeX = 10, SizeY = 7, SizeZ = 7
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 9, 6, 6, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -414,7 +426,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
100,
// DepthWeight:
- "",
+ "1:0|2:0|3:0|4:0|5:0",
// AddWeightIfSame:
0,
@@ -429,6 +441,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
14, 9, 7, // SizeX = 14, SizeY = 9, SizeZ = 7
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 13, 18, 6, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -558,7 +574,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
100,
// DepthWeight:
- "",
+ "1:0|2:0|3:0|4:0|5:0",
// AddWeightIfSame:
0,
@@ -573,6 +589,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
15, 8, 15, // SizeX = 15, SizeY = 8, SizeZ = 15
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 14, 17, 14, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -757,7 +777,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
"",
// AddWeightIfSame:
- 0,
+ -1000,
}, // BridgeCircleCrossing
@@ -769,6 +789,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
15, 8, 15, // SizeX = 15, SizeY = 8, SizeZ = 15
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 14, 17, 14, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -966,6 +990,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
9, 6, 5, // SizeX = 9, SizeY = 6, SizeZ = 5
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 8, 15, 4, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -1041,7 +1069,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
100,
// DepthWeight:
- "1:0",
+ "1:0|2:0|3:0|4:0|5:0",
// AddWeightIfSame:
0,
@@ -1056,6 +1084,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
13, 6, 5, // SizeX = 13, SizeY = 6, SizeZ = 5
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 12, 15, 4, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -1137,7 +1169,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
100,
// DepthWeight:
- "1:0",
+ "1:0|2:0|3:0|4:0|5:0",
// AddWeightIfSame:
0,
@@ -1152,6 +1184,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
5, 7, 16, // SizeX = 5, SizeY = 7, SizeZ = 16
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 4, 6, 15, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -1327,6 +1363,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
15, 12, 12, // SizeX = 15, SizeY = 12, SizeZ = 12
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 14, 21, 11, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -1558,304 +1598,311 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// BridgeLevelCrossing:
- // The data has been exported from the gallery Nether, area index 45, ID 304, created by Aloe_vera
+ // The data has been exported from the gallery Nether, area index 61, ID 321, created by Aloe_vera
{
// Size:
- 15, 14, 16, // SizeX = 15, SizeY = 14, SizeZ = 16
+ 16, 14, 16, // SizeX = 16, SizeY = 14, SizeZ = 16
+
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 15, 23, 15, // MaxX, MaxY, MaxZ
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
- "b:114: 6\n" /* netherbrickstairs */
+ "b:114: 5\n" /* netherbrickstairs */
"c:114: 4\n" /* netherbrickstairs */
- "d:114: 5\n" /* netherbrickstairs */
- "e: 44:14\n" /* step */
+ "d: 44:14\n" /* step */
+ "e:114: 6\n" /* netherbrickstairs */
"f:114: 7\n" /* netherbrickstairs */
"m: 19: 0\n" /* sponge */,
// Block data:
// Level 0
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "...........aaa."
- /* 1 */ "aa.........aaaa"
- /* 2 */ "aa...........aa"
- /* 3 */ "aa...........aa"
- /* 4 */ "..............."
- /* 5 */ "..............."
- /* 6 */ "..............."
- /* 7 */ "..............."
- /* 8 */ "..............."
- /* 9 */ "..............."
- /* 10 */ "..............."
- /* 11 */ "..............."
- /* 12 */ "..............."
- /* 13 */ "..............."
- /* 14 */ "...........aaa."
- /* 15 */ "...........aaa."
+ /* z\x* 111111 */
+ /* * 0123456789012345 */
+ /* 0 */ "mmmmmmmmmmmmmmmm"
+ /* 1 */ "aammmmmmmmmmmmaa"
+ /* 2 */ "aammmmmmmmmmmmaa"
+ /* 3 */ "aammmmmmmmmmmmaa"
+ /* 4 */ "mmmmmmmmmmmmmmmm"
+ /* 5 */ "mmmmmmmmmmmmmmmm"
+ /* 6 */ "mmmmmmmmmmmmmmmm"
+ /* 7 */ "mmmmmmmmmmmmmmmm"
+ /* 8 */ "mmmmmmmmmmmmmmmm"
+ /* 9 */ "mmmmmmmmmmmmmmmm"
+ /* 10 */ "mmmmmmmmmmmmmmmm"
+ /* 11 */ "mmmmmmmmmmmmmmmm"
+ /* 12 */ "maaammmmmmmmmmmm"
+ /* 13 */ "maaammmmmmmmmmmm"
+ /* 14 */ "maaammmmmmmmaaam"
+ /* 15 */ "mmmmmmmmmmmmaaam"
// Level 1
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "...........aaa."
- /* 1 */ "aa.........aaaa"
- /* 2 */ "aa...........aa"
- /* 3 */ "aa...........aa"
- /* 4 */ "..............."
- /* 5 */ "..............."
- /* 6 */ "..............."
- /* 7 */ "..............."
- /* 8 */ "..............."
- /* 9 */ "..............."
- /* 10 */ "..............."
- /* 11 */ "..............."
- /* 12 */ "..............."
- /* 13 */ "..............."
- /* 14 */ "...........aaa."
- /* 15 */ "...........aaa."
+ /* z\x* 111111 */
+ /* * 0123456789012345 */
+ /* 0 */ "mmmmmmmmmmmmmmmm"
+ /* 1 */ "aabmmmmmmmmmmcaa"
+ /* 2 */ "aabmmmmmmmmmmcaa"
+ /* 3 */ "aabmmmmmmmmmmcaa"
+ /* 4 */ "mmmmmmmmmmmmmmmm"
+ /* 5 */ "mmmmmmmmmmmmmmmm"
+ /* 6 */ "mmmmmmmmmmmmmmmm"
+ /* 7 */ "mmmmmmmmmmmmmmmm"
+ /* 8 */ "mmmmmmmmmmmmmmmm"
+ /* 9 */ "mmmmmmmmmmmmmmmm"
+ /* 10 */ "mmmmmmmmmmmmmmmm"
+ /* 11 */ "mmmmmmmmmmmmmmmm"
+ /* 12 */ "maaammmmmmmmmmmm"
+ /* 13 */ "maaammmmmmmmmmmm"
+ /* 14 */ "maaammmmmmmmaaam"
+ /* 15 */ "mmmmmmmmmmmmaaam"
// Level 2
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "...........aaa."
- /* 1 */ "aa.........aaaa"
- /* 2 */ "aa...........aa"
- /* 3 */ "aa...........aa"
- /* 4 */ "..............."
- /* 5 */ "..............."
- /* 6 */ "..............."
- /* 7 */ "..............."
- /* 8 */ "..............."
- /* 9 */ "..............."
- /* 10 */ "..............."
- /* 11 */ "..............."
- /* 12 */ "..............."
- /* 13 */ "...........bbb."
- /* 14 */ "...........aaa."
- /* 15 */ "...........aaa."
+ /* z\x* 111111 */
+ /* * 0123456789012345 */
+ /* 0 */ "mmmmmmmmmmmmmmmm"
+ /* 1 */ "aaabdmmmmmmdcaaa"
+ /* 2 */ "aaabdmmmmmmdcaaa"
+ /* 3 */ "aaabdmmmmmmdcaaa"
+ /* 4 */ "mmmmmmmmmmmmmmmm"
+ /* 5 */ "mmmmmmmmmmmmmmmm"
+ /* 6 */ "mmmmmmmmmmmmmmmm"
+ /* 7 */ "mmmmmmmmmmmmmmmm"
+ /* 8 */ "mmmmmmmmmmmmmmmm"
+ /* 9 */ "mmmmmmmmmmmmmmmm"
+ /* 10 */ "mmmmmmmmmmmmmmmm"
+ /* 11 */ "mmmmmmmmmmmmmmmm"
+ /* 12 */ "maaammmmmmmmmmmm"
+ /* 13 */ "maaammmmmmmmmmmm"
+ /* 14 */ "maaammmmmmmmaaam"
+ /* 15 */ "mmmmmmmmmmmmaaam"
// Level 3
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..........caaad"
- /* 1 */ "aa........caaaa"
- /* 2 */ "aa........caaaa"
- /* 3 */ "aa........caaaa"
- /* 4 */ "...........aaad"
- /* 5 */ "...........aaad"
- /* 6 */ "...........aaad"
- /* 7 */ "...........aaad"
- /* 8 */ "...........aaad"
- /* 9 */ "..........caaad"
- /* 10 */ "..........caaad"
- /* 11 */ "..........caaad"
- /* 12 */ "..........caaad"
- /* 13 */ "..........caaad"
- /* 14 */ "..........caaad"
- /* 15 */ "..........caaad"
+ /* z\x* 111111 */
+ /* * 0123456789012345 */
+ /* 0 */ "eeeeeeeeeeeeeeee"
+ /* 1 */ "aaaaaaaaaaaaaaaa"
+ /* 2 */ "aaaaaaaaaaaaaaaa"
+ /* 3 */ "aaaaaaaaaaaaaaaa"
+ /* 4 */ "ffffffffffffffff"
+ /* 5 */ "mmmmmmmmmmmmmmmm"
+ /* 6 */ "mmmmmmmmmmmmmmmm"
+ /* 7 */ "mmmmmmmmmmmmmmmm"
+ /* 8 */ "mmmmmmmmmmmmmmmm"
+ /* 9 */ "mmmmmmmmmmmmmmmm"
+ /* 10 */ "mmmmmmmmmmmmmmmm"
+ /* 11 */ "mmmmmmmmmmmmmmmm"
+ /* 12 */ "maaammmmmmmmmmmm"
+ /* 13 */ "maaammmmmmmmmmmm"
+ /* 14 */ "maaammmmmmmmaaam"
+ /* 15 */ "mmmmmmmmmmmmaaam"
// Level 4
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..........aaaaa"
- /* 1 */ "aa........aaaaa"
- /* 2 */ "aa........aaaaa"
- /* 3 */ "aa........aaaaa"
- /* 4 */ "..........aaaaa"
- /* 5 */ "..........aaaaa"
- /* 6 */ "..........aaaaa"
- /* 7 */ "..........aaaaa"
- /* 8 */ "..........aaaaa"
- /* 9 */ "..........aaaaa"
- /* 10 */ "..........aaaaa"
- /* 11 */ "..........aaaaa"
- /* 12 */ "..........aaaaa"
- /* 13 */ "..........aaaaa"
- /* 14 */ "..........aaaaa"
- /* 15 */ "..........aaaaa"
+ /* z\x* 111111 */
+ /* * 0123456789012345 */
+ /* 0 */ "aaaaaaaaaaaaaaaa"
+ /* 1 */ "aaaaaaaaaaaaaaaa"
+ /* 2 */ "aaaaaaaaaaaaaaaa"
+ /* 3 */ "aaaaaaaaaaaaaaaa"
+ /* 4 */ "aaaaaaaaaaaaaaaa"
+ /* 5 */ "faaabmmmmmmmmmmm"
+ /* 6 */ "caaabmmmmmmmmmmm"
+ /* 7 */ "caaabmmmmmmmmmmm"
+ /* 8 */ "mmmmmmmmmmmmmmmm"
+ /* 9 */ "mmmmmmmmmmmmmmmm"
+ /* 10 */ "mmmmmmmmmmmmmmmm"
+ /* 11 */ "mmmmmmmmmmmmmmmm"
+ /* 12 */ "maaammmmmmmmmmmm"
+ /* 13 */ "maaammmmmmmmmmmm"
+ /* 14 */ "maaammmmmmmmaaam"
+ /* 15 */ "mmmmmmmmmmmmaaam"
// Level 5
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..........a...a"
- /* 1 */ "aa........a...a"
- /* 2 */ "aa........a...a"
- /* 3 */ "aa........a...a"
- /* 4 */ "..........a...a"
- /* 5 */ "..........a...a"
- /* 6 */ "........aaa...a"
- /* 7 */ "........aa....a"
- /* 8 */ "........aa....a"
- /* 9 */ "........aa....a"
- /* 10 */ "........aaa...a"
- /* 11 */ "..........a...a"
- /* 12 */ "..........a...a"
- /* 13 */ "..........a...a"
- /* 14 */ "..........a...a"
- /* 15 */ "..........a...a"
+ /* z\x* 111111 */
+ /* * 0123456789012345 */
+ /* 0 */ "aaaaaaaaaaaaaaaa"
+ /* 1 */ "................"
+ /* 2 */ "................"
+ /* 3 */ "................"
+ /* 4 */ "a...aaaaaaaaaaaa"
+ /* 5 */ "a...ammmmmmmmmmm"
+ /* 6 */ "aaaaammmmmmmmmmm"
+ /* 7 */ "aaaaammmmmmmmmmm"
+ /* 8 */ "caaabmmmmmmmmmmm"
+ /* 9 */ "caaabmmmmmmmmmmm"
+ /* 10 */ "mmmmmmmmmmmmmmmm"
+ /* 11 */ "mmmmmmmmmmmmmmmm"
+ /* 12 */ "maaammmmmmmmmmmm"
+ /* 13 */ "maaammmmmmmmmmmm"
+ /* 14 */ "maaammmmmmmmaaam"
+ /* 15 */ "mmmmmmmmmmmmaaam"
// Level 6
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "aa........a...a"
- /* 2 */ "aa........a...a"
- /* 3 */ "aa........a...a"
- /* 4 */ "..............."
- /* 5 */ "..............."
- /* 6 */ "........aaa...."
- /* 7 */ "....aaaaa......"
- /* 8 */ "....aaaaa......"
- /* 9 */ "....aaaaa......"
- /* 10 */ "....aaaaaaa...."
- /* 11 */ "..............."
- /* 12 */ "..............."
- /* 13 */ "..............."
- /* 14 */ "..............."
- /* 15 */ "..............."
+ /* z\x* 111111 */
+ /* * 0123456789012345 */
+ /* 0 */ "mmmmmmmmmmmmaaam"
+ /* 1 */ "................"
+ /* 2 */ "................"
+ /* 3 */ "................"
+ /* 4 */ "m...mmmmmmmmaaam"
+ /* 5 */ "a...ammmmmmmmmmm"
+ /* 6 */ "a...ammmmmmmmmmm"
+ /* 7 */ "a...ammmmmmmmmmm"
+ /* 8 */ "aaaaammmmmmmmmmm"
+ /* 9 */ "aaaaammmmmmmmmmm"
+ /* 10 */ "caaabmmmmmmmmmmm"
+ /* 11 */ "caaabmmmmmmmmmmm"
+ /* 12 */ "maaabmmmmmmmmmmm"
+ /* 13 */ "maaabmmmmmmmmmmm"
+ /* 14 */ "maaafmmmmmmmaaam"
+ /* 15 */ "mmmmmmmmmmmmaaam"
// Level 7
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "aad.......a...a"
- /* 2 */ "aad.......a...a"
- /* 3 */ "aad.......a...a"
- /* 4 */ "..............."
- /* 5 */ "..............."
- /* 6 */ "....aaaaaa....."
- /* 7 */ "....aaaa......."
- /* 8 */ "....aaaa......."
- /* 9 */ "....aaaa......."
- /* 10 */ "....aaaaaa....."
- /* 11 */ "..............."
- /* 12 */ "..............."
- /* 13 */ "..............."
- /* 14 */ "..............."
- /* 15 */ "..............."
+ /* z\x* 111111 */
+ /* * 0123456789012345 */
+ /* 0 */ "mmmmmmmmmmmmaaam"
+ /* 1 */ "................"
+ /* 2 */ "................"
+ /* 3 */ "................"
+ /* 4 */ "m...mmmmmmmmaaam"
+ /* 5 */ "m...mmmmmmmmmmmm"
+ /* 6 */ "m...mmmmmmmmmmmm"
+ /* 7 */ "a...ammmmmmmmmmm"
+ /* 8 */ "a...ammmmmmmmmmm"
+ /* 9 */ "a...ammmmmmmmmmm"
+ /* 10 */ "aaaaammmmmmmmmmm"
+ /* 11 */ "aaaaaeemmmmmmmmm"
+ /* 12 */ "caaaaaammmmmmmmm"
+ /* 13 */ "caaaaaammmmmmmmm"
+ /* 14 */ "caaaaaammmmmaaam"
+ /* 15 */ "fffffffmmmmmaaam"
// Level 8
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "aaade.....a...a"
- /* 2 */ "aaade.....a...a"
- /* 3 */ "aaade.....a...a"
- /* 4 */ "..............."
- /* 5 */ "..............."
- /* 6 */ "....aaaaa......"
- /* 7 */ "....a.........."
- /* 8 */ "....a.........."
- /* 9 */ "....a.........."
- /* 10 */ "....aaaa......."
- /* 11 */ "..............."
- /* 12 */ "..............."
- /* 13 */ "..............."
- /* 14 */ "..............."
- /* 15 */ "..............."
+ /* z\x* 111111 */
+ /* * 0123456789012345 */
+ /* 0 */ "mmmmmmmmmmmmaaam"
+ /* 1 */ "mmmmmmmmmmmmmmmm"
+ /* 2 */ "mmmmmmmmmmmmmmmm"
+ /* 3 */ "mmmmmmmmmmmmmmmm"
+ /* 4 */ "m...mmmmmmmmaaam"
+ /* 5 */ "m...mmmmmmmmmmmm"
+ /* 6 */ "m...mmmmmmmmmmmm"
+ /* 7 */ "m...mmmmmmmmmmmm"
+ /* 8 */ "m...mmmmmmmmmmmm"
+ /* 9 */ "a...ammmmmmmmmmm"
+ /* 10 */ "a...ammmmmmmmmmm"
+ /* 11 */ "a...aaaeemmmmmmm"
+ /* 12 */ "a.....aaammmmmmm"
+ /* 13 */ "a.....aaammmmmmm"
+ /* 14 */ "a.....aaammmaaam"
+ /* 15 */ "aaaaaaaffmmmaaam"
// Level 9
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "bbbbbbbbbbbbbbb"
- /* 1 */ "aaaaaaaaaaaaaaa"
- /* 2 */ "aaaaaaaaaaaaaaa"
- /* 3 */ "aaaaaaaaaaaaaaa"
- /* 4 */ "ffffffaaaffffff"
- /* 5 */ "....aaaaa......"
- /* 6 */ "....a...a......"
- /* 7 */ "....a.........."
- /* 8 */ "..............."
- /* 9 */ "..............."
- /* 10 */ "..............."
- /* 11 */ "..............."
- /* 12 */ "..............."
- /* 13 */ "..............."
- /* 14 */ "..............."
- /* 15 */ "..............."
+ /* z\x* 111111 */
+ /* * 0123456789012345 */
+ /* 0 */ "mmmmmmmmmmmcaaab"
+ /* 1 */ "mmmmmmmmmmmcaaab"
+ /* 2 */ "mmmmmmmmmmmcaaab"
+ /* 3 */ "mmmmmmmmmmmcaaab"
+ /* 4 */ "mmmmmmmmmmmcaaab"
+ /* 5 */ "mmmmmmmmmmmcaaab"
+ /* 6 */ "m...mmmmmmmcaaab"
+ /* 7 */ "m...mmmmmmmcaaab"
+ /* 8 */ "m...mmmmmmmcaaab"
+ /* 9 */ "m...mmmmmmmcaaab"
+ /* 10 */ "m...mmmmmmmcaaab"
+ /* 11 */ "m...maaaaeecaaab"
+ /* 12 */ "m.......aaaaaaab"
+ /* 13 */ "m.......aaaaaaab"
+ /* 14 */ "m.......aaaaaaab"
+ /* 15 */ "mmmmmaaaafffaaab"
// Level 10
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "aaaaaaaaaaaaaaa"
- /* 1 */ "aaaaaaaaaaaaaaa"
- /* 2 */ "aaaaaaaaaaaaaaa"
- /* 3 */ "aaaaaaaaaaaaaaa"
- /* 4 */ "aaaaaaaaaaaaaaa"
- /* 5 */ "....a...a......"
- /* 6 */ "....a...a......"
- /* 7 */ "..............."
- /* 8 */ "..............."
- /* 9 */ "..............."
- /* 10 */ "..............."
- /* 11 */ "..............."
- /* 12 */ "..............."
- /* 13 */ "..............."
- /* 14 */ "..............."
- /* 15 */ "..............."
+ /* z\x* 111111 */
+ /* * 0123456789012345 */
+ /* 0 */ "mmmmmmmmmmmaaaaa"
+ /* 1 */ "mmmmmmmmmmmaaaaa"
+ /* 2 */ "mmmmmmmmmmmaaaaa"
+ /* 3 */ "mmmmmmmmmmmaaaaa"
+ /* 4 */ "mmmmmmmmmmmaaaaa"
+ /* 5 */ "mmmmmmmmmmmaaaaa"
+ /* 6 */ "mmmmmmmmmmmaaaaa"
+ /* 7 */ "mmmmmmmmmmmaaaaa"
+ /* 8 */ "m...mmmmmmmaaaaa"
+ /* 9 */ "m...mmmmmmmaaaaa"
+ /* 10 */ "m...mmmmmmmaaaaa"
+ /* 11 */ "m...mmmaaaaaaaaa"
+ /* 12 */ "m.........aaaaaa"
+ /* 13 */ "m.........aaaaaa"
+ /* 14 */ "m.........aaaaaa"
+ /* 15 */ "mmmmmmmaaaaaaaaa"
// Level 11
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "aaaaaaaaaaaaaaa"
- /* 1 */ "..............."
- /* 2 */ "..............."
- /* 3 */ "..............."
- /* 4 */ "aaaaa...aaaaaaa"
- /* 5 */ "....a...a......"
- /* 6 */ "..............."
- /* 7 */ "..............."
- /* 8 */ "..............."
- /* 9 */ "..............."
- /* 10 */ "..............."
- /* 11 */ "..............."
- /* 12 */ "..............."
- /* 13 */ "..............."
- /* 14 */ "..............."
- /* 15 */ "..............."
+ /* z\x* 111111 */
+ /* * 0123456789012345 */
+ /* 0 */ "mmmmmmmmmmma...a"
+ /* 1 */ "mmmmmmmmmmma...a"
+ /* 2 */ "mmmmmmmmmmma...a"
+ /* 3 */ "mmmmmmmmmmma...a"
+ /* 4 */ "mmmmmmmmmmma...a"
+ /* 5 */ "mmmmmmmmmmma...a"
+ /* 6 */ "mmmmmmmmmmma...a"
+ /* 7 */ "mmmmmmmmmmma...a"
+ /* 8 */ "mmmmmmmmmmma...a"
+ /* 9 */ "mmmmmmmmmmma...a"
+ /* 10 */ "mmmmmmmmmmma...a"
+ /* 11 */ "mmmmmmmmmaaa...a"
+ /* 12 */ "mmmm...........a"
+ /* 13 */ "mmmm...........a"
+ /* 14 */ "mmmm...........a"
+ /* 15 */ "mmmmmmmmmaaa...a"
// Level 12
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "..............."
- /* 2 */ "..............."
- /* 3 */ "..............."
- /* 4 */ "..............."
- /* 5 */ "..............."
- /* 6 */ "..............."
- /* 7 */ "..............."
- /* 8 */ "..............."
- /* 9 */ "..............."
- /* 10 */ "..............."
- /* 11 */ "..............."
- /* 12 */ "..............."
- /* 13 */ "..............."
- /* 14 */ "..............."
- /* 15 */ "..............."
+ /* z\x* 111111 */
+ /* * 0123456789012345 */
+ /* 0 */ "mmmmmmmmmmmm...m"
+ /* 1 */ "mmmmmmmmmmmm...m"
+ /* 2 */ "mmmmmmmmmmmm...m"
+ /* 3 */ "mmmmmmmmmmmm...m"
+ /* 4 */ "mmmmmmmmmmmm...m"
+ /* 5 */ "mmmmmmmmmmmm...m"
+ /* 6 */ "mmmmmmmmmmmm...m"
+ /* 7 */ "mmmmmmmmmmmm...m"
+ /* 8 */ "mmmmmmmmmmmm...m"
+ /* 9 */ "mmmmmmmmmmmm...m"
+ /* 10 */ "mmmmmmmmmmmm...m"
+ /* 11 */ "mmmmmmmmmmmm...m"
+ /* 12 */ "mmmmmm.........m"
+ /* 13 */ "mmmmmm.........m"
+ /* 14 */ "mmmmmm.........m"
+ /* 15 */ "mmmmmmmmmmmm...m"
// Level 13
- /* z\x* 11111 */
- /* * 012345678901234 */
- /* 0 */ "..............."
- /* 1 */ "..............."
- /* 2 */ "..............."
- /* 3 */ "..............."
- /* 4 */ "..............."
- /* 5 */ "..............."
- /* 6 */ "..............."
- /* 7 */ "..............."
- /* 8 */ "..............."
- /* 9 */ "..............."
- /* 10 */ "..............."
- /* 11 */ "..............."
- /* 12 */ "..............."
- /* 13 */ "..............."
- /* 14 */ "..............."
- /* 15 */ "...............",
+ /* z\x* 111111 */
+ /* * 0123456789012345 */
+ /* 0 */ "mmmmmmmmmmmm...m"
+ /* 1 */ "mmmmmmmmmmmm...m"
+ /* 2 */ "mmmmmmmmmmmm...m"
+ /* 3 */ "mmmmmmmmmmmm...m"
+ /* 4 */ "mmmmmmmmmmmm...m"
+ /* 5 */ "mmmmmmmmmmmm...m"
+ /* 6 */ "mmmmmmmmmmmm...m"
+ /* 7 */ "mmmmmmmmmmmm...m"
+ /* 8 */ "mmmmmmmmmmmm...m"
+ /* 9 */ "mmmmmmmmmmmm...m"
+ /* 10 */ "mmmmmmmmmmmm...m"
+ /* 11 */ "mmmmmmmmmmmm...m"
+ /* 12 */ "mmmmmmmm.......m"
+ /* 13 */ "mmmmmmmm.......m"
+ /* 14 */ "mmmmmmmm.......m"
+ /* 15 */ "mmmmmmmmmmmm...m",
// Connectors:
- "",
+ "0: 0, 5, 2: 4\n" /* Type 0, direction X- */
+ "0: 15, 5, 2: 5\n" /* Type 0, direction X+ */
+ "0: 13, 11, 0: 2\n" /* Type 0, direction Z- */
+ "0: 13, 11, 15: 3\n" /* Type 0, direction Z+ */,
// AllowedRotations:
7, /* 1, 2, 3 CCW rotation allowed */
@@ -1867,7 +1914,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
false,
// DefaultWeight:
- 100,
+ 20,
// DepthWeight:
"",
@@ -1885,6 +1932,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
15, 8, 5, // SizeX = 15, SizeY = 8, SizeZ = 5
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 14, 17, 4, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -1985,7 +2036,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
500,
// DepthWeight:
- "",
+ "4:-3000|8:-3000|12:-3000|16:-3000|20:-3000",
// AddWeightIfSame:
1000,
@@ -2000,6 +2051,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
15, 8, 10, // SizeX = 15, SizeY = 8, SizeZ = 10
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 14, 17, 9, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -2156,6 +2211,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
11, 6, 5, // SizeX = 11, SizeY = 6, SizeZ = 5
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 10, 5, 4, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -2233,7 +2292,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
false,
// DefaultWeight:
- 200,
+ 300,
// DepthWeight:
"",
@@ -2251,6 +2310,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
13, 6, 5, // SizeX = 13, SizeY = 6, SizeZ = 5
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 12, 5, 4, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -2328,7 +2391,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
false,
// DefaultWeight:
- 200,
+ 300,
// DepthWeight:
"",
@@ -2340,12 +2403,109 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // Corridor5:
+ // The data has been exported from the gallery Nether, area index 65, ID 330, created by xoft
+ {
+ // Size:
+ 5, 6, 5, // SizeX = 5, SizeY = 6, SizeZ = 5
+
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 4, 5, 4, // MaxX, MaxY, MaxZ
+
+ // Block definitions:
+ ".: 0: 0\n" /* air */
+ "a:112: 0\n" /* netherbrick */
+ "b:113: 0\n" /* netherbrickfence */
+ "c:114: 2\n" /* netherbrickstairs */
+ "d:114: 3\n" /* netherbrickstairs */
+ "m: 19: 0\n" /* sponge */,
+
+ // Block data:
+ // Level 0
+ /* z\x* 01234 */
+ /* 0 */ "aaaaa"
+ /* 1 */ "aaaaa"
+ /* 2 */ "aaaaa"
+ /* 3 */ "aaaaa"
+ /* 4 */ "aaaaa"
+
+ // Level 1
+ /* z\x* 01234 */
+ /* 0 */ "aaaaa"
+ /* 1 */ "....."
+ /* 2 */ "....."
+ /* 3 */ "....."
+ /* 4 */ "aaaaa"
+
+ // Level 2
+ /* z\x* 01234 */
+ /* 0 */ "ababa"
+ /* 1 */ "....."
+ /* 2 */ "....."
+ /* 3 */ "....."
+ /* 4 */ "ababa"
+
+ // Level 3
+ /* z\x* 01234 */
+ /* 0 */ "ababa"
+ /* 1 */ "....."
+ /* 2 */ "....."
+ /* 3 */ "....."
+ /* 4 */ "ababa"
+
+ // Level 4
+ /* z\x* 01234 */
+ /* 0 */ "ababa"
+ /* 1 */ "....."
+ /* 2 */ "....."
+ /* 3 */ "....."
+ /* 4 */ "ababa"
+
+ // Level 5
+ /* z\x* 01234 */
+ /* 0 */ "ccccc"
+ /* 1 */ "aaaaa"
+ /* 2 */ "aaaaa"
+ /* 3 */ "aaaaa"
+ /* 4 */ "ddddd",
+
+ // Connectors:
+ "1: 4, 1, 2: 5\n" /* Type 1, direction X+ */
+ "1: 0, 1, 2: 4\n" /* Type 1, direction X- */,
+
+ // AllowedRotations:
+ 7, /* 1, 2, 3 CCW rotation allowed */
+
+ // Merge strategy:
+ cBlockArea::msSpongePrint,
+
+ // ShouldExtendFloor:
+ false,
+
+ // DefaultWeight:
+ 500,
+
+ // DepthWeight:
+ "6:0|12:0|18:0",
+
+ // AddWeightIfSame:
+ 500,
+ }, // Corridor5
+
+
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CorridorCorner5:
// The data has been exported from the gallery Nether, area index 10, ID 40, created by xoft
{
// Size:
11, 6, 11, // SizeX = 11, SizeY = 6, SizeZ = 11
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 10, 5, 10, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -2479,6 +2639,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
11, 6, 11, // SizeX = 11, SizeY = 6, SizeZ = 11
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 10, 5, 10, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -2607,12 +2771,137 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // CorridorCrossing:
+ // The data has been exported from the gallery Nether, area index 63, ID 328, created by xoft
+ {
+ // Size:
+ 9, 6, 9, // SizeX = 9, SizeY = 6, SizeZ = 9
+
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 8, 5, 8, // MaxX, MaxY, MaxZ
+
+ // Block definitions:
+ ".: 0: 0\n" /* air */
+ "a:112: 0\n" /* netherbrick */
+ "b:113: 0\n" /* netherbrickfence */
+ "c:114: 0\n" /* netherbrickstairs */
+ "d:114: 1\n" /* netherbrickstairs */
+ "e:114: 2\n" /* netherbrickstairs */
+ "f:114: 3\n" /* netherbrickstairs */
+ "m: 19: 0\n" /* sponge */,
+
+ // Block data:
+ // Level 0
+ /* z\x* 012345678 */
+ /* 0 */ "mmaaaaamm"
+ /* 1 */ "mmaaaaamm"
+ /* 2 */ "aaaaaaaaa"
+ /* 3 */ "aaaaaaaaa"
+ /* 4 */ "aaaaaaaaa"
+ /* 5 */ "aaaaaaaaa"
+ /* 6 */ "aaaaaaaaa"
+ /* 7 */ "mmaaaaamm"
+ /* 8 */ "mmaaaaamm"
+
+ // Level 1
+ /* z\x* 012345678 */
+ /* 0 */ "mma...amm"
+ /* 1 */ "mma...amm"
+ /* 2 */ "aaa...aaa"
+ /* 3 */ "........."
+ /* 4 */ "........."
+ /* 5 */ "........."
+ /* 6 */ "aaa...aaa"
+ /* 7 */ "mma...amm"
+ /* 8 */ "mma...amm"
+
+ // Level 2
+ /* z\x* 012345678 */
+ /* 0 */ "mma...amm"
+ /* 1 */ "mmb...bmm"
+ /* 2 */ "aba...aba"
+ /* 3 */ "........."
+ /* 4 */ "........."
+ /* 5 */ "........."
+ /* 6 */ "aba...aba"
+ /* 7 */ "mmb...bmm"
+ /* 8 */ "mma...amm"
+
+ // Level 3
+ /* z\x* 012345678 */
+ /* 0 */ "mma...amm"
+ /* 1 */ "mmb...bmm"
+ /* 2 */ "aba...aba"
+ /* 3 */ "........."
+ /* 4 */ "........."
+ /* 5 */ "........."
+ /* 6 */ "aba...aba"
+ /* 7 */ "mmb...bmm"
+ /* 8 */ "mma...amm"
+
+ // Level 4
+ /* z\x* 012345678 */
+ /* 0 */ "mma...amm"
+ /* 1 */ "mmb...bmm"
+ /* 2 */ "aba...aba"
+ /* 3 */ "........."
+ /* 4 */ "........."
+ /* 5 */ "........."
+ /* 6 */ "aba...aba"
+ /* 7 */ "mmb...bmm"
+ /* 8 */ "mma...amm"
+
+ // Level 5
+ /* z\x* 012345678 */
+ /* 0 */ "mmcaaadmm"
+ /* 1 */ "mmcaaadmm"
+ /* 2 */ "eeeaaaeee"
+ /* 3 */ "aaaaaaaaa"
+ /* 4 */ "aaaaaaaaa"
+ /* 5 */ "aaaaaaaaa"
+ /* 6 */ "ffcaaadff"
+ /* 7 */ "mmcaaadmm"
+ /* 8 */ "mmcaaadmm",
+
+ // Connectors:
+ "1: 8, 1, 4: 5\n" /* Type 1, direction X+ */
+ "1: 4, 1, 0: 2\n" /* Type 1, direction Z- */
+ "1: 4, 1, 8: 3\n" /* Type 1, direction Z+ */
+ "1: 0, 1, 4: 4\n" /* Type 1, direction X- */,
+
+ // AllowedRotations:
+ 7, /* 1, 2, 3 CCW rotation allowed */
+
+ // Merge strategy:
+ cBlockArea::msSpongePrint,
+
+ // ShouldExtendFloor:
+ false,
+
+ // DefaultWeight:
+ 100,
+
+ // DepthWeight:
+ "",
+
+ // AddWeightIfSame:
+ -50,
+ }, // CorridorCrossing
+
+
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CorridorStairs:
// The data has been exported from the gallery Nether, area index 12, ID 42, created by xoft
{
// Size:
9, 13, 5, // SizeX = 9, SizeY = 13, SizeZ = 5
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 8, 12, 4, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -2741,10 +3030,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
false,
// DefaultWeight:
- 100,
+ 250,
// DepthWeight:
- "",
+ "0:0|2:0|4:0|6:0|8:0|10:0|12:0|14:0|16:0|18:0",
// AddWeightIfSame:
0,
@@ -2759,6 +3048,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
14, 6, 5, // SizeX = 14, SizeY = 6, SizeZ = 5
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 13, 5, 4, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -2854,6 +3147,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
15, 11, 15, // SizeX = 15, SizeY = 11, SizeZ = 15
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 14, 10, 14, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -3086,7 +3383,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
false,
// DefaultWeight:
- 100,
+ 10,
// DepthWeight:
"",
@@ -3104,6 +3401,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
12, 15, 15, // SizeX = 12, SizeY = 15, SizeZ = 15
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 11, 14, 14, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -3411,13 +3712,13 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
false,
// DefaultWeight:
- 100,
+ 10,
// DepthWeight:
"",
// AddWeightIfSame:
- 0,
+ -1000,
}, // LavaStaircaseBig
@@ -3429,6 +3730,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
16, 12, 15, // SizeX = 16, SizeY = 12, SizeZ = 15
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 15, 11, 14, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -3685,7 +3990,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
false,
// DefaultWeight:
- 100,
+ 10,
// DepthWeight:
"",
@@ -3703,6 +4008,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
13, 8, 13, // SizeX = 13, SizeY = 8, SizeZ = 13
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 12, 7, 12, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -3873,7 +4182,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
"",
// AddWeightIfSame:
- 0,
+ -1000,
}, // MidStaircase
@@ -3885,6 +4194,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
7, 10, 7, // SizeX = 7, SizeY = 10, SizeZ = 7
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 6, 19, 6, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -4009,7 +4322,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
100,
// DepthWeight:
- "",
+ "1:0|3:0|5:0|7:0|9:0|11:0|13:0|15:0",
// AddWeightIfSame:
0,
@@ -4024,6 +4337,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
7, 10, 7, // SizeX = 7, SizeY = 10, SizeZ = 7
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 6, 19, 6, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -4148,7 +4465,7 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
100,
// DepthWeight:
- "",
+ "1:0|3:0|5:0|7:0|9:0|11:0|13:0|15:0",
// AddWeightIfSame:
0,
@@ -4163,6 +4480,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
13, 6, 7, // SizeX = 13, SizeY = 6, SizeZ = 7
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 12, 5, 6, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -4273,6 +4594,10 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
// Size:
13, 6, 9, // SizeX = 13, SizeY = 6, SizeZ = 9
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 12, 5, 8, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
@@ -4389,11 +4714,299 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // TinyCorridorCorner:
+ // The data has been exported from the gallery Nether, area index 66, ID 331, created by xoft
+ {
+ // Size:
+ 5, 6, 5, // SizeX = 5, SizeY = 6, SizeZ = 5
+
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 4, 5, 4, // MaxX, MaxY, MaxZ
+
+ // Block definitions:
+ ".: 0: 0\n" /* air */
+ "a:112: 0\n" /* netherbrick */
+ "b:113: 0\n" /* netherbrickfence */
+ "c:114: 2\n" /* netherbrickstairs */
+ "d:114: 1\n" /* netherbrickstairs */
+ "e:114: 0\n" /* netherbrickstairs */
+ "m: 19: 0\n" /* sponge */,
+
+ // Block data:
+ // Level 0
+ /* z\x* 01234 */
+ /* 0 */ "aaaaa"
+ /* 1 */ "aaaaa"
+ /* 2 */ "aaaaa"
+ /* 3 */ "aaaaa"
+ /* 4 */ "aaaaa"
+
+ // Level 1
+ /* z\x* 01234 */
+ /* 0 */ "aaaaa"
+ /* 1 */ "....a"
+ /* 2 */ "....a"
+ /* 3 */ "....a"
+ /* 4 */ "a...a"
+
+ // Level 2
+ /* z\x* 01234 */
+ /* 0 */ "ababa"
+ /* 1 */ "....b"
+ /* 2 */ "....a"
+ /* 3 */ "....b"
+ /* 4 */ "a...a"
+
+ // Level 3
+ /* z\x* 01234 */
+ /* 0 */ "ababa"
+ /* 1 */ "....b"
+ /* 2 */ "....a"
+ /* 3 */ "....b"
+ /* 4 */ "a...a"
+
+ // Level 4
+ /* z\x* 01234 */
+ /* 0 */ "ababa"
+ /* 1 */ "....b"
+ /* 2 */ "....a"
+ /* 3 */ "....b"
+ /* 4 */ "a...a"
+
+ // Level 5
+ /* z\x* 01234 */
+ /* 0 */ "ccccc"
+ /* 1 */ "aaaad"
+ /* 2 */ "aaaad"
+ /* 3 */ "aaaad"
+ /* 4 */ "eaaad",
+
+ // Connectors:
+ "1: 2, 1, 4: 3\n" /* Type 1, direction Z+ */
+ "1: 0, 1, 2: 4\n" /* Type 1, direction X- */,
+
+ // AllowedRotations:
+ 7, /* 1, 2, 3 CCW rotation allowed */
+
+ // Merge strategy:
+ cBlockArea::msSpongePrint,
+
+ // ShouldExtendFloor:
+ false,
+
+ // DefaultWeight:
+ 100,
+
+ // DepthWeight:
+ "",
+
+ // AddWeightIfSame:
+ -50,
+ }, // TinyCorridorCorner
+
+
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // TinyCorridorCornerChest:
+ // The data has been exported from the gallery Nether, area index 67, ID 332, created by Aloe_vera
+ {
+ // Size:
+ 5, 6, 5, // SizeX = 5, SizeY = 6, SizeZ = 5
+
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 4, 5, 4, // MaxX, MaxY, MaxZ
+
+ // Block definitions:
+ ".: 0: 0\n" /* air */
+ "a:112: 0\n" /* netherbrick */
+ "b: 54: 4\n" /* chest */
+ "c:113: 0\n" /* netherbrickfence */
+ "d:114: 2\n" /* netherbrickstairs */
+ "e:114: 1\n" /* netherbrickstairs */
+ "f:114: 0\n" /* netherbrickstairs */
+ "m: 19: 0\n" /* sponge */,
+
+ // Block data:
+ // Level 0
+ /* z\x* 01234 */
+ /* 0 */ "aaaaa"
+ /* 1 */ "aaaaa"
+ /* 2 */ "aaaaa"
+ /* 3 */ "aaaaa"
+ /* 4 */ "aaaaa"
+
+ // Level 1
+ /* z\x* 01234 */
+ /* 0 */ "aaaaa"
+ /* 1 */ "....a"
+ /* 2 */ "...ba"
+ /* 3 */ "....a"
+ /* 4 */ "a...a"
+
+ // Level 2
+ /* z\x* 01234 */
+ /* 0 */ "acaca"
+ /* 1 */ "....c"
+ /* 2 */ "....a"
+ /* 3 */ "....c"
+ /* 4 */ "a...a"
+
+ // Level 3
+ /* z\x* 01234 */
+ /* 0 */ "acaca"
+ /* 1 */ "....c"
+ /* 2 */ "....a"
+ /* 3 */ "....c"
+ /* 4 */ "a...a"
+
+ // Level 4
+ /* z\x* 01234 */
+ /* 0 */ "acaca"
+ /* 1 */ "....c"
+ /* 2 */ "....a"
+ /* 3 */ "....c"
+ /* 4 */ "a...a"
+
+ // Level 5
+ /* z\x* 01234 */
+ /* 0 */ "ddddd"
+ /* 1 */ "aaaae"
+ /* 2 */ "aaaae"
+ /* 3 */ "aaaae"
+ /* 4 */ "faaae",
+
+ // Connectors:
+ "1: 2, 1, 4: 3\n" /* Type 1, direction Z+ */
+ "1: 0, 1, 2: 4\n" /* Type 1, direction X- */,
+
+ // AllowedRotations:
+ 7, /* 1, 2, 3 CCW rotation allowed */
+
+ // Merge strategy:
+ cBlockArea::msSpongePrint,
+
+ // ShouldExtendFloor:
+ false,
+
+ // DefaultWeight:
+ 100,
+
+ // DepthWeight:
+ "",
+
+ // AddWeightIfSame:
+ 0,
+ }, // TinyCorridorCornerChest
+
+
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // TinyCorridorCrossing:
+ // The data has been exported from the gallery Nether, area index 64, ID 329, created by xoft
+ {
+ // Size:
+ 5, 6, 5, // SizeX = 5, SizeY = 6, SizeZ = 5
+
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 4, 5, 4, // MaxX, MaxY, MaxZ
+
+ // Block definitions:
+ ".: 0: 0\n" /* air */
+ "a:112: 0\n" /* netherbrick */
+ "b:114: 2\n" /* netherbrickstairs */
+ "c:114: 0\n" /* netherbrickstairs */
+ "d:114: 1\n" /* netherbrickstairs */
+ "m: 19: 0\n" /* sponge */,
+
+ // Block data:
+ // Level 0
+ /* z\x* 01234 */
+ /* 0 */ "aaaaa"
+ /* 1 */ "aaaaa"
+ /* 2 */ "aaaaa"
+ /* 3 */ "aaaaa"
+ /* 4 */ "aaaaa"
+
+ // Level 1
+ /* z\x* 01234 */
+ /* 0 */ "a...a"
+ /* 1 */ "....."
+ /* 2 */ "....."
+ /* 3 */ "....."
+ /* 4 */ "a...a"
+
+ // Level 2
+ /* z\x* 01234 */
+ /* 0 */ "a...a"
+ /* 1 */ "....."
+ /* 2 */ "....."
+ /* 3 */ "....."
+ /* 4 */ "a...a"
+
+ // Level 3
+ /* z\x* 01234 */
+ /* 0 */ "a...a"
+ /* 1 */ "....."
+ /* 2 */ "....."
+ /* 3 */ "....."
+ /* 4 */ "a...a"
+
+ // Level 4
+ /* z\x* 01234 */
+ /* 0 */ "a...a"
+ /* 1 */ "....."
+ /* 2 */ "....."
+ /* 3 */ "....."
+ /* 4 */ "a...a"
+
+ // Level 5
+ /* z\x* 01234 */
+ /* 0 */ "baaab"
+ /* 1 */ "aaaaa"
+ /* 2 */ "aaaaa"
+ /* 3 */ "aaaaa"
+ /* 4 */ "caaad",
+
+ // Connectors:
+ "1: 4, 1, 2: 5\n" /* Type 1, direction X+ */
+ "1: 2, 1, 4: 3\n" /* Type 1, direction Z+ */
+ "1: 0, 1, 2: 4\n" /* Type 1, direction X- */
+ "1: 2, 1, 0: 2\n" /* Type 1, direction Z- */,
+
+ // AllowedRotations:
+ 7, /* 1, 2, 3 CCW rotation allowed */
+
+ // Merge strategy:
+ cBlockArea::msSpongePrint,
+
+ // ShouldExtendFloor:
+ false,
+
+ // DefaultWeight:
+ 100,
+
+ // DepthWeight:
+ "1:200|2:400|3:0|4:500",
+
+ // AddWeightIfSame:
+ -50,
+ }, // TinyCorridorCrossing
+
+
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Turret:
// The data has been exported from the gallery Nether, area index 7, ID 34, created by xoft
{
// Size:
- 7, 6, 7, // SizeX = 7, SizeY = 6, SizeZ = 7
+ 7, 7, 7, // SizeX = 7, SizeY = 7, SizeZ = 7
+
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 6, 16, 6, // MaxX, MaxY, MaxZ
// Block definitions:
".: 0: 0\n" /* air */
@@ -4460,7 +5073,17 @@ const cPrefab::sDef g_NetherFortPrefabs[] =
/* 3 */ "a.....a"
/* 4 */ "a.....a"
/* 5 */ "a.....a"
- /* 6 */ "aaaaaaa",
+ /* 6 */ "aaaaaaa"
+
+ // Level 6
+ /* z\x* 0123456 */
+ /* 0 */ "......."
+ /* 1 */ "......."
+ /* 2 */ "......."
+ /* 3 */ "......."
+ /* 4 */ "......."
+ /* 5 */ "......."
+ /* 6 */ ".......",
// Connectors:
"0: 0, 1, 3: 4\n" /* Type 0, direction X- */
@@ -4502,6 +5125,10 @@ const cPrefab::sDef g_NetherFortStartingPrefabs[] =
// Size:
13, 9, 13, // SizeX = 13, SizeY = 9, SizeZ = 13
+ // Hitbox (relative to bounding box):
+ 0, 0, 0, // MinX, MinY, MinZ
+ 12, 8, 12, // MaxX, MaxY, MaxZ
+
// Block definitions:
".: 0: 0\n" /* air */
"a:112: 0\n" /* netherbrick */
diff --git a/src/Generating/Ravines.cpp b/src/Generating/Ravines.cpp
index e64f55214..267dcbbf9 100644
--- a/src/Generating/Ravines.cpp
+++ b/src/Generating/Ravines.cpp
@@ -269,7 +269,7 @@ void cStructGenRavines::cRavine::GenerateBaseDefPoints(int a_BlockX, int a_Block
int CenterZ = a_BlockZ + OffsetZ;
// Get the base angle in which the ravine "axis" goes:
- float Angle = (float)(((float)((a_Noise.IntNoise3DInt(20 * a_BlockX, 70 * a_BlockZ, 6000) / 9) % 16384)) / 16384.0 * 3.141592653);
+ float Angle = (float)(((float)((a_Noise.IntNoise3DInt(20 * a_BlockX, 70 * a_BlockZ, 6000) / 9) % 16384)) / 16384.0 * M_PI);
float xc = sin(Angle);
float zc = cos(Angle);
@@ -311,12 +311,13 @@ void cStructGenRavines::cRavine::RefineDefPoints(const cRavDefPoints & a_Src, cR
a_Dst.clear();
a_Dst.reserve(Num * 2 + 2);
cRavDefPoints::const_iterator itr = a_Src.begin() + 1;
- a_Dst.push_back(a_Src.front());
- int PrevX = a_Src.front().m_BlockX;
- int PrevZ = a_Src.front().m_BlockZ;
- int PrevR = a_Src.front().m_Radius;
- int PrevT = a_Src.front().m_Top;
- int PrevB = a_Src.front().m_Bottom;
+ const cRavDefPoint & Source = a_Src.front();
+ a_Dst.push_back(Source);
+ int PrevX = Source.m_BlockX;
+ int PrevZ = Source.m_BlockZ;
+ int PrevR = Source.m_Radius;
+ int PrevT = Source.m_Top;
+ int PrevB = Source.m_Bottom;
for (int i = 0; i <= Num; ++i, ++itr)
{
int dx = itr->m_BlockX - PrevX;
diff --git a/src/Group.cpp b/src/Group.cpp
index 9c2467144..725740905 100644
--- a/src/Group.cpp
+++ b/src/Group.cpp
@@ -7,7 +7,7 @@
-void cGroup::AddCommand( AString a_Command )
+void cGroup::AddCommand( const AString & a_Command )
{
m_Commands[ a_Command ] = true;
}
@@ -16,7 +16,7 @@ void cGroup::AddCommand( AString a_Command )
-void cGroup::AddPermission( AString a_Permission )
+void cGroup::AddPermission( const AString & a_Permission )
{
m_Permissions[ a_Permission ] = true;
}
diff --git a/src/Group.h b/src/Group.h
index 8bee6f7ed..47088d50d 100644
--- a/src/Group.h
+++ b/src/Group.h
@@ -11,11 +11,11 @@ public: // tolua_export
cGroup() {}
~cGroup() {}
- void SetName( AString a_Name ) { m_Name = a_Name; } // tolua_export
+ void SetName( const AString & a_Name ) { m_Name = a_Name; } // tolua_export
const AString & GetName() const { return m_Name; } // tolua_export
- void SetColor( AString a_Color ) { m_Color = a_Color; } // tolua_export
- void AddCommand( AString a_Command ); // tolua_export
- void AddPermission( AString a_Permission ); // tolua_export
+ void SetColor( const AString & a_Color ) { m_Color = a_Color; } // tolua_export
+ void AddCommand( const AString & a_Command ); // tolua_export
+ void AddPermission( const AString & a_Permission ); // tolua_export
void InheritFrom( cGroup* a_Group ); // tolua_export
typedef std::map< AString, bool > PermissionMap;
diff --git a/src/Item.cpp b/src/Item.cpp
index 6a5fefbe1..7e472f6d8 100644
--- a/src/Item.cpp
+++ b/src/Item.cpp
@@ -198,9 +198,6 @@ bool cItem::IsEnchantable(short item)
return true;
if ((item >= 298) && (item <= 317))
return true;
- if ((item >= 290) && (item <= 294))
- return true;
-
if ((item == 346) || (item == 359) || (item == 261))
return true;
@@ -318,7 +315,7 @@ bool cItem::EnchantByXPLevels(int a_NumXPLevels)
// Next Enchantment (Second)
NewEnchantmentLevel = NewEnchantmentLevel / 2;
float SecondEnchantmentChance = (NewEnchantmentLevel + 1) / 50 * 100;
- if ((Random.NextFloat(100) > SecondEnchantmentChance) || (enchantments.size() == 0))
+ if (enchantments.empty() || (Random.NextFloat(100) > SecondEnchantmentChance))
{
return true;
}
@@ -333,7 +330,7 @@ bool cItem::EnchantByXPLevels(int a_NumXPLevels)
// Next Enchantment (Third)
NewEnchantmentLevel = NewEnchantmentLevel / 2;
float ThirdEnchantmentChance = (NewEnchantmentLevel + 1) / 50 * 100;
- if ((Random.NextFloat(100) > ThirdEnchantmentChance) || (enchantments.size() == 0))
+ if (enchantments.empty() || (Random.NextFloat(100) > ThirdEnchantmentChance))
{
return true;
}
@@ -348,7 +345,7 @@ bool cItem::EnchantByXPLevels(int a_NumXPLevels)
// Next Enchantment (Fourth)
NewEnchantmentLevel = NewEnchantmentLevel / 2;
float FourthEnchantmentChance = (NewEnchantmentLevel + 1) / 50 * 100;
- if ((Random.NextFloat(100) > FourthEnchantmentChance) || (enchantments.size() == 0))
+ if (enchantments.empty() || (Random.NextFloat(100) > FourthEnchantmentChance))
{
return true;
}
diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp
index 1e77717e3..5151eac38 100644
--- a/src/Items/ItemHandler.cpp
+++ b/src/Items/ItemHandler.cpp
@@ -431,7 +431,6 @@ bool cItemHandler::IsTool()
|| (m_ItemType >= 267 && m_ItemType <= 279)
|| (m_ItemType >= 283 && m_ItemType <= 286)
|| (m_ItemType >= 290 && m_ItemType <= 294)
- || (m_ItemType >= 256 && m_ItemType <= 259)
|| (m_ItemType == 325)
|| (m_ItemType == 346);
}
diff --git a/src/Items/ItemHandler.h b/src/Items/ItemHandler.h
index 5b6c239cc..f3d78335e 100644
--- a/src/Items/ItemHandler.h
+++ b/src/Items/ItemHandler.h
@@ -58,13 +58,13 @@ public:
struct FoodInfo
{
- int FoodLevel;
double Saturation;
+ int FoodLevel;
int PoisonChance; // 0 - 100, in percent. 0 = no chance of poisoning, 100 = sure poisoning
FoodInfo(int a_FoodLevel, double a_Saturation, int a_PoisonChance = 0) :
- FoodLevel(a_FoodLevel),
Saturation(a_Saturation),
+ FoodLevel(a_FoodLevel),
PoisonChance(a_PoisonChance)
{
}
diff --git a/src/MobProximityCounter.cpp b/src/MobProximityCounter.cpp
index 6c44ea458..519757c2c 100644
--- a/src/MobProximityCounter.cpp
+++ b/src/MobProximityCounter.cpp
@@ -34,7 +34,7 @@ void cMobProximityCounter::CollectMob(cEntity& a_Monster, cChunk& a_Chunk, doubl
void cMobProximityCounter::convertMaps()
{
- for(tMonsterToDistance::const_iterator itr = m_MonsterToDistance.begin(); itr != m_MonsterToDistance.end(); itr++)
+ for(tMonsterToDistance::const_iterator itr = m_MonsterToDistance.begin(); itr != m_MonsterToDistance.end(); ++itr)
{
m_DistanceToMonster.insert(tDistanceToMonster::value_type(itr->second.m_Distance,sMonsterAndChunk(*itr->first,itr->second.m_Chunk)));
}
@@ -55,7 +55,7 @@ cMobProximityCounter::sIterablePair cMobProximityCounter::getMobWithinThosesDist
convertMaps();
}
- for(tDistanceToMonster::const_iterator itr = m_DistanceToMonster.begin(); itr != m_DistanceToMonster.end(); itr++)
+ for(tDistanceToMonster::const_iterator itr = m_DistanceToMonster.begin(); itr != m_DistanceToMonster.end(); ++itr)
{
if (toReturn.m_Begin == m_DistanceToMonster.end())
{
diff --git a/src/MobSpawner.cpp b/src/MobSpawner.cpp
index 05da5d01c..ce8e06777 100644
--- a/src/MobSpawner.cpp
+++ b/src/MobSpawner.cpp
@@ -13,7 +13,7 @@ cMobSpawner::cMobSpawner(cMonster::eFamily a_MonsterFamily,const std::set<cMonst
m_NewPack(true),
m_MobType(cMonster::mtInvalidType)
{
- for (std::set<cMonster::eType>::const_iterator itr = a_AllowedTypes.begin(); itr != a_AllowedTypes.end(); itr++)
+ for (std::set<cMonster::eType>::const_iterator itr = a_AllowedTypes.begin(); itr != a_AllowedTypes.end(); ++itr)
{
if (cMonster::FamilyFromType(*itr) == a_MonsterFamily)
{
@@ -112,7 +112,7 @@ cMonster::eType cMobSpawner::ChooseMobType(EMCSBiome a_Biome)
for(int i = 0; i < iRandom; i++)
{
- itr++;
+ ++itr;
}
return *itr;
diff --git a/src/Mobs/Sheep.cpp b/src/Mobs/Sheep.cpp
index d599a4cef..5a6b760af 100644
--- a/src/Mobs/Sheep.cpp
+++ b/src/Mobs/Sheep.cpp
@@ -36,7 +36,8 @@ void cSheep::GetDrops(cItems & a_Drops, cEntity * a_Killer)
void cSheep::OnRightClicked(cPlayer & a_Player)
{
- if ((a_Player.GetEquippedItem().m_ItemType == E_ITEM_SHEARS) && (!m_IsSheared))
+ const cItem & EquippedItem = a_Player.GetEquippedItem();
+ if ((EquippedItem.m_ItemType == E_ITEM_SHEARS) && (!m_IsSheared))
{
m_IsSheared = true;
m_World->BroadcastEntityMetadata(*this);
@@ -51,9 +52,9 @@ void cSheep::OnRightClicked(cPlayer & a_Player)
Drops.push_back(cItem(E_BLOCK_WOOL, NumDrops, m_WoolColor));
m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10);
}
- if ((a_Player.GetEquippedItem().m_ItemType == E_ITEM_DYE) && (m_WoolColor != 15 - a_Player.GetEquippedItem().m_ItemDamage))
+ else if ((EquippedItem.m_ItemType == E_ITEM_DYE) && (m_WoolColor != 15 - EquippedItem.m_ItemDamage))
{
- m_WoolColor = 15 - a_Player.GetEquippedItem().m_ItemDamage;
+ m_WoolColor = 15 - EquippedItem.m_ItemDamage;
if (!a_Player.IsGameModeCreative())
{
a_Player.GetInventory().RemoveOneEquippedItem();
diff --git a/src/Mobs/Wolf.h b/src/Mobs/Wolf.h
index 9e5ad03c7..5925373e1 100644
--- a/src/Mobs/Wolf.h
+++ b/src/Mobs/Wolf.h
@@ -37,7 +37,7 @@ public:
void SetIsTame (bool a_IsTame) { m_IsTame = a_IsTame; }
void SetIsBegging (bool a_IsBegging) { m_IsBegging = a_IsBegging; }
void SetIsAngry (bool a_IsAngry) { m_IsAngry = a_IsAngry; }
- void SetOwner (AString a_NewOwner) { m_OwnerName = a_NewOwner; }
+ void SetOwner (const AString & a_NewOwner) { m_OwnerName = a_NewOwner; }
void SetCollarColor(int a_CollarColor) { m_CollarColor = a_CollarColor; }
protected:
diff --git a/src/MonsterConfig.cpp b/src/MonsterConfig.cpp
index c06bd6b6f..72a3a3245 100644
--- a/src/MonsterConfig.cpp
+++ b/src/MonsterConfig.cpp
@@ -17,6 +17,7 @@ struct cMonsterConfig::sAttributesStruct
int m_AttackRange;
double m_AttackRate;
int m_MaxHealth;
+ bool m_IsFireproof;
};
@@ -72,6 +73,7 @@ void cMonsterConfig::Initialize()
Attributes.m_SightDistance = MonstersIniFile.GetValueI(Name, "SightDistance", 0);
Attributes.m_AttackRate = MonstersIniFile.GetValueF(Name, "AttackRate", 0);
Attributes.m_MaxHealth = MonstersIniFile.GetValueI(Name, "MaxHealth", 1);
+ Attributes.m_IsFireproof = MonstersIniFile.GetValueB(Name, "IsFireproof", false);
m_pState->AttributesList.push_front(Attributes);
} // for i - SplitList[]
}
@@ -92,6 +94,7 @@ void cMonsterConfig::AssignAttributes(cMonster * a_Monster, const AString & a_Na
a_Monster->SetSightDistance(itr->m_SightDistance);
a_Monster->SetAttackRate ((float)itr->m_AttackRate);
a_Monster->SetMaxHealth (itr->m_MaxHealth);
+ a_Monster->SetIsFireproof (itr->m_IsFireproof);
return;
}
} // for itr - m_pState->AttributesList[]
diff --git a/src/Noise.cpp b/src/Noise.cpp
index 32922c8f3..efbb128c3 100644
--- a/src/Noise.cpp
+++ b/src/Noise.cpp
@@ -840,12 +840,14 @@ void cPerlinNoise::Generate2D(
}
// Generate the first octave directly into array:
- m_Octaves.front().m_Noise.Generate2D(
+ const cOctave & FirstOctave = m_Octaves.front();
+
+ FirstOctave.m_Noise.Generate2D(
a_Workspace, a_SizeX, a_SizeY,
- a_StartX * m_Octaves.front().m_Frequency, a_EndX * m_Octaves.front().m_Frequency,
- a_StartY * m_Octaves.front().m_Frequency, a_EndY * m_Octaves.front().m_Frequency
+ a_StartX * FirstOctave.m_Frequency, a_EndX * FirstOctave.m_Frequency,
+ a_StartY * FirstOctave.m_Frequency, a_EndY * FirstOctave.m_Frequency
);
- NOISE_DATATYPE Amplitude = m_Octaves.front().m_Amplitude;
+ NOISE_DATATYPE Amplitude = FirstOctave.m_Amplitude;
for (int i = 0; i < ArrayCount; i++)
{
a_Array[i] *= Amplitude;
@@ -902,13 +904,15 @@ void cPerlinNoise::Generate3D(
}
// Generate the first octave directly into array:
- m_Octaves.front().m_Noise.Generate3D(
+ const cOctave & FirstOctave = m_Octaves.front();
+
+ FirstOctave.m_Noise.Generate3D(
a_Workspace, a_SizeX, a_SizeY, a_SizeZ,
- a_StartX * m_Octaves.front().m_Frequency, a_EndX * m_Octaves.front().m_Frequency,
- a_StartY * m_Octaves.front().m_Frequency, a_EndY * m_Octaves.front().m_Frequency,
- a_StartZ * m_Octaves.front().m_Frequency, a_EndZ * m_Octaves.front().m_Frequency
+ a_StartX * FirstOctave.m_Frequency, a_EndX * FirstOctave.m_Frequency,
+ a_StartY * FirstOctave.m_Frequency, a_EndY * FirstOctave.m_Frequency,
+ a_StartZ * FirstOctave.m_Frequency, a_EndZ * FirstOctave.m_Frequency
);
- NOISE_DATATYPE Amplitude = m_Octaves.front().m_Amplitude;
+ NOISE_DATATYPE Amplitude = FirstOctave.m_Amplitude;
for (int i = 0; i < ArrayCount; i++)
{
a_Array[i] = a_Workspace[i] * Amplitude;
diff --git a/src/Protocol/Authenticator.cpp b/src/Protocol/Authenticator.cpp
index a30131b36..e0fcc0007 100644
--- a/src/Protocol/Authenticator.cpp
+++ b/src/Protocol/Authenticator.cpp
@@ -119,9 +119,10 @@ void cAuthenticator::Execute(void)
}
ASSERT(!m_Queue.empty());
- int ClientID = m_Queue.front().m_ClientID;
- AString UserName = m_Queue.front().m_Name;
- AString ServerID = m_Queue.front().m_ServerID;
+ cAuthenticator::cUser & User = m_Queue.front();
+ int ClientID = User.m_ClientID;
+ AString UserName = User.m_Name;
+ AString ServerID = User.m_ServerID;
m_Queue.pop_front();
Lock.Unlock();
diff --git a/src/Protocol/Protocol125.cpp b/src/Protocol/Protocol125.cpp
index 9b8db0b7b..3282a827f 100644
--- a/src/Protocol/Protocol125.cpp
+++ b/src/Protocol/Protocol125.cpp
@@ -538,9 +538,10 @@ void cProtocol125::SendHealth(void)
{
cCSLock Lock(m_CSPacket);
WriteByte (PACKET_UPDATE_HEALTH);
- WriteShort((short)m_Client->GetPlayer()->GetHealth());
- WriteShort((short)m_Client->GetPlayer()->GetFoodLevel());
- WriteFloat((float)m_Client->GetPlayer()->GetFoodSaturationLevel());
+ cPlayer * Player = m_Client->GetPlayer();
+ WriteShort((short)Player->GetHealth());
+ WriteShort((short)Player->GetFoodLevel());
+ WriteFloat((float)Player->GetFoodSaturationLevel());
Flush();
}
@@ -668,13 +669,14 @@ void cProtocol125::SendPickupSpawn(const cPickup & a_Pickup)
cCSLock Lock(m_CSPacket);
WriteByte (PACKET_PICKUP_SPAWN);
WriteInt (a_Pickup.GetUniqueID());
- WriteShort (a_Pickup.GetItem().m_ItemType);
- WriteChar (a_Pickup.GetItem().m_ItemCount);
- WriteShort (a_Pickup.GetItem().m_ItemDamage);
+ const cItem & Item = a_Pickup.GetItem();
+ WriteShort (Item.m_ItemType);
+ WriteChar (Item.m_ItemCount);
+ WriteShort (Item.m_ItemDamage);
WriteVectorI((Vector3i)(a_Pickup.GetPosition() * 32));
- WriteByte ((char)(a_Pickup.GetSpeed().x * 8));
- WriteByte ((char)(a_Pickup.GetSpeed().y * 8));
- WriteByte ((char)(a_Pickup.GetSpeed().z * 8));
+ WriteByte ((char)(a_Pickup.GetSpeedX() * 8));
+ WriteByte ((char)(a_Pickup.GetSpeedY() * 8));
+ WriteByte ((char)(a_Pickup.GetSpeedZ() * 8));
Flush();
}
@@ -831,10 +833,11 @@ void cProtocol125::SendRemoveEntityEffect(const cEntity & a_Entity, int a_Effect
void cProtocol125::SendRespawn(void)
{
cCSLock Lock(m_CSPacket);
+ cPlayer * Player = m_Client->GetPlayer();
WriteByte (PACKET_RESPAWN);
- WriteInt ((int)(m_Client->GetPlayer()->GetWorld()->GetDimension()));
+ WriteInt ((int)(Player->GetWorld()->GetDimension()));
WriteByte (2); // TODO: Difficulty; 2 = Normal
- WriteChar ((char)m_Client->GetPlayer()->GetGameMode());
+ WriteChar ((char)Player->GetGameMode());
WriteShort (256); // Current world height
WriteString("default");
}
@@ -846,10 +849,11 @@ void cProtocol125::SendRespawn(void)
void cProtocol125::SendExperience(void)
{
cCSLock Lock(m_CSPacket);
+ cPlayer * Player = m_Client->GetPlayer();
WriteByte (PACKET_EXPERIENCE);
- WriteFloat (m_Client->GetPlayer()->GetXpPercentage());
- WriteShort (m_Client->GetPlayer()->GetXpLevel());
- WriteShort (m_Client->GetPlayer()->GetCurrentXp());
+ WriteFloat (Player->GetXpPercentage());
+ WriteShort (Player->GetXpLevel());
+ WriteShort (Player->GetCurrentXp());
Flush();
}
diff --git a/src/Protocol/Protocol132.cpp b/src/Protocol/Protocol132.cpp
index ce5942a5c..53d8c1561 100644
--- a/src/Protocol/Protocol132.cpp
+++ b/src/Protocol/Protocol132.cpp
@@ -408,7 +408,8 @@ void cProtocol132::SendWholeInventory(const cWindow & a_Window)
super::SendWholeInventory(a_Window);
// Send the player inventory and hotbar:
- const cInventory & Inventory = m_Client->GetPlayer()->GetInventory();
+ cPlayer * Player = m_Client->GetPlayer();
+ const cInventory & Inventory = Player->GetInventory();
int BaseOffset = a_Window.GetNumSlots() - (cInventory::invNumSlots - cInventory::invInventoryOffset); // Number of non-inventory slots
char WindowID = a_Window.GetWindowID();
for (short i = 0; i < cInventory::invInventoryCount; i++)
@@ -422,7 +423,7 @@ void cProtocol132::SendWholeInventory(const cWindow & a_Window)
} // for i - Hotbar[]
// Send even the item being dragged:
- SendInventorySlot(-1, -1, m_Client->GetPlayer()->GetDraggingItem());
+ SendInventorySlot(-1, -1, Player->GetDraggingItem());
}
@@ -800,10 +801,12 @@ void cProtocol132::SendCompass(const cWorld & a_World)
void cProtocol132::SendEncryptionKeyRequest(void)
{
cCSLock Lock(m_CSPacket);
+ cServer * Server = cRoot::Get()->GetServer();
WriteByte(0xfd);
- WriteString(cRoot::Get()->GetServer()->GetServerID());
- WriteShort((short)(cRoot::Get()->GetServer()->GetPublicKeyDER().size()));
- SendData(cRoot::Get()->GetServer()->GetPublicKeyDER().data(), cRoot::Get()->GetServer()->GetPublicKeyDER().size());
+ WriteString(Server->GetServerID());
+ const AString & PublicKeyDER = Server->GetPublicKeyDER();
+ WriteShort((short)(PublicKeyDER.size()));
+ SendData(PublicKeyDER.data(), PublicKeyDER.size());
WriteShort(4);
WriteInt((int)(intptr_t)this); // Using 'this' as the cryptographic nonce, so that we don't have to generate one each time :)
Flush();
@@ -874,10 +877,11 @@ void cProtocol132::StartEncryption(const Byte * a_Key)
// Prepare the m_AuthServerID:
cSHA1Checksum Checksum;
- AString ServerID = cRoot::Get()->GetServer()->GetServerID();
+ cServer * Server = cRoot::Get()->GetServer();
+ AString ServerID = Server->GetServerID();
Checksum.Update((const Byte *)ServerID.c_str(), ServerID.length());
Checksum.Update(a_Key, 16);
- Checksum.Update((const Byte *)cRoot::Get()->GetServer()->GetPublicKeyDER().data(), cRoot::Get()->GetServer()->GetPublicKeyDER().size());
+ Checksum.Update((const Byte *)Server->GetPublicKeyDER().data(), Server->GetPublicKeyDER().size());
Byte Digest[20];
Checksum.Finalize(Digest);
cSHA1Checksum::DigestToJava(Digest, m_AuthServerID);
diff --git a/src/Protocol/Protocol14x.cpp b/src/Protocol/Protocol14x.cpp
index f694af1eb..f60e756fd 100644
--- a/src/Protocol/Protocol14x.cpp
+++ b/src/Protocol/Protocol14x.cpp
@@ -103,9 +103,9 @@ void cProtocol142::SendPickupSpawn(const cPickup & a_Pickup)
WriteInt (a_Pickup.GetUniqueID());
WriteItem (a_Pickup.GetItem());
WriteVectorI((Vector3i)(a_Pickup.GetPosition() * 32));
- WriteChar ((char)(a_Pickup.GetSpeed().x * 8));
- WriteChar ((char)(a_Pickup.GetSpeed().y * 8));
- WriteChar ((char)(a_Pickup.GetSpeed().z * 8));
+ WriteChar((char)(a_Pickup.GetSpeedX() * 8));
+ WriteChar((char)(a_Pickup.GetSpeedY() * 8));
+ WriteChar((char)(a_Pickup.GetSpeedZ() * 8));
Flush();
}
@@ -170,9 +170,9 @@ void cProtocol146::SendPickupSpawn(const cPickup & a_Pickup)
WriteInt ((int)(a_Pickup.GetPosY() * 32));
WriteInt ((int)(a_Pickup.GetPosZ() * 32));
WriteInt (1);
- WriteShort((short)(a_Pickup.GetSpeed().x * 32));
- WriteShort((short)(a_Pickup.GetSpeed().y * 32));
- WriteShort((short)(a_Pickup.GetSpeed().z * 32));
+ WriteShort((short)(a_Pickup.GetSpeedX() * 32));
+ WriteShort((short)(a_Pickup.GetSpeedY() * 32));
+ WriteShort((short)(a_Pickup.GetSpeedZ() * 32));
WriteByte(0);
WriteByte(0);
diff --git a/src/Protocol/Protocol16x.cpp b/src/Protocol/Protocol16x.cpp
index 8d79213af..714bf5e46 100644
--- a/src/Protocol/Protocol16x.cpp
+++ b/src/Protocol/Protocol16x.cpp
@@ -131,9 +131,10 @@ void cProtocol161::SendHealth(void)
{
cCSLock Lock(m_CSPacket);
WriteByte (PACKET_UPDATE_HEALTH);
- WriteFloat((float)m_Client->GetPlayer()->GetHealth());
- WriteShort((short)m_Client->GetPlayer()->GetFoodLevel());
- WriteFloat((float)m_Client->GetPlayer()->GetFoodSaturationLevel());
+ cPlayer * Player = m_Client->GetPlayer();
+ WriteFloat((float)Player->GetHealth());
+ WriteShort((short)Player->GetFoodLevel());
+ WriteFloat((float)Player->GetFoodSaturationLevel());
Flush();
}
@@ -144,11 +145,12 @@ void cProtocol161::SendHealth(void)
void cProtocol161::SendPlayerMaxSpeed(void)
{
cCSLock Lock(m_CSPacket);
+ cPlayer * Player = m_Client->GetPlayer();
WriteByte(PACKET_ENTITY_PROPERTIES);
- WriteInt(m_Client->GetPlayer()->GetUniqueID());
+ WriteInt(Player->GetUniqueID());
WriteInt(1);
WriteString("generic.movementSpeed");
- WriteDouble(0.1 * m_Client->GetPlayer()->GetMaxSpeed());
+ WriteDouble(0.1 * Player->GetMaxSpeed());
Flush();
}
@@ -295,11 +297,12 @@ cProtocol162::cProtocol162(cClientHandle * a_Client) :
void cProtocol162::SendPlayerMaxSpeed(void)
{
cCSLock Lock(m_CSPacket);
+ cPlayer * Player = m_Client->GetPlayer();
WriteByte(PACKET_ENTITY_PROPERTIES);
- WriteInt(m_Client->GetPlayer()->GetUniqueID());
+ WriteInt(Player->GetUniqueID());
WriteInt(1);
WriteString("generic.movementSpeed");
- WriteDouble(0.1 * m_Client->GetPlayer()->GetMaxSpeed());
+ WriteDouble(0.1 * Player->GetMaxSpeed());
WriteShort(0);
Flush();
}
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index 36f770df7..e57b551cb 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -563,9 +563,10 @@ void cProtocol172::SendHealth(void)
ASSERT(m_State == 3); // In game mode?
cPacketizer Pkt(*this, 0x06); // Update Health packet
- Pkt.WriteFloat((float)m_Client->GetPlayer()->GetHealth());
- Pkt.WriteShort(m_Client->GetPlayer()->GetFoodLevel());
- Pkt.WriteFloat((float)m_Client->GetPlayer()->GetFoodSaturationLevel());
+ cPlayer * Player = m_Client->GetPlayer();
+ Pkt.WriteFloat((float)Player->GetHealth());
+ Pkt.WriteShort(Player->GetFoodLevel());
+ Pkt.WriteFloat((float)Player->GetFoodSaturationLevel());
}
@@ -607,12 +608,13 @@ void cProtocol172::SendLogin(const cPlayer & a_Player, const cWorld & a_World)
{
// Send the Join Game packet:
{
+ cServer * Server = cRoot::Get()->GetServer();
cPacketizer Pkt(*this, 0x01); // Join Game packet
Pkt.WriteInt(a_Player.GetUniqueID());
- Pkt.WriteByte((Byte)a_Player.GetEffectiveGameMode() | (cRoot::Get()->GetServer()->IsHardcore() ? 0x08 : 0)); // Hardcore flag bit 4
+ Pkt.WriteByte((Byte)a_Player.GetEffectiveGameMode() | (Server->IsHardcore() ? 0x08 : 0)); // Hardcore flag bit 4
Pkt.WriteChar((char)a_World.GetDimension());
Pkt.WriteByte(2); // TODO: Difficulty (set to Normal)
- Pkt.WriteByte(std::min(cRoot::Get()->GetServer()->GetMaxPlayers(), 60));
+ Pkt.WriteByte(std::min(Server->GetMaxPlayers(), 60));
Pkt.WriteString("default"); // Level type - wtf?
}
@@ -758,22 +760,23 @@ void cProtocol172::SendPlayerAbilities(void)
cPacketizer Pkt(*this, 0x39); // Player Abilities packet
Byte Flags = 0;
- if (m_Client->GetPlayer()->IsGameModeCreative())
+ cPlayer * Player = m_Client->GetPlayer();
+ if (Player->IsGameModeCreative())
{
Flags |= 0x01;
Flags |= 0x08; // Godmode, used for creative
}
- if (m_Client->GetPlayer()->IsFlying())
+ if (Player->IsFlying())
{
Flags |= 0x02;
}
- if (m_Client->GetPlayer()->CanFly())
+ if (Player->CanFly())
{
Flags |= 0x04;
}
Pkt.WriteByte(Flags);
- Pkt.WriteFloat((float)(0.05 * m_Client->GetPlayer()->GetFlyingMaxSpeed()));
- Pkt.WriteFloat((float)(0.1 * m_Client->GetPlayer()->GetMaxSpeed()));
+ Pkt.WriteFloat((float)(0.05 * Player->GetFlyingMaxSpeed()));
+ Pkt.WriteFloat((float)(0.1 * Player->GetMaxSpeed()));
}
@@ -832,17 +835,18 @@ void cProtocol172::SendPlayerMaxSpeed(void)
ASSERT(m_State == 3); // In game mode?
cPacketizer Pkt(*this, 0x20); // Entity Properties
- Pkt.WriteInt(m_Client->GetPlayer()->GetUniqueID());
+ cPlayer * Player = m_Client->GetPlayer();
+ Pkt.WriteInt(Player->GetUniqueID());
Pkt.WriteInt(1); // Count
Pkt.WriteString("generic.movementSpeed");
// The default game speed is 0.1, multiply that value by the relative speed:
- Pkt.WriteDouble(0.1 * m_Client->GetPlayer()->GetNormalMaxSpeed());
- if (m_Client->GetPlayer()->IsSprinting())
+ Pkt.WriteDouble(0.1 * Player->GetNormalMaxSpeed());
+ if (Player->IsSprinting())
{
Pkt.WriteShort(1); // Modifier count
Pkt.WriteInt64(0x662a6b8dda3e4c1c);
Pkt.WriteInt64(0x881396ea6097278d); // UUID of the modifier
- Pkt.WriteDouble(m_Client->GetPlayer()->GetSprintingMaxSpeed() - m_Client->GetPlayer()->GetNormalMaxSpeed());
+ Pkt.WriteDouble(Player->GetSprintingMaxSpeed() - Player->GetNormalMaxSpeed());
Pkt.WriteByte(2);
}
else
@@ -860,16 +864,17 @@ void cProtocol172::SendPlayerMoveLook(void)
ASSERT(m_State == 3); // In game mode?
cPacketizer Pkt(*this, 0x08); // Player Position And Look packet
- Pkt.WriteDouble(m_Client->GetPlayer()->GetPosX());
+ cPlayer * Player = m_Client->GetPlayer();
+ Pkt.WriteDouble(Player->GetPosX());
// Protocol docs say this is PosY, but #323 says this is eye-pos
// Moreover, the "+ 0.001" is there because otherwise the player falls through the block they were standing on.
- Pkt.WriteDouble(m_Client->GetPlayer()->GetStance() + 0.001);
+ Pkt.WriteDouble(Player->GetStance() + 0.001);
- Pkt.WriteDouble(m_Client->GetPlayer()->GetPosZ());
- Pkt.WriteFloat((float)m_Client->GetPlayer()->GetYaw());
- Pkt.WriteFloat((float)m_Client->GetPlayer()->GetPitch());
- Pkt.WriteBool(m_Client->GetPlayer()->IsOnGround());
+ Pkt.WriteDouble(Player->GetPosZ());
+ Pkt.WriteFloat((float)Player->GetYaw());
+ Pkt.WriteFloat((float)Player->GetPitch());
+ Pkt.WriteBool(Player->IsOnGround());
}
@@ -941,9 +946,10 @@ void cProtocol172::SendRemoveEntityEffect(const cEntity & a_Entity, int a_Effect
void cProtocol172::SendRespawn(void)
{
cPacketizer Pkt(*this, 0x07); // Respawn packet
- Pkt.WriteInt(m_Client->GetPlayer()->GetWorld()->GetDimension());
+ cPlayer * Player = m_Client->GetPlayer();
+ Pkt.WriteInt(Player->GetWorld()->GetDimension());
Pkt.WriteByte(2); // TODO: Difficulty (set to Normal)
- Pkt.WriteByte((Byte)m_Client->GetPlayer()->GetEffectiveGameMode());
+ Pkt.WriteByte((Byte)Player->GetEffectiveGameMode());
Pkt.WriteString("default");
}
@@ -956,9 +962,10 @@ void cProtocol172::SendExperience (void)
ASSERT(m_State == 3); // In game mode?
cPacketizer Pkt(*this, 0x1f); // Experience Packet
- Pkt.WriteFloat(m_Client->GetPlayer()->GetXpPercentage());
- Pkt.WriteShort(m_Client->GetPlayer()->GetXpLevel());
- Pkt.WriteShort(m_Client->GetPlayer()->GetCurrentXp());
+ cPlayer * Player = m_Client->GetPlayer();
+ Pkt.WriteFloat(Player->GetXpPercentage());
+ Pkt.WriteShort(Player->GetXpLevel());
+ Pkt.WriteShort(Player->GetCurrentXp());
}
@@ -1635,15 +1642,16 @@ void cProtocol172::HandlePacketStatusRequest(cByteBuffer & a_ByteBuffer)
{
// Send the response:
AString Response = "{\"version\":{\"name\":\"1.7.2\",\"protocol\":4},\"players\":{";
+ cServer * Server = cRoot::Get()->GetServer();
AppendPrintf(Response, "\"max\":%u,\"online\":%u,\"sample\":[]},",
- cRoot::Get()->GetServer()->GetMaxPlayers(),
- cRoot::Get()->GetServer()->GetNumPlayers()
+ Server->GetMaxPlayers(),
+ Server->GetNumPlayers()
);
AppendPrintf(Response, "\"description\":{\"text\":\"%s\"},",
- cRoot::Get()->GetServer()->GetDescription().c_str()
+ Server->GetDescription().c_str()
);
AppendPrintf(Response, "\"favicon\":\"data:image/png;base64,%s\"",
- cRoot::Get()->GetServer()->GetFaviconData().c_str()
+ Server->GetFaviconData().c_str()
);
Response.append("}");
@@ -1723,12 +1731,13 @@ void cProtocol172::HandlePacketLoginStart(cByteBuffer & a_ByteBuffer)
return;
}
+ cServer * Server = cRoot::Get()->GetServer();
// If auth is required, then send the encryption request:
- if (cRoot::Get()->GetServer()->ShouldAuthenticate())
+ if (Server->ShouldAuthenticate())
{
cPacketizer Pkt(*this, 0x01);
- Pkt.WriteString(cRoot::Get()->GetServer()->GetServerID());
- const AString & PubKeyDer = cRoot::Get()->GetServer()->GetPublicKeyDER();
+ Pkt.WriteString(Server->GetServerID());
+ const AString & PubKeyDer = Server->GetPublicKeyDER();
Pkt.WriteShort(PubKeyDer.size());
Pkt.WriteBuf(PubKeyDer.data(), PubKeyDer.size());
Pkt.WriteShort(4);
@@ -2281,10 +2290,11 @@ void cProtocol172::StartEncryption(const Byte * a_Key)
// Prepare the m_AuthServerID:
cSHA1Checksum Checksum;
- const AString & ServerID = cRoot::Get()->GetServer()->GetServerID();
+ cServer * Server = cRoot::Get()->GetServer();
+ const AString & ServerID = Server->GetServerID();
Checksum.Update((const Byte *)ServerID.c_str(), ServerID.length());
Checksum.Update(a_Key, 16);
- Checksum.Update((const Byte *)cRoot::Get()->GetServer()->GetPublicKeyDER().data(), cRoot::Get()->GetServer()->GetPublicKeyDER().size());
+ Checksum.Update((const Byte *)Server->GetPublicKeyDER().data(), Server->GetPublicKeyDER().size());
Byte Digest[20];
Checksum.Finalize(Digest);
cSHA1Checksum::DigestToJava(Digest, m_AuthServerID);
@@ -2626,11 +2636,12 @@ void cProtocol172::cPacketizer::WriteEntityMetadata(const cEntity & a_Entity)
if (((cMinecart &)a_Entity).GetPayload() == cMinecart::mpNone)
{
cRideableMinecart & RideableMinecart = ((cRideableMinecart &)a_Entity);
- if (!RideableMinecart.GetContent().IsEmpty())
+ const cItem & MinecartContent = RideableMinecart.GetContent();
+ if (!MinecartContent.IsEmpty())
{
WriteByte(0x54);
- int Content = RideableMinecart.GetContent().m_ItemType;
- Content |= RideableMinecart.GetContent().m_ItemDamage << 8;
+ int Content = MinecartContent.m_ItemType;
+ Content |= MinecartContent.m_ItemDamage << 8;
WriteInt(Content);
WriteByte(0x55);
WriteInt(RideableMinecart.GetBlockHeight());
diff --git a/src/Protocol/ProtocolRecognizer.cpp b/src/Protocol/ProtocolRecognizer.cpp
index 8a97b9713..2ccb9f197 100644
--- a/src/Protocol/ProtocolRecognizer.cpp
+++ b/src/Protocol/ProtocolRecognizer.cpp
@@ -1003,6 +1003,7 @@ bool cProtocolRecognizer::TryRecognizeLengthedProtocol(UInt32 a_PacketLengthRema
void cProtocolRecognizer::SendLengthlessServerPing(void)
{
AString Reply;
+ cServer * Server = cRoot::Get()->GetServer();
switch (cRoot::Get()->GetPrimaryServerVersion())
{
case PROTO_VERSION_1_2_5:
@@ -1010,11 +1011,11 @@ void cProtocolRecognizer::SendLengthlessServerPing(void)
{
// http://wiki.vg/wiki/index.php?title=Protocol&oldid=3099#Server_List_Ping_.280xFE.29
Printf(Reply, "%s%s%i%s%i",
- cRoot::Get()->GetServer()->GetDescription().c_str(),
+ Server->GetDescription().c_str(),
cChatColor::Delimiter.c_str(),
- cRoot::Get()->GetServer()->GetNumPlayers(),
+ Server->GetNumPlayers(),
cChatColor::Delimiter.c_str(),
- cRoot::Get()->GetServer()->GetMaxPlayers()
+ Server->GetMaxPlayers()
);
break;
}
@@ -1044,9 +1045,9 @@ void cProtocolRecognizer::SendLengthlessServerPing(void)
// http://wiki.vg/wiki/index.php?title=Server_List_Ping&oldid=3100
AString NumPlayers;
- Printf(NumPlayers, "%d", cRoot::Get()->GetServer()->GetNumPlayers());
+ Printf(NumPlayers, "%d", Server->GetNumPlayers());
AString MaxPlayers;
- Printf(MaxPlayers, "%d", cRoot::Get()->GetServer()->GetMaxPlayers());
+ Printf(MaxPlayers, "%d", Server->GetMaxPlayers());
AString ProtocolVersionNum;
Printf(ProtocolVersionNum, "%d", cRoot::Get()->GetPrimaryServerVersion());
@@ -1060,7 +1061,7 @@ void cProtocolRecognizer::SendLengthlessServerPing(void)
Reply.push_back(0);
Reply.append(ProtocolVersionTxt);
Reply.push_back(0);
- Reply.append(cRoot::Get()->GetServer()->GetDescription());
+ Reply.append(Server->GetDescription());
Reply.push_back(0);
Reply.append(NumPlayers);
Reply.push_back(0);
diff --git a/src/Server.cpp b/src/Server.cpp
index e0feaf0d8..bfb1b1cbb 100644
--- a/src/Server.cpp
+++ b/src/Server.cpp
@@ -190,7 +190,7 @@ void cServer::PlayerDestroying(const cPlayer * a_Player)
bool cServer::InitServer(cIniFile & a_SettingsIni)
{
- m_Description = a_SettingsIni.GetValueSet("Server", "Description", "MCServer - in C++!").c_str();
+ m_Description = a_SettingsIni.GetValueSet("Server", "Description", "MCServer - in C++!");
m_MaxPlayers = a_SettingsIni.GetValueSetI("Server", "MaxPlayers", 100);
m_bIsHardcore = a_SettingsIni.GetValueSetB("Server", "HardcoreEnabled", false);
m_PlayerCount = 0;
@@ -275,7 +275,7 @@ bool cServer::InitServer(cIniFile & a_SettingsIni)
-int cServer::GetNumPlayers(void)
+int cServer::GetNumPlayers(void) const
{
cCSLock Lock(m_CSPlayerCount);
return m_PlayerCount;
diff --git a/src/Server.h b/src/Server.h
index b5c384a44..51c450ebd 100644
--- a/src/Server.h
+++ b/src/Server.h
@@ -59,7 +59,7 @@ public: // tolua_export
// Player counts:
int GetMaxPlayers(void) const {return m_MaxPlayers; }
- int GetNumPlayers(void);
+ int GetNumPlayers(void) const;
void SetMaxPlayers(int a_MaxPlayers) { m_MaxPlayers = a_MaxPlayers; }
// Hardcore mode or not:
@@ -168,7 +168,7 @@ private:
cClientHandleList m_Clients; ///< Clients that are connected to the server and not yet assigned to a cWorld
cClientHandleList m_ClientsToRemove; ///< Clients that have just been moved into a world and are to be removed from m_Clients in the next Tick()
- cCriticalSection m_CSPlayerCount; ///< Locks the m_PlayerCount
+ mutable cCriticalSection m_CSPlayerCount; ///< Locks the m_PlayerCount
int m_PlayerCount; ///< Number of players currently playing in the server
cCriticalSection m_CSPlayerCountDiff; ///< Locks the m_PlayerCountDiff
int m_PlayerCountDiff; ///< Adjustment to m_PlayerCount to be applied in the Tick thread
diff --git a/src/Simulator/FireSimulator.cpp b/src/Simulator/FireSimulator.cpp
index 470dfc791..4fbfffd43 100644
--- a/src/Simulator/FireSimulator.cpp
+++ b/src/Simulator/FireSimulator.cpp
@@ -350,7 +350,7 @@ void cFireSimulator::RemoveFuelNeighbors(cChunk * a_Chunk, int a_RelX, int a_Rel
{
continue;
}
- BlockType = Neighbour->GetBlock(X, a_RelY + gCrossCoords[i].y, Z);
+ BlockType = Neighbour->GetBlock(X, a_RelY + gNeighborCoords[i].y, Z);
if (!IsFuel(BlockType))
{
diff --git a/src/Simulator/FluidSimulator.cpp b/src/Simulator/FluidSimulator.cpp
index 7779573d7..4a84084d2 100644
--- a/src/Simulator/FluidSimulator.cpp
+++ b/src/Simulator/FluidSimulator.cpp
@@ -155,7 +155,7 @@ Direction cFluidSimulator::GetFlowingDirection(int a_X, int a_Y, int a_Z, bool a
Points.push_back(new Vector3i(a_X, a_Y, a_Z + 1));
Points.push_back(new Vector3i(a_X, a_Y, a_Z - 1));
- for (std::vector<Vector3i *>::iterator it = Points.begin(); it < Points.end(); it++)
+ for (std::vector<Vector3i *>::iterator it = Points.begin(); it < Points.end(); ++it)
{
Vector3i *Pos = (*it);
char BlockID = m_World.GetBlock(Pos->x, Pos->y, Pos->z);
diff --git a/src/StackWalker.cpp b/src/StackWalker.cpp
index b4f8ed8c7..b608d69e6 100644
--- a/src/StackWalker.cpp
+++ b/src/StackWalker.cpp
@@ -935,7 +935,8 @@ BOOL StackWalker::LoadModules()
break;
}
} // for (search for path separator...)
- if (strlen(szTemp) > 0)
+
+ if (szTemp[0] != '\0') // If szTemp is not empty (Note: This is more efficient than using strlen)
{
strcat_s(szSymPath, nSymPathLen, szTemp);
strcat_s(szSymPath, nSymPathLen, ";");
diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp
index e062598c8..2d58388b1 100644
--- a/src/UI/SlotArea.cpp
+++ b/src/UI/SlotArea.cpp
@@ -485,6 +485,7 @@ void cSlotAreaCrafting::ClickedResult(cPlayer & a_Player)
// Get the current recipe:
cCraftingRecipe & Recipe = GetRecipeForPlayer(a_Player);
+ const cItem & Result = Recipe.GetResult();
cItem * PlayerSlots = GetPlayerSlots(a_Player) + 1;
cCraftingGrid Grid(PlayerSlots, m_GridSize, m_GridSize);
@@ -492,16 +493,16 @@ void cSlotAreaCrafting::ClickedResult(cPlayer & a_Player)
// If possible, craft:
if (DraggingItem.IsEmpty())
{
- DraggingItem = Recipe.GetResult();
+ DraggingItem = Result;
Recipe.ConsumeIngredients(Grid);
Grid.CopyToItems(PlayerSlots);
}
- else if (DraggingItem.IsEqual(Recipe.GetResult()))
+ else if (DraggingItem.IsEqual(Result))
{
- cItemHandler * Handler = ItemHandler(Recipe.GetResult().m_ItemType);
- if (DraggingItem.m_ItemCount + Recipe.GetResult().m_ItemCount <= Handler->GetMaxStackSize())
+ cItemHandler * Handler = ItemHandler(Result.m_ItemType);
+ if (DraggingItem.m_ItemCount + Result.m_ItemCount <= Handler->GetMaxStackSize())
{
- DraggingItem.m_ItemCount += Recipe.GetResult().m_ItemCount;
+ DraggingItem.m_ItemCount += Result.m_ItemCount;
Recipe.ConsumeIngredients(Grid);
Grid.CopyToItems(PlayerSlots);
}
diff --git a/src/WebAdmin.cpp b/src/WebAdmin.cpp
index cd141f7eb..a3b3cc5be 100644
--- a/src/WebAdmin.cpp
+++ b/src/WebAdmin.cpp
@@ -229,10 +229,11 @@ void cWebAdmin::HandleWebadminRequest(cHTTPConnection & a_Connection, cHTTPReque
} // for itr - Data->m_Form[]
// Parse the URL into individual params:
- size_t idxQM = a_Request.GetURL().find('?');
+ const AString & URL = a_Request.GetURL();
+ size_t idxQM = URL.find('?');
if (idxQM != AString::npos)
{
- cHTTPFormParser URLParams(cHTTPFormParser::fpkURL, a_Request.GetURL().c_str() + idxQM + 1, a_Request.GetURL().length() - idxQM - 1, *Data);
+ cHTTPFormParser URLParams(cHTTPFormParser::fpkURL, URL.c_str() + idxQM + 1, URL.length() - idxQM - 1, *Data);
URLParams.Finish();
for (cHTTPFormParser::const_iterator itr = URLParams.begin(), end = URLParams.end(); itr != end; ++itr)
{
@@ -388,7 +389,6 @@ AString cWebAdmin::GetDefaultPage(void)
{
continue;
}
- AString VersionNum;
AppendPrintf(Content, "<li>%s V.%i</li>", itr->second->GetName().c_str(), itr->second->GetVersion());
}
Content += "</ul>";
diff --git a/src/World.cpp b/src/World.cpp
index 800bdde0e..25ac9b021 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -860,7 +860,7 @@ void cWorld::TickMobs(float a_Dt)
{
m_ChunkMap->SpawnMobs(Spawner);
// do the spawn
- for (cMobSpawner::tSpawnedContainer::const_iterator itr2 = Spawner.getSpawned().begin(); itr2 != Spawner.getSpawned().end(); itr2++)
+ for (cMobSpawner::tSpawnedContainer::const_iterator itr2 = Spawner.getSpawned().begin(); itr2 != Spawner.getSpawned().end(); ++itr2)
{
SpawnMobFinalize(*itr2);
}
@@ -870,14 +870,14 @@ void cWorld::TickMobs(float a_Dt)
// move close mobs
cMobProximityCounter::sIterablePair allCloseEnoughToMoveMobs = MobCensus.GetProximityCounter().getMobWithinThosesDistances(-1, 64 * 16);// MG TODO : deal with this magic number (the 16 is the size of a block)
- for(cMobProximityCounter::tDistanceToMonster::const_iterator itr = allCloseEnoughToMoveMobs.m_Begin; itr != allCloseEnoughToMoveMobs.m_End; itr++)
+ for(cMobProximityCounter::tDistanceToMonster::const_iterator itr = allCloseEnoughToMoveMobs.m_Begin; itr != allCloseEnoughToMoveMobs.m_End; ++itr)
{
itr->second.m_Monster.Tick(a_Dt, itr->second.m_Chunk);
}
// remove too far mobs
cMobProximityCounter::sIterablePair allTooFarMobs = MobCensus.GetProximityCounter().getMobWithinThosesDistances(128 * 16, -1);// MG TODO : deal with this magic number (the 16 is the size of a block)
- for(cMobProximityCounter::tDistanceToMonster::const_iterator itr = allTooFarMobs.m_Begin; itr != allTooFarMobs.m_End; itr++)
+ for(cMobProximityCounter::tDistanceToMonster::const_iterator itr = allTooFarMobs.m_Begin; itr != allTooFarMobs.m_End; ++itr)
{
itr->second.m_Monster.Destroy(true);
}
@@ -2894,7 +2894,7 @@ void cWorld::TickQueuedBlocks(void)
m_BlockTickQueueCopy.clear();
m_BlockTickQueue.swap(m_BlockTickQueueCopy);
- for (std::vector<BlockTickQueueItem *>::iterator itr = m_BlockTickQueueCopy.begin(); itr != m_BlockTickQueueCopy.end(); itr++)
+ for (std::vector<BlockTickQueueItem *>::iterator itr = m_BlockTickQueueCopy.begin(); itr != m_BlockTickQueueCopy.end(); ++itr)
{
BlockTickQueueItem * Block = (*itr);
Block->TicksToWait -= 1;
@@ -2985,7 +2985,7 @@ int cWorld::SpawnMobFinalize(cMonster * a_Monster)
-int cWorld::CreateProjectile(double a_PosX, double a_PosY, double a_PosZ, cProjectileEntity::eKind a_Kind, cEntity * a_Creator, const cItem a_Item, const Vector3d * a_Speed)
+int cWorld::CreateProjectile(double a_PosX, double a_PosY, double a_PosZ, cProjectileEntity::eKind a_Kind, cEntity * a_Creator, const cItem & a_Item, const Vector3d * a_Speed)
{
cProjectileEntity * Projectile = cProjectileEntity::Create(a_Kind, a_Creator, a_PosX, a_PosY, a_PosZ, a_Item, a_Speed);
if (Projectile == NULL)
diff --git a/src/World.h b/src/World.h
index e08ef7f53..e2be4cd35 100644
--- a/src/World.h
+++ b/src/World.h
@@ -711,7 +711,7 @@ public:
int SpawnMobFinalize(cMonster* a_Monster);
/** Creates a projectile of the specified type. Returns the projectile's EntityID if successful, <0 otherwise */
- int CreateProjectile(double a_PosX, double a_PosY, double a_PosZ, cProjectileEntity::eKind a_Kind, cEntity * a_Creator, const cItem a_Item, const Vector3d * a_Speed = NULL); // tolua_export
+ int CreateProjectile(double a_PosX, double a_PosY, double a_PosZ, cProjectileEntity::eKind a_Kind, cEntity * a_Creator, const cItem & a_Item, const Vector3d * a_Speed = NULL); // tolua_export
/** Returns a random number from the m_TickRand in range [0 .. a_Range]. To be used only in the tick thread! */
int GetTickRandomNumber(unsigned a_Range) { return (int)(m_TickRand.randInt(a_Range)); }
diff --git a/src/WorldStorage/FastNBT.cpp b/src/WorldStorage/FastNBT.cpp
index be25fd1a4..ac9a21205 100644
--- a/src/WorldStorage/FastNBT.cpp
+++ b/src/WorldStorage/FastNBT.cpp
@@ -345,7 +345,7 @@ cFastNBTWriter::cFastNBTWriter(const AString & a_RootTagName) :
void cFastNBTWriter::BeginCompound(const AString & a_Name)
{
- if (m_CurrentStack >= MAX_STACK)
+ if (m_CurrentStack >= MAX_STACK - 1)
{
ASSERT(!"Stack overflow");
return;
@@ -376,7 +376,7 @@ void cFastNBTWriter::EndCompound(void)
void cFastNBTWriter::BeginList(const AString & a_Name, eTagType a_ChildrenType)
{
- if (m_CurrentStack >= MAX_STACK)
+ if (m_CurrentStack >= MAX_STACK - 1)
{
ASSERT(!"Stack overflow");
return;
diff --git a/src/WorldStorage/WSSCompact.cpp b/src/WorldStorage/WSSCompact.cpp
index bb9d4b9e6..5435e6d5a 100644
--- a/src/WorldStorage/WSSCompact.cpp
+++ b/src/WorldStorage/WSSCompact.cpp
@@ -839,7 +839,7 @@ void cWSSCompact::cPAKFile::UpdateChunk2To3()
-bool cWSSCompact::LoadChunkFromData(const cChunkCoords & a_Chunk, int & a_UncompressedSize, const AString & a_Data, cWorld * a_World)
+bool cWSSCompact::LoadChunkFromData(const cChunkCoords & a_Chunk, int a_UncompressedSize, const AString & a_Data, cWorld * a_World)
{
// Crude data integrity check:
if (a_UncompressedSize < cChunkDef::BlockDataSize)
diff --git a/src/WorldStorage/WSSCompact.h b/src/WorldStorage/WSSCompact.h
index 4df146ec3..97e3b82f9 100644
--- a/src/WorldStorage/WSSCompact.h
+++ b/src/WorldStorage/WSSCompact.h
@@ -135,7 +135,7 @@ protected:
bool EraseChunkData(const cChunkCoords & a_Chunk);
/// Loads the chunk from the data (no locking needed)
- bool LoadChunkFromData(const cChunkCoords & a_Chunk, int & a_UncompressedSize, const AString & a_Data, cWorld * a_World);
+ bool LoadChunkFromData(const cChunkCoords & a_Chunk, int a_UncompressedSize, const AString & a_Data, cWorld * a_World);
void LoadEntitiesFromJson(Json::Value & a_Value, cEntityList & a_Entities, cBlockEntityList & a_BlockEntities, cWorld * a_World);