Fix bug and change Values to use switch statement
This commit is contained in:
parent
b80eecfc63
commit
293b4f7de1
@ -19,17 +19,29 @@ public class Values {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Values getValues(DisguiseType type) {
|
public static Values getValues(DisguiseType type) {
|
||||||
if (type == DisguiseType.DONKEY || type == DisguiseType.MULE || type == DisguiseType.UNDEAD_HORSE
|
switch (type) {
|
||||||
|| type == DisguiseType.SKELETON_HORSE)
|
case DONKEY:
|
||||||
|
case MULE:
|
||||||
|
case UNDEAD_HORSE:
|
||||||
|
case SKELETON_HORSE:
|
||||||
type = DisguiseType.HORSE;
|
type = DisguiseType.HORSE;
|
||||||
else if (type == DisguiseType.MINECART_CHEST || type == DisguiseType.MINECART_FURNACE
|
break;
|
||||||
|| type == DisguiseType.MINECART_HOPPER || type == DisguiseType.MINECART_TNT
|
case MINECART_CHEST:
|
||||||
|| type == DisguiseType.MINECART_MOB_SPAWNER)
|
case MINECART_FURNACE:
|
||||||
|
case MINECART_HOPPER:
|
||||||
|
case MINECART_TNT:
|
||||||
|
case MINECART_MOB_SPAWNER:
|
||||||
type = DisguiseType.MINECART;
|
type = DisguiseType.MINECART;
|
||||||
else if (type == DisguiseType.WITHER_SKELETON)
|
break;
|
||||||
|
case WITHER_SKELETON:
|
||||||
type = DisguiseType.SKELETON;
|
type = DisguiseType.SKELETON;
|
||||||
else if (type == DisguiseType.ZOMBIE_VILLAGER)
|
break;
|
||||||
|
case ZOMBIE_VILLAGER:
|
||||||
type = DisguiseType.ZOMBIE;
|
type = DisguiseType.ZOMBIE;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
return values.get(type);
|
return values.get(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ package me.libraryaddict.disguise.DisguiseTypes.Watchers;
|
|||||||
|
|
||||||
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
|
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
|
||||||
|
|
||||||
public abstract class AgeableWatcher extends LivingWatcher {
|
public class AgeableWatcher extends LivingWatcher {
|
||||||
|
|
||||||
public AgeableWatcher(Disguise disguise) {
|
public AgeableWatcher(Disguise disguise) {
|
||||||
super(disguise);
|
super(disguise);
|
||||||
|
Loading…
Reference in New Issue
Block a user