From 293b4f7de1f1271f8bd42239b9a46342c4fa44a9 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 28 Jul 2013 12:05:47 +1200 Subject: [PATCH] Fix bug and change Values to use switch statement --- .../disguise/DisguiseTypes/Values.java | 26 ++++++++++++++----- .../Watchers/AgeableWatcher.java | 2 +- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/me/libraryaddict/disguise/DisguiseTypes/Values.java b/src/me/libraryaddict/disguise/DisguiseTypes/Values.java index c6fabc96..4a614943 100644 --- a/src/me/libraryaddict/disguise/DisguiseTypes/Values.java +++ b/src/me/libraryaddict/disguise/DisguiseTypes/Values.java @@ -19,17 +19,29 @@ public class Values { } public static Values getValues(DisguiseType type) { - if (type == DisguiseType.DONKEY || type == DisguiseType.MULE || type == DisguiseType.UNDEAD_HORSE - || type == DisguiseType.SKELETON_HORSE) + switch (type) { + case DONKEY: + case MULE: + case UNDEAD_HORSE: + case SKELETON_HORSE: type = DisguiseType.HORSE; - else if (type == DisguiseType.MINECART_CHEST || type == DisguiseType.MINECART_FURNACE - || type == DisguiseType.MINECART_HOPPER || type == DisguiseType.MINECART_TNT - || type == DisguiseType.MINECART_MOB_SPAWNER) + break; + case MINECART_CHEST: + case MINECART_FURNACE: + case MINECART_HOPPER: + case MINECART_TNT: + case MINECART_MOB_SPAWNER: type = DisguiseType.MINECART; - else if (type == DisguiseType.WITHER_SKELETON) + break; + case WITHER_SKELETON: type = DisguiseType.SKELETON; - else if (type == DisguiseType.ZOMBIE_VILLAGER) + break; + case ZOMBIE_VILLAGER: type = DisguiseType.ZOMBIE; + break; + default: + break; + } return values.get(type); } diff --git a/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/AgeableWatcher.java b/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/AgeableWatcher.java index 1f28c575..ac5f000a 100644 --- a/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/AgeableWatcher.java +++ b/src/me/libraryaddict/disguise/DisguiseTypes/Watchers/AgeableWatcher.java @@ -2,7 +2,7 @@ package me.libraryaddict.disguise.DisguiseTypes.Watchers; import me.libraryaddict.disguise.DisguiseTypes.Disguise; -public abstract class AgeableWatcher extends LivingWatcher { +public class AgeableWatcher extends LivingWatcher { public AgeableWatcher(Disguise disguise) { super(disguise);