update und clean
This commit is contained in:
@ -23,25 +23,25 @@ import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public class dice extends ListenerAdapter {
|
||||
|
||||
private String prefixSr;
|
||||
private String prefixIni;
|
||||
private String prefixZitat;
|
||||
private String prefixTest;
|
||||
private String prefixCId;
|
||||
private final String prefixSr;
|
||||
private final String prefixIni;
|
||||
private final String prefixZitat;
|
||||
private final String prefixTest;
|
||||
private final String prefixCId;
|
||||
|
||||
private language langDe = new language("de");
|
||||
private language langEn = new language("en");
|
||||
private final language langDe = new language("de");
|
||||
private final language langEn = new language("en");
|
||||
|
||||
private help helpDe = new help("de");
|
||||
private help helpEn = new help("En");
|
||||
private final help helpDe = new help("de");
|
||||
private final help helpEn = new help("En");
|
||||
|
||||
private language activLang;
|
||||
private help activHelp;
|
||||
|
||||
private db_connect db;
|
||||
private final db_connect db;
|
||||
|
||||
|
||||
private Map<String, String> channelList = new HashMap<>();
|
||||
private final Map<String, String> channelList = new HashMap<>();
|
||||
|
||||
|
||||
public dice() {
|
||||
@ -82,7 +82,7 @@ public class dice extends ListenerAdapter {
|
||||
|
||||
if(!channelList.containsKey(event.getChannel().getId())) {
|
||||
Map<String, String> Einstellungen = db.getChannelSettings(event.getChannel().getId());
|
||||
channelList.put(event.getChannel().getId(), Einstellungen.get("lang").toString());
|
||||
channelList.put(event.getChannel().getId(), Einstellungen.get("lang"));
|
||||
}
|
||||
switch (channelList.get(event.getChannel().getId())) {
|
||||
case "de":
|
||||
@ -175,17 +175,17 @@ public class dice extends ListenerAdapter {
|
||||
}
|
||||
for(int i = 0; i < 6; i++) {
|
||||
float pro = verteilung[i]*100f/rounds;
|
||||
test.addField(Integer.toString(i+1), Integer.toString(verteilung[i]) + " - " + String.format("%.2f", pro) + "%", true);
|
||||
test.addField(Integer.toString(i+1), verteilung[i] + " - " + String.format("%.2f", pro) + "%", true);
|
||||
}
|
||||
test.addBlankField(false);
|
||||
for(int i = 0; i < 6; i++) {
|
||||
float pro = verteilung2[i]*100f/rounds;
|
||||
test.addField(Integer.toString(i+1), Integer.toString(verteilung2[i]) + " - " + String.format("%.2f", pro) + "%", true);
|
||||
test.addField(Integer.toString(i+1), verteilung2[i] + " - " + String.format("%.2f", pro) + "%", true);
|
||||
}
|
||||
test.addBlankField(false);
|
||||
for(int i = 0; i < 6; i++) {
|
||||
float pro = verteilung3[i]*100f/rounds;
|
||||
test.addField(Integer.toString(i+1), Integer.toString(verteilung3[i]) + " - " + String.format("%.2f", pro) + "%", true);
|
||||
test.addField(Integer.toString(i+1), verteilung3[i] + " - " + String.format("%.2f", pro) + "%", true);
|
||||
}
|
||||
event.getChannel().sendMessageEmbeds(test.build()).queue();
|
||||
|
||||
@ -240,14 +240,14 @@ public class dice extends ListenerAdapter {
|
||||
}
|
||||
|
||||
if(MsgParts[1].trim().matches(".*[^0-9].*")) { // es wurden andere zeichen als Zahlen gefunden
|
||||
if(MsgParts[1].trim().toLowerCase().equals("de")) {
|
||||
if(MsgParts[1].trim().equalsIgnoreCase("de")) {
|
||||
activLang = langDe;
|
||||
channelList.put(event.getChannel().getId(), "de");
|
||||
event.getChannel().sendMessage(getAsMention(event) + activLang.language).queue();
|
||||
db.setChannelSettings(event.getChannel().getId(), "de", event.getGuild().getId(), event.getChannel().getName());
|
||||
return;
|
||||
}
|
||||
else if(MsgParts[1].trim().toLowerCase().equals("en")) {
|
||||
else if(MsgParts[1].trim().equalsIgnoreCase("en")) {
|
||||
activLang = langEn;
|
||||
channelList.put(event.getChannel().getId(), "en");
|
||||
event.getChannel().sendMessage(getAsMention(event) + activLang.language).queue();
|
||||
@ -318,8 +318,8 @@ public class dice extends ListenerAdapter {
|
||||
|
||||
int[] verteilung = new int[diceart];
|
||||
int dice1;
|
||||
StringBuilder result = new StringBuilder("");
|
||||
StringBuilder rollString = new StringBuilder("");
|
||||
StringBuilder result = new StringBuilder();
|
||||
StringBuilder rollString = new StringBuilder();
|
||||
|
||||
int hits = 0;
|
||||
boolean glitches = false;
|
||||
@ -374,13 +374,13 @@ public class dice extends ListenerAdapter {
|
||||
if(type == 1) {
|
||||
message = activLang.resultText;
|
||||
//%numberOfDice%%dice%%diceart% %EdgeDice%:\tErfolge: %hits%\tMisserfolge: %oneHits%";
|
||||
message = message.replace("%numberOfDice%", String.valueOf(numberOfDice)).replace("%diceart%", String.valueOf(diceart)).replace("%EdgeDice%", addition).replace("%hits%", String.valueOf(hits) + "\t Gesamt: " + (hits + hitBasis)).replace("%oneHits%", String.valueOf(verteilung[0]));
|
||||
message = message.replace("%numberOfDice%", String.valueOf(numberOfDice)).replace("%diceart%", String.valueOf(diceart)).replace("%EdgeDice%", addition).replace("%hits%", hits + "\t Gesamt: " + (hits + hitBasis)).replace("%oneHits%", String.valueOf(verteilung[0]));
|
||||
outputBox.setTitle(effectiveName + " Edgereroll " + message);
|
||||
}
|
||||
if(type == 2) {
|
||||
message = activLang.resultTextExtent;
|
||||
//%numberOfDice%%dice%%diceart% %EdgeDice%:\tErfolge: %hits%\tMisserfolge: %oneHits%";
|
||||
message = message.replace("%numberOfDice%", String.valueOf(numberOfDice)).replace("%diceart%", String.valueOf(diceart)).replace("%EdgeDice%", addition).replace("%hits%", String.valueOf(hits) + "\t Gesamt: " + (hits + hitBasis)).replace("%oneHits%", String.valueOf(verteilung[0]));
|
||||
message = message.replace("%numberOfDice%", String.valueOf(numberOfDice)).replace("%diceart%", String.valueOf(diceart)).replace("%EdgeDice%", addition).replace("%hits%", hits + "\t Gesamt: " + (hits + hitBasis)).replace("%oneHits%", String.valueOf(verteilung[0]));
|
||||
outputBox.setTitle(effectiveName + " Ausgedehnt " + message);
|
||||
}
|
||||
else {
|
||||
@ -443,7 +443,7 @@ public class dice extends ListenerAdapter {
|
||||
int diceart = 6;
|
||||
int iniBase = 0;
|
||||
int ini = 0;
|
||||
StringBuilder result = new StringBuilder("");
|
||||
StringBuilder result = new StringBuilder();
|
||||
|
||||
try {
|
||||
String[] MsgParts = event.getMessage().getContentRaw().split(" ", 2);
|
||||
@ -455,13 +455,13 @@ public class dice extends ListenerAdapter {
|
||||
}
|
||||
|
||||
if(MsgParts[1].trim().matches(".*[^0-9].*")) { // es wurden andere zeichen als Zahlen gefunden
|
||||
if(MsgParts[1].trim().toLowerCase().equals("de")) {
|
||||
if(MsgParts[1].trim().equalsIgnoreCase("de")) {
|
||||
activLang = langDe;
|
||||
channelList.put(event.getChannel().getId(), "de");
|
||||
event.getChannel().sendMessage(getAsMention(event) + activLang.language).queue();
|
||||
return;
|
||||
}
|
||||
else if(MsgParts[1].trim().toLowerCase().equals("en")) {
|
||||
else if(MsgParts[1].trim().equalsIgnoreCase("en")) {
|
||||
activLang = langEn;
|
||||
channelList.put(event.getChannel().getId(), "en");
|
||||
event.getChannel().sendMessage(getAsMention(event) + activLang.language).queue();
|
||||
@ -538,7 +538,7 @@ public class dice extends ListenerAdapter {
|
||||
outputBox.setTitle(getEffectiveName(event) + message);
|
||||
|
||||
|
||||
outputBox.setDescription(String.valueOf(iniBase) + " + (" + result.toString().trim().replace(" ", "+") + ")");
|
||||
outputBox.setDescription(iniBase + " + (" + result.toString().trim().replace(" ", "+") + ")");
|
||||
|
||||
event.getChannel().sendMessageEmbeds(outputBox.build()).queue();
|
||||
|
||||
@ -558,11 +558,9 @@ public class dice extends ListenerAdapter {
|
||||
String[] quotes = new String[7];
|
||||
|
||||
quotes[0] = "*quiek quiek quiek*";
|
||||
quotes[1] = "" +
|
||||
"(\\\\______/)\n" +
|
||||
quotes[1] = "(\\\\______/)\n" +
|
||||
"( ͡ ͡° ͜ ʖ ͡ ͡°) *snuff snuff*\n" +
|
||||
"\\\\╭☞ \\\\╭☞\n" +
|
||||
"";
|
||||
"\\\\╭☞ \\\\╭☞\n";
|
||||
quotes[2] = "(づ。◕‿‿◕。)づ";
|
||||
quotes[3] = "zzzZZZZZzzZZ";
|
||||
quotes[4] = "piiiep";
|
||||
|
||||
Reference in New Issue
Block a user