the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 46 lines 1.1 kB view raw
1#pragma once 2 3#include "Packet.h" 4 5class AttributeModifier; 6class AttributeInstance; 7 8class UpdateAttributesPacket : public Packet, public enable_shared_from_this<UpdateAttributesPacket> 9{ 10public: 11 class AttributeSnapshot 12 { 13 private: 14 eATTRIBUTE_ID id; 15 double base; 16 unordered_set<AttributeModifier *> modifiers; 17 18 public: 19 AttributeSnapshot(eATTRIBUTE_ID id, double base, unordered_set<AttributeModifier *> *modifiers); 20 ~AttributeSnapshot(); 21 22 eATTRIBUTE_ID getId(); 23 double getBase(); 24 unordered_set<AttributeModifier *> *getModifiers(); 25 }; 26 27private: 28 int entityId; 29 unordered_set<AttributeSnapshot *> attributes; 30 31public: 32 UpdateAttributesPacket(); 33 UpdateAttributesPacket(int entityId, unordered_set<AttributeInstance *> *values); 34 ~UpdateAttributesPacket(); 35 36 void read(DataInputStream *dis); 37 void write(DataOutputStream *dos); 38 void handle(PacketListener *listener); 39 int getEstimatedSize(); 40 int getEntityId(); 41 unordered_set<AttributeSnapshot *> getValues(); 42 43public: 44 static shared_ptr<Packet> create() { return shared_ptr<Packet>(new UpdateAttributesPacket()); } 45 virtual int getId() { return 44; } 46};