forked from RepoMirrors/kami-blue
Compare commits
11 Commits
master
...
feature/ba
Author | SHA1 | Date |
---|---|---|
|
f2a27e183c | |
|
44b39a4ca8 | |
|
8892f461c6 | |
|
673e9b7dae | |
|
a6fcf61a35 | |
|
b0291649db | |
|
97426fbe3c | |
|
14cc25282f | |
|
4df0398b5f | |
|
5444538493 | |
|
79e02e0cfc |
|
@ -117,7 +117,7 @@ shadowJar {
|
|||
include(dependency('org.javassist:javassist'))
|
||||
include(dependency('com.github.MrPowerGamerBR:TemmieWebhook'))
|
||||
include(dependency('com.github.kevinsawicki:http-request'))
|
||||
include(dependency(group: 'cabaletta', name: 'baritone-api', version: '1.2.13'))
|
||||
include(dependency('com.github.cabaletta:baritone'))
|
||||
}
|
||||
exclude 'dummyThing' // can someone explain why this is here
|
||||
classifier = 'release'
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package me.zeroeightsix.kami.gui.kami;
|
||||
|
||||
import baritone.api.BaritoneAPI;
|
||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import me.zeroeightsix.kami.KamiMod;
|
||||
import me.zeroeightsix.kami.gui.kami.component.ActiveModules;
|
||||
|
@ -18,6 +19,7 @@ import me.zeroeightsix.kami.gui.rgui.util.ContainerHelper;
|
|||
import me.zeroeightsix.kami.gui.rgui.util.Docking;
|
||||
import me.zeroeightsix.kami.module.Module;
|
||||
import me.zeroeightsix.kami.module.modules.client.InfoOverlay;
|
||||
import me.zeroeightsix.kami.module.modules.movement.BaritoneWalk;
|
||||
import me.zeroeightsix.kami.util.ColourHolder;
|
||||
import me.zeroeightsix.kami.util.Friends;
|
||||
import me.zeroeightsix.kami.util.Pair;
|
||||
|
@ -45,6 +47,7 @@ import static me.zeroeightsix.kami.util.InfoCalculator.cardinalToAxis;
|
|||
/**
|
||||
* Created by 086 on 25/06/2017.
|
||||
* Updated by dominikaaaa on 28/01/20
|
||||
* Updated by Dewy on the 22nd of April, 2020
|
||||
* @see me.zeroeightsix.kami.module.modules.client.InventoryViewer
|
||||
*/
|
||||
public class KamiGUI extends GUI {
|
||||
|
@ -291,6 +294,36 @@ public class KamiGUI extends GUI {
|
|||
friends.setFontRenderer(fontRenderer);
|
||||
frames.add(frame);
|
||||
|
||||
/*
|
||||
* Baritone
|
||||
*/
|
||||
frame = new Frame(getTheme(), new Stretcherlayout(1), "Baritone");
|
||||
frame.setCloseable(false);
|
||||
frame.setPinnable(true);
|
||||
frame.setMinimumWidth(75);
|
||||
Label processes = new Label("");
|
||||
processes.setShadow(true);
|
||||
|
||||
Frame frameFinal = frame;
|
||||
|
||||
processes.addTickListener(() -> {
|
||||
processes.setText("");
|
||||
|
||||
if (!frameFinal.isMinimized() && BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().getGoal() != null) {
|
||||
if (MODULE_MANAGER.getModule(BaritoneWalk.class).isEnabled()) {
|
||||
processes.addLine("Current Process: AutoWalk (" + BaritoneWalk.direction + ")");
|
||||
} else {
|
||||
processes.addLine("Current Process: " + BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().getGoal().toString());
|
||||
}
|
||||
} else {
|
||||
processes.setWidth(70);
|
||||
}
|
||||
});
|
||||
|
||||
frame.addChild(processes);
|
||||
processes.setFontRenderer(fontRenderer);
|
||||
frames.add(frame);
|
||||
|
||||
/*
|
||||
* Text Radar
|
||||
*/
|
||||
|
|
|
@ -3,6 +3,7 @@ package me.zeroeightsix.kami.mixin.client;
|
|||
import me.zeroeightsix.kami.KamiMod;
|
||||
import me.zeroeightsix.kami.gui.mc.KamiGuiAntiDisconnect;
|
||||
import me.zeroeightsix.kami.module.modules.misc.AntiDisconnect;
|
||||
import me.zeroeightsix.kami.module.modules.movement.BaritoneWalk;
|
||||
import me.zeroeightsix.kami.util.Wrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
|
@ -17,11 +18,17 @@ public class MixinGuiIngameMenu {
|
|||
|
||||
@Inject(method = "actionPerformed", at = @At("HEAD"), cancellable = true)
|
||||
public void actionPerformed(GuiButton button, CallbackInfo callbackInfo) {
|
||||
if (KamiMod.MODULE_MANAGER.getModuleT(BaritoneWalk.class).isEnabled()) {
|
||||
if (button.id == 1) {
|
||||
KamiMod.MODULE_MANAGER.getModuleT(BaritoneWalk.class).disable();
|
||||
}
|
||||
}
|
||||
|
||||
if (KamiMod.MODULE_MANAGER.getModuleT(AntiDisconnect.class).isEnabled()) {
|
||||
switch (button.id) {
|
||||
case 1:
|
||||
Wrapper.getMinecraft().displayGuiScreen(new KamiGuiAntiDisconnect());
|
||||
callbackInfo.cancel();
|
||||
if (button.id == 1) {
|
||||
Wrapper.getMinecraft().displayGuiScreen(new KamiGuiAntiDisconnect());
|
||||
|
||||
callbackInfo.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
package me.zeroeightsix.kami.module.modules.client;
|
||||
|
||||
import baritone.api.BaritoneAPI;
|
||||
import me.zeroeightsix.kami.module.Module;
|
||||
import me.zeroeightsix.kami.setting.Setting;
|
||||
import me.zeroeightsix.kami.setting.Settings;
|
||||
import me.zeroeightsix.kami.util.MessageSendHelper;
|
||||
|
||||
/**
|
||||
* Created by Dewy on the 21st of April, 2020
|
||||
*/
|
||||
@Module.Info(
|
||||
name = "Baritone",
|
||||
category = Module.Category.CLIENT,
|
||||
description = "Configure KAMI Blue's Baritone integration.",
|
||||
showOnArray = Module.ShowOnArray.OFF
|
||||
)
|
||||
public class Baritone extends Module {
|
||||
public Setting<Boolean> allowBreak = register(Settings.b("Allow Break", true));
|
||||
public Setting<Boolean> allowSprint = register(Settings.b("Allow Sprint", true));
|
||||
public Setting<Boolean> allowPlace = register(Settings.b("Allow Place", true));
|
||||
public Setting<Boolean> allowInventory = register(Settings.b("Allow Inventory", true));
|
||||
public Setting<Boolean> freeLook = register(Settings.b("Free Look", true));
|
||||
public Setting<Boolean> allowDownwardTunneling = register(Settings.b("Downward Tunneling", true));
|
||||
|
||||
public Setting<Boolean> allowParkour = register(Settings.b("Allow Parkour", true));
|
||||
public Setting<Boolean> allowParkourPlace = register(Settings.b("Allow Parkour Place", true));
|
||||
|
||||
public Setting<Boolean> avoidPortals = register(Settings.b("Avoid Portals", false));
|
||||
public Setting<Boolean> mapArtMode = register(Settings.b("Map Art Mode", false));
|
||||
|
||||
public Setting<Boolean> renderGoal = register(Settings.b("Render Goals", true));
|
||||
|
||||
public void onDisable() {
|
||||
MessageSendHelper.sendErrorMessage("Error: The Baritone module is for configuring Baritone integration, not toggling it.");
|
||||
enable();
|
||||
}
|
||||
|
||||
// ._.
|
||||
public void onUpdate() {
|
||||
BaritoneAPI.getSettings().allowBreak.value = allowBreak.getValue();
|
||||
BaritoneAPI.getSettings().allowSprint.value = allowSprint.getValue();
|
||||
BaritoneAPI.getSettings().allowPlace.value = allowPlace.getValue();
|
||||
BaritoneAPI.getSettings().allowInventory.value = allowInventory.getValue();
|
||||
BaritoneAPI.getSettings().freeLook.value = freeLook.getValue();
|
||||
BaritoneAPI.getSettings().allowDownward.value = allowDownwardTunneling.getValue();
|
||||
|
||||
BaritoneAPI.getSettings().allowParkour.value = allowParkour.getValue();
|
||||
BaritoneAPI.getSettings().allowParkourPlace.value = allowParkourPlace.getValue();
|
||||
|
||||
BaritoneAPI.getSettings().enterPortal.value = !avoidPortals.getValue();
|
||||
BaritoneAPI.getSettings().mapArtMode.value = mapArtMode.getValue();
|
||||
|
||||
BaritoneAPI.getSettings().renderGoal.value = renderGoal.getValue();
|
||||
}
|
||||
}
|
|
@ -34,6 +34,7 @@ public class RunConfig extends Module {
|
|||
MODULE_MANAGER.getModule(CommandConfig.class).enable();
|
||||
MODULE_MANAGER.getModule(InfoOverlay.class).enable();
|
||||
MODULE_MANAGER.getModule(InventoryViewer.class).enable();
|
||||
MODULE_MANAGER.getModule(Baritone.class).enable();
|
||||
|
||||
if (!hasRunCapes.getValue()) {
|
||||
MODULE_MANAGER.getModule(Capes.class).enable();
|
||||
|
|
|
@ -17,17 +17,9 @@ import static me.zeroeightsix.kami.util.MathsUtils.normalizeAngle;
|
|||
*/
|
||||
@Module.Info(name = "BaritoneWalk", description = "AutoWalk with Baritone pathfinding.", category = Module.Category.MOVEMENT)
|
||||
public class BaritoneWalk extends Module {
|
||||
private Setting<Boolean> sprint = register(Settings.booleanBuilder("Allow Sprinting").withValue(true));
|
||||
private Setting<Boolean> parkour = register(Settings.booleanBuilder("Allow Parkour").withValue(true).withVisibility(v -> sprint.getValue().equals(true)));
|
||||
private Setting<Boolean> lockView = register(Settings.booleanBuilder("Lock View").withValue(false));
|
||||
public static String direction;
|
||||
|
||||
private String direction;
|
||||
|
||||
// Very shittily done, but this check is not that taxing on performance cos it is NOT performed every tick.
|
||||
@Override
|
||||
protected void onEnable() {
|
||||
|
||||
|
||||
if (normalizeAngle(mc.player.rotationYaw) >= -22.5 && normalizeAngle(mc.player.rotationYaw) <= 22.5) { // +Z
|
||||
BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAndPath(new GoalXZ((int) mc.player.posX, (int) mc.player.posZ + 1068));
|
||||
|
||||
|
@ -63,36 +55,18 @@ public class BaritoneWalk extends Module {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
BaritoneAPI.getSettings().allowSprint.value = sprint.getValue();
|
||||
BaritoneAPI.getSettings().freeLook.value = !lockView.getValue();
|
||||
|
||||
if (sprint.getValue()) {
|
||||
BaritoneAPI.getSettings().allowParkour.value = parkour.getValue();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHudInfo() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
protected void onDisable() {
|
||||
BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoal(null);
|
||||
|
||||
BaritoneAPI.getSettings().freeLook.reset();
|
||||
BaritoneAPI.getSettings().allowParkour.reset();
|
||||
BaritoneAPI.getSettings().allowSprint.reset();
|
||||
BaritoneAPI.getProvider().getPrimaryBaritone().getPathingBehavior().cancelEverything();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private Listener<ServerDisconnectedEvent> disconnectedEventListener = new Listener<>(event -> {
|
||||
System.out.println("bBBBB");
|
||||
|
||||
if (KamiMod.MODULE_MANAGER.getModuleT(BaritoneWalk.class).isEnabled()) {
|
||||
KamiMod.MODULE_MANAGER.getModuleT(BaritoneWalk.class).destroy();
|
||||
public Listener<ServerDisconnectedEvent> kickListener = new Listener<>(event -> {
|
||||
if (isEnabled()) {
|
||||
disable();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue