123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #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;
- virtual TickSourceType isTickSource() const override;
- friend GrassBlockType;
- };
- class GrassBlockType : public AdditionalItemSpawningBlockType
- {
- public:
- GrassBlockType();
- 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:
- virtual ItemType* createItemType() const override;
- };
- class GrassBlockTypeFactory : public SubTypeFactory<BlockType, GrassBlockType>
- {
- private:
- AdditionalItemSpawningBlockTypeFactory super;
- public:
- GrassBlockTypeFactory();
- GrassBlockType* createValue(
- Framework::JSON::JSONObject* zJson) const override;
- void fromJson(GrassBlockType* zResult,
- Framework::JSON::JSONObject* zJson) const override;
- void toJson(GrassBlockType* zObject,
- Framework::JSON::JSONObject* zResult) const override;
- JSONObjectValidationBuilder* addToValidator(
- JSONObjectValidationBuilder* builder) const override;
- Framework::Text getTypeToken() const override;
- };
|