aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/StairTile.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/StairTile.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/StairTile.cpp')
-rw-r--r--Minecraft.World/StairTile.cpp63
1 files changed, 12 insertions, 51 deletions
diff --git a/Minecraft.World/StairTile.cpp b/Minecraft.World/StairTile.cpp
index 7a80e9ff..de2cc865 100644
--- a/Minecraft.World/StairTile.cpp
+++ b/Minecraft.World/StairTile.cpp
@@ -6,9 +6,9 @@
#include "StairTile.h"
int StairTile::DEAD_SPACES[8][2] = {
- {2, 6}, {3, 7}, {2, 3}, {6, 7},
- {0, 4}, {1, 5}, {0, 1}, {4, 5}
- };
+ {2, 6}, {3, 7}, {2, 3}, {6, 7},
+ {0, 4}, {1, 5}, {0, 1}, {4, 5}
+};
StairTile::StairTile(int id, Tile *base,int basedata) : Tile(id, base->material, isSolidRender())
{
@@ -325,45 +325,6 @@ void StairTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList
}
}
- //int data = level->getData(x, y, z);
- //int dir = data & 0x3;
- //float lowerPieceY0 = 0;
- //float lowerPieceY1 = 0.5f;
- //float upperPieceY0 = 0.5f;
- //float upperPieceY1 = 1;
-
- //if ((data & UPSIDEDOWN_BIT) != 0)
- //{
- // lowerPieceY0 = .5f;
- // lowerPieceY1 = 1;
- // upperPieceY0 = 0;
- // upperPieceY1 = .5f;
- //}
-
- //setShape(0, lowerPieceY0, 0, 1, lowerPieceY1, 1);
- //Tile::addAABBs(level, x, y, z, box, boxes);
-
- //if (dir == 0)
- //{
- // setShape(0.5f, upperPieceY0, 0, 1, upperPieceY1, 1);
- // Tile::addAABBs(level, x, y, z, box, boxes);
- //}
- //else if (dir == 1)
- //{
- // setShape(0, upperPieceY0, 0, .5f, upperPieceY1, 1);
- // Tile::addAABBs(level, x, y, z, box, boxes);
- //}
- //else if (dir == 2)
- //{
- // setShape(0, upperPieceY0, 0.5f, 1, upperPieceY1, 1);
- // Tile::addAABBs(level, x, y, z, box, boxes);
- //}
- //else if (dir == 3)
- //{
- // setShape(0, upperPieceY0, 0, 1, upperPieceY1, .5f);
- // Tile::addAABBs(level, x, y, z, box, boxes);
- //}
-
setShape(0, 0, 0, 1, 1, 1);
}
@@ -416,9 +377,9 @@ Icon *StairTile::getTexture(int face, int data)
return base->getTexture(face, basedata);
}
-int StairTile::getTickDelay()
+int StairTile::getTickDelay(Level *level)
{
- return base->getTickDelay();
+ return base->getTickDelay(level);
}
AABB *StairTile::getTileAABB(Level *level, int x, int y, int z)
@@ -485,20 +446,20 @@ bool StairTile::use(Level *level, int x, int y, int z, shared_ptr<Player> player
return base->use(level, x, y, z, player, 0, 0, 0, 0);
}
-void StairTile::wasExploded(Level *level, int x, int y, int z)
+void StairTile::wasExploded(Level *level, int x, int y, int z, Explosion *explosion)
{
- base->wasExploded(level, x, y, z);
+ base->wasExploded(level, x, y, z, explosion);
}
-void StairTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr<Mob> by)
+void StairTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr<LivingEntity> by, shared_ptr<ItemInstance> itemInstance)
{
int dir = ( Mth::floor(by->yRot * 4 / (360) + 0.5) ) & 3;
int usd = level->getData(x, y, z) & UPSIDEDOWN_BIT;
- if (dir == 0) level->setData(x, y, z, DIR_SOUTH | usd);
- if (dir == 1) level->setData(x, y, z, DIR_WEST | usd);
- if (dir == 2) level->setData(x, y, z, DIR_NORTH | usd);
- if (dir == 3) level->setData(x, y, z, DIR_EAST | usd);
+ if (dir == 0) level->setData(x, y, z, DIR_SOUTH | usd, Tile::UPDATE_CLIENTS);
+ if (dir == 1) level->setData(x, y, z, DIR_WEST | usd, Tile::UPDATE_CLIENTS);
+ if (dir == 2) level->setData(x, y, z, DIR_NORTH | usd, Tile::UPDATE_CLIENTS);
+ if (dir == 3) level->setData(x, y, z, DIR_EAST | usd, Tile::UPDATE_CLIENTS);
}
int StairTile::getPlacedOnFaceDataValue(Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, int itemValue)