Makes the stargate logger private

This commit is contained in:
2021-10-23 14:25:46 +02:00
parent 7cc8685e26
commit deba2e5c2c
14 changed files with 60 additions and 41 deletions

View File

@ -268,7 +268,7 @@ public class Gate {
bufferedWriter.close();
} catch (IOException ex) {
Stargate.logger.log(Level.SEVERE, "Could not save Gate " + filename + " - " + ex.getMessage());
Stargate.getConsoleLogger().log(Level.SEVERE, "Could not save Gate " + filename + " - " + ex.getMessage());
}
}

View File

@ -106,7 +106,7 @@ public class GateHandler {
try (Scanner scanner = new Scanner(file)) {
return loadGate(file.getName(), file.getParent(), scanner);
} catch (Exception ex) {
Stargate.logger.log(Level.SEVERE, "Could not load Gate " + file.getName() + " - " + ex.getMessage());
Stargate.getConsoleLogger().log(Level.SEVERE, "Could not load Gate " + file.getName() + " - " + ex.getMessage());
return null;
}
}
@ -190,13 +190,13 @@ public class GateHandler {
*/
private static boolean validateGate(Gate gate, String fileName) {
if (gate.getLayout().getControls().length != 2) {
Stargate.logger.log(Level.SEVERE, "Could not load Gate " + fileName +
Stargate.getConsoleLogger().log(Level.SEVERE, "Could not load Gate " + fileName +
" - Gates must have exactly 2 control points.");
return false;
}
if (!MaterialHelper.isButtonCompatible(gate.getPortalButton())) {
Stargate.logger.log(Level.SEVERE, "Could not load Gate " + fileName +
Stargate.getConsoleLogger().log(Level.SEVERE, "Could not load Gate " + fileName +
" - Gate button must be a type of button.");
return false;
}

View File

@ -88,7 +88,7 @@ public class PortalHandler {
}
//Check if this player can access the dest world
if (PermissionHelper.cannotAccessWorld(player, portal.getWorld().getName())) {
Stargate.logger.info("cannot access world");
Stargate.getConsoleLogger().info("cannot access world");
continue;
}
//Visible to this player.
@ -439,14 +439,14 @@ public class PortalHandler {
}
}
PortalRegistry.unregisterPortal(portal, false);
Stargate.logger.info(Stargate.getString("prefix") + "Destroying stargate at " + portal);
Stargate.getConsoleLogger().info(Stargate.getString("prefix") + "Destroying stargate at " + portal);
}
/**
* Closes all portals
*/
public static void closeAllPortals() {
Stargate.logger.info("Closing all stargates.");
Stargate.getConsoleLogger().info("Closing all stargates.");
for (Portal portal : PortalRegistry.getAllPortals()) {
if (portal != null) {
portal.getPortalOpener().closePortal(true);

View File

@ -30,7 +30,8 @@ public class PortalSignDrawer {
Block signBlock = portal.getSignLocation().getBlock();
BlockState state = signBlock.getState();
if (!(state instanceof Sign sign)) {
Stargate.logger.warning(Stargate.getString("prefix") + "Sign block is not a Sign object");
Stargate.getConsoleLogger().warning(Stargate.getString("prefix") +
"Sign block is not a Sign object");
Stargate.debug("Portal::drawSign", "Block: " + signBlock.getType() + " @ " +
signBlock.getLocation());
return;

View File

@ -80,7 +80,7 @@ public abstract class Teleporter {
}
}
} else {
Stargate.logger.log(Level.WARNING, Stargate.getString("prefix") +
Stargate.getConsoleLogger().log(Level.WARNING, Stargate.getString("prefix") +
"Missing destination point in .gate file " + portal.getGate().getFilename());
}
@ -180,7 +180,7 @@ public abstract class Teleporter {
exitLocation.setPitch(traveller.getPitch());
return exitLocation;
} else {
Stargate.logger.log(Level.WARNING, Stargate.getString("prefix") +
Stargate.getConsoleLogger().log(Level.WARNING, Stargate.getString("prefix") +
"Unable to generate exit location");
}
return traveller;

View File

@ -138,7 +138,7 @@ public class VehicleTeleporter extends Teleporter {
Vector newVelocity) {
World vehicleWorld = exit.getWorld();
if (vehicleWorld == null) {
Stargate.logger.warning(Stargate.getString("prefix") +
Stargate.getConsoleLogger().warning(Stargate.getString("prefix") +
"Unable to get the world to teleport the vehicle to");
return;
}