summaryrefslogtreecommitdiffstats
path: root/src/Item.h
diff options
context:
space:
mode:
authorKingCol13 <48412633+KingCol13@users.noreply.github.com>2020-09-28 14:41:49 +0200
committerGitHub <noreply@github.com>2020-09-28 14:41:49 +0200
commit8eca58a1c9d3ea928b301de1ad772a46164372e1 (patch)
tree9627cfb9c43ed9b332a493c474e7ebe119543b89 /src/Item.h
parentEnchanting consumes lapis, removes correct number of levels (#4934) (diff)
downloadcuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar
cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar.gz
cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar.bz2
cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar.lz
cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar.xz
cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar.zst
cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.zip
Diffstat (limited to 'src/Item.h')
-rw-r--r--src/Item.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Item.h b/src/Item.h
index 2f7b1a238..d3f853170 100644
--- a/src/Item.h
+++ b/src/Item.h
@@ -230,6 +230,8 @@ public:
cItem * Get (int a_Idx);
void Set (int a_Idx, const cItem & a_Item);
void Add (const cItem & a_Item) {push_back(a_Item); }
+ void Add (short a_ItemType) { emplace_back(a_ItemType); }
+ void Add (short a_ItemType, char a_ItemCount) { emplace_back(a_ItemType, a_ItemCount); }
void Delete(int a_Idx);
void Clear (void) {clear(); }
size_t Size (void) const { return size(); }
@@ -239,7 +241,7 @@ public:
void Add (short a_ItemType, char a_ItemCount, short a_ItemDamage)
{
- push_back(cItem(a_ItemType, a_ItemCount, a_ItemDamage));
+ emplace_back(a_ItemType, a_ItemCount, a_ItemDamage);
}
/** Adds a copy of all items in a_ItemGrid. */