mirror of
https://github.com/TotalFreedomMC/TF-LibsDisguises.git
synced 2025-02-11 19:50:30 +00:00
Add simple material constructor to MiscDisguise for falling blocks and item disguises
This commit is contained in:
parent
c5cad96118
commit
b777375493
1 changed files with 11 additions and 0 deletions
|
@ -34,6 +34,17 @@ public class MiscDisguise extends TargetedDisguise {
|
||||||
apply(0, itemStack);
|
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) {
|
public MiscDisguise(DisguiseType disguiseType, int id) {
|
||||||
this(disguiseType, id, disguiseType.getDefaultData());
|
this(disguiseType, id, disguiseType.getDefaultData());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue