Files
2026-05-14 19:16:33 -04:00

53 lines
1.5 KiB
C++

#pragma once
#include "Tile.h"
class Player;
class HitResult;
class TrapDoorTile : public Tile
{
friend class Tile;
private:
static const int TOP_MASK = 0x8;
protected:
TrapDoorTile(int id, Material *material);
public:
bool blocksLight();
bool isSolidRender(bool isServerLevel = false);
bool isCubeShaped();
bool isPathfindable(LevelSource *level, int x, int y, int z);
int getRenderShape();
AABB *getTileAABB(Level *level, int x, int y, int z);
AABB *getAABB(Level *level, int x, int y, int z);
void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr<TileEntity> forceEntity = shared_ptr<TileEntity>()); // 4J added forceData, forceEntity param
void updateDefaultShape();
using Tile::setShape;
void setShape(int data);
static bool isTrapDoor(int tile);
virtual bool TestUse();
bool 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
void setOpen(Level *level, int x, int y, int z, bool shouldOpen);
void neighborChanged(Level *level, int x, int y, int z, int type);
HitResult *clip(Level *level, int xt, int yt, int zt, Vec3 *a, Vec3 *b);
int getDir(int dir);
int getPlacedOnFaceDataValue(Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, int itemValue);
bool mayPlace(Level *level, int x, int y, int z, int face);
static bool isOpen(int data);
private:
static bool attachesTo(int id);
};