PlotSquared/PlotSquared/src/main/java/com/intellectualcrafters/plot/titles/DefaultTitle.java

22 lines
865 B
Java
Raw Normal View History

2015-01-18 21:11:51 +01:00
package com.intellectualcrafters.plot.titles;
import org.bukkit.ChatColor;
2015-05-14 12:34:08 +02:00
import com.intellectualcrafters.plot.object.BukkitPlayer;
import com.intellectualcrafters.plot.object.PlotPlayer;
2015-01-18 21:11:51 +01:00
public class DefaultTitle extends AbstractTitle {
2015-02-20 07:34:19 +01:00
@Override
2015-05-14 12:34:08 +02:00
public void sendTitle(final PlotPlayer player, final String head, final String sub, final ChatColor head_color, final ChatColor sub_color) {
2015-02-20 07:34:19 +01:00
try {
final DefaultTitleManager title = new DefaultTitleManager(head, sub, 1, 2, 1);
title.setTitleColor(head_color);
title.setSubtitleColor(sub_color);
2015-05-14 12:34:08 +02:00
title.send(((BukkitPlayer) player).player);
2015-02-20 07:34:19 +01:00
} catch (final Throwable e) {
2015-03-12 04:15:17 +01:00
AbstractTitle.TITLE_CLASS = new DefaultTitle_183();
2015-02-20 07:34:19 +01:00
AbstractTitle.TITLE_CLASS.sendTitle(player, head, sub, head_color, sub_color);
}
}
2015-01-18 21:11:51 +01:00
}