From b777375493a743a30e5dd966f7fa487305d94f33 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Fri, 6 Dec 2019 17:51:56 +1300 Subject: [PATCH] Add simple material constructor to MiscDisguise for falling blocks and item disguises --- .../disguise/disguisetypes/MiscDisguise.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/MiscDisguise.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/MiscDisguise.java index 84888385..135947cc 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/MiscDisguise.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/MiscDisguise.java @@ -34,6 +34,17 @@ public class MiscDisguise extends TargetedDisguise { apply(0, itemStack); } + public MiscDisguise(DisguiseType disguiseType, Material material) { + super(disguiseType); + + if (disguiseType != DisguiseType.FALLING_BLOCK && disguiseType != DisguiseType.DROPPED_ITEM) { + throw new IllegalArgumentException( + "This constructor requires a DROPPED_ITEM or FALLING_BLOCK disguise type!"); + } + + apply(0, new ItemStack(material)); + } + public MiscDisguise(DisguiseType disguiseType, int id) { this(disguiseType, id, disguiseType.getDefaultData()); }