diff --git a/src/main/java/net/aoba/AobaClient.java b/src/main/java/net/aoba/AobaClient.java index 33043108..a317a173 100644 --- a/src/main/java/net/aoba/AobaClient.java +++ b/src/main/java/net/aoba/AobaClient.java @@ -49,7 +49,7 @@ public class AobaClient { public static final String NAME = "Aoba"; public static final String VERSION = "1.21.3"; - public static final String AOBA_VERSION = "1.4.3"; + public static final String AOBA_VERSION = "1.4.4"; public static MinecraftClient MC; public static IMinecraftClient IMC; diff --git a/src/main/java/net/aoba/gui/components/BlocksComponent.java b/src/main/java/net/aoba/gui/components/BlocksComponent.java index 328d023c..3aee3835 100644 --- a/src/main/java/net/aoba/gui/components/BlocksComponent.java +++ b/src/main/java/net/aoba/gui/components/BlocksComponent.java @@ -92,7 +92,7 @@ public void draw(DrawContext drawContext, float partialTicks) { float actualY = this.getActualSize().getY(); float actualWidth = this.getActualSize().getWidth(); - Render2D.drawString(drawContext, text, actualX + 6, actualY + 6, 0xFFFFFF); + Render2D.drawString(drawContext, text, actualX, actualY + 6, 0xFFFFFF); Render2D.drawString(drawContext, collapsed ? ">>" : "<<", (actualX + actualWidth - 24), actualY + 6, GuiManager.foregroundColor.getValue().getColorAsInt()); diff --git a/src/main/java/net/aoba/gui/navigation/windows/MacroWindow.java b/src/main/java/net/aoba/gui/navigation/windows/MacroWindow.java index bb6f9422..d7249b81 100644 --- a/src/main/java/net/aoba/gui/navigation/windows/MacroWindow.java +++ b/src/main/java/net/aoba/gui/navigation/windows/MacroWindow.java @@ -1,10 +1,7 @@ package net.aoba.gui.navigation.windows; -import java.util.function.Function; - import net.aoba.Aoba; import net.aoba.AobaClient; -import net.aoba.gui.UIElement; import net.aoba.gui.components.ButtonComponent; import net.aoba.gui.components.ItemsComponent; import net.aoba.gui.components.SeparatorComponent; @@ -76,32 +73,30 @@ public void run() { replayButton.addChild(replayButtonText); stackPanel.addChild(replayButton); - stackPanel.addChild(new StringComponent("Filename:")); - - filenameText = new TextBoxComponent(); - stackPanel.addChild(filenameText); - - saveButton = new ButtonComponent(new Runnable() { - @Override - public void run() { - AobaClient aoba = Aoba.getInstance(); - Macro currentMacro = aoba.macroManager.getCurrentlySelected(); - currentMacro.setName(filenameText.getText()); - aoba.macroManager.addMacro(currentMacro); - - // Reload the items control. - macrosList.setItemsSource(aoba.macroManager.getMacros()); - } - }); - - saveButton.addChild(new StringComponent("Save")); - - stackPanel.addChild(saveButton); - - // Add Macros ItemComponents - Function test = s -> new StringComponent(s.getName()); - macrosList = new ItemsComponent(Aoba.getInstance().macroManager.getMacros(), test); - stackPanel.addChild(macrosList); + /** + * stackPanel.addChild(new StringComponent("Filename:")); + * + * filenameText = new TextBoxComponent(); stackPanel.addChild(filenameText); + * + * saveButton = new ButtonComponent(new Runnable() { + * + * @Override public void run() { AobaClient aoba = Aoba.getInstance(); Macro + * currentMacro = aoba.macroManager.getCurrentlySelected(); + * currentMacro.setName(filenameText.getText()); + * aoba.macroManager.addMacro(currentMacro); + * + * // Reload the items control. + * macrosList.setItemsSource(aoba.macroManager.getMacros()); } }); + * + * saveButton.addChild(new StringComponent("Save")); + * + * stackPanel.addChild(saveButton); + * + * // Add Macros ItemComponents Function test = s -> + * new StringComponent(s.getName()); macrosList = new + * ItemsComponent(Aoba.getInstance().macroManager.getMacros(), + * test); stackPanel.addChild(macrosList); + */ // Add stackpanel to child. addChild(stackPanel); diff --git a/src/main/java/net/aoba/macros/MacroManager.java b/src/main/java/net/aoba/macros/MacroManager.java index eac8bd3f..90fe2794 100644 --- a/src/main/java/net/aoba/macros/MacroManager.java +++ b/src/main/java/net/aoba/macros/MacroManager.java @@ -1,13 +1,9 @@ package net.aoba.macros; -import java.io.File; -import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import com.mojang.logging.LogUtils; - import net.minecraft.client.MinecraftClient; public class MacroManager { @@ -26,40 +22,35 @@ public MacroManager() { } private void load() { - File macroDirectory = new File(MC.runDirectory + File.separator + "aoba" + File.separator + "macros"); - - if (macroDirectory.exists() && macroDirectory.isDirectory()) { - LogUtils.getLogger().info("Found Macro Directory: " + macroDirectory.getAbsolutePath()); - File[] files = macroDirectory.listFiles((dir, name) -> name.endsWith(".macro")); - - if (files != null) { - for (File file : files) { - try { - Macro macro = new Macro(file); - macros.put(macro.getName(), macro); - } catch (Exception e) { - - } - } - } - } + /* + * File macroDirectory = new File(MC.runDirectory + File.separator + "aoba" + + * File.separator + "macros"); + * + * if (macroDirectory.exists() && macroDirectory.isDirectory()) { + * LogUtils.getLogger().info("Found Macro Directory: " + + * macroDirectory.getAbsolutePath()); File[] files = + * macroDirectory.listFiles((dir, name) -> name.endsWith(".macro")); + * + * if (files != null) { for (File file : files) { try { Macro macro = new + * Macro(file); macros.put(macro.getName(), macro); } catch (Exception e) { + * + * } } } } + */ } public void save() { - try { - File macrosFolder = new File( - MinecraftClient.getInstance().runDirectory + File.separator + "aoba" + File.separator + "macros"); - if (!macrosFolder.exists() && !macrosFolder.mkdirs()) { - throw new IOException("Failed to create macro folder: " + macrosFolder.getAbsolutePath()); - } - - for (Macro macro : macros.values()) { - macro.save(); - } - } catch (Exception e) { - - } - + /* + * try { File macrosFolder = new File( + * MinecraftClient.getInstance().runDirectory + File.separator + "aoba" + + * File.separator + "macros"); if (!macrosFolder.exists() && + * !macrosFolder.mkdirs()) { throw new + * IOException("Failed to create macro folder: " + + * macrosFolder.getAbsolutePath()); } + * + * for (Macro macro : macros.values()) { macro.save(); } } catch (Exception e) { + * + * } + */ } public void addMacro(Macro macro) { diff --git a/src/main/java/net/aoba/mixin/BackgroundRendererMixin.java b/src/main/java/net/aoba/mixin/BackgroundRendererMixin.java index 413c32c6..62ea8f00 100644 --- a/src/main/java/net/aoba/mixin/BackgroundRendererMixin.java +++ b/src/main/java/net/aoba/mixin/BackgroundRendererMixin.java @@ -23,6 +23,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import net.aoba.Aoba; import net.minecraft.client.render.BackgroundRenderer; import net.minecraft.entity.Entity; @@ -31,8 +32,8 @@ public class BackgroundRendererMixin { @Inject(at = { @At("HEAD") }, method = { "getFogModifier(Lnet/minecraft/entity/Entity;F)Lnet/minecraft/client/render/BackgroundRenderer$StatusEffectFogModifier;" }, cancellable = true) private static void onGetFogModifier(Entity entity, float tickDelta, CallbackInfoReturnable cir) { - // TODO: NoRender - // if (Aoba.getInstance().moduleManager.nooverlay.getState()) - // cir.setReturnValue(null); + if (Aoba.getInstance().moduleManager.norender.state.getValue()) { + cir.setReturnValue(null); + } } } diff --git a/src/main/java/net/aoba/mixin/ClientPlayerInteractionManagerMixin.java b/src/main/java/net/aoba/mixin/ClientPlayerInteractionManagerMixin.java index 285d66eb..29dc118e 100644 --- a/src/main/java/net/aoba/mixin/ClientPlayerInteractionManagerMixin.java +++ b/src/main/java/net/aoba/mixin/ClientPlayerInteractionManagerMixin.java @@ -18,31 +18,19 @@ package net.aoba.mixin; -import net.aoba.interfaces.IClientPlayerInteractionManager; -import net.minecraft.client.network.ClientPlayerInteractionManager; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; +import net.aoba.interfaces.IClientPlayerInteractionManager; +import net.minecraft.client.network.ClientPlayerInteractionManager; + @Mixin(ClientPlayerInteractionManager.class) public abstract class ClientPlayerInteractionManagerMixin implements IClientPlayerInteractionManager { - @Shadow - protected abstract void syncSelectedSlot(); - - @Override - public void aoba$syncSelected() { - syncSelectedSlot(); - } + @Shadow + protected abstract void syncSelectedSlot(); - // TODO Reach? - /* - * @Inject(at = { @At("HEAD") }, method = { "getReachDistance()F" }, cancellable - * = true) private void onGetReachDistance(CallbackInfoReturnable ci) { - * Reach reachHack = (Reach) Aoba.getInstance().moduleManager.reach; if - * (reachHack.getState()) { ci.setReturnValue(reachHack.getReach()); } } - * - * @Inject(at = { @At("HEAD") }, method = { "hasExtendedReach()Z" }, cancellable - * = true) private void hasExtendedReach(CallbackInfoReturnable cir) { - * Reach reachHack = (Reach) Aoba.getInstance().moduleManager.reach; if - * (reachHack.getState()) cir.setReturnValue(true); } - */ + @Override + public void aoba$syncSelected() { + syncSelectedSlot(); + } } diff --git a/src/main/java/net/aoba/mixin/GameRendererMixin.java b/src/main/java/net/aoba/mixin/GameRendererMixin.java index 4cac6310..afa27fd6 100644 --- a/src/main/java/net/aoba/mixin/GameRendererMixin.java +++ b/src/main/java/net/aoba/mixin/GameRendererMixin.java @@ -46,19 +46,17 @@ public abstract class GameRendererMixin { @Inject(at = { @At("HEAD") }, method = { "bobView(Lnet/minecraft/client/util/math/MatrixStack;F)V" }, cancellable = true) private void onBobViewWhenHurt(MatrixStack matrixStack, float f, CallbackInfo ci) { - // TODO: NoRender - // if (Aoba.getInstance().moduleManager.nooverlay.getState()) { - // ci.cancel(); - // } + if (Aoba.getInstance().moduleManager.norender.state.getValue()) { + ci.cancel(); + } } @Redirect(at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;lerp(FFF)F", ordinal = 0), method = { "renderWorld(Lnet/minecraft/client/render/RenderTickCounter;)V" }) private float nauseaLerp(float delta, float first, float second) { - // TODO: NoRender - // if (Aoba.getInstance().moduleManager.nooverlay.getState()) - // return 0; - + if (Aoba.getInstance().moduleManager.norender.state.getValue()) { + return 0; + } return MathHelper.lerp(delta, first, second); } diff --git a/src/main/java/net/aoba/mixin/LightmapTextureManagerMixin.java b/src/main/java/net/aoba/mixin/LightmapTextureManagerMixin.java index df10f2c2..5ee80997 100644 --- a/src/main/java/net/aoba/mixin/LightmapTextureManagerMixin.java +++ b/src/main/java/net/aoba/mixin/LightmapTextureManagerMixin.java @@ -23,14 +23,15 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import net.aoba.Aoba; import net.minecraft.client.render.LightmapTextureManager; @Mixin(LightmapTextureManager.class) public class LightmapTextureManagerMixin { @Inject(at = { @At("HEAD") }, method = { "getDarknessFactor(F)F" }, cancellable = true) private void onGetDarknessFactor(float delta, CallbackInfoReturnable cir) { - // TODO: NoRender - // if (Aoba.getInstance().moduleManager.nooverlay.getState()) - // cir.setReturnValue(0F); + if (Aoba.getInstance().moduleManager.norender.state.getValue()) { + cir.setReturnValue(0F); + } } } diff --git a/src/main/java/net/aoba/mixin/PlayerEntityMixin.java b/src/main/java/net/aoba/mixin/PlayerEntityMixin.java index 9a131323..e6c81cf1 100644 --- a/src/main/java/net/aoba/mixin/PlayerEntityMixin.java +++ b/src/main/java/net/aoba/mixin/PlayerEntityMixin.java @@ -26,6 +26,7 @@ import net.aoba.Aoba; import net.aoba.AobaClient; +import net.aoba.module.modules.combat.Reach; import net.aoba.module.modules.misc.FastBreak; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; @@ -66,4 +67,20 @@ public void onGetBlockBreakingSpeed(BlockState blockState, CallbackInfoReturnabl protected void onGetOffGroundSpeed(CallbackInfoReturnable cir) { return; } + + @Inject(at = { @At("HEAD") }, method = "getBlockInteractionRange()D", cancellable = true) + private void onBlockInteractionRange(CallbackInfoReturnable cir) { + if (Aoba.getInstance().moduleManager.reach.state.getValue()) { + Reach reach = (Reach) Aoba.getInstance().moduleManager.reach; + cir.setReturnValue((double) reach.getReach()); + } + } + + @Inject(at = { @At("HEAD") }, method = "getEntityInteractionRange()D", cancellable = true) + private void onEntityInteractionRange(CallbackInfoReturnable cir) { + if (Aoba.getInstance().moduleManager.reach.state.getValue()) { + Reach reach = (Reach) Aoba.getInstance().moduleManager.reach; + cir.setReturnValue((double) reach.getReach()); + } + } } diff --git a/src/main/java/net/aoba/mixin/WorldRendererMixin.java b/src/main/java/net/aoba/mixin/WorldRendererMixin.java index 08365fd3..186a8dd6 100644 --- a/src/main/java/net/aoba/mixin/WorldRendererMixin.java +++ b/src/main/java/net/aoba/mixin/WorldRendererMixin.java @@ -76,9 +76,9 @@ public void render(ObjectAllocator allocator, RenderTickCounter tickCounter, boo @Inject(at = @At("HEAD"), method = "hasBlindnessOrDarkness(Lnet/minecraft/client/render/Camera;)Z", cancellable = true) private void onHasBlindnessOrDarknessEffect(Camera camera, CallbackInfoReturnable cir) { - // TODO: NoRender - // if (Aoba.getInstance().moduleManager.nooverlay.getState()) - // cir.setReturnValue(false); + if (Aoba.getInstance().moduleManager.norender.state.getValue()) { + cir.setReturnValue(false); + } } @Inject(at = @At("HEAD"), method = "drawBlockOutline(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;Lnet/minecraft/entity/Entity;DDDLnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;I)V", cancellable = true) diff --git a/src/main/java/net/aoba/mixin/interfaces/ILlamaEntityModel.java b/src/main/java/net/aoba/mixin/interfaces/ILlamaEntityModel.java deleted file mode 100644 index eb3213f3..00000000 --- a/src/main/java/net/aoba/mixin/interfaces/ILlamaEntityModel.java +++ /dev/null @@ -1,31 +0,0 @@ -package net.aoba.mixin.interfaces; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Accessor; - -import net.minecraft.client.model.ModelPart; -import net.minecraft.client.render.entity.model.LlamaEntityModel; - -@Mixin(LlamaEntityModel.class) -public interface ILlamaEntityModel { - @Accessor("head") - ModelPart getHead(); - - @Accessor("rightHindLeg") - ModelPart getRightHindLeg(); - - @Accessor("leftHindLeg") - ModelPart getLeftHindLeg(); - - @Accessor("rightFrontLeg") - ModelPart getRightFrontLeg(); - - @Accessor("leftFrontLeg") - ModelPart getLeftFrontLeg(); - - @Accessor("rightChest") - ModelPart getRightChest(); - - @Accessor("leftChest") - ModelPart getLeftChest(); -} diff --git a/src/main/java/net/aoba/mixin/interfaces/IRabbitEntityModel.java b/src/main/java/net/aoba/mixin/interfaces/IRabbitEntityModel.java deleted file mode 100644 index 7343dc2c..00000000 --- a/src/main/java/net/aoba/mixin/interfaces/IRabbitEntityModel.java +++ /dev/null @@ -1,40 +0,0 @@ -package net.aoba.mixin.interfaces; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Accessor; - -import net.minecraft.client.model.ModelPart; -import net.minecraft.client.render.entity.model.RabbitEntityModel; - -@Mixin(RabbitEntityModel.class) -public interface IRabbitEntityModel { - @Accessor("leftHindLeg") - ModelPart getLeftHindLeg(); - - @Accessor("rightHindLeg") - ModelPart getRightHindLeg(); - - @Accessor("leftHaunch") - ModelPart getLeftHaunch(); - - @Accessor("rightHaunch") - ModelPart getRightHaunch(); - - @Accessor("leftFrontLeg") - ModelPart getLeftFrontLeg(); - - @Accessor("rightFrontLeg") - ModelPart getRightFrontLeg(); - - @Accessor("head") - ModelPart getHead(); - - @Accessor("rightEar") - ModelPart getRightEar(); - - @Accessor("leftEar") - ModelPart getLeftEar(); - - @Accessor("nose") - ModelPart getNose(); -} diff --git a/src/main/java/net/aoba/module/modules/combat/Reach.java b/src/main/java/net/aoba/module/modules/combat/Reach.java index 56204930..a4fe20ca 100644 --- a/src/main/java/net/aoba/module/modules/combat/Reach.java +++ b/src/main/java/net/aoba/module/modules/combat/Reach.java @@ -27,46 +27,40 @@ public class Reach extends Module { - private FloatSetting distance; + private FloatSetting distance; - public Reach() { - super("Reach"); + public Reach() { + super("Reach"); - this.setCategory(Category.of("Combat")); - this.setDescription("Allows you to reach further."); + this.setCategory(Category.of("Combat")); + this.setDescription("Allows you to reach further."); - distance = FloatSetting.builder() - .id("reach_distance") - .displayName("Distance") - .description("Distance, in blocks, that you can reach.") - .defaultValue(5f) - .minValue(1f) - .maxValue(15f) - .step(1f) - .build(); - this.addSetting(distance); - } + distance = FloatSetting.builder().id("reach_distance").displayName("Distance") + .description("Distance, in blocks, that you can reach.").defaultValue(5f).minValue(1f).maxValue(128f) + .step(1f).build(); + this.addSetting(distance); + } - public float getReach() { - return distance.getValue().floatValue(); - } + public float getReach() { + return distance.getValue().floatValue(); + } - @Override - public void onDisable() { + @Override + public void onDisable() { - } + } - @Override - public void onEnable() { + @Override + public void onEnable() { - } + } - @Override - public void onToggle() { + @Override + public void onToggle() { - } + } - public void setReachLength(float reach) { - this.distance.setValue(reach); - } + public void setReachLength(float reach) { + this.distance.setValue(reach); + } } \ No newline at end of file diff --git a/src/main/java/net/aoba/module/modules/misc/FakePlayer.java b/src/main/java/net/aoba/module/modules/misc/FakePlayer.java index 3677dfdf..d4475cf3 100644 --- a/src/main/java/net/aoba/module/modules/misc/FakePlayer.java +++ b/src/main/java/net/aoba/module/modules/misc/FakePlayer.java @@ -75,9 +75,6 @@ public FakePlayer() { public void onDisable() { if (fakePlayer == null) return; - - // TODO: 1.21.3 changed this - // fakePlayer.kill(fakePlayer.getWorld()); fakePlayer.setRemoved(Entity.RemovalReason.KILLED); fakePlayer.onRemoved(); fakePlayer = null; diff --git a/src/main/java/net/aoba/module/modules/render/ChestESP.java b/src/main/java/net/aoba/module/modules/render/ChestESP.java index f8ce4309..b557fbe7 100644 --- a/src/main/java/net/aoba/module/modules/render/ChestESP.java +++ b/src/main/java/net/aoba/module/modules/render/ChestESP.java @@ -43,7 +43,7 @@ public class ChestESP extends Module implements Render3DListener { private ColorSetting color = ColorSetting.builder().id("chestesp_color").displayName("Color").description("Color") - .defaultValue(new Color(0, 1f, 1f)).build(); + .defaultValue(new Color(0, 1f, 1f, 0.3f)).build(); public FloatSetting lineThickness = FloatSetting.builder().id("chestesp_linethickness") .displayName("Line Thickness").description("Adjust the thickness of the ESP box lines").defaultValue(2f) diff --git a/src/main/java/net/aoba/module/modules/render/EntityESP.java b/src/main/java/net/aoba/module/modules/render/EntityESP.java index b08d3cc6..f697f5c1 100644 --- a/src/main/java/net/aoba/module/modules/render/EntityESP.java +++ b/src/main/java/net/aoba/module/modules/render/EntityESP.java @@ -53,13 +53,14 @@ public enum DrawMode { .displayName("Draw Mode").description("Draw Mode").defaultValue(DrawMode.Model).build(); private ColorSetting color_passive = ColorSetting.builder().id("entityesp_color_passive") - .displayName("Passive Color").description("Passive Color").defaultValue(new Color(0, 1f, 1f)).build(); + .displayName("Passive Color").description("Passive Color").defaultValue(new Color(0f, 1f, 0f, 0.3f)) + .build(); private ColorSetting color_enemies = ColorSetting.builder().id("entityesp_color_enemy").displayName("Enemy Color") - .description("Enemy Color").defaultValue(new Color(0, 1f, 1f)).build(); + .description("Enemy Color").defaultValue(new Color(1, 0f, 0f, 0.3f)).build(); private ColorSetting color_misc = ColorSetting.builder().id("entityesp_color_misc").displayName("Misc. Color") - .description("Misc. Color").defaultValue(new Color(0, 1f, 1f)).build(); + .description("Misc. Color").defaultValue(new Color(0, 0f, 1f, 0.3f)).build(); private BooleanSetting showPassiveEntities = BooleanSetting.builder().id("entityesp_show_passive") .displayName("Show Passive Entities").description("Show Passive Entities.").defaultValue(true).build(); diff --git a/src/main/java/net/aoba/module/modules/render/ItemESP.java b/src/main/java/net/aoba/module/modules/render/ItemESP.java index 4043a4a4..c8f5d3d4 100644 --- a/src/main/java/net/aoba/module/modules/render/ItemESP.java +++ b/src/main/java/net/aoba/module/modules/render/ItemESP.java @@ -39,7 +39,7 @@ public class ItemESP extends Module implements Render3DListener { private ColorSetting color = ColorSetting.builder().id("itemesp_color").displayName("Color").description("Color") - .defaultValue(new Color(0, 1f, 1f)).build(); + .defaultValue(new Color(0, 1f, 1f, 0.3f)).build(); private BooleanSetting visibilityToggle = BooleanSetting.builder().id("itemesp_visibility") .displayName("Visibility").defaultValue(true).build(); diff --git a/src/main/java/net/aoba/module/modules/render/SpawnerESP.java b/src/main/java/net/aoba/module/modules/render/SpawnerESP.java index 03f35c30..3fbd5386 100644 --- a/src/main/java/net/aoba/module/modules/render/SpawnerESP.java +++ b/src/main/java/net/aoba/module/modules/render/SpawnerESP.java @@ -41,7 +41,7 @@ public class SpawnerESP extends Module implements Render3DListener { private ColorSetting color = ColorSetting.builder().id("spawneresp_color").displayName("Color").description("Color") - .defaultValue(new Color(0f, 1f, 1f)).build(); + .defaultValue(new Color(0f, 1f, 1f, 0.3f)).build(); private FloatSetting lineThickness = FloatSetting.builder().id("spawneresp_linethickness") .displayName("Line Thickness").description("Adjust the thickness of the ESP box lines").defaultValue(2f) diff --git a/src/main/java/net/aoba/module/modules/world/Surround.java b/src/main/java/net/aoba/module/modules/world/Surround.java index e97b4094..f9c54d8e 100644 --- a/src/main/java/net/aoba/module/modules/world/Surround.java +++ b/src/main/java/net/aoba/module/modules/world/Surround.java @@ -18,7 +18,7 @@ package net.aoba.module.modules.world; -import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import com.google.common.collect.Lists; @@ -29,6 +29,7 @@ import net.aoba.event.listeners.TickListener; import net.aoba.module.Category; import net.aoba.module.Module; +import net.aoba.settings.types.BlocksSetting; import net.aoba.settings.types.BooleanSetting; import net.aoba.settings.types.FloatSetting; import net.minecraft.block.Block; @@ -44,15 +45,17 @@ import net.minecraft.util.math.Vec3d; public class Surround extends Module implements TickListener { - - public static final ArrayList blocks = Lists.newArrayList(Blocks.OBSIDIAN, Blocks.ENDER_CHEST, - Blocks.ENCHANTING_TABLE, Blocks.ANVIL, Blocks.CHIPPED_ANVIL, Blocks.DAMAGED_ANVIL, Blocks.CRYING_OBSIDIAN, - Blocks.NETHERITE_BLOCK, Blocks.ANCIENT_DEBRIS, Blocks.RESPAWN_ANCHOR); - public FloatSetting placeHeight = FloatSetting.builder().id("surround_height").displayName("Height") .description("Height that surround walls will go.").defaultValue(1f).minValue(1f).maxValue(3f).step(1.0f) .build(); + public BlocksSetting blocks = BlocksSetting.builder().id("surround_blocks").displayName("Blocks") + .description("Blocks that will be used to place surrounding blocks.") + .defaultValue(new HashSet(Lists.newArrayList(Blocks.OBSIDIAN, Blocks.ENDER_CHEST, + Blocks.ENCHANTING_TABLE, Blocks.ANVIL, Blocks.CHIPPED_ANVIL, Blocks.DAMAGED_ANVIL, + Blocks.CRYING_OBSIDIAN, Blocks.NETHERITE_BLOCK, Blocks.ANCIENT_DEBRIS, Blocks.RESPAWN_ANCHOR))) + .build(); + public BooleanSetting alignCharacter = BooleanSetting.builder().id("surround_align").displayName("Align") .description("Aligns the character to the nearest block.").defaultValue(false).build(); @@ -73,6 +76,7 @@ public Surround() { this.setDescription("Surrounds the player with blocks."); this.addSetting(placeHeight); + this.addSetting(blocks); this.addSetting(alignCharacter); this.addSetting(autoDisable); this.addSetting(legit); @@ -100,9 +104,10 @@ public void onToggle() { } private int getBlockInventorySlot() { + HashSet availableBlocks = blocks.getValue(); for (int i = 0; i < 36; i++) { ItemStack stack = MC.player.getInventory().getStack(i); - if (stack != null && blocks.contains(Block.getBlockFromItem(stack.getItem()))) { + if (stack != null && availableBlocks.contains(Block.getBlockFromItem(stack.getItem()))) { return i; } } diff --git a/src/main/resources/aoba.mixins.json b/src/main/resources/aoba.mixins.json index 0fb94d29..0beef0e2 100644 --- a/src/main/resources/aoba.mixins.json +++ b/src/main/resources/aoba.mixins.json @@ -13,9 +13,7 @@ "interfaces.IPlayerInteractEntityC2SPacket", "interfaces.IModelPart", "interfaces.ICuboid", - "interfaces.IRabbitEntityModel", "interfaces.IEntityModel", - "interfaces.ILlamaEntityModel", "interfaces.IPlayerMoveC2SPacket", "interfaces.IMouse", ], diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 03e75003..eef92a61 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, "id": "aoba", - "version": "1.4.3", + "version": "1.4.4", "name": "Aoba Hacked Client", "description": "A Minecraft Fabric 1.21.3 utility mod.", "authors": [ @@ -26,8 +26,8 @@ "aoba-sodium.mixins.json" ], "depends": { - "fabricloader": ">=0.16.5", - "minecraft": "~1.21.1", + "fabricloader": ">=0.16.9", + "minecraft": "~1.21.3", "java": ">=21", "fabric-api": "*" }