12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #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 BasicBlockTypeFactory
- {
- public:
- ChestBlockTypeFactory();
- BasicBlockType* createValue(
- Framework::JSON::JSONObject* zJson) const override;
- BasicBlockType* fromJson(Framework::JSON::JSONObject* zJson) const override;
- Framework::JSON::JSONObject* toJsonObject(
- BasicBlockType* zObject) const override;
- JSONObjectValidationBuilder* addToValidator(
- JSONObjectValidationBuilder* builder) const override;
- const char* getTypeToken() const override;
- const char* getTypeName() const;
- };
|