forked from ChomeNS/chomens-bot-java
some among us lol
This commit is contained in:
parent
5eadb1c868
commit
6acc76171a
20 changed files with 31 additions and 63 deletions
|
@ -6,9 +6,6 @@ import land.chipmunk.chayapak.chomens_bot.command.CommandContext;
|
||||||
import land.chipmunk.chayapak.chomens_bot.command.TrustLevel;
|
import land.chipmunk.chayapak.chomens_bot.command.TrustLevel;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class BruhifyCommand extends Command {
|
public class BruhifyCommand extends Command {
|
||||||
public BruhifyCommand () {
|
public BruhifyCommand () {
|
||||||
super(
|
super(
|
||||||
|
|
|
@ -8,8 +8,6 @@ import land.chipmunk.chayapak.chomens_bot.command.CommandContext;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
import net.kyori.adventure.text.format.NamedTextColor;
|
import net.kyori.adventure.text.format.NamedTextColor;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class ClearChatCommand extends Command {
|
public class ClearChatCommand extends Command {
|
||||||
|
|
|
@ -20,30 +20,6 @@ public class ClearChatQueueCommand extends Command {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String name() { return "clearchatqueue"; }
|
|
||||||
|
|
||||||
public String description() {
|
|
||||||
return "Clears the bot's chat queue";
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> usage() {
|
|
||||||
final List<String> usages = new ArrayList<>();
|
|
||||||
usages.add("");
|
|
||||||
|
|
||||||
return usages;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> alias() {
|
|
||||||
final List<String> aliases = new ArrayList<>();
|
|
||||||
aliases.add("ccq");
|
|
||||||
|
|
||||||
return aliases;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TrustLevel trustLevel() {
|
|
||||||
return TrustLevel.PUBLIC;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Component execute(CommandContext context, String[] args, String[] fullArgs) {
|
public Component execute(CommandContext context, String[] args, String[] fullArgs) {
|
||||||
final Bot bot = context.bot;
|
final Bot bot = context.bot;
|
||||||
|
|
|
@ -7,9 +7,6 @@ import land.chipmunk.chayapak.chomens_bot.command.TrustLevel;
|
||||||
import land.chipmunk.chayapak.chomens_bot.util.ColorUtilities;
|
import land.chipmunk.chayapak.chomens_bot.util.ColorUtilities;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class CreatorCommand extends Command {
|
public class CreatorCommand extends Command {
|
||||||
public CreatorCommand () {
|
public CreatorCommand () {
|
||||||
super(
|
super(
|
||||||
|
|
|
@ -7,7 +7,7 @@ import net.kyori.adventure.text.Component;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class BossBar {
|
public class BossBar {
|
||||||
public UUID uuid;
|
public final UUID uuid;
|
||||||
|
|
||||||
public Component title;
|
public Component title;
|
||||||
public BossBarColor color;
|
public BossBarColor color;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package land.chipmunk.chayapak.chomens_bot.data;
|
package land.chipmunk.chayapak.chomens_bot.data;
|
||||||
|
|
||||||
public class FilteredPlayer {
|
public class FilteredPlayer {
|
||||||
public String playerName;
|
public final String playerName;
|
||||||
public boolean regex;
|
public final boolean regex;
|
||||||
public boolean ignoreCase;
|
public final boolean ignoreCase;
|
||||||
|
|
||||||
public FilteredPlayer (
|
public FilteredPlayer (
|
||||||
String playerName,
|
String playerName,
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package land.chipmunk.chayapak.chomens_bot.data;
|
package land.chipmunk.chayapak.chomens_bot.data;
|
||||||
|
|
||||||
public class Mail {
|
public class Mail {
|
||||||
public String sentBy;
|
public final String sentBy;
|
||||||
public String sentTo;
|
public final String sentTo;
|
||||||
public long timeSent;
|
public final long timeSent;
|
||||||
public String server;
|
public final String server;
|
||||||
public String contents;
|
public final String contents;
|
||||||
|
|
||||||
public Mail (
|
public Mail (
|
||||||
String sentBy,
|
String sentBy,
|
||||||
|
|
|
@ -8,13 +8,13 @@ import net.kyori.adventure.text.Component;
|
||||||
import java.security.PublicKey;
|
import java.security.PublicKey;
|
||||||
|
|
||||||
public class MutablePlayerListEntry {
|
public class MutablePlayerListEntry {
|
||||||
public GameProfile profile;
|
public final GameProfile profile;
|
||||||
public GameMode gamemode;
|
public GameMode gamemode;
|
||||||
public int latency;
|
public int latency;
|
||||||
public Component displayName;
|
public Component displayName;
|
||||||
public long expiresAt;
|
public final long expiresAt;
|
||||||
public PublicKey publicKey;
|
public PublicKey publicKey;
|
||||||
public byte[] keySignature;
|
public final byte[] keySignature;
|
||||||
public boolean listed;
|
public boolean listed;
|
||||||
|
|
||||||
public MutablePlayerListEntry (
|
public MutablePlayerListEntry (
|
||||||
|
|
|
@ -22,9 +22,9 @@ public class BossbarManagerPlugin extends Bot.Listener {
|
||||||
public final Map<UUID, BossBar> serverBossBars = new HashMap<>();
|
public final Map<UUID, BossBar> serverBossBars = new HashMap<>();
|
||||||
private final Map<UUID, BotBossBar> bossBars = new HashMap<>();
|
private final Map<UUID, BotBossBar> bossBars = new HashMap<>();
|
||||||
|
|
||||||
public boolean enabled = true;
|
public final boolean enabled = true;
|
||||||
|
|
||||||
public String bossBarPrefix = "chomens_bot:";
|
public final String bossBarPrefix = "chomens_bot:";
|
||||||
|
|
||||||
public BossbarManagerPlugin (Bot bot) {
|
public BossbarManagerPlugin (Bot bot) {
|
||||||
this.bot = bot;
|
this.bot = bot;
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class ChatPlugin extends Bot.Listener {
|
||||||
|
|
||||||
private final List<String> queue = new ArrayList<>();
|
private final List<String> queue = new ArrayList<>();
|
||||||
|
|
||||||
public int queueDelay;
|
public final int queueDelay;
|
||||||
|
|
||||||
private final List<Listener> listeners = new ArrayList<>();
|
private final List<Listener> listeners = new ArrayList<>();
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ public class CommandHandlerPlugin {
|
||||||
|
|
||||||
public final List<Command> commands = new ArrayList<>();
|
public final List<Command> commands = new ArrayList<>();
|
||||||
|
|
||||||
public boolean disabled = false;
|
public final boolean disabled = false;
|
||||||
|
|
||||||
public CommandHandlerPlugin (Bot bot) {
|
public CommandHandlerPlugin (Bot bot) {
|
||||||
this.bot = bot;
|
this.bot = bot;
|
||||||
|
|
|
@ -12,7 +12,7 @@ import java.util.List;
|
||||||
public class CommandSuggestionPlugin extends ChatPlugin.Listener {
|
public class CommandSuggestionPlugin extends ChatPlugin.Listener {
|
||||||
private final Bot bot;
|
private final Bot bot;
|
||||||
|
|
||||||
public String id = "chomens_bot_command_suggestion";
|
public final String id = "chomens_bot_command_suggestion";
|
||||||
|
|
||||||
public CommandSuggestionPlugin (Bot bot) {
|
public CommandSuggestionPlugin (Bot bot) {
|
||||||
this.bot = bot;
|
this.bot = bot;
|
||||||
|
|
|
@ -29,7 +29,7 @@ import java.util.List;
|
||||||
// please ignore my ohio code
|
// please ignore my ohio code
|
||||||
// also this is one of the classes which has >100 lines or actually >300 LMAO
|
// also this is one of the classes which has >100 lines or actually >300 LMAO
|
||||||
public class DiscordPlugin {
|
public class DiscordPlugin {
|
||||||
public JDA jda;
|
public final JDA jda;
|
||||||
|
|
||||||
public final Map<String, String> servers;
|
public final Map<String, String> servers;
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ public class LoggerPlugin extends ChatPlugin.Listener {
|
||||||
|
|
||||||
private boolean addedListener = false;
|
private boolean addedListener = false;
|
||||||
|
|
||||||
public boolean logToConsole = true;
|
public final boolean logToConsole = true;
|
||||||
|
|
||||||
private final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm:ss");
|
private final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm:ss");
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class MusicPlayerPlugin extends Bot.Listener {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Song currentSong;
|
public Song currentSong;
|
||||||
public List<Song> songQueue = new ArrayList<>();
|
public final List<Song> songQueue = new ArrayList<>();
|
||||||
public SongLoaderRunnable loaderThread;
|
public SongLoaderRunnable loaderThread;
|
||||||
public Loop loop = Loop.OFF;
|
public Loop loop = Loop.OFF;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
// normally unused in the main instance of the bot
|
// normally unused in the main instance of the bot
|
||||||
public class PacketSnifferPlugin extends Bot.Listener {
|
public class PacketSnifferPlugin extends Bot.Listener {
|
||||||
public boolean enabled = false;
|
public final boolean enabled = false;
|
||||||
|
|
||||||
private OutputStreamWriter writer;
|
private OutputStreamWriter writer;
|
||||||
|
|
||||||
|
|
|
@ -158,7 +158,7 @@ public class SelfCarePlugin extends Bot.Listener {
|
||||||
final GameEvent notification = packet.getNotification();
|
final GameEvent notification = packet.getNotification();
|
||||||
final GameEventValue value = packet.getValue();
|
final GameEventValue value = packet.getValue();
|
||||||
|
|
||||||
if (notification == GameEvent.ENTER_CREDITS) {
|
if (notification == GameEvent.ENTER_CREDITS && bot.config.selfCare.endCredits) {
|
||||||
bot.session.send(new ServerboundClientCommandPacket(ClientCommand.RESPAWN));
|
bot.session.send(new ServerboundClientCommandPacket(ClientCommand.RESPAWN));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,9 +70,9 @@ public class TPSPlugin extends Bot.Listener {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateTPSBar () {
|
private void updateTPSBar () {
|
||||||
try {
|
if (!enabled) return;
|
||||||
if (!enabled) return;
|
|
||||||
|
|
||||||
|
try {
|
||||||
final double tickRate = getTickRate();
|
final double tickRate = getTickRate();
|
||||||
|
|
||||||
final DecimalFormat formatter = new DecimalFormat("##.##");
|
final DecimalFormat formatter = new DecimalFormat("##.##");
|
||||||
|
|
|
@ -2,12 +2,12 @@ package land.chipmunk.chayapak.chomens_bot.song;
|
||||||
|
|
||||||
// Author: hhhzzzsss
|
// Author: hhhzzzsss
|
||||||
public class Note implements Comparable<Note> {
|
public class Note implements Comparable<Note> {
|
||||||
public Instrument instrument;
|
public final Instrument instrument;
|
||||||
public int pitch;
|
public final int pitch;
|
||||||
public float volume;
|
public final float volume;
|
||||||
public long time;
|
public final long time;
|
||||||
public int panning;
|
public final int panning;
|
||||||
public int stereo;
|
public final int stereo;
|
||||||
|
|
||||||
public Note (
|
public Note (
|
||||||
Instrument instrument,
|
Instrument instrument,
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class ComponentUtilities {
|
||||||
ansiMap.put("r", "\u001b[0m");
|
ansiMap.put("r", "\u001b[0m");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static record PartiallyStringifiedOutput (
|
private record PartiallyStringifiedOutput (
|
||||||
String output,
|
String output,
|
||||||
String lastColor
|
String lastColor
|
||||||
) {}
|
) {}
|
||||||
|
|
Loading…
Reference in a new issue