Replaces several static strings with strings from the language files

This commit is contained in:
Kristian Knarvik 2021-02-09 18:47:54 +01:00
parent 3521257cb2
commit 5a8e8a219e
3 changed files with 10 additions and 10 deletions

View File

@ -40,7 +40,7 @@ public class BungeeCordListener implements PluginMessageListener {
Portal destinationPortal = Portal.getBungeeGate(destination); Portal destinationPortal = Portal.getBungeeGate(destination);
// Specified an invalid gate. For now we'll just let them connect at their current location // Specified an invalid gate. For now we'll just let them connect at their current location
if (destinationPortal == null) { if (destinationPortal == null) {
Stargate.log.info("[stargate] Bungee gate " + destination + " does not exist"); Stargate.log.info(Stargate.getString("prefix") + "Bungee gate " + destination + " does not exist");
return; return;
} }
destinationPortal.teleport(player, destinationPortal, null); destinationPortal.teleport(player, destinationPortal, null);
@ -63,7 +63,7 @@ public class BungeeCordListener implements PluginMessageListener {
data = new byte[dataLength]; data = new byte[dataLength];
dataInputStream.readFully(data); dataInputStream.readFully(data);
} catch (IOException ex) { } catch (IOException ex) {
Stargate.log.severe("[stargate] Error receiving BungeeCord message"); Stargate.log.severe(Stargate.getString("prefix") + "Error receiving BungeeCord message");
ex.printStackTrace(); ex.printStackTrace();
return null; return null;
} }

View File

@ -122,7 +122,7 @@ public class EconomyHandler {
return true; return true;
} }
} }
Stargate.log.info("[stargate] Economy is enabled but vault could not be loaded. Economy disabled"); Stargate.log.info(Stargate.getString("prefix") + Stargate.getString("ecoLoadError"));
economyEnabled = false; economyEnabled = false;
return false; return false;
} }

View File

@ -556,7 +556,7 @@ public class Portal {
int back = (isBackwards()) ? -1 : 1; int back = (isBackwards()) ? -1 : 1;
loc = exit.modRelativeLoc(0D, 0D, 1D, traveller.getYaw(), traveller.getPitch(), modX * back, 1, modZ * back); loc = exit.modRelativeLoc(0D, 0D, 1D, traveller.getYaw(), traveller.getPitch(), modX * back, 1, modZ * back);
} else { } else {
Stargate.log.log(Level.WARNING, "[stargate] Missing destination point in .gate file " + gate.getFilename()); Stargate.log.log(Level.WARNING, Stargate.getString("prefix") + "Missing destination point in .gate file " + gate.getFilename());
} }
if (loc != null) { if (loc != null) {
@ -711,7 +711,7 @@ public class Portal {
public final void drawSign() { public final void drawSign() {
BlockState state = id.getBlock().getState(); BlockState state = id.getBlock().getState();
if (!(state instanceof Sign)) { if (!(state instanceof Sign)) {
Stargate.log.warning("[stargate] Sign block is not a Sign object"); Stargate.log.warning(Stargate.getString("prefix") + "Sign block is not a Sign object");
Stargate.debug("Portal::drawSign", "Block: " + id.getBlock().getType() + " @ " + id.getBlock().getLocation()); Stargate.debug("Portal::drawSign", "Block: " + id.getBlock().getType() + " @ " + id.getBlock().getLocation());
return; return;
} }
@ -1357,7 +1357,7 @@ public class Portal {
} }
String[] split = line.split(":"); String[] split = line.split(":");
if (split.length < 8) { if (split.length < 8) {
Stargate.log.info("[stargate] Invalid line - " + l); Stargate.log.info(Stargate.getString("prefix") + "Invalid line - " + l);
continue; continue;
} }
String name = split[0]; String name = split[0];
@ -1369,7 +1369,7 @@ public class Portal {
BlockLocation topLeft = new BlockLocation(world, split[6]); BlockLocation topLeft = new BlockLocation(world, split[6]);
Gate gate = Gate.getGateByName(split[7]); Gate gate = Gate.getGateByName(split[7]);
if (gate == null) { if (gate == null) {
Stargate.log.info("[stargate] Gate layout on line " + l + " does not exist [" + split[7] + "]"); Stargate.log.info(Stargate.getString("prefix") + "Gate layout on line " + l + " does not exist [" + split[7] + "]");
continue; continue;
} }
@ -1427,7 +1427,7 @@ public class Portal {
} }
portal.unregister(false); portal.unregister(false);
iter.remove(); iter.remove();
Stargate.log.info("[stargate] Destroying stargate at " + portal.toString()); Stargate.log.info(Stargate.getString("prefix") + "Destroying stargate at " + portal.toString());
continue; continue;
} }
} }
@ -1439,14 +1439,14 @@ public class Portal {
OpenCount++; OpenCount++;
} }
} }
Stargate.log.info("[stargate] {" + world.getName() + "} Loaded " + portalCount + " stargates with " + OpenCount + " set as always-on"); Stargate.log.info(Stargate.getString("prefix") + "{" + world.getName() + "} Loaded " + portalCount + " stargates with " + OpenCount + " set as always-on");
return true; return true;
} catch (Exception e) { } catch (Exception e) {
Stargate.log.log(Level.SEVERE, "Exception while reading stargates from " + db.getName() + ": " + l); Stargate.log.log(Level.SEVERE, "Exception while reading stargates from " + db.getName() + ": " + l);
e.printStackTrace(); e.printStackTrace();
} }
} else { } else {
Stargate.log.info("[stargate] {" + world.getName() + "} No stargates for world "); Stargate.log.info(Stargate.getString("prefix") + "{" + world.getName() + "} No stargates for world ");
} }
return false; return false;
} }