diff --git a/.github/workflows/dev_build.yml b/.github/workflows/dev_build.yml index f320b1f9..d9b97ae1 100644 --- a/.github/workflows/dev_build.yml +++ b/.github/workflows/dev_build.yml @@ -3,8 +3,8 @@ name: Java CI with Gradle -concurrency: - group: "build-1.19" +concurrency: + group: "build-1.20" cancel-in-progress: true on: @@ -12,7 +12,7 @@ on: branches: [ master ] paths-ignore: - '*.md' - + jobs: build: @@ -34,9 +34,8 @@ jobs: - uses: "marvinpinto/action-automatic-releases@latest" with: repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest-1.19" + automatic_release_tag: "latest-1.20.2" prerelease: false - title: "1.19 Build" + title: "1.20.2 Build" files: | ./build/libs/*.jar - \ No newline at end of file diff --git a/build.gradle b/build.gradle index 705f50b6..b1d86d75 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '0.12-SNAPSHOT' + id 'fabric-loom' version '1.4-SNAPSHOT' } sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17 @@ -26,7 +26,8 @@ dependencies { modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" // Meteor - modImplementation "meteordevelopment:meteor-client:${project.meteor_version}" + modImplementation "meteordevelopment:meteor-client:${project.meteor_version}-SNAPSHOT" + modImplementation "baritone:fabric:${project.minecraft_version}-SNAPSHOT" } processResources { diff --git a/gradle.properties b/gradle.properties index 6243bb42..9e9d7ef6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,16 +1,13 @@ org.gradle.jvmargs=-Xmx2G -# Fabric (https://fabricmc.net/versions.html) -minecraft_version=1.19.3 -yarn_version=1.19.3+build.3 -loader_version=0.14.11 +# Fabric (https://fabricmc.net/develop/) +minecraft_version=1.20.2 +yarn_version=1.20.2+build.4 +loader_version=0.14.23 # Mod Properties mod_version=0.1 -maven_group=dummy.package +maven_group=tanuki.package archives_base_name=tanuki-addon -# Dependency Versions - -# Meteor (https://maven.meteordev.org/) -meteor_version=0.5.2-SNAPSHOT +meteor_version=0.5.5 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 00e33ede..db9a6b82 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/anticope/tanuki/Tanuki.java b/src/main/java/anticope/tanuki/Tanuki.java index 492e88df..695c2c6c 100644 --- a/src/main/java/anticope/tanuki/Tanuki.java +++ b/src/main/java/anticope/tanuki/Tanuki.java @@ -1,40 +1,39 @@ package anticope.tanuki; +import anticope.tanuki.modules.*; import com.mojang.logging.LogUtils; import meteordevelopment.meteorclient.addons.GithubRepo; import meteordevelopment.meteorclient.addons.MeteorAddon; import meteordevelopment.meteorclient.systems.modules.Category; import meteordevelopment.meteorclient.systems.modules.Modules; -import anticope.tanuki.modules.*; - import net.fabricmc.loader.api.FabricLoader; import net.minecraft.item.Items; import org.slf4j.Logger; public class Tanuki extends MeteorAddon { - public static final Logger LOG = LogUtils.getLogger(); - public static final Category CATEGORY = new Category("Tanuki", Items.BROWN_WOOL.getDefaultStack()); - - @Override - public void onInitialize() { - LOG.info("Initializing Tanuki"); + public static final Logger LOG = LogUtils.getLogger(); + public static final Category CATEGORY = new Category("Tanuki", Items.BROWN_WOOL.getDefaultStack()); - Modules modules = Modules.get(); - modules.add(new AntiCrystal()); - modules.add(new AntiCrystalPhase()); - modules.add(new AutoGriffer()); - modules.add(new BedrockWalk()); - modules.add(new Confetti()); - modules.add(new FuckedDetector()); - modules.add(new PauseOnUnloaded()); + @Override + public void onInitialize() { + LOG.info("Initializing Tanuki"); + + Modules modules = Modules.get(); + modules.add(new AntiCrystal()); + modules.add(new AntiCrystalPhase()); + modules.add(new AutoGriffer()); + modules.add(new BedrockWalk()); + modules.add(new Confetti()); + modules.add(new FuckedDetector()); + modules.add(new PauseOnUnloaded()); modules.add(new TanukiPacketFly()); - } + } - @Override - public void onRegisterCategories() { - Modules.registerCategory(CATEGORY); - } + @Override + public void onRegisterCategories() { + Modules.registerCategory(CATEGORY); + } @Override public String getPackage() { diff --git a/src/main/java/anticope/tanuki/mixin/ClientPlayerEntityMixin.java b/src/main/java/anticope/tanuki/mixin/ClientPlayerEntityMixin.java index 618d764b..49b5bd7b 100644 --- a/src/main/java/anticope/tanuki/mixin/ClientPlayerEntityMixin.java +++ b/src/main/java/anticope/tanuki/mixin/ClientPlayerEntityMixin.java @@ -1,14 +1,12 @@ package anticope.tanuki.mixin; +import anticope.tanuki.events.PushOutOfBlockEvent; +import meteordevelopment.meteorclient.MeteorClient; +import net.minecraft.client.network.ClientPlayerEntity; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.At; - -import net.minecraft.client.network.ClientPlayerEntity; - -import anticope.tanuki.events.PushOutOfBlockEvent; -import meteordevelopment.meteorclient.MeteorClient; @Mixin(ClientPlayerEntity.class) public class ClientPlayerEntityMixin { @@ -16,6 +14,6 @@ public class ClientPlayerEntityMixin { private void onPushOutOfBlocks(double x, double d, CallbackInfo info) { PushOutOfBlockEvent event = PushOutOfBlockEvent.get(x, d); MeteorClient.EVENT_BUS.post(event); - if(event.isCancelled()) info.cancel(); + if (event.isCancelled()) info.cancel(); } } diff --git a/src/main/java/anticope/tanuki/mixin/TotemParticleMixin.java b/src/main/java/anticope/tanuki/mixin/TotemParticleMixin.java index 4f61fa06..1b2f3977 100644 --- a/src/main/java/anticope/tanuki/mixin/TotemParticleMixin.java +++ b/src/main/java/anticope/tanuki/mixin/TotemParticleMixin.java @@ -1,13 +1,12 @@ package anticope.tanuki.mixin; +import anticope.tanuki.modules.Confetti; import meteordevelopment.meteorclient.systems.modules.Modules; import net.minecraft.client.particle.AnimatedParticle; import net.minecraft.client.particle.SpriteProvider; import net.minecraft.client.particle.TotemParticle; import net.minecraft.client.world.ClientWorld; import net.minecraft.util.math.Vec3d; -import anticope.tanuki.modules.Confetti; - import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -23,8 +22,8 @@ protected TotemParticleMixin(ClientWorld world, double x, double y, double z, Sp @Inject(method = "", at = @At("TAIL")) private void onConfettiConstructor(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider, CallbackInfo ci) { Confetti confetti = Modules.get().get(Confetti.class); - TotemParticle totemParticle = ((TotemParticle)(Object) this); - if(confetti.isActive()) { + TotemParticle totemParticle = ((TotemParticle) (Object) this); + if (confetti.isActive()) { Vec3d colorOne = confetti.getColorOne(); Vec3d colorTwo = confetti.getColorTwo(); if (this.random.nextInt(4) == 0) { @@ -34,5 +33,4 @@ private void onConfettiConstructor(ClientWorld world, double x, double y, double } } } - } diff --git a/src/main/java/anticope/tanuki/mixin/meteor/CrystalAuraAccessor.java b/src/main/java/anticope/tanuki/mixin/meteor/CrystalAuraAccessor.java index 16fe1875..802d1aec 100644 --- a/src/main/java/anticope/tanuki/mixin/meteor/CrystalAuraAccessor.java +++ b/src/main/java/anticope/tanuki/mixin/meteor/CrystalAuraAccessor.java @@ -1,12 +1,10 @@ package anticope.tanuki.mixin.meteor; +import meteordevelopment.meteorclient.systems.modules.combat.CrystalAura; +import net.minecraft.entity.player.PlayerEntity; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; -import net.minecraft.entity.player.PlayerEntity; - -import meteordevelopment.meteorclient.systems.modules.combat.CrystalAura; - @Mixin(CrystalAura.class) public interface CrystalAuraAccessor { @Accessor("bestTarget") diff --git a/src/main/java/anticope/tanuki/mixin/meteor/ProfileMixin.java b/src/main/java/anticope/tanuki/mixin/meteor/ProfileMixin.java index f715eada..f5db71c2 100644 --- a/src/main/java/anticope/tanuki/mixin/meteor/ProfileMixin.java +++ b/src/main/java/anticope/tanuki/mixin/meteor/ProfileMixin.java @@ -1,11 +1,10 @@ package anticope.tanuki.mixin.meteor; import anticope.tanuki.modules.hud.ProfileHud; +import meteordevelopment.meteorclient.systems.profiles.Profile; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; - -import meteordevelopment.meteorclient.systems.profiles.Profile; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(Profile.class) diff --git a/src/main/java/anticope/tanuki/modules/AntiCrystal.java b/src/main/java/anticope/tanuki/modules/AntiCrystal.java index 6af4b2c0..a43b8b8e 100644 --- a/src/main/java/anticope/tanuki/modules/AntiCrystal.java +++ b/src/main/java/anticope/tanuki/modules/AntiCrystal.java @@ -1,24 +1,18 @@ package anticope.tanuki.modules; +import anticope.tanuki.Tanuki; import com.google.common.collect.Streams; -import meteordevelopment.orbit.EventHandler; import meteordevelopment.meteorclient.events.world.TickEvent; +import meteordevelopment.meteorclient.settings.*; import meteordevelopment.meteorclient.systems.modules.Module; -import meteordevelopment.meteorclient.settings.BoolSetting; -import meteordevelopment.meteorclient.settings.DoubleSetting; -import meteordevelopment.meteorclient.settings.EnumSetting; -import meteordevelopment.meteorclient.settings.Setting; -import meteordevelopment.meteorclient.settings.SettingGroup; import meteordevelopment.meteorclient.utils.player.FindItemResult; import meteordevelopment.meteorclient.utils.player.InvUtils; import meteordevelopment.meteorclient.utils.world.BlockUtils; - +import meteordevelopment.orbit.EventHandler; import net.minecraft.entity.decoration.EndCrystalEntity; import net.minecraft.item.Item; import net.minecraft.item.Items; -import anticope.tanuki.Tanuki; - import java.util.Comparator; import java.util.Optional; @@ -32,34 +26,34 @@ public enum Mode { private final SettingGroup sgGeneral = settings.getDefaultGroup(); private final Setting mode = sgGeneral.add(new EnumSetting.Builder() - .name("mode") - .description("The mode at which AntiCrystal operates.") - .defaultValue(Mode.PressurePlate) - .build() + .name("mode") + .description("The mode at which AntiCrystal operates.") + .defaultValue(Mode.PressurePlate) + .build() ); private final Setting range = sgGeneral.add(new DoubleSetting.Builder() - .name("range") - .description("The range to place Pressure Plates/Buttons.") - .min(1) - .max(10) - .defaultValue(1) - .build() + .name("range") + .description("The range to place Pressure Plates/Buttons.") + .min(1) + .max(10) + .defaultValue(1) + .build() ); private final Setting rotate = sgGeneral.add(new BoolSetting.Builder() - .name("rotate") - .description("Rotate.") - .defaultValue(true) - .build() + .name("rotate") + .description("Rotate.") + .defaultValue(true) + .build() ); public AntiCrystal() { super(Tanuki.CATEGORY, "anti-crystal", "Stops End Crystals from doing damage to you."); } - private static final Item[] BUTTONS = { Items.ACACIA_BUTTON, Items.BIRCH_BUTTON, Items.CRIMSON_BUTTON, Items.DARK_OAK_BUTTON, Items.JUNGLE_BUTTON, Items.OAK_BUTTON, Items.POLISHED_BLACKSTONE_BUTTON, Items.SPRUCE_BUTTON, Items.STONE_BUTTON, Items.WARPED_BUTTON }; - private static final Item[] PLATES = { Items.ACACIA_PRESSURE_PLATE, Items.BIRCH_PRESSURE_PLATE, Items.CRIMSON_PRESSURE_PLATE, Items.DARK_OAK_PRESSURE_PLATE, Items.JUNGLE_PRESSURE_PLATE, Items.OAK_PRESSURE_PLATE, Items.POLISHED_BLACKSTONE_PRESSURE_PLATE, Items.SPRUCE_PRESSURE_PLATE, Items.STONE_PRESSURE_PLATE, Items.WARPED_PRESSURE_PLATE}; + private static final Item[] BUTTONS = {Items.ACACIA_BUTTON, Items.BIRCH_BUTTON, Items.CRIMSON_BUTTON, Items.DARK_OAK_BUTTON, Items.JUNGLE_BUTTON, Items.OAK_BUTTON, Items.POLISHED_BLACKSTONE_BUTTON, Items.SPRUCE_BUTTON, Items.STONE_BUTTON, Items.WARPED_BUTTON}; + private static final Item[] PLATES = {Items.ACACIA_PRESSURE_PLATE, Items.BIRCH_PRESSURE_PLATE, Items.CRIMSON_PRESSURE_PLATE, Items.DARK_OAK_PRESSURE_PLATE, Items.JUNGLE_PRESSURE_PLATE, Items.OAK_PRESSURE_PLATE, Items.POLISHED_BLACKSTONE_PRESSURE_PLATE, Items.SPRUCE_PRESSURE_PLATE, Items.STONE_PRESSURE_PLATE, Items.WARPED_PRESSURE_PLATE}; @EventHandler private void onTick(TickEvent.Post event) { @@ -67,11 +61,11 @@ private void onTick(TickEvent.Post event) { assert mc.player != null; Optional crystalTarget = Streams.stream(mc.world.getEntities()) - .filter(e -> (e instanceof EndCrystalEntity)) - .filter(e -> e.distanceTo(mc.player) <= range.get() * 2) - .filter(e -> mc.world.getBlockState(e.getBlockPos()).isAir()) - .min(Comparator.comparingDouble(o -> o.distanceTo(mc.player))) - .map(e -> (EndCrystalEntity) e); + .filter(e -> (e instanceof EndCrystalEntity)) + .filter(e -> e.distanceTo(mc.player) <= range.get() * 2) + .filter(e -> mc.world.getBlockState(e.getBlockPos()).isAir()) + .min(Comparator.comparingDouble(o -> o.distanceTo(mc.player))) + .map(e -> (EndCrystalEntity) e); crystalTarget.ifPresent(crystal -> { diff --git a/src/main/java/anticope/tanuki/modules/AntiCrystalPhase.java b/src/main/java/anticope/tanuki/modules/AntiCrystalPhase.java index 7ae0326a..25a37d9e 100644 --- a/src/main/java/anticope/tanuki/modules/AntiCrystalPhase.java +++ b/src/main/java/anticope/tanuki/modules/AntiCrystalPhase.java @@ -1,29 +1,28 @@ package anticope.tanuki.modules; -import meteordevelopment.orbit.EventHandler; +import anticope.tanuki.Tanuki; +import anticope.tanuki.events.PushOutOfBlockEvent; import meteordevelopment.meteorclient.events.world.TickEvent; -import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.meteorclient.settings.DoubleSetting; import meteordevelopment.meteorclient.settings.Setting; import meteordevelopment.meteorclient.settings.SettingGroup; +import meteordevelopment.meteorclient.systems.modules.Module; +import meteordevelopment.orbit.EventHandler; import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.util.math.Vec3d; -import anticope.tanuki.Tanuki; -import anticope.tanuki.events.PushOutOfBlockEvent; - public class AntiCrystalPhase extends Module { private final SettingGroup sgGeneral = settings.getDefaultGroup(); private final Setting clipDistance = sgGeneral.add(new DoubleSetting.Builder() - .name("Clip Distance") - .description("The distance per clip.") - .defaultValue(.01) - .min(0) - .max(1) - .build() + .name("Clip Distance") + .description("The distance per clip.") + .defaultValue(.01) + .min(0) + .max(1) + .build() ); public AntiCrystalPhase() { @@ -37,33 +36,33 @@ private void onTick(TickEvent.Pre event) { if (!p.isOnGround()) return; - if(mc.options.forwardKey.isPressed()){ - Vec3d forward = Vec3d.fromPolar(0, p.getYaw()); - p.updatePosition(p.getX() + forward.x * blocks, p.getY(), p.getZ() + forward.z * blocks); - } - - if(mc.options.backKey.isPressed()){ - Vec3d forward = Vec3d.fromPolar(0, p.getYaw() - 180); - p.updatePosition(p.getX() + forward.x * blocks, p.getY(), p.getZ() + forward.z * blocks); - } - - if(mc.options.leftKey.isPressed()){ - Vec3d forward = Vec3d.fromPolar(0, p.getYaw() - 90); - p.updatePosition(p.getX() + forward.x * blocks, p.getY(), p.getZ() + forward.z * blocks); - } - - if(mc.options.rightKey.isPressed()) { - Vec3d forward = Vec3d.fromPolar(0, p.getYaw() - 270); - p.updatePosition(p.getX() + forward.x * blocks, p.getY(), p.getZ() + forward.z * blocks); - } - - if (mc.options.jumpKey.isPressed()) { - p.updatePosition(p.getX(), p.getY() + 0.05, p.getZ()); - } - - if (mc.options.sneakKey.isPressed()) { - p.updatePosition(p.getX(), p.getY() - 0.05, p.getZ()); - } + if (mc.options.forwardKey.isPressed()) { + Vec3d forward = Vec3d.fromPolar(0, p.getYaw()); + p.updatePosition(p.getX() + forward.x * blocks, p.getY(), p.getZ() + forward.z * blocks); + } + + if (mc.options.backKey.isPressed()) { + Vec3d forward = Vec3d.fromPolar(0, p.getYaw() - 180); + p.updatePosition(p.getX() + forward.x * blocks, p.getY(), p.getZ() + forward.z * blocks); + } + + if (mc.options.leftKey.isPressed()) { + Vec3d forward = Vec3d.fromPolar(0, p.getYaw() - 90); + p.updatePosition(p.getX() + forward.x * blocks, p.getY(), p.getZ() + forward.z * blocks); + } + + if (mc.options.rightKey.isPressed()) { + Vec3d forward = Vec3d.fromPolar(0, p.getYaw() - 270); + p.updatePosition(p.getX() + forward.x * blocks, p.getY(), p.getZ() + forward.z * blocks); + } + + if (mc.options.jumpKey.isPressed()) { + p.updatePosition(p.getX(), p.getY() + 0.05, p.getZ()); + } + + if (mc.options.sneakKey.isPressed()) { + p.updatePosition(p.getX(), p.getY() - 0.05, p.getZ()); + } } @EventHandler diff --git a/src/main/java/anticope/tanuki/modules/AutoGriffer.java b/src/main/java/anticope/tanuki/modules/AutoGriffer.java index 53788a57..18b56e43 100644 --- a/src/main/java/anticope/tanuki/modules/AutoGriffer.java +++ b/src/main/java/anticope/tanuki/modules/AutoGriffer.java @@ -1,24 +1,22 @@ package anticope.tanuki.modules; -import meteordevelopment.orbit.EventHandler; +import anticope.tanuki.Tanuki; import meteordevelopment.meteorclient.events.world.TickEvent; -import meteordevelopment.meteorclient.systems.friends.Friends; -import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.meteorclient.settings.DoubleSetting; import meteordevelopment.meteorclient.settings.Setting; import meteordevelopment.meteorclient.settings.SettingGroup; -import meteordevelopment.meteorclient.utils.entity.fakeplayer.FakePlayerEntity; +import meteordevelopment.meteorclient.systems.friends.Friends; +import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.meteorclient.utils.entity.fakeplayer.FakePlayerManager; import meteordevelopment.meteorclient.utils.player.FindItemResult; import meteordevelopment.meteorclient.utils.player.InvUtils; import meteordevelopment.meteorclient.utils.player.Rotations; +import meteordevelopment.orbit.EventHandler; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.Items; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; -import anticope.tanuki.Tanuki; - public class AutoGriffer extends Module { private final SettingGroup sgPlace = settings.createGroup("Place"); @@ -28,11 +26,11 @@ public AutoGriffer() { } private final Setting range = sgPlace.add(new DoubleSetting.Builder() - .name("range") - .description("How far away the target can be to be affected.") - .defaultValue(4) - .min(0) - .build()); + .name("range") + .description("How far away the target can be to be affected.") + .defaultValue(4) + .min(0) + .build()); private static PlayerEntity target; private int stage; @@ -51,7 +49,7 @@ private void onTick(TickEvent.Pre event) { for (PlayerEntity player : mc.world.getPlayers()) { if (player == mc.player || !Friends.get().shouldAttack(player) || !player.isAlive() - || mc.player.distanceTo(player) > range.get()) + || mc.player.distanceTo(player) > range.get()) continue; if (target == null) @@ -63,7 +61,7 @@ else if (mc.player.distanceTo(target) > mc.player.distanceTo(player)) if (target == null) { FakePlayerManager.forEach(player -> { if (!Friends.get().shouldAttack(player) || !player.isAlive() - || mc.player.distanceTo(player) > range.get()) + || mc.player.distanceTo(player) > range.get()) return; if (target == null) @@ -84,7 +82,7 @@ else if (mc.player.distanceTo(target) > mc.player.distanceTo(player)) toggle(); return; } else { - BlockPos anvil1 = target.getBlockPos().add(0, 1.3, 0); + BlockPos anvil1 = target.getBlockPos().add(0, (int) 1.3, 0); mc.player.setPitch((float) Rotations.getPitch(anvil1)); mc.player.setYaw((float) Rotations.getYaw(anvil1)); InvUtils.swap(lava.slot(), false); diff --git a/src/main/java/anticope/tanuki/modules/BedrockWalk.java b/src/main/java/anticope/tanuki/modules/BedrockWalk.java index 91c78427..2256d921 100644 --- a/src/main/java/anticope/tanuki/modules/BedrockWalk.java +++ b/src/main/java/anticope/tanuki/modules/BedrockWalk.java @@ -1,29 +1,24 @@ package anticope.tanuki.modules; -import java.util.ArrayList; -import java.util.Map; -import java.util.TreeMap; - import anticope.tanuki.Tanuki; +import meteordevelopment.meteorclient.events.world.TickEvent; +import meteordevelopment.meteorclient.mixininterface.IVec3d; +import meteordevelopment.meteorclient.settings.*; +import meteordevelopment.meteorclient.systems.modules.Module; +import meteordevelopment.orbit.EventHandler; import net.minecraft.block.BlockState; import net.minecraft.block.FluidBlock; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; -import meteordevelopment.meteorclient.events.world.TickEvent; -import meteordevelopment.meteorclient.mixininterface.IVec3d; -import meteordevelopment.meteorclient.settings.BoolSetting; -import meteordevelopment.meteorclient.settings.DoubleSetting; -import meteordevelopment.meteorclient.settings.IntSetting; -import meteordevelopment.meteorclient.settings.Setting; -import meteordevelopment.meteorclient.settings.SettingGroup; -import meteordevelopment.meteorclient.systems.modules.Module; -import meteordevelopment.orbit.EventHandler; +import java.util.ArrayList; +import java.util.Map; +import java.util.TreeMap; public class BedrockWalk extends Module { - private final SettingGroup sgGeneral = settings.getDefaultGroup(); + private final SettingGroup sgGeneral = settings.getDefaultGroup(); - private final Setting activationWindow = sgGeneral.add(new DoubleSetting.Builder() + private final Setting activationWindow = sgGeneral.add(new DoubleSetting.Builder() .name("activation-window") .description("The area above the target Y level at which pull activates.") .min(0.2D) @@ -34,7 +29,7 @@ public class BedrockWalk extends Module { .build() ); - + private final Setting driftToHeight = sgGeneral.add(new IntSetting.Builder() .name("drift-to-height") .description("Y level to find blocks to drift onto.") @@ -46,7 +41,7 @@ public class BedrockWalk extends Module { .build() ); - + private final Setting horizontalPullStrength = sgGeneral.add(new DoubleSetting.Builder() .name("horizontal-pull") .description("The horizontal speed/strength at which you drift to the goal block.") @@ -56,9 +51,9 @@ public class BedrockWalk extends Module { .sliderMax(10.0D) .defaultValue(1.0D) .build() - ); + ); + - private final Setting verticalPullStrength = sgGeneral.add(new DoubleSetting.Builder() .name("vertical-pull") .description("The vertical speed/strength at which you drift to the goal block.") @@ -70,7 +65,7 @@ public class BedrockWalk extends Module { .build() ); - + private final Setting searchRadius = sgGeneral.add(new IntSetting.Builder() .name("search-radius") .description("The radius at which tanuki mode searches for blocks (odd numbers only).") @@ -82,7 +77,7 @@ public class BedrockWalk extends Module { .build() ); - + private final Setting updatePositionFailsafe = sgGeneral.add(new BoolSetting.Builder() .name("failsafe") .description("Updates your position to the top of the target block if you miss the jump.") @@ -90,7 +85,7 @@ public class BedrockWalk extends Module { .build() ); - + private final Setting failsafeWindow = sgGeneral.add(new DoubleSetting.Builder() .name("failsafe-window") .description("Window below the target block to fall to trigger failsafe.") @@ -102,7 +97,7 @@ public class BedrockWalk extends Module { .build() ); - + private final Setting successfulLandingMargin = sgGeneral.add(new DoubleSetting.Builder() .name("landing-margin") .description("The distance from a landing block to be considered a successful landing.") @@ -112,14 +107,14 @@ public class BedrockWalk extends Module { .sliderMax(10.0D) .defaultValue(1.0D) .build() - ); + ); private final BlockPos.Mutable blockPos = new BlockPos.Mutable(0, 0, 0); private final ArrayList validBlocks = new ArrayList<>(); private final TreeMap sortedBlocks = new TreeMap<>(); private final BlockPos.Mutable playerHorizontalPos = new BlockPos.Mutable(); private boolean successfulLanding; - + public BedrockWalk() { super(Tanuki.CATEGORY, "bedrock-walk", "Makes moving on bedrock easier."); @@ -130,22 +125,22 @@ public void onActivate() { if (this.searchRadius.get() % 2 == 0) { info("%d is not valid for radius, rounding up", this.searchRadius.get()); searchRadius.set(searchRadius.get() + 1); - } + } } @EventHandler private void onTick(TickEvent.Post event) { if (mc.player.getY() > driftToHeight.get() + activationWindow.get()) return; - Vec3d targetPos = findNearestBlock(mc.player.getX(), driftToHeight.get() -1, mc.player.getZ()); + Vec3d targetPos = findNearestBlock(mc.player.getX(), driftToHeight.get() - 1, mc.player.getZ()); if (targetPos == null) return; if (mc.player.getY() == targetPos.getY() + 1.0D) return; if (mc.options.jumpKey.isPressed()) return; - if (updatePositionFailsafe.get() && !successfulLanding && mc.player.getY() < (driftToHeight.get() - failsafeWindow.get())) { + if (updatePositionFailsafe.get() && !successfulLanding && mc.player.getY() < (driftToHeight.get() - failsafeWindow.get())) { mc.player.setPos(targetPos.getX(), targetPos.getY() + 1.0D, targetPos.getZ()); } Vec3d normalizedDirection = targetPos.subtract(mc.player.getPos()).normalize(); Vec3d velocity = mc.player.getVelocity(); - ((IVec3d)mc.player.getVelocity()).set( + ((IVec3d) mc.player.getVelocity()).set( velocity.x + normalizedDirection.x * horizontalPullStrength.get() * mc.getTickDelta(), velocity.y + normalizedDirection.y * verticalPullStrength.get() * mc.getTickDelta(), velocity.z + normalizedDirection.z * horizontalPullStrength.get() * mc.getTickDelta() @@ -164,7 +159,7 @@ private Vec3d findNearestBlock(double x, int y, double z) { for (int ix = 0; ix < rad; ix++) { for (int iy = 0; iy < rad; iy++) { BlockState block = mc.world.getBlockState(blockPos.set(x - ((rad - 1) / 2 - ix), y, x - ((rad - 1) / 2 - iy))); - if (!block.isAir() &&!(block.getBlock() instanceof FluidBlock)) { + if (!block.isAir() && !(block.getBlock() instanceof FluidBlock)) { validBlocks.add(blockPos.mutableCopy()); } } @@ -180,4 +175,4 @@ private Vec3d findNearestBlock(double x, int y, double z) { return Vec3d.ofBottomCenter(firstEntry.getValue()); } -} \ No newline at end of file +} diff --git a/src/main/java/anticope/tanuki/modules/Confetti.java b/src/main/java/anticope/tanuki/modules/Confetti.java index 060fa66e..c6fecd9b 100644 --- a/src/main/java/anticope/tanuki/modules/Confetti.java +++ b/src/main/java/anticope/tanuki/modules/Confetti.java @@ -1,28 +1,28 @@ package anticope.tanuki.modules; -import meteordevelopment.meteorclient.systems.modules.Module; +import anticope.tanuki.Tanuki; import meteordevelopment.meteorclient.settings.ColorSetting; import meteordevelopment.meteorclient.settings.Setting; import meteordevelopment.meteorclient.settings.SettingGroup; +import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.meteorclient.utils.render.color.SettingColor; import net.minecraft.util.math.Vec3d; -import anticope.tanuki.Tanuki; public class Confetti extends Module { private final SettingGroup sgGeneral = settings.getDefaultGroup(); private final Setting colorOne = sgGeneral.add(new ColorSetting.Builder() - .name("color-one") - .description("The first confetti color to change.") - .defaultValue(new SettingColor(102, 0, 0, 255)) - .build() + .name("color-one") + .description("The first confetti color to change.") + .defaultValue(new SettingColor(102, 0, 0, 255)) + .build() ); private final Setting colorTwo = sgGeneral.add(new ColorSetting.Builder() - .name("color-two") - .description("The second confetti color to change.") - .defaultValue(new SettingColor(102, 0, 0, 255)) - .build() + .name("color-two") + .description("The second confetti color to change.") + .defaultValue(new SettingColor(102, 0, 0, 255)) + .build() ); public Confetti() { diff --git a/src/main/java/anticope/tanuki/modules/FuckedDetector.java b/src/main/java/anticope/tanuki/modules/FuckedDetector.java index b0b35af9..fa50085c 100644 --- a/src/main/java/anticope/tanuki/modules/FuckedDetector.java +++ b/src/main/java/anticope/tanuki/modules/FuckedDetector.java @@ -1,52 +1,51 @@ package anticope.tanuki.modules; -import meteordevelopment.orbit.EventHandler; +import anticope.tanuki.Tanuki; +import anticope.tanuki.mixin.meteor.CrystalAuraAccessor; import meteordevelopment.meteorclient.events.render.Render3DEvent; import meteordevelopment.meteorclient.events.world.TickEvent; +import meteordevelopment.meteorclient.renderer.ShapeMode; +import meteordevelopment.meteorclient.settings.*; import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.meteorclient.systems.modules.Modules; import meteordevelopment.meteorclient.systems.modules.combat.CrystalAura; -import meteordevelopment.meteorclient.renderer.ShapeMode; -import meteordevelopment.meteorclient.settings.*; import meteordevelopment.meteorclient.utils.render.color.SettingColor; +import meteordevelopment.orbit.EventHandler; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.BlockPos; -import anticope.tanuki.Tanuki; -import anticope.tanuki.mixin.meteor.CrystalAuraAccessor; - public class FuckedDetector extends Module { private final SettingGroup sgGeneral = settings.getDefaultGroup(); private final Setting shapeMode = sgGeneral.add(new EnumSetting.Builder() - .name("shape-mode") - .description("How the shapes are rendered.") - .defaultValue(ShapeMode.Lines) - .build() + .name("shape-mode") + .description("How the shapes are rendered.") + .defaultValue(ShapeMode.Lines) + .build() ); private final Setting sideColor = sgGeneral.add(new ColorSetting.Builder() - .name("side-color") - .description("The side color.") - .defaultValue(new SettingColor(255, 255, 255, 75)) - .build() + .name("side-color") + .description("The side color.") + .defaultValue(new SettingColor(255, 255, 255, 75)) + .build() ); private final Setting lineColor = sgGeneral.add(new ColorSetting.Builder() - .name("line-color") - .description("The line color.") - .defaultValue(new SettingColor(255, 255, 255, 255)) - .build() + .name("line-color") + .description("The line color.") + .defaultValue(new SettingColor(255, 255, 255, 255)) + .build() ); private final Setting damageThreshold = sgGeneral.add(new DoubleSetting.Builder() - .name("damage-threshold") - .description("The threshold for CA damage before FuckedDetector begins rendering.") - .defaultValue(6.0) - .min(0) - .sliderMax(40) - .build() + .name("damage-threshold") + .description("The threshold for CA damage before FuckedDetector begins rendering.") + .defaultValue(6.0) + .min(0) + .sliderMax(40) + .build() ); public FuckedDetector() { @@ -65,10 +64,10 @@ public void onActivate() { @EventHandler public void onTick(TickEvent.Post event) { CrystalAura caura = Modules.get().get(CrystalAura.class); - CrystalAuraAccessor cauraAccessor = (CrystalAuraAccessor)caura; - if(caura.isActive()) { + CrystalAuraAccessor cauraAccessor = (CrystalAuraAccessor) caura; + if (caura.isActive()) { target = cauraAccessor.bestTarget(); - if(target != null) { + if (target != null) { isTargetFucked = !isSurrounded(target) && !isBurrowed(target) && cauraAccessor.bestTargetDamage() >= damageThreshold.get(); } } @@ -76,18 +75,18 @@ public void onTick(TickEvent.Post event) { @EventHandler public void onRender3D(Render3DEvent event) { - if(isTargetFucked) { + if (isTargetFucked) { BlockPos tbp = target.getBlockPos(); event.renderer.box(tbp, sideColor.get(), lineColor.get(), shapeMode.get(), 0); } } - private boolean isSurrounded(LivingEntity target){ + private boolean isSurrounded(LivingEntity target) { assert mc.world != null; return !mc.world.getBlockState(target.getBlockPos().add(1, 0, 0)).isAir() - && !mc.world.getBlockState(target.getBlockPos().add(-1, 0, 0)).isAir() - && !mc.world.getBlockState(target.getBlockPos().add(0, 0, 1)).isAir() && - !mc.world.getBlockState(target.getBlockPos().add(0, 0, -1)).isAir(); + && !mc.world.getBlockState(target.getBlockPos().add(-1, 0, 0)).isAir() + && !mc.world.getBlockState(target.getBlockPos().add(0, 0, 1)).isAir() && + !mc.world.getBlockState(target.getBlockPos().add(0, 0, -1)).isAir(); } private boolean isBurrowed(LivingEntity target) { diff --git a/src/main/java/anticope/tanuki/modules/PauseOnUnloaded.java b/src/main/java/anticope/tanuki/modules/PauseOnUnloaded.java index 30eaebf5..e6a9ffed 100644 --- a/src/main/java/anticope/tanuki/modules/PauseOnUnloaded.java +++ b/src/main/java/anticope/tanuki/modules/PauseOnUnloaded.java @@ -2,26 +2,26 @@ import anticope.tanuki.Tanuki; import baritone.api.BaritoneAPI; -import meteordevelopment.orbit.EventHandler; import meteordevelopment.meteorclient.events.world.TickEvent; -import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.meteorclient.settings.DoubleSetting; import meteordevelopment.meteorclient.settings.Setting; import meteordevelopment.meteorclient.settings.SettingGroup; +import meteordevelopment.meteorclient.systems.modules.Module; +import meteordevelopment.orbit.EventHandler; public class PauseOnUnloaded extends Module { private final SettingGroup sgGeneral = settings.getDefaultGroup(); private final Setting readahead = sgGeneral.add(new DoubleSetting.Builder() - .name("Readahead") - .description("How far the module should 'look ahead' for unloaded chunks.") - .min(1) - .max(40) - .sliderMin(1) - .sliderMax(40) - .defaultValue(12) - .build() + .name("Readahead") + .description("How far the module should 'look ahead' for unloaded chunks.") + .min(1) + .max(40) + .sliderMin(1) + .sliderMax(40) + .defaultValue(12) + .build() ); public PauseOnUnloaded() { @@ -49,7 +49,7 @@ private void onTick(TickEvent.Pre event) { paused = true; pausedChunkX = chunkX; pausedChunkZ = chunkZ; - } else if(paused && mc.world.getChunkManager().isChunkLoaded(pausedChunkX, pausedChunkZ)) { + } else if (paused && mc.world.getChunkManager().isChunkLoaded(pausedChunkX, pausedChunkZ)) { BaritoneAPI.getProvider().getPrimaryBaritone().getCommandManager().execute("resume"); info("Chunk was loaded, resuming Baritone."); paused = false; diff --git a/src/main/java/anticope/tanuki/modules/TanukiPacketFly.java b/src/main/java/anticope/tanuki/modules/TanukiPacketFly.java index bd9f0a70..72be92a3 100644 --- a/src/main/java/anticope/tanuki/modules/TanukiPacketFly.java +++ b/src/main/java/anticope/tanuki/modules/TanukiPacketFly.java @@ -105,7 +105,7 @@ private void onPreTick(TickEvent.Pre event) { } lastYaw = currentYaw; - if(tpConfirms >= tpConfirmCounter.get()) { + if (tpConfirms >= tpConfirmCounter.get()) { tpConfirms = 0; } } @@ -113,14 +113,12 @@ private void onPreTick(TickEvent.Pre event) { @EventHandler private void onPostTick(TickEvent.Post event) { if (mc.player == null || mc.getNetworkHandler() == null) return; - if (antiKickMode.get() == AntiKickMode.Normal && delayLeft > 0) delayLeft --; + if (antiKickMode.get() == AntiKickMode.Normal && delayLeft > 0) delayLeft--; else if (antiKickMode.get() == AntiKickMode.Normal && delayLeft <= 0 && offLeft > 0) { - offLeft --; + offLeft--; return; - } - - else if (antiKickMode.get() == AntiKickMode.Normal && delayLeft <=0 && offLeft <= 0) { + } else if (antiKickMode.get() == AntiKickMode.Normal && delayLeft <= 0 && offLeft <= 0) { delayLeft = delay.get(); offLeft = offTime.get(); }