123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- #pragma once
- #include "Block.h"
- #include "BlockType.h"
- #include "Item.h"
- class BlockType;
- class ItemType;
- class BasicBlockType;
- class BasicBlock : public Block
- {
- public:
- BasicBlock(
- int typeId, ItemType* zTool, Framework::Vec3<int> pos, int dimensionId);
- BasicBlock(int typeId,
- ItemType* zTool,
- Framework::Vec3<int> pos,
- int dimensionId,
- bool hasInventory);
- virtual bool onTick(
- TickQueue* zQueue, int numTicks, bool& blocked) override;
- virtual void onPostTick() override;
- friend BasicBlockType;
- };
- struct SpawnConfig
- {
- int min;
- int max;
- double chance;
- int itemType;
- };
- class AdditionalItemSpawningBlock : public BasicBlock
- {
- private:
- Framework::Array<SpawnConfig> spawns;
- public:
- AdditionalItemSpawningBlock(
- int typeId, ItemType* zTool, Framework::Vec3<int> pos, int dimensionId);
- void addSpawn(SpawnConfig config);
- virtual void onDestroy() override;
- };
- class BasicBlockType : public BlockType
- {
- private:
- int itemType;
- bool transparent;
- bool passable;
- float hardness;
- ItemType* zTool;
- float speedModifier;
- bool interactable;
- std::function<Block*(Framework::Vec3<int>, int)> creatBlockCustom;
- protected:
- virtual void createSuperBlock(Block* zBlock, Item* zItem) const override;
- public:
- BasicBlockType(int typeId,
- int itemTypeId,
- ModelInfo model,
- const char* name,
- int mapColor);
- BasicBlockType(int typeId,
- int itemTypeId,
- ModelInfo model,
- std::function<Block*(Framework::Vec3<int>, int)> creatBlockCustom,
- const char* name,
- int mapColor);
- BasicBlockType(int typeId,
- int itemTypeId,
- ModelInfo model,
- std::function<Block*(Framework::Vec3<int>, int)> creatBlockCustom,
- const char* name,
- int mapColor,
- bool modelSubscription);
- virtual Block* createBlock(
- Framework::Vec3<int> position, int dimensionId) const override;
- virtual Item* createItem() const override;
- BasicBlockType* setHardness(float hardness);
- BasicBlockType* setTransparent(bool transparent);
- };
|