Added disguise constructors using entitytype
This commit is contained in:
parent
0981a0a88a
commit
5375edc14c
@ -1,5 +1,7 @@
|
|||||||
package me.libraryaddict.disguise.DisguiseTypes;
|
package me.libraryaddict.disguise.DisguiseTypes;
|
||||||
|
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
|
||||||
public class MiscDisguise extends Disguise {
|
public class MiscDisguise extends Disguise {
|
||||||
private int data = -1;
|
private int data = -1;
|
||||||
private int id = -1;
|
private int id = -1;
|
||||||
@ -26,6 +28,28 @@ public class MiscDisguise extends Disguise {
|
|||||||
this(disguiseType, true, id, data);
|
this(disguiseType, true, id, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MiscDisguise(EntityType entityType) {
|
||||||
|
this(entityType, true, -1, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MiscDisguise(EntityType entityType, boolean replaceSounds) {
|
||||||
|
this(entityType, replaceSounds, -1, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MiscDisguise(EntityType entityType, boolean replaceSounds, int id, int data) {
|
||||||
|
super(DisguiseType.getType(entityType), replaceSounds);
|
||||||
|
if (id == -1)
|
||||||
|
id = DisguiseType.getType(entityType).getDefaultId();
|
||||||
|
if (data == -1)
|
||||||
|
data = DisguiseType.getType(entityType).getDefaultData();
|
||||||
|
this.id = id;
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MiscDisguise(EntityType disguiseType, int id, int data) {
|
||||||
|
this(disguiseType, true, id, data);
|
||||||
|
}
|
||||||
|
|
||||||
public MiscDisguise clone() {
|
public MiscDisguise clone() {
|
||||||
MiscDisguise disguise = new MiscDisguise(getType(), replaceSounds(), getId(), getData());
|
MiscDisguise disguise = new MiscDisguise(getType(), replaceSounds(), getId(), getData());
|
||||||
return disguise;
|
return disguise;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package me.libraryaddict.disguise.DisguiseTypes;
|
package me.libraryaddict.disguise.DisguiseTypes;
|
||||||
|
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
|
||||||
import me.libraryaddict.disguise.DisguiseTypes.Watchers.AgeableWatcher;
|
import me.libraryaddict.disguise.DisguiseTypes.Watchers.AgeableWatcher;
|
||||||
import me.libraryaddict.disguise.DisguiseTypes.Watchers.ZombieWatcher;
|
import me.libraryaddict.disguise.DisguiseTypes.Watchers.ZombieWatcher;
|
||||||
|
|
||||||
@ -20,6 +22,19 @@ public class MobDisguise extends Disguise {
|
|||||||
this.isAdult = isAdult;
|
this.isAdult = isAdult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MobDisguise(EntityType entityType) {
|
||||||
|
this(entityType, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MobDisguise(EntityType entityType, boolean isAdult) {
|
||||||
|
this(entityType, isAdult, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MobDisguise(EntityType entityType, boolean isAdult, boolean replaceSounds) {
|
||||||
|
super(DisguiseType.getType(entityType), replaceSounds);
|
||||||
|
this.isAdult = isAdult;
|
||||||
|
}
|
||||||
|
|
||||||
public MobDisguise clone() {
|
public MobDisguise clone() {
|
||||||
MobDisguise disguise = new MobDisguise(getType(), isAdult(), replaceSounds());
|
MobDisguise disguise = new MobDisguise(getType(), isAdult(), replaceSounds());
|
||||||
return disguise;
|
return disguise;
|
||||||
|
Loading…
Reference in New Issue
Block a user