the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at master 75 lines 1.9 kB view raw
1#pragma once 2#include "TileEntity.h" 3#include "Container.h" 4 5class BeaconTileEntity : public TileEntity, public Container 6{ 7public: 8 eINSTANCEOF GetType() { return eTYPE_BEACONTILEENTITY; } 9 static TileEntity *create() { return new BeaconTileEntity(); } 10 // 4J Added 11 virtual shared_ptr<TileEntity> clone(); 12 13private: 14 static const int SCALE_TIME = SharedConstants::TICKS_PER_SECOND * 2; 15 16public: 17 static const int BEACON_EFFECTS_TIERS = 4; 18 static const int BEACON_EFFECTS_EFFECTS = 3; 19 static MobEffect *BEACON_EFFECTS[BEACON_EFFECTS_TIERS][BEACON_EFFECTS_EFFECTS]; 20 21 static void staticCtor(); 22 23private: 24 __int64 clientSideRenderTick; 25 float clientSideRenderScale; 26 27 bool isActive; 28 int levels; 29 30 int primaryPower; 31 int secondaryPower; 32 33 shared_ptr<ItemInstance> paymentItem; 34 wstring name; 35 36public: 37 BeaconTileEntity(); 38 39 void tick(); 40 41private: 42 void applyEffects(); 43 void updateShape(); 44 45public: 46 float getAndUpdateClientSideScale(); 47 int getPrimaryPower(); 48 int getSecondaryPower(); 49 int getLevels(); 50 // client-side method used by GUI 51 void setLevels(int levels); 52 void setPrimaryPower(int primaryPower); 53 void setSecondaryPower(int secondaryPower); 54 shared_ptr<Packet> getUpdatePacket(); 55 double getViewDistance(); 56 void load(CompoundTag *tag); 57 void save(CompoundTag *tag); 58 unsigned int getContainerSize(); 59 shared_ptr<ItemInstance> getItem(unsigned int slot); 60 shared_ptr<ItemInstance> removeItem(unsigned int slot, int count); 61 shared_ptr<ItemInstance> removeItemNoUpdate(int slot); 62 void setItem(unsigned int slot, shared_ptr<ItemInstance> item); 63 wstring getName(); 64 wstring getCustomName(); 65 bool hasCustomName(); 66 void setCustomName(const wstring &name); 67 int getMaxStackSize() const; 68 bool stillValid(shared_ptr<Player> player); 69 void startOpen(); 70 void stopOpen(); 71 bool canPlaceItem(int slot, shared_ptr<ItemInstance> item); 72 73 // 4J Stu - For container 74 virtual void setChanged() { TileEntity::setChanged(); } 75};