mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-28 13:36:33 +01:00
Add sign type legacy check
This commit is contained in:
parent
57247ef96a
commit
33f917f0c4
@ -104,6 +104,17 @@ public class DSignListener implements Listener {
|
||||
sign.setLine(2, lines[2]);
|
||||
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);
|
||||
|
||||
if (dsign == null) {
|
||||
|
@ -108,6 +108,17 @@ public enum DSignTypeDefault implements DSignType {
|
||||
return isProtected;
|
||||
}
|
||||
|
||||
public boolean isLegacy() {
|
||||
switch (this) {
|
||||
case CHEST:
|
||||
case EXTERNAL_MOB:
|
||||
case FLOOR:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends DSign> getHandler() {
|
||||
return handler;
|
||||
|
Loading…
Reference in New Issue
Block a user