diff --git a/.classpath b/.classpath index c9ea35b..e4f252d 100644 --- a/.classpath +++ b/.classpath @@ -2,12 +2,6 @@ - - - - - - @@ -17,5 +11,10 @@ + + + + + diff --git a/lib/bukkit-1.7.2-R0.3-javadoc.jar b/lib/bukkit-1.7.2-R0.3-javadoc.zip similarity index 100% rename from lib/bukkit-1.7.2-R0.3-javadoc.jar rename to lib/bukkit-1.7.2-R0.3-javadoc.zip diff --git a/lib/bukkit-1.7.2-R0.3.jar b/lib/bukkit-1.7.2-R0.3.jar deleted file mode 100644 index 3d81db1..0000000 Binary files a/lib/bukkit-1.7.2-R0.3.jar and /dev/null differ diff --git a/lib/craftbukkit-1.7.2-R0.3.jar b/lib/craftbukkit-1.7.2-R0.4-20140316.221310-4.jar similarity index 90% rename from lib/craftbukkit-1.7.2-R0.3.jar rename to lib/craftbukkit-1.7.2-R0.4-20140316.221310-4.jar index 5d1ad32..11f6a5c 100644 Binary files a/lib/craftbukkit-1.7.2-R0.3.jar and b/lib/craftbukkit-1.7.2-R0.4-20140316.221310-4.jar differ diff --git a/lib/craftbukkit-1.7.2-R0.3.src.zip b/lib/craftbukkit-1.7.2-R0.4-20140316.221310-4.src.zip similarity index 86% rename from lib/craftbukkit-1.7.2-R0.3.src.zip rename to lib/craftbukkit-1.7.2-R0.4-20140316.221310-4.src.zip index 6261b9c..3760a06 100644 Binary files a/lib/craftbukkit-1.7.2-R0.3.src.zip and b/lib/craftbukkit-1.7.2-R0.4-20140316.221310-4.src.zip differ diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/PandacraftUtils.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/PandacraftUtils.java index fe67c2f..456f3d6 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/PandacraftUtils.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/PandacraftUtils.java @@ -4,6 +4,7 @@ import java.sql.SQLException; import net.mc_pandacraft.java.plugin.pandacraftutils.commands.PandacraftUtilsCommandsManager; import net.mc_pandacraft.java.plugin.pandacraftutils.config.ConfigManager; +import net.mc_pandacraft.java.plugin.pandacraftutils.data_model.SQLManager; import net.mc_pandacraft.java.plugin.pandacraftutils.modules.AutoMessagesManager; import net.mc_pandacraft.java.plugin.pandacraftutils.modules.CalculatorManager; import net.mc_pandacraft.java.plugin.pandacraftutils.modules.CommandAliasManager; @@ -106,6 +107,7 @@ public class PandacraftUtils extends JavaPlugin { ConfigManager.loadNewInstance(); + SQLManager.loadNewInstance(); OnlinePlayerManager.loadNewInstance(); PandacraftUtilsCommandsManager.loadNewInstance(); diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/commands/CommandList.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/commands/CommandList.java index 4be1034..9b3cd5a 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/commands/CommandList.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/commands/CommandList.java @@ -15,6 +15,7 @@ import org.bukkit.World; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer; +import org.bukkit.entity.Damageable; import org.bukkit.entity.Player; public class CommandList extends AbstractCommandExecutor { @@ -184,7 +185,7 @@ public class CommandList extends AbstractCommandExecutor { else if (args.length > 0 && (args[0].toLowerCase().equals("gm") || args[0].toLowerCase().equals("gamemode"))) { String world = p.getWorld().getName(); - double health = Math.rint(p.getHealth()*100)/100; + double health = Math.rint(((Damageable)p).getHealth()*100)/100; double eat = Math.rint(p.getFoodLevel()*100)/100; boolean flyMode = p.getAllowFlight(); String gm = (p.getGameMode() == GameMode.SURVIVAL)?("§CSurvie§r;vie:§7"+health+"§r;faim:§7"+eat+"§r"+((flyMode)?";§7canFly":"")) diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/ModoHistoryElement.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/ModoHistoryElement.java index 8ea8942..ee35ce9 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/ModoHistoryElement.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/ModoHistoryElement.java @@ -47,7 +47,7 @@ public class ModoHistoryElement extends SQLElement { "actionType", "time", "playerName", - "duration", + "value", "message" }; } diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/SQLElement.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/SQLElement.java index cd3baf5..d5bbf1e 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/SQLElement.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/SQLElement.java @@ -25,8 +25,8 @@ public abstract class SQLElement { protected SQLElement(String name) { - this(name, 0); - + tableName = name; + saved = false; } protected SQLElement(String name, int id) { tableName = name; @@ -39,7 +39,6 @@ public abstract class SQLElement { public void save() { - String tableName = this.getClass().getSimpleName(); try { Connection conn; @@ -54,9 +53,12 @@ public abstract class SQLElement { String sql = ""; for (int i=0; i 0) + sql = sql.substring(0, sql.length()-1); + PreparedStatement st = conn.prepareStatement("UPDATE "+tableName+" SET "+sql+" WHERE id="+id); for (int i=0; i