Refactoring
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package de.anura.core;
|
||||
|
||||
import de.anura.core.API.Core;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
@@ -48,7 +49,7 @@ public class Features implements Listener {
|
||||
{
|
||||
if(!mainLobby()) return;
|
||||
try {
|
||||
ResultSet rs = API.getMySql().querySelect("SELECT featureId FROM coreFeatures WHERE playerId = (SELECT id FROM players WHERE uuid = '"+P.getUniqueId().toString()+"')");
|
||||
ResultSet rs = Core.getMySql().querySelect("SELECT featureId FROM coreFeatures WHERE playerId = (SELECT id FROM players WHERE uuid = '"+P.getUniqueId().toString()+"')");
|
||||
resetPlayerFeatures(P);
|
||||
playerFeatures.put(P, new ArrayList<Feature>());
|
||||
featureEnabled.put(P, new HashMap<Feature, Boolean>());
|
||||
@@ -85,12 +86,12 @@ public class Features implements Listener {
|
||||
if(!mainLobby()) return;
|
||||
if (f == Feature.DOUBLE_JUMP) {
|
||||
if (!hasFeature(P, f)) {
|
||||
API.statusMsg(P, "dont_have_dbl_jump", false);
|
||||
Core.statusMsg(P, "dont_have_dbl_jump", false);
|
||||
return;
|
||||
}
|
||||
featureEnabled.get(P).put(f, false);
|
||||
canDoubleJump.put(P, false);
|
||||
API.statusMsg(P, "dbl_jump_off", true);
|
||||
Core.statusMsg(P, "dbl_jump_off", true);
|
||||
if (P.getGameMode() != GameMode.CREATIVE) {
|
||||
P.setAllowFlight(false);
|
||||
}
|
||||
@@ -101,13 +102,13 @@ public class Features implements Listener {
|
||||
if(!mainLobby()) return;
|
||||
if (f == Feature.DOUBLE_JUMP) {
|
||||
if (!hasFeature(P, f)) {
|
||||
API.statusMsg(P, "dont_have_dbl_jump", false);
|
||||
Core.statusMsg(P, "dont_have_dbl_jump", false);
|
||||
return;
|
||||
}
|
||||
featureEnabled.get(P).put(f, true);
|
||||
P.setAllowFlight(true);
|
||||
canDoubleJump.put(P, true);
|
||||
API.statusMsg(P, "dbl_jump_on", true);
|
||||
Core.statusMsg(P, "dbl_jump_on", true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user