From 53b5be001d465c2864e726ab3a279fb3794b16c5 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 29 Jul 2013 11:19:59 +1200 Subject: [PATCH] Sort by name --- .../disguise/DisguiseTypes/DisguiseSound.java | 48 +++++++++---------- .../disguise/DisguiseTypes/DisguiseType.java | 20 ++++---- .../disguise/DisguiseTypes/MobDisguise.java | 8 ++-- .../disguise/Events/DisguisedEvent.java | 8 ++-- .../disguise/Events/RedisguisedEvent.java | 28 +++++------ .../disguise/Events/UndisguisedEvent.java | 8 ++-- 6 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/me/libraryaddict/disguise/DisguiseTypes/DisguiseSound.java b/src/me/libraryaddict/disguise/DisguiseTypes/DisguiseSound.java index 4379b3fa..b242e843 100644 --- a/src/me/libraryaddict/disguise/DisguiseTypes/DisguiseSound.java +++ b/src/me/libraryaddict/disguise/DisguiseTypes/DisguiseSound.java @@ -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); + } + } } diff --git a/src/me/libraryaddict/disguise/DisguiseTypes/DisguiseType.java b/src/me/libraryaddict/disguise/DisguiseTypes/DisguiseType.java index f444eab9..89e4b138 100644 --- a/src/me/libraryaddict/disguise/DisguiseTypes/DisguiseType.java +++ b/src/me/libraryaddict/disguise/DisguiseTypes/DisguiseType.java @@ -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; } } \ No newline at end of file diff --git a/src/me/libraryaddict/disguise/DisguiseTypes/MobDisguise.java b/src/me/libraryaddict/disguise/DisguiseTypes/MobDisguise.java index e65af4f4..6e0d8ed6 100644 --- a/src/me/libraryaddict/disguise/DisguiseTypes/MobDisguise.java +++ b/src/me/libraryaddict/disguise/DisguiseTypes/MobDisguise.java @@ -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; diff --git a/src/me/libraryaddict/disguise/Events/DisguisedEvent.java b/src/me/libraryaddict/disguise/Events/DisguisedEvent.java index fc22069d..59731421 100644 --- a/src/me/libraryaddict/disguise/Events/DisguisedEvent.java +++ b/src/me/libraryaddict/disguise/Events/DisguisedEvent.java @@ -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; } diff --git a/src/me/libraryaddict/disguise/Events/RedisguisedEvent.java b/src/me/libraryaddict/disguise/Events/RedisguisedEvent.java index 65312e90..963bcb04 100644 --- a/src/me/libraryaddict/disguise/Events/RedisguisedEvent.java +++ b/src/me/libraryaddict/disguise/Events/RedisguisedEvent.java @@ -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 diff --git a/src/me/libraryaddict/disguise/Events/UndisguisedEvent.java b/src/me/libraryaddict/disguise/Events/UndisguisedEvent.java index 09558518..6276bccf 100644 --- a/src/me/libraryaddict/disguise/Events/UndisguisedEvent.java +++ b/src/me/libraryaddict/disguise/Events/UndisguisedEvent.java @@ -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; }