diff options
Diffstat (limited to 'src/main/java/rosegoldaddons/features/AutoLeaveLimbo.java')
-rw-r--r-- | src/main/java/rosegoldaddons/features/AutoLeaveLimbo.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/main/java/rosegoldaddons/features/AutoLeaveLimbo.java b/src/main/java/rosegoldaddons/features/AutoLeaveLimbo.java new file mode 100644 index 0000000..407965f --- /dev/null +++ b/src/main/java/rosegoldaddons/features/AutoLeaveLimbo.java @@ -0,0 +1,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; + } + } +} |