· 9 years ago · Dec 09, 2016, 08:50 PM
1 public static void TablePlayerData() throws SQLException {
2 Statement statement = Main.getConnection().createStatement();
3 statement.executeUpdate(
4 "CREATE TABLE IF NOT EXISTS Minetopia_PlayerData (PlayerUUID varchar(255), PlayerName varchar(255), Money int, Level int, Lening int, Time int)");
5 }
6
7 public static void TableInsaneCoins() throws SQLException {
8 Statement statement = Main.getConnection().createStatement();
9 statement.executeUpdate("CREATE TABLE IF NOT EXISTS Minetopia_GameCoins(PlayerName varchar(255), Coins int)");
10 }
11
12 public static void TableChat() throws SQLException {
13 Statement statement = Main.getConnection().createStatement();
14 statement.executeUpdate(
15 "CREATE TABLE IF NOT EXISTS Minetopia_Chat(PlayerName varchar(255), Prefix varchar(255), ChatColor varchar(255), "
16 + "NameColor varchar(255), World varchar(255))");
17 }
18
19 public static void TableFitheid() throws SQLException {
20 Statement statement = Main.getConnection().createStatement();
21 statement.executeUpdate(
22 "CREATE TABLE IF NOT EXISTS Minetopia_Fitheid(PlayerName varchar(255), Fitheid int, Swum int, Run int, Eat int, Drink int, "
23 + "Death int, Punishrun int, Punishfood int)");
24 }
25
26
27 public void save() {
28 try {
29 Statement statement = Main.getConnection().createStatement();
30 int Time = (this.day * 86400) + (this.hour * 3600) + (this.minute * 60) + this.second;
31 statement.executeUpdate(
32 "UPDATE Minetopia_PlayerData SET Money=" + this.money + ", Level=" + this.level + ", Lening="
33 + this.lening + ", Time = " + Time + " WHERE PlayerUUID = '" + this.p.getUniqueId() + "'");
34 } catch (SQLException e) {
35 e.printStackTrace();
36 }
37 }
38
39 public void save() {
40 try {
41 Statement statement = Main.getConnection().createStatement();
42 statement.executeUpdate("UPDATE Minetopia_Chat SET Prefix = '" + this.Prefix + "', ChatColor = '"
43 + this.ChatColor + "', NameColor = '" + this.NameColor + "', World = '" + this.world
44 + "' WHERE PlayerName = '" + p.getName() + "'");
45 } catch (SQLException e) {
46 e.printStackTrace();
47 }
48 }
49
50 public void save() {
51 try {
52 updateFitheid(p);
53 Statement statement = Main.getConnection().createStatement();
54 statement.executeUpdate("UPDATE Minetopia_Fitheid SET Fitheid=" + this.fitheid + ", Swum=" + this.swum
55 + ", Run=" + this.run + ", Eat=" + this.eat + ", Drink=" + this.drink + ", Death=" + this.death
56 + ", Punishrun=" + this.punishrun + ", Punishfood=" + this.punishfood + " WHERE PlayerName ='"
57 + p.getName() + "'");
58 } catch (SQLException e) {
59 e.printStackTrace();
60 }
61 }
62
63 public void save() {
64 try {
65 Statement statement = Main.getConnection().createStatement();
66 statement.executeUpdate("UPDATE Minetopia_GameCoins SET Coins = " + coins + " WHERE PlayerName = '" + p.getName() + "'");
67 } catch(SQLException e) {
68 e.printStackTrace();
69 }
70 }