Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Commit

Permalink
1.20 Stable release
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekiplay committed Jul 11, 2023
1 parent 15fa179 commit 6d9a377
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dev_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: '${{ secrets.GITHUB_TOKEN }}'
automatic_release_tag: "latest-dev-build-0.5.3-1835-1.19.4"
automatic_release_tag: "latest-dev-build-0.5.4-1.20"
prerelease: true
title: "Dev build 0.5.3 #1835 | 1.19.4 Build"
title: "Dev build 0.5.4 | 1.20 Build"
files: |
./build/libs/*.jar
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package olejka.meteorplus.mixin.meteorclient;

import baritone.api.BaritoneAPI;
import baritone.api.pathing.goals.GoalBlock;
import meteordevelopment.meteorclient.events.meteor.MouseButtonEvent;
import meteordevelopment.meteorclient.settings.BoolSetting;
import meteordevelopment.meteorclient.settings.Setting;
import meteordevelopment.meteorclient.settings.SettingGroup;
import meteordevelopment.meteorclient.systems.modules.render.Freecam;
import meteordevelopment.meteorclient.utils.misc.input.KeyAction;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import org.lwjgl.glfw.GLFW;
import org.spongepowered.asm.mixin.Mixin;

import static baritone.api.utils.Helper.mc;

@Mixin(Freecam.class)
public class FreecamMixin {
private final Freecam freecam = (Freecam)(Object) this;

private final SettingGroup freecamMeteorPlusSetting = freecam.settings.createGroup("Meteor Plus");

private final Setting<Boolean> baritoneControl = freecamMeteorPlusSetting.add(new BoolSetting.Builder()
.name("Baritone control")
.description("Left-click to set the destination on the selected block. Right click to cancel.")
.build()
);

@EventHandler
private void onMouseButtonEvent(MouseButtonEvent event) {
if (!baritoneControl.get()) return;
if (event.action != KeyAction.Press) return;
if (mc.currentScreen != null) return;

if (event.button == GLFW.GLFW_MOUSE_BUTTON_LEFT) {
if (!(mc.crosshairTarget instanceof BlockHitResult)) return;

BlockPos blockPos = ((BlockHitResult) mc.crosshairTarget).getBlockPos();

if (mc.world.getBlockState(blockPos).isAir()) return;

GoalBlock goal = new GoalBlock(blockPos.up());
BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAndPath(goal);
event.cancel();
}

if (event.button == GLFW.GLFW_MOUSE_BUTTON_RIGHT) {
BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAndPath(null);
event.cancel();
}
}
}
3 changes: 2 additions & 1 deletion src/main/resources/meteor-plus.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"mixins": [
"ClientPlayerInteractionManagerMixin",
"InGameHudMixin"
"InGameHudMixin",
"meteorclient.FreecamMixin"
]
}

0 comments on commit 6d9a377

Please sign in to comment.