From c948138db19db4b59a02121c4a652b78eef1b0f0 Mon Sep 17 00:00:00 2001 From: jellylab Date: Tue, 25 Apr 2023 22:39:16 +0800 Subject: [PATCH] Commission macro final fix + gradle fix --- build.gradle | 5 +++-- .../baritone/automine/calculations/AStarPathFinder.java | 2 +- src/main/java/com/jelly/MightyMiner/config/Config.java | 2 +- .../jelly/MightyMiner/macros/macros/CommissionMacro.java | 6 +++--- .../com/jelly/MightyMiner/macros/macros/MithrilMacro.java | 8 ++++---- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index 176d14ca..13f792ce 100644 --- a/build.gradle +++ b/build.gradle @@ -7,12 +7,12 @@ buildscript { url = "https://files.minecraftforge.net/maven" } maven { url "https://jitpack.io" } - maven { url "https://repo.spongepowered.org/repository/maven-public/" } + maven { url "https://repo.spongepowered.org/repository/maven/" } } dependencies { classpath "com.github.Skytils:ForgeGradle:41dfce0a70" classpath "com.github.jengelman.gradle.plugins:shadow:6.1.0" - classpath "com.github.debuggingss:MixinGradle:0.6-SNAPSHOT" + classpath "com.github.xcfrg:MixinGradle:0.6-SNAPSHOT" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } @@ -70,6 +70,7 @@ repositories { dependencies { implementation('com.google.code.gson:gson:2.10.1') + implementation('org.spongepowered:mixin:0.7.11-SNAPSHOT') annotationProcessor('org.spongepowered:mixin:0.7.11-SNAPSHOT') diff --git a/src/main/java/com/jelly/MightyMiner/baritone/automine/calculations/AStarPathFinder.java b/src/main/java/com/jelly/MightyMiner/baritone/automine/calculations/AStarPathFinder.java index 45ae26b5..8e703d72 100644 --- a/src/main/java/com/jelly/MightyMiner/baritone/automine/calculations/AStarPathFinder.java +++ b/src/main/java/com/jelly/MightyMiner/baritone/automine/calculations/AStarPathFinder.java @@ -139,7 +139,7 @@ private double calculatePathCost(List nodes) { double cost = 0.0D; if (nodes.size() <= 2) { for (BlockNode node : nodes) - cost += (0.5 * Math.abs(AngleUtils.getActualRotationYaw(mc.thePlayer.rotationYaw) - AngleUtils.getRequiredYawSide(node.getPos())) + Math.abs(mc.thePlayer.rotationPitch - AngleUtils.getRequiredPitchSide(node.getPos()))) / 540.0d + mc.thePlayer.rayTrace(5, 1).hitVec.distanceTo(new Vec3(node.getPos())) / 540.0d; + cost += (Math.abs(AngleUtils.getActualRotationYaw(mc.thePlayer.rotationYaw) - AngleUtils.getRequiredYawSide(node.getPos())) + Math.abs(mc.thePlayer.rotationPitch - AngleUtils.getRequiredPitchSide(node.getPos()))) / 540.0d; } else { for (BlockNode node : nodes) cost += (node.getType() == BlockType.WALK) ? 1D : 1.5D; diff --git a/src/main/java/com/jelly/MightyMiner/config/Config.java b/src/main/java/com/jelly/MightyMiner/config/Config.java index badb6bbe..65fcc025 100644 --- a/src/main/java/com/jelly/MightyMiner/config/Config.java +++ b/src/main/java/com/jelly/MightyMiner/config/Config.java @@ -204,7 +204,7 @@ public class Config extends cc.polyfrost.oneconfig.config.Config { @VigilanceName(name = "Arrive check wait time in ms", category = COMMISSION_MACRO, subcategory = "Warping") @Slider( name = "Arrive check wait time in ms", category = COMMISSION_MACRO, subcategory = "Warping", max = 750, min = 200) - public int commArriveWaitTime = 10; + public int commArriveWaitTime = 250; @VigilanceName(name = "Stop on limbo", category = COMMISSION_MACRO, subcategory = "Failsafe") @Switch(name = "Stop on limbo", description = "Stop macro when getting kicked to limbo", category = COMMISSION_MACRO, subcategory = "Failsafe") diff --git a/src/main/java/com/jelly/MightyMiner/macros/macros/CommissionMacro.java b/src/main/java/com/jelly/MightyMiner/macros/macros/CommissionMacro.java index 0ab22546..34916c26 100644 --- a/src/main/java/com/jelly/MightyMiner/macros/macros/CommissionMacro.java +++ b/src/main/java/com/jelly/MightyMiner/macros/macros/CommissionMacro.java @@ -2102,13 +2102,13 @@ protected void onDisable() { private ArrayList> getHighestPriority() { - for(BlockPos bp : BlockUtils.findBlockInCube(10, null, 0, 256, + for(BlockPos bp : BlockUtils.findBlockInCube(12, null, 0, 256, MineUtils.getMithrilColorBasedOnPriority(3))) { if(BlockUtils.canMineBlock(bp)) return MineUtils.getMithrilColorBasedOnPriority(3); } - for(BlockPos bp : BlockUtils.findBlockInCube(10, null, 0, 256, + for(BlockPos bp : BlockUtils.findBlockInCube(12, null, 0, 256, new ArrayList>() {{ add(new BlockData<>(Blocks.stained_hardened_clay, null)); add(new BlockData<>(Blocks.wool, EnumDyeColor.GRAY)); @@ -2122,7 +2122,7 @@ private ArrayList> getHighestPriority() { }}; } - for(BlockPos bp : BlockUtils.findBlockInCube(10, null, 0, 256, + for(BlockPos bp : BlockUtils.findBlockInCube(12, null, 0, 256, MineUtils.getMithrilColorBasedOnPriority(2))) { if(BlockUtils.canMineBlock(bp)) return MineUtils.getMithrilColorBasedOnPriority(2); diff --git a/src/main/java/com/jelly/MightyMiner/macros/macros/MithrilMacro.java b/src/main/java/com/jelly/MightyMiner/macros/macros/MithrilMacro.java index a30eedc0..8c43459f 100644 --- a/src/main/java/com/jelly/MightyMiner/macros/macros/MithrilMacro.java +++ b/src/main/java/com/jelly/MightyMiner/macros/macros/MithrilMacro.java @@ -83,22 +83,22 @@ public void onTick(TickEvent.Phase phase) { private ArrayList> getHighestPriority() { - for(BlockPos bp : BlockUtils.findBlockInCube(10, null, 0, 256, + for(BlockPos bp : BlockUtils.findBlockInCube(12, null, 0, 256, MineUtils.getMithrilColorBasedOnPriority(MightyMiner.config.mithPriority1))) { if(BlockUtils.canMineBlock(bp)) return MineUtils.getMithrilColorBasedOnPriority(MightyMiner.config.mithPriority1); } - for(BlockPos bp : BlockUtils.findBlockInCube(10, null, 0, 256, + for(BlockPos bp : BlockUtils.findBlockInCube(12, null, 0, 256, MineUtils.getMithrilColorBasedOnPriority(MightyMiner.config.mithPriority2))) { if(BlockUtils.canMineBlock(bp)) return MineUtils.getMithrilColorBasedOnPriority(MightyMiner.config.mithPriority2); } - for(BlockPos bp : BlockUtils.findBlockInCube(10, null, 0, 256, + for(BlockPos bp : BlockUtils.findBlockInCube(12, null, 0, 256, MineUtils.getMithrilColorBasedOnPriority(MightyMiner.config.mithPriority3))) { if(BlockUtils.canMineBlock(bp)) return MineUtils.getMithrilColorBasedOnPriority(MightyMiner.config.mithPriority3); } - for(BlockPos bp : BlockUtils.findBlockInCube(10, null, 0, 256, + for(BlockPos bp : BlockUtils.findBlockInCube(12, null, 0, 256, MineUtils.getMithrilColorBasedOnPriority(MightyMiner.config.mithPriority4))) { if(BlockUtils.canMineBlock(bp)) return MineUtils.getMithrilColorBasedOnPriority(MightyMiner.config.mithPriority4);