123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #pragma once
- #include "BasicBlocks.h"
- class Chest : public BasicBlock
- {
- private:
- bool open;
- int userEntityId;
- virtual void onDestroy() override;
- virtual void onDialogClosed(Framework::Text dialogId) override;
- Framework::Text getDialogId() const;
- protected:
- virtual bool onTick(
- TickQueue* zQueue, int numTicks, bool& blocked) override;
- public:
- Chest(int typeId, Framework::Vec3<int> pos, int dimensionId);
- virtual bool interact(Item* zItem, Entity* zActor) override;
- virtual void sendModelInfo(NetworkMessage* zMessage) override;
- };
- class ChestBlockType : public BasicBlockType
- {
- public:
- ChestBlockType();
- virtual Block* createBlock(
- Framework::Vec3<int> position, int dimensionId) const override;
- };
- class ChestBlockTypeFactory : public SubTypeFactory<BlockType, ChestBlockType>
- {
- BasicBlockTypeFactory super;
- public:
- ChestBlockTypeFactory();
- ChestBlockType* createValue(
- Framework::JSON::JSONObject* zJson) const override;
- void fromJson(ChestBlockType* zResult,
- Framework::JSON::JSONObject* zJson) const override;
- void toJson(ChestBlockType* zObject,
- Framework::JSON::JSONObject* zResult) const override;
- JSONObjectValidationBuilder* addToValidator(
- JSONObjectValidationBuilder* builder) const override;
- Framework::Text getTypeToken() const override;
- };
|