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

@ -22,7 +22,7 @@ import com.plotsquared.bukkit.database.plotme.PlotMeConnector_017;
import com.plotsquared.bukkit.generator.BukkitPlotGenerator;
import com.plotsquared.bukkit.listeners.*;
import com.plotsquared.bukkit.listeners.worldedit.WEListener;
import com.plotsquared.bukkit.titles.DefaultTitle;
import com.plotsquared.bukkit.titles.DefaultTitle_19;
import com.plotsquared.bukkit.util.*;
import com.plotsquared.bukkit.util.block.*;
import com.plotsquared.bukkit.uuid.*;
@ -471,7 +471,7 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
Settings.TITLES = false;
FlagManager.removeFlag(FlagManager.getFlag("titles"));
} else {
AbstractTitle.TITLE_CLASS = new DefaultTitle();
AbstractTitle.TITLE_CLASS = new DefaultTitle_19();
if (wrapper instanceof DefaultUUIDWrapper || wrapper.getClass() == OfflineUUIDWrapper.class && !Bukkit.getOnlineMode()) {
Settings.TWIN_MODE_UUID = true;
}

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);
}
}
}

View file

@ -396,7 +396,11 @@ public class FastQueue_1_9 extends SlowQueue {
}
public boolean isSolid(int i) {
return i != 0 && Material.getMaterial(i).isOccluding();
if (i != 0) {
Material material = Material.getMaterial(i);
return material != null && Material.getMaterial(i).isOccluding();
}
return false;
}
public int getId(int[][] sections, int x, int y, int z) {