Better error handling for hologram signs; resolves #267

This commit is contained in:
Daniel Saukel 2017-10-05 00:35:28 +02:00
parent 2843c0dfcb
commit 3dad23c216
11 changed files with 5 additions and 11 deletions

View File

@ -16,7 +16,6 @@
*/ */
package io.github.dre2n.dungeonsxl.player; package io.github.dre2n.dungeonsxl.player;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.MainConfig; import io.github.dre2n.dungeonsxl.config.MainConfig;
import io.github.dre2n.dungeonsxl.util.ParsingUtil; import io.github.dre2n.dungeonsxl.util.ParsingUtil;
import io.github.dre2n.dungeonsxl.world.DInstanceWorld; import io.github.dre2n.dungeonsxl.world.DInstanceWorld;

View File

@ -17,7 +17,6 @@
package io.github.dre2n.dungeonsxl.reward; package io.github.dre2n.dungeonsxl.reward;
import io.github.dre2n.commons.chat.MessageUtil; import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.config.DMessage;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;

View File

@ -17,7 +17,6 @@
package io.github.dre2n.dungeonsxl.sign; package io.github.dre2n.dungeonsxl.sign;
import io.github.dre2n.commons.misc.NumberUtil; import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.loottable.DLootTable; import io.github.dre2n.dungeonsxl.loottable.DLootTable;
import io.github.dre2n.dungeonsxl.world.DGameWorld; import io.github.dre2n.dungeonsxl.world.DGameWorld;
import io.github.dre2n.dungeonsxl.world.block.RewardChest; import io.github.dre2n.dungeonsxl.world.block.RewardChest;

View File

@ -16,7 +16,6 @@
*/ */
package io.github.dre2n.dungeonsxl.sign; package io.github.dre2n.dungeonsxl.sign;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.player.DGamePlayer; import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.trigger.InteractTrigger; import io.github.dre2n.dungeonsxl.trigger.InteractTrigger;
import io.github.dre2n.dungeonsxl.world.DGameWorld; import io.github.dre2n.dungeonsxl.world.DGameWorld;

View File

@ -16,7 +16,6 @@
*/ */
package io.github.dre2n.dungeonsxl.sign; package io.github.dre2n.dungeonsxl.sign;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.event.dplayer.instance.game.DGamePlayerEscapeEvent; import io.github.dre2n.dungeonsxl.event.dplayer.instance.game.DGamePlayerEscapeEvent;
import io.github.dre2n.dungeonsxl.player.DGamePlayer; import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.trigger.InteractTrigger; import io.github.dre2n.dungeonsxl.trigger.InteractTrigger;

View File

@ -16,7 +16,6 @@
*/ */
package io.github.dre2n.dungeonsxl.sign; package io.github.dre2n.dungeonsxl.sign;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.trigger.InteractTrigger; import io.github.dre2n.dungeonsxl.trigger.InteractTrigger;
import io.github.dre2n.dungeonsxl.world.DGameWorld; import io.github.dre2n.dungeonsxl.world.DGameWorld;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;

View File

@ -16,7 +16,6 @@
*/ */
package io.github.dre2n.dungeonsxl.sign; package io.github.dre2n.dungeonsxl.sign;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.world.DGameWorld; import io.github.dre2n.dungeonsxl.world.DGameWorld;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Sign; import org.bukkit.block.Sign;

View File

@ -16,7 +16,6 @@
*/ */
package io.github.dre2n.dungeonsxl.sign.lobby; package io.github.dre2n.dungeonsxl.sign.lobby;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.player.DClass; import io.github.dre2n.dungeonsxl.player.DClass;
import io.github.dre2n.dungeonsxl.sign.DSign; import io.github.dre2n.dungeonsxl.sign.DSign;
import io.github.dre2n.dungeonsxl.sign.DSignType; import io.github.dre2n.dungeonsxl.sign.DSignType;

View File

@ -24,11 +24,11 @@ import io.github.dre2n.commons.compatibility.CompatibilityHandler;
import io.github.dre2n.commons.compatibility.Version; import io.github.dre2n.commons.compatibility.Version;
import io.github.dre2n.commons.misc.EnumUtil; import io.github.dre2n.commons.misc.EnumUtil;
import io.github.dre2n.commons.misc.NumberUtil; import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.sign.DSign; import io.github.dre2n.dungeonsxl.sign.DSign;
import io.github.dre2n.dungeonsxl.sign.DSignType; import io.github.dre2n.dungeonsxl.sign.DSignType;
import io.github.dre2n.dungeonsxl.sign.DSignTypeDefault; import io.github.dre2n.dungeonsxl.sign.DSignTypeDefault;
import io.github.dre2n.dungeonsxl.world.DGameWorld; import io.github.dre2n.dungeonsxl.world.DGameWorld;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
@ -55,6 +55,10 @@ public class HologramSign extends DSign {
@Override @Override
public void onInit() { public void onInit() {
if (Bukkit.getPluginManager().getPlugin("HolographicDisplays") == null) {
markAsErroneous();
return;
}
getSign().getBlock().setType(Material.AIR); getSign().getBlock().setType(Material.AIR);
String[] holoLines = lines[1].split("/"); String[] holoLines = lines[1].split("/");

View File

@ -17,7 +17,6 @@
package io.github.dre2n.dungeonsxl.sign.mob; package io.github.dre2n.dungeonsxl.sign.mob;
import io.github.dre2n.commons.misc.NumberUtil; import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.sign.DSign; import io.github.dre2n.dungeonsxl.sign.DSign;
import io.github.dre2n.dungeonsxl.sign.DSignType; import io.github.dre2n.dungeonsxl.sign.DSignType;
import io.github.dre2n.dungeonsxl.sign.DSignTypeDefault; import io.github.dre2n.dungeonsxl.sign.DSignTypeDefault;

View File

@ -17,7 +17,6 @@
package io.github.dre2n.dungeonsxl.sign.mob; package io.github.dre2n.dungeonsxl.sign.mob;
import io.github.dre2n.commons.misc.NumberUtil; import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.mob.ExternalMobPlugin; import io.github.dre2n.dungeonsxl.mob.ExternalMobPlugin;
import io.github.dre2n.dungeonsxl.mob.ExternalMobProvider; import io.github.dre2n.dungeonsxl.mob.ExternalMobProvider;
import io.github.dre2n.dungeonsxl.sign.DSign; import io.github.dre2n.dungeonsxl.sign.DSign;