Add sign type legacy check

This commit is contained in:
Daniel Saukel 2019-02-26 18:32:32 +01:00
parent 57247ef96a
commit 33f917f0c4
2 changed files with 22 additions and 0 deletions

View File

@ -104,6 +104,17 @@ public class DSignListener implements Listener {
sign.setLine(2, lines[2]); sign.setLine(2, lines[2]);
sign.setLine(3, lines[3]); sign.setLine(3, lines[3]);
for (DSignTypeDefault type : DSignTypeDefault.values()) {
if (!lines[0].equalsIgnoreCase("[" + type.getName() + "]")) {
continue;
}
if (type.isLegacy()) {
MessageUtil.sendMessage(player, ChatColor.RED + "https://erethon.de/resources/dxl-signs/deprecated.gif");
MessageUtil.sendMessage(player, ChatColor.LIGHT_PURPLE + "https://github.com/DRE2N/DungeonsXL/wiki/Legacy-support#updating");
return;
}
}
DSign dsign = DSign.create(plugin, sign, null); DSign dsign = DSign.create(plugin, sign, null);
if (dsign == null) { if (dsign == null) {

View File

@ -108,6 +108,17 @@ public enum DSignTypeDefault implements DSignType {
return isProtected; return isProtected;
} }
public boolean isLegacy() {
switch (this) {
case CHEST:
case EXTERNAL_MOB:
case FLOOR:
return true;
default:
return false;
}
}
@Override @Override
public Class<? extends DSign> getHandler() { public Class<? extends DSign> getHandler() {
return handler; return handler;