Add AnimalColor for Sheep color and wolf color
This commit is contained in:
parent
e7301e06d0
commit
d7010c6389
@ -8,6 +8,7 @@ import java.util.Collection;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import me.libraryaddict.disguise.disguisetypes.AnimalColor;
|
||||||
import me.libraryaddict.disguise.disguisetypes.Disguise;
|
import me.libraryaddict.disguise.disguisetypes.Disguise;
|
||||||
import me.libraryaddict.disguise.disguisetypes.DisguiseType;
|
import me.libraryaddict.disguise.disguisetypes.DisguiseType;
|
||||||
import me.libraryaddict.disguise.disguisetypes.FlagWatcher;
|
import me.libraryaddict.disguise.disguisetypes.FlagWatcher;
|
||||||
@ -24,6 +25,7 @@ import me.libraryaddict.disguise.utilities.DisguiseUtilities;
|
|||||||
import me.libraryaddict.disguise.utilities.ReflectionManager;
|
import me.libraryaddict.disguise.utilities.ReflectionManager;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.DyeColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
@ -31,7 +33,6 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.inventory.EntityEquipment;
|
import org.bukkit.inventory.EntityEquipment;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
|
||||||
|
|
||||||
public class DisguiseAPI {
|
public class DisguiseAPI {
|
||||||
|
|
||||||
@ -98,8 +99,8 @@ public class DisguiseAPI {
|
|||||||
Class methodParam = watcherMethod.getParameterTypes()[0];
|
Class methodParam = watcherMethod.getParameterTypes()[0];
|
||||||
if (methodParam == float.class || methodParam == Float.class || methodParam == Double.class) {
|
if (methodParam == float.class || methodParam == Float.class || methodParam == Double.class) {
|
||||||
methodParam = double.class;
|
methodParam = double.class;
|
||||||
} else if (methodParam == PotionEffect.class) {
|
} else if (methodParam == AnimalColor.class) {
|
||||||
methodParam = PotionEffectType.class;
|
methodParam = DyeColor.class;
|
||||||
}
|
}
|
||||||
if (methodReturn == methodParam) {
|
if (methodReturn == methodParam) {
|
||||||
try {
|
try {
|
||||||
@ -121,6 +122,8 @@ public class DisguiseAPI {
|
|||||||
float d = (Float) value;
|
float d = (Float) value;
|
||||||
value = (double) d;
|
value = (double) d;
|
||||||
}
|
}
|
||||||
|
} else if (toCast == AnimalColor.class) {
|
||||||
|
value = AnimalColor.valueOf(((DyeColor) value).name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (value instanceof Boolean && !(Boolean) value
|
if (value instanceof Boolean && !(Boolean) value
|
||||||
|
Loading…
Reference in New Issue
Block a user