Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1cae7ad6b1 | |||
| 7dd881aa9a | |||
| c7ad235110 | |||
| a989547976 | |||
| fa75880626 | |||
| 529895f970 | |||
| 3d5de440fd | |||
| 568bb1b0e8 |
@@ -45,6 +45,12 @@ Here are some links to help to get started:
|
|||||||
|
|
||||||
Quick start example: `thisway 1000` or `goal 70` to set the goal, `path` to actually start pathing. Also try `mine diamond_ore`. `cancel` to cancel.
|
Quick start example: `thisway 1000` or `goal 70` to set the goal, `path` to actually start pathing. Also try `mine diamond_ore`. `cancel` to cancel.
|
||||||
|
|
||||||
|
On v1.1.0 and newer: Put a `#` in front so that if you make a typo it doesn't go into public chat (anything beginning with `#` isn't sent).
|
||||||
|
|
||||||
|
For older than v1.1.0, `#` must be enabled by toggling on the `prefix` setting.
|
||||||
|
|
||||||
|
**Only** in Impact is `.b` also a valid prefix
|
||||||
|
|
||||||
# API example
|
# API example
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,5 +1,15 @@
|
|||||||
# Setup
|
# Setup
|
||||||
|
|
||||||
|
## Prebuilt
|
||||||
|
[Releases](https://github.com/cabaletta/baritone/releases)
|
||||||
|
|
||||||
|
Not always completely up to date with latest features.
|
||||||
|
|
||||||
|
The forge release (currently `baritone-forge-1.1.3.jar`) can simply be added as a Forge mod.
|
||||||
|
|
||||||
|
Previously (Baritone v1.1.2 and below), it was not fully compatible with the latest version of Forge. `freeLook` was broken in Forge 14.23.4.2744. Forge 14.23.4.2743 or **older** worked with Baritone v1.1.2 and lower. Newer versions of Forge "worked", sort of, but Baritone's movement became unreliable and `freeLook` must be off.
|
||||||
|
|
||||||
|
## Build it yourself
|
||||||
- Clone or download Baritone
|
- Clone or download Baritone
|
||||||
|
|
||||||

|

|
||||||
@@ -69,8 +79,9 @@ $ gradlew build
|
|||||||
|
|
||||||
## Artifacts
|
## Artifacts
|
||||||
|
|
||||||
Building Baritone will result in 3 artifacts created in the ``dist`` directory.
|
Building Baritone will result in 4 artifacts created in the ``dist`` directory.
|
||||||
|
|
||||||
|
- **Forge**: Forge mod
|
||||||
- **API**: Only the non-api packages are obfuscated. This should be used in environments where other mods would like to use Baritone's features.
|
- **API**: Only the non-api packages are obfuscated. This should be used in environments where other mods would like to use Baritone's features.
|
||||||
- **Standalone**: Everything is obfuscated. This should be used in environments where there are no other mods present that would like to use Baritone's features.
|
- **Standalone**: Everything is obfuscated. This should be used in environments where there are no other mods present that would like to use Baritone's features.
|
||||||
- **Unoptimized**: Nothing is obfuscated. This shouldn't be used ever in production.
|
- **Unoptimized**: Nothing is obfuscated. This shouldn't be used ever in production.
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
group 'baritone'
|
group 'baritone'
|
||||||
version '1.1.0'
|
version '1.1.3'
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@@ -478,6 +478,11 @@ public final class Settings {
|
|||||||
*/
|
*/
|
||||||
public Setting<Float> cachedChunksOpacity = new Setting<>(0.5f);
|
public Setting<Float> cachedChunksOpacity = new Setting<>(0.5f);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If true, Baritone will not allow you to left or right click while pathing
|
||||||
|
*/
|
||||||
|
public Setting<Boolean> suppressClicks = new Setting<>(false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether or not to use the "#" command prefix
|
* Whether or not to use the "#" command prefix
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,74 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of Baritone.
|
|
||||||
*
|
|
||||||
* Baritone is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Baritone is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package baritone.launch.mixins;
|
|
||||||
|
|
||||||
import baritone.api.BaritoneAPI;
|
|
||||||
import baritone.api.event.events.RotationMoveEvent;
|
|
||||||
import net.minecraft.client.entity.EntityPlayerSP;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|
||||||
|
|
||||||
import static org.spongepowered.asm.lib.Opcodes.GETFIELD;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Brady
|
|
||||||
* @since 8/21/2018
|
|
||||||
*/
|
|
||||||
@Mixin(Entity.class)
|
|
||||||
public class MixinEntity {
|
|
||||||
|
|
||||||
@Shadow
|
|
||||||
public float rotationYaw;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Event called to override the movement direction when walking
|
|
||||||
*/
|
|
||||||
private RotationMoveEvent motionUpdateRotationEvent;
|
|
||||||
|
|
||||||
@Inject(
|
|
||||||
method = "moveRelative",
|
|
||||||
at = @At("HEAD")
|
|
||||||
)
|
|
||||||
private void preMoveRelative(float strafe, float up, float forward, float friction, CallbackInfo ci) {
|
|
||||||
// noinspection ConstantConditions
|
|
||||||
if (EntityPlayerSP.class.isInstance(this)) {
|
|
||||||
this.motionUpdateRotationEvent = new RotationMoveEvent(RotationMoveEvent.Type.MOTION_UPDATE, this.rotationYaw);
|
|
||||||
BaritoneAPI.getProvider().getBaritoneForPlayer((EntityPlayerSP) (Object) this).getGameEventHandler().onPlayerRotationMove(this.motionUpdateRotationEvent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Redirect(
|
|
||||||
method = "moveRelative",
|
|
||||||
at = @At(
|
|
||||||
value = "FIELD",
|
|
||||||
opcode = GETFIELD,
|
|
||||||
target = "net/minecraft/entity/Entity.rotationYaw:F"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
private float overrideYaw(Entity self) {
|
|
||||||
if (self instanceof EntityPlayerSP) {
|
|
||||||
return this.motionUpdateRotationEvent.getYaw();
|
|
||||||
}
|
|
||||||
return self.rotationYaw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -74,4 +74,25 @@ public abstract class MixinEntityLivingBase extends Entity {
|
|||||||
}
|
}
|
||||||
return self.rotationYaw;
|
return self.rotationYaw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Redirect(
|
||||||
|
method = "travel",
|
||||||
|
at = @At(
|
||||||
|
value = "INVOKE",
|
||||||
|
target = "net/minecraft/entity/EntityLivingBase.moveRelative(FFFF)V"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
private void travel(EntityLivingBase self, float strafe, float up, float forward, float friction) {
|
||||||
|
// noinspection ConstantConditions
|
||||||
|
if (!EntityPlayerSP.class.isInstance(this)) {
|
||||||
|
moveRelative(strafe, up, forward, friction);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
RotationMoveEvent motionUpdateRotationEvent = new RotationMoveEvent(RotationMoveEvent.Type.MOTION_UPDATE, this.rotationYaw);
|
||||||
|
BaritoneAPI.getProvider().getBaritoneForPlayer((EntityPlayerSP) (Object) this).getGameEventHandler().onPlayerRotationMove(motionUpdateRotationEvent);
|
||||||
|
float originalYaw = this.rotationYaw;
|
||||||
|
this.rotationYaw = motionUpdateRotationEvent.getYaw();
|
||||||
|
this.moveRelative(strafe, up, forward, friction);
|
||||||
|
this.rotationYaw = originalYaw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package baritone.launch.mixins;
|
package baritone.launch.mixins;
|
||||||
|
|
||||||
|
import baritone.Baritone;
|
||||||
import baritone.api.BaritoneAPI;
|
import baritone.api.BaritoneAPI;
|
||||||
import baritone.utils.Helper;
|
import baritone.utils.Helper;
|
||||||
import net.minecraft.client.settings.KeyBinding;
|
import net.minecraft.client.settings.KeyBinding;
|
||||||
@@ -45,6 +46,9 @@ public class MixinKeyBinding {
|
|||||||
// only the primary baritone forces keys
|
// only the primary baritone forces keys
|
||||||
Boolean force = BaritoneAPI.getProvider().getPrimaryBaritone().getInputOverrideHandler().isInputForcedDown((KeyBinding) (Object) this);
|
Boolean force = BaritoneAPI.getProvider().getPrimaryBaritone().getInputOverrideHandler().isInputForcedDown((KeyBinding) (Object) this);
|
||||||
if (force != null) {
|
if (force != null) {
|
||||||
|
if (!force && !Baritone.settings().suppressClicks.get()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
cir.setReturnValue(force); // :sunglasses:
|
cir.setReturnValue(force); // :sunglasses:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -57,9 +61,10 @@ public class MixinKeyBinding {
|
|||||||
private void isPressed(CallbackInfoReturnable<Boolean> cir) {
|
private void isPressed(CallbackInfoReturnable<Boolean> cir) {
|
||||||
// only the primary baritone forces keys
|
// only the primary baritone forces keys
|
||||||
Boolean force = BaritoneAPI.getProvider().getPrimaryBaritone().getInputOverrideHandler().isInputForcedDown((KeyBinding) (Object) this);
|
Boolean force = BaritoneAPI.getProvider().getPrimaryBaritone().getInputOverrideHandler().isInputForcedDown((KeyBinding) (Object) this);
|
||||||
if (force != null && !force) { // <-- cursed
|
if (force != null && !force && Baritone.settings().suppressClicks.get()) { // <-- cursed
|
||||||
if (pressTime > 0) {
|
if (pressTime > 0) {
|
||||||
Helper.HELPER.logDirect("You're trying to press this mouse button but I won't let you");
|
Helper.HELPER.logDirect("You're trying to press this mouse button but I won't let you.");
|
||||||
|
Helper.HELPER.logDirect("Turn off the suppressClicks setting to allow clicking while pathing.");
|
||||||
pressTime--;
|
pressTime--;
|
||||||
}
|
}
|
||||||
cir.setReturnValue(force); // :sunglasses:
|
cir.setReturnValue(force); // :sunglasses:
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
"MixinChunkProviderServer",
|
"MixinChunkProviderServer",
|
||||||
"MixinChunkRenderContainer",
|
"MixinChunkRenderContainer",
|
||||||
"MixinChunkRenderWorker",
|
"MixinChunkRenderWorker",
|
||||||
"MixinEntity",
|
|
||||||
"MixinEntityLivingBase",
|
"MixinEntityLivingBase",
|
||||||
"MixinEntityPlayerSP",
|
"MixinEntityPlayerSP",
|
||||||
"MixinEntityRenderer",
|
"MixinEntityRenderer",
|
||||||
|
|||||||
Reference in New Issue
Block a user