Archiviert
1
0
Signed-off-by: Chaoscaot <chaoscaot444@gmail.com>
Dieser Commit ist enthalten in:
Chaoscaot 2021-08-27 18:59:54 +02:00
Ursprung bb1a2d327e
Commit cf43600644
2 geänderte Dateien mit 12 neuen und 12 gelöschten Zeilen

Datei anzeigen

@ -20,7 +20,7 @@
package de.steamwar.bungeecore.bot.util; package de.steamwar.bungeecore.bot.util;
import de.steamwar.bungeecore.bot.SteamwarDiscordBot; 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 de.steamwar.bungeecore.sql.SteamwarUser;
import lombok.experimental.UtilityClass; import lombok.experimental.UtilityClass;
import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.EmbedBuilder;
@ -36,14 +36,14 @@ import java.time.Instant;
@UtilityClass @UtilityClass
public class DiscordSchemAlert { 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) { if(user.getDiscordId() != null) {
User dcUser = SteamwarDiscordBot.instance().getJda().retrieveUserById(user.getDiscordId()).complete(); User dcUser = SteamwarDiscordBot.instance().getJda().retrieveUserById(user.getDiscordId()).complete();
EmbedBuilder builder = new EmbedBuilder(); EmbedBuilder builder = new EmbedBuilder();
builder.setAuthor("SteamWar", "https://steamwar.de", "https://cdn.discordapp.com/app-icons/869606970099904562/60c884000407c02671d91d8e7182b8a1.png"); builder.setAuthor("SteamWar", "https://steamwar.de", "https://cdn.discordapp.com/app-icons/869606970099904562/60c884000407c02671d91d8e7182b8a1.png");
builder.setColor(Color.RED); builder.setColor(Color.RED);
builder.setTitle("SteamWar-Schematic Info"); 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()); builder.setTimestamp(Instant.now());
MessageBuilder messageBuilder = new MessageBuilder(); 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) { if(user.getDiscordId() != null) {
User dcUser = SteamwarDiscordBot.instance().getJda().retrieveUserById(user.getDiscordId()).complete(); User dcUser = SteamwarDiscordBot.instance().getJda().retrieveUserById(user.getDiscordId()).complete();
EmbedBuilder builder = new EmbedBuilder(); EmbedBuilder builder = new EmbedBuilder();
builder.setAuthor("SteamWar", "https://steamwar.de", "https://cdn.discordapp.com/app-icons/869606970099904562/60c884000407c02671d91d8e7182b8a1.png"); builder.setAuthor("SteamWar", "https://steamwar.de", "https://cdn.discordapp.com/app-icons/869606970099904562/60c884000407c02671d91d8e7182b8a1.png");
builder.setColor(Color.GREEN); builder.setColor(Color.GREEN);
builder.setTitle("SteamWar-Schematic Info"); 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()); builder.setTimestamp(Instant.now());
MessageBuilder messageBuilder = new MessageBuilder(); MessageBuilder messageBuilder = new MessageBuilder();

Datei anzeigen

@ -121,9 +121,9 @@ public class CheckCommand extends BasicCommand {
return schematicList; return schematicList;
} }
public static String getChecker(Schematic schematic) { public static String getChecker(SchematicNode schematic) {
if (currentSchems.get(schematic.getSchemID()) == null) return null; if (currentSchems.get(schematic.getId()) == null) return null;
return currentSchems.get(schematic.getSchemID()).checker.getName(); return currentSchems.get(schematic.getId()).checker.getName();
} }
private void list(ProxiedPlayer player) { private void list(ProxiedPlayer player) {
@ -295,11 +295,11 @@ public class CheckCommand extends BasicCommand {
SteamwarUser user = SteamwarUser.get(schematic.getOwner()); SteamwarUser user = SteamwarUser.get(schematic.getOwner());
ProxiedPlayer player = ProxyServer.getInstance().getPlayer(user.getUuid()); ProxiedPlayer player = ProxyServer.getInstance().getPlayer(user.getUuid());
if(player != null) { if(player != null) {
Message.send("CHECK_ACCEPTED", player, schematic.getSchemType().name(), schematic.getSchemName()); Message.send("CHECK_ACCEPTED", player, schematic.getSchemtype().name(), schematic.getName());
} else { } else {
DiscordSchemAlert.sendAccept(schematic, user); DiscordSchemAlert.sendAccept(schematic, user);
} }
Message.team("CHECK_ACCEPTED_TEAM", schematic.getSchemName(), user.getUserName()); Message.team("CHECK_ACCEPTED_TEAM", schematic.getName(), user.getUserName());
stop(); stop();
} }
@ -309,11 +309,11 @@ public class CheckCommand extends BasicCommand {
SteamwarUser user = SteamwarUser.get(schematic.getOwner()); SteamwarUser user = SteamwarUser.get(schematic.getOwner());
ProxiedPlayer player = ProxyServer.getInstance().getPlayer(user.getUuid()); ProxiedPlayer player = ProxyServer.getInstance().getPlayer(user.getUuid());
if(player != null) { 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 { } else {
DiscordSchemAlert.sendDecline(schematic, user, reason); 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(); stop();
} }