forked from ChomeNS/chomens-bot-java
the tag self care
This commit is contained in:
parent
16c79115ee
commit
3134d3e525
3 changed files with 29 additions and 0 deletions
|
@ -70,6 +70,7 @@ public class Bot {
|
|||
public MailPlugin mail;
|
||||
public PacketSnifferPlugin packetSniffer;
|
||||
public VoiceChatPlugin voiceChat;
|
||||
public TagPlugin tag;
|
||||
|
||||
public Bot (Configuration.BotOption botOption, List<Bot> bots, Configuration config) {
|
||||
this.host = botOption.host;
|
||||
|
@ -115,6 +116,7 @@ public class Bot {
|
|||
this.mail = new MailPlugin(this);
|
||||
this.packetSniffer = new PacketSnifferPlugin(this);
|
||||
this.voiceChat = new VoiceChatPlugin(this);
|
||||
this.tag = new TagPlugin(this);
|
||||
|
||||
for (Listener listener : listeners) listener.loadedPlugins();
|
||||
|
||||
|
|
|
@ -330,10 +330,13 @@ public class CorePlugin extends PositionPlugin.Listener {
|
|||
// bot.chat.send(command);
|
||||
|
||||
runPlaceBlock(command);
|
||||
|
||||
for (Listener listener : listeners) listener.refilled();
|
||||
}
|
||||
|
||||
public static class Listener {
|
||||
public void ready () {}
|
||||
public void refilled () {}
|
||||
}
|
||||
|
||||
public void addListener (Listener listener) { listeners.add(listener); }
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
package land.chipmunk.chayapak.chomens_bot.plugins;
|
||||
|
||||
import land.chipmunk.chayapak.chomens_bot.Bot;
|
||||
import land.chipmunk.chayapak.chomens_bot.util.UUIDUtilities;
|
||||
|
||||
// TODO: self care
|
||||
public class TagPlugin extends CorePlugin.Listener {
|
||||
private final Bot bot;
|
||||
|
||||
public final String tag = "chomens_bot";
|
||||
|
||||
public TagPlugin (Bot bot) {
|
||||
this.bot = bot;
|
||||
|
||||
bot.core.addListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ready () { // might not be the best idea but whatever
|
||||
final String command = "minecraft:tag " + UUIDUtilities.selector(bot.profile.getId()) + " add " + tag;
|
||||
System.out.println(command);
|
||||
bot.core.run(command);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue