12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #pragma once
- #include "BasicBlocks.h"
- #include "Block.h"
- class GrassBlockType;
- class GrassBlock : public AdditionalItemSpawningBlock
- {
- public:
- GrassBlock(int typeId, Framework::Vec3<int> pos, int dimensionId);
- virtual bool onTick(
- TickQueue* zQueue, int numTicks, bool& blocked) override;
- virtual void onPostTick() override;
- void filterPassingLight(unsigned char rgb[3]) const override;
- friend GrassBlockType;
- };
- class GrassBlockType : public AdditionalItemSpawningBlockType
- {
- public:
- GrassBlockType(ModelInfo* model,
- Framework::Text name,
- int mapColor,
- Framework::Array<SpawnConfig> spawns,
- Framework::RCArray<Framework::Text> groupNames);
- protected:
- virtual void createSuperBlock(Block* zBlock, Item* zItem) const override;
- virtual void loadSuperBlock(Block* zBlock,
- Framework::StreamReader* zReader,
- int dimensionId) const override;
- virtual void saveSuperBlock(
- Block* zBlock, Framework::StreamWriter* zWriter) const override;
- virtual Item* createItem() const override;
- virtual Block* createBlock(
- Framework::Vec3<int> position, int dimensionId) const override;
- public:
- Framework::Text getItemTypeName() const;
- virtual ItemType* createItemType() const override;
- };
- class GrassBlockTypeFactory : public SubTypeFactory<BlockType, GrassBlockType>
- {
- public:
- GrassBlockTypeFactory();
- GrassBlockType* fromJson(Framework::JSON::JSONObject* zJson) const override;
- Framework::JSON::JSONObject* toJson(GrassBlockType* zObject) const override;
- Framework::JSON::Validator::JSONValidator* getValidator(
- Framework::JSON::Validator::ObjectValidationBuilder<
- Framework::JSON::Validator::JSONValidator>* builder) const override;
- Framework::Text getTypeToken() const override;
- };
|