aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/LadderTile.cpp
diff options
context:
space:
mode:
authordaoge <3523206925@qq.com>2026-03-03 03:04:10 +0800
committerGitHub <noreply@github.com>2026-03-03 03:04:10 +0800
commitb3feddfef372618c8a9d7a0abcaf18cfad866c18 (patch)
tree267761c3bb39241ba5c347bfbe2254d06686e287 /Minecraft.World/LadderTile.cpp
parent84c31a2331f7a0ec85b9d438992e244f60e5020f (diff)
feat: TU19 (Dec 2014) Features & Content (#155)
* try to resolve merge conflict * feat: TU19 (Dec 2014) Features & Content (#32) * December 2014 files * Working release build * Fix compilation issues * Add sound to Windows64Media * Add DLC content and force Tutorial DLC * Revert "Add DLC content and force Tutorial DLC" This reverts commit 97a43994725008e35fceb984d5549df9c8cea470. * Disable broken light packing * Disable breakpoint during DLC texture map load Allows DLC loading but the DLC textures are still broken * Fix post build not working * ... * fix vs2022 build * fix cmake build --------- Co-authored-by: Loki <lokirautio@gmail.com>
Diffstat (limited to 'Minecraft.World/LadderTile.cpp')
-rw-r--r--Minecraft.World/LadderTile.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/Minecraft.World/LadderTile.cpp b/Minecraft.World/LadderTile.cpp
index 32f35ed8..438d2bbf 100644
--- a/Minecraft.World/LadderTile.cpp
+++ b/Minecraft.World/LadderTile.cpp
@@ -15,8 +15,8 @@ AABB *LadderTile::getAABB(Level *level, int x, int y, int z)
AABB *LadderTile::getTileAABB(Level *level, int x, int y, int z)
{
- updateShape(level, x, y, z);
- return Tile::getTileAABB(level, x, y, z);
+ updateShape(level, x, y, z);
+ return Tile::getTileAABB(level, x, y, z);
}
void LadderTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr<TileEntity> forceEntity) // 4J added forceData, forceEntity param
@@ -57,53 +57,53 @@ int LadderTile::getRenderShape()
bool LadderTile::mayPlace(Level *level, int x, int y, int z)
{
- if (level->isSolidBlockingTile(x - 1, y, z))
+ if (level->isSolidBlockingTile(x - 1, y, z))
{
- return true;
- }
+ return true;
+ }
else if (level->isSolidBlockingTile(x + 1, y, z))
{
- return true;
+ return true;
}
else if (level->isSolidBlockingTile(x, y, z - 1))
{
- return true;
- }
+ return true;
+ }
else if (level->isSolidBlockingTile(x, y, z + 1))
{
- return true;
- }
- return false;
+ return true;
+ }
+ return false;
}
int LadderTile::getPlacedOnFaceDataValue(Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, int itemValue)
{
- int dir = level->getData(x, y, z);
+ int dir = level->getData(x, y, z);
- if ((dir == 0 || face == 2) && level->isSolidBlockingTile(x, y, z + 1)) dir = 2;
- if ((dir == 0 || face == 3) && level->isSolidBlockingTile(x, y, z - 1)) dir = 3;
- if ((dir == 0 || face == 4) && level->isSolidBlockingTile(x + 1, y, z)) dir = 4;
- if ((dir == 0 || face == 5) && level->isSolidBlockingTile(x - 1, y, z)) dir = 5;
+ if ((dir == 0 || face == 2) && level->isSolidBlockingTile(x, y, z + 1)) dir = 2;
+ if ((dir == 0 || face == 3) && level->isSolidBlockingTile(x, y, z - 1)) dir = 3;
+ if ((dir == 0 || face == 4) && level->isSolidBlockingTile(x + 1, y, z)) dir = 4;
+ if ((dir == 0 || face == 5) && level->isSolidBlockingTile(x - 1, y, z)) dir = 5;
- return dir;
+ return dir;
}
void LadderTile::neighborChanged(Level *level, int x, int y, int z, int type)
{
- int face = level->getData(x, y, z);
- bool ok = false;
-
- if (face == 2 && level->isSolidBlockingTile(x, y, z + 1)) ok = true;
- if (face == 3 && level->isSolidBlockingTile(x, y, z - 1)) ok = true;
- if (face == 4 && level->isSolidBlockingTile(x + 1, y, z)) ok = true;
- if (face == 5 && level->isSolidBlockingTile(x - 1, y, z)) ok = true;
- if (!ok)
+ int face = level->getData(x, y, z);
+ bool ok = false;
+
+ if (face == 2 && level->isSolidBlockingTile(x, y, z + 1)) ok = true;
+ if (face == 3 && level->isSolidBlockingTile(x, y, z - 1)) ok = true;
+ if (face == 4 && level->isSolidBlockingTile(x + 1, y, z)) ok = true;
+ if (face == 5 && level->isSolidBlockingTile(x - 1, y, z)) ok = true;
+ if (!ok)
{
- spawnResources(level, x, y, z, face, 0);
- level->setTile(x, y, z, 0);
- }
+ spawnResources(level, x, y, z, face, 0);
+ level->removeTile(x, y, z);
+ }
- Tile::neighborChanged(level, x, y, z, type);
+ Tile::neighborChanged(level, x, y, z, type);
}
int LadderTile::getResourceCount(Random* random)