diff --git a/src/de/warking/schematicsystem/commands/SchematicCommand.java b/src/de/warking/schematicsystem/commands/SchematicCommand.java index f5755cc..c2db2ad 100644 --- a/src/de/warking/schematicsystem/commands/SchematicCommand.java +++ b/src/de/warking/schematicsystem/commands/SchematicCommand.java @@ -149,6 +149,14 @@ public class SchematicCommand implements CommandExecutor { File file = new File(SchematicSystem.SCHEM_DIR + player.getUniqueId() + "/" + args[1] + ".schematic"); file.delete(); schematic.remove(); + + List checkedSchematics = CheckedSchematic.getLastDeclined(player.getUniqueId()); + for(CheckedSchematic checkedSchematic : checkedSchematics) { + if(checkedSchematic.getSchemOwner() == schematic.getSchemOwner() && + checkedSchematic.getSchemName() == schematic.getSchemName()) + checkedSchematic.remove(); + } + player.sendMessage(SchematicSystem.PREFIX + "Schematic §6" + args[1] + " §7gelöscht."); return false; } else { diff --git a/src/de/warking/schematicsystem/utils/CheckedSchematic.java b/src/de/warking/schematicsystem/utils/CheckedSchematic.java index e5a6d61..aed6631 100644 --- a/src/de/warking/schematicsystem/utils/CheckedSchematic.java +++ b/src/de/warking/schematicsystem/utils/CheckedSchematic.java @@ -1,5 +1,6 @@ package de.warking.schematicsystem.utils; +import de.warking.hunjy.Core; import de.warking.hunjy.MySQL.MySQL; import de.warking.hunjy.MySQL.WarkingUser; @@ -73,6 +74,10 @@ public class CheckedSchematic { return lastDeclined; } + public void remove() { + Core.sql.update("DELETE FROM CheckedSchematic WHERE SchemOwner = " + this.SchemOwner + " AND SchemName = '" + this.SchemName + "'"); + } + public String getSchemName() { return SchemName; }