Added features from TU25

Acacia and Dark Oak Logs, Planks and Stairs.

Fences, Fence Gates and Doors for Spruce/Birch/Jungle/Acacia/Dark Oak.

Iron Trapdoors and Inverted Daylight Sensor.
This commit is contained in:
piebot
2026-03-11 08:58:52 +03:00
parent a195ac7172
commit a205b1d70a
29 changed files with 531 additions and 196 deletions
+9 -3
View File
@@ -12,9 +12,10 @@ using namespace std;
#include "GenericStats.h"
#include "DoorItem.h"
DoorItem::DoorItem(int id, Material *material) : Item(id)
DoorItem::DoorItem(int id, Material *material, const wstring& doorType) : Item(id)
{
this->material = material;
this->doorType = doorType;
maxStackSize = 1;
}
@@ -25,8 +26,13 @@ bool DoorItem::useOn(shared_ptr<ItemInstance> instance, shared_ptr<Player> playe
Tile *tile;
if (material == Material::wood) tile = Tile::door_wood;
else tile = Tile::door_iron;
if (doorType == L"doorWood") tile = Tile::door_wood;
else if (doorType == L"doorIron") tile = Tile::door_iron;
else if (doorType == L"doorSpruce") tile = Tile::door_spruce;
else if (doorType == L"doorBirch") tile = Tile::door_birch;
else if (doorType == L"doorJungle") tile = Tile::door_jungle;
else if (doorType == L"doorAcacia") tile = Tile::door_acacia;
else if (doorType == L"doorDark") tile = Tile::door_dark;
if (!player->mayUseItemAt(x, y, z, face, instance) || !player->mayUseItemAt(x, y + 1, z, face, instance)) return false;
if (!tile->mayPlace(level, x, y, z)) return false;