1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 22:13:25 +01:00
This commit is contained in:
montlikadani 2020-12-05 17:41:00 +01:00
parent 67614adc76
commit 7f9c125c55
5 changed files with 12 additions and 29 deletions

View File

@ -24,7 +24,7 @@ public class BossBarManager {
this.plugin = plugin;
}
public synchronized void ShowJobProgression(final JobsPlayer player) {
public void ShowJobProgression(final JobsPlayer player) {
if (Version.getCurrent().isLower(Version.v1_9_R1) || player == null)
return;
@ -36,7 +36,7 @@ public class BossBarManager {
player.clearUpdateBossBarFor();
}
public synchronized void ShowJobProgression(final JobsPlayer player, final JobProgression jobProg, double expGain) {
public void ShowJobProgression(final JobsPlayer player, final JobProgression jobProg, double expGain) {
if (Version.getCurrent().isLower(Version.v1_9_R1) || !Jobs.getGCManager().BossBarsMessageByDefault)
return;

View File

@ -104,7 +104,7 @@ public class RestrictedAreaManager {
* @param player
* @return - the multiplier
*/
public synchronized double getRestrictedMultiplier(Player player) {
public double getRestrictedMultiplier(Player player) {
if (player == null)
return 0D;
for (RestrictedArea area : getRestrictedAreasByLoc(player.getLocation())) {
@ -116,7 +116,7 @@ public class RestrictedAreaManager {
return 0D;
}
public synchronized List<RestrictedArea> getRestrictedAreasByLoc(Location loc) {
public List<RestrictedArea> getRestrictedAreasByLoc(Location loc) {
List<RestrictedArea> areas = new ArrayList<>();
for (RestrictedArea area : restrictedAreas.values()) {
if (area.inRestrictedArea(loc))
@ -129,7 +129,7 @@ public class RestrictedAreaManager {
return areas;
}
public synchronized List<RestrictedArea> getRestrictedAreasByName(String name) {
public List<RestrictedArea> getRestrictedAreasByName(String name) {
List<RestrictedArea> areas = new ArrayList<>();
for (Entry<String, RestrictedArea> area : restrictedAreas.entrySet()) {
if (area.getKey().equalsIgnoreCase(name))

View File

@ -13,7 +13,7 @@ public class JobsConnection {
this.conn = conn;
}
public synchronized Connection getConnection() {
public Connection getConnection() {
return conn;
}

View File

@ -28,24 +28,15 @@ public class JobsMySQL extends JobsDAO {
}
@Override
protected synchronized void checkUpdate() throws SQLException {
protected void checkUpdate() throws SQLException {
JobsConnection conn = getConnection();
if (conn == null) {
Jobs.consoleMsg("&cCould not run database updates! Could not connect to MySQL!");
return;
}
createDefaultUsersBase();
}
private boolean createDefaultUsersBase() {
try {
executeSQL("CREATE TABLE `" + getPrefix()
+ "users` (`id` int NOT NULL AUTO_INCREMENT PRIMARY KEY, `player_uuid` varchar(36) NOT NULL, `username` varchar(20), `seen` bigint);");
} catch (SQLException e) {
e.printStackTrace();
return false;
}
return true;
executeSQL("CREATE TABLE `" + getPrefix()
+ "users` (`id` int NOT NULL AUTO_INCREMENT PRIMARY KEY, `player_uuid` varchar(36) NOT NULL, `username` varchar(20), `seen` bigint);");
}
@Override

View File

@ -32,23 +32,15 @@ public class JobsSQLite extends JobsDAO {
}
@Override
protected synchronized void checkUpdate() throws SQLException {
protected void checkUpdate() throws SQLException {
JobsConnection conn = getConnection();
if (conn == null) {
Jobs.consoleMsg("&cCould not run database updates! Could not connect to MySQL!");
Jobs.consoleMsg("&cCould not run database updates! Could not connect to MySQL!");
return;
}
createDefaultUsersBase();
}
private boolean createDefaultUsersBase() {
try {
executeSQL("CREATE TABLE `" + getPrefix()
executeSQL("CREATE TABLE `" + getPrefix()
+ "users` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `player_uuid` varchar(36) NOT NULL, `username` varchar(20), `data` text);");
} catch (SQLException e) {
return false;
}
return true;
}
@Override