diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
| commit | b691c43c44ff180d10e7d4a9afc83b98551ff586 (patch) | |
| tree | 3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/Material.h | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.World/Material.h')
| -rw-r--r-- | Minecraft.World/Material.h | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/Minecraft.World/Material.h b/Minecraft.World/Material.h new file mode 100644 index 00000000..6e0571cf --- /dev/null +++ b/Minecraft.World/Material.h @@ -0,0 +1,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(); +}; + |
