aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/rosegoldaddons/features/AutoLeaveLimbo.java
blob: 407965f16e8999bf3698059504b7a2210084ea58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package rosegoldaddons.features;

import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import rosegoldaddons.Main;
import rosegoldaddons.utils.ScoreboardUtils;

public class AutoLeaveLimbo {
    private int deb = 0;
    private boolean playSb = false;
    private int prev = 0;

    @SubscribeEvent
    public void onTick(TickEvent.ClientTickEvent event) {
        if(!Main.configFile.autoLeaveLimbo || Main.endermanMacro) return;
        if(event.phase == TickEvent.Phase.END) return;
        if(deb > 0) deb--;
        if(deb != 0) return;
        deb = 20;
        if(ScoreboardUtils.inLimbo) {
            if(prev < 10) {
                prev++;
            } else {
                Main.mc.thePlayer.sendChatMessage("/l");
                prev = 0;
                playSb = true;
                return;
            }
        } else {
            prev = 0;
        }
        if(!ScoreboardUtils.inSkyblock && playSb && Main.configFile.autoLimboSB) {
            Main.mc.thePlayer.sendChatMessage("/play sb");
            playSb = false;
        }
    }
}