Add simple material constructor to MiscDisguise for falling blocks and item disguises

This commit is contained in:
libraryaddict 2019-12-06 17:51:56 +13:00
parent c5cad96118
commit b777375493

View File

@ -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());
}