mirror of
https://github.com/Zrips/Jobs.git
synced 2025-02-18 05:11:32 +01:00
Cleanup
This commit is contained in:
parent
ade5fcc4f1
commit
b7d50720ad
@ -179,23 +179,16 @@ public class CMIChatColor {
|
||||
|
||||
gtext = stripColor(gtext);
|
||||
|
||||
for (int i = 0; i < gtext.length(); i++) {
|
||||
char ch = gtext.charAt(i);
|
||||
int length = gtext.length();
|
||||
length = length < 2 ? 2 : length;
|
||||
|
||||
double percent = (i * 100D) / (length - 1);
|
||||
|
||||
// if (gtext.length() == 1) {
|
||||
// percent = 50D;
|
||||
// }
|
||||
|
||||
CMIChatColor mix = CMIChatColor.mixColors(c1, c2, percent);
|
||||
updated += CMIChatColor.colorCodePrefix + mix.getHex() + CMIChatColor.colorCodeSuffix;
|
||||
|
||||
updated += String.valueOf(ch);
|
||||
// updated += charEscape(String.valueOf(ch));
|
||||
}
|
||||
if (gtext != null)
|
||||
for (int i = 0; i < gtext.length(); i++) {
|
||||
char ch = gtext.charAt(i);
|
||||
int length = gtext.length();
|
||||
length = length < 2 ? 2 : length;
|
||||
double percent = (i * 100D) / (length - 1);
|
||||
CMIChatColor mix = CMIChatColor.mixColors(c1, c2, percent);
|
||||
updated += CMIChatColor.colorCodePrefix + mix.getHex() + CMIChatColor.colorCodeSuffix;
|
||||
updated += String.valueOf(ch);
|
||||
}
|
||||
|
||||
if (continuous) {
|
||||
updated += CMIChatColor.colorCodePrefix + gradientMatch.group(5).replace("#", "") + ">" + CMIChatColor.colorCodeSuffix;
|
||||
|
@ -91,10 +91,6 @@ public class ExploreManager {
|
||||
try {
|
||||
int worldId = res.getInt(ExploreDataTableFields.worldid.getCollumn());
|
||||
String worldName = res.getString(ExploreDataTableFields.worldname.getCollumn());
|
||||
int x = res.getInt(ExploreDataTableFields.chunkX.getCollumn());
|
||||
int z = res.getInt(ExploreDataTableFields.chunkZ.getCollumn());
|
||||
String names = res.getString(ExploreDataTableFields.playerNames.getCollumn());
|
||||
int id = res.getInt("id");
|
||||
|
||||
JobsWorld jobsWorld = Util.getJobsWorld(worldName);
|
||||
if (jobsWorld == null)
|
||||
@ -103,6 +99,11 @@ public class ExploreManager {
|
||||
if (jobsWorld == null)
|
||||
return;
|
||||
|
||||
int x = res.getInt(ExploreDataTableFields.chunkX.getCollumn());
|
||||
int z = res.getInt(ExploreDataTableFields.chunkZ.getCollumn());
|
||||
String names = res.getString(ExploreDataTableFields.playerNames.getCollumn());
|
||||
int id = res.getInt("id");
|
||||
|
||||
ExploreRegion eRegions = worlds.get(jobsWorld.getName());
|
||||
if (eRegions == null) {
|
||||
int RegionX = (int) Math.floor(x / 32D);
|
||||
|
@ -102,12 +102,10 @@ public class ExploreChunk {
|
||||
}
|
||||
}
|
||||
|
||||
if (playerIds.size() >= Jobs.getExplore().getPlayerAmount()) {
|
||||
if (Jobs.getGCManager().ExploreCompact) {
|
||||
playerIds = null;
|
||||
if (!names.isEmpty())
|
||||
updated = true;
|
||||
}
|
||||
if (playerIds.size() >= Jobs.getExplore().getPlayerAmount() && Jobs.getGCManager().ExploreCompact) {
|
||||
playerIds = null;
|
||||
if (!names.isEmpty())
|
||||
updated = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -106,25 +106,27 @@ public class JobsMySQL extends JobsDAO {
|
||||
return false;
|
||||
} catch (SQLException e) {
|
||||
Jobs.consoleMsg("Not a table |" + "SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME ='" + table + "';" + "|");
|
||||
}
|
||||
try {
|
||||
|
||||
PreparedStatement insert = conn.prepareStatement("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME ='" + table + "';");
|
||||
ResultSet res = insert.executeQuery();
|
||||
if (res.next()) {
|
||||
res.close();
|
||||
insert.close();
|
||||
return true;
|
||||
}
|
||||
res.close();
|
||||
insert.close();
|
||||
return false;
|
||||
} catch (SQLException e) {
|
||||
Jobs.consoleMsg("Not a table |" + "SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME ='" + table + "';" + "|");
|
||||
return false;
|
||||
} finally {
|
||||
close(statement);
|
||||
}
|
||||
PreparedStatement insert = null;
|
||||
ResultSet res = null;
|
||||
try {
|
||||
insert = conn.prepareStatement("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME ='" + table + "';");
|
||||
res = insert.executeQuery();
|
||||
if (res.next()) {
|
||||
close(res);
|
||||
close(insert);
|
||||
close(statement);
|
||||
return true;
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
Jobs.consoleMsg("Not a table |" + "SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME ='" + table + "';" + "|");
|
||||
} finally {
|
||||
}
|
||||
close(res);
|
||||
close(insert);
|
||||
close(statement);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -155,7 +155,7 @@ public class BufferedEconomy {
|
||||
|
||||
if (ServerTaxesAccount.isOnline() && Jobs.getGCManager().ActionBarsMessageByDefault) {
|
||||
ActionBarManager.send(Bukkit.getPlayer(ServerAccountname),
|
||||
Jobs.getLanguage().getMessage("message.taxes", "[amount]", (int) (TotalAmount * 100) / 100.0));
|
||||
Jobs.getLanguage().getMessage("message.taxes", "[amount]", (int) (TotalAmount * 100) / 100.0));
|
||||
}
|
||||
}
|
||||
|
||||
@ -224,15 +224,15 @@ public class BufferedEconomy {
|
||||
String Message = Jobs.getLanguage().getMessage("command.toggle.output.paid.main");
|
||||
if (payment.get(CurrencyType.MONEY) != 0D) {
|
||||
Message = Message + " " + Jobs.getLanguage().getMessage("command.toggle.output.paid.money", "[amount]", String.format(Jobs.getGCManager().getDecimalPlacesMoney(),
|
||||
Double.valueOf(payment.get(CurrencyType.MONEY))));
|
||||
payment.get(CurrencyType.MONEY)));
|
||||
}
|
||||
if (payment.get(CurrencyType.POINTS) != 0D) {
|
||||
Message = Message + " " + Jobs.getLanguage().getMessage("command.toggle.output.paid.points", "[points]", String.format(Jobs.getGCManager().getDecimalPlacesPoints(),
|
||||
Double.valueOf(payment.get(CurrencyType.POINTS))));
|
||||
payment.get(CurrencyType.POINTS)));
|
||||
}
|
||||
if (payment.get(CurrencyType.EXP) != 0D) {
|
||||
Message = Message + " " + Jobs.getLanguage().getMessage("command.toggle.output.paid.exp", "[exp]", String.format(Jobs.getGCManager().getDecimalPlacesExp(),
|
||||
Double.valueOf(payment.get(CurrencyType.EXP))));
|
||||
payment.get(CurrencyType.EXP)));
|
||||
}
|
||||
ActionBarManager.send(abp, Message);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user