Changing to Schemnodes #190
@ -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();
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren