TypeWeatherType - Aliases and Colorization
This commit is contained in:
parent
4200155719
commit
9e193ef75f
@ -2,7 +2,9 @@ package com.massivecraft.massivecore.command.type.enumeration;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.WeatherType;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.massivecraft.massivecore.collections.MassiveSet;
|
||||
|
||||
@ -23,16 +25,44 @@ public class TypeWeatherType extends TypeEnum<WeatherType>
|
||||
// OVERRIDE
|
||||
// -------------------------------------------- //
|
||||
|
||||
@Override
|
||||
public ChatColor getVisualColor(WeatherType value, CommandSender sender)
|
||||
{
|
||||
if (value == null) return ChatColor.GRAY;
|
||||
if (value == WeatherType.CLEAR) return ChatColor.GREEN;
|
||||
return ChatColor.RED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNameInner(WeatherType value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case DOWNFALL: return "Rain";
|
||||
case CLEAR: return "Sun";
|
||||
}
|
||||
throw new RuntimeException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getNamesInner(WeatherType value)
|
||||
{
|
||||
Set<String> ret = new MassiveSet<String>(super.getNamesInner(value));
|
||||
Set<String> ret = new MassiveSet<String>();
|
||||
|
||||
if (value == WeatherType.DOWNFALL)
|
||||
switch (value)
|
||||
{
|
||||
case DOWNFALL:
|
||||
ret.add("Rain");
|
||||
ret.add("Storm");
|
||||
break;
|
||||
case CLEAR:
|
||||
ret.add("Sun");
|
||||
ret.add("Sky");
|
||||
break;
|
||||
}
|
||||
|
||||
ret.addAll(super.getNamesInner(value));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user