Sort by name

This commit is contained in:
Andrew 2013-07-29 11:19:59 +12:00
parent 293b4f7de1
commit 53b5be001d
6 changed files with 60 additions and 60 deletions

View File

@ -153,30 +153,6 @@ public enum DisguiseSound {
return cancelSounds;
}
public void setSound(SoundType type, Sound sound) {
setSound(type, CraftSound.getSound(sound));
}
public void setSound(SoundType type, String sound) {
if (type == SoundType.CANCEL)
cancelSounds.add(sound);
else {
disguiseSounds.put(type, sound);
}
}
public void removeSound(SoundType type, Sound sound) {
removeSound(type, CraftSound.getSound(sound));
}
public void removeSound(SoundType type, String sound) {
if (type == SoundType.CANCEL)
cancelSounds.remove(sound);
else {
disguiseSounds.remove(type);
}
}
/**
* Used to check if this sound name is owned by this disguise sound.
*/
@ -206,7 +182,31 @@ public enum DisguiseSound {
return getSoundsToCancel().contains(sound);
}
public void removeSound(SoundType type, Sound sound) {
removeSound(type, CraftSound.getSound(sound));
}
public void removeSound(SoundType type, String sound) {
if (type == SoundType.CANCEL)
cancelSounds.remove(sound);
else {
disguiseSounds.remove(type);
}
}
public void setDamageSoundVolume(float strength) {
this.damageSoundVolume = strength;
}
public void setSound(SoundType type, Sound sound) {
setSound(type, CraftSound.getSound(sound));
}
public void setSound(SoundType type, String sound) {
if (type == SoundType.CANCEL)
cancelSounds.add(sound);
else {
disguiseSounds.put(type, sound);
}
}
}

View File

@ -161,14 +161,6 @@ public enum DisguiseType {
return defaultData;
}
public Class getWatcherClass() {
return watcherClass;
}
public void setWatcherClass(Class c) {
watcherClass = c;
}
public int getDefaultId() {
return defaultId;
}
@ -177,6 +169,14 @@ public enum DisguiseType {
return entityId;
}
public EntityType getEntityType() {
return entityType;
}
public Class getWatcherClass() {
return watcherClass;
}
public boolean isMisc() {
return !entityType.isAlive();
}
@ -189,7 +189,7 @@ public enum DisguiseType {
return entityType == EntityType.PLAYER;
}
public EntityType getEntityType() {
return entityType;
public void setWatcherClass(Class c) {
watcherClass = c;
}
}

View File

@ -7,6 +7,10 @@ public class MobDisguise extends Disguise {
private boolean isAdult;
public MobDisguise(DisguiseType disguiseType) {
this(disguiseType, true);
}
public MobDisguise(DisguiseType disguiseType, boolean isAdult) {
this(disguiseType, isAdult, true);
}
@ -16,10 +20,6 @@ public class MobDisguise extends Disguise {
this.isAdult = isAdult;
}
public MobDisguise(DisguiseType disguiseType) {
this(disguiseType, true);
}
public MobDisguise clone() {
MobDisguise disguise = new MobDisguise(getType(), isAdult(), replaceSounds());
return disguise;

View File

@ -9,8 +9,12 @@ import org.bukkit.event.HandlerList;
public class DisguisedEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
public static HandlerList getHandlerList() {
return handlers;
}
private Disguise disguise;
private Entity disguised;
private boolean isCancelled;
public DisguisedEvent(Entity entity, Disguise disguise) {
@ -26,10 +30,6 @@ public class DisguisedEvent extends Event implements Cancellable {
return disguised;
}
public static HandlerList getHandlerList() {
return handlers;
}
public HandlerList getHandlers() {
return handlers;
}

View File

@ -9,10 +9,14 @@ import org.bukkit.event.HandlerList;
public class RedisguisedEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private Disguise oldDisguise;
private Disguise newDisguise;
public static HandlerList getHandlerList() {
return handlers;
}
private Entity disguised;
private boolean isCancelled;
private Disguise newDisguise;
private Disguise oldDisguise;
public RedisguisedEvent(Entity entity, Disguise oldDisguise, Disguise newDisguise) {
this.disguised = entity;
@ -20,24 +24,20 @@ public class RedisguisedEvent extends Event implements Cancellable {
this.newDisguise = newDisguise;
}
public Disguise getOldDisguise() {
return oldDisguise;
public Entity getDisguised() {
return disguised;
}
public HandlerList getHandlers() {
return handlers;
}
public Disguise getNewDisguise() {
return newDisguise;
}
public Entity getDisguised() {
return disguised;
}
public static HandlerList getHandlerList() {
return handlers;
}
public HandlerList getHandlers() {
return handlers;
public Disguise getOldDisguise() {
return oldDisguise;
}
@Override

View File

@ -9,8 +9,12 @@ import org.bukkit.event.HandlerList;
public class UndisguisedEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
public static HandlerList getHandlerList() {
return handlers;
}
private Disguise disguise;
private Entity disguised;
private boolean isCancelled;
public UndisguisedEvent(Entity entity, Disguise disguise) {
@ -26,10 +30,6 @@ public class UndisguisedEvent extends Event implements Cancellable {
return disguised;
}
public static HandlerList getHandlerList() {
return handlers;
}
public HandlerList getHandlers() {
return handlers;
}