This commit is contained in:
GabsPuNs
2026-05-14 21:52:21 -04:00
parent 1b2f5c6fe8
commit f8a2d644f5
291 changed files with 7363 additions and 18368 deletions

View File

@@ -119,37 +119,11 @@ int DoorTile::getDir(LevelSource *level, int x, int y, int z)
return getCompositeData(level, x, y, z) & C_DIR_MASK;
}
int DoorTile::getItem()
{
switch(id)
{
case Tile::door_iron_Id:
return Item::door_iron_Id;
case Tile::door_spruce_Id:
return Item::door_spruce_Id;
case Tile::door_birch_Id:
return Item::door_birch_Id;
case Tile::door_jungle_Id:
return Item::door_jungle_Id;
case Tile::door_acacia_Id:
return Item::door_acacia_Id;
case Tile::door_dark_oak_Id:
return Item::door_dark_oak_Id;
default:
return Item::door_wood_Id;
}
}
bool DoorTile::isOpen(LevelSource *level, int x, int y, int z)
{
return (getCompositeData(level, x, y, z) & C_OPEN_MASK) != 0;
}
bool DoorTile::isDoor(int t)
{
return (t == Tile::door_wood_Id) || (t >= Tile::door_spruce_Id && t <= Tile::door_dark_oak_Id);
}
void DoorTile::setShape(int compositeData)
{
float r = 3 / 16.0f;
@@ -205,7 +179,7 @@ void DoorTile::attack(Level *level, int x, int y, int z, shared_ptr<Player> play
// 4J-PB - Adding a TestUse for tooltip display
bool DoorTile::TestUse()
{
return isDoor(id);
return id == Tile::door_wood_Id;
}
bool DoorTile::use(Level *level, int x, int y, int z, shared_ptr<Player> player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param
@@ -314,7 +288,8 @@ void DoorTile::neighborChanged(Level *level, int x, int y, int z, int type)
int DoorTile::getResource(int data, Random *random, int playerBonusLevel)
{
if ((data & 8) != 0) return 0;
return getItem();
if (material == Material::metal) return Item::door_iron->id;
return Item::door_wood->id;
}
HitResult *DoorTile::clip(Level *level, int xt, int yt, int zt, Vec3 *a, Vec3 *b)
@@ -364,7 +339,7 @@ int DoorTile::getCompositeData(LevelSource *level, int x, int y, int z)
int DoorTile::cloneTileId(Level *level, int x, int y, int z)
{
return getItem();
return material == Material::metal ? Item::door_iron_Id : Item::door_wood_Id;
}
void DoorTile::playerWillDestroy(Level *level, int x, int y, int z, int data, shared_ptr<Player> player)