the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at master 74 lines 2.1 kB view raw
1#pragma once 2 3#include <stdint.h> 4 5class ChunkRebuildData; 6class Material_SPU 7{ 8 friend class ChunkRebuildData; 9public: 10 static const int air_Id = 0; 11 static const int grass_Id = 1; 12 static const int dirt_Id = 2; 13 static const int wood_Id = 3; 14 static const int stone_Id = 4; 15 static const int metal_Id = 5; 16 static const int water_Id = 6; 17 static const int lava_Id = 7; 18 static const int leaves_Id = 8; 19 static const int plant_Id = 9; 20 static const int replaceable_plant_Id = 10; 21 static const int sponge_Id = 11; 22 static const int cloth_Id = 12; 23 static const int fire_Id = 13; 24 static const int sand_Id = 14; 25 static const int decoration_Id = 15; 26 static const int glass_Id = 16; 27 static const int explosive_Id = 17; 28 static const int coral_Id = 18; 29 static const int ice_Id = 19; 30 static const int topSnow_Id = 20; 31 static const int snow_Id = 21; 32 static const int cactus_Id = 22; 33 static const int clay_Id = 23; 34 static const int vegetable_Id = 24; 35 static const int egg_Id = 25; 36 static const int portal_Id = 26; 37 static const int cake_Id = 27; 38 static const int web_Id = 28; 39 static const int piston_Id = 29; 40 static const int buildable_glass_Id = 30; 41 static const int heavyMetal_Id = 31; 42 static const int clothDecoration_Id = 32; 43 static const int num_Ids = 32; 44 45 enum Flags 46 { 47 e_flammable = 0x01, 48 e_replaceable = 0x02, 49 e_neverBuildable = 0x04, 50 e_isSolid = 0x08, 51 e_isLiquid = 0x10, 52 e_blocksLight = 0x20, 53 e_blocksMotion = 0x40 54 }; 55 56private: 57 uint16_t id; 58 uint16_t flags; 59 60public: 61 int color; 62 63public: 64 int getID() { return id;} 65 bool isLiquid() { return (flags & e_isLiquid) != 0; } 66 bool letsWaterThrough() { return (!isLiquid() && !isSolid()); } 67 bool isSolid() { return (flags & e_isSolid) != 0;} 68 bool blocksLight() { return (flags & e_blocksLight) != 0; } 69 bool blocksMotion() { return (flags & e_blocksMotion) != 0; } 70 bool isFlammable() { return (flags & e_flammable) != 0; } 71 bool isReplaceable(){ return (flags & e_replaceable) != 0; } 72 bool isSolidBlocking(){ if (flags & e_neverBuildable) return false; return blocksMotion(); } 73}; 74