Second Smelt makes use of its own section in Bonus Drops in config.yml

Co-authored-by: t00thpick1 <t00thpick1dirko@gmail.com>
This commit is contained in:
nossr50
2020-07-13 12:31:30 -07:00
parent 7eae59a0b3
commit fdd951f1f1
176 changed files with 642 additions and 604 deletions

View File

@@ -25,7 +25,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
private static final String ALL_QUERY_VERSION = "total";
private final String tablePrefix = Config.getInstance().getMySQLTablePrefix();
private final Map<UUID, Integer> cachedUserIDs = new HashMap<UUID, Integer>();
private final Map<UUID, Integer> cachedUserIDs = new HashMap<>();
private DataSource miscPool;
private DataSource loadPool;
@@ -214,8 +214,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
}
public void cleanupUser(UUID uuid) {
if(cachedUserIDs.containsKey(uuid))
cachedUserIDs.remove(uuid);
cachedUserIDs.remove(uuid);
}
public boolean saveUser(PlayerProfile profile) {
@@ -345,7 +344,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
}
public List<PlayerStat> readLeaderboard(PrimarySkillType skill, int pageNumber, int statsPerPage) {
List<PlayerStat> stats = new ArrayList<PlayerStat>();
List<PlayerStat> stats = new ArrayList<>();
String query = skill == null ? ALL_QUERY_VERSION : skill.name().toLowerCase(Locale.ENGLISH);
ResultSet resultSet = null;
@@ -360,13 +359,13 @@ public final class SQLDatabaseManager implements DatabaseManager {
resultSet = statement.executeQuery();
while (resultSet.next()) {
ArrayList<String> column = new ArrayList<String>();
ArrayList<String> column = new ArrayList<>();
for (int i = 1; i <= resultSet.getMetaData().getColumnCount(); i++) {
column.add(resultSet.getString(i));
}
stats.add(new PlayerStat(column.get(1), Integer.valueOf(column.get(0))));
stats.add(new PlayerStat(column.get(1), Integer.parseInt(column.get(0))));
}
}
catch (SQLException ex) {
@@ -382,7 +381,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
}
public Map<PrimarySkillType, Integer> readRank(String playerName) {
Map<PrimarySkillType, Integer> skills = new HashMap<PrimarySkillType, Integer>();
Map<PrimarySkillType, Integer> skills = new HashMap<>();
ResultSet resultSet = null;
PreparedStatement statement = null;
@@ -752,7 +751,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
}
public List<String> getStoredUsers() {
ArrayList<String> users = new ArrayList<String>();
ArrayList<String> users = new ArrayList<>();
Statement statement = null;
Connection connection = null;
@@ -1070,10 +1069,10 @@ public final class SQLDatabaseManager implements DatabaseManager {
}
private PlayerProfile loadFromResult(String playerName, ResultSet result) throws SQLException {
Map<PrimarySkillType, Integer> skills = new EnumMap<PrimarySkillType, Integer>(PrimarySkillType.class); // Skill & Level
Map<PrimarySkillType, Float> skillsXp = new EnumMap<PrimarySkillType, Float>(PrimarySkillType.class); // Skill & XP
Map<SuperAbilityType, Integer> skillsDATS = new EnumMap<SuperAbilityType, Integer>(SuperAbilityType.class); // Ability & Cooldown
Map<UniqueDataType, Integer> uniqueData = new EnumMap<UniqueDataType, Integer>(UniqueDataType.class); //Chimaera wing cooldown and other misc info
Map<PrimarySkillType, Integer> skills = new EnumMap<>(PrimarySkillType.class); // Skill & Level
Map<PrimarySkillType, Float> skillsXp = new EnumMap<>(PrimarySkillType.class); // Skill & XP
Map<SuperAbilityType, Integer> skillsDATS = new EnumMap<>(SuperAbilityType.class); // Ability & Cooldown
Map<UniqueDataType, Integer> uniqueData = new EnumMap<>(UniqueDataType.class); //Chimaera wing cooldown and other misc info
MobHealthbarType mobHealthbarType;
UUID uuid;
int scoreboardTipsShown;
@@ -1316,7 +1315,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
private class GetUUIDUpdatesRequired extends BukkitRunnable {
public void run() {
massUpdateLock.lock();
List<String> names = new ArrayList<String>();
List<String> names = new ArrayList<>();
Connection connection = null;
Statement statement = null;
ResultSet resultSet = null;