From 1023a165ab8a77d80c26c169e66732037da24b10 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 4 Apr 2021 18:02:24 +0200 Subject: [PATCH] Remove BauweltMember.build --- .../src/de/steamwar/sql/BauweltMember.java | 31 ++++++------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/SpigotCore_Main/src/de/steamwar/sql/BauweltMember.java b/SpigotCore_Main/src/de/steamwar/sql/BauweltMember.java index 9c1734d..4e0ed39 100644 --- a/SpigotCore_Main/src/de/steamwar/sql/BauweltMember.java +++ b/SpigotCore_Main/src/de/steamwar/sql/BauweltMember.java @@ -29,16 +29,14 @@ import java.util.UUID; public class BauweltMember{ private final int bauweltID; private final int memberID; - private boolean build; private boolean worldEdit; private boolean world; private static final List members = new ArrayList<>(); - private BauweltMember(int ownerID, int memberID, boolean build, boolean worldEdit, boolean world, boolean updateDB){ + private BauweltMember(int ownerID, int memberID, boolean worldEdit, boolean world, boolean updateDB){ bauweltID = ownerID; this.memberID = memberID; - this.build = build; this.worldEdit = worldEdit; this.world = world; if(updateDB) @@ -46,12 +44,12 @@ public class BauweltMember{ members.add(this); } - public BauweltMember(int ownerID, int memberID, boolean build, boolean worldEdit, boolean world){ - this(ownerID, memberID, build, worldEdit, world, true); + public BauweltMember(int ownerID, int memberID, boolean worldEdit, boolean world){ + this(ownerID, memberID, worldEdit, world, true); } - public BauweltMember(UUID ownerID, UUID memberID, boolean build, boolean worldEdit, boolean world){ - this(SteamwarUser.get(ownerID).getId(), SteamwarUser.get(memberID).getId(), build, worldEdit, world, true); + public BauweltMember(UUID ownerID, UUID memberID, boolean worldEdit, boolean world){ + this(SteamwarUser.get(ownerID).getId(), SteamwarUser.get(memberID).getId(), worldEdit, world, true); } public void remove(){ @@ -60,8 +58,8 @@ public class BauweltMember{ } private void updateDB(){ - SQL.update("INSERT INTO BauweltMember (BauweltID, MemberID, Build, WorldEdit, World) VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE Build = VALUES(Build), WorldEdit = VALUES(WorldEdit), World = VALUES(World)", - bauweltID, memberID, build, worldEdit, world); + SQL.update("INSERT INTO BauweltMember (BauweltID, MemberID, WorldEdit, World) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE WorldEdit = VALUES(WorldEdit), World = VALUES(World)", + bauweltID, memberID, worldEdit, world); } public static BauweltMember getBauMember(UUID ownerID, UUID memberID){ @@ -77,10 +75,9 @@ public class BauweltMember{ if(member == null || !member.next()){ return null; } - boolean build = member.getBoolean("Build"); boolean worldEdit = member.getBoolean("WorldEdit"); boolean testblock = member.getBoolean("World"); - return new BauweltMember(ownerID, memberID, build, worldEdit, testblock, false); + return new BauweltMember(ownerID, memberID, worldEdit, testblock, false); } catch (SQLException e) { throw new SecurityException("Did not get member", e); } @@ -96,10 +93,9 @@ public class BauweltMember{ List members = new LinkedList<>(); while(memberlist.next()){ int memberID = memberlist.getInt("MemberID"); - boolean build = memberlist.getBoolean("Build"); boolean worldEdit = memberlist.getBoolean("WorldEdit"); boolean testblock = memberlist.getBoolean("World"); - members.add(new BauweltMember(bauweltID, memberID, build, worldEdit, testblock, false)); + members.add(new BauweltMember(bauweltID, memberID, worldEdit, testblock, false)); } return members; }catch(SQLException e){ @@ -115,15 +111,6 @@ public class BauweltMember{ return memberID; } - public boolean isBuild() { - return build; - } - - public void setBuild(boolean build) { - this.build = build; - updateDB(); - } - public boolean isWorldEdit() { return worldEdit; }