forked from RepoMirrors/kami-blue
revert baritoneImpl on master
This commit is contained in:
parent
4eeae5d339
commit
5985ee42f1
|
@ -56,10 +56,6 @@ repositories {
|
|||
name = "jitpack.io"
|
||||
url = "https://jitpack.io"
|
||||
}
|
||||
maven {
|
||||
name = 'impact'
|
||||
url = 'https://impactdevelopment.github.io/maven/'
|
||||
}
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
}
|
||||
|
@ -81,7 +77,6 @@ dependencies {
|
|||
compile 'club.minnced:java-discord-rpc:2.0.2'
|
||||
compile 'com.github.MrPowerGamerBR:TemmieWebhook:-SNAPSHOT'
|
||||
compile 'com.github.kevinsawicki:http-request:http-request-6.0'
|
||||
compile 'com.github.cabaletta:baritone:v1.2.13'
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
@ -117,7 +112,6 @@ 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'))
|
||||
}
|
||||
exclude 'dummyThing' // can someone explain why this is here
|
||||
classifier = 'release'
|
||||
|
@ -138,7 +132,7 @@ reobf {
|
|||
jar {
|
||||
manifest {
|
||||
attributes(
|
||||
'MixinConfigs': 'mixins.kami.json', 'mixins.baritone.json',
|
||||
'MixinConfigs': 'mixins.kami.json',
|
||||
'tweakClass': 'org.spongepowered.asm.launch.MixinTweaker',
|
||||
'TweakOrder': 0,
|
||||
'FMLCorePluginContainsFMLMod': 'true',
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
package me.zeroeightsix.kami.command.commands;
|
||||
|
||||
import me.zeroeightsix.kami.command.Command;
|
||||
|
||||
import static me.zeroeightsix.kami.util.MessageSendHelper.sendChatMessage;
|
||||
|
||||
/**
|
||||
* Created by Dewy on the 17th of April, 2020
|
||||
*/
|
||||
public class BaritoneCommand extends Command {
|
||||
|
||||
public BaritoneCommand() {
|
||||
super("baritone", null);
|
||||
setDescription("Configure baritone using it's own command system. Try typing '#help'.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void call(String[] args) {
|
||||
sendChatMessage("KAMI Blue has Baritone integration. To configure Baritone, use Baritone's own command system. Try #help for a command list.");
|
||||
}
|
||||
}
|
|
@ -19,7 +19,6 @@ public class MixinLoaderForge implements IFMLLoadingPlugin {
|
|||
log.info("KAMI mixins initialized");
|
||||
MixinBootstrap.init();
|
||||
Mixins.addConfiguration("mixins.kami.json");
|
||||
Mixins.addConfiguration("mixins.baritone.json");
|
||||
MixinEnvironment.getDefaultEnvironment().setObfuscationContext("searge");
|
||||
log.info(MixinEnvironment.getDefaultEnvironment().getObfuscationContext());
|
||||
}
|
||||
|
|
|
@ -1,98 +0,0 @@
|
|||
package me.zeroeightsix.kami.module.modules.movement;
|
||||
|
||||
import baritone.api.BaritoneAPI;
|
||||
import baritone.api.pathing.goals.GoalXZ;
|
||||
import me.zero.alpine.listener.EventHandler;
|
||||
import me.zero.alpine.listener.Listener;
|
||||
import me.zeroeightsix.kami.KamiMod;
|
||||
import me.zeroeightsix.kami.event.events.ServerDisconnectedEvent;
|
||||
import me.zeroeightsix.kami.module.Module;
|
||||
import me.zeroeightsix.kami.setting.Setting;
|
||||
import me.zeroeightsix.kami.setting.Settings;
|
||||
|
||||
import static me.zeroeightsix.kami.util.MathsUtils.normalizeAngle;
|
||||
|
||||
/**
|
||||
* Created by Dewy on the 17th of April, 2020
|
||||
*/
|
||||
@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));
|
||||
|
||||
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));
|
||||
|
||||
direction = "+Z";
|
||||
} else if (normalizeAngle(mc.player.rotationYaw) >= 22.6 && normalizeAngle(mc.player.rotationYaw) <= 67.5) { // -X / +Z
|
||||
BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAndPath(new GoalXZ((int) mc.player.posX - 1068, (int) mc.player.posZ + 1068));
|
||||
|
||||
direction = "-X / +Z";
|
||||
} else if (normalizeAngle(mc.player.rotationYaw) >= 67.6 && normalizeAngle(mc.player.rotationYaw) <= 112.5) { // -X
|
||||
BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAndPath(new GoalXZ((int) mc.player.posX - 1068, (int) mc.player.posZ));
|
||||
|
||||
direction = "-X";
|
||||
} else if (normalizeAngle(mc.player.rotationYaw) >= 112.6 && normalizeAngle(mc.player.rotationYaw) <= 157.5) { // -X / -Z
|
||||
BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAndPath(new GoalXZ((int) mc.player.posX - 1068, (int) mc.player.posZ - 1068));
|
||||
|
||||
direction = "-X / -Z";
|
||||
} else if (normalizeAngle(mc.player.rotationYaw) >= 157.6 || normalizeAngle(mc.player.rotationYaw) <= -157.5) { // -Z
|
||||
BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAndPath(new GoalXZ((int) mc.player.posX, (int) mc.player.posZ - 1068));
|
||||
|
||||
direction = "-Z";
|
||||
} else if (normalizeAngle(mc.player.rotationYaw) >= -157.6 && normalizeAngle(mc.player.rotationYaw) <= -112.5) { // +X / -Z
|
||||
BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAndPath(new GoalXZ((int) mc.player.posX + 1068, (int) mc.player.posZ - 1068));
|
||||
|
||||
direction = "+X / -Z";
|
||||
} else if (normalizeAngle(mc.player.rotationYaw) >= -112.6 && normalizeAngle(mc.player.rotationYaw) <= -67.5) { // +X
|
||||
BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAndPath(new GoalXZ((int) mc.player.posX + 1068, (int) mc.player.posZ));
|
||||
|
||||
direction = "+X";
|
||||
} else if (normalizeAngle(mc.player.rotationYaw) >= -67.6 && normalizeAngle(mc.player.rotationYaw) <= -22.6) { // +X / +Z
|
||||
BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAndPath(new GoalXZ((int) mc.player.posX + 1068, (int) mc.player.posZ + 1068));
|
||||
|
||||
direction = "+X / +Z";
|
||||
}
|
||||
}
|
||||
|
||||
@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();
|
||||
}
|
||||
|
||||
@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();
|
||||
}
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue