From 8eca58a1c9d3ea928b301de1ad772a46164372e1 Mon Sep 17 00:00:00 2001 From: KingCol13 <48412633+KingCol13@users.noreply.github.com> Date: Mon, 28 Sep 2020 13:41:49 +0100 Subject: Fortune Drops (#4932) + Implemented and standardized all clamped discrete random drops. + Changed cItems Add from push_back to emplace_back. Implement fortune for crops. + Enabled hoes to be enchanted with efficiency, silk touch and fortune. Made leaves, gravel and crops affected by fortune. Co-authored-by: Tiger Wang --- src/Item.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Item.h') 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. */ -- cgit v1.2.3