From cf436006448e7d2788cbdbbf2449adbf7935e8ce Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Fri, 27 Aug 2021 18:59:54 +0200 Subject: [PATCH] Fixing Signed-off-by: Chaoscaot --- .../bungeecore/bot/util/DiscordSchemAlert.java | 10 +++++----- .../steamwar/bungeecore/commands/CheckCommand.java | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/de/steamwar/bungeecore/bot/util/DiscordSchemAlert.java b/src/de/steamwar/bungeecore/bot/util/DiscordSchemAlert.java index b4b4261e..f0d9d7b6 100644 --- a/src/de/steamwar/bungeecore/bot/util/DiscordSchemAlert.java +++ b/src/de/steamwar/bungeecore/bot/util/DiscordSchemAlert.java @@ -20,7 +20,7 @@ package de.steamwar.bungeecore.bot.util; import de.steamwar.bungeecore.bot.SteamwarDiscordBot; -import de.steamwar.bungeecore.sql.Schematic; +import de.steamwar.bungeecore.sql.SchematicNode; import de.steamwar.bungeecore.sql.SteamwarUser; import lombok.experimental.UtilityClass; import net.dv8tion.jda.api.EmbedBuilder; @@ -36,14 +36,14 @@ import java.time.Instant; @UtilityClass public class DiscordSchemAlert { - public void sendDecline(Schematic schematic, SteamwarUser user, String reason) { + public void sendDecline(SchematicNode schematic, SteamwarUser user, String reason) { if(user.getDiscordId() != null) { User dcUser = SteamwarDiscordBot.instance().getJda().retrieveUserById(user.getDiscordId()).complete(); EmbedBuilder builder = new EmbedBuilder(); builder.setAuthor("SteamWar", "https://steamwar.de", "https://cdn.discordapp.com/app-icons/869606970099904562/60c884000407c02671d91d8e7182b8a1.png"); builder.setColor(Color.RED); builder.setTitle("SteamWar-Schematic Info"); - builder.setDescription("Deine Schematic **" + schematic.getSchemName() + "** wurde abgelehnt. **Grund:** \n" + reason); + builder.setDescription("Deine Schematic **" + schematic.getName() + "** wurde abgelehnt. **Grund:** \n" + reason); builder.setTimestamp(Instant.now()); MessageBuilder messageBuilder = new MessageBuilder(); @@ -56,14 +56,14 @@ public class DiscordSchemAlert { } } - public void sendAccept(Schematic schematic, SteamwarUser user) { + public void sendAccept(SchematicNode schematic, SteamwarUser user) { if(user.getDiscordId() != null) { User dcUser = SteamwarDiscordBot.instance().getJda().retrieveUserById(user.getDiscordId()).complete(); EmbedBuilder builder = new EmbedBuilder(); builder.setAuthor("SteamWar", "https://steamwar.de", "https://cdn.discordapp.com/app-icons/869606970099904562/60c884000407c02671d91d8e7182b8a1.png"); builder.setColor(Color.GREEN); builder.setTitle("SteamWar-Schematic Info"); - builder.setDescription("Deine Schematic **" + schematic.getSchemName() + "** wurde angenommen."); + builder.setDescription("Deine Schematic **" + schematic.getName() + "** wurde angenommen."); builder.setTimestamp(Instant.now()); MessageBuilder messageBuilder = new MessageBuilder(); diff --git a/src/de/steamwar/bungeecore/commands/CheckCommand.java b/src/de/steamwar/bungeecore/commands/CheckCommand.java index 3144161b..dde381bf 100644 --- a/src/de/steamwar/bungeecore/commands/CheckCommand.java +++ b/src/de/steamwar/bungeecore/commands/CheckCommand.java @@ -121,9 +121,9 @@ public class CheckCommand extends BasicCommand { return schematicList; } - public static String getChecker(Schematic schematic) { - if (currentSchems.get(schematic.getSchemID()) == null) return null; - return currentSchems.get(schematic.getSchemID()).checker.getName(); + public static String getChecker(SchematicNode schematic) { + if (currentSchems.get(schematic.getId()) == null) return null; + return currentSchems.get(schematic.getId()).checker.getName(); } private void list(ProxiedPlayer player) { @@ -295,11 +295,11 @@ public class CheckCommand extends BasicCommand { SteamwarUser user = SteamwarUser.get(schematic.getOwner()); ProxiedPlayer player = ProxyServer.getInstance().getPlayer(user.getUuid()); if(player != null) { - Message.send("CHECK_ACCEPTED", player, schematic.getSchemType().name(), schematic.getSchemName()); + Message.send("CHECK_ACCEPTED", player, schematic.getSchemtype().name(), schematic.getName()); } else { DiscordSchemAlert.sendAccept(schematic, user); } - Message.team("CHECK_ACCEPTED_TEAM", schematic.getSchemName(), user.getUserName()); + Message.team("CHECK_ACCEPTED_TEAM", schematic.getName(), user.getUserName()); stop(); } @@ -309,11 +309,11 @@ public class CheckCommand extends BasicCommand { SteamwarUser user = SteamwarUser.get(schematic.getOwner()); ProxiedPlayer player = ProxyServer.getInstance().getPlayer(user.getUuid()); if(player != null) { - Message.send("CHECK_DECLINED", player, schematic.getSchemType().name(), schematic.getSchemName(), reason); + Message.send("CHECK_DECLINED", player, schematic.getSchemtype().name(), schematic.getName(), reason); } else { DiscordSchemAlert.sendDecline(schematic, user, reason); } - Message.team("CHECK_DECLINED_TEAM", schematic.getSchemName(), user.getUserName(), reason); + Message.team("CHECK_DECLINED_TEAM", schematic.getName(), user.getUserName(), reason); stop(); }