Change code style
This commit is contained in:
@@ -42,11 +42,10 @@ import org.bukkit.material.Stairs;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class Setup {
|
||||
|
||||
|
||||
|
||||
public static void setupConfig() {
|
||||
Core.getMainClass().getConfig().addDefault("no-damage", false);
|
||||
Core.getMainClass().getConfig().addDefault("no-void-death",false);
|
||||
Core.getMainClass().getConfig().addDefault("no-void-death", false);
|
||||
Core.getMainClass().getConfig().addDefault("no-change-blocks", false);
|
||||
Core.getMainClass().getConfig().addDefault("is-main-lobby", false);
|
||||
Core.getMainClass().getConfig().addDefault("no-hunger", false);
|
||||
@@ -61,7 +60,7 @@ public class Setup {
|
||||
Core.getMainClass().getConfig().options().copyDefaults(true);
|
||||
Core.getMainClass().getConfig().options().header("Config File of the Anura Core-Plugin:");
|
||||
}
|
||||
|
||||
|
||||
public static void setupEvents() {
|
||||
new PlayerJoin(Core.getMainClass());
|
||||
new PlayerMove(Core.getMainClass());
|
||||
@@ -84,7 +83,7 @@ public class Setup {
|
||||
new InvClick(Core.getMainClass());
|
||||
new BlockSpread(Core.getMainClass());
|
||||
}
|
||||
|
||||
|
||||
public static void setupClasses() {
|
||||
Core.getMainClass().lang = new LanguageSupport(Core.getMainClass());
|
||||
new Inventories(Core.getMainClass());
|
||||
@@ -95,14 +94,14 @@ public class Setup {
|
||||
RealTime.setup();
|
||||
ResultSet rs = sql.querySelect("SELECT id, X, Y, Z, world, type, waitTime FROM corePots");
|
||||
try {
|
||||
while(rs.next())
|
||||
{
|
||||
while (rs.next()) {
|
||||
World w = Bukkit.getWorld(rs.getString("world"));
|
||||
if(w == null) continue;
|
||||
if (w == null) {
|
||||
continue;
|
||||
}
|
||||
Location l = new Location(w, rs.getInt("X"), rs.getInt("Y"), rs.getInt("Z"));
|
||||
Core.getMainClass().flowerPots.put(rs.getInt("id"), l);
|
||||
if (rs.getBoolean("type"))
|
||||
{
|
||||
if (rs.getBoolean("type")) {
|
||||
Core.getMainClass().flowerPotsWait.put(rs.getInt("id"), rs.getInt("waitTime"));
|
||||
}
|
||||
l.getBlock().setType(Material.BROWN_MUSHROOM);
|
||||
@@ -113,45 +112,40 @@ public class Setup {
|
||||
Core.getMainClass().features = new Features();
|
||||
Core.getMainClass().features.updateFeaturesAll();
|
||||
}
|
||||
|
||||
|
||||
public static void setupTasks() {
|
||||
Bukkit.getScheduler().scheduleSyncRepeatingTask(Core.getMainClass(), new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
for(Player P : Core.getMainClass().golfPower.keySet())
|
||||
{
|
||||
if(Core.getMainClass().releaseGolf.get(P))
|
||||
{
|
||||
for (Player P : Core.getMainClass().golfPower.keySet()) {
|
||||
if (Core.getMainClass().releaseGolf.get(P)) {
|
||||
P.setExp(0);
|
||||
int power = Core.getMainClass().golfPower.get(P);
|
||||
Entity i = Core.getMainClass().golfBall.get(P);
|
||||
if(i != null && i.isValid())
|
||||
{
|
||||
if (i != null && i.isValid()) {
|
||||
Vector v = P.getLocation().getDirection();
|
||||
v.multiply(new Vector(power / 10 + 1,1.2,power / 10 + 1));
|
||||
v.multiply(new Vector(power / 10 + 1, 1.2, power / 10 + 1));
|
||||
i.setVelocity(v);
|
||||
}
|
||||
Core.getMainClass().golfPower.remove(P);
|
||||
Core.getMainClass().releaseGolf.remove(P);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Core.getMainClass().releaseGolf.put(P, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}, 5, 5);
|
||||
ResultSet rs = sql.querySelect("SELECT world, X, Y, Z FROM coreStairs WHERE server = '"+Core.getMainClass().getConfig().getString("server-name")+"'");
|
||||
ResultSet rs = sql.querySelect("SELECT world, X, Y, Z FROM coreStairs WHERE server = '" + Core.getMainClass().getConfig().getString("server-name") + "'");
|
||||
try {
|
||||
while(rs.next())
|
||||
{
|
||||
while (rs.next()) {
|
||||
World w = Bukkit.getWorld(rs.getString("world"));
|
||||
if(w == null) continue;
|
||||
if (w == null) {
|
||||
continue;
|
||||
}
|
||||
Location l = new Location(w, rs.getInt("X"), rs.getInt("Y"), rs.getInt("Z"));
|
||||
if(l.getBlock().getState().getData() instanceof Stairs)
|
||||
{
|
||||
if (l.getBlock().getState().getData() instanceof Stairs) {
|
||||
Core.getMainClass().sittableBlocks.add(l.getBlock());
|
||||
}
|
||||
}
|
||||
@@ -163,10 +157,9 @@ public class Setup {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
for(Player p : AnuraCore.getInstance().sittingPlayer.keySet())
|
||||
{
|
||||
for (Player p : AnuraCore.getInstance().sittingPlayer.keySet()) {
|
||||
Location loc = AnuraCore.getInstance().sittingPlayer.get(p).getLocation();
|
||||
Arrow a = loc.getWorld().spawnArrow(loc, new Vector(0,0,0), 0, 0);
|
||||
Arrow a = loc.getWorld().spawnArrow(loc, new Vector(0, 0, 0), 0, 0);
|
||||
a.setPassenger(p);
|
||||
AnuraCore.getInstance().sittingPlayer.get(p).remove();
|
||||
AnuraCore.getInstance().sittingPlayer.put(p, a);
|
||||
@@ -179,15 +172,15 @@ public class Setup {
|
||||
public void run() {
|
||||
AnuraCore.getInstance().signs.updateServerSigns();
|
||||
}
|
||||
}, 20*5, 20*5);
|
||||
}, 20 * 5, 20 * 5);
|
||||
}
|
||||
|
||||
|
||||
public static void setupCommands() {
|
||||
TeamCommands tc = new TeamCommands();
|
||||
AdminCommands ac = new AdminCommands();
|
||||
PlayerCommands pc = new PlayerCommands();
|
||||
OtherCommands oc = new OtherCommands();
|
||||
|
||||
|
||||
Core.getMainClass().getCommand("setjumper").setExecutor(tc);
|
||||
Core.getMainClass().getCommand("setspawn").setExecutor(ac);
|
||||
Core.getMainClass().getCommand("spawn").setExecutor(pc);
|
||||
@@ -215,7 +208,7 @@ public class Setup {
|
||||
Core.getMainClass().getCommand("leaveminigame").setExecutor(pc);
|
||||
Core.getMainClass().getCommand("toggleminigame").setExecutor(pc);
|
||||
}
|
||||
|
||||
|
||||
public static void setupInventories() {
|
||||
Inventories.registerInventory("GAMEMODES", "select_gamemode_inv", ChatColor.DARK_BLUE);
|
||||
Inventories.putIntoInventory("GAMEMODES", 0, Inventories.buildItems(Material.RED_ROSE, "inv_lobby_tps", ChatColor.DARK_GREEN));
|
||||
@@ -258,8 +251,7 @@ public class Setup {
|
||||
|
||||
Inventories.registerInventory("LANGUAGE", "Select language", ChatColor.DARK_BLUE);
|
||||
int i = 0;
|
||||
for(String langu : Core.getMainClass().lang.languages.keySet())
|
||||
{
|
||||
for (String langu : Core.getMainClass().lang.languages.keySet()) {
|
||||
Inventories.putIntoInventory("LANGUAGE", i, Inventories.buildItems(Material.BOOK_AND_QUILL, Core.getMainClass().lang.languages.get(langu), ChatColor.DARK_GREEN, ChatColor.GOLD, "set_lang_to", Core.getMainClass().lang.languages.get(langu)));
|
||||
Inventories.registerAction("LANGUAGE", i, Inventories.Action.LANGUAGE, langu);
|
||||
i++;
|
||||
|
||||
Reference in New Issue
Block a user