@@ -152,7 +152,13 @@ public class PortalSignDrawer {
|
|||||||
ChatColor highlightColor = signData.getHighlightSignColor();
|
ChatColor highlightColor = signData.getHighlightSignColor();
|
||||||
ChatColor mainColor = signData.getMainSignColor();
|
ChatColor mainColor = signData.getMainSignColor();
|
||||||
|
|
||||||
|
// Initialize all lines as empty to prevent null
|
||||||
String[] lines = new String[4];
|
String[] lines = new String[4];
|
||||||
|
lines[0] = "";
|
||||||
|
lines[1] = "";
|
||||||
|
lines[2] = "";
|
||||||
|
lines[3] = "";
|
||||||
|
|
||||||
setLine(signData, 0, highlightColor + "-" + mainColor + translateAllColorCodes(portal.getName()) +
|
setLine(signData, 0, highlightColor + "-" + mainColor + translateAllColorCodes(portal.getName()) +
|
||||||
highlightColor + "-", lines);
|
highlightColor + "-", lines);
|
||||||
|
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
package net.knarcraft.stargate.utility;
|
package net.knarcraft.stargate.utility;
|
||||||
|
|
||||||
|
import net.knarcraft.stargate.Stargate;
|
||||||
import org.bukkit.DyeColor;
|
import org.bukkit.DyeColor;
|
||||||
import org.bukkit.block.Sign;
|
import org.bukkit.block.Sign;
|
||||||
import org.bukkit.block.sign.Side;
|
import org.bukkit.block.sign.Side;
|
||||||
@@ -75,11 +76,11 @@ public final class SignHelper {
|
|||||||
*/
|
*/
|
||||||
private static boolean hasSignSides() {
|
private static boolean hasSignSides() {
|
||||||
try {
|
try {
|
||||||
Class.forName("Side");
|
|
||||||
Class<?> aClass = Class.forName("org.bukkit.block.Sign");
|
Class<?> aClass = Class.forName("org.bukkit.block.Sign");
|
||||||
aClass.getMethod("getSide", Side.class);
|
aClass.getMethod("getSide", Side.class);
|
||||||
return true;
|
return true;
|
||||||
} catch (ClassNotFoundException | NoSuchMethodException ignored) {
|
} catch (ClassNotFoundException | NoSuchMethodException ignored) {
|
||||||
|
Stargate.debug("SignHelper::hasSignSides", "Detected legacy Spigot");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user