- Some minor fixes and improvements
This commit is contained in:
@@ -49,7 +49,7 @@ public class Core {
|
|||||||
*/
|
*/
|
||||||
public static String getl(String id, String lang) {
|
public static String getl(String id, String lang) {
|
||||||
String val = AnuraCore.getInstance().lang.get(id, lang);
|
String val = AnuraCore.getInstance().lang.get(id, lang);
|
||||||
if (val == null || val.equals("")) {
|
if (val == null || val.isEmpty()) {
|
||||||
val = AnuraCore.getInstance().lang.get(id, "en");
|
val = AnuraCore.getInstance().lang.get(id, "en");
|
||||||
}
|
}
|
||||||
return val;
|
return val;
|
||||||
@@ -125,10 +125,13 @@ public class Core {
|
|||||||
Player p = (Player) P;
|
Player p = (Player) P;
|
||||||
if (!Core.cachedPlayerLanguage.containsKey(p)) {
|
if (!Core.cachedPlayerLanguage.containsKey(p)) {
|
||||||
ResultSet rs = AnuraCore.sql.querySelect("SELECT lang FROM players WHERE uuid = '" + p.getUniqueId().toString() + "'");
|
ResultSet rs = AnuraCore.sql.querySelect("SELECT lang FROM players WHERE uuid = '" + p.getUniqueId().toString() + "'");
|
||||||
|
if (!rs.next()) {
|
||||||
rs.first();
|
//This is a weird bug
|
||||||
Core.cachedPlayerLanguage.put(p, rs.getString("lang"));
|
Core.cachedPlayerLanguage.put(p, "de");
|
||||||
return rs.getString("lang");
|
return "de";
|
||||||
|
}
|
||||||
|
Core.cachedPlayerLanguage.put(p, rs.getString("lang"));
|
||||||
|
return rs.getString("lang");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return Core.cachedPlayerLanguage.get(p);
|
return Core.cachedPlayerLanguage.get(p);
|
||||||
@@ -198,7 +201,7 @@ public class Core {
|
|||||||
if (md instanceof Stairs) {
|
if (md instanceof Stairs) {
|
||||||
Stairs s = (Stairs) md;
|
Stairs s = (Stairs) md;
|
||||||
Location loc = getMainClass().sittingBlocks.get(P).getRelative(s.getFacing()).getLocation();
|
Location loc = getMainClass().sittingBlocks.get(P).getRelative(s.getFacing()).getLocation();
|
||||||
Entity a = (Entity) getMainClass().sittingPlayer.get(P);
|
Entity a = getMainClass().sittingPlayer.get(P);
|
||||||
P.teleport(loc);
|
P.teleport(loc);
|
||||||
a.remove();
|
a.remove();
|
||||||
if (!noRemove) {
|
if (!noRemove) {
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import de.anura.core.API.Errors;
|
|||||||
import de.anura.core.API.Inventories;
|
import de.anura.core.API.Inventories;
|
||||||
import de.anura.core.API.Level;
|
import de.anura.core.API.Level;
|
||||||
import de.anura.core.API.Tools;
|
import de.anura.core.API.Tools;
|
||||||
import static de.anura.core.AnuraCore.sql;
|
|
||||||
import de.anura.core.commands.*;
|
import de.anura.core.commands.*;
|
||||||
import de.anura.core.events.*;
|
import de.anura.core.events.*;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@@ -88,7 +87,7 @@ public class Setup {
|
|||||||
Core.getMainClass().signs = new Signs();
|
Core.getMainClass().signs = new Signs();
|
||||||
Core.getMainClass().level = new Level();
|
Core.getMainClass().level = new Level();
|
||||||
RealTime.setup();
|
RealTime.setup();
|
||||||
ResultSet rs = sql.querySelect("SELECT id, X, Y, Z, world, type, waitTime FROM corePots");
|
ResultSet rs = Core.getMySql().querySelect("SELECT id, X, Y, Z, world, type, waitTime FROM corePots");
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
World w = Bukkit.getWorld(rs.getString("world"));
|
World w = Bukkit.getWorld(rs.getString("world"));
|
||||||
if (w == null) {
|
if (w == null) {
|
||||||
@@ -133,7 +132,7 @@ public class Setup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}, 5, 5);
|
}, 5, 5);
|
||||||
ResultSet rs = sql.querySelect("SELECT world, X, Y, Z FROM coreStairs WHERE server = '" + Core.getMainClass().getConfig().getString("server-name") + "'");
|
ResultSet rs = Core.getMySql().querySelect("SELECT world, X, Y, Z FROM coreStairs WHERE server = '" + Core.getMainClass().getConfig().getString("server-name") + "'");
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
World w = Bukkit.getWorld(rs.getString("world"));
|
World w = Bukkit.getWorld(rs.getString("world"));
|
||||||
if (w == null) {
|
if (w == null) {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import java.net.MalformedURLException;
|
|||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
|
import java.util.HashSet;
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
@@ -52,11 +53,13 @@ public class TeamCommands implements CommandExecutor {
|
|||||||
Core.statusMsg(sender, "wrong_args_count", false);
|
Core.statusMsg(sender, "wrong_args_count", false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Block b = P.getTargetBlock(null, 100);
|
HashSet<Material> transparent = new HashSet<>();
|
||||||
|
transparent.add(Material.AIR);
|
||||||
|
Block b = P.getTargetBlock(transparent, 100);
|
||||||
if (b.getType().equals(Material.COMMAND)) {
|
if (b.getType().equals(Material.COMMAND)) {
|
||||||
String command = "";
|
String command = "";
|
||||||
for (String arg : args) {
|
for (String arg : args) {
|
||||||
if (!command.equals("")) {
|
if (!command.isEmpty()) {
|
||||||
command += " ";
|
command += " ";
|
||||||
}
|
}
|
||||||
command += arg;
|
command += arg;
|
||||||
@@ -79,12 +82,14 @@ public class TeamCommands implements CommandExecutor {
|
|||||||
Core.statusMsg(sender, "wrong_args_count", false);
|
Core.statusMsg(sender, "wrong_args_count", false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Block b = P.getTargetBlock(null, 100);
|
HashSet<Material> transparent = new HashSet<>();
|
||||||
|
transparent.add(Material.AIR);
|
||||||
|
Block b = P.getTargetBlock(transparent, 100);
|
||||||
if (b.getType().equals(Material.COMMAND)) {
|
if (b.getType().equals(Material.COMMAND)) {
|
||||||
CommandBlock cb = (CommandBlock) b.getState();
|
CommandBlock cb = (CommandBlock) b.getState();
|
||||||
String command = "";
|
String command = "";
|
||||||
for (String arg : args) {
|
for (String arg : args) {
|
||||||
if (!command.equals("")) {
|
if (!command.isEmpty()) {
|
||||||
command += " ";
|
command += " ";
|
||||||
}
|
}
|
||||||
command += arg;
|
command += arg;
|
||||||
@@ -210,7 +215,7 @@ public class TeamCommands implements CommandExecutor {
|
|||||||
w.setTime(2000);
|
w.setTime(2000);
|
||||||
w.setThundering(false);
|
w.setThundering(false);
|
||||||
w.setStorm(false);
|
w.setStorm(false);
|
||||||
Core.getMainClass().tools.sendStatusMsg(sender, "Sun!", true);
|
Tools.sendStatusMsg(sender, "Sun!", true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user