refactor: make bruhify a part of the tick listener
i don't even know how i missed this
This commit is contained in:
parent
f7187e560f
commit
dc023758f2
1 changed files with 21 additions and 16 deletions
|
@ -5,15 +5,21 @@ import me.chayapak1.chomens_bot.util.ColorUtilities;
|
|||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.TextColor;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
public class BruhifyPlugin extends TickPlugin.Listener {
|
||||
private final Bot bot;
|
||||
|
||||
public class BruhifyPlugin {
|
||||
public String bruhifyText = "";
|
||||
|
||||
private int startHue = 0;
|
||||
|
||||
public BruhifyPlugin (Bot bot) {
|
||||
bot.executor.scheduleAtFixedRate(() -> {
|
||||
this.bot = bot;
|
||||
|
||||
bot.tick.addListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTick() {
|
||||
if (bruhifyText.isEmpty()) return;
|
||||
|
||||
int hue = startHue;
|
||||
|
@ -31,6 +37,5 @@ public class BruhifyPlugin {
|
|||
bot.chat.actionBar(component);
|
||||
|
||||
startHue = (startHue + increment) % 360;
|
||||
}, 0, 50, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue