Add Llama color Type and add to registry.

This commit is contained in:
ulumulu1510 2017-02-02 00:09:41 +01:00
parent 1838c9c2ab
commit 1f2aecccb1
2 changed files with 61 additions and 0 deletions

View File

@ -35,6 +35,7 @@ import com.massivecraft.massivecore.command.type.enumeration.TypeGameMode;
import com.massivecraft.massivecore.command.type.enumeration.TypeHorseColor;
import com.massivecraft.massivecore.command.type.enumeration.TypeHorseStyle;
import com.massivecraft.massivecore.command.type.enumeration.TypeHorseVariant;
import com.massivecraft.massivecore.command.type.enumeration.TypeLlamaColor;
import com.massivecraft.massivecore.command.type.enumeration.TypeMaterial;
import com.massivecraft.massivecore.command.type.enumeration.TypeOcelotType;
import com.massivecraft.massivecore.command.type.enumeration.TypeParticleEffect;
@ -328,6 +329,15 @@ public class RegistryType
}
try
{
register(TypeLlamaColor.get());
}
catch (Throwable t)
{
}
register(TypeSkeletonType.get());
register(TypeSound.get());
register(TypeVillagerProfession.get());

View File

@ -0,0 +1,51 @@
package com.massivecraft.massivecore.command.type.enumeration;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Llama.Color;
public class TypeLlamaColor extends TypeEnum<Color>
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private static TypeLlamaColor i = new TypeLlamaColor();
public static TypeLlamaColor get() { return i; }
public TypeLlamaColor()
{
super(Color.class);
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public ChatColor getVisualColor(Color value, CommandSender sender)
{
return getChatColor(value);
}
private ChatColor getChatColor(Color color)
{
switch (color)
{
case CREAMY:
return ChatColor.GRAY;
case WHITE:
return ChatColor.WHITE;
case BROWN:
return ChatColor.GOLD;
case GRAY:
return ChatColor.DARK_GRAY;
default:
return ChatColor.WHITE;
}
}
}