aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/TrapDoorTile.h
blob: 19cec1505768b19daa17217cf6d1b5e102617978 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#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 int getTexture(int face, int data) { if (face == 0 || face == 1)
 * return tex; int dir = getDir(data); if ((dir == 0 || dir == 2) ^ (face <= 3))
 * { return tex; } int tt = (dir / 2 + ((face & 1) ^ dir)); tt += ((data & 4) /
 * 4); int texture = tex - (data & 8) * 2; if ((tt & 1) != 0) { texture =
 * -texture; } // if (getDir(data)==0 // tt-=((face+data&3)&1)^((data&4)>>2);
 * return texture; }
 */

public:
	bool blocksLight();

public:
	bool isSolidRender(bool isServerLevel = false);

public:
	bool isCubeShaped();
	bool isPathfindable(LevelSource *level, int x, int y, int z);

public:
	int getRenderShape();

public:
	AABB *getTileAABB(Level *level, int x, int y, int z);

public:
	AABB *getAABB(Level *level, int x, int y, int z);

public:
	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

public:
	void updateDefaultShape();

public:
	using Tile::setShape;
	void setShape(int data);

public:
	void attack(Level *level, int x, int y, int z, shared_ptr<Player> player);

public:
	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

public:
	void setOpen(Level *level, int x, int y, int z, bool shouldOpen);


public:
	void neighborChanged(Level *level, int x, int y, int z, int type);


public:
	HitResult *clip(Level *level, int xt, int yt, int zt, Vec3 *a, Vec3 *b);

public:
	int getDir(int dir);

public:
	int getPlacedOnFaceDataValue(Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, int itemValue);

public:
	bool mayPlace(Level *level, int x, int y, int z, int face);

public:
	static bool isOpen(int data);

private:
	static bool attachesTo(int id);
};