aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/Material.h
blob: 6e0571cf940168216f720d1fc376a0e8ab963c2f (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
88
89
90
91
92
#pragma once
#include "MaterialColor.h"

class ChunkRebuildData;

class Material
{
	friend class ChunkRebuildData;
public:
	static Material *air;
	static Material *grass;
	static Material *dirt;
	static Material *wood;
	static Material *stone;
	static Material *metal;
	static Material *heavyMetal;
	static Material *water;
	static Material *lava;
	static Material *leaves;
	static Material *plant;
	static Material *replaceable_plant;
	static Material *sponge;
	static Material *cloth;
	static Material *fire;
	static Material *sand;
	static Material *decoration;
	static Material *clothDecoration;
	static Material *glass;
	static Material *buildable_glass;
	static Material *explosive;
	static Material *coral;
	static Material *ice;
	static Material *topSnow;
	static Material *snow;
	static Material *cactus;
	static Material *clay;
	static Material *vegetable;
	static Material *egg;
	static Material *portal;
	static Material *cake;
	static Material *web;
	static Material *piston;

	static const int PUSH_NORMAL = 0;
	static const int PUSH_DESTROY = 1;
	static const int PUSH_BLOCK = 2;		// not pushable

	static void staticCtor();

private:
    bool _flammable, _replaceable, _neverBuildable;

public:
	MaterialColor *color;
private:
	bool _isAlwaysDestroyable;
	int pushReaction;
	bool destroyedByHand;
public:

    Material(MaterialColor *color);
    virtual bool isLiquid() ;
    virtual bool letsWaterThrough();
    virtual bool isSolid();
    virtual bool blocksLight();
    virtual bool blocksMotion();

private:
    virtual Material *neverBuildable();
protected:
	virtual Material *notAlwaysDestroyable();
    virtual Material *flammable();

public:
	virtual bool isFlammable();
	virtual Material *replaceable();
	virtual bool isReplaceable();
	virtual bool isSolidBlocking();
	virtual bool isAlwaysDestroyable();
	virtual int getPushReaction();
	
protected:
	Material *makeDestroyedByHand();

public:
	bool isDestroyedByHand();

protected:
	Material *destroyOnPush();
	Material *notPushable();
};