Update titles

This commit is contained in:
Jesse Boyd
2016-03-03 09:08:43 +11:00
parent cfcfd87f57
commit 6e2256ffcf
3 changed files with 34 additions and 3 deletions

View File

@ -0,0 +1,27 @@
package com.plotsquared.bukkit.titles;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.AbstractTitle;
import com.intellectualcrafters.plot.util.TaskManager;
import com.plotsquared.bukkit.object.BukkitPlayer;
import org.bukkit.entity.Player;
public class DefaultTitle_19 extends AbstractTitle {
@Override
public void sendTitle(final PlotPlayer player, final String head, final String sub, final int in, final int delay, final int out) {
try {
final Player playerObj = ((BukkitPlayer) player).player;
playerObj.sendTitle(head,sub);
TaskManager.runTaskLater(new Runnable() {
@Override
public void run() {
playerObj.resetTitle();
}
}, delay);
}
catch (Throwable e) {
AbstractTitle.TITLE_CLASS = new DefaultTitle();
AbstractTitle.TITLE_CLASS.sendTitle(player, head, sub, in, delay, out);
}
}
}