Improves sign drawing during portal loading
Adds "Invalid gate" to the last line of portals with an invalid or unloaded gate type Re-draws all portals' signs on load in case some invalid portals becomes valid. This also updates any formatting
This commit is contained in:
parent
8c16ddbed5
commit
f4ec5e05d6
@ -937,6 +937,11 @@ public class PortalHandler {
|
|||||||
Stargate.logger.info(String.format("%s{%s} Loaded %d stargates with %d set as always-on",
|
Stargate.logger.info(String.format("%s{%s} Loaded %d stargates with %d set as always-on",
|
||||||
Stargate.getString("prefix"), world.getName(), portalCounts.getSecondValue(),
|
Stargate.getString("prefix"), world.getName(), portalCounts.getSecondValue(),
|
||||||
portalCounts.getFirstValue()));
|
portalCounts.getFirstValue()));
|
||||||
|
|
||||||
|
//Re-draw the signs in case a bug in the config prevented the portal from loading and has been fixed since
|
||||||
|
for (Portal portal : allPortals) {
|
||||||
|
portal.drawSign();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Stargate.logger.log(Level.SEVERE, "Exception while reading stargates from " + database.getName() + ": " + lineIndex);
|
Stargate.logger.log(Level.SEVERE, "Exception while reading stargates from " + database.getName() + ": " + lineIndex);
|
||||||
@ -962,6 +967,11 @@ public class PortalHandler {
|
|||||||
portalLocation.setTopLeft(new BlockLocation(world, portalData[6]));
|
portalLocation.setTopLeft(new BlockLocation(world, portalData[6]));
|
||||||
Gate gate = GateHandler.getGateByName(portalData[7]);
|
Gate gate = GateHandler.getGateByName(portalData[7]);
|
||||||
if (gate == null) {
|
if (gate == null) {
|
||||||
|
//Mark the sign as invalid to reduce some player confusion
|
||||||
|
Sign sign = (Sign) portalLocation.getSignLocation().getBlock().getState();
|
||||||
|
Stargate.setLine(sign, 3, Stargate.getString("signInvalidGate"));
|
||||||
|
sign.update();
|
||||||
|
|
||||||
Stargate.logger.info(Stargate.getString("prefix") + "Gate layout on line " + lineIndex +
|
Stargate.logger.info(Stargate.getString("prefix") + "Gate layout on line " + lineIndex +
|
||||||
" does not exist [" + portalData[7] + "]");
|
" does not exist [" + portalData[7] + "]");
|
||||||
return;
|
return;
|
||||||
|
@ -28,6 +28,7 @@ signRightClick=Right click
|
|||||||
signToUse=to use gate
|
signToUse=to use gate
|
||||||
signRandom=Random
|
signRandom=Random
|
||||||
signDisconnected=Disconnected
|
signDisconnected=Disconnected
|
||||||
|
signInvalidGate=Invalid gate
|
||||||
|
|
||||||
bungeeDisabled=BungeeCord support is disabled.
|
bungeeDisabled=BungeeCord support is disabled.
|
||||||
bungeeDeny=You do not have permission to create BungeeCord gates.
|
bungeeDeny=You do not have permission to create BungeeCord gates.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user