From 7d3fffa9dad5d42d796eb425ec6cdae0d2680f9c Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sun, 2 Apr 2023 10:38:17 +0200 Subject: [PATCH] Revert "Add AI" This reverts commit ccdfb40d711a500d62e9e6a93789e82606086188. Revert "Fix AI" This reverts commit c664e08fa6d493439744a650bc31c4f0d0fd94de. Revert "Fix AI" This reverts commit 169e4fd75f28e0c0c7a24049353042618895d2b5. Revert "Fix AI" This reverts commit e81f4a314fdd3643edb4518147198349462e149c. Revert "Fix AI" This reverts commit 985f11e96849c2850bbb307ed98dd2c4a4d0e9e8. Revert "Fix AI" This reverts commit 33d6a9ad531c099f0977af2c7ec9632d2453cac7. Revert "Fix AI" This reverts commit eef545d28261a927fd3d3c90227c2c01c54fc0b6. --- .../src/SchematicSystem.properties | 7 +- .../schematicsystem/SchematicSystem.java | 2 - .../commands/AprilCommand.java | 65 ------------------- 3 files changed, 1 insertion(+), 73 deletions(-) delete mode 100644 SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/AprilCommand.java diff --git a/SchematicSystem_Core/src/SchematicSystem.properties b/SchematicSystem_Core/src/SchematicSystem.properties index f379876..60acc26 100644 --- a/SchematicSystem_Core/src/SchematicSystem.properties +++ b/SchematicSystem_Core/src/SchematicSystem.properties @@ -259,9 +259,4 @@ AUTO_CHECKER_RESULT_RECORD=§7Record: §c[{0}, {1}, {2}] AUTO_CHECKER_RESULT_TOO_MANY_DISPENSER_ITEMS=§7Dispenser: §c[{0}, {1}, {2}]§7, §c{3} §7items, Max: §e{4} AUTO_CHECKER_RESULT_FORBIDDEN_ITEM_NBT=§7Forbidden Item NBT: [{0}, {1}, {2}] -> §c{3} AUTO_CHECKER_RESULT_TELEPORT_HERE=§7Teleport to block -AUTO_CHECKER_RESULT_AFTER_DEADLINE=§cThe deadline has expired: {0} - -AI_START=§7The AI is synthesizing a "§e{0}§7"... Please wait. -AI_FINISH=§7The AI has finished synthesizing. It can be found in your Clipboard. -AI_ERROR=§cAn error occurred while synthesizing the schematic. Please try again later or look at the current date. -AI_NO_STEAMIES=§cYou have no Steamies. Please buy some Steamies in the shop. \ No newline at end of file +AUTO_CHECKER_RESULT_AFTER_DEADLINE=§cThe deadline has expired: {0} \ No newline at end of file diff --git a/SchematicSystem_Core/src/de/steamwar/schematicsystem/SchematicSystem.java b/SchematicSystem_Core/src/de/steamwar/schematicsystem/SchematicSystem.java index 3344644..d6b9480 100644 --- a/SchematicSystem_Core/src/de/steamwar/schematicsystem/SchematicSystem.java +++ b/SchematicSystem_Core/src/de/steamwar/schematicsystem/SchematicSystem.java @@ -20,7 +20,6 @@ package de.steamwar.schematicsystem; import de.steamwar.message.Message; -import de.steamwar.schematicsystem.commands.AprilCommand; import de.steamwar.schematicsystem.commands.DownloadCommand; import de.steamwar.schematicsystem.commands.schematiccommand.SchematicCommand; import de.steamwar.schematicsystem.commands.schematiccommand.SchematicCommandInitializer; @@ -39,7 +38,6 @@ public class SchematicSystem extends JavaPlugin { SchematicCommandInitializer.init(); new DownloadCommand(); - new AprilCommand(); Bukkit.getPluginManager().registerEvents(new PlayerEventListener(), this); } diff --git a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/AprilCommand.java b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/AprilCommand.java deleted file mode 100644 index 7e5fb78..0000000 --- a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/AprilCommand.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - This file is a part of the SteamWar software. - - Copyright (C) 2023 SteamWar.de-Serverteam - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - */ - -package de.steamwar.schematicsystem.commands; - -import de.steamwar.command.SWCommand; -import de.steamwar.schematicsystem.SchematicSystem; -import de.steamwar.sql.SchematicData; -import de.steamwar.sql.SchematicNode; -import de.steamwar.sql.SteamwarUser; -import org.bukkit.entity.Player; - -import java.io.IOException; -import java.util.List; -import java.util.Random; - -public class AprilCommand extends SWCommand { - - public AprilCommand() { - super("ai"); - } - - @Register - public void genericCommand(Player player, String... prompt) { - SteamwarUser user = SteamwarUser.get(player.getName()); - String message = String.join(" ", prompt); - Random random = new Random(message.hashCode()); - SchematicSystem.MESSAGE.send("AI_START", player, message); - try { - Thread.sleep(random.nextInt(3000)); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - int randomInt = random.nextInt(100); - if (randomInt < 33) { - List nodes = SchematicNode.getAll(user); - try { - new SchematicData(nodes.get(random.nextInt(nodes.size()))).loadToPlayer(player); - } catch (IOException e) { - throw new RuntimeException(e); - } - SchematicSystem.MESSAGE.send("AI_FINISH", player); - } else if (randomInt < 66) { - SchematicSystem.MESSAGE.send("AI_NO_STEAMIES", player); - } else { - SchematicSystem.MESSAGE.send("AI_ERROR", player); - } - } -}