fix
This commit is contained in:
@@ -51,6 +51,7 @@ std::shared_ptr<Inventory> Inventories::clone(int64_t id) {
|
||||
auto origptr = reinterpret_cast<const Inventory*>(original.get());
|
||||
auto clone = std::make_shared<Inventory>(*origptr);
|
||||
clone->setId(level.getWorld()->getNextInventoryId());
|
||||
store(clone);
|
||||
return clone;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
Inventory::Inventory(int64_t id, size_t size) : id(id), slots(size) {
|
||||
}
|
||||
|
||||
Inventory::Inventory(const Inventory& orig) {
|
||||
this->slots = orig.slots;
|
||||
}
|
||||
|
||||
ItemStack& Inventory::getSlot(size_t index) {
|
||||
return slots.at(index);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@ class Inventory : public Serializable {
|
||||
public:
|
||||
Inventory(int64_t id, size_t size);
|
||||
|
||||
Inventory(const Inventory& orig);
|
||||
|
||||
ItemStack& getSlot(size_t index);
|
||||
size_t findEmptySlot(size_t begin=0, size_t end=-1) const;
|
||||
size_t findSlotByItem(itemid_t id, size_t begin=0, size_t end=-1);
|
||||
|
||||
Reference in New Issue
Block a user