From a6e725497af0b2227e6f80d4650ffb612cdce0bc Mon Sep 17 00:00:00 2001 From: Brianna Date: Tue, 15 Dec 2020 09:59:35 -0600 Subject: [PATCH] Added the ability to specify an amount for getItem. --- .../songoda/core/compatibility/CompatibleMaterial.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Core/src/main/java/com/songoda/core/compatibility/CompatibleMaterial.java b/Core/src/main/java/com/songoda/core/compatibility/CompatibleMaterial.java index 6c09b892..da7c8614 100644 --- a/Core/src/main/java/com/songoda/core/compatibility/CompatibleMaterial.java +++ b/Core/src/main/java/com/songoda/core/compatibility/CompatibleMaterial.java @@ -1250,10 +1250,18 @@ public enum CompatibleMaterial { * @return an item that resembles this material for the current server version */ public ItemStack getItem() { + return getItem(1); + } + + /** + * @param amount the amount to return + * @return an item that resembles this material for the current server version + */ + public ItemStack getItem(int amount) { if (usesCompatibility()) { return compatibleMaterial.getItem(); } - return data != null ? new ItemStack(material, 1, data) : new ItemStack(material); + return data != null ? new ItemStack(material, amount, data) : new ItemStack(material); } /**