aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Material_SPU.h
blob: e7cf34b85a4c42d2b840b0ac4a295f10c2cbf097 (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
#pragma once

#include <stdint.h>

class ChunkRebuildData;
class Material_SPU
{
	friend class ChunkRebuildData;
public:
	static const int air_Id = 0;
	static const int grass_Id = 1;
	static const int dirt_Id = 2;
	static const int wood_Id = 3;
	static const int stone_Id = 4;
	static const int metal_Id = 5;
	static const int water_Id = 6;
	static const int lava_Id = 7;
	static const int leaves_Id = 8;
	static const int plant_Id = 9;
	static const int replaceable_plant_Id = 10;
	static const int sponge_Id = 11;
	static const int cloth_Id = 12;
	static const int fire_Id = 13;
	static const int sand_Id = 14;
	static const int decoration_Id = 15;
	static const int glass_Id = 16;
	static const int explosive_Id = 17;
	static const int coral_Id = 18;
	static const int ice_Id = 19;
	static const int topSnow_Id = 20;
	static const int snow_Id = 21;
	static const int cactus_Id = 22;
	static const int clay_Id = 23;
	static const int vegetable_Id = 24;
	static const int egg_Id = 25;
	static const int portal_Id = 26;
	static const int cake_Id = 27;
	static const int web_Id = 28;
	static const int piston_Id = 29;
	static const int buildable_glass_Id = 30;
	static const int heavyMetal_Id = 31;
	static const int clothDecoration_Id = 32;
	static const int num_Ids = 32;

	enum Flags
	{
		e_flammable = 0x01,
		e_replaceable = 0x02,
		e_neverBuildable = 0x04,
		e_isSolid = 0x08,
		e_isLiquid = 0x10, 
		e_blocksLight = 0x20,
		e_blocksMotion = 0x40
	};

private:
	uint16_t id;
	uint16_t flags;

public:
	int color;

public:
	int getID() { return id;}
	bool isLiquid() { return (flags & e_isLiquid) != 0; }
	bool letsWaterThrough() { return (!isLiquid() && !isSolid()); }
    bool isSolid() { return (flags & e_isSolid) != 0;}
    bool blocksLight() { return (flags & e_blocksLight) != 0; }
    bool blocksMotion() { return (flags & e_blocksMotion) != 0; }
	bool isFlammable() { return (flags & e_flammable) != 0; }
	bool isReplaceable(){ return (flags & e_replaceable) != 0; }
	bool isSolidBlocking(){   if (flags & e_neverBuildable) return false;	return blocksMotion(); }
};