From 0481536db082c9dfc5355fe61303c6a9caea9237 Mon Sep 17 00:00:00 2001 From: Colton Date: Sat, 27 Apr 2024 17:35:25 -0400 Subject: [PATCH] Update to 1.20.5 and tweaks. - Updated to 1.20.5 (There may still be bugs, but everything seemed smooth) - Optimized Nuker to only scan for the next block when the previous one is broken. - Cleaned up rendering code (more to come) - Replace lots of List with HashSet for performance reasons. --- build.gradle | 41 +- gradle.bat | 92 +++ gradle.properties | 15 +- gradle/wrapper/gradle-wrapper.jar | Bin 61574 -> 43453 bytes gradle/wrapper/gradle-wrapper.properties | 3 +- gradlew | 29 +- gradlew.bat | 20 +- remappedSrc/net/aoba/Aoba.java | 45 ++ remappedSrc/net/aoba/AobaClient.java | 151 +++++ remappedSrc/net/aoba/altmanager/Alt.java | 131 ++++ .../net/aoba/altmanager/AltManager.java | 622 +++++++++++++++++ .../net/aoba/altmanager/XboxLiveToken.java | 56 ++ .../exceptions/APIDownException.java | 23 + .../exceptions/APIErrorException.java | 43 ++ .../exceptions/InvalidResponseException.java | 41 ++ .../exceptions/InvalidTokenException.java | 23 + remappedSrc/net/aoba/cmd/Command.java | 77 +++ .../net/aoba/cmd/CommandException.java | 30 + remappedSrc/net/aoba/cmd/CommandManager.java | 162 +++++ remappedSrc/net/aoba/cmd/GlobalChat.java | 186 ++++++ .../net/aoba/cmd/InvalidSyntaxException.java | 37 ++ .../net/aoba/cmd/commands/CmdAimbot.java | 67 ++ .../net/aoba/cmd/commands/CmdAutoEat.java | 78 +++ .../net/aoba/cmd/commands/CmdChestESP.java | 67 ++ .../net/aoba/cmd/commands/CmdClickgui.java | 56 ++ .../net/aoba/cmd/commands/CmdEntityESP.java | 67 ++ .../net/aoba/cmd/commands/CmdFastBreak.java | 79 +++ remappedSrc/net/aoba/cmd/commands/CmdFly.java | 78 +++ .../net/aoba/cmd/commands/CmdFont.java | 57 ++ .../net/aoba/cmd/commands/CmdFreecam.java | 68 ++ .../net/aoba/cmd/commands/CmdFullbright.java | 68 ++ .../net/aoba/cmd/commands/CmdHelp.java | 96 +++ remappedSrc/net/aoba/cmd/commands/CmdHud.java | 50 ++ .../net/aoba/cmd/commands/CmdItemESP.java | 67 ++ .../net/aoba/cmd/commands/CmdNoFall.java | 67 ++ .../net/aoba/cmd/commands/CmdNoSlowdown.java | 68 ++ .../net/aoba/cmd/commands/CmdNoclip.java | 81 +++ .../net/aoba/cmd/commands/CmdNuker.java | 84 +++ remappedSrc/net/aoba/cmd/commands/CmdPOV.java | 88 +++ .../net/aoba/cmd/commands/CmdPlayerESP.java | 67 ++ .../net/aoba/cmd/commands/CmdReach.java | 79 +++ .../net/aoba/cmd/commands/CmdSpam.java | 55 ++ .../net/aoba/cmd/commands/CmdSprint.java | 68 ++ .../net/aoba/cmd/commands/CmdStep.java | 79 +++ remappedSrc/net/aoba/cmd/commands/CmdTP.java | 42 ++ .../net/aoba/cmd/commands/CmdTileBreaker.java | 84 +++ .../net/aoba/cmd/commands/CmdTimer.java | 82 +++ .../net/aoba/cmd/commands/CmdTracer.java | 67 ++ .../net/aoba/cmd/commands/CmdXRay.java | 122 ++++ remappedSrc/net/aoba/event/EventManager.java | 74 +++ .../net/aoba/event/events/AbstractEvent.java | 42 ++ .../aoba/event/events/BlockStateEvent.java | 46 ++ .../aoba/event/events/FontChangedEvent.java | 22 + .../net/aoba/event/events/FoodLevelEvent.java | 54 ++ .../net/aoba/event/events/KeyDownEvent.java | 75 +++ .../aoba/event/events/LeftMouseDownEvent.java | 58 ++ .../aoba/event/events/LeftMouseUpEvent.java | 58 ++ .../net/aoba/event/events/MouseMoveEvent.java | 57 ++ .../aoba/event/events/MouseScrollEvent.java | 57 ++ .../aoba/event/events/PlayerDeathEvent.java | 43 ++ .../aoba/event/events/PlayerHealthEvent.java | 58 ++ .../aoba/event/events/ReceivePacketEvent.java | 52 ++ .../net/aoba/event/events/RenderEvent.java | 56 ++ .../aoba/event/events/SendPacketEvent.java | 52 ++ .../net/aoba/event/events/TickEvent.java | 40 ++ .../event/listeners/AbstractListener.java | 22 + .../event/listeners/BlockStateListener.java | 9 + .../event/listeners/FontChangedListener.java | 7 + .../event/listeners/FoodLevelListener.java | 25 + .../aoba/event/listeners/KeyDownListener.java | 25 + .../listeners/LeftMouseDownListener.java | 25 + .../event/listeners/LeftMouseUpListener.java | 25 + .../event/listeners/MouseMoveListener.java | 25 + .../event/listeners/MouseScrollListener.java | 25 + .../event/listeners/PlayerDeathListener.java | 25 + .../event/listeners/PlayerHealthListener.java | 25 + .../listeners/ReceivePacketListener.java | 25 + .../aoba/event/listeners/RenderListener.java | 25 + .../event/listeners/SendPacketListener.java | 25 + .../aoba/event/listeners/TickListener.java | 25 + remappedSrc/net/aoba/gui/AbstractGui.java | 220 ++++++ remappedSrc/net/aoba/gui/GuiManager.java | 298 +++++++++ remappedSrc/net/aoba/gui/IGuiElement.java | 35 + remappedSrc/net/aoba/gui/NavigationBar.java | 120 ++++ remappedSrc/net/aoba/gui/Page.java | 69 ++ .../net/aoba/gui/colors}/Color.java | 5 +- .../net/aoba/gui/colors/ColorMode.java | 7 + .../net/aoba/gui/colors}/Colors.java | 4 +- .../net/aoba/gui/colors}/RainbowColor.java | 29 +- .../net/aoba/gui/colors/RandomColor.java | 17 + .../net/aoba/gui/font/FontManager.java | 154 +++++ remappedSrc/net/aoba/gui/hud/AbstractHud.java | 52 ++ remappedSrc/net/aoba/gui/hud/ArmorHud.java | 58 ++ remappedSrc/net/aoba/gui/hud/InfoHud.java | 89 +++ .../net/aoba/gui/hud/ModuleSelectorHud.java | 174 +++++ remappedSrc/net/aoba/gui/hud/RadarHud.java | 114 ++++ .../net/aoba/gui/screens/AddAltScreen.java | 95 +++ .../net/aoba/gui/screens/AltScreen.java | 141 ++++ .../aoba/gui/screens/AltSelectionList.java | 203 ++++++ .../gui/screens/DirectLoginAltScreen.java | 114 ++++ .../net/aoba/gui/screens/EditAltScreen.java | 104 +++ .../aoba/gui/screens/MCLeaksLoginScreen.java | 82 +++ .../net/aoba/gui/tabs/AuthCrackerTab.java | 143 ++++ .../net/aoba/gui/tabs/ClickGuiTab.java | 183 +++++ remappedSrc/net/aoba/gui/tabs/HudsTab.java | 112 ++++ .../net/aoba/gui/tabs/ModuleSettingsTab.java | 171 +++++ remappedSrc/net/aoba/gui/tabs/OptionsTab.java | 83 +++ .../gui/tabs/components/BlocksComponent.java | 156 +++++ .../gui/tabs/components/ButtonComponent.java | 125 ++++ .../tabs/components/CheckboxComponent.java | 94 +++ .../tabs/components/ColorPickerComponent.java | 187 ++++++ .../aoba/gui/tabs/components/Component.java | 458 +++++++++++++ .../gui/tabs/components/HudComponent.java | 75 +++ .../gui/tabs/components/KeybindComponent.java | 90 +++ .../gui/tabs/components/ListComponent.java | 88 +++ .../gui/tabs/components/ModuleComponent.java | 97 +++ .../gui/tabs/components/ScrollComponent.java | 23 + .../gui/tabs/components/SliderComponent.java | 149 +++++ .../tabs/components/StackPanelComponent.java | 72 ++ .../gui/tabs/components/StringComponent.java | 126 ++++ .../net/aoba/interfaces/ISimpleOption.java | 24 + .../net/aoba/misc/FakePlayerEntity.java | 42 ++ remappedSrc/net/aoba/misc/ModuleUtils.java | 92 +++ remappedSrc/net/aoba/misc/RenderUtils.java | 625 ++++++++++++++++++ remappedSrc/net/aoba/misc/TextUtils.java | 35 + .../aoba/mixin/AbstractBlockStateMixin.java | 51 ++ .../AbstractClientPlayerEntityMixin.java | 17 + .../mixin/AbstractSignEditScreenMixin.java | 72 ++ .../aoba/mixin/BackgroundRendererMixin.java | 42 ++ remappedSrc/net/aoba/mixin/BlockMixin.java | 58 ++ .../aoba/mixin/BlockModelRendererMixin.java | 56 ++ .../net/aoba/mixin/CactusBlockMixin.java | 53 ++ remappedSrc/net/aoba/mixin/ChatHudMixin.java | 132 ++++ .../aoba/mixin/ChatInputSuggestorMixin.java | 113 ++++ .../net/aoba/mixin/ChatScreenMixin.java | 122 ++++ .../mixin/ChunkOcclusionDataBuilderMixin.java | 41 ++ .../net/aoba/mixin/ClientConnectionMixin.java | 72 ++ .../aoba/mixin/ClientPlayerEntityMixin.java | 98 +++ .../ClientPlayerInteractionManagerMixin.java | 46 ++ .../net/aoba/mixin/DeathScreenMixin.java | 47 ++ remappedSrc/net/aoba/mixin/EntityMixin.java | 57 ++ .../net/aoba/mixin/EntityRendererMixin.java | 116 ++++ .../net/aoba/mixin/FluidBlockMixin.java | 56 ++ .../net/aoba/mixin/GameRendererMixin.java | 49 ++ .../net/aoba/mixin/HungerManagerMixin.java | 50 ++ .../net/aoba/mixin/IngameHudMixin.java | 36 + remappedSrc/net/aoba/mixin/KeyboardMixin.java | 45 ++ .../mixin/LightmapTextureManagerMixin.java | 36 + .../net/aoba/mixin/LivingEntityMixin.java | 20 + .../net/aoba/mixin/MinecraftClientMixin.java | 114 ++++ remappedSrc/net/aoba/mixin/MouseMixin.java | 92 +++ .../aoba/mixin/MultiplayerScreenMixin.java | 46 ++ .../net/aoba/mixin/PlayerEntityMixin.java | 67 ++ .../aoba/mixin/RenderTickCounterMixin.java | 46 ++ remappedSrc/net/aoba/mixin/ScreenMixin.java | 22 + .../net/aoba/mixin/SimpleOptionMixin.java | 56 ++ .../aoba/mixin/TerrainRenderContextMixin.java | 48 ++ .../net/aoba/mixin/TitleScreenMixin.java | 44 ++ .../net/aoba/mixin/WorldChunkMixin.java | 28 + .../net/aoba/mixin/WorldRendererMixin.java | 48 ++ .../IEntityVelocityUpdateS2CPacket.java | 51 ++ .../mixin/interfaces/IExplosionS2CPacket.java | 49 ++ .../aoba/mixin/interfaces/ILivingEntity.java | 32 + .../mixin/interfaces/IMinecraftClient.java | 43 ++ remappedSrc/net/aoba/module/Module.java | 150 +++++ .../net/aoba/module/ModuleManager.java | 217 ++++++ .../aoba/module/modules/combat/Aimbot.java | 131 ++++ .../aoba/module/modules/combat/AntiInvis.java | 54 ++ .../module/modules/combat/AntiKnockback.java | 86 +++ .../module/modules/combat/AutoRespawn.java | 63 ++ .../aoba/module/modules/combat/AutoSoup.java | 139 ++++ .../aoba/module/modules/combat/AutoTotem.java | 151 +++++ .../aoba/module/modules/combat/Criticals.java | 102 +++ .../module/modules/combat/CrystalAura.java | 119 ++++ .../aoba/module/modules/combat/KillAura.java | 151 +++++ .../aoba/module/modules/combat/Nametags.java | 78 +++ .../aoba/module/modules/combat/NoOverlay.java | 53 ++ .../net/aoba/module/modules/combat/Reach.java | 67 ++ .../module/modules/combat/TriggerBot.java | 98 +++ .../aoba/module/modules/misc/AntiCactus.java | 50 ++ .../net/aoba/module/modules/misc/AutoEat.java | 101 +++ .../aoba/module/modules/misc/AutoFish.java | 80 +++ .../aoba/module/modules/misc/AutoWalk.java | 61 ++ .../aoba/module/modules/misc/FastBreak.java | 68 ++ .../aoba/module/modules/misc/FastPlace.java | 64 ++ .../net/aoba/module/modules/misc/Timer.java | 63 ++ .../net/aoba/module/modules/movement/Fly.java | 103 +++ .../aoba/module/modules/movement/Freecam.java | 119 ++++ .../aoba/module/modules/movement/Glide.java | 65 ++ .../aoba/module/modules/movement/Jesus.java | 73 ++ .../aoba/module/modules/movement/Jetpack.java | 110 +++ .../aoba/module/modules/movement/NoFall.java | 64 ++ .../module/modules/movement/NoJumpDelay.java | 68 ++ .../module/modules/movement/NoSlowdown.java | 61 ++ .../aoba/module/modules/movement/Noclip.java | 88 +++ .../module/modules/movement/Safewalk.java | 103 +++ .../aoba/module/modules/movement/Sneak.java | 71 ++ .../aoba/module/modules/movement/Spider.java | 68 ++ .../aoba/module/modules/movement/Sprint.java | 61 ++ .../aoba/module/modules/movement/Step.java | 66 ++ .../module/modules/render/Breadcrumbs.java | 106 +++ .../aoba/module/modules/render/ChestESP.java | 91 +++ .../aoba/module/modules/render/EntityESP.java | 120 ++++ .../module/modules/render/Fullbright.java | 63 ++ .../aoba/module/modules/render/ItemESP.java | 76 +++ .../net/aoba/module/modules/render/POV.java | 121 ++++ .../aoba/module/modules/render/PlayerESP.java | 77 +++ .../module/modules/render/SpawnerESP.java | 81 +++ .../aoba/module/modules/render/Tracer.java | 104 +++ .../module/modules/render/Trajectory.java | 121 ++++ .../net/aoba/module/modules/render/XRay.java | 93 +++ .../net/aoba/module/modules/render/Zoom.java | 72 ++ .../aoba/module/modules/world/AutoFarm.java | 135 ++++ .../aoba/module/modules/world/AutoSign.java | 62 ++ .../net/aoba/module/modules/world/Nuker.java | 171 +++++ .../aoba/module/modules/world/Surround.java | 172 +++++ .../module/modules/world/TileBreaker.java | 169 +++++ remappedSrc/net/aoba/settings/Setting.java | 133 ++++ .../net/aoba/settings/SettingManager.java | 208 ++++++ .../aoba/settings/types/BlocksSetting.java | 41 ++ .../aoba/settings/types/BooleanSetting.java | 56 ++ .../net/aoba/settings/types/ColorSetting.java | 58 ++ .../net/aoba/settings/types/FloatSetting.java | 71 ++ .../types/IndexedStringListSetting.java | 90 +++ .../aoba/settings/types/IntegerSetting.java | 63 ++ .../aoba/settings/types/KeybindSetting.java | 48 ++ .../settings/types/StringListSetting.java | 98 +++ .../aoba/settings/types/StringSetting.java | 48 ++ .../aoba/settings/types/Vector2Setting.java | 85 +++ remappedSrc/net/aoba/utils/types/Vector2.java | 30 + src/main/java/net/aoba/AobaClient.java | 8 +- .../aoba/event/events/BlockStateEvent.java | 46 ++ .../net/aoba/event/events/RenderEvent.java | 10 +- .../event/listeners/BlockStateListener.java | 9 + .../event/listeners/FontChangedListener.java | 1 - src/main/java/net/aoba/gui/GuiManager.java | 14 +- src/main/java/net/aoba/gui/NavigationBar.java | 13 +- src/main/java/net/aoba/gui/colors/Color.java | 322 +++++++++ .../java/net/aoba/gui/colors/ColorMode.java | 7 + src/main/java/net/aoba/gui/colors/Colors.java | 34 + .../net/aoba/gui/colors/RainbowColor.java | 38 ++ .../java/net/aoba/gui/colors/RandomColor.java | 17 + .../java/net/aoba/gui/font/FontManager.java | 35 +- .../java/net/aoba/gui/hud/AbstractHud.java | 2 +- src/main/java/net/aoba/gui/hud/InfoHud.java | 9 +- .../net/aoba/gui/hud/ModuleSelectorHud.java | 14 +- src/main/java/net/aoba/gui/hud/RadarHud.java | 19 +- .../java/net/aoba/gui/tabs/ClickGuiTab.java | 22 +- src/main/java/net/aoba/gui/tabs/HudsTab.java | 2 +- .../net/aoba/gui/tabs/ModuleSettingsTab.java | 18 +- .../java/net/aoba/gui/tabs/OptionsTab.java | 14 +- .../gui/tabs/components/BlocksComponent.java | 10 +- .../gui/tabs/components/ButtonComponent.java | 7 +- .../tabs/components/CheckboxComponent.java | 10 +- .../tabs/components/ColorPickerComponent.java | 37 +- .../aoba/gui/tabs/components/Component.java | 10 +- .../gui/tabs/components/HudComponent.java | 9 +- .../gui/tabs/components/KeybindComponent.java | 12 +- .../gui/tabs/components/ListComponent.java | 9 +- .../gui/tabs/components/ModuleComponent.java | 11 +- .../gui/tabs/components/SliderComponent.java | 14 +- .../gui/tabs/components/StringComponent.java | 10 +- src/main/java/net/aoba/misc/RenderUtils.java | 328 +++++---- .../aoba/mixin/AbstractBlockStateMixin.java | 13 +- .../java/net/aoba/mixin/ChatHudMixin.java | 4 +- .../java/net/aoba/mixin/ChatScreenMixin.java | 6 +- .../aoba/mixin/ClientPlayerEntityMixin.java | 12 +- .../ClientPlayerInteractionManagerMixin.java | 26 +- src/main/java/net/aoba/mixin/EntityMixin.java | 6 + .../net/aoba/mixin/EntityRendererMixin.java | 9 +- .../net/aoba/mixin/GameRendererMixin.java | 3 +- .../java/net/aoba/mixin/IngameHudMixin.java | 2 +- .../net/aoba/mixin/MinecraftClientMixin.java | 10 +- src/main/java/net/aoba/mixin/MouseMixin.java | 15 +- .../aoba/mixin/RenderTickCounterMixin.java | 10 +- .../java/net/aoba/mixin/WorldChunkMixin.java | 28 + .../net/aoba/mixin/WorldRendererMixin.java | 18 +- .../java/net/aoba/module/ModuleManager.java | 14 +- .../aoba/module/modules/combat/Criticals.java | 4 +- .../net/aoba/module/modules/misc/AutoEat.java | 13 +- .../aoba/module/modules/movement/Step.java | 10 +- .../module/modules/render/Breadcrumbs.java | 13 +- .../aoba/module/modules/render/ChestESP.java | 26 +- .../aoba/module/modules/render/EntityESP.java | 23 +- .../aoba/module/modules/render/ItemESP.java | 4 +- .../aoba/module/modules/render/PlayerESP.java | 4 +- .../module/modules/render/SpawnerESP.java | 4 +- .../aoba/module/modules/render/Tracer.java | 10 +- .../module/modules/render/Trajectory.java | 15 +- .../net/aoba/module/modules/render/XRay.java | 12 +- .../net/aoba/module/modules/world/Nuker.java | 102 ++- .../module/modules/world/TileBreaker.java | 4 +- .../net/aoba/settings/SettingManager.java | 18 +- .../aoba/settings/types/BlocksSetting.java | 10 +- .../net/aoba/settings/types/ColorSetting.java | 22 +- src/main/resources/aoba.mixins.json | 3 +- src/main/resources/fabric.mod.json | 12 +- 297 files changed, 19937 insertions(+), 543 deletions(-) create mode 100644 gradle.bat create mode 100644 remappedSrc/net/aoba/Aoba.java create mode 100644 remappedSrc/net/aoba/AobaClient.java create mode 100644 remappedSrc/net/aoba/altmanager/Alt.java create mode 100644 remappedSrc/net/aoba/altmanager/AltManager.java create mode 100644 remappedSrc/net/aoba/altmanager/XboxLiveToken.java create mode 100644 remappedSrc/net/aoba/altmanager/exceptions/APIDownException.java create mode 100644 remappedSrc/net/aoba/altmanager/exceptions/APIErrorException.java create mode 100644 remappedSrc/net/aoba/altmanager/exceptions/InvalidResponseException.java create mode 100644 remappedSrc/net/aoba/altmanager/exceptions/InvalidTokenException.java create mode 100644 remappedSrc/net/aoba/cmd/Command.java create mode 100644 remappedSrc/net/aoba/cmd/CommandException.java create mode 100644 remappedSrc/net/aoba/cmd/CommandManager.java create mode 100644 remappedSrc/net/aoba/cmd/GlobalChat.java create mode 100644 remappedSrc/net/aoba/cmd/InvalidSyntaxException.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdAimbot.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdAutoEat.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdChestESP.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdClickgui.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdEntityESP.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdFastBreak.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdFly.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdFont.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdFreecam.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdFullbright.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdHelp.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdHud.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdItemESP.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdNoFall.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdNoSlowdown.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdNoclip.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdNuker.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdPOV.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdPlayerESP.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdReach.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdSpam.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdSprint.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdStep.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdTP.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdTileBreaker.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdTimer.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdTracer.java create mode 100644 remappedSrc/net/aoba/cmd/commands/CmdXRay.java create mode 100644 remappedSrc/net/aoba/event/EventManager.java create mode 100644 remappedSrc/net/aoba/event/events/AbstractEvent.java create mode 100644 remappedSrc/net/aoba/event/events/BlockStateEvent.java create mode 100644 remappedSrc/net/aoba/event/events/FontChangedEvent.java create mode 100644 remappedSrc/net/aoba/event/events/FoodLevelEvent.java create mode 100644 remappedSrc/net/aoba/event/events/KeyDownEvent.java create mode 100644 remappedSrc/net/aoba/event/events/LeftMouseDownEvent.java create mode 100644 remappedSrc/net/aoba/event/events/LeftMouseUpEvent.java create mode 100644 remappedSrc/net/aoba/event/events/MouseMoveEvent.java create mode 100644 remappedSrc/net/aoba/event/events/MouseScrollEvent.java create mode 100644 remappedSrc/net/aoba/event/events/PlayerDeathEvent.java create mode 100644 remappedSrc/net/aoba/event/events/PlayerHealthEvent.java create mode 100644 remappedSrc/net/aoba/event/events/ReceivePacketEvent.java create mode 100644 remappedSrc/net/aoba/event/events/RenderEvent.java create mode 100644 remappedSrc/net/aoba/event/events/SendPacketEvent.java create mode 100644 remappedSrc/net/aoba/event/events/TickEvent.java create mode 100644 remappedSrc/net/aoba/event/listeners/AbstractListener.java create mode 100644 remappedSrc/net/aoba/event/listeners/BlockStateListener.java create mode 100644 remappedSrc/net/aoba/event/listeners/FontChangedListener.java create mode 100644 remappedSrc/net/aoba/event/listeners/FoodLevelListener.java create mode 100644 remappedSrc/net/aoba/event/listeners/KeyDownListener.java create mode 100644 remappedSrc/net/aoba/event/listeners/LeftMouseDownListener.java create mode 100644 remappedSrc/net/aoba/event/listeners/LeftMouseUpListener.java create mode 100644 remappedSrc/net/aoba/event/listeners/MouseMoveListener.java create mode 100644 remappedSrc/net/aoba/event/listeners/MouseScrollListener.java create mode 100644 remappedSrc/net/aoba/event/listeners/PlayerDeathListener.java create mode 100644 remappedSrc/net/aoba/event/listeners/PlayerHealthListener.java create mode 100644 remappedSrc/net/aoba/event/listeners/ReceivePacketListener.java create mode 100644 remappedSrc/net/aoba/event/listeners/RenderListener.java create mode 100644 remappedSrc/net/aoba/event/listeners/SendPacketListener.java create mode 100644 remappedSrc/net/aoba/event/listeners/TickListener.java create mode 100644 remappedSrc/net/aoba/gui/AbstractGui.java create mode 100644 remappedSrc/net/aoba/gui/GuiManager.java create mode 100644 remappedSrc/net/aoba/gui/IGuiElement.java create mode 100644 remappedSrc/net/aoba/gui/NavigationBar.java create mode 100644 remappedSrc/net/aoba/gui/Page.java rename {src/main/java/net/aoba/gui => remappedSrc/net/aoba/gui/colors}/Color.java (99%) create mode 100644 remappedSrc/net/aoba/gui/colors/ColorMode.java rename {src/main/java/net/aoba/misc => remappedSrc/net/aoba/gui/colors}/Colors.java (96%) rename {src/main/java/net/aoba/misc => remappedSrc/net/aoba/gui/colors}/RainbowColor.java (66%) create mode 100644 remappedSrc/net/aoba/gui/colors/RandomColor.java create mode 100644 remappedSrc/net/aoba/gui/font/FontManager.java create mode 100644 remappedSrc/net/aoba/gui/hud/AbstractHud.java create mode 100644 remappedSrc/net/aoba/gui/hud/ArmorHud.java create mode 100644 remappedSrc/net/aoba/gui/hud/InfoHud.java create mode 100644 remappedSrc/net/aoba/gui/hud/ModuleSelectorHud.java create mode 100644 remappedSrc/net/aoba/gui/hud/RadarHud.java create mode 100644 remappedSrc/net/aoba/gui/screens/AddAltScreen.java create mode 100644 remappedSrc/net/aoba/gui/screens/AltScreen.java create mode 100644 remappedSrc/net/aoba/gui/screens/AltSelectionList.java create mode 100644 remappedSrc/net/aoba/gui/screens/DirectLoginAltScreen.java create mode 100644 remappedSrc/net/aoba/gui/screens/EditAltScreen.java create mode 100644 remappedSrc/net/aoba/gui/screens/MCLeaksLoginScreen.java create mode 100644 remappedSrc/net/aoba/gui/tabs/AuthCrackerTab.java create mode 100644 remappedSrc/net/aoba/gui/tabs/ClickGuiTab.java create mode 100644 remappedSrc/net/aoba/gui/tabs/HudsTab.java create mode 100644 remappedSrc/net/aoba/gui/tabs/ModuleSettingsTab.java create mode 100644 remappedSrc/net/aoba/gui/tabs/OptionsTab.java create mode 100644 remappedSrc/net/aoba/gui/tabs/components/BlocksComponent.java create mode 100644 remappedSrc/net/aoba/gui/tabs/components/ButtonComponent.java create mode 100644 remappedSrc/net/aoba/gui/tabs/components/CheckboxComponent.java create mode 100644 remappedSrc/net/aoba/gui/tabs/components/ColorPickerComponent.java create mode 100644 remappedSrc/net/aoba/gui/tabs/components/Component.java create mode 100644 remappedSrc/net/aoba/gui/tabs/components/HudComponent.java create mode 100644 remappedSrc/net/aoba/gui/tabs/components/KeybindComponent.java create mode 100644 remappedSrc/net/aoba/gui/tabs/components/ListComponent.java create mode 100644 remappedSrc/net/aoba/gui/tabs/components/ModuleComponent.java create mode 100644 remappedSrc/net/aoba/gui/tabs/components/ScrollComponent.java create mode 100644 remappedSrc/net/aoba/gui/tabs/components/SliderComponent.java create mode 100644 remappedSrc/net/aoba/gui/tabs/components/StackPanelComponent.java create mode 100644 remappedSrc/net/aoba/gui/tabs/components/StringComponent.java create mode 100644 remappedSrc/net/aoba/interfaces/ISimpleOption.java create mode 100644 remappedSrc/net/aoba/misc/FakePlayerEntity.java create mode 100644 remappedSrc/net/aoba/misc/ModuleUtils.java create mode 100644 remappedSrc/net/aoba/misc/RenderUtils.java create mode 100644 remappedSrc/net/aoba/misc/TextUtils.java create mode 100644 remappedSrc/net/aoba/mixin/AbstractBlockStateMixin.java create mode 100644 remappedSrc/net/aoba/mixin/AbstractClientPlayerEntityMixin.java create mode 100644 remappedSrc/net/aoba/mixin/AbstractSignEditScreenMixin.java create mode 100644 remappedSrc/net/aoba/mixin/BackgroundRendererMixin.java create mode 100644 remappedSrc/net/aoba/mixin/BlockMixin.java create mode 100644 remappedSrc/net/aoba/mixin/BlockModelRendererMixin.java create mode 100644 remappedSrc/net/aoba/mixin/CactusBlockMixin.java create mode 100644 remappedSrc/net/aoba/mixin/ChatHudMixin.java create mode 100644 remappedSrc/net/aoba/mixin/ChatInputSuggestorMixin.java create mode 100644 remappedSrc/net/aoba/mixin/ChatScreenMixin.java create mode 100644 remappedSrc/net/aoba/mixin/ChunkOcclusionDataBuilderMixin.java create mode 100644 remappedSrc/net/aoba/mixin/ClientConnectionMixin.java create mode 100644 remappedSrc/net/aoba/mixin/ClientPlayerEntityMixin.java create mode 100644 remappedSrc/net/aoba/mixin/ClientPlayerInteractionManagerMixin.java create mode 100644 remappedSrc/net/aoba/mixin/DeathScreenMixin.java create mode 100644 remappedSrc/net/aoba/mixin/EntityMixin.java create mode 100644 remappedSrc/net/aoba/mixin/EntityRendererMixin.java create mode 100644 remappedSrc/net/aoba/mixin/FluidBlockMixin.java create mode 100644 remappedSrc/net/aoba/mixin/GameRendererMixin.java create mode 100644 remappedSrc/net/aoba/mixin/HungerManagerMixin.java create mode 100644 remappedSrc/net/aoba/mixin/IngameHudMixin.java create mode 100644 remappedSrc/net/aoba/mixin/KeyboardMixin.java create mode 100644 remappedSrc/net/aoba/mixin/LightmapTextureManagerMixin.java create mode 100644 remappedSrc/net/aoba/mixin/LivingEntityMixin.java create mode 100644 remappedSrc/net/aoba/mixin/MinecraftClientMixin.java create mode 100644 remappedSrc/net/aoba/mixin/MouseMixin.java create mode 100644 remappedSrc/net/aoba/mixin/MultiplayerScreenMixin.java create mode 100644 remappedSrc/net/aoba/mixin/PlayerEntityMixin.java create mode 100644 remappedSrc/net/aoba/mixin/RenderTickCounterMixin.java create mode 100644 remappedSrc/net/aoba/mixin/ScreenMixin.java create mode 100644 remappedSrc/net/aoba/mixin/SimpleOptionMixin.java create mode 100644 remappedSrc/net/aoba/mixin/TerrainRenderContextMixin.java create mode 100644 remappedSrc/net/aoba/mixin/TitleScreenMixin.java create mode 100644 remappedSrc/net/aoba/mixin/WorldChunkMixin.java create mode 100644 remappedSrc/net/aoba/mixin/WorldRendererMixin.java create mode 100644 remappedSrc/net/aoba/mixin/interfaces/IEntityVelocityUpdateS2CPacket.java create mode 100644 remappedSrc/net/aoba/mixin/interfaces/IExplosionS2CPacket.java create mode 100644 remappedSrc/net/aoba/mixin/interfaces/ILivingEntity.java create mode 100644 remappedSrc/net/aoba/mixin/interfaces/IMinecraftClient.java create mode 100644 remappedSrc/net/aoba/module/Module.java create mode 100644 remappedSrc/net/aoba/module/ModuleManager.java create mode 100644 remappedSrc/net/aoba/module/modules/combat/Aimbot.java create mode 100644 remappedSrc/net/aoba/module/modules/combat/AntiInvis.java create mode 100644 remappedSrc/net/aoba/module/modules/combat/AntiKnockback.java create mode 100644 remappedSrc/net/aoba/module/modules/combat/AutoRespawn.java create mode 100644 remappedSrc/net/aoba/module/modules/combat/AutoSoup.java create mode 100644 remappedSrc/net/aoba/module/modules/combat/AutoTotem.java create mode 100644 remappedSrc/net/aoba/module/modules/combat/Criticals.java create mode 100644 remappedSrc/net/aoba/module/modules/combat/CrystalAura.java create mode 100644 remappedSrc/net/aoba/module/modules/combat/KillAura.java create mode 100644 remappedSrc/net/aoba/module/modules/combat/Nametags.java create mode 100644 remappedSrc/net/aoba/module/modules/combat/NoOverlay.java create mode 100644 remappedSrc/net/aoba/module/modules/combat/Reach.java create mode 100644 remappedSrc/net/aoba/module/modules/combat/TriggerBot.java create mode 100644 remappedSrc/net/aoba/module/modules/misc/AntiCactus.java create mode 100644 remappedSrc/net/aoba/module/modules/misc/AutoEat.java create mode 100644 remappedSrc/net/aoba/module/modules/misc/AutoFish.java create mode 100644 remappedSrc/net/aoba/module/modules/misc/AutoWalk.java create mode 100644 remappedSrc/net/aoba/module/modules/misc/FastBreak.java create mode 100644 remappedSrc/net/aoba/module/modules/misc/FastPlace.java create mode 100644 remappedSrc/net/aoba/module/modules/misc/Timer.java create mode 100644 remappedSrc/net/aoba/module/modules/movement/Fly.java create mode 100644 remappedSrc/net/aoba/module/modules/movement/Freecam.java create mode 100644 remappedSrc/net/aoba/module/modules/movement/Glide.java create mode 100644 remappedSrc/net/aoba/module/modules/movement/Jesus.java create mode 100644 remappedSrc/net/aoba/module/modules/movement/Jetpack.java create mode 100644 remappedSrc/net/aoba/module/modules/movement/NoFall.java create mode 100644 remappedSrc/net/aoba/module/modules/movement/NoJumpDelay.java create mode 100644 remappedSrc/net/aoba/module/modules/movement/NoSlowdown.java create mode 100644 remappedSrc/net/aoba/module/modules/movement/Noclip.java create mode 100644 remappedSrc/net/aoba/module/modules/movement/Safewalk.java create mode 100644 remappedSrc/net/aoba/module/modules/movement/Sneak.java create mode 100644 remappedSrc/net/aoba/module/modules/movement/Spider.java create mode 100644 remappedSrc/net/aoba/module/modules/movement/Sprint.java create mode 100644 remappedSrc/net/aoba/module/modules/movement/Step.java create mode 100644 remappedSrc/net/aoba/module/modules/render/Breadcrumbs.java create mode 100644 remappedSrc/net/aoba/module/modules/render/ChestESP.java create mode 100644 remappedSrc/net/aoba/module/modules/render/EntityESP.java create mode 100644 remappedSrc/net/aoba/module/modules/render/Fullbright.java create mode 100644 remappedSrc/net/aoba/module/modules/render/ItemESP.java create mode 100644 remappedSrc/net/aoba/module/modules/render/POV.java create mode 100644 remappedSrc/net/aoba/module/modules/render/PlayerESP.java create mode 100644 remappedSrc/net/aoba/module/modules/render/SpawnerESP.java create mode 100644 remappedSrc/net/aoba/module/modules/render/Tracer.java create mode 100644 remappedSrc/net/aoba/module/modules/render/Trajectory.java create mode 100644 remappedSrc/net/aoba/module/modules/render/XRay.java create mode 100644 remappedSrc/net/aoba/module/modules/render/Zoom.java create mode 100644 remappedSrc/net/aoba/module/modules/world/AutoFarm.java create mode 100644 remappedSrc/net/aoba/module/modules/world/AutoSign.java create mode 100644 remappedSrc/net/aoba/module/modules/world/Nuker.java create mode 100644 remappedSrc/net/aoba/module/modules/world/Surround.java create mode 100644 remappedSrc/net/aoba/module/modules/world/TileBreaker.java create mode 100644 remappedSrc/net/aoba/settings/Setting.java create mode 100644 remappedSrc/net/aoba/settings/SettingManager.java create mode 100644 remappedSrc/net/aoba/settings/types/BlocksSetting.java create mode 100644 remappedSrc/net/aoba/settings/types/BooleanSetting.java create mode 100644 remappedSrc/net/aoba/settings/types/ColorSetting.java create mode 100644 remappedSrc/net/aoba/settings/types/FloatSetting.java create mode 100644 remappedSrc/net/aoba/settings/types/IndexedStringListSetting.java create mode 100644 remappedSrc/net/aoba/settings/types/IntegerSetting.java create mode 100644 remappedSrc/net/aoba/settings/types/KeybindSetting.java create mode 100644 remappedSrc/net/aoba/settings/types/StringListSetting.java create mode 100644 remappedSrc/net/aoba/settings/types/StringSetting.java create mode 100644 remappedSrc/net/aoba/settings/types/Vector2Setting.java create mode 100644 remappedSrc/net/aoba/utils/types/Vector2.java create mode 100644 src/main/java/net/aoba/event/events/BlockStateEvent.java create mode 100644 src/main/java/net/aoba/event/listeners/BlockStateListener.java create mode 100644 src/main/java/net/aoba/gui/colors/Color.java create mode 100644 src/main/java/net/aoba/gui/colors/ColorMode.java create mode 100644 src/main/java/net/aoba/gui/colors/Colors.java create mode 100644 src/main/java/net/aoba/gui/colors/RainbowColor.java create mode 100644 src/main/java/net/aoba/gui/colors/RandomColor.java create mode 100644 src/main/java/net/aoba/mixin/WorldChunkMixin.java diff --git a/build.gradle b/build.gradle index 89308cb7..f05a486f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,15 +1,15 @@ plugins { - id 'fabric-loom' version '1.1-SNAPSHOT' + id 'fabric-loom' version '1.6-SNAPSHOT' id 'maven-publish' } -sourceCompatibility = JavaVersion.VERSION_17 -targetCompatibility = JavaVersion.VERSION_17 - -archivesBaseName = project.archives_base_name version = project.mod_version group = project.maven_group +base { + archivesName = project.archives_base_name +} + repositories { // Add repositories to retrieve artifacts from in here. // You should only use this when depending on other mods because @@ -18,6 +18,18 @@ repositories { // for more information about repositories. } +loom { + splitEnvironmentSourceSets() + + mods { + "template-mod" { + sourceSet sourceSets.main + sourceSet sourceSets.client + } + } + +} + dependencies { // To change the versions see the gradle.properties file minecraft "com.mojang:minecraft:${project.minecraft_version}" @@ -26,11 +38,7 @@ dependencies { // Fabric API. This is technically optional, but you probably want it anyway. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - - // Uncomment the following line to enable the deprecated Fabric API modules. - // These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time. - - // modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}" + } processResources { @@ -42,8 +50,7 @@ processResources { } tasks.withType(JavaCompile).configureEach { - // Minecraft 1.18 (1.18-pre2) upwards uses Java 17. - it.options.release = 17 + it.options.release = 21 } java { @@ -51,18 +58,22 @@ java { // if it is present. // If you remove this line, sources will not be generated. withSourcesJar() + + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } jar { from("LICENSE") { - rename { "${it}_${project.archivesBaseName}"} + rename { "${it}_${project.base.archivesName.get()}"} } } // configure the maven publication publishing { publications { - mavenJava(MavenPublication) { + create("mavenJava", MavenPublication) { + artifactId = project.archives_base_name from components.java } } @@ -74,4 +85,4 @@ publishing { // The repositories here will be used for publishing your artifact, not for // retrieving dependencies. } -} +} \ No newline at end of file diff --git a/gradle.bat b/gradle.bat new file mode 100644 index 00000000..1cce1818 --- /dev/null +++ b/gradle.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME%.. + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" "-javaagent:%APP_HOME%/lib/agents/gradle-instrumentation-agent-8.7.jar" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\lib\gradle-launcher-8.7.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.launcher.GradleMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/gradle.properties b/gradle.properties index 0f26373a..74b7b523 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,15 +4,14 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop -minecraft_version=1.20.4 -yarn_mappings=1.20.4+build.3 -loader_version=0.15.7 - +minecraft_version=1.20.5 +yarn_mappings=1.20.5+build.1 +loader_version=0.15.10 # Mod Properties -mod_version = 1.0.0 -maven_group = net.aoba -archives_base_name = Aoba +mod_version=1.0.0 +maven_group=com.example +archives_base_name=template-mod # Dependencies -fabric_version=0.96.3+1.20.4 +fabric_version=0.97.7+1.20.5 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 943f0cbfa754578e88a3dae77fce6e3dea56edbf..e6441136f3d4ba8a0da8d277868979cfbc8ad796 100644 GIT binary patch literal 43453 zcma&N1CXTcmMvW9vTb(Rwr$&4wr$(C?dmSu>@vG-+vuvg^_??!{yS%8zW-#zn-LkA z5&1^$^{lnmUON?}LBF8_K|(?T0Ra(xUH{($5eN!MR#ZihR#HxkUPe+_R8Cn`RRs(P z_^*#_XlXmGv7!4;*Y%p4nw?{bNp@UZHv1?Um8r6)Fei3p@ClJn0ECfg1hkeuUU@Or zDaPa;U3fE=3L}DooL;8f;P0ipPt0Z~9P0)lbStMS)ag54=uL9ia-Lm3nh|@(Y?B`; zx_#arJIpXH!U{fbCbI^17}6Ri*H<>OLR%c|^mh8+)*h~K8Z!9)DPf zR2h?lbDZQ`p9P;&DQ4F0sur@TMa!Y}S8irn(%d-gi0*WxxCSk*A?3lGh=gcYN?FGl z7D=Js!i~0=u3rox^eO3i@$0=n{K1lPNU zwmfjRVmLOCRfe=seV&P*1Iq=^i`502keY8Uy-WNPwVNNtJFx?IwAyRPZo2Wo1+S(xF37LJZ~%i)kpFQ3Fw=mXfd@>%+)RpYQLnr}B~~zoof(JVm^^&f zxKV^+3D3$A1G;qh4gPVjhrC8e(VYUHv#dy^)(RoUFM?o%W-EHxufuWf(l*@-l+7vt z=l`qmR56K~F|v<^Pd*p~1_y^P0P^aPC##d8+HqX4IR1gu+7w#~TBFphJxF)T$2WEa zxa?H&6=Qe7d(#tha?_1uQys2KtHQ{)Qco)qwGjrdNL7thd^G5i8Os)CHqc>iOidS} z%nFEDdm=GXBw=yXe1W-ShHHFb?Cc70+$W~z_+}nAoHFYI1MV1wZegw*0y^tC*s%3h zhD3tN8b=Gv&rj}!SUM6|ajSPp*58KR7MPpI{oAJCtY~JECm)*m_x>AZEu>DF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aK#F@_p=e}FdAa3tEl!|+j?h8h`t0CvCmNU%dOwEq<+jmm-=n|r|G^7QX4N4o(v zPU!%%w(Cet)Zev3QA?;TMm_aEK!5(~Nc6pJlp|sQP@z%JI}f0_`u+rc`1Df^j0G&s ScNgau(U?ep-K_E5zy1%ZQTdPn diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f398c33c..b82aa23a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 65dcd68d..1aa94a42 100755 --- a/gradlew +++ b/gradlew @@ -83,10 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index 93e3f59f..25da30db 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/remappedSrc/net/aoba/Aoba.java b/remappedSrc/net/aoba/Aoba.java new file mode 100644 index 00000000..385caf00 --- /dev/null +++ b/remappedSrc/net/aoba/Aoba.java @@ -0,0 +1,45 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * A class to initialize and hold the Singleton of Aoba Client. + */ +package net.aoba; + +import net.fabricmc.api.ModInitializer; + +public class Aoba implements ModInitializer { + public static AobaClient instance; + + @Override + public void onInitialize() + { + instance = new AobaClient(); + instance.Initialize(); + } + + /** + * Returns the singleton instance of Aoba client. + * @return Aoba Client + */ + public static AobaClient getInstance() { + return instance; + } + + +} diff --git a/remappedSrc/net/aoba/AobaClient.java b/remappedSrc/net/aoba/AobaClient.java new file mode 100644 index 00000000..e324b87e --- /dev/null +++ b/remappedSrc/net/aoba/AobaClient.java @@ -0,0 +1,151 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * A class to represent Aoba Client and all of its functions. + */ +package net.aoba; + +import net.aoba.altmanager.AltManager; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.GlobalChat; +import net.aoba.event.EventManager; +import net.aoba.gui.GuiManager; +import net.aoba.gui.colors.ColorMode; +import net.aoba.gui.font.FontManager; +import net.aoba.misc.RenderUtils; +import net.aoba.mixin.interfaces.IMinecraftClient; +import net.aoba.module.ModuleManager; +import net.aoba.settings.SettingManager; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.DrawContext; + +public class AobaClient { + public static final String NAME = "Aoba"; + public static final String VERSION = "1.20.4"; + public static final String AOBA_VERSION = "1.4.0"; + + public static MinecraftClient MC; + public static IMinecraftClient IMC; + + // Systems + public ModuleManager moduleManager; + public CommandManager commandManager; + public AltManager altManager; + public GuiManager hudManager; + public FontManager fontManager; + public SettingManager settingManager; + public RenderUtils renderUtils; + public GlobalChat globalChat; + public EventManager eventManager; + + private boolean ghostMode; + + /** + * Initializes Aoba Client and creates sub-systems. + */ + public void Initialize() { + // Gets instance of Minecraft + MC = MinecraftClient.getInstance(); + IMC = (IMinecraftClient)MC; + } + + public void loadAssets() { + System.out.println("[Aoba] Starting Client"); + + eventManager = new EventManager(); + + renderUtils = new RenderUtils(); + System.out.println("[Aoba] Reading Settings"); + settingManager = new SettingManager(); + System.out.println("[Aoba] Initializing Modules"); + moduleManager = new ModuleManager(); + System.out.println("[Aoba] Initializing Commands"); + commandManager = new CommandManager(); + System.out.println("[Aoba] Initializing Font Manager"); + fontManager = new FontManager(); + fontManager.Initialize(); + System.out.println("[Aoba] Initializing GUI"); + hudManager = new GuiManager(); + hudManager.Initialize(); + System.out.println("[Aoba] Loading Alts"); + altManager = new AltManager(); + System.out.println("[Aoba] Aoba-chan initialized and ready to play!"); + + SettingManager.loadSettings("config_category", settingManager.config_category); + SettingManager.loadSettings("modules_category", settingManager.modules_category); + SettingManager.loadSettings("hidden_category", settingManager.hidden_category); + + globalChat = new GlobalChat(); + globalChat.StartListener(); + + //GuiManager.borderColor.setMode(ColorMode.Rainbow); + //GuiManager.foregroundColor.setMode(ColorMode.Random); + } + + /** + * Updates Aoba on a per-tick basis. + */ + public void update() { + moduleManager.update(); + hudManager.update(); + } + + /** + * Renders the HUD every frame + * @param context The current Matrix Stack + * @param partialTicks Delta between ticks + */ + public void drawHUD(DrawContext context, float partialTicks) { + // If the program is not in Ghost Mode, draw UI. + if (!ghostMode) { + hudManager.draw(context, partialTicks); + } + } + + /** + * Toggles Ghost Mode. (No UI) + */ + public void toggleGhostMode() { + ghostMode = !ghostMode; + } + + /** + * Returns whether Aoba is currently in Ghost Mode. (No UI) + * @return Ghost Mode + */ + public boolean isGhosted() { + return this.ghostMode; + } + + /** + * Called when the client is shutting down. + */ + public void endClient() { + try { + SettingManager.saveSettings("config_category", settingManager.config_category); + SettingManager.saveSettings("modules_category", settingManager.modules_category); + SettingManager.saveSettings("hidden_category", settingManager.hidden_category); + altManager.saveAlts(); + moduleManager.modules.forEach(s -> s.onDisable()); + }catch(Exception e) { + e.printStackTrace(); + } + System.out.println("[Aoba] Shutting down..."); + } +} diff --git a/remappedSrc/net/aoba/altmanager/Alt.java b/remappedSrc/net/aoba/altmanager/Alt.java new file mode 100644 index 00000000..0be8609d --- /dev/null +++ b/remappedSrc/net/aoba/altmanager/Alt.java @@ -0,0 +1,131 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * A class to represent an Alt Account and all of it's information. + */ +package net.aoba.altmanager; + +public class Alt { + private String email; + private String username; + private String password; + private boolean microsoft = false; + private boolean isCracked = false; + + /** + * Constructor for an Alt given it's email, password, and whether it is a Microsoft account. + * @param email Email used to log in to the account. + * @param password Password used to log in to the account. + * @param microsoft Whether or not the account is a Microsoft or Mojang Account. + */ + public Alt(String email, String password, boolean microsoft) { + this.email = email; + this.password = password; + this.microsoft = microsoft; + // If no password is entered, assume the account is a cracked account. + if(this.password.isEmpty()) { + this.isCracked = true; + } + } + + /** + * Constructor for an Alt given it's email, password, username, and whether it is a Microsoft account. + * @param email Email used to log in to the account. + * @param password Password used to log in to the account. + * @param username Username that the account currently has. + * @param microsoft Whether or not the account is a Microsoft or Mojang Account. + */ + public Alt(String email, String password, String username, boolean microsoft) { + this.email = email; + this.password = password; + this.username = username; + this.microsoft = microsoft; + // If no password is entered, assume the account is a cracked account. + if(this.password.isEmpty()) { + this.isCracked = true; + } + } + + /** + * Sets the username of the Alt account. + * @param username The username of the Alt account. + */ + public void setUsername(String username) { + this.username = username; + } + + /** + * Sets the email of the Alt account. + * @param email The email of the Alt account. + */ + public void setEmail(String email) { + this.email = email; + } + + /** + * Sets the password of the Alt account. + * @param password The password of the Alt account. + */ + public void setPassword(String password) { + this.password = password; + } + + /** + * Gets the username of the Alt account. + * @return The username of the Alt account. + */ + public String getUsername() { + if(this.username == null) { + return ""; + } + return this.username; + } + + /** + * Gets the email of the Alt account. + * @return The email of the Alt account. + */ + public String getEmail() { + return this.email; + } + + /** + * Gets the password of the Alt account. + * @return The password of the Alt account. + */ + public String getPassword() { + return this.password; + } + + /** + * Gets whether the Alt account is cracked. + * @return Whether the Alt account is cracked. + */ + public boolean isCracked() { + return this.isCracked; + } + + /** + * Gets whether the Alt account is a Microsoft account. + * @return Whether the Alt account is a Microsoft account. + */ + public boolean isMicrosoft() { + return this.microsoft; + } +} diff --git a/remappedSrc/net/aoba/altmanager/AltManager.java b/remappedSrc/net/aoba/altmanager/AltManager.java new file mode 100644 index 00000000..e4c384ca --- /dev/null +++ b/remappedSrc/net/aoba/altmanager/AltManager.java @@ -0,0 +1,622 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * A class to represent a system to manage Alt accounts. + */ +package net.aoba.altmanager; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; +import java.net.URLDecoder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Base64; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.UUID; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import javax.crypto.Cipher; +import javax.crypto.spec.SecretKeySpec; +import javax.net.ssl.HttpsURLConnection; +import javax.security.auth.login.LoginException; +import org.apache.commons.io.IOUtils; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import net.aoba.AobaClient; +import net.aoba.altmanager.exceptions.APIDownException; +import net.aoba.altmanager.exceptions.APIErrorException; +import net.aoba.altmanager.exceptions.InvalidResponseException; +import net.aoba.altmanager.exceptions.InvalidTokenException; +import net.aoba.mixin.interfaces.IMinecraftClient; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.session.Session; +import net.minecraft.client.session.Session.AccountType; +import net.minecraft.util.Uuids; + +public class AltManager { + private final MinecraftClient mc; + private final String apiURL = "https://auth.mcleaks.net/v1/"; + + private ArrayList alts = new ArrayList(); + private String encryptKey = "B&E)H@McQeThWmZq"; + private String MCLeaksSession; + + // Big thanks to Wurst for the URLs and REGEX. What are you doing Microsoft? + private final String CLIENT_ID = "00000000402b5328"; + private final String SCOPE_ENCODED = "service%3A%3Auser.auth.xboxlive.com%3A%3AMBI_SSL"; + private final String SCOPE_UNENCODED = "service::user.auth.xboxlive.com::MBI_SSL"; + private final String REDIRECT_URI_ENCODED = "https%3A%2F%2Flogin.live.com%2Foauth20_desktop.srf"; + private final URL LOGIN_URL = createURL("https://login.live.com/oauth20_authorize.srf?client_id=" + CLIENT_ID + + "&response_type=code&scope=" + SCOPE_ENCODED + "&redirect_uri=" + REDIRECT_URI_ENCODED); + private final URL AUTH_TOKEN_URL = createURL("https://login.live.com/oauth20_token.srf"); + private final URL XBL_TOKEN_URL = createURL("https://user.auth.xboxlive.com/user/authenticate"); + private final URL XSTS_TOKEN_URL = createURL("https://xsts.auth.xboxlive.com/xsts/authorize"); + private final URL MC_TOKEN_URL = createURL("https://api.minecraftservices.com/authentication/login_with_xbox"); + private final URL PROFILE_URL = createURL("https://api.minecraftservices.com/minecraft/profile"); + private final Pattern PPFT_REGEX = Pattern.compile("sFTTag:[ ]?'.*value=\"(.*)\"/>"); + private final Pattern URLPOST_REGEX = Pattern.compile("urlPost:[ ]?'(.+?(?='))"); + private final Pattern AUTHCODE_REGEX = Pattern.compile("[?|&]code=([\\w.-]+)"); + + /** + * Constructor for the Alt Manager system. + */ + public AltManager() { + mc = AobaClient.MC; + readAlts(); + } + + /** + * Reads the Alts from a file. + */ + public void readAlts() { + try { + // Finds the file and opens it. + File altFile = new File(mc.runDirectory, "aoba_alts.txt"); + if (!altFile.exists()) + throw new IOException("File not found! Could not load alts..."); + List list = IOUtils.readLines(new FileInputStream(altFile), StandardCharsets.UTF_8); + + // For every line in the file, decrypt and read the account information. + for (String s : list) { + String str = decrypt(s); + String[] alt = str.split(":"); + try { + Alt newAlt = new Alt(alt[0], alt[1], alt[2], Boolean.parseBoolean(alt[3])); + alts.add(newAlt); + } catch (Exception e) { + System.out.println("Skipping bad option: " + alt[0]); + } + } + } catch (IOException exception) { + exception.printStackTrace(); + } + } + + /** + * Saves the Alts to a file. + */ + public void saveAlts() { + PrintWriter printwriter = null; + try { + // Finds the file and opens it. + File altFile = new File(mc.runDirectory, "aoba_alts.txt"); + System.out.println("[Aoba] Saving Alts"); + printwriter = new PrintWriter( + new OutputStreamWriter(new FileOutputStream(altFile), StandardCharsets.UTF_8)); + + // For every Alt in the current Alt list, print it to the file and encrypt it. + for (Alt alt : alts) { + String str = alt.getEmail() + ":" + alt.getPassword() + ":" + alt.getUsername() + ":" + + alt.isMicrosoft(); + printwriter.println(encrypt(str)); + } + } catch (Exception exception) { + System.out.println("[Aoba] Failed to save alts"); + } + printwriter.close(); + } + + /** + * Encrypts a string using a defined encryption key. + * + * @param strToEncrypt The string to by encrypted. + * @return The encrypted string. + */ + public String encrypt(String strToEncrypt) { + try { + Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding"); + cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(encryptKey.getBytes(), "AES")); + return Base64.getEncoder().encodeToString(cipher.doFinal(strToEncrypt.getBytes("UTF-8"))); + } catch (Exception e) { + e.printStackTrace(); + } + return strToEncrypt; + } + + /** + * Decrypts a string using a defined encryption key. + * + * @param strToEncrypt The encrypted string to by decrypted. + * @return The decrypted string. + */ + public String decrypt(String strToDecrypt) { + try { + Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding"); + cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(encryptKey.getBytes(), "AES")); + return new String(cipher.doFinal(Base64.getDecoder().decode(strToDecrypt))); + } catch (Exception e) { + e.printStackTrace(); + } + return strToDecrypt; + } + + /** + * Adds an Alt account to the Alt list. + * + * @param alt The Alt to be added. + */ + public void addAlt(Alt alt) { + alts.add(alt); + } + + /** + * Removes an Alt account from the Alt list. + * + * @param alt The Alt to be removed. + */ + public void removeAlt(Alt alt) { + alts.remove(alt); + } + + /** + * Gets the Alt list. + * + * @return The Alt list. + */ + public ArrayList getAlts() { + return this.alts; + } + + /** + * + * @param alt + * @return + */ + public boolean login(Alt alt) { + // Log in to the correct service depending on the Alt type. + return loginMicrosoft(alt); + } + + /** + * Logs in to a Microsoft Account. + * @param alt The Alt to be signed into. + * @return A boolean signifying that the operation has completed. + */ + private boolean loginMicrosoft(Alt alt) { + try { + IMinecraftClient iMC = (IMinecraftClient) this.mc; + UUID uuid; + String name; + + // Grabs login information from Microsoft's Servers. + String authCode = getAuthCode(alt); + String msftAccessToken = getMicrosoftAccessToken(authCode); + XboxLiveToken xblToken = getXBLToken(msftAccessToken); + String xstsToken = getXSTSToken(xblToken.getToken()); + String mcAccessToken = getMinecraftAccessToken(xblToken.getHash(), xstsToken); + + // Creates a connection to the login server. + URLConnection connection = PROFILE_URL.openConnection(); + connection.setRequestProperty("Authorization", "Bearer " + mcAccessToken); + + // Retrieves the JsonObject from the login server. + JsonObject json = parseConnectionToObject(connection); + + // Throw an error is the JsonObject contains an error. + if (json.has("error")) + throw new LoginException("Error message from api.minecraftservices.com:\n" + json.get("error")); + + // Otherwise, create a Session and log in. + uuid = uuidFromJson(json.get("id").getAsString()); + name = json.get("name").getAsString(); + + Session session = new Session(name, uuid, mcAccessToken, Optional.empty(), Optional.empty(), Session.AccountType.MOJANG); + iMC.setSession(session); + System.out.println("Logged in as " + alt.getUsername()); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * Gets the Authentication Code from Microsoft's servers, + * @param alt The Alt to fetch the Auth code from. + * @return The Auth Code. + * @throws LoginException If the login has failed. + */ + private String getAuthCode(Alt alt) throws LoginException { + String cookie; + String loginWebpage; + try { + URLConnection connection = LOGIN_URL.openConnection(); + cookie = connection.getHeaderField("set-cookie"); + try (InputStream input = connection.getInputStream()) { + InputStreamReader reader = new InputStreamReader(input); + BufferedReader bufferedReader = new BufferedReader(reader); + loginWebpage = bufferedReader.lines().collect(Collectors.joining("\n")); + } + } catch (Exception e) { + throw new LoginException("Failed login"); + } + + Matcher matcher = PPFT_REGEX.matcher(loginWebpage); + if (!matcher.find()) + throw new LoginException("sFTTag / PPFT regex failed."); + + String ppft = matcher.group(1); + + matcher = URLPOST_REGEX.matcher(loginWebpage); + if (!matcher.find()) + throw new LoginException("urlPost regex failed."); + + String urlPost = matcher.group(1); + + return microsoftLogin(alt, cookie, ppft, urlPost); + } + + private String microsoftLogin(Alt alt, String cookie, String ppft, String urlPost) throws LoginException { + Map postData = new HashMap<>(); + postData.put("login", alt.getEmail()); + postData.put("loginfmt", alt.getEmail()); + postData.put("passwd", alt.getPassword()); + postData.put("PPFT", ppft); + + byte[] encodedDataBytes = urlEncodeMap(postData).getBytes(StandardCharsets.UTF_8); + + try { + URL url = new URL(urlPost); + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + + connection.setRequestMethod("POST"); + connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); + connection.setRequestProperty("Content-Length", "" + encodedDataBytes.length); + connection.setRequestProperty("Cookie", cookie); + + connection.setDoInput(true); + connection.setDoOutput(true); + + try (OutputStream out = connection.getOutputStream()) { + out.write(encodedDataBytes); + } + + int responseCode = connection.getResponseCode(); + if (responseCode >= 500 && responseCode <= 599) + throw new LoginException("Servers are down (code " + responseCode + ")."); + + if (responseCode != 200) + throw new LoginException("Got code " + responseCode + " from urlPost."); + + String decodedUrl = URLDecoder.decode(connection.getURL().toString(), StandardCharsets.UTF_8.name()); + + Matcher matcher = AUTHCODE_REGEX.matcher(decodedUrl); + if (!matcher.find()) + throw new LoginException("Didn't get authCode. (Wrong email/password?)"); + + return matcher.group(1); + + } catch (IOException e) { + throw new LoginException("Connection failed: " + e); + } + } + + public boolean loginCracked(String alt) { + try { + IMinecraftClient iMC = (IMinecraftClient) this.mc; + UUID offlineAlt = Uuids.getOfflinePlayerUuid(alt); + iMC.setSession(new Session(alt, offlineAlt, "", Optional.empty(), Optional.empty(), AccountType.MOJANG)); + System.out.println("Logged in as " + alt); + + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + public void loginMCLeaks(final String token) + throws APIDownException, APIErrorException, InvalidResponseException, InvalidTokenException { + if (token == null || token.length() != 16) { + throw new InvalidTokenException(); + } + JsonObject requestObject = new JsonObject(); + requestObject.add("token", new GsonBuilder().create().toJsonTree(token)); + String response; + try { + response = postJson(apiURL + "redeem", requestObject.toString()); + } catch (Exception e) { + throw new APIDownException(); + } + JsonObject responseObject; + try { + responseObject = JsonParser.parseString(response).getAsJsonObject(); + } catch (Exception e) { + throw new InvalidResponseException(response); + } + if (!responseObject.get("success").getAsBoolean()) { + throw new APIErrorException(responseObject.get("errorMessage").getAsString()); + } + JsonObject resultObject = responseObject.get("result").getAsJsonObject(); + + MCLeaksSession = resultObject.get("session").getAsString(); + } + + public void joinServer(Session session, final String server, final String serverHash) + throws APIDownException, InvalidResponseException, APIErrorException { + Gson gson = new GsonBuilder().create(); + JsonObject requestObject = new JsonObject(); + + requestObject.add("session", gson.toJsonTree(MCLeaksSession)); + requestObject.add("mcname", gson.toJsonTree(session.getUsername())); + requestObject.add("serverhash", gson.toJsonTree(serverHash)); + requestObject.add("server", gson.toJsonTree(server)); + String response; + try { + response = postJson(apiURL + "joinserver", requestObject.toString()); + } catch (Exception e) { + throw new APIDownException(); + } + JsonObject responseObject; + try { + responseObject = JsonParser.parseString(response).getAsJsonObject(); + } catch (Exception e) { + throw new InvalidResponseException(response); + } + if (!responseObject.get("success").getAsBoolean()) { + throw new APIErrorException(responseObject.get("errorMessage").getAsString()); + } + } + + private XboxLiveToken getXBLToken(String msftAccessToken) throws LoginException { + JsonObject properties = new JsonObject(); + properties.addProperty("AuthMethod", "RPS"); + properties.addProperty("SiteName", "user.auth.xboxlive.com"); + properties.addProperty("RpsTicket", msftAccessToken); + + JsonObject postData = new JsonObject(); + postData.addProperty("RelyingParty", "http://auth.xboxlive.com"); + postData.addProperty("TokenType", "JWT"); + postData.add("Properties", properties); + + String request = postData.toString(); + + try { + URLConnection connection = XBL_TOKEN_URL.openConnection(); + + connection.setRequestProperty("Content-Type", "application/json"); + connection.setRequestProperty("Accept", "application/json"); + connection.setDoOutput(true); + + try (OutputStream out = connection.getOutputStream()) { + out.write(request.getBytes(StandardCharsets.US_ASCII)); + } + + JsonObject json = parseConnectionToObject(connection); + + String token = json.get("Token").getAsString(); + String uhs = json.get("DisplayClaims").getAsJsonObject().getAsJsonArray("xui").get(0).getAsJsonObject() + .get("uhs").getAsString(); + + return new XboxLiveToken(token, uhs); + + } catch (IOException e) { + e.printStackTrace(); + throw new LoginException("Connection failed: " + e); + } catch (Exception e) { + e.printStackTrace(); + throw new LoginException("Server sent invalid JSON."); + } + } + + private String getXSTSToken(String xblToken) throws LoginException { + JsonArray tokens = new JsonArray(); + tokens.add(xblToken); + + JsonObject properties = new JsonObject(); + properties.addProperty("SandboxId", "RETAIL"); + properties.add("UserTokens", tokens); + + JsonObject postData = new JsonObject(); + postData.addProperty("RelyingParty", "rp://api.minecraftservices.com/"); + postData.addProperty("TokenType", "JWT"); + postData.add("Properties", properties); + + String request = postData.toString(); + + try { + URLConnection connection = XSTS_TOKEN_URL.openConnection(); + + connection.setRequestProperty("Content-Type", "application/json"); + connection.setRequestProperty("Accept", "application/json"); + + connection.setDoOutput(true); + + try (OutputStream out = connection.getOutputStream()) { + out.write(request.getBytes(StandardCharsets.US_ASCII)); + } + + JsonObject json = parseConnectionToObject(connection); + return json.get("Token").getAsString(); + + } catch (IOException e) { + e.printStackTrace(); + throw new LoginException("Connection failed: " + e); + } catch (Exception e) { + e.printStackTrace(); + throw new LoginException("Server sent invalid JSON."); + } + } + + private String getMinecraftAccessToken(String uhs, String xstsToken) throws LoginException { + JsonObject postData = new JsonObject(); + postData.addProperty("identityToken", "XBL3.0 x=" + uhs + ";" + xstsToken); + + String request = postData.toString(); + + try { + URLConnection connection = MC_TOKEN_URL.openConnection(); + + connection.setRequestProperty("Content-Type", "application/json"); + connection.setRequestProperty("Accept", "application/json"); + + connection.setDoOutput(true); + + try (OutputStream out = connection.getOutputStream()) { + out.write(request.getBytes(StandardCharsets.US_ASCII)); + } + + JsonObject json = parseConnectionToObject(connection); + return json.get("access_token").getAsString(); + + } catch (IOException e) { + throw new LoginException("Connection failed: " + e); + } catch (Exception e) { + throw new LoginException("Server sent invalid JSON."); + } + } + + private String getMicrosoftAccessToken(String authCode) throws LoginException { + Map postData = new HashMap<>(); + postData.put("client_id", CLIENT_ID); + postData.put("code", authCode); + postData.put("grant_type", "authorization_code"); + postData.put("redirect_uri", "https://login.live.com/oauth20_desktop.srf"); + postData.put("scope", SCOPE_UNENCODED); + + byte[] encodedDataBytes = urlEncodeMap(postData).getBytes(StandardCharsets.UTF_8); + + try { + HttpURLConnection connection = (HttpURLConnection) AUTH_TOKEN_URL.openConnection(); + + connection.setRequestMethod("POST"); + connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); + + connection.setDoOutput(true); + + try (OutputStream out = connection.getOutputStream()) { + out.write(encodedDataBytes); + } + + JsonObject json = parseConnectionToObject(connection); + return json.get("access_token").getAsString(); + + } catch (IOException e) { + throw new LoginException("Connection failed: " + e); + + } catch (Exception e) { + throw new LoginException("Server sent invalid JSON."); + } + } + + private String postJson(final String urlString, final String content) throws Exception { + URL url = new URL(urlString); + HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); + connection.setDoInput(true); + connection.setDoOutput(true); + connection.setRequestMethod("POST"); + connection.setRequestProperty("Content-Type", "application/json; charset=UTF-8"); + OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream(), "UTF-8"); + writer.write(content); + writer.close(); + BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); + StringBuilder builder = new StringBuilder(); + String line; + while ((line = reader.readLine()) != null) { + builder.append(line); + } + reader.close(); + connection.disconnect(); + return builder.toString(); + } + + private String urlEncodeMap(Map map) { + StringBuilder sb = new StringBuilder(); + for (Map.Entry entry : map.entrySet()) { + if (sb.length() > 0) + sb.append("&"); + sb.append(URLEncoder.encode(entry.getKey(), StandardCharsets.UTF_8)); + sb.append("="); + sb.append(URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8)); + } + return sb.toString(); + } + + private UUID uuidFromJson(String jsonUUID) throws Exception { + try { + String withDashes = jsonUUID.replaceFirst( + "(\\p{XDigit}{8})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}+)", "$1-$2-$3-$4-$5"); + return UUID.fromString(withDashes); + } catch (IllegalArgumentException e) { + throw new Exception("Invalid UUID.", e); + } + } + + private URL createURL(String url) { + try { + return new URL(url); + } catch (MalformedURLException e) { + throw new IllegalArgumentException(e); + } + } + + private JsonObject parseConnectionToObject(URLConnection connection) throws IOException { + try (InputStream input = connection.getInputStream()) { + InputStreamReader reader = new InputStreamReader(input); + BufferedReader bufferedReader = new BufferedReader(reader); + JsonElement json = JsonParser.parseReader(bufferedReader); + if (!json.isJsonObject()) + throw new Exception("JSON recieved is not object!"); + return json.getAsJsonObject(); + } catch (Exception e) { + throw new IOException("Failed to read JSON."); + } + } +} diff --git a/remappedSrc/net/aoba/altmanager/XboxLiveToken.java b/remappedSrc/net/aoba/altmanager/XboxLiveToken.java new file mode 100644 index 00000000..6cb29845 --- /dev/null +++ b/remappedSrc/net/aoba/altmanager/XboxLiveToken.java @@ -0,0 +1,56 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * A class to represent an Xbox Live Token. + */ +package net.aoba.altmanager; + +public class XboxLiveToken { + private final String token; + private final String hash; + + /** + * Constructor for an Xbox Live Token + * @param token + * @param uhs + */ + public XboxLiveToken(String token, String uhs) + { + this.token = token; + this.hash = uhs; + } + + /** + * Returns the token of the Xbox Live Token. + * @return The token of the Xbox Live Token. + */ + public String getToken() + { + return token; + } + + /** + * Returns the hash of the Xbox Live Token. + * @return The hash of the Xbox Live Token. + */ + public String getHash() + { + return hash; + } +} diff --git a/remappedSrc/net/aoba/altmanager/exceptions/APIDownException.java b/remappedSrc/net/aoba/altmanager/exceptions/APIDownException.java new file mode 100644 index 00000000..c17f070d --- /dev/null +++ b/remappedSrc/net/aoba/altmanager/exceptions/APIDownException.java @@ -0,0 +1,23 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.altmanager.exceptions; + +public class APIDownException extends Exception { + private static final long serialVersionUID = -3514931511912106574L; +} diff --git a/remappedSrc/net/aoba/altmanager/exceptions/APIErrorException.java b/remappedSrc/net/aoba/altmanager/exceptions/APIErrorException.java new file mode 100644 index 00000000..2b86d414 --- /dev/null +++ b/remappedSrc/net/aoba/altmanager/exceptions/APIErrorException.java @@ -0,0 +1,43 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.altmanager.exceptions; + +public class APIErrorException extends Exception { + + private static final long serialVersionUID = -1133030777452596952L; + private final String errorMessage; + + /** + * Constructor for APIErrorException + * @param errorMessage + */ + public APIErrorException(final String errorMessage) { + super(errorMessage); + this.errorMessage = errorMessage; + } + + /** + * Returns the error message. + * @return The error message. + */ + public final String getErrorMessage() { + return this.errorMessage; + } + +} diff --git a/remappedSrc/net/aoba/altmanager/exceptions/InvalidResponseException.java b/remappedSrc/net/aoba/altmanager/exceptions/InvalidResponseException.java new file mode 100644 index 00000000..6f3d558b --- /dev/null +++ b/remappedSrc/net/aoba/altmanager/exceptions/InvalidResponseException.java @@ -0,0 +1,41 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.altmanager.exceptions; + +public class InvalidResponseException extends Exception { + private static final long serialVersionUID = -4593254916052579608L; + private final String response; + + /** + * Constructor for InvalidResponseException + * @param response The response from the server. + */ + public InvalidResponseException(final String response) { + super(response); + this.response = response; + } + + /** + * Returns the Response held in this exception. + * @return Response + */ + public String getResponse() { + return this.response; + } +} diff --git a/remappedSrc/net/aoba/altmanager/exceptions/InvalidTokenException.java b/remappedSrc/net/aoba/altmanager/exceptions/InvalidTokenException.java new file mode 100644 index 00000000..c9f98742 --- /dev/null +++ b/remappedSrc/net/aoba/altmanager/exceptions/InvalidTokenException.java @@ -0,0 +1,23 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.altmanager.exceptions; + +public class InvalidTokenException extends Exception { + private static final long serialVersionUID = -264097897271382356L; +} diff --git a/remappedSrc/net/aoba/cmd/Command.java b/remappedSrc/net/aoba/cmd/Command.java new file mode 100644 index 00000000..ee8ac3df --- /dev/null +++ b/remappedSrc/net/aoba/cmd/Command.java @@ -0,0 +1,77 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * A class to represent a Command + */ +package net.aoba.cmd; + +import java.util.Objects; + +import net.aoba.AobaClient; +import net.minecraft.client.MinecraftClient; + +public abstract class Command { + protected final String name; + protected final String description; + protected final String syntax; + + protected static final MinecraftClient mc = AobaClient.MC; + + public Command(String name, String description, String syntax) { + this.name = Objects.requireNonNull(name); + this.description = Objects.requireNonNull(description); + this.syntax = Objects.requireNonNull(syntax); + } + + /** + * Gets the name of the command. + * @return The name of the command. + */ + public String getName() { + return this.name; + } + + /** + * Gets the description of the command. + * @return The description of the command. + */ + public String getDescription() { + return this.description; + } + + /** + * Gets the syntax of the command. + * @return The syntax of the command. + */ + public String getSyntax() { + return this.syntax; + } + + /** + * Runs the intended action of the command. + * @param parameters The parameters being passed. + */ + public abstract void runCommand(String[] parameters) throws InvalidSyntaxException; + + /** + * Gets the next Autocorrect suggestions given the last typed parameter. + * @param previousParameter + */ + public abstract String[] getAutocorrect(String previousParameter); +} diff --git a/remappedSrc/net/aoba/cmd/CommandException.java b/remappedSrc/net/aoba/cmd/CommandException.java new file mode 100644 index 00000000..9b3713a3 --- /dev/null +++ b/remappedSrc/net/aoba/cmd/CommandException.java @@ -0,0 +1,30 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd; + +public abstract class CommandException extends Exception{ + private static final long serialVersionUID = 1L; + protected Command cmd; + + public CommandException(Command cmd) { + this.cmd = cmd; + } + + public abstract void PrintToChat(); +} diff --git a/remappedSrc/net/aoba/cmd/CommandManager.java b/remappedSrc/net/aoba/cmd/CommandManager.java new file mode 100644 index 00000000..aeedfeb5 --- /dev/null +++ b/remappedSrc/net/aoba/cmd/CommandManager.java @@ -0,0 +1,162 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * A class to represent a system to manage Commands. + */ +package net.aoba.cmd; + +import java.lang.reflect.Field; +import java.util.HashMap; +import net.aoba.Aoba; +import net.aoba.cmd.commands.*; +import net.aoba.settings.SettingManager; +import net.aoba.settings.types.StringSetting; +import net.minecraft.client.MinecraftClient; +import net.minecraft.text.Text; +import net.minecraft.util.Formatting; + +public class CommandManager { + private HashMap commands = new HashMap(); + + public final CmdAimbot aimbot = new CmdAimbot(); + public final CmdAutoEat autoeat = new CmdAutoEat(); + public final CmdChestESP chestesp = new CmdChestESP(); + public final CmdClickgui clickgui = new CmdClickgui(); + public final CmdEntityESP entityesp = new CmdEntityESP(); + public final CmdFastBreak fastbreak = new CmdFastBreak(); + public final CmdFly fly = new CmdFly(); + public final CmdFreecam freecam = new CmdFreecam(); + public final CmdFont font = new CmdFont(); + public final CmdFullbright fullbright = new CmdFullbright(); + public final CmdHelp help = new CmdHelp(); + public final CmdHud hud = new CmdHud(); + public final CmdItemESP itemesp = new CmdItemESP(); + public final CmdNoclip noclip = new CmdNoclip(); + public final CmdNoFall nofall = new CmdNoFall(); + public final CmdNoSlowdown noslowdown = new CmdNoSlowdown(); + public final CmdNuker nuker = new CmdNuker(); + public final CmdPlayerESP playeresp = new CmdPlayerESP(); + public final CmdPOV pov = new CmdPOV(); + public final CmdReach reach = new CmdReach(); + public final CmdSpam spam = new CmdSpam(); + public final CmdSprint sprint = new CmdSprint(); + public final CmdStep step = new CmdStep(); + public final CmdTileBreaker tilebreaker = new CmdTileBreaker(); + public final CmdTimer timer = new CmdTimer(); + public final CmdTP tp = new CmdTP(); + public final CmdTracer tracer = new CmdTracer(); + public final CmdXRay xray = new CmdXRay(); + + public static StringSetting PREFIX; + + /** + * Constructor for Command Manager. Initializes all commands. + */ + public CommandManager() { + + PREFIX = new StringSetting("Prefix", "Prefix", ".aoba"); + + SettingManager.registerSetting(PREFIX, Aoba.getInstance().settingManager.hidden_category); + + try + { + for(Field field : CommandManager.class.getDeclaredFields()) + { + if (!Command.class.isAssignableFrom(field.getType())) + continue; + Command cmd = (Command)field.get(this); + commands.put(cmd.getName(), cmd); + } + }catch(Exception e) + { + System.out.println("Error initializing Aoba commands."); + System.out.println(e.getStackTrace().toString()); + } + } + + /** + * Gets the command by a given syntax. + * + * @param string The syntax (command) as a string. + * @return The Command Object associated with that syntax. + */ + public Command getCommandBySyntax(String string) { + return this.commands.get(string); + } + + /** + * Gets all of the Commands currently registered. + * + * @return List of registered Command Objects. + */ + public HashMap getCommands() { + return this.commands; + } + + /** + * Gets the total number of Commands. + * @return The number of registered Commands. + */ + public int getNumOfCommands() { + return this.commands.size(); + } + + /** + * Runs a command. + * @param commandIn A list of Command Parameters given by a "split" message. + */ + public void command(String[] commandIn) { + try { + + // Get the command from the user's message. (Index 0 is Username) + Command command = commands.get(commandIn[1]); + + // If the command does not exist, throw an error. + if (command == null) + sendChatMessage("Invalid Command! Type " + Formatting.LIGHT_PURPLE + ".aoba help" + Formatting.RESET + " for a list of commands."); + else { + // Otherwise, create a new parameter list. + String[] parameterList = new String[commandIn.length - 2]; + if (commandIn.length > 1) { + for (int i = 2; i < commandIn.length; i++) { + parameterList[i - 2] = commandIn[i]; + } + } + + // Runs the command. + command.runCommand(parameterList); + } + } catch(ArrayIndexOutOfBoundsException e) { + sendChatMessage("Invalid Command! Type " + Formatting.LIGHT_PURPLE + ".aoba help" + Formatting.RESET + " for a list of commands."); + } catch (InvalidSyntaxException e) { + e.PrintToChat(); + } + } + + /** + * Prints a message into the Minecraft Chat. + * @param message The message to be printed. + */ + public static void sendChatMessage(String message) { + MinecraftClient mc = MinecraftClient.getInstance(); + if(mc.inGameHud != null) { + mc.inGameHud.getChatHud().addMessage(Text.of(Formatting.DARK_PURPLE + "[" + Formatting.LIGHT_PURPLE + "Aoba" + Formatting.DARK_PURPLE + "] " + Formatting.RESET + message)); + } + } +} diff --git a/remappedSrc/net/aoba/cmd/GlobalChat.java b/remappedSrc/net/aoba/cmd/GlobalChat.java new file mode 100644 index 00000000..f0b9994f --- /dev/null +++ b/remappedSrc/net/aoba/cmd/GlobalChat.java @@ -0,0 +1,186 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.net.Socket; +import java.util.List; +import com.google.common.collect.Lists; +import com.google.gson.Gson; +import net.aoba.Aoba; +import net.aoba.settings.SettingManager; +import net.aoba.settings.types.BooleanSetting; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.hud.ChatHudLine; +import net.minecraft.client.gui.hud.MessageIndicator; +import net.minecraft.text.Text; + +public class GlobalChat { + + public enum ChatType{ + Minecraft, + Global + } + + public static ChatType chatType = ChatType.Minecraft; + + public final List messages = Lists.newArrayList(); + + private Gson gson; + private Socket socket; + private Thread chatSocketListenerThread; + private PrintWriter out; + private BufferedReader in; + private boolean started = false; + + private BooleanSetting enabled; + + public GlobalChat() { + gson = new Gson(); + enabled = new BooleanSetting("global_chat_enabled", "Whether or not global chat is enabled or disabled.", true); + SettingManager.registerSetting(this.enabled, Aoba.getInstance().settingManager.modules_category); + } + + private void Send(String json) { + if(out != null) { + out.print(json); + out.flush(); + } + } + + public void SendMessage(String message) { + Send(gson.toJson(new MessageAction(message, null))); + } + + private void SendChatMessage(String message) { + MinecraftClient MC = MinecraftClient.getInstance(); + if(MC != null && MC.inGameHud != null) { + this.messages.add(0, new ChatHudLine.Visible(MC.inGameHud.getTicks(), Text.of(message).asOrderedText(), MessageIndicator.system(), false)); + + } + } + + + public void StartListener() { + if(started) { + System.out.println("Socket listener already started."); + return; + } + + try { + started = true; + + chatSocketListenerThread = new Thread(new Runnable() { + @Override + public void run() { + try { + // Gotta love AWS! + socket = new Socket("18.221.222.43", 80); + out = new PrintWriter(socket.getOutputStream(), false); + in = new BufferedReader(new InputStreamReader(socket.getInputStream())); + + // Send the connection action to the server. + Send(gson.toJson(new ConnectAction(MinecraftClient.getInstance().getSession().getUsername()))); + + String json = in.readLine(); + while(json != null && MinecraftClient.getInstance() != null) { + MessageResponse response = new Gson().fromJson(json, MessageResponse.class); + if(response != null) { + String user = response.getUser(); + String chatMessage = response.getMessage(); + if(user != null && chatMessage != null) { + SendChatMessage(String.format("<%s> %s", user, chatMessage)); + } + } + json = in.readLine(); + } + + out.close(); + in.close(); + socket.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + chatSocketListenerThread.start(); + }catch(Exception e) { + e.printStackTrace(); + } + } + + public void RemoveListener() { + Send(gson.toJson(new GenericAction("disconnect"))); + } +} + +/** + * Defines classes that will be parsed to Json and passed to the chat server. + */ +class GenericAction{ + public String action; + public GenericAction(String action) { this.action = action; } +} + +class ConnectAction extends GenericAction { + public String username; + public ConnectAction(String username) { + super("connect"); + this.username = username; + } +} + +class MessageAction extends GenericAction{ + public String message; + public String to; + public MessageAction(String message, String to) { + super("message"); + this.message = message; + this.to = to; + } +} + +/** + * Server Response + */ +class MessageResponse { + private String message; + private String user; + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getUser() { + return user; + } + + public void setUser(String user) { + this.user = user; + } +} + + + diff --git a/remappedSrc/net/aoba/cmd/InvalidSyntaxException.java b/remappedSrc/net/aoba/cmd/InvalidSyntaxException.java new file mode 100644 index 00000000..8dc4e9c4 --- /dev/null +++ b/remappedSrc/net/aoba/cmd/InvalidSyntaxException.java @@ -0,0 +1,37 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * A class to represent an exception thrown when a command is typed with invalid syntax. + */ +package net.aoba.cmd; + +import net.minecraft.util.Formatting; + +public class InvalidSyntaxException extends CommandException { + private static final long serialVersionUID = 1L; + + public InvalidSyntaxException(Command cmd) { + super(cmd); + } + + @Override + public void PrintToChat() { + CommandManager.sendChatMessage("Invalid Usage! Usage: " + Formatting.LIGHT_PURPLE + ".aoba " + cmd.getName() + " " + cmd.getSyntax() + Formatting.RESET); + } +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdAimbot.java b/remappedSrc/net/aoba/cmd/commands/CmdAimbot.java new file mode 100644 index 00000000..ec61fc59 --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdAimbot.java @@ -0,0 +1,67 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.aoba.module.modules.combat.Aimbot; + +public class CmdAimbot extends Command { + + public CmdAimbot() { + super("aimbot", "Allows the player to see chest locations through ESP", "[toggle/mode] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + Aimbot module = (Aimbot) Aoba.getInstance().moduleManager.aimbot; + + switch (parameters[0]) { + case "toggle": + String state = parameters[1].toLowerCase(); + if (state.equals("on")) { + module.setState(true); + CommandManager.sendChatMessage("Aimbot toggled ON"); + } else if (state.equals("off")) { + module.setState(false); + CommandManager.sendChatMessage("Aimbot toggled OFF"); + } else { + CommandManager.sendChatMessage("Invalid value. [ON/OFF]"); + } + break; + default: + throw new InvalidSyntaxException(this); + } + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + default: + return new String[] { "toggle" }; + } + } +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdAutoEat.java b/remappedSrc/net/aoba/cmd/commands/CmdAutoEat.java new file mode 100644 index 00000000..3666aea2 --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdAutoEat.java @@ -0,0 +1,78 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.aoba.module.modules.misc.AutoEat; + +public class CmdAutoEat extends Command { + + public CmdAutoEat() { + super("autoeat", "Automatically eats when the player is hungry.", "[toggle/set] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + AutoEat module = (AutoEat) Aoba.getInstance().moduleManager.autoeat; + + switch (parameters[0]) { + case "toggle": + String state = parameters[1].toLowerCase(); + if (state.equals("on")) { + module.setState(true); + CommandManager.sendChatMessage("AutoEat toggled ON"); + } else if (state.equals("off")) { + module.setState(false); + CommandManager.sendChatMessage("AutoEat toggled OFF"); + } else { + CommandManager.sendChatMessage("Invalid value. [ON/OFF]"); + } + break; + case "set": + String setting = parameters[1].toLowerCase(); + if (setting.isEmpty()) { + CommandManager.sendChatMessage("Please enter the number of hearts to set to."); + } else { + module.setHunger((int) Math.min(Double.parseDouble(setting) * 2, 20)); + CommandManager.sendChatMessage("AutoEat hunger set to " + setting + " hearts."); + } + break; + default: + throw new InvalidSyntaxException(this); + } + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + case "set": + return new String[] { "1", "2", "4", "6", "8" }; + default: + return new String[] { "toggle", "set" }; + } + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/cmd/commands/CmdChestESP.java b/remappedSrc/net/aoba/cmd/commands/CmdChestESP.java new file mode 100644 index 00000000..e8058007 --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdChestESP.java @@ -0,0 +1,67 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.aoba.module.modules.render.ChestESP; + +public class CmdChestESP extends Command { + + public CmdChestESP() { + super("chestesp", "Allows the player to see chest locations through ESP", "[toggle] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + ChestESP module = (ChestESP) Aoba.getInstance().moduleManager.chestesp; + + switch (parameters[0]) { + case "toggle": + String state = parameters[1].toLowerCase(); + if (state.equals("on")) { + module.setState(true); + CommandManager.sendChatMessage("ChestESP toggled ON"); + } else if (state.equals("off")) { + module.setState(false); + CommandManager.sendChatMessage("ChestESP toggled OFF"); + } else { + CommandManager.sendChatMessage("Invalid value. [ON/OFF]"); + } + break; + default: + throw new InvalidSyntaxException(this); + } + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + default: + return new String[] { "toggle" }; + } + } +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdClickgui.java b/remappedSrc/net/aoba/cmd/commands/CmdClickgui.java new file mode 100644 index 00000000..81a94e24 --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdClickgui.java @@ -0,0 +1,56 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.InvalidSyntaxException; +import net.minecraft.client.util.InputUtil; + +public class CmdClickgui extends Command { + + public CmdClickgui() { + super("clickgui", "Allows the player to see chest locations through ESP", "[set/open] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + switch (parameters[0]) { + case "set": + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + char keybind = Character.toUpperCase(parameters[1].charAt(0)); + Aoba.getInstance().hudManager.clickGuiButton.setValue(InputUtil.fromKeyCode(keybind, 0)); + break; + case "open": + Aoba.getInstance().hudManager.setClickGuiOpen(true); + break; + default: + throw new InvalidSyntaxException(this); + } + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + default: + return new String[] { "set", "open" }; + } + } +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdEntityESP.java b/remappedSrc/net/aoba/cmd/commands/CmdEntityESP.java new file mode 100644 index 00000000..3ca1d704 --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdEntityESP.java @@ -0,0 +1,67 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.aoba.module.modules.render.EntityESP; + +public class CmdEntityESP extends Command { + + public CmdEntityESP() { + super("entityesp", "Allows the player to see mobs through ESP.", "[toggle] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + EntityESP module = (EntityESP) Aoba.getInstance().moduleManager.entityesp; + + switch (parameters[0]) { + case "toggle": + String state = parameters[1].toLowerCase(); + if (state.equals("on")) { + module.setState(true); + CommandManager.sendChatMessage("EntityESP toggled ON"); + } else if (state.equals("off")) { + module.setState(false); + CommandManager.sendChatMessage("EntityESP toggled OFF"); + } else { + CommandManager.sendChatMessage("Invalid value. [ON/OFF]"); + } + break; + default: + throw new InvalidSyntaxException(this); + } + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + default: + return new String[] { "toggle" }; + } + } +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdFastBreak.java b/remappedSrc/net/aoba/cmd/commands/CmdFastBreak.java new file mode 100644 index 00000000..3baf3851 --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdFastBreak.java @@ -0,0 +1,79 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.aoba.module.modules.misc.FastBreak; + +public class CmdFastBreak extends Command { + + public CmdFastBreak() { + super("fastbreak", "Decreases the time it takes to break blocks", "[multiplier, toggle] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + FastBreak module = (FastBreak) Aoba.getInstance().moduleManager.fastbreak; + switch (parameters[0]) { + case "multiplier": + try { + float multiplier = Float.parseFloat(parameters[1]); + module.setMultiplier(multiplier); + module.toggle(); + CommandManager.sendChatMessage("FastBreak multiplier set to " + multiplier + "x"); + module.toggle(); + } catch (Exception e) { + CommandManager.sendChatMessage("Invalid value."); + } + break; + case "toggle": + String state = parameters[1].toLowerCase(); + if (state.equals("on")) { + module.setState(true); + CommandManager.sendChatMessage("FastBreak toggled ON"); + } else if (state.equals("off")) { + module.setState(false); + CommandManager.sendChatMessage("FastBreak toggled OFF"); + } else { + CommandManager.sendChatMessage("Invalid value. [ON/OFF]"); + } + break; + default: + throw new InvalidSyntaxException(this); + } + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + case "multiplier": + return new String[] { "0.5", "1.0", "1.15", "1.25", "1.5", "2.0" }; + default: + return new String[] { "toggle", "multiplier" }; + } + } +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdFly.java b/remappedSrc/net/aoba/cmd/commands/CmdFly.java new file mode 100644 index 00000000..f5669f23 --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdFly.java @@ -0,0 +1,78 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.aoba.module.modules.movement.Fly; + +public class CmdFly extends Command { + + public CmdFly() { + super("fly", "Allows the player to fly", "[speed, toggle] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + Fly module = (Fly) Aoba.getInstance().moduleManager.fly; + switch (parameters[0]) { + case "speed": + try { + float speed = Float.parseFloat(parameters[1]); + module.setSpeed(speed); + CommandManager.sendChatMessage("Flight speed set to " + speed); + + } catch (Exception e) { + CommandManager.sendChatMessage("Invalid value."); + } + break; + case "toggle": + String state = parameters[1].toLowerCase(); + if (state.equals("on")) { + module.setState(true); + CommandManager.sendChatMessage("Fly toggled ON"); + } else if (state.equals("off")) { + module.setState(false); + CommandManager.sendChatMessage("Fly toggled OFF"); + } else { + CommandManager.sendChatMessage("Invalid value. [ON/OFF]"); + } + break; + default: + throw new InvalidSyntaxException(this); + } + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + case "speed": + return new String[] { "0.0", "1.0", "5.0", "10.0" }; + default: + return new String[] { "speed", "toggle" }; + } + } +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdFont.java b/remappedSrc/net/aoba/cmd/commands/CmdFont.java new file mode 100644 index 00000000..1a0f24e7 --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdFont.java @@ -0,0 +1,57 @@ +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.AobaClient; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.minecraft.client.font.TextRenderer; + +public class CmdFont extends Command { + + public CmdFont() { + super("font", "Sets the HUD font.", "[set] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + AobaClient aoba = Aoba.getInstance(); + + switch (parameters[0]) { + case "set": + try { + String font = parameters[1]; + TextRenderer t = aoba.fontManager.fontRenderers.get(font); + if(t != null) { + aoba.fontManager.SetRenderer(t); + } + } catch (Exception e) { + CommandManager.sendChatMessage("Invalid value."); + } + break; + default: + throw new InvalidSyntaxException(this); + } + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "set": + AobaClient aoba = Aoba.getInstance(); + + String[] suggestions = new String[aoba.fontManager.fontRenderers.size()]; + + int i = 0; + for (String fontName : aoba.fontManager.fontRenderers.keySet()) + suggestions[i++] = fontName; + + return suggestions; + default: + return new String[] { "set" }; + } + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/cmd/commands/CmdFreecam.java b/remappedSrc/net/aoba/cmd/commands/CmdFreecam.java new file mode 100644 index 00000000..87c879e8 --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdFreecam.java @@ -0,0 +1,68 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.aoba.module.modules.movement.Freecam; + +public class CmdFreecam extends Command { + + public CmdFreecam() { + super("freecam", "Disables fall damage for the player", "[toggle] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + Freecam module = (Freecam) Aoba.getInstance().moduleManager.freecam; + + switch (parameters[0]) { + case "toggle": + String state = parameters[1].toLowerCase(); + if (state.equals("on")) { + module.setState(true); + CommandManager.sendChatMessage("Freecam toggled ON"); + } else if (state.equals("off")) { + module.setState(false); + CommandManager.sendChatMessage("Freecam toggled OFF"); + } else { + CommandManager.sendChatMessage("Invalid value. [ON/OFF]"); + } + break; + default: + throw new InvalidSyntaxException(this); + } + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + default: + return new String[] { "toggle" }; + } + } + +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdFullbright.java b/remappedSrc/net/aoba/cmd/commands/CmdFullbright.java new file mode 100644 index 00000000..7269a8ee --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdFullbright.java @@ -0,0 +1,68 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.aoba.module.modules.render.Fullbright; + +public class CmdFullbright extends Command { + + public CmdFullbright() { + super("fullbright", "Brightens up the world!", "[toggle] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + Fullbright module = (Fullbright) Aoba.getInstance().moduleManager.fullbright; + + switch (parameters[0]) { + case "toggle": + String state = parameters[1].toLowerCase(); + if (state.equals("on")) { + module.setState(true); + CommandManager.sendChatMessage("Fullbright toggled ON"); + } else if (state.equals("off")) { + module.setState(false); + CommandManager.sendChatMessage("Fullbright toggled OFF"); + } else { + CommandManager.sendChatMessage("Invalid value. [ON/OFF]"); + } + break; + default: + throw new InvalidSyntaxException(this); + } + } + + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + default: + return new String[] { "toggle" }; + } + } +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdHelp.java b/remappedSrc/net/aoba/cmd/commands/CmdHelp.java new file mode 100644 index 00000000..c8e0e07e --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdHelp.java @@ -0,0 +1,96 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Set; + +import net.minecraft.util.Formatting; +import org.apache.commons.lang3.StringUtils; +import net.aoba.module.Module; +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; + +public class CmdHelp extends Command { + + int indexesPerPage = 5; + + public CmdHelp() { + super("help", "Shows the avaiable commands.", "[page, module]"); + } + + @Override + public void runCommand(String[] parameters) { + if (parameters.length <= 0) { + ShowCommands(1); + } else if (StringUtils.isNumeric(parameters[0])) { + int page = Integer.parseInt(parameters[0]); + ShowCommands(page); + } else { + Module module = Aoba.getInstance().moduleManager.getModuleByName(parameters[0]); + if (module == null) { + CommandManager.sendChatMessage("Could not find Module '" + parameters[0] + "'."); + } else { + String title = "------------ " + Formatting.LIGHT_PURPLE + module.getName() + " Help" + Formatting.RESET + " ------------"; + String unformatted_title = "------------ " + module.getName() + " Help ------------"; + CommandManager.sendChatMessage(title); + CommandManager.sendChatMessage("Name: " + Formatting.LIGHT_PURPLE + module.getName() + Formatting.RESET); + CommandManager.sendChatMessage("Description: " + Formatting.LIGHT_PURPLE + module.getDescription() + Formatting.RESET); + CommandManager.sendChatMessage("Keybind: " + Formatting.LIGHT_PURPLE + module.getBind().getValue().getTranslationKey() + Formatting.RESET); + CommandManager.sendChatMessage("-".repeat(unformatted_title.length() - 2)); // mc font characters are not the same width but eh.. + } + } + + } + + private void ShowCommands(int page) { + String title = "------------ Help [Page " + page + " of 5] ------------"; // TODO: remove hardcoded page length + CommandManager.sendChatMessage(title); + CommandManager.sendChatMessage("Use " + Formatting.LIGHT_PURPLE + ".aoba help [n]" + Formatting.RESET + " to get page n of help."); + + // Fetch the commands and dislays their syntax on the screen. + HashMap commands = Aoba.getInstance().commandManager.getCommands(); + Set keySet = commands.keySet(); + ArrayList listOfCommands = new ArrayList(keySet); + + for (int i = (page - 1) * indexesPerPage; i <= (page * indexesPerPage); i++) { + if (i >= 0 && i < Aoba.getInstance().commandManager.getNumOfCommands()) { + CommandManager.sendChatMessage(" .aoba " + listOfCommands.get(i)); + } + } + CommandManager.sendChatMessage("-".repeat(title.length() - 2)); // mc font characters are not the same width but eh.. + } + + @Override + public String[] getAutocorrect(String previousParameter) { + CommandManager cm = Aoba.getInstance().commandManager; + int numCmds = cm.getNumOfCommands(); + String[] commands = new String[numCmds]; + + Set cmds = Aoba.getInstance().commandManager.getCommands().keySet(); + int i = 0; + for (String x : cmds) + commands[i++] = x; + + return commands; + } + +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdHud.java b/remappedSrc/net/aoba/cmd/commands/CmdHud.java new file mode 100644 index 00000000..d7a58195 --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdHud.java @@ -0,0 +1,50 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.cmd.Command; +import net.aoba.cmd.InvalidSyntaxException; + +public class CmdHud extends Command { + + public CmdHud() { + super("hud", "Allows you to customize the hud using commands.", "[toggle] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + switch (parameters[0]) { + default: + throw new InvalidSyntaxException(this); + } + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + default: + return new String[] { "toggle" }; + } + } +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdItemESP.java b/remappedSrc/net/aoba/cmd/commands/CmdItemESP.java new file mode 100644 index 00000000..00605297 --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdItemESP.java @@ -0,0 +1,67 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.aoba.module.modules.render.ItemESP; + +public class CmdItemESP extends Command { + + public CmdItemESP() { + super("itemesp", "Allows the player to see items through walls.", "[toggle] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + ItemESP module = (ItemESP) Aoba.getInstance().moduleManager.itemesp; + + switch (parameters[0]) { + case "toggle": + String state = parameters[1].toLowerCase(); + if (state.equals("on")) { + module.setState(true); + CommandManager.sendChatMessage("ItemESP toggled ON"); + } else if (state.equals("off")) { + module.setState(false); + CommandManager.sendChatMessage("ItemESP toggled OFF"); + } else { + CommandManager.sendChatMessage("Invalid value. [ON/OFF]"); + } + break; + default: + throw new InvalidSyntaxException(this); + } + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + default: + return new String[] { "toggle" }; + } + } +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdNoFall.java b/remappedSrc/net/aoba/cmd/commands/CmdNoFall.java new file mode 100644 index 00000000..c10e9af4 --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdNoFall.java @@ -0,0 +1,67 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.aoba.module.modules.movement.NoFall; + +public class CmdNoFall extends Command { + + public CmdNoFall() { + super("nofall", "Disables fall damage for the player", "[toggle] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + NoFall module = (NoFall) Aoba.getInstance().moduleManager.nofall; + + switch (parameters[0]) { + case "toggle": + String state = parameters[1].toLowerCase(); + if (state.equals("on")) { + module.setState(true); + CommandManager.sendChatMessage("NoFall toggled ON"); + } else if (state.equals("off")) { + module.setState(false); + CommandManager.sendChatMessage("NoFall toggled OFF"); + } else { + CommandManager.sendChatMessage("Invalid value. [ON/OFF]"); + } + break; + default: + throw new InvalidSyntaxException(this); + } + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + default: + return new String[] { "toggle" }; + } + } +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdNoSlowdown.java b/remappedSrc/net/aoba/cmd/commands/CmdNoSlowdown.java new file mode 100644 index 00000000..2f3159ac --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdNoSlowdown.java @@ -0,0 +1,68 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.aoba.module.modules.movement.NoSlowdown; + +public class CmdNoSlowdown extends Command { + + public CmdNoSlowdown() { + super("noslowdown", "Disables webs from slowing the player down", "[toggle] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + NoSlowdown module = (NoSlowdown) Aoba.getInstance().moduleManager.noslowdown; + + switch (parameters[0]) { + case "toggle": + String state = parameters[1].toLowerCase(); + if (state.equals("on")) { + module.setState(true); + CommandManager.sendChatMessage("NoSlowDown toggled ON"); + } else if (state.equals("off")) { + module.setState(false); + CommandManager.sendChatMessage("NoSlowDown toggled OFF"); + } else { + CommandManager.sendChatMessage("Invalid value. [ON/OFF]"); + } + break; + default: + throw new InvalidSyntaxException(this); + } + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + default: + return new String[] { "toggle" }; + } + } + +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdNoclip.java b/remappedSrc/net/aoba/cmd/commands/CmdNoclip.java new file mode 100644 index 00000000..5de52299 --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdNoclip.java @@ -0,0 +1,81 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.aoba.module.modules.movement.Noclip; + +public class CmdNoclip extends Command { + + public CmdNoclip() { + super("noclip", "Allows the player to phase through blocks.", "[toggle/speed] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + Noclip module = (Noclip) Aoba.getInstance().moduleManager.noclip; + + switch (parameters[0]) { + case "speed": + try { + float speed = Float.parseFloat(parameters[1]); + module.setSpeed(speed); + CommandManager.sendChatMessage("Flight speed set to " + speed); + + } catch (Exception e) { + CommandManager.sendChatMessage("Invalid value."); + } + break; + case "toggle": + String state = parameters[1].toLowerCase(); + if (state.equals("on")) { + module.setState(true); + CommandManager.sendChatMessage("Noclip toggled ON"); + } else if (state.equals("off")) { + module.setState(false); + CommandManager.sendChatMessage("Noclip toggled OFF"); + } else { + CommandManager.sendChatMessage("Invalid value. [ON/OFF]"); + } + break; + default: + throw new InvalidSyntaxException(this); + } + + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + case "speed": + return new String[] { "0.0", "1.0", "5.0", "10.0" }; + default: + return new String[] { "toggle" }; + } + } + +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdNuker.java b/remappedSrc/net/aoba/cmd/commands/CmdNuker.java new file mode 100644 index 00000000..8786b53b --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdNuker.java @@ -0,0 +1,84 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.aoba.module.modules.world.Nuker; + +public class CmdNuker extends Command { + + public CmdNuker() { + super("nuker", "Destroys blocks within a certain distance of the player.", "[radius, toggle] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + Nuker module = (Nuker) Aoba.getInstance().moduleManager.nuker; + + switch (parameters[0]) { + case "radius": + try { + int radius = Integer.parseInt(parameters[1]); + if (radius > 10) { + radius = 10; + } else if (radius < 1) { + radius = 1; + } + module.setRadius(radius); + CommandManager.sendChatMessage("Nuker radius set to " + radius); + + } catch (Exception e) { + CommandManager.sendChatMessage("Invalid value. [1-10]"); + } + break; + case "toggle": + String state = parameters[1].toLowerCase(); + if (state.equals("on")) { + module.setState(true); + CommandManager.sendChatMessage("Nuker toggled ON"); + } else if (state.equals("off")) { + module.setState(false); + CommandManager.sendChatMessage("Nuker toggled OFF"); + } else { + CommandManager.sendChatMessage("Invalid value. [ON/OFF]"); + } + break; + default: + throw new InvalidSyntaxException(this); + } + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + case "radius": + return new String[] { "1.0", "2.0", "5.0", "10.0" }; + default: + return new String[] { "toggle" }; + } + } +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdPOV.java b/remappedSrc/net/aoba/cmd/commands/CmdPOV.java new file mode 100644 index 00000000..22f32d34 --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdPOV.java @@ -0,0 +1,88 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import java.util.List; +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.aoba.module.modules.render.POV; +import net.minecraft.client.network.AbstractClientPlayerEntity; + +public class CmdPOV extends Command { + + public CmdPOV() { + super("pov", "Allows the player to see through someone else's POV.", "[set, toggle] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + POV module = (POV) Aoba.getInstance().moduleManager.pov; + + switch (parameters[0]) { + case "set": + try { + String player = parameters[1]; + CommandManager.sendChatMessage("Setting POV Player Name to " + player); + module.setEntityPOV(player); + } catch (Exception e) { + CommandManager.sendChatMessage("Invalid value."); + } + break; + case "toggle": + String state = parameters[1].toLowerCase(); + if (state.equals("on")) { + module.setState(true); + CommandManager.sendChatMessage("POV toggled ON"); + } else if (state.equals("off")) { + module.setState(false); + CommandManager.sendChatMessage("POV toggled OFF"); + } else { + CommandManager.sendChatMessage("Invalid value. [ON/OFF]"); + } + break; + default: + throw new InvalidSyntaxException(this); + } + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + case "set": + List players = mc.world.getPlayers(); + int numPlayers = players.size(); + String[] suggestions = new String[numPlayers]; + + int i = 0; + for (AbstractClientPlayerEntity x : players) + suggestions[i++] = x.getName().getString(); + + return suggestions; + default: + return new String[] { "toggle", "set" }; + } + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/cmd/commands/CmdPlayerESP.java b/remappedSrc/net/aoba/cmd/commands/CmdPlayerESP.java new file mode 100644 index 00000000..800849fd --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdPlayerESP.java @@ -0,0 +1,67 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.aoba.module.modules.render.PlayerESP; + +public class CmdPlayerESP extends Command { + + public CmdPlayerESP() { + super("playeresp", "Allows the player to see other players through walls.", "[toggle] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + PlayerESP module = (PlayerESP) Aoba.getInstance().moduleManager.playeresp; + + switch (parameters[0]) { + case "toggle": + String state = parameters[1].toLowerCase(); + if (state.equals("on")) { + module.setState(true); + CommandManager.sendChatMessage("PlayerESP toggled ON"); + } else if (state.equals("off")) { + module.setState(false); + CommandManager.sendChatMessage("PlayerESP toggled OFF"); + } else { + CommandManager.sendChatMessage("Invalid value. [ON/OFF]"); + } + break; + default: + throw new InvalidSyntaxException(this); + } + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + default: + return new String[] { "toggle" }; + } + } +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdReach.java b/remappedSrc/net/aoba/cmd/commands/CmdReach.java new file mode 100644 index 00000000..deb233e3 --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdReach.java @@ -0,0 +1,79 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.aoba.module.modules.combat.Reach; + +public class CmdReach extends Command { + + public CmdReach() { + super("reach", "Allows the player to reach further.", "[toggle/distance] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + Reach module = (Reach) Aoba.getInstance().moduleManager.reach; + + switch (parameters[0]) { + case "distance": + try { + float distance = Float.parseFloat(parameters[1]); + module.setReachLength(distance); + CommandManager.sendChatMessage("Reach distance set to " + distance); + + } catch (Exception e) { + CommandManager.sendChatMessage("Invalid value."); + } + break; + case "toggle": + String state = parameters[1].toLowerCase(); + if (state.equals("on")) { + module.setState(true); + CommandManager.sendChatMessage("Reach toggled ON"); + } else if (state.equals("off")) { + module.setState(false); + CommandManager.sendChatMessage("Reach toggled OFF"); + } else { + CommandManager.sendChatMessage("Invalid value. [ON/OFF]"); + } + break; + default: + throw new InvalidSyntaxException(this); + } + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + case "distance:": + return new String[] { "1.0", "2.0", "3.0", "4.0", "5.0", "6.0", "7.0", "8.0" }; + default: + return new String[] { "toggle" }; + } + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/cmd/commands/CmdSpam.java b/remappedSrc/net/aoba/cmd/commands/CmdSpam.java new file mode 100644 index 00000000..a1150f17 --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdSpam.java @@ -0,0 +1,55 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.cmd.Command; +import net.aoba.cmd.InvalidSyntaxException; + +public class CmdSpam extends Command { + + public CmdSpam() { + super("spam", "Spams the chat with a certain message.", "[times] [message]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length < 2) + throw new InvalidSyntaxException(this); + + // Combines the "parameters" into a string to be printed. + String message = ""; + for (int msg = 1; msg < parameters.length; msg++) { + message = message + parameters[msg] + " "; + } + + // Prints out that message X number of times. + for (int i = 0; i < Integer.parseInt(parameters[0]); i++) { + mc.player.networkHandler.sendChatMessage(message); + } + + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + default: + return new String[] { "Aoba is an amazing client!" }; + } + } +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdSprint.java b/remappedSrc/net/aoba/cmd/commands/CmdSprint.java new file mode 100644 index 00000000..5c30929d --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdSprint.java @@ -0,0 +1,68 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.aoba.module.modules.movement.Sprint; + +public class CmdSprint extends Command { + + public CmdSprint() { + super("sprint", "Forces the player to constantly sprint.", "[toggle] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + Sprint module = (Sprint) Aoba.getInstance().moduleManager.sprint; + + switch (parameters[0]) { + case "toggle": + String state = parameters[1].toLowerCase(); + if (state.equals("on")) { + module.setState(true); + CommandManager.sendChatMessage("Sprint toggled ON"); + } else if (state.equals("off")) { + module.setState(false); + CommandManager.sendChatMessage("Sprint toggled OFF"); + } else { + CommandManager.sendChatMessage("Invalid value. [ON/OFF]"); + } + break; + default: + throw new InvalidSyntaxException(this); + } + + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + default: + return new String[] { "toggle" }; + } + } +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdStep.java b/remappedSrc/net/aoba/cmd/commands/CmdStep.java new file mode 100644 index 00000000..725af585 --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdStep.java @@ -0,0 +1,79 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.aoba.module.modules.movement.Step; + +public class CmdStep extends Command { + + public CmdStep() { + super("step", "Allows the player to step up blocks", "[toggle/height] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + Step module = (Step) Aoba.getInstance().moduleManager.step; + + switch (parameters[0]) { + case "height": + try { + float height = Float.parseFloat(parameters[1]); + module.setStepHeight(height); + CommandManager.sendChatMessage("Step height set to " + height); + + } catch (Exception e) { + CommandManager.sendChatMessage("Invalid value."); + } + break; + case "toggle": + String state = parameters[1].toLowerCase(); + if (state.equals("on")) { + module.setState(true); + CommandManager.sendChatMessage("Step toggled ON"); + } else if (state.equals("off")) { + module.setState(false); + CommandManager.sendChatMessage("Step toggled OFF"); + } else { + CommandManager.sendChatMessage("Invalid value. [ON/OFF]"); + } + break; + default: + throw new InvalidSyntaxException(this); + } + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + case "height": + return new String[] { "0.5", "1.0", "1.5", "2.0", "5.0", "10.0" }; + default: + return new String[] { "toggle", "height" }; + } + } +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdTP.java b/remappedSrc/net/aoba/cmd/commands/CmdTP.java new file mode 100644 index 00000000..8a9ea20c --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdTP.java @@ -0,0 +1,42 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.cmd.Command; +import net.aoba.cmd.InvalidSyntaxException; + +public class CmdTP extends Command { + + public CmdTP() { + super("tp", "Teleports the player certain blocks away (Vanilla only)", "[x] [y] [z]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 3) + throw new InvalidSyntaxException(this); + + mc.player.setPosition(Double.parseDouble(parameters[0]), Double.parseDouble(parameters[1]), Double.parseDouble(parameters[2])); + } + + @Override + public String[] getAutocorrect(String previousParameter) { + return new String[] {"0 0 0"}; + } +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdTileBreaker.java b/remappedSrc/net/aoba/cmd/commands/CmdTileBreaker.java new file mode 100644 index 00000000..1f33f3f7 --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdTileBreaker.java @@ -0,0 +1,84 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.aoba.module.modules.world.TileBreaker; + +public class CmdTileBreaker extends Command { + + public CmdTileBreaker() { + super("tilebreaker", "Breaks insta-break blocks within a certain radius", "[radius, toggle] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + TileBreaker module = (TileBreaker) Aoba.getInstance().moduleManager.tilebreaker; + + switch (parameters[0]) { + case "radius": + try { + int radius = Integer.parseInt(parameters[1]); + if (radius > 10) { + radius = 10; + } else if (radius < 1) { + radius = 1; + } + module.setRadius(radius); + CommandManager.sendChatMessage("TileBreaker radius set to " + radius); + + } catch (Exception e) { + CommandManager.sendChatMessage("Invalid value. [1-10]"); + } + break; + case "toggle": + String state = parameters[1].toLowerCase(); + if (state.equals("on")) { + module.setState(true); + CommandManager.sendChatMessage("TileBreaker toggled ON"); + } else if (state.equals("off")) { + module.setState(false); + CommandManager.sendChatMessage("TileBreaker toggled OFF"); + } else { + CommandManager.sendChatMessage("Invalid value. [ON/OFF]"); + } + break; + default: + throw new InvalidSyntaxException(this); + } + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + case "radius": + return new String[] { "1.0", "2.0", "5.0", "10.0" }; + default: + return new String[] { "toggle", "radius" }; + } + } +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdTimer.java b/remappedSrc/net/aoba/cmd/commands/CmdTimer.java new file mode 100644 index 00000000..586f4a90 --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdTimer.java @@ -0,0 +1,82 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.aoba.module.modules.misc.Timer; + +public class CmdTimer extends Command { + + public CmdTimer() { + super("timer", "Speeds up the game.", "[toggle/multiplier] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + Timer module = (Timer) Aoba.getInstance().moduleManager.timer; + + switch (parameters[0]) { + case "toggle": + String state = parameters[1].toLowerCase(); + if (state.equals("on")) { + module.setState(true); + CommandManager.sendChatMessage("Timer toggled ON"); + } else if (state.equals("off")) { + module.setState(false); + CommandManager.sendChatMessage("Timer toggled OFF"); + } else { + CommandManager.sendChatMessage("Invalid value. [ON/OFF]"); + } + break; + case "multiplier": + try { + float param1 = Float.parseFloat(parameters[1]); + Timer timer = (Timer) Aoba.getInstance().moduleManager.timer; + timer.setMultipler(param1); + CommandManager.sendChatMessage("Timer multiplier set to " + param1); + + } catch (Exception e) { + CommandManager.sendChatMessage("Invalid value."); + } + break; + + default: + throw new InvalidSyntaxException(this); + } + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + case "multiplier": + return new String[] { "0.5", "1.0", "1.15", "1.25", "1.5", "2.0" }; + default: + return new String[] { "toggle", "multiplier" }; + } + } + +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/cmd/commands/CmdTracer.java b/remappedSrc/net/aoba/cmd/commands/CmdTracer.java new file mode 100644 index 00000000..b38923de --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdTracer.java @@ -0,0 +1,67 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.aoba.module.modules.render.Tracer; + +public class CmdTracer extends Command { + + public CmdTracer() { + super("tracer", "Draws a tracer that points towards players.", "[toggle] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + Tracer module = (Tracer) Aoba.getInstance().moduleManager.tracer; + + switch (parameters[0]) { + case "toggle": + String state = parameters[1].toLowerCase(); + if (state.equals("on")) { + module.setState(true); + CommandManager.sendChatMessage("Tracer toggled ON"); + } else if (state.equals("off")) { + module.setState(false); + CommandManager.sendChatMessage("Tracer toggled OFF"); + } else { + CommandManager.sendChatMessage("Invalid value. [ON/OFF]"); + } + break; + default: + throw new InvalidSyntaxException(this); + } + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + default: + return new String[] { "toggle" }; + } + } +} diff --git a/remappedSrc/net/aoba/cmd/commands/CmdXRay.java b/remappedSrc/net/aoba/cmd/commands/CmdXRay.java new file mode 100644 index 00000000..33558abe --- /dev/null +++ b/remappedSrc/net/aoba/cmd/commands/CmdXRay.java @@ -0,0 +1,122 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.cmd.commands; + +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.InvalidSyntaxException; +import net.aoba.module.modules.render.XRay; +import net.minecraft.block.Block; +import net.minecraft.registry.Registries; +import net.minecraft.util.Identifier; +import net.minecraft.util.InvalidIdentifierException; + +public class CmdXRay extends Command { + + public CmdXRay() { + super("xray", "Allows the player to see certain blocks through walls", "[toggle/block] [value]"); + } + + @Override + public void runCommand(String[] parameters) throws InvalidSyntaxException { + + XRay module = (XRay) Aoba.getInstance().moduleManager.xray; + + switch (parameters[0]) { + case "toggle": + if (parameters.length != 2) + throw new InvalidSyntaxException(this); + + String state = parameters[1].toLowerCase(); + if (state.equals("on")) { + module.setState(true); + CommandManager.sendChatMessage("XRay toggled ON"); + } else if (state.equals("off")) { + module.setState(false); + CommandManager.sendChatMessage("XRay toggled OFF"); + } else { + CommandManager.sendChatMessage("Invalid value. [ON/OFF]"); + } + break; + case "block": + if (parameters.length != 3) + throw new InvalidSyntaxException(this); + switch (parameters[1]) { + case "add": + String block1 = parameters[2].toLowerCase(); + Block tempBlock1; + try { + tempBlock1 = Registries.BLOCK.get(new Identifier(block1)); + } catch (InvalidIdentifierException e) { + CommandManager.sendChatMessage("Block " + parameters[2] + " could not be found."); + return; + } + + module.blocks.getValue().add(tempBlock1); + mc.worldRenderer.reload(); + break; + case "remove": + String block2 = parameters[2].toLowerCase(); + Block tempBlock2; + try { + tempBlock2 = Registries.BLOCK.get(new Identifier(block2)); + } catch (InvalidIdentifierException e) { + CommandManager.sendChatMessage("Block " + parameters[2] + " could not be found."); + return; + } + + module.blocks.getValue().remove(tempBlock2); + mc.worldRenderer.reload(); + break; + case "list": + String blockList = ""; + for (Block block : module.blocks.getValue()) { + blockList += block.getName().getString() + ", "; + } + blockList = blockList.substring(0, blockList.length() - 2); + CommandManager.sendChatMessage("Block List: " + blockList); + break; + } + break; + default: + throw new InvalidSyntaxException(this); + } + } + + @Override + public String[] getAutocorrect(String previousParameter) { + switch (previousParameter) { + case "toggle": + return new String[] { "on", "off" }; + case "block": + return new String[] { "add", "remove" }; + case "add": + String[] blockNames = new String[Registries.BLOCK.size()]; + for (int i = 0; i < Registries.BLOCK.size(); i++) { + blockNames[i] = Registries.BLOCK.get(i).getTranslationKey(); + } + return blockNames; + case "remove": + return new String[] { "xray", "delete" }; + default: + return new String[] { "toggle", "block" }; + } + } +} diff --git a/remappedSrc/net/aoba/event/EventManager.java b/remappedSrc/net/aoba/event/EventManager.java new file mode 100644 index 00000000..a033aff7 --- /dev/null +++ b/remappedSrc/net/aoba/event/EventManager.java @@ -0,0 +1,74 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import net.aoba.event.events.AbstractEvent; +import net.aoba.event.listeners.AbstractListener; + +public class EventManager { + + private final HashMap, ArrayList> listeners; + + public EventManager() { + listeners = new HashMap, ArrayList>(); + } + + @SuppressWarnings("unchecked") + public void AddListener(Class object, AbstractListener listener) { + try { + ArrayList listOfListeners = listeners.get(object); + if(listOfListeners == null) + { + listOfListeners = new ArrayList<>(Arrays.asList(listener)); + listeners.put((Class) object, listOfListeners); + }else { + listOfListeners.add(listener); + } + }catch(Exception e) { + System.out.println("Issue adding listener: " + object.getTypeName() + "..."); + e.printStackTrace(); + } + } + + public void RemoveListener(Class object, AbstractListener listener) { + try { + ArrayList listOfListeners = listeners.get(object); + if(listOfListeners != null) + { + listOfListeners.remove(listener); + } + }catch(Exception e) { + System.out.println("Issue removing listener: " + object.getTypeName() + "..."); + e.printStackTrace(); + } + } + + public void Fire(AbstractEvent event) { + ArrayList listOfListeners = listeners.get(event.GetListenerClassType()); + + if(listOfListeners == null) { + return; + } + + event.Fire(listOfListeners); + } +} diff --git a/remappedSrc/net/aoba/event/events/AbstractEvent.java b/remappedSrc/net/aoba/event/events/AbstractEvent.java new file mode 100644 index 00000000..07cb9a46 --- /dev/null +++ b/remappedSrc/net/aoba/event/events/AbstractEvent.java @@ -0,0 +1,42 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.events; + +import java.util.ArrayList; + +import net.aoba.event.listeners.AbstractListener; + +public abstract class AbstractEvent { + boolean isCancelled; + + public AbstractEvent() { + isCancelled = false; + } + + public boolean IsCancelled() { + return isCancelled; + } + + public void SetCancelled(boolean state) { + this.isCancelled = state; + } + + public abstract void Fire(ArrayList listeners); + public abstract Class GetListenerClassType(); +} diff --git a/remappedSrc/net/aoba/event/events/BlockStateEvent.java b/remappedSrc/net/aoba/event/events/BlockStateEvent.java new file mode 100644 index 00000000..8a0a28c0 --- /dev/null +++ b/remappedSrc/net/aoba/event/events/BlockStateEvent.java @@ -0,0 +1,46 @@ +package net.aoba.event.events; + +import java.util.ArrayList; +import java.util.List; +import net.aoba.event.listeners.AbstractListener; +import net.aoba.event.listeners.BlockStateListener; +import net.minecraft.block.BlockState; +import net.minecraft.util.math.BlockPos; + +public class BlockStateEvent extends AbstractEvent { + private BlockPos blockPos; + private BlockState blockState; + private BlockState previousBlockState; + + public BlockStateEvent(BlockPos blockPos, BlockState state, BlockState previousState) { + this.blockPos = blockPos; + this.blockState = state; + this.previousBlockState = previousState; + } + + public BlockPos getBlockPos() { + return this.blockPos; + } + + public BlockState getBlockState() { + return this.blockState; + } + + public BlockState getPreviousBlockState() { + return this.previousBlockState; + } + + @Override + public void Fire(ArrayList listeners) { + for(AbstractListener listener : List.copyOf(listeners)) { + BlockStateListener blockStateListener = (BlockStateListener) listener; + blockStateListener.OnBlockStateChanged(this); + } + } + + @SuppressWarnings("unchecked") + @Override + public Class GetListenerClassType() { + return BlockStateListener.class; + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/event/events/FontChangedEvent.java b/remappedSrc/net/aoba/event/events/FontChangedEvent.java new file mode 100644 index 00000000..2d081362 --- /dev/null +++ b/remappedSrc/net/aoba/event/events/FontChangedEvent.java @@ -0,0 +1,22 @@ +package net.aoba.event.events; + +import java.util.ArrayList; +import java.util.List; +import net.aoba.event.listeners.AbstractListener; +import net.aoba.event.listeners.FontChangedListener; + +public class FontChangedEvent extends AbstractEvent { + @Override + public void Fire(ArrayList listeners) { + for(AbstractListener listener : List.copyOf(listeners)) { + FontChangedListener fontChangeListener = (FontChangedListener) listener; + fontChangeListener.OnFontChanged(this); + } + } + + @SuppressWarnings("unchecked") + @Override + public Class GetListenerClassType() { + return FontChangedListener.class; + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/event/events/FoodLevelEvent.java b/remappedSrc/net/aoba/event/events/FoodLevelEvent.java new file mode 100644 index 00000000..877b8c23 --- /dev/null +++ b/remappedSrc/net/aoba/event/events/FoodLevelEvent.java @@ -0,0 +1,54 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.events; + +import java.util.ArrayList; +import java.util.List; + +import net.aoba.event.listeners.AbstractListener; +import net.aoba.event.listeners.FoodLevelListener; +import net.aoba.event.listeners.PlayerHealthListener; +import net.minecraft.entity.damage.DamageSource; + +public class FoodLevelEvent extends AbstractEvent { + private float foodLevel; + + public FoodLevelEvent(float foodLevel) { + this.foodLevel = foodLevel; + } + + public float getFoodLevel() { + return foodLevel; + } + + + @Override + public void Fire(ArrayList listeners) { + for(AbstractListener listener : List.copyOf(listeners)) { + FoodLevelListener foodLevelListener = (FoodLevelListener) listener; + foodLevelListener.OnFoodLevelChanged(this); + } + } + + @SuppressWarnings("unchecked") + @Override + public Class GetListenerClassType() { + return FoodLevelListener.class; + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/event/events/KeyDownEvent.java b/remappedSrc/net/aoba/event/events/KeyDownEvent.java new file mode 100644 index 00000000..4756692a --- /dev/null +++ b/remappedSrc/net/aoba/event/events/KeyDownEvent.java @@ -0,0 +1,75 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.events; + +import java.util.ArrayList; +import java.util.List; +import net.aoba.event.listeners.AbstractListener; +import net.aoba.event.listeners.KeyDownListener; + +public class KeyDownEvent extends AbstractEvent{ + private final long window; + private final int key; + private final int scancode; + private final int action; + private final int modifiers; + + public KeyDownEvent(long window, int key, int scancode, int action, int modifiers) { + super(); + this.window = window; + this.key = key; + this.scancode = scancode; + this.action = action; + this.modifiers = modifiers; + } + + public long GetWindow() { + return window; + } + + public int GetKey() { + return key; + } + + public int GetScanCode() { + return scancode; + } + + public int GetAction() { + return action; + } + + public int GetModifiers() { + return modifiers; + } + + @Override + public void Fire(ArrayList listeners) { + for(AbstractListener listener : List.copyOf(listeners)) { + KeyDownListener keyDownListener = (KeyDownListener) listener; + keyDownListener.OnKeyDown(this); + } + } + + @SuppressWarnings("unchecked") + @Override + public Class GetListenerClassType() { + return KeyDownListener.class; + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/event/events/LeftMouseDownEvent.java b/remappedSrc/net/aoba/event/events/LeftMouseDownEvent.java new file mode 100644 index 00000000..bab0bb39 --- /dev/null +++ b/remappedSrc/net/aoba/event/events/LeftMouseDownEvent.java @@ -0,0 +1,58 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.events; + +import java.util.ArrayList; +import java.util.List; +import net.aoba.event.listeners.AbstractListener; +import net.aoba.event.listeners.LeftMouseDownListener; + +public class LeftMouseDownEvent extends AbstractEvent{ + + double mouseX; + double mouseY; + + public LeftMouseDownEvent(double mouseX2, double mouseY2) { + super(); + this.mouseX = mouseX2; + this.mouseY = mouseY2; + } + + public double GetMouseX() { + return mouseX; + } + + public double GetMouseY() { + return mouseY; + } + + @Override + public void Fire(ArrayList listeners) { + for(AbstractListener listener : List.copyOf(listeners)) { + LeftMouseDownListener mouseLeftClickListener = (LeftMouseDownListener) listener; + mouseLeftClickListener.OnLeftMouseDown(this); + } + } + + @SuppressWarnings("unchecked") + @Override + public Class GetListenerClassType() { + return LeftMouseDownListener.class; + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/event/events/LeftMouseUpEvent.java b/remappedSrc/net/aoba/event/events/LeftMouseUpEvent.java new file mode 100644 index 00000000..54a3a525 --- /dev/null +++ b/remappedSrc/net/aoba/event/events/LeftMouseUpEvent.java @@ -0,0 +1,58 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.events; + +import java.util.ArrayList; +import java.util.List; +import net.aoba.event.listeners.AbstractListener; +import net.aoba.event.listeners.LeftMouseUpListener; + +public class LeftMouseUpEvent extends AbstractEvent{ + + double mouseX; + double mouseY; + + public LeftMouseUpEvent(double mouseX2, double mouseY2) { + super(); + this.mouseX = mouseX2; + this.mouseY = mouseY2; + } + + public double GetMouseX() { + return mouseX; + } + + public double GetMouseY() { + return mouseY; + } + + @Override + public void Fire(ArrayList listeners) { + for(AbstractListener listener : List.copyOf(listeners)) { + LeftMouseUpListener mouseLeftClickListener = (LeftMouseUpListener) listener; + mouseLeftClickListener.OnLeftMouseUp(this); + } + } + + @SuppressWarnings("unchecked") + @Override + public Class GetListenerClassType() { + return LeftMouseUpListener.class; + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/event/events/MouseMoveEvent.java b/remappedSrc/net/aoba/event/events/MouseMoveEvent.java new file mode 100644 index 00000000..6202dff7 --- /dev/null +++ b/remappedSrc/net/aoba/event/events/MouseMoveEvent.java @@ -0,0 +1,57 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.events; + +import java.util.ArrayList; +import java.util.List; +import net.aoba.event.listeners.AbstractListener; +import net.aoba.event.listeners.MouseMoveListener; + +public class MouseMoveEvent extends AbstractEvent{ + private double horizontal; + private double vertical; + + public MouseMoveEvent(double x, double y) { + super(); + this.horizontal = x; + this.vertical = y; + } + + public double GetVertical() { + return vertical; + } + + public double GetHorizontal() { + return horizontal; + } + + @Override + public void Fire(ArrayList listeners) { + for(AbstractListener listener : List.copyOf(listeners)) { + MouseMoveListener mouseMoveListener = (MouseMoveListener) listener; + mouseMoveListener.OnMouseMove(this); + } + } + + @SuppressWarnings("unchecked") + @Override + public Class GetListenerClassType() { + return MouseMoveListener.class; + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/event/events/MouseScrollEvent.java b/remappedSrc/net/aoba/event/events/MouseScrollEvent.java new file mode 100644 index 00000000..f1ce2ac8 --- /dev/null +++ b/remappedSrc/net/aoba/event/events/MouseScrollEvent.java @@ -0,0 +1,57 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.events; + +import java.util.ArrayList; +import java.util.List; +import net.aoba.event.listeners.AbstractListener; +import net.aoba.event.listeners.MouseScrollListener; + +public class MouseScrollEvent extends AbstractEvent{ + private double horizontal; + private double vertical; + + public MouseScrollEvent(double horizontal2, double vertical2) { + super(); + this.horizontal = horizontal2; + this.vertical = vertical2; + } + + public double GetVertical() { + return vertical; + } + + public double GetHorizontal() { + return horizontal; + } + + @Override + public void Fire(ArrayList listeners) { + for(AbstractListener listener : List.copyOf(listeners)) { + MouseScrollListener mouseScrollListener = (MouseScrollListener) listener; + mouseScrollListener.OnMouseScroll(this); + } + } + + @SuppressWarnings("unchecked") + @Override + public Class GetListenerClassType() { + return MouseScrollListener.class; + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/event/events/PlayerDeathEvent.java b/remappedSrc/net/aoba/event/events/PlayerDeathEvent.java new file mode 100644 index 00000000..ac405b98 --- /dev/null +++ b/remappedSrc/net/aoba/event/events/PlayerDeathEvent.java @@ -0,0 +1,43 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.events; + +import java.util.ArrayList; +import java.util.List; +import net.aoba.event.listeners.AbstractListener; +import net.aoba.event.listeners.PlayerDeathListener; + +public class PlayerDeathEvent extends AbstractEvent { + public PlayerDeathEvent() { + } + + @Override + public void Fire(ArrayList listeners) { + for(AbstractListener listener : List.copyOf(listeners)) { + PlayerDeathListener playerDeathListener = (PlayerDeathListener) listener; + playerDeathListener.OnPlayerDeath(this); + } + } + + @SuppressWarnings("unchecked") + @Override + public Class GetListenerClassType() { + return PlayerDeathListener.class; + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/event/events/PlayerHealthEvent.java b/remappedSrc/net/aoba/event/events/PlayerHealthEvent.java new file mode 100644 index 00000000..8125f721 --- /dev/null +++ b/remappedSrc/net/aoba/event/events/PlayerHealthEvent.java @@ -0,0 +1,58 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.events; + +import java.util.ArrayList; +import java.util.List; + +import net.aoba.event.listeners.AbstractListener; +import net.aoba.event.listeners.PlayerHealthListener; +import net.minecraft.entity.damage.DamageSource; + +public class PlayerHealthEvent extends AbstractEvent { + private float health; + private DamageSource source; + + public PlayerHealthEvent(DamageSource source, float health) { + this.source = source; + this.health = health; + } + + public float getHealth() { + return health; + } + + public DamageSource getDamageSource() { + return source; + } + + @Override + public void Fire(ArrayList listeners) { + for(AbstractListener listener : List.copyOf(listeners)) { + PlayerHealthListener playerHealthListener = (PlayerHealthListener) listener; + playerHealthListener.OnHealthChanged(this); + } + } + + @SuppressWarnings("unchecked") + @Override + public Class GetListenerClassType() { + return PlayerHealthListener.class; + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/event/events/ReceivePacketEvent.java b/remappedSrc/net/aoba/event/events/ReceivePacketEvent.java new file mode 100644 index 00000000..ebab7c2f --- /dev/null +++ b/remappedSrc/net/aoba/event/events/ReceivePacketEvent.java @@ -0,0 +1,52 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.events; + +import java.util.ArrayList; +import java.util.List; +import net.aoba.event.listeners.AbstractListener; +import net.aoba.event.listeners.ReceivePacketListener; +import net.minecraft.network.packet.Packet; + +public class ReceivePacketEvent extends AbstractEvent { + + private Packet packet; + + public Packet GetPacket(){ + return packet; + } + + public ReceivePacketEvent(Packet packet) { + this.packet = packet; + } + + @Override + public void Fire(ArrayList listeners) { + for(AbstractListener listener : List.copyOf(listeners)) { + ReceivePacketListener readPacketListener = (ReceivePacketListener) listener; + readPacketListener.OnReceivePacket(this); + } + } + + @SuppressWarnings("unchecked") + @Override + public Class GetListenerClassType() { + return ReceivePacketListener.class; + } +} diff --git a/remappedSrc/net/aoba/event/events/RenderEvent.java b/remappedSrc/net/aoba/event/events/RenderEvent.java new file mode 100644 index 00000000..7cafc980 --- /dev/null +++ b/remappedSrc/net/aoba/event/events/RenderEvent.java @@ -0,0 +1,56 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.events; + +import java.util.ArrayList; +import java.util.List; +import net.aoba.event.listeners.AbstractListener; +import net.aoba.event.listeners.RenderListener; +import net.minecraft.client.util.math.MatrixStack; + +public class RenderEvent extends AbstractEvent { + MatrixStack matrixStack; + float partialTicks; + + public MatrixStack GetMatrixStack() { + return matrixStack; + } + public float GetPartialTicks() { + return partialTicks; + } + + public RenderEvent(MatrixStack matrixStack, float partialTicks) { + this.matrixStack = matrixStack; + this.partialTicks = partialTicks; + } + + @Override + public void Fire(ArrayList listeners) { + for(AbstractListener listener : List.copyOf(listeners)) { + RenderListener renderListener = (RenderListener) listener; + renderListener.OnRender(this); + } + } + + @SuppressWarnings("unchecked") + @Override + public Class GetListenerClassType() { + return RenderListener.class; + } +} diff --git a/remappedSrc/net/aoba/event/events/SendPacketEvent.java b/remappedSrc/net/aoba/event/events/SendPacketEvent.java new file mode 100644 index 00000000..9e9fd868 --- /dev/null +++ b/remappedSrc/net/aoba/event/events/SendPacketEvent.java @@ -0,0 +1,52 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.events; + +import java.util.ArrayList; +import java.util.List; +import net.aoba.event.listeners.AbstractListener; +import net.aoba.event.listeners.SendPacketListener; +import net.minecraft.network.packet.Packet; + +public class SendPacketEvent extends AbstractEvent { + + private Packet packet; + + public SendPacketEvent(Packet packet) { + this.packet = packet; + } + + public Packet GetPacket(){ + return packet; + } + + @Override + public void Fire(ArrayList listeners) { + for(AbstractListener listener : List.copyOf(listeners)) { + SendPacketListener sendPacketListener = (SendPacketListener) listener; + sendPacketListener.OnSendPacket(this); + } + } + + @SuppressWarnings("unchecked") + @Override + public Class GetListenerClassType() { + return SendPacketListener.class; + } +} diff --git a/remappedSrc/net/aoba/event/events/TickEvent.java b/remappedSrc/net/aoba/event/events/TickEvent.java new file mode 100644 index 00000000..8f628e4a --- /dev/null +++ b/remappedSrc/net/aoba/event/events/TickEvent.java @@ -0,0 +1,40 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.events; + +import java.util.ArrayList; +import java.util.List; +import net.aoba.event.listeners.AbstractListener; +import net.aoba.event.listeners.TickListener; + +public class TickEvent extends AbstractEvent { + @Override + public void Fire(ArrayList listeners) { + for(AbstractListener listener : List.copyOf(listeners)) { + TickListener tickListener = (TickListener) listener; + tickListener.OnUpdate(this); + } + } + + @SuppressWarnings("unchecked") + @Override + public Class GetListenerClassType() { + return TickListener.class; + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/event/listeners/AbstractListener.java b/remappedSrc/net/aoba/event/listeners/AbstractListener.java new file mode 100644 index 00000000..3874e28f --- /dev/null +++ b/remappedSrc/net/aoba/event/listeners/AbstractListener.java @@ -0,0 +1,22 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.listeners; + +public interface AbstractListener {} + diff --git a/remappedSrc/net/aoba/event/listeners/BlockStateListener.java b/remappedSrc/net/aoba/event/listeners/BlockStateListener.java new file mode 100644 index 00000000..77d595ad --- /dev/null +++ b/remappedSrc/net/aoba/event/listeners/BlockStateListener.java @@ -0,0 +1,9 @@ +package net.aoba.event.listeners; + +import net.aoba.event.events.BlockStateEvent; +import net.aoba.event.events.FontChangedEvent; +import net.aoba.event.events.KeyDownEvent; + +public interface BlockStateListener extends AbstractListener { + public abstract void OnBlockStateChanged(BlockStateEvent event); +} diff --git a/remappedSrc/net/aoba/event/listeners/FontChangedListener.java b/remappedSrc/net/aoba/event/listeners/FontChangedListener.java new file mode 100644 index 00000000..3da06bf9 --- /dev/null +++ b/remappedSrc/net/aoba/event/listeners/FontChangedListener.java @@ -0,0 +1,7 @@ +package net.aoba.event.listeners; + +import net.aoba.event.events.FontChangedEvent; + +public interface FontChangedListener extends AbstractListener { + public abstract void OnFontChanged(FontChangedEvent event); +} diff --git a/remappedSrc/net/aoba/event/listeners/FoodLevelListener.java b/remappedSrc/net/aoba/event/listeners/FoodLevelListener.java new file mode 100644 index 00000000..8c586fea --- /dev/null +++ b/remappedSrc/net/aoba/event/listeners/FoodLevelListener.java @@ -0,0 +1,25 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.listeners; + +import net.aoba.event.events.FoodLevelEvent; + +public interface FoodLevelListener extends AbstractListener { + public abstract void OnFoodLevelChanged(FoodLevelEvent readPacketEvent); +} diff --git a/remappedSrc/net/aoba/event/listeners/KeyDownListener.java b/remappedSrc/net/aoba/event/listeners/KeyDownListener.java new file mode 100644 index 00000000..7f62c760 --- /dev/null +++ b/remappedSrc/net/aoba/event/listeners/KeyDownListener.java @@ -0,0 +1,25 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.listeners; + +import net.aoba.event.events.KeyDownEvent; + +public interface KeyDownListener extends AbstractListener { + public abstract void OnKeyDown(KeyDownEvent event); +} diff --git a/remappedSrc/net/aoba/event/listeners/LeftMouseDownListener.java b/remappedSrc/net/aoba/event/listeners/LeftMouseDownListener.java new file mode 100644 index 00000000..03b1d940 --- /dev/null +++ b/remappedSrc/net/aoba/event/listeners/LeftMouseDownListener.java @@ -0,0 +1,25 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.listeners; + +import net.aoba.event.events.LeftMouseDownEvent; + +public interface LeftMouseDownListener extends AbstractListener { + public abstract void OnLeftMouseDown(LeftMouseDownEvent event); +} diff --git a/remappedSrc/net/aoba/event/listeners/LeftMouseUpListener.java b/remappedSrc/net/aoba/event/listeners/LeftMouseUpListener.java new file mode 100644 index 00000000..24a668d7 --- /dev/null +++ b/remappedSrc/net/aoba/event/listeners/LeftMouseUpListener.java @@ -0,0 +1,25 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.listeners; + +import net.aoba.event.events.LeftMouseUpEvent; + +public interface LeftMouseUpListener extends AbstractListener { + public abstract void OnLeftMouseUp(LeftMouseUpEvent event); +} diff --git a/remappedSrc/net/aoba/event/listeners/MouseMoveListener.java b/remappedSrc/net/aoba/event/listeners/MouseMoveListener.java new file mode 100644 index 00000000..44409102 --- /dev/null +++ b/remappedSrc/net/aoba/event/listeners/MouseMoveListener.java @@ -0,0 +1,25 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.listeners; + +import net.aoba.event.events.MouseMoveEvent; + +public interface MouseMoveListener extends AbstractListener { + public abstract void OnMouseMove(MouseMoveEvent mouseMoveEvent); +} diff --git a/remappedSrc/net/aoba/event/listeners/MouseScrollListener.java b/remappedSrc/net/aoba/event/listeners/MouseScrollListener.java new file mode 100644 index 00000000..335ace51 --- /dev/null +++ b/remappedSrc/net/aoba/event/listeners/MouseScrollListener.java @@ -0,0 +1,25 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.listeners; + +import net.aoba.event.events.MouseScrollEvent; + +public interface MouseScrollListener extends AbstractListener { + public abstract void OnMouseScroll(MouseScrollEvent event); +} diff --git a/remappedSrc/net/aoba/event/listeners/PlayerDeathListener.java b/remappedSrc/net/aoba/event/listeners/PlayerDeathListener.java new file mode 100644 index 00000000..361d06cd --- /dev/null +++ b/remappedSrc/net/aoba/event/listeners/PlayerDeathListener.java @@ -0,0 +1,25 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.listeners; + +import net.aoba.event.events.PlayerDeathEvent; + +public interface PlayerDeathListener extends AbstractListener { + public abstract void OnPlayerDeath(PlayerDeathEvent readPacketEvent); +} diff --git a/remappedSrc/net/aoba/event/listeners/PlayerHealthListener.java b/remappedSrc/net/aoba/event/listeners/PlayerHealthListener.java new file mode 100644 index 00000000..45f38bd6 --- /dev/null +++ b/remappedSrc/net/aoba/event/listeners/PlayerHealthListener.java @@ -0,0 +1,25 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.listeners; + +import net.aoba.event.events.PlayerHealthEvent; + +public interface PlayerHealthListener extends AbstractListener { + public abstract void OnHealthChanged(PlayerHealthEvent readPacketEvent); +} diff --git a/remappedSrc/net/aoba/event/listeners/ReceivePacketListener.java b/remappedSrc/net/aoba/event/listeners/ReceivePacketListener.java new file mode 100644 index 00000000..38f479ea --- /dev/null +++ b/remappedSrc/net/aoba/event/listeners/ReceivePacketListener.java @@ -0,0 +1,25 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.listeners; + +import net.aoba.event.events.ReceivePacketEvent; + +public interface ReceivePacketListener extends AbstractListener { + public abstract void OnReceivePacket(ReceivePacketEvent readPacketEvent); +} diff --git a/remappedSrc/net/aoba/event/listeners/RenderListener.java b/remappedSrc/net/aoba/event/listeners/RenderListener.java new file mode 100644 index 00000000..babe4453 --- /dev/null +++ b/remappedSrc/net/aoba/event/listeners/RenderListener.java @@ -0,0 +1,25 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.listeners; + +import net.aoba.event.events.RenderEvent; + +public interface RenderListener extends AbstractListener { + public abstract void OnRender(RenderEvent event); +} diff --git a/remappedSrc/net/aoba/event/listeners/SendPacketListener.java b/remappedSrc/net/aoba/event/listeners/SendPacketListener.java new file mode 100644 index 00000000..f939b0e6 --- /dev/null +++ b/remappedSrc/net/aoba/event/listeners/SendPacketListener.java @@ -0,0 +1,25 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.listeners; + +import net.aoba.event.events.SendPacketEvent; + +public interface SendPacketListener extends AbstractListener { + public abstract void OnSendPacket(SendPacketEvent event); +} diff --git a/remappedSrc/net/aoba/event/listeners/TickListener.java b/remappedSrc/net/aoba/event/listeners/TickListener.java new file mode 100644 index 00000000..1a7aedd9 --- /dev/null +++ b/remappedSrc/net/aoba/event/listeners/TickListener.java @@ -0,0 +1,25 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.listeners; + +import net.aoba.event.events.TickEvent; + +public interface TickListener extends AbstractListener { + public abstract void OnUpdate(TickEvent event); +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/gui/AbstractGui.java b/remappedSrc/net/aoba/gui/AbstractGui.java new file mode 100644 index 00000000..c4015974 --- /dev/null +++ b/remappedSrc/net/aoba/gui/AbstractGui.java @@ -0,0 +1,220 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui; + +import java.util.ArrayList; +import net.aoba.Aoba; +import net.aoba.event.events.LeftMouseDownEvent; +import net.aoba.event.events.MouseMoveEvent; +import net.aoba.event.listeners.LeftMouseDownListener; +import net.aoba.event.listeners.MouseMoveListener; +import net.aoba.gui.tabs.components.Component; +import net.aoba.settings.SettingManager; +import net.aoba.settings.types.Vector2Setting; +import net.aoba.utils.types.Vector2; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.DrawContext; + +public abstract class AbstractGui implements IGuiElement, LeftMouseDownListener, MouseMoveListener { + protected static MinecraftClient mc = MinecraftClient.getInstance(); + + protected String ID; + + protected Vector2Setting position; + + protected float width; + protected float height; + + protected boolean isMouseOver = false; + public boolean moveable = true; + + protected boolean alwaysVisible = false; + protected boolean visible = false; + + // Mouse Variables + protected double lastClickOffsetX; + protected double lastClickOffsetY; + protected boolean inheritHeightFromChildren = true; + + + protected ArrayList children = new ArrayList<>(); + + public AbstractGui(String ID, float x, float y, float width, float height) { + this.ID = ID; + this.position = new Vector2Setting(ID + "_position", ID + "Position", new Vector2(x, y), (Vector2 vec) -> UpdateAll(vec)); + this.width = width; + this.height = height; + SettingManager.registerSetting(position, Aoba.getInstance().settingManager.config_category); + } + + public void UpdateAll(Vector2 vec) { + for(Component component : this.children) { + component.OnParentXChanged(); + component.OnParentYChanged(); + } + } + + public String getID() { + return ID; + } + + @Override + public float getHeight() { + return this.height; + } + + @Override + public float getX() { + return position.getValue().x; + } + + @Override + public float getY() { + return position.getValue().y; + } + + @Override + public float getWidth() { + return this.width; + } + + @Override + public void setX(float x) { + if(this.position.getValue().x != x) { + position.silentSetX(x); + for(Component component : this.children) { + component.OnParentXChanged(); + } + } + } + + public void setY(float y) { + if(this.position.getValue().y != y) { + position.silentSetY(y); + for(Component component : this.children) { + component.OnParentYChanged(); + } + } + } + + public void setWidth(float width) { + if(this.width != width) { + this.width = width; + for(Component component : this.children) { + component.OnParentWidthChanged(); + } + } + } + + public void setHeight(float height) { + if(this.height != height) { + this.height = height; + for(Component component : this.children) { + component.OnParentHeightChanged(); + } + } + } + + public boolean getVisible() { + return this.visible; + } + + public void setVisible(boolean state) { + if(alwaysVisible) state = true; + + if(visible != state) { + this.visible = state; + for(Component component : children){ + component.setVisible(state); + } + + // Binds/Unbinds respective listeners depending on whether it is visible. + if(state) { + Aoba.instance.eventManager.AddListener(LeftMouseDownListener.class, this); + Aoba.instance.eventManager.AddListener(MouseMoveListener.class, this); + }else { + Aoba.instance.eventManager.RemoveListener(LeftMouseDownListener.class, this); + Aoba.instance.eventManager.RemoveListener(MouseMoveListener.class, this); + } + } + } + + public void setAlwaysVisible(boolean state) { + this.alwaysVisible = state; + if(this.alwaysVisible) { + this.setVisible(true); + } + } + + public abstract void update(); + + public abstract void draw(DrawContext drawContext, float partialTicks); + + @Override + public void OnLeftMouseDown(LeftMouseDownEvent event) { + double mouseX = event.GetMouseX(); + double mouseY = event.GetMouseY(); + + Vector2 pos = position.getValue(); + + if (Aoba.getInstance().hudManager.isClickGuiOpen()) { + if (GuiManager.currentGrabbed == null) { + if (mouseX >= pos.x && mouseX <= (pos.x + width)) { + if (mouseY >= pos.y && mouseY <= (pos.y + height)) { + GuiManager.currentGrabbed = this; + this.lastClickOffsetX = mouseX - pos.x; + this.lastClickOffsetY = mouseY - pos.y; + } + } + } + } + } + + @Override + public void OnMouseMove(MouseMoveEvent event) { + if (this.visible && Aoba.getInstance().hudManager.isClickGuiOpen()) { + double mouseX = event.GetHorizontal(); + double mouseY = event.GetVertical(); + + Vector2 pos = position.getValue(); + + if (GuiManager.currentGrabbed == this && this.moveable) { + this.setX((float)(mouseX - this.lastClickOffsetX)); + this.setY((float) (mouseY - this.lastClickOffsetY)); + } + + if (mouseX >= pos.x && mouseX <= pos.x + width) { + if (mouseY >= pos.y && mouseY <= pos.y + height) { + isMouseOver = true; + }else { + isMouseOver = false; + } + }else { + isMouseOver = false; + } + }else { + isMouseOver = false; + } + } + + @Override + public void OnChildChanged(IGuiElement child) { + + } +} diff --git a/remappedSrc/net/aoba/gui/GuiManager.java b/remappedSrc/net/aoba/gui/GuiManager.java new file mode 100644 index 00000000..b47bdb53 --- /dev/null +++ b/remappedSrc/net/aoba/gui/GuiManager.java @@ -0,0 +1,298 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui; + +import java.util.HashMap; +import net.aoba.event.events.KeyDownEvent; +import net.aoba.event.events.LeftMouseDownEvent; +import net.aoba.event.events.LeftMouseUpEvent; +import net.aoba.event.listeners.LeftMouseDownListener; +import net.aoba.event.listeners.LeftMouseUpListener; +import net.aoba.event.listeners.KeyDownListener; +import org.lwjgl.glfw.GLFW; +import org.lwjgl.opengl.GL11; +import net.aoba.module.Module; +import net.aoba.Aoba; +import net.aoba.gui.colors.Color; +import net.aoba.gui.colors.RainbowColor; +import net.aoba.gui.colors.RandomColor; +import net.aoba.gui.hud.AbstractHud; +import net.aoba.gui.hud.ArmorHud; +import net.aoba.gui.hud.InfoHud; +import net.aoba.gui.hud.ModuleSelectorHud; +import net.aoba.gui.hud.RadarHud; +import net.aoba.gui.tabs.*; +import net.aoba.gui.tabs.components.ModuleComponent; +import net.aoba.gui.tabs.components.StackPanelComponent; +import net.aoba.misc.RenderUtils; +import net.aoba.module.Module.Category; +import net.aoba.settings.SettingManager; +import net.aoba.settings.types.BooleanSetting; +import net.aoba.settings.types.ColorSetting; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.option.KeyBinding; +import net.minecraft.client.util.InputUtil; +import net.minecraft.client.util.Window; +import net.minecraft.client.util.math.MatrixStack; + +public class GuiManager implements LeftMouseDownListener, LeftMouseUpListener, KeyDownListener { + protected MinecraftClient mc = MinecraftClient.getInstance(); + + public KeybindSetting clickGuiButton = new KeybindSetting("key.clickgui", "ClickGUI Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_GRAVE_ACCENT, 0)); + private KeyBinding esc = new KeyBinding("key.esc", GLFW.GLFW_KEY_ESCAPE, "key.categories.aoba"); + + private boolean clickGuiOpen = false; + + public static AbstractGui currentGrabbed = null; + + private HashMap pinnedHuds = new HashMap(); + + // Navigation Bar and Pages + public NavigationBar clickGuiNavBar; + public Page modulesPane = new Page("Modules"); + public Page toolsPane = new Page("Tools"); + public Page hudPane = new Page("Hud"); + + // Global HUD Settings + public static ColorSetting foregroundColor; + public static ColorSetting borderColor; + public static ColorSetting backgroundColor; + + public static RainbowColor rainbowColor = new RainbowColor(); + public static RandomColor randomColor = new RandomColor(); + + public FloatSetting effectSpeed = new FloatSetting("color_speed", "Effect Spd", 4f, 1f, 20f, 0.1f, null); + public BooleanSetting rainbow = new BooleanSetting("rainbow_mode", "Rainbow", false, null); + public BooleanSetting ah = new BooleanSetting("armorhud_toggle", "ArmorHUD", false, null); + + public ModuleSelectorHud moduleSelector; + public ArmorHud armorHud; + public RadarHud radarHud; + public InfoHud infoHud; + + public GuiManager() { + mc = MinecraftClient.getInstance(); + + borderColor = new ColorSetting("hud_border_color", "Color of the borders.", new Color(0, 0, 0)); + backgroundColor = new ColorSetting("hud_background_color", "Color of the background.", new Color(0, 0, 0, 50)); + foregroundColor = new ColorSetting("hud_foreground_color", "The color of the HUD", new Color(1.0f, 1.0f, 1.0f)); + clickGuiNavBar = new NavigationBar(); + + SettingManager.registerSetting(borderColor, Aoba.getInstance().settingManager.config_category); + SettingManager.registerSetting(backgroundColor, Aoba.getInstance().settingManager.config_category); + SettingManager.registerSetting(foregroundColor, Aoba.getInstance().settingManager.config_category); + SettingManager.registerSetting(clickGuiButton, Aoba.getInstance().settingManager.modules_category); + + Aoba.getInstance().eventManager.AddListener(KeyDownListener.class, this); + } + + public void Initialize() { + toolsPane.AddHud(new AuthCrackerTab("Auth Cracker", 810, 500)); + + moduleSelector = new ModuleSelectorHud(); + armorHud = new ArmorHud(790, 500, 200, 50); + radarHud = new RadarHud(590, 500, 180, 180); + infoHud = new InfoHud(100, 500); + + hudPane.AddHud(new HudsTab(new AbstractHud[] { moduleSelector, armorHud,radarHud, infoHud })); + + int xOffset = 50; + for (Category category : Module.Category.values()) { + ClickGuiTab tab = new ClickGuiTab(category.name(), xOffset, 75, true, category.name()); + + StackPanelComponent stackPanel = new StackPanelComponent(tab); + stackPanel.setTop(30); + for (Module module : Aoba.getInstance().moduleManager.modules) { + if (module.getCategory() == category) { + ModuleComponent button = new ModuleComponent(module.getName(), stackPanel, module); + stackPanel.addChild(button); + } + } + tab.addChild(stackPanel); + tab.setWidth(180); + modulesPane.AddHud(tab); + xOffset += tab.getWidth() + 10; + } + + clickGuiNavBar.addPane(modulesPane); + clickGuiNavBar.addPane(toolsPane); + clickGuiNavBar.addPane(hudPane); + //clickGuiNavBar.addPane(settingsPane); + + SettingManager.registerSetting(effectSpeed, Aoba.getInstance().settingManager.config_category); + SettingManager.registerSetting(rainbow, Aoba.getInstance().settingManager.config_category); + SettingManager.registerSetting(ah, Aoba.getInstance().settingManager.config_category); + + Aoba.getInstance().eventManager.AddListener(LeftMouseDownListener.class, this); + Aoba.getInstance().eventManager.AddListener(LeftMouseUpListener.class, this); + + clickGuiNavBar.setSelectedIndex(0); + } + + public void AddHud(AbstractGui hud, String pageName) { + for(Page page : clickGuiNavBar.getPanes()) { + if(page.getTitle().equals(pageName)) { + page.tabs.add(hud); + break; + } + } + } + + public void RemoveHud(AbstractGui hud, String pageName) { + for(Page page : clickGuiNavBar.getPanes()) { + if(page.getTitle().equals(pageName)) { + page.tabs.remove(hud); + break; + } + } + } + + @Override + public void OnKeyDown(KeyDownEvent event) { + if(clickGuiButton.getValue().getCode() == event.GetKey()) { + this.clickGuiOpen = !this.clickGuiOpen; + this.toggleMouse(); + } + } + + public void SetHudActive(AbstractHud hud, boolean state) { + if(state) { + this.pinnedHuds.put(hud.getClass(), hud); + hud.activated.silentSetValue(true); + } + else { + this.pinnedHuds.remove(hud.getClass()); + hud.activated.silentSetValue(false); + } + } + + /** + * Getter for the current color used by the GUI for text rendering. + * @return Current Color + */ + public void update() { + if(!Aoba.getInstance().isGhosted()){ + + /** + * Moves the selected Tab to where the user moves their mouse. + */ + if (this.clickGuiOpen) { + clickGuiNavBar.update(); + } + + /** + * Updates each of the Tab GUIs that are currently on the screen. + */ + for(AbstractGui hud : pinnedHuds.values()) { + hud.update(); + } + + if (this.esc.isPressed() && this.clickGuiOpen) { + this.clickGuiOpen = !this.clickGuiOpen; + this.toggleMouse(); + } + } + + /** + * Updates the Color. + * TODO: Remove this and move to event-based. + */ + //if(this.rainbow.getValue()) { + // rainbowColor.update(this.effectSpeed.getValue().floatValue()); + // this.currentColor = rainbowColor.getColor(); + //}else { + // this.currentColor = foregroundColor.getValue(); + //} + + //Aoba.getInstance().eventManager.Fire(new MouseScrollEvent(5.0f, 5.0f)); + } + + public void draw(DrawContext drawContext, float tickDelta) { + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + + MatrixStack matrixStack = drawContext.getMatrices(); + matrixStack.push(); + + int guiScale = mc.getWindow().calculateScaleFactor(mc.options.getGuiScale().getValue(), mc.forcesUnicodeFont()); + matrixStack.scale(1.0f / guiScale, 1.0f / guiScale, 1.0f); + + Window window = mc.getWindow(); + + /** + * Render ClickGUI and Sidebar + */ + if (this.clickGuiOpen) { + RenderUtils.drawBox(matrixStack, 0, 0, window.getWidth(), window.getHeight(), new Color(26, 26, 26, 100)); + clickGuiNavBar.draw(drawContext, tickDelta); + } + + // Render HUDS + if(!this.clickGuiOpen || this.clickGuiNavBar.getSelectedPage() == this.hudPane) { + for(AbstractGui hud : pinnedHuds.values()) { + if(hud.getVisible()) { + hud.draw(drawContext, tickDelta); + } + } + } + + + matrixStack.pop(); + GL11.glEnable(GL11.GL_CULL_FACE); + } + + /** + * Gets whether or not the Click GUI is currently open. + * @return State of the Click GUI. + */ + public boolean isClickGuiOpen() { + return this.clickGuiOpen; + } + + public void setClickGuiOpen(boolean state) { + this.clickGuiOpen = state; + currentGrabbed = null; + } + + /** + * Locks and unlocks the Mouse. + */ + public void toggleMouse() { + if(this.mc.mouse.isCursorLocked()) { + this.mc.mouse.unlockCursor(); + }else { + this.mc.mouse.lockCursor(); + } + } + + @Override + public void OnLeftMouseDown(LeftMouseDownEvent event) { + if (this.clickGuiOpen) { + event.SetCancelled(true); + } + } + + @Override + public void OnLeftMouseUp(LeftMouseUpEvent event) { + currentGrabbed = null; + } +} diff --git a/remappedSrc/net/aoba/gui/IGuiElement.java b/remappedSrc/net/aoba/gui/IGuiElement.java new file mode 100644 index 00000000..864f34ce --- /dev/null +++ b/remappedSrc/net/aoba/gui/IGuiElement.java @@ -0,0 +1,35 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +// An interface containing the most abstract definition of a Hud Element that will appear on the screen. +package net.aoba.gui; + +public interface IGuiElement { + + public float getX(); + public float getY(); + public float getWidth(); + public float getHeight(); + + public void setX(float x); + public void setY(float y); + public void setWidth(float width); + public void setHeight(float height); + + public void OnChildChanged(IGuiElement child); +} diff --git a/remappedSrc/net/aoba/gui/NavigationBar.java b/remappedSrc/net/aoba/gui/NavigationBar.java new file mode 100644 index 00000000..ba2673de --- /dev/null +++ b/remappedSrc/net/aoba/gui/NavigationBar.java @@ -0,0 +1,120 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui; + +import java.util.ArrayList; +import java.util.List; +import net.aoba.Aoba; +import net.aoba.AobaClient; +import net.aoba.event.events.LeftMouseDownEvent; +import net.aoba.event.listeners.LeftMouseDownListener; +import net.aoba.gui.colors.Color; +import net.aoba.misc.RenderUtils; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.util.Window; +import net.minecraft.client.util.math.MatrixStack; + +public class NavigationBar implements LeftMouseDownListener { + MinecraftClient mc = MinecraftClient.getInstance(); + + private List options; + private int selectedIndex; + + public NavigationBar() { + options = new ArrayList(); + Aoba.getInstance().eventManager.AddListener(LeftMouseDownListener.class, this); + } + + public void addPane(Page pane) { + options.add(pane); + } + + public List getPanes(){ + return this.options; + } + + public int getSelectedIndex() { + return this.selectedIndex; + } + + public Page getSelectedPage() { + return options.get(selectedIndex); + } + + public void setSelectedIndex(int index) { + if(index <= this.options.size()) { + this.options.get(selectedIndex).setVisible(false); + this.selectedIndex = index; + this.options.get(selectedIndex).setVisible(true); + } + } + + public void update() { + if(options.size() > 0) { + options.get(selectedIndex).update(); + } + } + + public void draw(DrawContext drawContext, float partialTicks) { + Window window = mc.getWindow(); + + int centerX = (window.getWidth() / 2); + + MatrixStack matrixStack = drawContext.getMatrices(); + + int width = 100 * options.size(); + + GuiManager hudManager = Aoba.getInstance().hudManager; + RenderUtils.drawRoundedBox(matrixStack, centerX - (width / 2), 25, width, 25, 6, GuiManager.backgroundColor.getValue()); + RenderUtils.drawRoundedOutline(matrixStack, centerX - (width / 2), 25, width, 25, 6, GuiManager.borderColor.getValue()); + + RenderUtils.drawRoundedBox(drawContext.getMatrices(), centerX - (width / 2) + (100 * this.selectedIndex), 25, 100, 25, 5, new Color(150, 150, 150, 100)); + + for(int i = 0; i < options.size(); i++) { + Page pane = options.get(i); + if(i == selectedIndex) { + pane.render(drawContext, partialTicks); + } + RenderUtils.drawString(drawContext, pane.title, centerX - (width / 2) + 50 + (100 * i) - mc.textRenderer.getWidth(pane.title), 30, GuiManager.foregroundColor.getValue()); + } + } + + @Override + public void OnLeftMouseDown(LeftMouseDownEvent event) { + AobaClient aoba = Aoba.getInstance(); + Window window = mc.getWindow(); + + double mouseX = event.GetMouseX(); + double mouseY = event.GetMouseY(); + int width = 100 * options.size(); + int centerX = (window.getWidth() / 2); + int x = centerX - (width / 2); + + if (aoba.hudManager.isClickGuiOpen() && GuiManager.currentGrabbed == null) { + if (mouseX >= (x) && mouseX <= (x + width)) { + if (mouseY >= (25) && mouseY <= (50)) { + int mouseXInt = (int) mouseX; + int selection = (mouseXInt - x) / 100; + this.setSelectedIndex(selection); + } + } + } + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/gui/Page.java b/remappedSrc/net/aoba/gui/Page.java new file mode 100644 index 00000000..ae83bc1d --- /dev/null +++ b/remappedSrc/net/aoba/gui/Page.java @@ -0,0 +1,69 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import net.minecraft.client.gui.DrawContext; + +public class Page { + protected String title; + protected List tabs = new ArrayList(); + + private boolean isVisible; + + public Page(String title) { + this.title = title; + } + + public String getTitle() { + return this.title; + } + + public void AddHud(AbstractGui hud) { + tabs.add(hud); + } + + public void setVisible(boolean state) { + this.isVisible = state; + for(AbstractGui hud : tabs){ + hud.setVisible(state); + } + } + + public void update() { + if(this.isVisible) { + Iterator tabIterator = tabs.iterator(); + while(tabIterator.hasNext()) { + tabIterator.next().update(); + } + } + } + + public void render(DrawContext drawContext, float partialTicks) { + if(this.isVisible) { + Iterator tabIterator = tabs.iterator(); + while(tabIterator.hasNext()) { + tabIterator.next().draw(drawContext, partialTicks); + } + } + } +} diff --git a/src/main/java/net/aoba/gui/Color.java b/remappedSrc/net/aoba/gui/colors/Color.java similarity index 99% rename from src/main/java/net/aoba/gui/Color.java rename to remappedSrc/net/aoba/gui/colors/Color.java index 1f7ffbae..e713625b 100644 --- a/src/main/java/net/aoba/gui/Color.java +++ b/remappedSrc/net/aoba/gui/colors/Color.java @@ -20,15 +20,12 @@ * A class to represent Colors and their respective functions. */ -package net.aoba.gui; +package net.aoba.gui.colors; import org.apache.commons.lang3.StringUtils; import org.joml.Vector3f; public class Color { - - public static Color WHITE = new Color(255, 255, 255); - public int r; public int g; public int b; diff --git a/remappedSrc/net/aoba/gui/colors/ColorMode.java b/remappedSrc/net/aoba/gui/colors/ColorMode.java new file mode 100644 index 00000000..8e26f483 --- /dev/null +++ b/remappedSrc/net/aoba/gui/colors/ColorMode.java @@ -0,0 +1,7 @@ +package net.aoba.gui.colors; + +public enum ColorMode { + Normal, + Rainbow, + Random, +} \ No newline at end of file diff --git a/src/main/java/net/aoba/misc/Colors.java b/remappedSrc/net/aoba/gui/colors/Colors.java similarity index 96% rename from src/main/java/net/aoba/misc/Colors.java rename to remappedSrc/net/aoba/gui/colors/Colors.java index 6f735b32..a31bb16d 100644 --- a/src/main/java/net/aoba/misc/Colors.java +++ b/remappedSrc/net/aoba/gui/colors/Colors.java @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -package net.aoba.misc; - -import net.aoba.gui.Color; +package net.aoba.gui.colors; public class Colors { public static final Color Red = new Color(255, 0, 0); diff --git a/src/main/java/net/aoba/misc/RainbowColor.java b/remappedSrc/net/aoba/gui/colors/RainbowColor.java similarity index 66% rename from src/main/java/net/aoba/misc/RainbowColor.java rename to remappedSrc/net/aoba/gui/colors/RainbowColor.java index 290e0ed6..dccde131 100644 --- a/src/main/java/net/aoba/misc/RainbowColor.java +++ b/remappedSrc/net/aoba/gui/colors/RainbowColor.java @@ -19,29 +19,20 @@ /** * A class to represent a Color that iterates. */ -package net.aoba.misc; +package net.aoba.gui.colors; -import net.aoba.gui.Color; - -public class RainbowColor { - private Color color; - private float timer = 0f; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +public class RainbowColor extends Color implements TickListener { public RainbowColor() { - this.color = new Color(255, 0, 0); - } - - public void update(float timerIncrement) { - if (timer >= (20 - timerIncrement)) { - timer = 0f; - this.color.setHSV(((this.color.hue + 1f) % 361), 1f, 1f); - } else { - timer++; - } - + super(255, 0, 0); + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); } - public Color getColor() { - return this.color; + @Override + public void OnUpdate(TickEvent event) { + this.setHSV(((this.hue + 1f) % 361), 1f, 1f); } } diff --git a/remappedSrc/net/aoba/gui/colors/RandomColor.java b/remappedSrc/net/aoba/gui/colors/RandomColor.java new file mode 100644 index 00000000..44fe86ee --- /dev/null +++ b/remappedSrc/net/aoba/gui/colors/RandomColor.java @@ -0,0 +1,17 @@ +package net.aoba.gui.colors; + +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; + +public class RandomColor extends Color implements TickListener { + public RandomColor() { + super(0, 0, 0); + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void OnUpdate(TickEvent event) { + this.setHSV(((float)(Math.random() * 360f)), 1f, 1f); + } +} diff --git a/remappedSrc/net/aoba/gui/font/FontManager.java b/remappedSrc/net/aoba/gui/font/FontManager.java new file mode 100644 index 00000000..4426be5f --- /dev/null +++ b/remappedSrc/net/aoba/gui/font/FontManager.java @@ -0,0 +1,154 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.font; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FilenameFilter; +import java.io.IOException; +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import org.lwjgl.stb.STBTTFontinfo; +import org.lwjgl.stb.STBTruetype; +import org.lwjgl.system.MemoryUtil; +import org.lwjgl.system.Struct; + +import net.aoba.Aoba; +import net.aoba.event.events.FontChangedEvent; +import net.aoba.settings.SettingManager; +import net.aoba.settings.types.StringSetting; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.font.Font; +import net.minecraft.client.font.FontStorage; +import net.minecraft.client.font.TextRenderer; +import net.minecraft.client.font.TrueTypeFont; +import net.minecraft.client.font.TrueTypeFontLoader; +import net.minecraft.client.font.TrueTypeFontLoader.Shift; +import net.minecraft.util.Identifier; + +public class FontManager { + private MinecraftClient MC; + private TextRenderer currentFontRenderer; + + public HashMap fontRenderers; + public StringSetting fontSetting; + + public FontManager() { + fontRenderers = new HashMap(); + MC = MinecraftClient.getInstance(); + + fontSetting = new StringSetting("font", "The font that Aoba will use.", "minecraft"); + fontSetting.setOnUpdate((i) -> { + FontManager font = Aoba.getInstance().fontManager; + font.SetRenderer(font.fontRenderers.get(i)); + }); + + SettingManager.registerSetting(fontSetting, Aoba.getInstance().settingManager.hidden_category); + } + + public void Initialize() { + fontRenderers.put("minecraft", MC.textRenderer); + + File fontDirectory = new File(MC.runDirectory + "\\aoba\\fonts\\"); + if (fontDirectory.isDirectory()) { + File[] files = fontDirectory.listFiles(new FilenameFilter() { + @Override + public boolean accept(File dir, String name) { + return name.endsWith(".ttf"); + } + }); + + for (File file : files) { + List list = new ArrayList(); + + try { + Font font = LoadTTFFont(file, 12.5f, 2, new TrueTypeFontLoader.Shift(-1, 0), ""); + list.add(font); + } catch (Exception e) { + e.printStackTrace(); + } + + FontStorage storage = new FontStorage(MC.getTextureManager(), new Identifier("aoba:" + file.getName())); + storage.setFonts(list); + fontRenderers.put(file.getName().replace(".ttf", ""), new TextRenderer(id -> storage, true)); + } + } + + Iterator newFonts = fontRenderers.values().iterator(); + if(newFonts.hasNext()) { + currentFontRenderer = newFonts.next(); + } + + } + + public TextRenderer GetRenderer() { + return currentFontRenderer; + } + + public void SetRenderer(TextRenderer renderer) { + this.currentFontRenderer = renderer; + Aoba.getInstance().eventManager.Fire(new FontChangedEvent()); + } + + private static Font LoadTTFFont(File location, float size, float oversample, Shift shift, String skip) throws IOException { + TrueTypeFont trueTypeFont = null; + Struct sTBTTFontinfo = null; + ByteBuffer byteBuffer = null; + + InputStream inputStream = new FileInputStream(location); + try { + sTBTTFontinfo = STBTTFontinfo.malloc(); + byte[] test = inputStream.readAllBytes(); + byteBuffer = ByteBuffer.allocateDirect(test.length); + byteBuffer.put(test, 0, test.length); + byteBuffer.flip(); + + if (!STBTruetype.stbtt_InitFont((STBTTFontinfo) sTBTTFontinfo, byteBuffer)) { + inputStream.close(); + throw new IOException("Invalid ttf"); + } + trueTypeFont = new TrueTypeFont(byteBuffer, (STBTTFontinfo) sTBTTFontinfo, size, oversample, shift.x(), + shift.y(), skip); + } catch (Throwable throwable) { + try { + if (inputStream != null) { + try { + inputStream.close(); + } catch (Throwable throwable2) { + throwable.addSuppressed(throwable2); + } + } + throw throwable; + } catch (Exception exception) { + if (sTBTTFontinfo != null) { + sTBTTFontinfo.free(); + } + MemoryUtil.memFree(byteBuffer); + throw exception; + } + } + inputStream.close(); + + return trueTypeFont; + } +} diff --git a/remappedSrc/net/aoba/gui/hud/AbstractHud.java b/remappedSrc/net/aoba/gui/hud/AbstractHud.java new file mode 100644 index 00000000..e13ce6c3 --- /dev/null +++ b/remappedSrc/net/aoba/gui/hud/AbstractHud.java @@ -0,0 +1,52 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.hud; + +import net.aoba.Aoba; +import net.aoba.gui.AbstractGui; +import net.aoba.gui.colors.Color; +import net.aoba.settings.SettingManager; +import net.aoba.settings.types.BooleanSetting; +import net.minecraft.client.gui.DrawContext; + +public class AbstractHud extends AbstractGui { + + public BooleanSetting activated; + + public AbstractHud(String ID, float x, float y, float width, float height) { + super(ID, x, y, width, height); + this.setVisible(true); + this.activated = new BooleanSetting(ID + "_activated", ID + " Activated", false, (Boolean val) -> onActivatedChanged(val)); + SettingManager.registerSetting(activated, Aoba.getInstance().settingManager.config_category); + } + + private void onActivatedChanged(Boolean state) { + Aoba.getInstance().hudManager.SetHudActive(this, state.booleanValue()); + } + + @Override + public void update() { + + } + + @Override + public void draw(DrawContext drawContext, float partialTicks) { + + } +} diff --git a/remappedSrc/net/aoba/gui/hud/ArmorHud.java b/remappedSrc/net/aoba/gui/hud/ArmorHud.java new file mode 100644 index 00000000..f27391a0 --- /dev/null +++ b/remappedSrc/net/aoba/gui/hud/ArmorHud.java @@ -0,0 +1,58 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * A class to represent a Tab containing Armor Information + */ + +package net.aoba.gui.hud; + +import net.aoba.utils.types.Vector2; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.util.collection.DefaultedList; + +public class ArmorHud extends AbstractHud{ + + public ArmorHud(int x, int y, int width, int height) { + super("ArmorHud", x,y,width,height); + this.width = 60; + this.height = 256; + } + + @Override + public void update() { + + } + + @Override + public void draw(DrawContext drawContext, float partialTicks) { + if(this.visible) { + DefaultedList armors = mc.player.getInventory().armor; + + Vector2 pos = position.getValue(); + int yOff = 16; + for(ItemStack armor : armors) { + if(armor.getItem() == Items.AIR) continue; + drawContext.drawItem(armor, (int)pos.x, (int)(pos.y + this.height - yOff)); + yOff += 16; + } + } + } +} diff --git a/remappedSrc/net/aoba/gui/hud/InfoHud.java b/remappedSrc/net/aoba/gui/hud/InfoHud.java new file mode 100644 index 00000000..f1c13264 --- /dev/null +++ b/remappedSrc/net/aoba/gui/hud/InfoHud.java @@ -0,0 +1,89 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ +package net.aoba.gui.hud; + +import net.aoba.gui.GuiManager; +import net.aoba.misc.RenderUtils; +import net.aoba.utils.types.Vector2; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.util.math.MatrixStack; + +public class InfoHud extends AbstractHud { + + String positionText = ""; + String timeText = ""; + String fpsText = ""; + + // + public InfoHud(int x, int y) { + super("InfoHud", x, y, 190, 60); + } + + @Override + public void update() { + MinecraftClient mc = MinecraftClient.getInstance(); + + int time = ((int)mc.world.getTime() + 6000)% 24000; + String suffix = time >= 12000 ? "PM" : "AM"; + String timeString = (time / 10) % 1200 + ""; + for (int n = timeString.length(); n < 4; ++n) { + timeString = "0" + timeString; + } + final String[] strsplit = timeString.split(""); + String hours = strsplit[0] + strsplit[1]; + if(hours.equalsIgnoreCase("00")) { + hours = "12"; + } + final int minutes = (int)Math.floor(Double.parseDouble(strsplit[2] + strsplit[3]) / 100.0 * 60.0); + String sm = minutes + ""; + if (minutes < 10) { + sm = "0" + minutes; + } + timeString = hours + ":" + sm.charAt(0) + sm.charAt(1) + suffix; + positionText = "XYZ: " + (int)mc.player.getBlockX() + ", " + (int)mc.player.getBlockY() + ", " + (int)mc.player.getBlockZ(); + timeText = "Time: " + timeString; + fpsText = "FPS: " + mc.fpsDebugString.split(" ", 2)[0] + " Day: " + (int) (mc.world.getTime() / 24000); + + int newWidth = (int)(mc.textRenderer.getWidth(positionText) * 2) + 20; + if(this.getWidth()!= newWidth) { + if(newWidth >= 190) { + this.setWidth(newWidth); + }else { + this.setWidth(190); + } + } + } + + @Override + public void draw(DrawContext drawContext, float partialTicks) { + if(this.visible) { + MatrixStack matrixStack = drawContext.getMatrices(); + // Draws background depending on components width and height + + Vector2 pos = position.getValue(); + + RenderUtils.drawRoundedBox(matrixStack, pos.x, pos.y, width, height, 6, GuiManager.backgroundColor.getValue()); + RenderUtils.drawRoundedOutline(matrixStack, pos.x, pos.y, width, height, 6, GuiManager.borderColor.getValue()); + + RenderUtils.drawString(drawContext, positionText, pos.x + 5, pos.y + 4, GuiManager.foregroundColor.getValue()); + RenderUtils.drawString(drawContext, timeText, pos.x + 5, pos.y + 24, GuiManager.foregroundColor.getValue()); + RenderUtils.drawString(drawContext, fpsText, pos.x + 5, pos.y + 44, GuiManager.foregroundColor.getValue()); + } + } +} diff --git a/remappedSrc/net/aoba/gui/hud/ModuleSelectorHud.java b/remappedSrc/net/aoba/gui/hud/ModuleSelectorHud.java new file mode 100644 index 00000000..d535a2c3 --- /dev/null +++ b/remappedSrc/net/aoba/gui/hud/ModuleSelectorHud.java @@ -0,0 +1,174 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ +package net.aoba.gui.hud; + +import java.util.ArrayList; +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.AobaClient; +import net.aoba.gui.GuiManager; +import net.aoba.gui.colors.Color; +import net.aoba.misc.RenderUtils; +import net.aoba.module.Module; +import net.aoba.module.Module.Category; +import net.aoba.utils.types.Vector2; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.option.KeyBinding; +import net.minecraft.client.util.Window; +import net.minecraft.client.util.math.MatrixStack; + +public class ModuleSelectorHud extends AbstractHud { + private KeyBinding keybindUp; + private KeyBinding keybindDown; + private KeyBinding keybindLeft; + private KeyBinding keybindRight; + + private AobaClient aoba; + + int index = 0; + int indexMods = 0; + boolean isCategoryMenuOpen = false; + + Category[] categories; + ArrayList modules = new ArrayList(); + + public ModuleSelectorHud() { + super("ModuleSelectorHud", 0, 0, 150, 30); + this.keybindUp = new KeyBinding("key.tabup", GLFW.GLFW_KEY_UP, "key.categories.aoba"); + this.keybindDown = new KeyBinding("key.tabdown", GLFW.GLFW_KEY_DOWN, "key.categories.aoba"); + this.keybindLeft = new KeyBinding("key.tableft", GLFW.GLFW_KEY_LEFT, "key.categories.aoba"); + this.keybindRight = new KeyBinding("key.tabright", GLFW.GLFW_KEY_RIGHT, "key.categories.aoba"); + + categories = Module.Category.values(); + + this.aoba = Aoba.getInstance(); + } + + @Override + public void update() { + if (!aoba.isGhosted()) { + if (this.keybindUp.isPressed()) { + if (!isCategoryMenuOpen) { + if (index == 0) { + index = categories.length - 1; + } else { + index -= 1; + } + } else { + if (indexMods == 0) { + indexMods = modules.size() - 1; + } else { + indexMods -= 1; + } + } + this.keybindUp.setPressed(false); + } else if (this.keybindDown.isPressed()) { + if (!isCategoryMenuOpen) { + index = (index + 1) % categories.length; + } else { + indexMods = (indexMods + 1) % modules.size(); + } + this.keybindDown.setPressed(false); + } else if (this.keybindRight.isPressed()) { + if (!isCategoryMenuOpen) { + isCategoryMenuOpen = !isCategoryMenuOpen; + if (modules.isEmpty()) { + for (Module module : aoba.moduleManager.modules) { + if (module.isCategory(this.categories[this.index])) { + modules.add(module); + } + } + } + } else { + modules.get(indexMods).toggle(); + } + this.keybindRight.setPressed(false); + } else if (this.keybindLeft.isPressed()) { + if (this.isCategoryMenuOpen) { + this.indexMods = 0; + this.modules.clear(); + this.isCategoryMenuOpen = false; + } + this.keybindLeft.setPressed(false); + } + } + + } + + @Override + public void draw(DrawContext drawContext, float partialTicks) { + // Gets the client and window. + MinecraftClient mc = MinecraftClient.getInstance(); + MatrixStack matrixStack = drawContext.getMatrices(); + Window window = mc.getWindow(); + + Vector2 pos = position.getValue(); + + // Draws the top bar including "Aoba x.x" + RenderUtils.drawString(drawContext, "Aoba " + AobaClient.VERSION, 8, 8, GuiManager.foregroundColor.getValue()); + + // Draws the table including all of the categories. + GuiManager hudManager = Aoba.getInstance().hudManager; + RenderUtils.drawRoundedBox(matrixStack, pos.x, pos.y, width, height * this.categories.length, 6f, GuiManager.backgroundColor.getValue()); + RenderUtils.drawRoundedOutline(matrixStack, pos.x, pos.y, width, height * this.categories.length, 6f, GuiManager.borderColor.getValue()); + + // For every category, draw a cell for it. + for (int i = 0; i < this.categories.length; i++) { + RenderUtils.drawString(drawContext, ">>", pos.x + width - 24, pos.y + (height * i) + 8, GuiManager.foregroundColor.getValue()); + // Draws the name of the category dependent on whether it is selected. + if (this.index == i) { + RenderUtils.drawString(drawContext, "> " + this.categories[i].name(), pos.x + 8, pos.y + (height * i) + 8, GuiManager.foregroundColor.getValue()); + } else { + RenderUtils.drawString(drawContext, this.categories[i].name(), pos.x + 8, pos.y + (height * i) + 8, 0xFFFFFF); + } + } + + // If any particular category menu is open. + if (isCategoryMenuOpen) { + // Draw the table underneath + RenderUtils.drawRoundedBox(matrixStack, pos.x + width, pos.y + (height * this.index), 165, height * modules.size(), 6f, GuiManager.backgroundColor.getValue()); + RenderUtils.drawRoundedOutline(matrixStack, pos.x + width, pos.y + (height * this.index), 165, height * modules.size(), 6f, GuiManager.borderColor.getValue()); + + // For every mod, draw a cell for it. + for (int i = 0; i < modules.size(); i++) { + if (this.indexMods == i) { + RenderUtils.drawString(drawContext, "> " + modules.get(i).getName(), pos.x + width + 5, + pos.y + (i * height) + (this.index * height) + 8, + modules.get(i).getState() ? 0x00FF00 : GuiManager.foregroundColor.getValue().getColorAsInt()); + } else { + RenderUtils.drawString(drawContext, modules.get(i).getName(), pos.x + width + 5, + pos.y + (i * height) + (this.index * height) + 8, + modules.get(i).getState() ? 0x00FF00 : 0xFFFFFF); + } + } + } + + // Draws the active mods in the top right of the screen. + int iteration = 0; + for(int i = 0; i < aoba.moduleManager.modules.size(); i++) { + Module mod = aoba.moduleManager.modules.get(i); + if(mod.getState()) { + RenderUtils.drawString(drawContext, mod.getName(), + (float) (window.getWidth() - ((mc.textRenderer.getWidth(mod.getName()) + 5) * 2)), 10 + (iteration*20), + GuiManager.foregroundColor.getValue().getColorAsInt()); + iteration++; + } + } + } +} diff --git a/remappedSrc/net/aoba/gui/hud/RadarHud.java b/remappedSrc/net/aoba/gui/hud/RadarHud.java new file mode 100644 index 00000000..02c99814 --- /dev/null +++ b/remappedSrc/net/aoba/gui/hud/RadarHud.java @@ -0,0 +1,114 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ +package net.aoba.gui.hud; + +import net.aoba.Aoba; +import net.aoba.gui.GuiManager; +import net.aoba.gui.colors.Color; +import net.aoba.misc.RenderUtils; +import net.aoba.utils.types.Vector2; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.network.AbstractClientPlayerEntity; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.entity.Entity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.mob.Monster; +import net.minecraft.entity.passive.AnimalEntity; +import net.minecraft.entity.player.PlayerEntity; + +public class RadarHud extends AbstractHud { + + float distance = 50; + public RadarHud( int x, int y, int width, int height) { + super("RadarHud", x, y, width, height); + } + + @Override + public void draw(DrawContext drawContext, float partialTicks) { + if(this.visible) { + MatrixStack matrixStack = drawContext.getMatrices(); + + Vector2 pos = position.getValue(); + + // Draws background depending on components width and height + GuiManager hudManager = Aoba.getInstance().hudManager; + RenderUtils.drawRoundedBox(matrixStack, pos.x, pos.y, width, height, 6, GuiManager.backgroundColor.getValue()); + RenderUtils.drawRoundedOutline(matrixStack, pos.x, pos.y, width, height, 6, GuiManager.borderColor.getValue()); + + // Draw the 'Radar' + RenderUtils.drawBox(matrixStack, pos.x , pos.y + (height / 2), width - 1, 1, new Color(128,128,128, 255)); + RenderUtils.drawBox(matrixStack, pos.x + (width / 2), pos.y, 1, height, new Color(128,128,128, 255)); + RenderUtils.drawBox(matrixStack, pos.x + (width / 2) - 2, pos.y + (height / 2) - 2, 5, 5, GuiManager.foregroundColor.getValue()); + + float sin_theta = (float) Math.sin(Math.toRadians(-mc.player.getRotationClient().y)); + float cos_theta = (float) Math.cos(Math.toRadians(-mc.player.getRotationClient().y)); + + float center_x = pos.x + (width / 2); + float center_y = pos.y - 2 + (height / 2); + + // Render Entities + for (Entity entity : mc.world.getEntities()) { + Color c ; + if (entity instanceof LivingEntity && !(entity instanceof PlayerEntity)) { + if (entity instanceof AnimalEntity) { + c = new Color(0, 255, 0); + } else if (entity instanceof Monster) { + c = new Color(255, 0, 0); + } else { + c = new Color(0, 0, 255); + } + }else { + continue; + } + + float ratio_x = (float)((entity.getX() - mc.player.getX())) / (distance); + float ratio_y = (float)((entity.getZ() - mc.player.getZ())) / (distance); + + float fake_x = (pos.x + (width / 2) - (width * ratio_x / 2)); + float fake_y = (pos.y - 2 + (height / 2) - (width * ratio_y / 2)); + + float radius_x = (float)((cos_theta * (fake_x - center_x)) - (sin_theta * (fake_y - center_y))) + center_x; + float radius_y = (float)((sin_theta * (fake_x - center_x)) + (cos_theta * (fake_y - center_y))) + center_y; + + RenderUtils.drawBox(matrixStack, (int)(Math.min(pos.x + width - 5, Math.max(pos.x, radius_x))) , (int)(Math.min(pos.y - 5 + height, Math.max(pos.y, radius_y))), 3, 3, c); + } + + // Render Players + for (AbstractClientPlayerEntity entity : mc.world.getPlayers()) { + if(entity != mc.player) { + float ratio_x = (float)((entity.getX() - mc.player.getX())) / (distance); + float ratio_y = (float)((entity.getZ() - mc.player.getZ())) / (distance); + + float fake_x = (pos.x + (width / 2) - (width * ratio_x / 2)); + float fake_y = (pos.y + 28 + (height / 2) - (width * ratio_y / 2)); + + float radius_x = (float)((cos_theta * (fake_x - center_x)) - (sin_theta * (fake_y - center_y))) + center_x; + float radius_y = (float)((sin_theta * (fake_x - center_x)) + (cos_theta * (fake_y - center_y))) + center_y; + + RenderUtils.drawBox(matrixStack, (int)(Math.min(pos.x + width - 5, Math.max(pos.x, radius_x))), (int)(Math.min(pos.y + 25 + height, Math.max(pos.y, radius_y))), 3, 3, new Color(255, 255, 255, 255)); + RenderUtils.drawStringWithScale(drawContext, entity.getName().getString(), (int)(Math.min(pos.x + width - 5, Math.max(pos.x, radius_x))) - (mc.textRenderer.getWidth(entity.getName()) * 0.5f), (int)(Math.min(pos.y + 25 + height, Math.max(pos.y, radius_y))) - 10, GuiManager.foregroundColor.getValue(), 1.0f); + } + } + } + } + + @Override + public void update() { + + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/gui/screens/AddAltScreen.java b/remappedSrc/net/aoba/gui/screens/AddAltScreen.java new file mode 100644 index 00000000..7954315a --- /dev/null +++ b/remappedSrc/net/aoba/gui/screens/AddAltScreen.java @@ -0,0 +1,95 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.screens; + +import net.aoba.Aoba; +import net.aoba.altmanager.Alt; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.client.gui.widget.CheckboxWidget; +import net.minecraft.client.gui.widget.TextFieldWidget; + +import net.minecraft.text.OrderedText; +import net.minecraft.text.Style; +import net.minecraft.text.Text; + +public class AddAltScreen extends Screen { + + private final AltScreen parent; + + private ButtonWidget buttonAddAlt; + private CheckboxWidget toggleMicrosoft; + private TextFieldWidget textFieldAltUsername; + private TextFieldWidget textFieldAltPassword; + + public AddAltScreen(AltScreen parentScreen) { + super(Text.of("Alt Manager")); + this.parent = parentScreen; + } + + public void init() { + super.init(); + + this.textFieldAltUsername = new TextFieldWidget(textRenderer, this.width / 2 - 100, height / 2 - 76, 200, 20, + Text.of("Enter Name")); + this.textFieldAltUsername.setText(""); + this.addDrawableChild(this.textFieldAltUsername); + + this.textFieldAltPassword = new TextFieldWidget(textRenderer, this.width / 2 - 100, height / 2 - 36, 200, 20, + Text.of("Enter Password")); + this.textFieldAltPassword.setText(""); + this.addDrawableChild(this.textFieldAltPassword); + textFieldAltPassword.setRenderTextProvider((text, n) -> { + String str = ""; + for(int i = 0; i < text.length(); i++) + str += "*"; + return OrderedText.styledForwardsVisitedString(str, Style.EMPTY); + }); + + this.toggleMicrosoft = CheckboxWidget.builder(Text.of("Microsoft Account?"), textRenderer).pos(this.width / 2 - 100, height / 2 + - 12).build(); + this.addDrawableChild(this.toggleMicrosoft); + + this.buttonAddAlt = ButtonWidget.builder(Text.of("Add Alt"), b -> this.onButtonAltAddPressed()) + .dimensions(this.width / 2 - 100, this.height / 2 + 24, 200, 20).build(); + this.addDrawableChild(this.buttonAddAlt); + + this.addDrawableChild(ButtonWidget.builder(Text.of("Cancel"), b -> this.onButtonCancelPressed()) + .dimensions(this.width / 2 - 100, this.height / 2 + 46, 200, 20).build()); + } + + @Override + public void render(DrawContext drawContext, int mouseX, int mouseY, float delta) { + this.renderBackground(drawContext, mouseX, mouseY, delta); + drawContext.drawCenteredTextWithShadow(textRenderer, "Add Alternate Account", this.width / 2, 20, 16777215); + drawContext.drawCenteredTextWithShadow(textRenderer, "Username:", this.width / 2 - 100, height / 2 - 90, 16777215); + drawContext.drawCenteredTextWithShadow(textRenderer, "Password:", this.width / 2 - 100, height / 2 - 50, 16777215); + super.render(drawContext, mouseX, mouseY, delta); + } + + private void onButtonAltAddPressed() { + Alt alt = new Alt(this.textFieldAltUsername.getText(), this.textFieldAltPassword.getText(), this.toggleMicrosoft.isChecked()); + Aoba.getInstance().altManager.addAlt(alt); + this.parent.refreshAltList(); + } + + public void onButtonCancelPressed() { + client.setScreen(this.parent); + } +} diff --git a/remappedSrc/net/aoba/gui/screens/AltScreen.java b/remappedSrc/net/aoba/gui/screens/AltScreen.java new file mode 100644 index 00000000..6b574e7f --- /dev/null +++ b/remappedSrc/net/aoba/gui/screens/AltScreen.java @@ -0,0 +1,141 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.screens; + +import java.util.List; +import net.aoba.Aoba; +import net.aoba.altmanager.Alt; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.text.Text; + +public class AltScreen extends Screen { + private final Screen parentScreen; + private ButtonWidget editButton; + private ButtonWidget deleteButton; + private AltSelectionList altListSelector; + + public AltScreen(Screen parentScreen) { + super(Text.of("Alt Manager")); + this.parentScreen = parentScreen; + } + + public void init() { + super.init(); + //this.client.keyboard.setRepeatEvents(true); + + this.altListSelector = new AltSelectionList(this, this.client, this.width, this.height, 32, this.height - 64); + this.altListSelector.updateAlts(); + this.addDrawableChild(this.altListSelector); + + this.deleteButton = ButtonWidget.builder(Text.of("Delete Alt"), b -> this.deleteSelected()) + .dimensions(this.width / 2 - 154, this.height - 28, 100, 20).build(); + this.deleteButton.active = false; + this.addDrawableChild(this.deleteButton); + + this.addDrawableChild(ButtonWidget.builder(Text.of("Direct Login"), b -> client.setScreen(new DirectLoginAltScreen(this))) + .dimensions(this.width / 2 - 50, this.height - 52, 100, 20).build()); + + + this.addDrawableChild(ButtonWidget.builder(Text.of("Add Alt"), b -> client.setScreen(new AddAltScreen(this))) + .dimensions(this.width / 2 + 4 + 50, this.height - 52, 100, 20).build()); + + this.addDrawableChild(ButtonWidget.builder(Text.of("Cancel"), b -> client.setScreen(this.parentScreen)) + .dimensions(this.width / 2 + 54, this.height - 28, 100, 20).build()); + + + this.editButton = ButtonWidget.builder(Text.of("Edit Alt"), b -> this.editSelected()) + .dimensions(this.width / 2 - 50, this.height - 28, 100, 20).build(); + this.editButton.active = false; + this.addDrawableChild(this.editButton); + + + this.addDrawableChild(ButtonWidget.builder(Text.of("MCLeaks Login"), b -> client.setScreen(new MCLeaksLoginScreen(this))) + .dimensions(this.width / 2 - 154, this.height - 52, 100, 20).build()); + } + + @Override + public void tick() + { + AltSelectionList.Entry altselectionlist$entry = this.altListSelector.getSelectedOrNull(); + if (altselectionlist$entry == null) + return; + } + + @Override + public void render(DrawContext drawContext, int mouseX, int mouseY, float partialTicks) { + this.renderBackground(drawContext, mouseX, mouseY, partialTicks); + this.altListSelector.render(drawContext, mouseX, mouseY, partialTicks); + + super.render(drawContext, mouseX, mouseY, partialTicks); + drawContext.drawCenteredTextWithShadow(textRenderer,"Currently Logged Into: " + MinecraftClient.getInstance().getSession().getUsername(), + this.width / 2, 20, 16777215); + } + + public List getAltList() { + return Aoba.getInstance().altManager.getAlts(); + } + + public void refreshAltList() { + this.client.setScreen(new AltScreen(this.parentScreen)); + } + + public void setSelected(AltSelectionList.Entry selected) { + this.altListSelector.setSelected(selected); + this.setEdittable(); + } + + protected void setEdittable() { + this.editButton.active = true; + this.deleteButton.active = true; + } + + public void loginToSelected() { + AltSelectionList.Entry altselectionlist$entry = this.altListSelector.getSelectedOrNull(); + if (altselectionlist$entry == null) { + return; + } + + Alt alt = ((AltSelectionList.NormalEntry) altselectionlist$entry).getAltData(); + if (alt.isCracked()) { + Aoba.getInstance().altManager.loginCracked(alt.getEmail()); + } else { + Aoba.getInstance().altManager.login(alt); + } + } + + public void editSelected() { + Alt alt = ((AltSelectionList.NormalEntry)this.altListSelector.getSelectedOrNull()).getAltData(); + if (alt == null) { + return; + } + client.setScreen(new EditAltScreen(this, alt)); + } + + public void deleteSelected() { + Alt alt = ((AltSelectionList.NormalEntry)this.altListSelector.getSelectedOrNull()).getAltData(); + if (alt == null) { + return; + } + Aoba.getInstance().altManager.removeAlt(alt); + this.refreshAltList(); + } +} diff --git a/remappedSrc/net/aoba/gui/screens/AltSelectionList.java b/remappedSrc/net/aoba/gui/screens/AltSelectionList.java new file mode 100644 index 00000000..f136ab00 --- /dev/null +++ b/remappedSrc/net/aoba/gui/screens/AltSelectionList.java @@ -0,0 +1,203 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.screens; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.UUID; +import org.jetbrains.annotations.Nullable; +import org.lwjgl.opengl.GL11; +import com.mojang.authlib.GameProfile; +import com.mojang.blaze3d.systems.RenderSystem; +import net.aoba.altmanager.Alt; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.font.TextRenderer; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.Element; +import net.minecraft.client.gui.Selectable; +import net.minecraft.client.gui.widget.ElementListWidget; +import net.minecraft.client.network.PlayerListEntry; +import net.minecraft.util.Util; +import net.minecraft.util.Uuids; + +public class AltSelectionList extends ElementListWidget { + private final AltScreen owner; + private final List altList = new ArrayList(); + + public AltSelectionList(AltScreen ownerIn, MinecraftClient minecraftClient, int i, int j, int k, int l) { + super(minecraftClient, i, j, k, l); + this.owner = ownerIn; + } + + public void updateAlts() { + this.clearEntries(); + for (Alt alt : this.owner.getAltList()) { + AltSelectionList.NormalEntry entry = new AltSelectionList.NormalEntry(this.owner, alt); + altList.add(entry); + } + this.setList(); + } + + private void setList() { + this.altList.forEach(this::addEntry); + } + + public void setSelected(@Nullable AltSelectionList.Entry entry) { + super.setSelected(entry); + } + + @Override + public boolean keyPressed(int keyCode, int scanCode, int modifiers) { + AltSelectionList.Entry AltSelectionList$entry = this.getSelectedOrNull(); + return AltSelectionList$entry != null && AltSelectionList$entry.keyPressed(keyCode, scanCode, modifiers) + || super.keyPressed(keyCode, scanCode, modifiers); + } + + public abstract static class Entry extends ElementListWidget.Entry { + } + + public class NormalEntry extends AltSelectionList.Entry { + private final AltScreen owner; + private final MinecraftClient mc; + private final Alt alt; + private long lastClickTime; + private PlayerListEntry entry; + + protected NormalEntry(AltScreen ownerIn, Alt alt) { + this.owner = ownerIn; + this.alt = alt; + this.mc = MinecraftClient.getInstance(); + + try { + String name = alt.getUsername(); + if (name.isEmpty()) { + name = "Steve"; + } + + + UUID uuid = Uuids.getOfflinePlayerUuid(name);; + entry = new PlayerListEntry(new GameProfile(uuid, name), false); + + } catch (Exception e) { + e.printStackTrace(); + } + } + + public void getAltList() { + this.owner.getAltList(); + } + + public Alt getAltData() { + return this.alt; + } + + @Override + public void render(DrawContext drawContext, int index, int y, int x, int entryWidth, int entryHeight, + int mouseX, int mouseY, boolean hovered, float tickDelta) { + + String password = ""; + String description; + + // Generates string for the password of an alt. + if (!this.alt.isCracked()) { + for (int i = 0; i < this.alt.getPassword().toCharArray().length; i++) { + password = password + "*"; + } + } else { + password = "None"; + } + + // Generates the description of an alt. + if (this.alt.isCracked()) { + description = "Cracked Account"; + } else { + if (this.alt.isMicrosoft()) { + description = "Microsoft Account"; + } else { + description = "Mojang Account"; + } + } + + // Draws the strings onto the screen. + TextRenderer textRenderer = this.mc.textRenderer; + drawContext.drawTextWithShadow(textRenderer, "Username: " + this.alt.getEmail(), (x + 32 + 3), + (y + 2), 16777215); + drawContext.drawTextWithShadow(textRenderer, "Username: " + this.alt.getEmail(), (x + 32 + 3), + (y + 2), 16777215); + drawContext.drawTextWithShadow(textRenderer, "Password: " + password, (x + 32 + 3), (y + 12), + 16777215); + drawContext.drawText(textRenderer, description, (x + 32 + 3), (y + 22), + this.alt.isCracked() ? 0xFF0000 : 0x00FF00, true); + + // Draws the respective player head. + this.drawHead(drawContext, x + 4, y + 4); + } + + private void drawHead(DrawContext drawContext, int x, int y) { + GL11.glEnable(GL11.GL_BLEND); + RenderSystem.setShaderColor(1, 1, 1, 1); + + // Face + int fw = 192; + int fh = 192; + float u = 24; + float v = 24; + drawContext.drawTexture(entry.getSkinTextures().texture(), x, y, y, u, v, 24, 24, fw, fh); + + // Hat + fw = 192; + fh = 192; + u = 120; + v = 24; + drawContext.drawTexture(entry.getSkinTextures().texture(), x, y, y, u, v, 24, 24, fw, fh); + + GL11.glDisable(GL11.GL_BLEND); + } + + @Override + public List children() { + return Collections.emptyList(); + } + + @Override + public List selectableChildren() { + return Collections.emptyList(); + } + + @Override + public boolean mouseClicked(double mouseX, double mouseY, int button) { + double d0 = mouseX - (double) AltSelectionList.this.getRowLeft(); + + if (d0 <= 32.0D) { + if (d0 < 32.0D && d0 > 16.0D) { + this.owner.setSelected(this); + this.owner.loginToSelected(); + return true; + } + } + this.owner.setSelected(this); + if (Util.getMeasuringTimeMs() - this.lastClickTime < 250L) { + this.owner.loginToSelected(); + } + this.lastClickTime = Util.getMeasuringTimeMs(); + return false; + } + } +} diff --git a/remappedSrc/net/aoba/gui/screens/DirectLoginAltScreen.java b/remappedSrc/net/aoba/gui/screens/DirectLoginAltScreen.java new file mode 100644 index 00000000..d67d4a08 --- /dev/null +++ b/remappedSrc/net/aoba/gui/screens/DirectLoginAltScreen.java @@ -0,0 +1,114 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.screens; + +import net.aoba.Aoba; +import net.aoba.altmanager.Alt; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.client.gui.widget.CheckboxWidget; +import net.minecraft.client.gui.widget.TextFieldWidget; +import net.minecraft.text.OrderedText; +import net.minecraft.text.Style; +import net.minecraft.text.Text; + +public class DirectLoginAltScreen extends Screen{ + + private final Screen parent; + private ButtonWidget buttonLoginAlt; + private CheckboxWidget toggleMicrosoft; + + private TextFieldWidget textFieldAltUsername; + private TextFieldWidget textFieldAltPassword; + + private boolean didLoginError = false; + + protected DirectLoginAltScreen(Screen parent) { + super(Text.of("Direct Login")); + this.parent = parent; + } + + public void init() { + super.init(); + + this.textFieldAltUsername = new TextFieldWidget(textRenderer, this.width / 2 - 100, height / 2 - 76, 200, 20, Text.of("Enter Name")); + this.addDrawableChild(this.textFieldAltUsername); + + this.textFieldAltPassword = new TextFieldWidget(textRenderer, this.width / 2 - 100, height / 2 - 36, 200, 20, Text.of("Enter Password")); + textFieldAltPassword.setRenderTextProvider((text, n) -> { + String str = ""; + for(int i = 0; i < text.length(); i++) + str += "*"; + return OrderedText.styledForwardsVisitedString(str, Style.EMPTY); + }); + this.addDrawableChild(this.textFieldAltPassword); + + this.toggleMicrosoft = CheckboxWidget.builder(Text.of("Microsoft Account?"), textRenderer).pos(this.width / 2 - 100, height / 2 + - 12).build(); + this.addDrawableChild(this.toggleMicrosoft); + + this.buttonLoginAlt = ButtonWidget.builder(Text.of("Login"), b -> this.onButtonLoginPressed()) + .dimensions(this.width / 2 - 100, this.height / 2 + 24, 200, 20).build(); + this.addDrawableChild(this.buttonLoginAlt); + + this.addDrawableChild(ButtonWidget.builder(Text.of("Cancel"), b -> client.setScreen(this.parent)) + .dimensions(this.width / 2 - 100, this.height / 2 + 46, 200, 20).build()); + } + + @Override + public void tick() { + // TODO: + // this.textFieldAltUsername.tick(); + //this.textFieldAltPassword.tick(); + } + + private void onButtonLoginPressed() { + boolean loggedIn = false; + if(this.textFieldAltPassword.getText().isEmpty()) { + Aoba.getInstance().altManager.loginCracked(this.textFieldAltUsername.getText()); + client.setScreen(this.parent); + return; + }else { + Alt alt = new Alt(this.textFieldAltUsername.getText(), this.textFieldAltPassword.getText(), this.toggleMicrosoft.isChecked()); + loggedIn = Aoba.getInstance().altManager.login(alt); + } + + if(!loggedIn) { + didLoginError = true; + }else { + client.setScreen(this.parent); + } + } + + @Override + public void render(DrawContext drawContext, int mouseX, int mouseY, float partialTicks) { + this.renderBackground(drawContext, mouseX, mouseY, partialTicks); + drawContext.drawCenteredTextWithShadow(textRenderer, this.title.getString(), this.width / 2, 20, 16777215); + drawContext.drawTextWithShadow(textRenderer, this.textFieldAltPassword.getText().isEmpty() ? "Cracked Account" : "Premium Account", this.width / 2 - 100, height / 2 - 106, this.textFieldAltPassword.getText().isEmpty() ? 0xFF0000 : 0x00FF00); + drawContext.drawTextWithShadow(textRenderer, "Enter Username", this.width / 2 - 100, height / 2 - 90, 16777215); + drawContext.drawTextWithShadow(textRenderer, "Enter Password", this.width / 2 - 100, height / 2 - 50, 16777215); + //drawStringWithShadow(matrixStack,textRenderer, "Microsoft: ", this.width / 2 - 100, height / 2 - 10, 16777215); + this.textFieldAltUsername.render(drawContext,mouseX, mouseY, partialTicks); + this.textFieldAltPassword.render(drawContext,mouseX, mouseY, partialTicks); + if (didLoginError) { + drawContext.drawTextWithShadow(textRenderer, "Incorrect Login (Try using Email rather than Username)", this.width / 2 - 140, 116, 0xFF0000); + } + super.render(drawContext, mouseX, mouseY, partialTicks); + } +} diff --git a/remappedSrc/net/aoba/gui/screens/EditAltScreen.java b/remappedSrc/net/aoba/gui/screens/EditAltScreen.java new file mode 100644 index 00000000..8de349a1 --- /dev/null +++ b/remappedSrc/net/aoba/gui/screens/EditAltScreen.java @@ -0,0 +1,104 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.screens; + +import net.aoba.Aoba; +import net.aoba.altmanager.Alt; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.client.gui.widget.CheckboxWidget; +import net.minecraft.client.gui.widget.TextFieldWidget; +import net.minecraft.text.OrderedText; +import net.minecraft.text.Style; +import net.minecraft.text.Text; + +public class EditAltScreen extends Screen { + + private final AltScreen parent; + private Alt alt; + + private ButtonWidget buttonSaveAlt; + private CheckboxWidget toggleMicrosoft; + private TextFieldWidget textFieldAltUsername; + private TextFieldWidget textFieldAltPassword; + + public EditAltScreen(AltScreen parentScreen, Alt alt) { + super(Text.of("Alt Manager")); + this.parent = parentScreen; + this.alt = alt; + } + + public void init() { + super.init(); + this.textFieldAltUsername = new TextFieldWidget(textRenderer, this.width / 2 - 100, height / 2 - 76, 200, 20, + Text.of("Enter Name")); + this.textFieldAltUsername.setText(this.alt == null ? "" : alt.getEmail()); + this.addDrawableChild(this.textFieldAltUsername); + + this.textFieldAltPassword = new TextFieldWidget(textRenderer, this.width / 2 - 100, height / 2 - 36, 200, 20, + Text.of("Enter Password")); + this.textFieldAltPassword.setText(this.alt == null ? "" : alt.getPassword()); + textFieldAltPassword.setRenderTextProvider((text, n) -> { + String str = ""; + for(int i = 0; i < text.length(); i++) + str += "*"; + return OrderedText.styledForwardsVisitedString(str, Style.EMPTY); + }); + this.addDrawableChild(this.textFieldAltPassword); + + this.toggleMicrosoft = CheckboxWidget.builder(Text.of("Microsoft Account?"), textRenderer).pos(this.width / 2 - 100, height / 2 + - 12).build(); + this.addDrawableChild(this.toggleMicrosoft); + + + + this.buttonSaveAlt = ButtonWidget.builder(Text.of("Save Alt"), b -> this.onButtonAltEditPressed()) + .dimensions(this.width / 2 - 100, this.height / 2 + 24, 200, 20).build(); + this.addDrawableChild(this.buttonSaveAlt); + this.addDrawableChild(ButtonWidget.builder(Text.of("Cancel"), b -> this.onButtonCancelPressed()) + .dimensions(this.width / 2 - 100, this.height / 2 + 46, 200, 20).build()); + } + + @Override + public void tick() { + // TODO: + //this.textFieldAltUsername.tick(); + //this.textFieldAltPassword.tick(); + } + + @Override + public void render(DrawContext drawContext, int mouseX, int mouseY, float partialTicks) { + this.renderBackground(drawContext, mouseX, mouseY, partialTicks); + drawContext.drawCenteredTextWithShadow(textRenderer, "Edit Alternate Account", this.width / 2, 20, 16777215); + drawContext.drawTextWithShadow(textRenderer, "Username:", this.width / 2 - 100, height / 2 - 90, 16777215); + drawContext.drawTextWithShadow(textRenderer, "Password:", this.width / 2 - 100, height / 2 - 50, 16777215); + super.render(drawContext, mouseX, mouseY, partialTicks); + } + + private void onButtonAltEditPressed() { + alt.setEmail(this.textFieldAltUsername.getText()); + alt.setPassword(this.textFieldAltPassword.getText()); + Aoba.getInstance().altManager.saveAlts(); + this.parent.refreshAltList(); + } + + public void onButtonCancelPressed() { + client.setScreen(this.parent); + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/gui/screens/MCLeaksLoginScreen.java b/remappedSrc/net/aoba/gui/screens/MCLeaksLoginScreen.java new file mode 100644 index 00000000..7356f533 --- /dev/null +++ b/remappedSrc/net/aoba/gui/screens/MCLeaksLoginScreen.java @@ -0,0 +1,82 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.screens; + +import net.aoba.Aoba; +import net.aoba.altmanager.exceptions.APIDownException; +import net.aoba.altmanager.exceptions.APIErrorException; +import net.aoba.altmanager.exceptions.InvalidResponseException; +import net.aoba.altmanager.exceptions.InvalidTokenException; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.client.gui.widget.TextFieldWidget; +import net.minecraft.text.Text; + +public class MCLeaksLoginScreen extends Screen{ + + private final Screen parent; + private ButtonWidget buttonLoginAlt; + + private TextFieldWidget textFieldToken; + + private boolean didLoginError = false; + + protected MCLeaksLoginScreen(Screen parent) { + super(Text.of("MCLeaks Login")); + this.parent = parent; + } + + public void init() { + super.init(); + + this.textFieldToken = new TextFieldWidget(textRenderer, this.width / 2 - 100, 206, 200, 20, Text.of("Enter MCLeaks Token")); + this.addDrawableChild(this.textFieldToken); + + + + this.buttonLoginAlt = ButtonWidget.builder(Text.of("Login"), b -> this.onButtonLoginPressed()) + .dimensions(this.width / 2 - 100, this.height / 4 + 96 + 18, 200, 20).build(); + this.addDrawableChild(this.buttonLoginAlt); + this.addDrawableChild(ButtonWidget.builder(Text.of("Cancel"), b -> client.setScreen(this.parent)) + .dimensions(this.width / 2 - 100, this.height / 4 + 120 + 18, 200, 20).build()); + } + + private void onButtonLoginPressed() { + try { + Aoba.getInstance().altManager.loginMCLeaks(this.textFieldToken.getText()); + client.setScreen(this.parent); + } catch (APIDownException | APIErrorException | InvalidResponseException | InvalidTokenException e) { + didLoginError = true; + e.printStackTrace(); + } + } + + @Override + public void render(DrawContext drawContext, int mouseX, int mouseY, float partialTicks) { + this.renderBackground(drawContext, mouseX, mouseY, partialTicks); + drawContext.drawCenteredTextWithShadow(textRenderer, this.title.getString(), this.width / 2, 17, 16777215); + drawContext.drawTextWithShadow(textRenderer, "Enter Token", this.width / 2 - 100, 194, 10526880); + this.textFieldToken.render(drawContext, mouseX, mouseY, partialTicks); + if (didLoginError) { + drawContext.drawTextWithShadow(textRenderer, "Incorrect Token", this.width / 2 - 140, 116, 0xFF0000); + } + super.render(drawContext, mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/gui/tabs/AuthCrackerTab.java b/remappedSrc/net/aoba/gui/tabs/AuthCrackerTab.java new file mode 100644 index 00000000..87facf7a --- /dev/null +++ b/remappedSrc/net/aoba/gui/tabs/AuthCrackerTab.java @@ -0,0 +1,143 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.tabs; + +import java.io.IOException; +import java.net.URL; +import java.util.Scanner; +import java.util.concurrent.TimeUnit; + +import net.aoba.gui.tabs.components.ButtonComponent; +import net.aoba.gui.tabs.components.SliderComponent; +import net.aoba.gui.tabs.components.StackPanelComponent; +import net.aoba.gui.tabs.components.StringComponent; +import net.aoba.settings.types.FloatSetting; +import net.minecraft.client.MinecraftClient; + +public class AuthCrackerTab extends ClickGuiTab { + private ButtonComponent start; + + private FloatSetting delay = new FloatSetting("authcracker_delay", "Delay", 100, 50, 50000, 1, null); + + private AuthCracker authCracker; + + Runnable startRunnable; + Runnable endRunnable; + + public AuthCrackerTab(String title, int x, int y){ + super(title, x, y, false); + this.width = 360.0f; + + StackPanelComponent stackPanel = new StackPanelComponent(this); + stackPanel.setTop(30); + + StringComponent label = new StringComponent("This panel can be used to break Auth passwords used in cracked servers.", stackPanel); + stackPanel.addChild(label); + + SliderComponent slider = new SliderComponent(stackPanel, delay); + stackPanel.addChild(slider); + + authCracker = new AuthCracker(delay); + + this.startRunnable = new Runnable() { + @Override + public void run() { + authCracker.Start(); + start.setText("Cancel"); + start.setOnClick(endRunnable); + } + }; + + this.endRunnable = new Runnable() { + @Override + public void run() { + authCracker.Stop(); + start.setText("Start"); + start.setOnClick(startRunnable); + } + }; + + start = new ButtonComponent(stackPanel, "Start", startRunnable); + stackPanel.addChild(start); + + this.children.add(stackPanel); + } +} + +class AuthCracker{ + + private Thread curThread; + private boolean shouldContinue = true; + private MinecraftClient mc = MinecraftClient.getInstance(); + private FloatSetting delay; + + public AuthCracker(FloatSetting delay) { + this.delay = delay; + } + + private long time = System.currentTimeMillis(); + + private void RunAuthCracker() { + System.out.println("Aoba AuthMe Cracker Started."); + URL url; + Scanner s = null; + try { + url = new URL("https://raw.githubusercontent.com/danielmiessler/SecLists/master/Passwords/Common-Credentials/10-million-password-list-top-1000000.txt"); + s = new Scanner(url.openStream()); + } catch (IOException e) { + e.printStackTrace(); + } + if(s != null) { + while(shouldContinue && s.hasNextLine()) { + if(System.currentTimeMillis() - time > delay.getValue().floatValue()) { + String str = s.nextLine(); + while(mc.player == null) { + try { + TimeUnit.SECONDS.sleep(1); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + if(mc.player.networkHandler != null) { + mc.player.networkHandler.sendChatCommand("login " + str); + time = System.currentTimeMillis(); + }else { + System.out.println("Network Handler is null"); + } + } + } + } + + System.out.println("Aoba AuthMe Cracker Stopped."); + } + + public void Start() { + curThread = new Thread(new Runnable() { + @Override + public void run() { + RunAuthCracker(); + } + }); + curThread.start(); + } + + public void Stop() { + this.shouldContinue = false; + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/gui/tabs/ClickGuiTab.java b/remappedSrc/net/aoba/gui/tabs/ClickGuiTab.java new file mode 100644 index 00000000..6249e167 --- /dev/null +++ b/remappedSrc/net/aoba/gui/tabs/ClickGuiTab.java @@ -0,0 +1,183 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * A class to represent a ClickGui Tab that contains different Components. + */ + +package net.aoba.gui.tabs; + +import net.aoba.Aoba; +import net.aoba.event.events.LeftMouseDownEvent; +import net.aoba.event.listeners.LeftMouseDownListener; +import net.aoba.event.listeners.MouseMoveListener; +import net.aoba.gui.AbstractGui; +import net.aoba.gui.GuiManager; +import net.aoba.gui.colors.Color; +import net.aoba.gui.tabs.components.Component; +import net.aoba.misc.RenderUtils; +import net.aoba.settings.SettingManager; +import net.aoba.settings.types.BooleanSetting; +import net.aoba.utils.types.Vector2; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.util.Identifier; + +public class ClickGuiTab extends AbstractGui implements LeftMouseDownListener, MouseMoveListener { + protected String title; + + protected boolean pinnable = true; + protected boolean drawBorder = true; + + private BooleanSetting isPinned; + private Identifier icon = null; + + public ClickGuiTab(String title, int x, int y, boolean pinnable) { + super(title + "_tab", x, y, 180, 0); + this.title = title; + + this.pinnable = pinnable; + + isPinned = new BooleanSetting(title + "_pinned", "IS PINNED", false); + SettingManager.registerSetting(isPinned, Aoba.getInstance().settingManager.hidden_category); + } + + public ClickGuiTab(String title, int x, int y, boolean pinnable, String iconName) { + super(title + "_tab", x, y, 180, 0); + this.title = title; + + this.pinnable = pinnable; + + isPinned = new BooleanSetting(title + "_pinned", "IS PINNED", false); + SettingManager.registerSetting(isPinned, Aoba.getInstance().settingManager.hidden_category); + icon = new Identifier("aoba", "/textures/" + iconName.trim().toLowerCase() + ".png"); + } + + public final String getTitle() { + return title; + } + + public final boolean isPinned() { + return isPinned.getValue(); + } + + public final void setPinned(boolean pin) { + this.isPinned.setValue(pin); + } + + public final void setTitle(String title) { + + this.title = title; + } + + public final boolean isGrabbed() { + return (GuiManager.currentGrabbed == this); + } + + public final void addChild(Component component) { + this.children.add(component); + } + + @Override + public void update() { + if (this.inheritHeightFromChildren) { + float tempHeight = 0; + for (Component child : children) { + tempHeight += (child.getHeight()); + } + this.setHeight(tempHeight); + } + + if (Aoba.getInstance().hudManager.isClickGuiOpen()) { + for (Component child : this.children) { + child.update(); + } + } + } + + public void preupdate() { + } + + public void postupdate() { + } + + @Override + public void draw(DrawContext drawContext, float partialTicks) { + MatrixStack matrixStack = drawContext.getMatrices(); + + Vector2 pos = position.getValue(); + + + if (drawBorder) { + // Draws background depending on components width and height + RenderUtils.drawRoundedBox(matrixStack, pos.x, pos.y, width, height + 30, 6, GuiManager.backgroundColor.getValue()); + RenderUtils.drawRoundedOutline(matrixStack, pos.x, pos.y, width, height + 30, 6, GuiManager.borderColor.getValue()); + + if(icon != null) { + RenderUtils.drawTexturedQuad(drawContext, icon, pos.x + 8, pos.y + 4, 22, 22, GuiManager.foregroundColor.getValue()); + RenderUtils.drawString(drawContext, this.title, pos.x + 38, pos.y + 8, GuiManager.foregroundColor.getValue()); + }else + RenderUtils.drawString(drawContext, this.title, pos.x + 8, pos.y + 8, GuiManager.foregroundColor.getValue()); + + RenderUtils.drawLine(matrixStack, pos.x, pos.y + 30, pos.x + width, pos.y + 30, new Color(0, 0, 0, 100)); + + if (this.pinnable) { + if (this.isPinned.getValue()) { + RenderUtils.drawRoundedBox(matrixStack, pos.x + width - 23, pos.y + 8, 15, 15, 6f, new Color(154, 0, 0, 200)); + RenderUtils.drawRoundedOutline(matrixStack, pos.x + width - 23, pos.y + 8, 15, 15, 6f, new Color(0, 0, 0, 200)); + } else { + RenderUtils.drawRoundedBox(matrixStack, pos.x + width - 23, pos.y + 8, 15, 15, 6f, new Color(128, 128, 128, 50)); + RenderUtils.drawRoundedOutline(matrixStack, pos.x + width - 23, pos.y + 8, 15, 15, 6f, new Color(0, 0, 0, 50)); + } + } + } + for (Component child : children) { + child.draw(drawContext, partialTicks); + } + } + + @Override + public void OnLeftMouseDown(LeftMouseDownEvent event) { + double mouseX = mc.mouse.getX(); + double mouseY = mc.mouse.getY(); + Vector2 pos = position.getValue(); + + if (Aoba.getInstance().hudManager.isClickGuiOpen()) { + // Allow the user to move the clickgui if it within the header bar and NOT pinned. + if(!isPinned.getValue()) { + if(mouseX >= pos.x && mouseX <= pos.x + width) { + if(mouseY >= pos.y && mouseY <= pos.y + 24) { + lastClickOffsetX = mouseX - pos.x; + lastClickOffsetY = mouseY - pos.y; + GuiManager.currentGrabbed = this; + } + } + } + + // If the GUI is pinnable, allow the user to click the pin button to pin a gui + if (pinnable) { + if (mouseX >= (pos.x + width - 24) && mouseX <= (pos.x + width - 2)) { + if (mouseY >= (pos.y + 4) && mouseY <= (pos.y + 20)) { + GuiManager.currentGrabbed = null; + isPinned.silentSetValue(!isPinned.getValue()); + } + } + } + } + } +} diff --git a/remappedSrc/net/aoba/gui/tabs/HudsTab.java b/remappedSrc/net/aoba/gui/tabs/HudsTab.java new file mode 100644 index 00000000..6b949c39 --- /dev/null +++ b/remappedSrc/net/aoba/gui/tabs/HudsTab.java @@ -0,0 +1,112 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.tabs; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Set; + +import net.aoba.Aoba; +import net.aoba.event.events.MouseScrollEvent; +import net.aoba.event.listeners.MouseScrollListener; +import net.aoba.gui.GuiManager; +import net.aoba.gui.colors.Color; +import net.aoba.gui.font.FontManager; +import net.aoba.gui.hud.AbstractHud; +import net.aoba.gui.tabs.components.ColorPickerComponent; +import net.aoba.gui.tabs.components.HudComponent; +import net.aoba.gui.tabs.components.KeybindComponent; +import net.aoba.gui.tabs.components.ListComponent; +import net.aoba.gui.tabs.components.StackPanelComponent; +import net.aoba.gui.tabs.components.StringComponent; +import net.minecraft.client.font.TextRenderer; +import net.minecraft.client.gui.DrawContext; +import net.aoba.module.Module; +import net.aoba.settings.types.StringSetting; + +public class HudsTab extends ClickGuiTab implements MouseScrollListener { + + int visibleScrollElements; + int currentScroll; + + public HudsTab(AbstractHud[] abstractHuds) { + super("Hud Options", 50, 50, false); + + Aoba.getInstance().eventManager.AddListener(MouseScrollListener.class, this); + StackPanelComponent stackPanel = new StackPanelComponent(this); + stackPanel.setTop(30); + + List test = new ArrayList(); + + + HashMap fontRenderers = Aoba.getInstance().fontManager.fontRenderers; + Set set = fontRenderers.keySet(); + + for(String s : set) { + test.add(s); + } + + stackPanel.addChild(new StringComponent("Toggle HUD", stackPanel, GuiManager.foregroundColor.getValue(), true)); + + for(AbstractHud hud : abstractHuds) { + HudComponent hudComponent = new HudComponent(hud.getID(), stackPanel, hud); + stackPanel.addChild(hudComponent); + } + + // Keybinds Header + stackPanel.addChild(new StringComponent("Keybinds", stackPanel, GuiManager.foregroundColor.getValue(), true)); + + KeybindComponent clickGuiKeybindComponent = new KeybindComponent(stackPanel, Aoba.getInstance().hudManager.clickGuiButton); + clickGuiKeybindComponent.setHeight(30); + stackPanel.addChild(clickGuiKeybindComponent); + + // Hud Font Header + stackPanel.addChild(new StringComponent("HUD Font", stackPanel, GuiManager.foregroundColor.getValue(), true)); + + + + ListComponent listComponent = new ListComponent(stackPanel, test, Aoba.getInstance().fontManager.fontSetting); + stackPanel.addChild(listComponent); + + stackPanel.addChild(new StringComponent("HUD Colors", stackPanel, GuiManager.foregroundColor.getValue(), true)); + + stackPanel.addChild(new ColorPickerComponent(stackPanel, GuiManager.foregroundColor)); + stackPanel.addChild(new ColorPickerComponent(stackPanel, GuiManager.backgroundColor)); + stackPanel.addChild(new ColorPickerComponent(stackPanel, GuiManager.borderColor)); + + this.children.add(stackPanel); + this.setWidth(300); + } + + @Override + public void OnMouseScroll(MouseScrollEvent event) { + ArrayList modules = Aoba.getInstance().moduleManager.modules; + + if(event.GetVertical() > 0) + this.currentScroll = Math.min(currentScroll + 1, modules.size() - visibleScrollElements - 1); + else if(event.GetVertical() < 0) + this.currentScroll = Math.max(currentScroll - 1, 0); + } + + @Override + public void draw(DrawContext drawContext, float partialTicks) { + super.draw(drawContext, partialTicks); + } +} diff --git a/remappedSrc/net/aoba/gui/tabs/ModuleSettingsTab.java b/remappedSrc/net/aoba/gui/tabs/ModuleSettingsTab.java new file mode 100644 index 00000000..211f3c17 --- /dev/null +++ b/remappedSrc/net/aoba/gui/tabs/ModuleSettingsTab.java @@ -0,0 +1,171 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.tabs; + +import net.aoba.Aoba; +import net.aoba.event.events.LeftMouseDownEvent; +import net.aoba.event.listeners.LeftMouseDownListener; +import net.aoba.event.listeners.MouseMoveListener; +import net.aoba.gui.AbstractGui; +import net.aoba.gui.GuiManager; +import net.aoba.gui.colors.Color; +import net.aoba.gui.tabs.components.BlocksComponent; +import net.aoba.gui.tabs.components.CheckboxComponent; +import net.aoba.gui.tabs.components.ColorPickerComponent; +import net.aoba.gui.tabs.components.Component; +import net.aoba.gui.tabs.components.KeybindComponent; +import net.aoba.gui.tabs.components.ListComponent; +import net.aoba.gui.tabs.components.SliderComponent; +import net.aoba.gui.tabs.components.StackPanelComponent; +import net.aoba.misc.RenderUtils; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.util.math.MatrixStack; +import net.aoba.module.Module; +import net.aoba.settings.Setting; +import net.aoba.settings.types.BlocksSetting; +import net.aoba.settings.types.BooleanSetting; +import net.aoba.settings.types.ColorSetting; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.IndexedStringListSetting; +import net.aoba.settings.types.StringListSetting; +import net.aoba.utils.types.Vector2; + +public class ModuleSettingsTab extends AbstractGui implements LeftMouseDownListener, MouseMoveListener { + protected String title; + protected Module module; + + public ModuleSettingsTab(String title, float x, float y, Module module) { + super(title + "_tab", x, y, 180, 0); + this.title = title + " Settings"; + this.module = module; + this.setWidth(260); + + StackPanelComponent stackPanel = new StackPanelComponent(this); + stackPanel.setTop(30); + + KeybindComponent keybindComponent = new KeybindComponent(stackPanel, module.getBind()); + keybindComponent.setHeight(30); + stackPanel.addChild(keybindComponent); + + for (Setting setting : this.module.getSettings()) { + Component c; + if (setting instanceof FloatSetting) { + c = new SliderComponent(stackPanel, (FloatSetting) setting); + } else if (setting instanceof BooleanSetting) { + c = new CheckboxComponent(stackPanel, (BooleanSetting) setting); + //}else if (setting instanceof StringListSetting) { + //c = new ListComponent(stackPanel, (IndexedStringListSetting) setting); + } else if (setting instanceof ColorSetting) { + c = new ColorPickerComponent(stackPanel, (ColorSetting) setting); + } else if (setting instanceof BlocksSetting) { + c = new BlocksComponent(stackPanel, (BlocksSetting)setting); + } else { + c = null; + } + + if(c != null) { + stackPanel.addChild(c); + } + } + + this.addChild(stackPanel); + } + + public final String getTitle() { + return title; + } + + public final void setTitle(String title) { + + this.title = title; + } + + public final void addChild(Component component) { + this.children.add(component); + } + + @Override + public void update() { + if (this.inheritHeightFromChildren) { + float tempHeight = 0; + for (Component child : children) { + tempHeight += (child.getHeight()); + } + this.setHeight(tempHeight); + } + + if (Aoba.getInstance().hudManager.isClickGuiOpen()) { + for (Component child : this.children) { + child.update(); + } + } + } + + public void preupdate() { + } + + public void postupdate() { + } + + @Override + public void draw(DrawContext drawContext, float partialTicks) { + MatrixStack matrixStack = drawContext.getMatrices(); + + Vector2 pos = position.getValue(); + + // Draws background depending on components width and height + GuiManager hudManager = Aoba.getInstance().hudManager; + RenderUtils.drawRoundedBox(matrixStack, pos.x, pos.y, width, height + 30, 6, GuiManager.backgroundColor.getValue()); + RenderUtils.drawRoundedOutline(matrixStack, pos.x, pos.y, width, height + 30, 6, GuiManager.borderColor.getValue()); + + RenderUtils.drawString(drawContext, this.title, pos.x + 8, pos.y + 8, GuiManager.foregroundColor.getValue()); + RenderUtils.drawLine(matrixStack, pos.x, pos.y + 30, pos.x + width, pos.y + 30, new Color(0, 0, 0, 100)); + + RenderUtils.drawLine(matrixStack, pos.x + width - 23, pos.y + 8, pos.x + width - 8, pos.y + 23, new Color(255, 0, 0, 255)); + RenderUtils.drawLine(matrixStack, pos.x + width - 23, pos.y + 23, pos.x + width - 8, pos.y + 8, new Color(255, 0, 0, 255)); + + for (Component child : children) { + child.draw(drawContext, partialTicks); + } + } + + @Override + public void OnLeftMouseDown(LeftMouseDownEvent event) { + double mouseX = mc.mouse.getX(); + double mouseY = mc.mouse.getY(); + Vector2 pos = position.getValue(); + + if (Aoba.getInstance().hudManager.isClickGuiOpen()) { + if (mouseX >= pos.x && mouseX <= pos.x + width) { + if (mouseY >= pos.y && mouseY <= pos.y + 24) { + this.lastClickOffsetX = mouseX - pos.x; + this.lastClickOffsetY = mouseY - pos.y; + GuiManager.currentGrabbed = this; + } + } + + if (mouseX >= (pos.x + width - 24) && mouseX <= (pos.x + width - 2)) { + if (mouseY >= (pos.y + 4) && mouseY <= (pos.y + 20)) { + GuiManager.currentGrabbed = null; + Aoba.getInstance().hudManager.RemoveHud(this, "Modules"); + } + } + } + } +} diff --git a/remappedSrc/net/aoba/gui/tabs/OptionsTab.java b/remappedSrc/net/aoba/gui/tabs/OptionsTab.java new file mode 100644 index 00000000..58774809 --- /dev/null +++ b/remappedSrc/net/aoba/gui/tabs/OptionsTab.java @@ -0,0 +1,83 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.tabs; + +import java.util.ArrayList; +import net.aoba.Aoba; +import net.aoba.event.events.MouseScrollEvent; +import net.aoba.event.listeners.MouseScrollListener; +import net.aoba.gui.AbstractGui; +import net.aoba.gui.GuiManager; +import net.aoba.gui.colors.Color; +import net.aoba.misc.RenderUtils; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.util.Window; +import net.minecraft.client.util.math.MatrixStack; +import net.aoba.module.Module; +import net.aoba.utils.types.Vector2; + +public class OptionsTab extends AbstractGui implements MouseScrollListener { + + int visibleScrollElements; + int currentScroll; + + public OptionsTab() { + super("Options", 40, 220, 100, 100); + Aoba.getInstance().eventManager.AddListener(MouseScrollListener.class, this); + } + + @Override + public void update() { + Window window = mc.getWindow(); + this.setWidth(window.getWidth() - 240); + this.setHeight(window.getHeight() - 240); + + visibleScrollElements = (int) ((this.height - 30) / 30); + } + + @Override + public void draw(DrawContext drawContext, float partialTicks) { + MatrixStack matrixStack = drawContext.getMatrices(); + + Vector2 pos = position.getValue(); + + RenderUtils.drawRoundedBox(matrixStack, pos.x, pos.y, width, height, 6, GuiManager.backgroundColor.getValue()); + RenderUtils.drawRoundedOutline(matrixStack, pos.x, pos.y, width, height, 6, GuiManager.borderColor.getValue()); + RenderUtils.drawLine(matrixStack, pos.x + 480, pos.y, pos.x + 480, pos.y + height, new Color(0, 0, 0, 200)); + + ArrayList modules = Aoba.getInstance().moduleManager.modules; + + int yHeight = 30; + for (int i = currentScroll; i < Math.min(modules.size(), currentScroll + visibleScrollElements); i++) { + Module module = modules.get(i); + RenderUtils.drawString(drawContext, module.getName(), pos.x + 10, pos.y + yHeight, GuiManager.foregroundColor.getValue()); + yHeight += 30; + } + } + + @Override + public void OnMouseScroll(MouseScrollEvent event) { + ArrayList modules = Aoba.getInstance().moduleManager.modules; + + if(event.GetVertical() > 0) + this.currentScroll = Math.min(currentScroll + 1, modules.size() - visibleScrollElements - 1); + else if(event.GetVertical() < 0) + this.currentScroll = Math.max(currentScroll - 1, 0); + } +} diff --git a/remappedSrc/net/aoba/gui/tabs/components/BlocksComponent.java b/remappedSrc/net/aoba/gui/tabs/components/BlocksComponent.java new file mode 100644 index 00000000..023ef0f8 --- /dev/null +++ b/remappedSrc/net/aoba/gui/tabs/components/BlocksComponent.java @@ -0,0 +1,156 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.tabs.components; + +import net.aoba.Aoba; +import net.aoba.event.events.LeftMouseDownEvent; +import net.aoba.event.events.MouseScrollEvent; +import net.aoba.event.listeners.LeftMouseDownListener; +import net.aoba.event.listeners.MouseScrollListener; +import net.aoba.gui.GuiManager; +import net.aoba.gui.IGuiElement; +import net.aoba.gui.colors.Color; +import net.aoba.misc.RenderUtils; +import net.aoba.settings.types.BlocksSetting; +import net.minecraft.block.Block; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.item.ItemStack; +import net.minecraft.registry.Registries; + +public class BlocksComponent extends Component implements MouseScrollListener, LeftMouseDownListener { + + private BlocksSetting blocks; + private String text; + private int visibleRows; + private int visibleColumns; + private int scroll = 0; + + private boolean collapsed = true; + private float collapsedHeight = 30; + private float expandedHeight = 135; + /** + * Constructor for button component. + * @param parent Parent Tab that this Component resides in. + * @param text Text contained in this button element. + * @param onClick OnClick delegate that will run when the button is pressed. + */ + public BlocksComponent(IGuiElement parent, BlocksSetting setting) { + super(parent); + this.text = setting.displayName; + blocks = setting; + + this.setLeft(2); + this.setRight(2); + this.setHeight(collapsedHeight); + + visibleRows = (int)expandedHeight / 36; + visibleColumns = (int)actualWidth / 36; + } + + /** + * Draws the button to the screen. + * @param offset The offset (Y location relative to parent) of the Component. + * @param drawContext The current draw context of the game. + * @param partialTicks The partial ticks used for interpolation. + * @param color The current Color of the UI. + */ + @Override + public void draw(DrawContext drawContext, float partialTicks) { + RenderUtils.drawString(drawContext, text, actualX + 6, actualY + 6, 0xFFFFFF); + RenderUtils.drawString(drawContext, collapsed ? ">>" : "<<", (actualX + actualWidth - 24), actualY + 6, GuiManager.foregroundColor.getValue().getColorAsInt()); + + if(!collapsed) { + MatrixStack matrixStack = drawContext.getMatrices(); + matrixStack.push(); + matrixStack.scale(2.0f, 2.0f, 2.0f); + for(int i = scroll; i < visibleRows + scroll; i++) { + for(int j = 0; j < visibleColumns; j++) { + int index = (i * visibleColumns) + j; + if(index > Registries.BLOCK.size()) + continue; + + Block block = Registries.BLOCK.get(index); + + if(blocks.getValue().contains(block)) { + RenderUtils.drawBox(matrixStack, ((actualX + (j * 36) + 4) / 2.0f), ((actualY + ((i-scroll) * 36) + 25) / 2.0f), 16, 16, new Color(0, 255, 0, 55)); + } + drawContext.drawItem(new ItemStack(block.asItem()), (int) ((actualX + (j * 36) + 6) / 2.0f), (int) ((actualY + ((i-scroll) * 36) + 25) / 2.0f) ); + } + } + + matrixStack.pop(); + } + } + + @Override + public void OnMouseScroll(MouseScrollEvent event) { + if(Aoba.getInstance().hudManager.isClickGuiOpen() && this.hovered) { + if(event.GetVertical() > 0 && scroll > 0) { + scroll--; + }else if (event.GetVertical() < 0 && (scroll + visibleRows) < (Registries.BLOCK.size() / visibleColumns)) { + scroll++; + } + event.SetCancelled(true); + } + } + + @Override + public void OnVisibilityChanged() { + if(this.isVisible()) { + Aoba.getInstance().eventManager.AddListener(MouseScrollListener.class, this); + Aoba.getInstance().eventManager.AddListener(LeftMouseDownListener.class, this); + }else { + Aoba.getInstance().eventManager.RemoveListener(MouseScrollListener.class, this); + Aoba.getInstance().eventManager.RemoveListener(LeftMouseDownListener.class, this); + } + } + + @Override + public void OnLeftMouseDown(LeftMouseDownEvent event) { + double mouseX = event.GetMouseX(); + double mouseY = event.GetMouseY(); + + if(mouseX > (actualX + 4) && mouseY < (actualX + (36 * visibleColumns) + 4)) { + if(mouseY > actualY && mouseY < actualY + 25) { + collapsed = !collapsed; + if(collapsed) + this.setHeight(collapsedHeight); + else + this.setHeight(expandedHeight); + }else if(mouseY > (actualY + 25) && mouseY < (actualY + (36 * visibleRows) + 25)) { + int col = (int) (mouseX - actualX - 8) / 36; + int row = (int) ((mouseY - actualY - 24) / 36) + scroll; + + int index = (row * visibleColumns) + col; + if(index > Registries.BLOCK.size()) + return; + + Block block = Registries.BLOCK.get(index); + if(this.blocks.getValue().contains(block)) { + this.blocks.getValue().remove(block); + this.blocks.update(); + }else { + this.blocks.getValue().add(block); + this.blocks.update(); + } + } + } + } +} diff --git a/remappedSrc/net/aoba/gui/tabs/components/ButtonComponent.java b/remappedSrc/net/aoba/gui/tabs/components/ButtonComponent.java new file mode 100644 index 00000000..77776b52 --- /dev/null +++ b/remappedSrc/net/aoba/gui/tabs/components/ButtonComponent.java @@ -0,0 +1,125 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.tabs.components; + +import net.aoba.Aoba; +import net.aoba.event.events.LeftMouseDownEvent; +import net.aoba.event.listeners.LeftMouseDownListener; +import net.aoba.gui.IGuiElement; +import net.aoba.gui.colors.Color; +import net.aoba.misc.RenderUtils; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.util.math.MatrixStack; + +public class ButtonComponent extends Component implements LeftMouseDownListener { + + private String text; + private Runnable onClick; + private Color borderColor = new Color(128, 128, 128); + private Color backgroundColor = borderColor; + + /** + * Constructor for button component. + * @param parent Parent Tab that this Component resides in. + * @param text Text contained in this button element. + * @param onClick OnClick delegate that will run when the button is pressed. + */ + public ButtonComponent(IGuiElement parent, String text, Runnable onClick) { + super(parent); + + this.setLeft(2); + this.setRight(2); + this.setHeight(30); + + this.text = text; + this.onClick = onClick; + } + + public ButtonComponent(IGuiElement parent, String text, Runnable onClick, Color borderColor, Color backgroundColor) { + super(parent); + + this.setLeft(2); + this.setRight(2); + this.setHeight(30); + + this.text = text; + this.onClick = onClick; + + this.borderColor = borderColor; + this.backgroundColor = backgroundColor; + } + + /** + * Sets the text of the button. + * @param text Text to set. + */ + public void setText(String text) { + this.text = text; + } + + /** + * Sets the OnClick delegate of the button. + * @param onClick Delegate to set. + */ + public void setOnClick(Runnable onClick) { + this.onClick = onClick; + } + + public void setBorderColor(Color color) { + this.borderColor = color; + } + + public void setBackgroundColor(Color color) { + this.backgroundColor = color; + } + + /** + * Draws the button to the screen. + * @param offset The offset (Y location relative to parent) of the Component. + * @param drawContext The current draw context of the game. + * @param partialTicks The partial ticks used for interpolation. + * @param color The current Color of the UI. + */ + @Override + public void draw(DrawContext drawContext, float partialTicks) { + MatrixStack matrixStack = drawContext.getMatrices(); + RenderUtils.drawOutlinedBox(matrixStack, actualX + 2, actualY, actualWidth - 4, actualHeight - 2, borderColor, backgroundColor); + RenderUtils.drawString(drawContext, this.text, actualX + 8, actualY + 8, 0xFFFFFF); + } + + /** + * Triggered when the user clicks the Left Mouse Button (LMB) + * @param event Event fired. + */ + @Override + public void OnLeftMouseDown(LeftMouseDownEvent event) { + if(this.hovered && this.isVisible() && onClick != null) { + this.onClick.run(); + } + } + + @Override + public void OnVisibilityChanged() { + if(this.isVisible()) { + Aoba.getInstance().eventManager.AddListener(LeftMouseDownListener.class, this); + }else { + Aoba.getInstance().eventManager.RemoveListener(LeftMouseDownListener.class, this); + } + } +} diff --git a/remappedSrc/net/aoba/gui/tabs/components/CheckboxComponent.java b/remappedSrc/net/aoba/gui/tabs/components/CheckboxComponent.java new file mode 100644 index 00000000..e93166c4 --- /dev/null +++ b/remappedSrc/net/aoba/gui/tabs/components/CheckboxComponent.java @@ -0,0 +1,94 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.tabs.components; + +import net.aoba.Aoba; +import net.aoba.event.events.LeftMouseDownEvent; +import net.aoba.event.listeners.LeftMouseDownListener; +import net.aoba.gui.GuiManager; +import net.aoba.gui.IGuiElement; +import net.aoba.gui.colors.Color; +import net.aoba.misc.RenderUtils; +import net.aoba.settings.types.BooleanSetting; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.util.math.MatrixStack; + +public class CheckboxComponent extends Component implements LeftMouseDownListener { + private String text; + private BooleanSetting checkbox; + private Runnable onClick; + + public CheckboxComponent(IGuiElement parent, BooleanSetting checkbox) { + super(parent); + this.text = checkbox.displayName; + this.checkbox = checkbox; + + this.setLeft(2); + this.setRight(2); + this.setHeight(30); + + Aoba.getInstance().eventManager.AddListener(LeftMouseDownListener.class, this); + } + + /** + * Draws the checkbox to the screen. + * @param offset The offset (Y location relative to parent) of the Component. + * @param drawContext The current draw context of the game. + * @param partialTicks The partial ticks used for interpolation. + * @param color The current Color of the UI. + */ + @Override + public void draw(DrawContext drawContext, float partialTicks) { + super.draw(drawContext, partialTicks); + + MatrixStack matrixStack = drawContext.getMatrices(); + RenderUtils.drawString(drawContext, this.text, actualX + 6, actualY + 8, 0xFFFFFF); + if (this.checkbox.getValue()) { + RenderUtils.drawOutlinedBox(matrixStack, actualX + actualWidth - 24, actualY + 5, 20, 20, + new Color(0, 154, 0, 200)); + } else { + RenderUtils.drawOutlinedBox(matrixStack, actualX + actualWidth - 24, actualY + 5, 20, 20, + new Color(154, 0, 0, 200)); + } + } + + /** + * Handles updating the Checkbox component. + * @param offset The offset (Y position relative to parent) of the Checkbox. + */ + @Override + public void update() { + super.update(); + } + + /** + * Triggered when the user clicks the Left Mouse Button (LMB) + * + * @param event Event fired. + */ + @Override + public void OnLeftMouseDown(LeftMouseDownEvent event) { + if (hovered && Aoba.getInstance().hudManager.isClickGuiOpen()) { + checkbox.toggle(); + if(onClick != null) { + onClick.run(); + } + } + } +} diff --git a/remappedSrc/net/aoba/gui/tabs/components/ColorPickerComponent.java b/remappedSrc/net/aoba/gui/tabs/components/ColorPickerComponent.java new file mode 100644 index 00000000..67ca94ea --- /dev/null +++ b/remappedSrc/net/aoba/gui/tabs/components/ColorPickerComponent.java @@ -0,0 +1,187 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.tabs.components; + +import net.aoba.Aoba; +import net.aoba.event.events.LeftMouseDownEvent; +import net.aoba.event.events.LeftMouseUpEvent; +import net.aoba.event.events.MouseMoveEvent; +import net.aoba.event.listeners.LeftMouseDownListener; +import net.aoba.event.listeners.LeftMouseUpListener; +import net.aoba.event.listeners.MouseMoveListener; +import net.aoba.gui.GuiManager; +import net.aoba.gui.IGuiElement; +import net.aoba.gui.colors.Color; +import net.aoba.misc.RenderUtils; +import net.aoba.settings.types.ColorSetting; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.util.math.MatrixStack; + + +public class ColorPickerComponent extends Component implements LeftMouseDownListener, LeftMouseUpListener, MouseMoveListener { + + private String text; + private boolean isSliding = false; + private boolean collapsed = true; + private float hue = 0.0f; + private float saturation = 0.0f; + private float luminance = 0.0f; + private float alpha = 0.0f; + + private ColorSetting color; + + public ColorPickerComponent(String text, IGuiElement parent) { + super(parent); + this.text = text; + + this.setHeight(145); + this.setLeft(4); + this.setRight(4); + + Aoba.getInstance().eventManager.AddListener(LeftMouseDownListener.class, this); + Aoba.getInstance().eventManager.AddListener(LeftMouseUpListener.class, this); + } + + public ColorPickerComponent(IGuiElement parent, ColorSetting color) { + super(parent); + + this.text = color.displayName; + this.color = color; + this.color.setOnUpdate((Color newColor) -> ensureGuiUpdated(newColor)); + + this.hue = color.getValue().hue; + this.saturation = color.getValue().saturation; + this.luminance = color.getValue().luminance; + + this.setHeight(30); + this.setLeft(4); + this.setRight(4); + + Aoba.getInstance().eventManager.AddListener(LeftMouseDownListener.class, this); + Aoba.getInstance().eventManager.AddListener(LeftMouseUpListener.class, this); + } + + public void ensureGuiUpdated(Color newColor) { + this.hue = newColor.hue; + this.saturation = newColor.saturation; + this.luminance = newColor.luminance; + this.alpha = newColor.alpha; + } + + public void setText(String text) { + this.text = text; + } + + public String getText() { + return this.text; + } + + @Override + public void OnLeftMouseDown(LeftMouseDownEvent event) { + double mouseY = event.GetMouseY(); + + if(hovered && Aoba.getInstance().hudManager.isClickGuiOpen()) { + if(mouseY < actualY + 29) { + collapsed = !collapsed; + if(collapsed) + this.setHeight(30); + else + this.setHeight(145); + }else { + if(!collapsed) + isSliding = true; + } + } + } + + @Override + public void OnLeftMouseUp(LeftMouseUpEvent event) { + isSliding = false; + } + + @Override + public void OnMouseMove(MouseMoveEvent event) { + super.OnMouseMove(event); + + double mouseX = event.GetHorizontal(); + double mouseY = event.GetVertical(); + if (Aoba.getInstance().hudManager.isClickGuiOpen() && this.isSliding) { + + float vertical = (float) Math.min(Math.max(1.0f - (((mouseY - (actualY + 29)) - 1) / (actualHeight - 33)), 0.0f), 1.0f); + + // If inside of saturation/lightness box. + if(mouseX >= actualX + 4 && mouseX <= actualX + actualWidth - 68) { + float horizontal = (float) Math.min(Math.max(((mouseX - (actualX + 4)) - 1) / (actualWidth - 68), 0.0f), 1.0f); + + this.luminance = vertical; + this.saturation = horizontal; + }else if(mouseX >= actualX + actualWidth - 72 && mouseX <= actualX + actualWidth - 38) { + this.hue = (1.0f - vertical) * 360.0f; + }else if(mouseX >= actualX + actualWidth - 34 && mouseX <= actualX + actualWidth - 4) { + this.alpha = (vertical) * 255.0f; + } + + this.color.getValue().setHSV(hue, saturation, luminance); + this.color.getValue().setAlpha((int) alpha); + } + } + + + @Override + public void update() { + super.update(); + } + + @Override + public void draw(DrawContext drawContext, float partialTicks) { + MatrixStack matrixStack = drawContext.getMatrices(); + + RenderUtils.drawString(drawContext, this.text, actualX + 6, actualY + 6, 0xFFFFFF); + RenderUtils.drawString(drawContext, collapsed ? ">>" : "<<", (actualX + actualWidth - 24), actualY + 6, GuiManager.foregroundColor.getValue().getColorAsInt()); + + if(!collapsed) { + Color newColor = new Color(255, 0, 0); + newColor.setHSV(this.hue, 1.0f, 1.0f); + RenderUtils.drawHorizontalGradient(matrixStack, actualX + 4, actualY + 29, actualWidth - 76, actualHeight - 33, new Color(255, 255, 255), newColor); + RenderUtils.drawVerticalGradient(matrixStack, actualX + 4, actualY+ 29, actualWidth - 76, actualHeight - 33, new Color(0, 0, 0, 0), new Color(0, 0, 0)); + + // Draw Hue Rectangle + float increment = ((this.actualHeight - 33) / 6.0f); + RenderUtils.drawVerticalGradient(matrixStack, actualX + actualWidth - 68, actualY + 29, 30, increment, new Color(255, 0, 0), new Color(255, 255, 0)); + RenderUtils.drawVerticalGradient(matrixStack, actualX + actualWidth - 68, actualY + 29 + increment, 30,increment, new Color(255, 255, 0), new Color(0, 255, 0)); + RenderUtils.drawVerticalGradient(matrixStack, actualX + actualWidth - 68, actualY + 29 + (2 * increment), 30, increment, new Color(0, 255, 0), new Color(0, 255, 255)); + RenderUtils.drawVerticalGradient(matrixStack, actualX + actualWidth - 68, actualY + 29 + (3 * increment), 30, increment, new Color(0, 255, 255), new Color(0, 0, 255)); + RenderUtils.drawVerticalGradient(matrixStack, actualX + actualWidth - 68, actualY + 29 + (4 * increment), 30, increment, new Color(0, 0, 255), new Color(255, 0, 255)); + RenderUtils.drawVerticalGradient(matrixStack, actualX + actualWidth - 68, actualY + 29 + (5 * increment), 30, increment, new Color(255, 0, 255), new Color(255, 0, 0)); + + // Draw Alpha Rectangle + RenderUtils.drawVerticalGradient(matrixStack, actualX + actualWidth - 34 , actualY + 29, 30, actualHeight - 33, new Color(255, 255, 255), new Color(0, 0, 0)); + + // Draw Outlines + RenderUtils.drawOutline(matrixStack, actualX + 4, actualY + 29, actualWidth - 76, actualHeight - 33); + RenderUtils.drawOutline(matrixStack, actualX + actualWidth - 68, actualY + 29, 30, actualHeight - 33); + RenderUtils.drawOutline(matrixStack, actualX + actualWidth - 34, actualY + 29, 30, actualHeight - 33); + + // Draw Indicators + RenderUtils.drawCircle(matrixStack, actualX + 4 + (saturation * (actualWidth - 72)), actualY + 29 + ((1.0f - luminance) * (actualHeight - 33)), 3, new Color(255, 255, 255, 255)); + RenderUtils.drawOutlinedBox(matrixStack, actualX + actualWidth - 68, actualY + 29 + ((hue / 360.0f) * (actualHeight - 33)), 30, 3, new Color(255, 255, 255, 255)); + RenderUtils.drawOutlinedBox(matrixStack, actualX + actualWidth - 34, actualY + 29 + (((255.0f - alpha) / 255.0f) * (actualHeight - 33)), 30, 3, new Color(255, 255, 255, 255)); + } + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/gui/tabs/components/Component.java b/remappedSrc/net/aoba/gui/tabs/components/Component.java new file mode 100644 index 00000000..97d30661 --- /dev/null +++ b/remappedSrc/net/aoba/gui/tabs/components/Component.java @@ -0,0 +1,458 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.tabs.components; + +import java.util.ArrayList; +import net.aoba.Aoba; +import net.aoba.event.events.MouseMoveEvent; +import net.aoba.event.listeners.MouseMoveListener; +import net.aoba.gui.IGuiElement; +import net.aoba.gui.colors.Color; +import net.aoba.misc.RenderUtils; +import net.minecraft.client.gui.DrawContext; + +public abstract class Component implements IGuiElement, MouseMoveListener { + private static boolean DEBUG = false; + + private boolean visible = false; + protected boolean hovered = false; + + // NEW ui variables. + protected IGuiElement parent; + protected ArrayList children; + + // These are positions that the UI designer will input to enforce specific + // options. + // These will take precedence over the top/bottom/left/right positions. + protected float x; + protected float y; + protected float width; + protected float height; + + protected boolean autoWidth; + protected boolean autoHeight; + + private float top = -1; + private float bottom = -1; + private float left = -1; + private float right = -1; + + // The actual screen space positions of the HUD elements. + protected float actualX; + protected float actualY; + protected float actualHeight; + protected float actualWidth; + + public Component(IGuiElement parent) { + this.parent = parent; + this.children = new ArrayList(); + + // Assumes that the component will take up the entire space of the parent unless + // otherwise specified. + this.setTop(0); + this.setLeft(0); + this.setRight(0); + this.setBottom(0); + } + + /** + * Gets the X position of the component. + * + * @return X position of the component as a float. + */ + @Override + public float getX() { + return actualX; + } + + /** + * Gets the Y position of the component. + * + * @return Y position of the component as a float. + */ + @Override + public float getY() { + return actualY; + } + + /** + * Gets the Width of the component. + * + * @return Width of the component as a float. + */ + @Override + public float getWidth() { + return actualWidth; + } + + /** + * Gets the height of the component. + * + * @return Height of the component as a float. + */ + @Override + public float getHeight() { + return actualHeight; + } + + public float getTop() { + return top; + } + + public float getBottom() { + return bottom; + } + + public float getLeft() { + return left; + } + + public float getRight() { + return right; + } + + public void setX(float x) { + if (this.x != x) { + this.x = x; + this.setActualX(x); + + if(this.parent != null) { + this.parent.OnChildChanged(this); + } + } + } + + public void setY(float y) { + if (this.y != y) { + this.y = y; + this.setActualY(y); + + // If parent is not null, notify the parent. + if (parent != null) { + this.parent.OnChildChanged(this); + } + } + } + + public void setWidth(float width) { + if (this.width != width) { + this.width = width; + this.setActualWidth(width); + + // If parent is not null, notify the parent. + if (parent != null) { + this.parent.OnChildChanged(this); + } + } + } + + /** + * Sets the height of the component. + * + * @param height The height to set. + */ + @Override + public void setHeight(float height) { + if (this.height != height) { + this.height = height; + this.setActualHeight(height); + + // If parent is not null, notify the parent. + if (parent != null) { + this.parent.OnChildChanged(this); + } + } + } + + public void setTop(float top) { + if (this.top != top) { + this.top = top; + + // If parent is not null, notify the parent and use it's positioning. + if (parent != null) { + if (y == 0.0f) { + this.setActualY(parent.getY() + top); + } + + if (height == 0.0f) { + this.setActualHeight(parent.getHeight() - top - bottom); + } + + this.parent.OnChildChanged(this); + }else { + if (y == 0.0f) { + this.setActualY(top); + } + + if (height == 0.0f) { + this.setActualHeight(top - bottom); + } + } + } + } + + public void setBottom(float bottom) { + if (this.bottom != bottom) { + this.bottom = bottom; + + + // If parent is not null, notify the parent. + if (parent != null) { + if (height == 0.0) { + this.setActualHeight(parent.getHeight() - top - bottom); + } + this.parent.OnChildChanged(this); + }else { + if (height == 0.0) { + this.setActualHeight(top - bottom); + } + } + } + } + + public void setLeft(float left) { + if (this.left != left) { + this.left = left; + + // If parent is not null, notify the parent. + if (parent != null) { + if (x == 0.0) { + this.setActualX(parent.getX() + left); + } + if (width == 0.0f) { + this.setActualWidth(parent.getWidth() - left - right); + } + this.parent.OnChildChanged(this); + }else { + if (x == 0.0) { + this.setActualX(left); + } + if (width == 0.0f) { + this.setActualWidth(left - right); + } + } + } + } + + public void setRight(float right) { + if (this.right != right) { + this.right = right; + + // If parent is not null, notify the parent. + if (parent != null) { + if (width == 0.0f) { + this.setActualWidth(parent.getWidth() - right - left); + } + + this.parent.OnChildChanged(this); + }else { + if (width == 0.0f) { + this.setActualWidth(right - left); + } + } + } + } + + private void setActualX(float value) { + if (actualX == value) + return; + + actualX = value; + for (Component child : children) { + child.OnParentXChanged(); + } + } + + private void setActualY(float value) { + if (actualY == value) + return; + + actualY = value; + for (Component child : children) { + child.OnParentYChanged(); + } + } + + private void setActualWidth(float value) { + if (actualWidth == value) + return; + + actualWidth = value; + for (Component child : children) { + child.OnParentWidthChanged(); + } + } + + private void setActualHeight(float value) { + if (actualHeight == value) + return; + + actualHeight = value; + for (Component child : children) { + child.OnParentHeightChanged(); + } + } + + public void addChild(Component component) { + this.children.add(component); + this.OnChildAdded(component); + } + + public void OnParentXChanged() { + if (x == 0.0) { + setActualX(parent.getX() + left); + } + } + + public void OnParentYChanged() { + if (y == 0.0f) { + setActualY(parent.getY() + top); + } + } + + public void OnParentWidthChanged() { + if (width == 0.0f) { + setActualWidth(parent.getWidth() - left - right); + } + } + + public void OnParentHeightChanged() { + if (height == 0.0f) { + setActualHeight(parent.getHeight() - top - bottom); + } + } + + /** + * Returns the parent of the Component. + * + * @return Parent of the component as a ClickGuiTab. + */ + public IGuiElement getParent() { + return parent; + } + + /** + * Sets whether the component is visible or not + * + * @param bool State to set visibility to. + */ + public void setVisible(boolean bool) { + if (this.visible == bool) + return; + + this.visible = bool; + this.hovered = false; + + for (Component child : this.children) { + child.setVisible(bool); + } + + // If parent is not null, notify the parent. + if (parent != null) { + this.parent.OnChildChanged(this); + } + + + // Register and Unregister event listener according to state. + if (bool) { + Aoba.getInstance().eventManager.AddListener(MouseMoveListener.class, this); + } else { + Aoba.getInstance().eventManager.RemoveListener(MouseMoveListener.class, this); + } + + this.OnVisibilityChanged(); + } + + /** + * Whether or not the component is currently visible. + * + * @return Visibility state as a boolean. + */ + public boolean isVisible() { + return this.visible; + } + + /** + * Updates the offset (y position relative to parent) of the component. + * + * @param offset Offset + */ + public void update() { + for (Component child : children) { + if (child.visible) { + child.update(); + } + } + } + + /** + * Abstract method for drawing components onto the screen. + * + * @param offset Offset of the module. + * @param drawContext DrawContext of the game. + * @param partialTicks Partial Ticks of the game. + * @param color Color of the UI. + */ + public void draw(DrawContext drawContext, float partialTicks) { + if (this.visible) { + if (this.hovered && DEBUG) { + RenderUtils.drawOutline(drawContext.getMatrices(), this.actualX, this.actualY, this.actualWidth, + this.actualHeight); + } + + for (Component child : children) { + if (child.visible) { + child.draw(drawContext, partialTicks); + } + } + } + } + + /** + * Triggers when the mouse is moved. + * + * @param mouseMoveEvent Event fired. + */ + @Override + public void OnMouseMove(MouseMoveEvent mouseMoveEvent) { + if (!visible || (parent != null && !Aoba.getInstance().hudManager.isClickGuiOpen())) { + this.hovered = false; + } else { + + double mouseX = mouseMoveEvent.GetHorizontal(); + double mouseY = mouseMoveEvent.GetVertical(); + + this.hovered = ((mouseX >= actualX && mouseX <= (actualX + actualWidth)) + && (mouseY >= (actualY) && mouseY <= (actualY + actualHeight))); + } + } + + public void OnChildAdded(IGuiElement child) { + + } + + @Override + public void OnChildChanged(IGuiElement child) { + + } + + public void OnVisibilityChanged() { + + } +} diff --git a/remappedSrc/net/aoba/gui/tabs/components/HudComponent.java b/remappedSrc/net/aoba/gui/tabs/components/HudComponent.java new file mode 100644 index 00000000..88894e00 --- /dev/null +++ b/remappedSrc/net/aoba/gui/tabs/components/HudComponent.java @@ -0,0 +1,75 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.tabs.components; + +import net.aoba.Aoba; +import net.aoba.event.events.LeftMouseDownEvent; +import net.aoba.event.listeners.LeftMouseDownListener; +import net.aoba.gui.IGuiElement; +import net.aoba.gui.colors.Color; +import net.aoba.gui.hud.AbstractHud; +import net.aoba.misc.RenderUtils; +import net.minecraft.client.gui.DrawContext; + +public class HudComponent extends Component implements LeftMouseDownListener { + private String text; + private AbstractHud hud; + + public HudComponent(String text, IGuiElement parent, AbstractHud hud) { + super(parent); + this.text = text; + this.hud = hud; + + this.setHeight(30); + } + + @Override + public void update() { + super.update(); + } + + @Override + public void draw(DrawContext drawContext, float partialTicks) { + super.draw(drawContext, partialTicks); + RenderUtils.drawString(drawContext, this.text, actualX + 8, actualY + 8, 0xFFFFFF); + + if(this.hud.activated.getValue()) { + RenderUtils.drawString(drawContext, "-", actualX + actualWidth - 16, actualY + 8, 0xFF0000); + }else { + RenderUtils.drawString(drawContext, "+", actualX + actualWidth - 16, actualY + 8, 0x00FF00); + } + } + + @Override + public void OnLeftMouseDown(LeftMouseDownEvent event) { + if(this.hovered && Aoba.getInstance().hudManager.isClickGuiOpen()) { + boolean visibility = hud.activated.getValue(); + Aoba.getInstance().hudManager.SetHudActive(hud, !visibility); + } + } + + @Override + public void OnVisibilityChanged() { + if(this.isVisible()) { + Aoba.getInstance().eventManager.AddListener(LeftMouseDownListener.class, this); + }else { + Aoba.getInstance().eventManager.RemoveListener(LeftMouseDownListener.class, this); + } + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/gui/tabs/components/KeybindComponent.java b/remappedSrc/net/aoba/gui/tabs/components/KeybindComponent.java new file mode 100644 index 00000000..aa86c35b --- /dev/null +++ b/remappedSrc/net/aoba/gui/tabs/components/KeybindComponent.java @@ -0,0 +1,90 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.tabs.components; + +import org.lwjgl.glfw.GLFW; + +import net.aoba.Aoba; +import net.aoba.event.events.KeyDownEvent; +import net.aoba.event.events.LeftMouseDownEvent; +import net.aoba.event.listeners.KeyDownListener; +import net.aoba.event.listeners.LeftMouseDownListener; +import net.aoba.gui.IGuiElement; +import net.aoba.gui.colors.Color; +import net.aoba.misc.RenderUtils; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.util.InputUtil; + +public class KeybindComponent extends Component implements LeftMouseDownListener, KeyDownListener { + private boolean listeningForKey; + private KeybindSetting keyBind; + + public KeybindComponent(IGuiElement parent, KeybindSetting keyBind) { + super(parent); + this.keyBind = keyBind; + + Aoba.getInstance().eventManager.AddListener(LeftMouseDownListener.class, this); + Aoba.getInstance().eventManager.AddListener(KeyDownListener.class, this); + } + + @Override + public void update() { + super.update(); + } + + @Override + public void draw(DrawContext drawContext, float partialTicks) { + super.draw(drawContext, partialTicks); + RenderUtils.drawString(drawContext, "Keybind", actualX + 8, actualY + 8, 0xFFFFFF); + RenderUtils.drawBox(drawContext.getMatrices(), actualX + actualWidth - 100, actualY + 2, 98, actualHeight - 4, new Color(115, 115, 115, 200)); + RenderUtils.drawOutline(drawContext.getMatrices(), actualX + actualWidth - 100, actualY + 2, 98, actualHeight - 4); + + String keyBindText = this.keyBind.getValue().getLocalizedText().getString(); + if(keyBindText.equals("scancode.0") || keyBindText.equals("key.keyboard.0")) + keyBindText = "N/A"; + + RenderUtils.drawString(drawContext, keyBindText, actualX + actualWidth - 90, actualY + 8, 0xFFFFFF); + } + + @Override + public void OnLeftMouseDown(LeftMouseDownEvent event) { + if (hovered && Aoba.getInstance().hudManager.isClickGuiOpen()) { + listeningForKey = !listeningForKey; + } + } + + @Override + public void OnKeyDown(KeyDownEvent event) { + if(listeningForKey) { + int key = event.GetKey(); + int scanCode = event.GetScanCode(); + + if(key == GLFW.GLFW_KEY_ESCAPE) { + keyBind.setValue(InputUtil.UNKNOWN_KEY); + }else { + keyBind.setValue(InputUtil.fromKeyCode(key, scanCode)); + } + + listeningForKey = false; + + event.SetCancelled(true); + } + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/gui/tabs/components/ListComponent.java b/remappedSrc/net/aoba/gui/tabs/components/ListComponent.java new file mode 100644 index 00000000..0d461bb3 --- /dev/null +++ b/remappedSrc/net/aoba/gui/tabs/components/ListComponent.java @@ -0,0 +1,88 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.tabs.components; + +import java.util.List; +import net.aoba.Aoba; +import net.aoba.event.events.LeftMouseDownEvent; +import net.aoba.event.listeners.LeftMouseDownListener; +import net.aoba.gui.IGuiElement; +import net.aoba.gui.colors.Color; +import net.aoba.misc.RenderUtils; +import net.aoba.settings.types.StringSetting; +import net.minecraft.client.gui.DrawContext; + +public class ListComponent extends Component implements LeftMouseDownListener { + private StringSetting listSetting; + + private List options; + private int selectedIndex; + + public ListComponent(IGuiElement parent, List options) { + super(parent); + this.setLeft(2); + this.setRight(2); + this.setHeight(30); + Aoba.getInstance().eventManager.AddListener(LeftMouseDownListener.class, this); + + this.options = options; + } + + public ListComponent(IGuiElement parent, List options, StringSetting listSetting) { + super(parent); + this.listSetting = listSetting; + + this.setLeft(2); + this.setRight(2); + this.setHeight(30); + + Aoba.getInstance().eventManager.AddListener(LeftMouseDownListener.class, this); + + this.options = options; + } + + @Override + public void draw(DrawContext drawContext, float partialTicks) { + float stringWidth = Aoba.getInstance().fontManager.GetRenderer().getWidth(listSetting.getValue()); + RenderUtils.drawString(drawContext, listSetting.getValue(), actualX + (actualWidth / 2.0f) - stringWidth, + actualY + 8, 0xFFFFFF); + RenderUtils.drawString(drawContext, "<<", actualX + 8, actualY + 4, 0xFFFFFF); + RenderUtils.drawString(drawContext, ">>", actualX + 8 + (actualWidth - 34), actualY + 4, 0xFFFFFF); + } + + @Override + public void OnLeftMouseDown(LeftMouseDownEvent event) { + double mouseX = event.GetMouseX(); + + // Mouse is on the left + if(this.hovered) { + if (mouseX > actualX && mouseX < (actualX + 32)) { + setSelectedIndex(Math.max(--selectedIndex, 0)); + // Mouse is on the right + } else if (mouseX > (actualX + actualWidth - 32) && mouseX < (actualX + actualWidth)) { + setSelectedIndex(Math.min(++selectedIndex, options.size() - 1)); + } + } + } + + public void setSelectedIndex(int index) { + selectedIndex = index; + listSetting.setValue(options.get(selectedIndex)); + } +} diff --git a/remappedSrc/net/aoba/gui/tabs/components/ModuleComponent.java b/remappedSrc/net/aoba/gui/tabs/components/ModuleComponent.java new file mode 100644 index 00000000..61bf045b --- /dev/null +++ b/remappedSrc/net/aoba/gui/tabs/components/ModuleComponent.java @@ -0,0 +1,97 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.tabs.components; + +import net.aoba.Aoba; +import net.aoba.event.events.LeftMouseDownEvent; +import net.aoba.event.listeners.LeftMouseDownListener; +import net.aoba.module.Module; +import net.aoba.gui.GuiManager; +import net.aoba.gui.IGuiElement; +import net.aoba.gui.colors.Color; +import net.aoba.gui.tabs.ModuleSettingsTab; +import net.aoba.misc.RenderUtils; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.util.Identifier; + +public class ModuleComponent extends Component implements LeftMouseDownListener { + private String text; + private Module module; + + private ModuleSettingsTab lastSettingsTab = null; + + public final Identifier gear; + + public ModuleComponent(String text, IGuiElement parent, Module module) { + super(parent); + + gear = new Identifier("aoba", "/textures/gear.png"); + this.text = text; + this.module = module; + + this.setLeft(2); + this.setRight(2); + this.setHeight(30); + } + + @Override + public void update() { + super.update(); + } + + @Override + public void draw(DrawContext drawContext, float partialTicks) { + super.draw(drawContext, partialTicks); + RenderUtils.drawString(drawContext, this.text, actualX + 8, actualY + 8, module.getState() ? 0x00FF00 : this.hovered ? GuiManager.foregroundColor.getValue().getColorAsInt() : 0xFFFFFF); + if(module.hasSettings()) { + Color hudColor = GuiManager.foregroundColor.getValue(); + RenderUtils.drawTexturedQuad(drawContext, gear, (actualX + actualWidth - 20), (actualY + 6), 16, 16, hudColor); + } + } + + @Override + public void OnLeftMouseDown(LeftMouseDownEvent event) { + double mouseX = event.GetMouseX(); + if (hovered && Aoba.getInstance().hudManager.isClickGuiOpen()) { + boolean isOnOptionsButton = (mouseX >= (actualX + actualWidth - 34) && mouseX <= (actualX + actualWidth)); + if (isOnOptionsButton) { + if(lastSettingsTab == null) { + lastSettingsTab = new ModuleSettingsTab(this.module.getName(), this.actualX + this.actualWidth + 1, this.actualY, this.module); + lastSettingsTab.setVisible(true); + Aoba.getInstance().hudManager.AddHud(lastSettingsTab, "Modules"); + }else { + Aoba.getInstance().hudManager.RemoveHud(lastSettingsTab, "Modules"); + lastSettingsTab = null; + } + } else { + module.toggle(); + return; + } + } + } + + @Override + public void OnVisibilityChanged() { + if(this.isVisible()) { + Aoba.getInstance().eventManager.AddListener(LeftMouseDownListener.class, this); + }else { + Aoba.getInstance().eventManager.RemoveListener(LeftMouseDownListener.class, this); + } + } +} diff --git a/remappedSrc/net/aoba/gui/tabs/components/ScrollComponent.java b/remappedSrc/net/aoba/gui/tabs/components/ScrollComponent.java new file mode 100644 index 00000000..82e04901 --- /dev/null +++ b/remappedSrc/net/aoba/gui/tabs/components/ScrollComponent.java @@ -0,0 +1,23 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.tabs.components; + +public class ScrollComponent { + +} diff --git a/remappedSrc/net/aoba/gui/tabs/components/SliderComponent.java b/remappedSrc/net/aoba/gui/tabs/components/SliderComponent.java new file mode 100644 index 00000000..6ed7ca19 --- /dev/null +++ b/remappedSrc/net/aoba/gui/tabs/components/SliderComponent.java @@ -0,0 +1,149 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.tabs.components; + +import net.aoba.Aoba; +import net.aoba.event.events.LeftMouseDownEvent; +import net.aoba.event.events.LeftMouseUpEvent; +import net.aoba.event.events.MouseMoveEvent; +import net.aoba.event.listeners.LeftMouseDownListener; +import net.aoba.event.listeners.LeftMouseUpListener; +import net.aoba.event.listeners.MouseMoveListener; +import net.aoba.gui.GuiManager; +import net.aoba.gui.IGuiElement; +import net.aoba.gui.colors.Color; +import net.aoba.misc.RenderUtils; +import net.aoba.settings.types.FloatSetting; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.util.math.MatrixStack; + +public class SliderComponent extends Component implements LeftMouseDownListener, LeftMouseUpListener, MouseMoveListener { + + private String text; + private float currentSliderPosition = 0.4f; + float r; + float g; + float b; + private boolean isSliding = false; + + + FloatSetting slider; + + public SliderComponent(String text, IGuiElement parent) { + super(parent); + this.text = text; + this.slider = null; + + this.setHeight(50); + this.setLeft(4); + this.setRight(4); + + Aoba.getInstance().eventManager.AddListener(LeftMouseDownListener.class, this); + Aoba.getInstance().eventManager.AddListener(LeftMouseUpListener.class, this); + } + + public SliderComponent(IGuiElement parent, FloatSetting slider) { + super(parent); + this.text = slider.displayName; + this.slider = slider; + this.currentSliderPosition = (float) ((slider.getValue() - slider.min_value) + / (slider.max_value - slider.min_value)); + + this.setHeight(50); + this.setLeft(4); + this.setRight(4); + + Aoba.getInstance().eventManager.AddListener(LeftMouseDownListener.class, this); + Aoba.getInstance().eventManager.AddListener(LeftMouseUpListener.class, this); + } + + public float getSliderPosition() { + return this.currentSliderPosition; + } + + public void setSliderPosition(float pos) { + this.currentSliderPosition = pos; + } + + public void setText(String text) { + this.text = text; + } + + public String getText() { + return this.text; + } + + public void setColor(float r, float g, float b) { + this.r = r; + this.g = g; + this.b = b; + } + + @Override + public void OnLeftMouseDown(LeftMouseDownEvent event) { + if (hovered && Aoba.getInstance().hudManager.isClickGuiOpen()) { + isSliding = true; + } + } + + @Override + public void OnLeftMouseUp(LeftMouseUpEvent event) { + isSliding = false; + } + + @Override + public void OnMouseMove(MouseMoveEvent event) { + super.OnMouseMove(event); + + double mouseX = event.GetHorizontal(); + if (Aoba.getInstance().hudManager.isClickGuiOpen() && this.isSliding) { + this.currentSliderPosition = (float) Math.min((((mouseX - (actualX + 4)) - 1) / (actualWidth - 8)),1f); + this.currentSliderPosition = (float) Math.max(0f, this.currentSliderPosition); + this.slider.setValue((this.currentSliderPosition * (slider.max_value - slider.min_value)) + slider.min_value); + } + } + + + @Override + public void update() { + super.update(); + } + + @Override + public void draw(DrawContext drawContext, float partialTicks) { + MatrixStack matrixStack = drawContext.getMatrices(); + + // Draw the rest of the box. + float xLength = ((actualWidth - 18) * (float) ((slider.getValue() - slider.min_value) / (slider.max_value - slider.min_value))); + + GuiManager hudManager = Aoba.getInstance().hudManager; + RenderUtils.drawBox(matrixStack, actualX + 10, actualY + 35, xLength, 2, GuiManager.foregroundColor.getValue()); + RenderUtils.drawBox(matrixStack, actualX + 10 + xLength, actualY + 35, (actualWidth - xLength - 18), 2, new Color(255, 255, 255, 255)); + RenderUtils.drawCircle(matrixStack, actualX + 10 + xLength, actualY + 35, 6, GuiManager.foregroundColor.getValue()); + + if (this.slider == null) + return; + RenderUtils.drawString(drawContext, this.text, actualX + 6, actualY + 6, 0xFFFFFF); + + String valueText = String.format("%.02f", this.slider.getValue()); + int textSize = MinecraftClient.getInstance().textRenderer.getWidth(valueText) * MinecraftClient.getInstance().options.getGuiScale().getValue(); + RenderUtils.drawString(drawContext, valueText, actualX + actualWidth - 6 - textSize, actualY + 6, 0xFFFFFF); + } +} diff --git a/remappedSrc/net/aoba/gui/tabs/components/StackPanelComponent.java b/remappedSrc/net/aoba/gui/tabs/components/StackPanelComponent.java new file mode 100644 index 00000000..e8e3e7b2 --- /dev/null +++ b/remappedSrc/net/aoba/gui/tabs/components/StackPanelComponent.java @@ -0,0 +1,72 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.tabs.components; + +import net.aoba.gui.IGuiElement; + +public class StackPanelComponent extends Component { + public enum StackType { + Horizontal, Vertical + } + + protected StackType stackType = StackType.Vertical; + + public StackPanelComponent(IGuiElement parent) { + super(parent); + } + + @Override + public void update() { + super.update(); + } + + @Override + public void OnChildAdded(IGuiElement child) { + this.RecalculateHeight(); + } + + @Override + public void OnChildChanged(IGuiElement child) { + this.RecalculateHeight(); + } + + @Override + public void OnVisibilityChanged() { + this.RecalculateHeight(); + } + + public void RecalculateHeight() { + int height = 0; + for (int i = 0; i < children.size(); i++) { + Component iChild = children.get(i); + + // If the child is visible, increase the height of the StackPanel. + if (iChild.isVisible()) { + height += iChild.getHeight(); + } + + // Move the Top of the child below to the top + height of the previous element. + if (i + 1 != children.size()) { + Component childBelow = children.get(i + 1); + childBelow.setTop(height); + } + } + setHeight(height); + } +} diff --git a/remappedSrc/net/aoba/gui/tabs/components/StringComponent.java b/remappedSrc/net/aoba/gui/tabs/components/StringComponent.java new file mode 100644 index 00000000..b3a59f39 --- /dev/null +++ b/remappedSrc/net/aoba/gui/tabs/components/StringComponent.java @@ -0,0 +1,126 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.tabs.components; + +import java.util.ArrayList; + +import net.aoba.Aoba; +import net.aoba.event.events.FontChangedEvent; +import net.aoba.event.listeners.FontChangedListener; +import net.aoba.event.listeners.LeftMouseDownListener; +import net.aoba.gui.IGuiElement; +import net.aoba.gui.colors.Color; +import net.aoba.gui.colors.Colors; +import net.aoba.misc.RenderUtils; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.util.Formatting; + +public class StringComponent extends Component implements FontChangedListener { + private String originalText; + private ArrayList text; + private boolean bold; + private Color color; + + public StringComponent(String text, IGuiElement parent) { + super(parent); + setText(text); + this.color = Colors.White; + this.bold = false; + + Aoba.getInstance().eventManager.AddListener(FontChangedListener.class, this); + } + + public StringComponent(String text, IGuiElement parent, boolean bold) { + super(parent); + setText(text); + this.color = Colors.White; + this.bold = bold; + + Aoba.getInstance().eventManager.AddListener(FontChangedListener.class, this); + } + + public StringComponent(String text, IGuiElement parent, Color color, boolean bold) { + super(parent); + setText(text); + this.color = color; + this.bold = bold; + + Aoba.getInstance().eventManager.AddListener(FontChangedListener.class, this); + } + + @Override + public void draw(DrawContext drawContext, float partialTicks) { + int i = 0; + for (String str : text) { + if(bold) + str = Formatting.BOLD + str; + RenderUtils.drawString(drawContext, str, actualX + 8, actualY + 8 + i, this.color.getColorAsInt()); + i += 30; + } + } + + /** + * Sets the text of the String Component. + * + * @param text The text to set. + */ + public void setText(String text) { + this.originalText = text; + this.text = new ArrayList(); + + float textWidth = Aoba.getInstance().fontManager.GetRenderer().getWidth(text) * 2.0f; + int strings = (int) Math.ceil(textWidth / this.actualWidth); + if (strings == 0) { + this.text.add(text); + this.setHeight(30); + } else { + int lengthOfEachSegment = text.length() / strings; + + for (int i = 0; i < strings; i++) { + this.text.add(text.substring(lengthOfEachSegment * i, (lengthOfEachSegment * i) + lengthOfEachSegment)); + } + this.setHeight(strings * 30); + } + } + + /** + * Gets the text of the String Component. + * + * @return Text of the String Component as a string. + */ + + public String getText() { + return this.originalText; + } + + @Override + public void update() { + + } + + @Override + public void OnParentWidthChanged() { + setText(originalText); + } + + @Override + public void OnFontChanged(FontChangedEvent event) { + setText(this.originalText); + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/interfaces/ISimpleOption.java b/remappedSrc/net/aoba/interfaces/ISimpleOption.java new file mode 100644 index 00000000..5ed75563 --- /dev/null +++ b/remappedSrc/net/aoba/interfaces/ISimpleOption.java @@ -0,0 +1,24 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.interfaces; + +public interface ISimpleOption +{ + public void forceSetValue(T newValue); +} diff --git a/remappedSrc/net/aoba/misc/FakePlayerEntity.java b/remappedSrc/net/aoba/misc/FakePlayerEntity.java new file mode 100644 index 00000000..c0905d06 --- /dev/null +++ b/remappedSrc/net/aoba/misc/FakePlayerEntity.java @@ -0,0 +1,42 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * A class to represent a fake player. + */ +package net.aoba.misc; + +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.network.AbstractClientPlayerEntity; +import net.minecraft.client.network.ClientPlayerEntity; + +public class FakePlayerEntity extends AbstractClientPlayerEntity { + + public FakePlayerEntity() { + super(MinecraftClient.getInstance().world, MinecraftClient.getInstance().player.getGameProfile()); + ClientPlayerEntity player = MinecraftClient.getInstance().player; + this.setPos(player.getPos().x, player.getPos().y, player.getPos().z); + this.setRotation(player.getYaw(MinecraftClient.getInstance().getTickDelta()), + player.getPitch(MinecraftClient.getInstance().getTickDelta())); + //this.inventory = player.getInventory(); + } + + public void despawn() { + this.remove(RemovalReason.DISCARDED); + } +} diff --git a/remappedSrc/net/aoba/misc/ModuleUtils.java b/remappedSrc/net/aoba/misc/ModuleUtils.java new file mode 100644 index 00000000..93313c85 --- /dev/null +++ b/remappedSrc/net/aoba/misc/ModuleUtils.java @@ -0,0 +1,92 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * A helper class that contains several useful functions. + */ +package net.aoba.misc; + +import java.util.Objects; +import java.util.stream.Stream; + +import net.aoba.AobaClient; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.item.*; +import net.minecraft.util.math.ChunkPos; +import net.minecraft.world.chunk.WorldChunk; + +public class ModuleUtils { + + public static boolean isThrowable(ItemStack stack) { + Item item = stack.getItem(); + return item instanceof BowItem || item instanceof SnowballItem || item instanceof EggItem + || item instanceof EnderPearlItem || item instanceof SplashPotionItem + || item instanceof LingeringPotionItem || item instanceof FishingRodItem; + } + + public static double throwableGravity(Item item) { + if(item instanceof RangedWeaponItem) { + return 0.05; + }else if(item instanceof ThrowablePotionItem) { + return 0.4; + }else if(item instanceof FishingRodItem) { + return 0.15; + }else if(item instanceof TridentItem) { + return 0.015; + }else { + return 0.03; + } + } + + public static boolean isPlantable(ItemStack stack) { + Item item = stack.getItem(); + return item == Items.WHEAT_SEEDS || item == Items.CARROT || item == Items.POTATO; + } + + public static Stream getTileEntities(){ + return getLoadedChunks().flatMap(chunk -> chunk.getBlockEntities().values().stream()); + } + + public static Stream getLoadedChunks(){ + int radius = Math.max(2, AobaClient.MC.options.getClampedViewDistance()) + 3; + int diameter = radius * 2 + 1; + + ChunkPos center = AobaClient.MC.player.getChunkPos(); + ChunkPos min = new ChunkPos(center.x - radius, center.z - radius); + ChunkPos max = new ChunkPos(center.x + radius, center.z + radius); + + Stream stream = Stream. iterate(min, pos -> { + int x = pos.x; + int z = pos.z; + x++; + + if(x > max.x) + { + x = min.x; + z++; + } + + return new ChunkPos(x, z); + + }).limit(diameter*diameter) + .filter(c -> AobaClient.MC.world.isChunkLoaded(c.x, c.z)) + .map(c -> AobaClient.MC.world.getChunk(c.x, c.z)).filter(Objects::nonNull); + + return stream; + } +} diff --git a/remappedSrc/net/aoba/misc/RenderUtils.java b/remappedSrc/net/aoba/misc/RenderUtils.java new file mode 100644 index 00000000..691696de --- /dev/null +++ b/remappedSrc/net/aoba/misc/RenderUtils.java @@ -0,0 +1,625 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * A class that contains all of the drawing functions. + */ +package net.aoba.misc; + +import net.aoba.Aoba; +import net.aoba.AobaClient; +import net.aoba.gui.colors.Color; +import net.aoba.gui.colors.Colors; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.font.Font; +import net.minecraft.client.font.FontStorage; +import net.minecraft.client.font.TextRenderer; +import net.minecraft.client.font.TrueTypeFont; +import net.minecraft.client.font.TrueTypeFontLoader; +import net.minecraft.client.font.TrueTypeFontLoader.Shift; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferRenderer; +import net.minecraft.client.render.GameRenderer; +import net.minecraft.client.render.Tessellator; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.entity.Entity; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.Box; +import net.minecraft.util.math.MathHelper; +import org.joml.Matrix4f; +import org.lwjgl.opengl.GL11; +import net.minecraft.util.math.Vec3d; +import net.minecraft.client.render.VertexFormat; +import net.minecraft.client.render.VertexFormats; +import com.mojang.blaze3d.systems.RenderSystem; + +public class RenderUtils { + + static final float ROUND_QUALITY = 10; + + public static void drawTexturedQuad(DrawContext drawContext, Identifier texture, float x1, float y1, float width, float height, Color color) { + float red = color.getRedFloat(); + float green = color.getGreenFloat(); + float blue = color.getBlueFloat(); + float alpha = color.getAlphaFloat(); + + float x2 = x1 + width; + float y2 = y1 + height; + + RenderSystem.setShaderTexture(0, texture); + RenderSystem.setShader(GameRenderer::getPositionColorTexProgram); + RenderSystem.enableBlend(); + Matrix4f matrix4f = drawContext.getMatrices().peek().getPositionMatrix(); + BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer(); + bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR_TEXTURE); + bufferBuilder.vertex(matrix4f, x1, y1, 0).color(red, green, blue, alpha).texture(0, 0).next(); + bufferBuilder.vertex(matrix4f, x1, y2, 0).color(red, green, blue, alpha).texture(0, 1).next(); + bufferBuilder.vertex(matrix4f, x2, y2, 0).color(red, green, blue, alpha).texture(1, 1).next(); + bufferBuilder.vertex(matrix4f, x2, y1, 0).color(red, green, blue, alpha).texture(1, 0).next(); + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); + RenderSystem.disableBlend(); + } + + public static void drawBox(MatrixStack matrixStack, float x, float y, float width, float height, Color color) { + + RenderSystem.setShaderColor(color.getRedFloat(), color.getGreenFloat(), color.getBlueFloat(), color.getAlphaFloat()); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_LINE_SMOOTH); + Matrix4f matrix = matrixStack.peek().getPositionMatrix(); + Tessellator tessellator = RenderSystem.renderThreadTesselator(); + BufferBuilder bufferBuilder = tessellator.getBuffer(); + RenderSystem.setShader(GameRenderer::getPositionProgram); + + bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + bufferBuilder.vertex(matrix, x, y, 0).next(); + bufferBuilder.vertex(matrix, x + width, y, 0).next(); + bufferBuilder.vertex(matrix, x + width, y + height, 0).next(); + bufferBuilder.vertex(matrix, x, y + height, 0).next(); + + tessellator.draw(); + + RenderSystem.setShaderColor(1, 1, 1, 1); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void drawCircle(MatrixStack matrixStack, float x, float y, float radius, Color color) { + RenderSystem.setShaderColor(color.getRedFloat(), color.getGreenFloat(), color.getBlueFloat(), color.getAlphaFloat()); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_LINE_SMOOTH); + Matrix4f matrix = matrixStack.peek().getPositionMatrix(); + Tessellator tessellator = RenderSystem.renderThreadTesselator(); + BufferBuilder bufferBuilder = tessellator.getBuffer(); + RenderSystem.setShader(GameRenderer::getPositionProgram); + + bufferBuilder.begin(VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION); + + double roundedInterval = (360.0f / 30.0f); + + for(int i = 0; i < 30; i++) { + double angle = Math.toRadians(0 + (i * roundedInterval)); + double angle2 = Math.toRadians(0 + ((i + 1) * roundedInterval)); + float radiusX1 = (float)(Math.cos(angle) * radius); + float radiusY1 = (float)Math.sin(angle) * radius; + float radiusX2 = (float)Math.cos(angle2) * radius; + float radiusY2 = (float)Math.sin(angle2) * radius; + + bufferBuilder.vertex(matrix, x, y, 0).next(); + bufferBuilder.vertex(matrix, x + radiusX1, y + radiusY1, 0).next(); + bufferBuilder.vertex(matrix, x + radiusX2, y + radiusY2, 0).next(); + } + + tessellator.draw(); + + RenderSystem.setShaderColor(1, 1, 1, 1); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void drawRoundedBox(MatrixStack matrixStack, float x, float y, float width, float height, float radius, Color color) { + RenderSystem.setShaderColor(color.getRedFloat(), color.getGreenFloat(), color.getBlueFloat(), color.getAlphaFloat()); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_LINE_SMOOTH); + Matrix4f matrix = matrixStack.peek().getPositionMatrix(); + Tessellator tessellator = RenderSystem.renderThreadTesselator(); + BufferBuilder bufferBuilder = tessellator.getBuffer(); + RenderSystem.setShader(GameRenderer::getPositionProgram); + + bufferBuilder.begin(VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION); + + buildFilledArc(bufferBuilder, matrix, x + radius, y + radius, radius, 180.0f, 90.0f); + buildFilledArc(bufferBuilder, matrix, x + width - radius, y + radius, radius, 270.0f, 90.0f); + buildFilledArc(bufferBuilder, matrix, x + width - radius, y + height - radius, radius, 0.0f, 90.0f); + buildFilledArc(bufferBuilder, matrix, x + radius, y + height - radius, radius, 90.0f, 90.0f); + + // |--- + bufferBuilder.vertex(matrix, x + radius, y, 0).next(); + bufferBuilder.vertex(matrix, x + width - radius, y, 0).next(); + bufferBuilder.vertex(matrix, x + radius, y + radius, 0).next(); + + // ---| + bufferBuilder.vertex(matrix, x + radius, y + radius, 0).next(); + bufferBuilder.vertex(matrix, x + width - radius, y, 0).next(); + bufferBuilder.vertex(matrix, x + width - radius, y + radius, 0).next(); + + // _|| + bufferBuilder.vertex(matrix, x + width - radius, y + radius, 0).next(); + bufferBuilder.vertex(matrix, x + width, y + radius, 0).next(); + bufferBuilder.vertex(matrix, x + width - radius, y + height - radius, 0).next(); + + // ||| + bufferBuilder.vertex(matrix, x + width, y + radius, 0).next(); + bufferBuilder.vertex(matrix, x + width, y + height - radius, 0).next(); + bufferBuilder.vertex(matrix, x + width - radius, y + height - radius, 0).next(); + + /// __| + bufferBuilder.vertex(matrix, x + width - radius, y + height - radius, 0).next(); + bufferBuilder.vertex(matrix, x + width - radius, y + height, 0).next(); + bufferBuilder.vertex(matrix, x + radius, y + height - radius, 0).next(); + + // |__ + bufferBuilder.vertex(matrix, x + radius, y + height - radius, 0).next(); + bufferBuilder.vertex(matrix, x + radius, y + height, 0).next(); + bufferBuilder.vertex(matrix, x + width - radius, y + height, 0).next(); + + // ||| + bufferBuilder.vertex(matrix, x + radius, y + height - radius, 0).next(); + bufferBuilder.vertex(matrix, x, y + height - radius, 0).next(); + bufferBuilder.vertex(matrix, x , y + radius, 0).next(); + + /// ||- + bufferBuilder.vertex(matrix, x , y + radius, 0).next(); + bufferBuilder.vertex(matrix, x + radius , y + radius, 0).next(); + bufferBuilder.vertex(matrix, x + radius, y + height - radius, 0).next(); + + /// |-/ + bufferBuilder.vertex(matrix, x + radius , y + radius, 0).next(); + bufferBuilder.vertex(matrix, x + width - radius , y + radius, 0).next(); + bufferBuilder.vertex(matrix, x + radius , y + height - radius, 0).next(); + + /// /_| + bufferBuilder.vertex(matrix, x + radius , y + height - radius, 0).next(); + bufferBuilder.vertex(matrix, x + width - radius , y + height - radius, 0).next(); + bufferBuilder.vertex(matrix, x + width - radius , y + radius, 0).next(); + + tessellator.draw(); + + RenderSystem.setShaderColor(1, 1, 1, 1); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void drawRoundedOutline(MatrixStack matrixStack, float x, float y, float width, float height, float radius, Color color) { + RenderSystem.setShaderColor(color.getRedFloat(), color.getGreenFloat(), color.getBlueFloat(), color.getAlphaFloat()); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_DEPTH_TEST); + + Matrix4f matrix = matrixStack.peek().getPositionMatrix(); + Tessellator tessellator = RenderSystem.renderThreadTesselator(); + BufferBuilder bufferBuilder = tessellator.getBuffer(); + RenderSystem.setShader(GameRenderer::getPositionProgram); + + bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + + // Top Left Arc and Top + buildArc(bufferBuilder, matrix, x + radius, y + radius, radius, 180.0f, 90.0f); + bufferBuilder.vertex(matrix, x + radius, y, 0).next(); + bufferBuilder.vertex(matrix, x + width - radius, y, 0).next(); + + // Top Right Arc and Right + buildArc(bufferBuilder, matrix, x + width - radius, y + radius, radius, 270.0f, 90.0f); + bufferBuilder.vertex(matrix, x + width, y + radius, 0).next(); + bufferBuilder.vertex(matrix, x + width, y + height - radius, 0).next(); + + // Bottom Right + buildArc(bufferBuilder, matrix, x + width - radius, y + height - radius, radius, 0.0f, 90.0f); + bufferBuilder.vertex(matrix, x + width - radius, y + height, 0).next(); + bufferBuilder.vertex(matrix, x + radius, y + height, 0).next(); + + // Bottom Left + buildArc(bufferBuilder, matrix, x + radius, y + height - radius, radius, 90.0f, 90.0f); + bufferBuilder.vertex(matrix, x, y + height - radius, 0).next(); + bufferBuilder.vertex(matrix, x, y + radius, 0).next(); + + tessellator.draw(); + + RenderSystem.setShaderColor(1, 1, 1, 1); + GL11.glDisable(GL11.GL_DEPTH_TEST); + } + + public static void drawOutlinedBox(MatrixStack matrixStack, float x, float y, float width, float height, Color outlineColor, Color backgroundColor) { + RenderSystem.setShaderColor(backgroundColor.getRedFloat(), backgroundColor.getGreenFloat(), backgroundColor.getBlueFloat(), backgroundColor.getAlphaFloat()); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_DEPTH_TEST); + + Matrix4f matrix = matrixStack.peek().getPositionMatrix(); + Tessellator tessellator = RenderSystem.renderThreadTesselator(); + BufferBuilder bufferBuilder = tessellator.getBuffer(); + RenderSystem.setShader(GameRenderer::getPositionProgram); + + bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + + bufferBuilder.vertex(matrix, x, y, 0).next(); + bufferBuilder.vertex(matrix, x + width, y, 0).next(); + bufferBuilder.vertex(matrix, x + width, y + height, 0).next(); + bufferBuilder.vertex(matrix, x, y + height, 0).next(); + + tessellator.draw(); + + RenderSystem.setShaderColor(outlineColor.getRedFloat(), outlineColor.getGreenFloat(), outlineColor.getBlueFloat(), outlineColor.getAlphaFloat()); + RenderSystem.setShader(GameRenderer::getPositionProgram); + bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + + bufferBuilder.vertex(matrix, x, y, 0).next(); + bufferBuilder.vertex(matrix, x + width, y, 0).next(); + bufferBuilder.vertex(matrix, x + width, y + height, 0).next(); + bufferBuilder.vertex(matrix, x, y + height, 0).next(); + bufferBuilder.vertex(matrix, x, y, 0).next(); + + tessellator.draw(); + RenderSystem.setShaderColor(1, 1, 1, 1); + + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void drawOutlinedBox(MatrixStack matrixStack, float x, float y, float width, float height, Color color) { + drawOutlinedBox(matrixStack, x, y, width, height, Colors.Black, color); + } + + public static void drawLine(MatrixStack matrixStack, float x1, float y1, float x2, float y2, Color color) { + RenderSystem.setShaderColor(color.getRedFloat(), color.getGreenFloat(), color.getBlueFloat(), color.getAlphaFloat()); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_DEPTH_TEST); + + Matrix4f matrix = matrixStack.peek().getPositionMatrix(); + Tessellator tessellator = RenderSystem.renderThreadTesselator(); + BufferBuilder bufferBuilder = tessellator.getBuffer(); + RenderSystem.setShader(GameRenderer::getPositionProgram); + + bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + + bufferBuilder.vertex(matrix, x1, y1, 0).next(); + bufferBuilder.vertex(matrix, x2, y2, 0).next(); + + tessellator.draw(); + RenderSystem.setShaderColor(1, 1, 1, 1); + + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void drawHorizontalGradient(MatrixStack matrixStack, float x, float y, float width, float height, Color startColor, Color endColor) { + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_DEPTH_TEST); + + Matrix4f matrix = matrixStack.peek().getPositionMatrix(); + Tessellator tessellator = RenderSystem.renderThreadTesselator(); + BufferBuilder bufferBuilder = tessellator.getBuffer(); + RenderSystem.setShader(GameRenderer::getPositionColorProgram); + + bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); + + bufferBuilder.vertex(matrix, x, y, 0.0F).color(startColor.getColorAsInt()).next(); + bufferBuilder.vertex(matrix, x + width, y, 0.0F).color(endColor.getColorAsInt()).next(); + bufferBuilder.vertex(matrix, x + width, y + height, 0.0F).color(endColor.getColorAsInt()).next(); + bufferBuilder.vertex(matrix, x, y + height, 0.0F).color(startColor.getColorAsInt()).next(); + + tessellator.draw(); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void drawVerticalGradient(MatrixStack matrixStack, float x, float y, float width, float height, Color startColor, Color endColor) { + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_DEPTH_TEST); + + Matrix4f matrix = matrixStack.peek().getPositionMatrix(); + Tessellator tessellator = RenderSystem.renderThreadTesselator(); + BufferBuilder bufferBuilder = tessellator.getBuffer(); + RenderSystem.setShader(GameRenderer::getPositionColorProgram); + + bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); + + bufferBuilder.vertex(matrix, x, y, 0.0F).color(startColor.getColorAsInt()).next(); + bufferBuilder.vertex(matrix, x + width, y, 0.0F).color(startColor.getColorAsInt()).next(); + bufferBuilder.vertex(matrix, x + width, y + height, 0.0F).color(endColor.getColorAsInt()).next(); + bufferBuilder.vertex(matrix, x, y + height, 0.0F).color(endColor.getColorAsInt()).next(); + + tessellator.draw(); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void drawOutline(MatrixStack matrixStack, float x, float y, float width, float height) { + RenderSystem.setShaderColor(0, 0, 0, 1); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_DEPTH_TEST); + + Matrix4f matrix = matrixStack.peek().getPositionMatrix(); + Tessellator tessellator = RenderSystem.renderThreadTesselator(); + BufferBuilder bufferBuilder = tessellator.getBuffer(); + RenderSystem.setShader(GameRenderer::getPositionProgram); + + bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + + bufferBuilder.vertex(matrix, x, y, 0).next(); + bufferBuilder.vertex(matrix, x + width, y, 0).next(); + bufferBuilder.vertex(matrix, x + width, y + height, 0).next(); + bufferBuilder.vertex(matrix, x, y + height, 0).next(); + bufferBuilder.vertex(matrix, x, y, 0).next(); + + tessellator.draw(); + RenderSystem.setShaderColor(1, 1, 1, 1); + + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void drawOutline(MatrixStack matrixStack, float x, float y, float width, float height, Color color) { + RenderSystem.setShaderColor(color.getRedFloat(), color.getGreenFloat(), color.getBlueFloat(), color.getAlphaFloat()); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_DEPTH_TEST); + + Matrix4f matrix = matrixStack.peek().getPositionMatrix(); + Tessellator tessellator = RenderSystem.renderThreadTesselator(); + BufferBuilder bufferBuilder = tessellator.getBuffer(); + RenderSystem.setShader(GameRenderer::getPositionProgram); + + bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); + + bufferBuilder.vertex(matrix, x, y, 0).next(); + bufferBuilder.vertex(matrix, x + width, y, 0).next(); + bufferBuilder.vertex(matrix, x + width, y + height, 0).next(); + bufferBuilder.vertex(matrix, x, y + height, 0).next(); + bufferBuilder.vertex(matrix, x, y, 0).next(); + + tessellator.draw(); + RenderSystem.setShaderColor(1, 1, 1, 1); + + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void draw3DBox(MatrixStack matrixStack, Box box, Color color) { + RenderSystem.setShaderColor(color.getRedFloat(), color.getGreenFloat(), color.getBlueFloat(), 1.0f); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_DEPTH_TEST); + + Matrix4f matrix = matrixStack.peek().getPositionMatrix(); + Tessellator tessellator = RenderSystem.renderThreadTesselator(); + BufferBuilder bufferBuilder = tessellator.getBuffer(); + RenderSystem.setShader(GameRenderer::getPositionProgram); + + bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.minZ).next(); + + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.maxZ).next(); + + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.maxZ).next(); + + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.minZ).next(); + + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.minZ).next(); + + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.minZ).next(); + + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.maxZ).next(); + + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.maxZ).next(); + + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.minZ).next(); + + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.maxZ).next(); + + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.maxZ).next(); + + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.minZ).next(); + + tessellator.draw(); + + RenderSystem.setShaderColor(color.getRedFloat(), color.getGreenFloat(), color.getBlueFloat(), color.getAlphaFloat()); + RenderSystem.setShader(GameRenderer::getPositionProgram); + + bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); + + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.maxZ).next(); + + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.minZ).next(); + + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.minZ).next(); + + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.maxZ).next(); + + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.maxZ).next(); + + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.minZ).next(); + tessellator.draw(); + RenderSystem.setShaderColor(1, 1, 1, 1); + + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void drawLine3D(MatrixStack matrixStack, Vec3d pos, Vec3d pos2, Color color) { + RenderSystem.setShaderColor(color.getRedFloat(), color.getGreenFloat(), color.getBlueFloat(), color.getAlphaFloat()); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_DEPTH_TEST); + + Matrix4f matrix = matrixStack.peek().getPositionMatrix(); + Tessellator tessellator = RenderSystem.renderThreadTesselator(); + BufferBuilder bufferBuilder = tessellator.getBuffer(); + RenderSystem.setShader(GameRenderer::getPositionProgram); + + bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); + + bufferBuilder.vertex(matrix, (float) pos.x, (float) pos.y, (float) pos.z).next(); + bufferBuilder.vertex(matrix, (float) pos2.x, (float) pos2.y, (float) pos2.z).next(); + + tessellator.draw(); + RenderSystem.setShaderColor(1, 1, 1, 1); + + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_BLEND); + } + + public static void drawString(DrawContext drawContext, String text, float x, float y, Color color) { + AobaClient aoba = Aoba.getInstance(); + MatrixStack matrixStack = drawContext.getMatrices(); + matrixStack.push(); + matrixStack.scale(2.0f, 2.0f, 1.0f); + matrixStack.translate(-x / 2, -y / 2, 0.0f); + drawContext.drawText(aoba.fontManager.GetRenderer(), text, (int)x, (int)y, color.getColorAsInt(), false); + matrixStack.pop(); + } + + public static void drawString(DrawContext drawContext, String text, float x, float y, int color) { + AobaClient aoba = Aoba.getInstance(); + MatrixStack matrixStack = drawContext.getMatrices(); + matrixStack.push(); + matrixStack.scale(2.0f, 2.0f, 1.0f); + matrixStack.translate(-x / 2, -y / 2, 0.0f); + drawContext.drawText(aoba.fontManager.GetRenderer(), text, (int)x, (int)y, color, false); + matrixStack.pop(); + } + + public static void drawStringWithScale(DrawContext drawContext, String text, float x, float y, Color color, float scale) { + AobaClient aoba = Aoba.getInstance(); + MatrixStack matrixStack = drawContext.getMatrices(); + matrixStack.push(); + matrixStack.scale(scale, scale, 1.0f); + if (scale > 1.0f) { + matrixStack.translate(-x / scale, -y / scale, 0.0f); + } else { + matrixStack.translate((x / scale) - x, (y * scale) - y, 0.0f); + } + drawContext.drawText(aoba.fontManager.GetRenderer(), text, (int)x, (int)y, color.getColorAsInt(), false); + matrixStack.pop(); + } + + public static void drawStringWithScale(DrawContext drawContext, String text, float x, float y, int color, float scale) { + AobaClient aoba = Aoba.getInstance(); + MatrixStack matrixStack = drawContext.getMatrices(); + matrixStack.push(); + matrixStack.scale(scale, scale, 1.0f); + if (scale > 1.0f) { + matrixStack.translate(-x / scale, -y / scale, 0.0f); + } else { + matrixStack.translate(x / scale, y * scale, 0.0f); + } + drawContext.drawText(aoba.fontManager.GetRenderer(), text, (int)x, (int)y, color, false); + matrixStack.pop(); + } + + private static void buildFilledArc(BufferBuilder bufferBuilder, Matrix4f matrix, float x, float y, float radius, float startAngle, float sweepAngle) { + double roundedInterval = (sweepAngle / ROUND_QUALITY); + + for(int i = 0; i < ROUND_QUALITY; i++) { + double angle = Math.toRadians(startAngle + (i * roundedInterval)); + double angle2 = Math.toRadians(startAngle + ((i + 1) * roundedInterval)); + float radiusX1 = (float)(Math.cos(angle) * radius); + float radiusY1 = (float)Math.sin(angle) * radius; + float radiusX2 = (float)Math.cos(angle2) * radius; + float radiusY2 = (float)Math.sin(angle2) * radius; + + bufferBuilder.vertex(matrix, x, y, 0).next(); + bufferBuilder.vertex(matrix, x + radiusX1, y + radiusY1, 0).next(); + bufferBuilder.vertex(matrix, x + radiusX2, y + radiusY2, 0).next(); + } + } + + private static void buildArc(BufferBuilder bufferBuilder, Matrix4f matrix, float x, float y, float radius, float startAngle, float sweepAngle) { + double roundedInterval = (sweepAngle / ROUND_QUALITY); + + for(int i = 0; i < ROUND_QUALITY; i++) { + double angle = Math.toRadians(startAngle + (i * roundedInterval)); + float radiusX1 = (float) (Math.cos(angle) * radius); + float radiusY1 = (float)Math.sin(angle) * radius; + + bufferBuilder.vertex(matrix, x + radiusX1, y + radiusY1, 0).next(); + } + } + + /** + * Gets the interpolated position of the entity given a tick delta. + * @param entity Entity to get position of + * @param delta Tick delta. + * @return Vec3d representing the interpolated position of the entity. + */ + public static Vec3d getEntityPositionInterpolated(Entity entity, float delta) { + return new Vec3d(MathHelper.lerp(delta, entity.prevX, entity.getX()), + MathHelper.lerp(delta, entity.prevY, entity.getY()), + MathHelper.lerp(delta, entity.prevZ, entity.getZ())); + } + + /** + * Gets the difference between the interpolated position and + * @param entity Entity to get position of + * @param delta Tick delta. + * @return Vec3d representing the interpolated position of the entity. + */ + public static Vec3d getEntityPositionOffsetInterpolated(Entity entity, float delta) { + Vec3d interpolated = getEntityPositionInterpolated(entity, delta); + return entity.getPos().subtract(interpolated); + } +} diff --git a/remappedSrc/net/aoba/misc/TextUtils.java b/remappedSrc/net/aoba/misc/TextUtils.java new file mode 100644 index 00000000..b3a1b944 --- /dev/null +++ b/remappedSrc/net/aoba/misc/TextUtils.java @@ -0,0 +1,35 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.misc; + +import java.util.Arrays; +import java.util.stream.Collectors; + +public class TextUtils { + public static String IDToName (String ID) { + return Arrays.stream(ID.split("_")).map(TextUtils::Capitalize).collect(Collectors.joining(" ")); + } + + public static String Capitalize (String str) { + if (str.length() > 1) { + return str.substring(0, 1).toUpperCase() + str.substring(1); + } + return str; + } +} diff --git a/remappedSrc/net/aoba/mixin/AbstractBlockStateMixin.java b/remappedSrc/net/aoba/mixin/AbstractBlockStateMixin.java new file mode 100644 index 00000000..2ff6e134 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/AbstractBlockStateMixin.java @@ -0,0 +1,51 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +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.CallbackInfoReturnable; +import com.google.common.collect.ImmutableMap; +import com.mojang.serialization.MapCodec; +import net.aoba.Aoba; +import net.minecraft.block.AbstractBlock.AbstractBlockState; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.state.State; +import net.minecraft.state.property.Property; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.BlockView; + +@Mixin(AbstractBlockState.class) +public abstract class AbstractBlockStateMixin extends State { + + private AbstractBlockStateMixin(Block object, ImmutableMap, Comparable> immutableMap, MapCodec mapCodec) + { + super(object, immutableMap, mapCodec); + } + + @Inject(at = @At("TAIL"), method = { "getAmbientOcclusionLightLevel(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)F"}, cancellable = true) + private void onGetAmbientOcclusionLightLevel(BlockView blockView, BlockPos blockPos, CallbackInfoReturnable cir) + { + if (!Aoba.getInstance().moduleManager.xray.getState()) + return; + cir.setReturnValue(1F); + } +} diff --git a/remappedSrc/net/aoba/mixin/AbstractClientPlayerEntityMixin.java b/remappedSrc/net/aoba/mixin/AbstractClientPlayerEntityMixin.java new file mode 100644 index 00000000..ebeda8d3 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/AbstractClientPlayerEntityMixin.java @@ -0,0 +1,17 @@ +package net.aoba.mixin; + +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.CallbackInfoReturnable; + +import net.minecraft.client.network.AbstractClientPlayerEntity; + +@Mixin(AbstractClientPlayerEntity.class) +public abstract class AbstractClientPlayerEntityMixin extends PlayerEntityMixin { + + @Inject(method = "isSpectator()Z", at = @At("HEAD"), cancellable = true) + public void onIsSpectator(CallbackInfoReturnable cir) { + return; + } +} diff --git a/remappedSrc/net/aoba/mixin/AbstractSignEditScreenMixin.java b/remappedSrc/net/aoba/mixin/AbstractSignEditScreenMixin.java new file mode 100644 index 00000000..929a6d58 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/AbstractSignEditScreenMixin.java @@ -0,0 +1,72 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +import org.spongepowered.asm.mixin.Final; +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.callback.CallbackInfo; +import net.aoba.Aoba; +import net.aoba.cmd.CommandManager; +import net.aoba.module.modules.world.AutoSign; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.screen.ingame.AbstractSignEditScreen; +import net.minecraft.text.Text; + +@Mixin(AbstractSignEditScreen.class) +public abstract class AbstractSignEditScreenMixin extends Screen { + @Shadow + @Final + private String[] messages; + + protected AbstractSignEditScreenMixin(Text title) { + super(title); + } + + @Inject(at = {@At("HEAD")}, method = {"init()V"}) + private void onInit(CallbackInfo ci) + { + AutoSign mod = (AutoSign) Aoba.getInstance().moduleManager.autosign; + String[] newText = mod.getText(); + if(newText != null) { + for(int i = 0; i < 4; i++) + messages[i] = newText[i]; + finishEditing(); + } + } + + @Inject(at = { @At("HEAD") }, method = "finishEditing()V") + private void onEditorClose(CallbackInfo ci) { + AutoSign mod = (AutoSign) Aoba.getInstance().moduleManager.autosign; + if(mod.getState()) { + if(mod.getText() == null) { + mod.setText(messages); + CommandManager.sendChatMessage("Sign text set!"); + } + } + } + + @Shadow + private void finishEditing() + { + + } +} diff --git a/remappedSrc/net/aoba/mixin/BackgroundRendererMixin.java b/remappedSrc/net/aoba/mixin/BackgroundRendererMixin.java new file mode 100644 index 00000000..9f9f54d4 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/BackgroundRendererMixin.java @@ -0,0 +1,42 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import org.spongepowered.asm.mixin.injection.At; + +import net.aoba.Aoba; +import net.minecraft.client.render.BackgroundRenderer; +import net.minecraft.entity.Entity; + +@Mixin(BackgroundRenderer.class) +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) + { + if(Aoba.getInstance().moduleManager.nooverlay.getState()) + cir.setReturnValue(null); + } +} diff --git a/remappedSrc/net/aoba/mixin/BlockMixin.java b/remappedSrc/net/aoba/mixin/BlockMixin.java new file mode 100644 index 00000000..850558e7 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/BlockMixin.java @@ -0,0 +1,58 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +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.CallbackInfoReturnable; +import net.aoba.Aoba; +import net.aoba.AobaClient; +import net.aoba.module.modules.render.XRay; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.item.ItemConvertible; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.BlockView; + +@Mixin(Block.class) +public abstract class BlockMixin implements ItemConvertible { + + @Inject(at = { @At("HEAD") }, method = { + "shouldDrawSide(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;Lnet/minecraft/util/math/BlockPos;)Z" }, cancellable = true) + private static void onShouldDrawSide(BlockState state, BlockView world, BlockPos pos, Direction direction, + BlockPos blockPos, CallbackInfoReturnable cir) { + AobaClient aoba = Aoba.getInstance(); + XRay xray = (XRay)aoba.moduleManager.xray; + if (xray.getState()) { + boolean isXray = xray.isXRayBlock(state.getBlock()); + cir.setReturnValue(isXray); + } + } + + @Inject(at = { @At("HEAD") }, method = { "getVelocityMultiplier()F" }, cancellable = true) + private void onGetVelocityMultiplier(CallbackInfoReturnable cir) { + if (!Aoba.getInstance().moduleManager.noslowdown.getState()) + return; + if (cir.getReturnValueF() < 1.0f) + cir.setReturnValue(1F); + } + +} diff --git a/remappedSrc/net/aoba/mixin/BlockModelRendererMixin.java b/remappedSrc/net/aoba/mixin/BlockModelRendererMixin.java new file mode 100644 index 00000000..24b6a5eb --- /dev/null +++ b/remappedSrc/net/aoba/mixin/BlockModelRendererMixin.java @@ -0,0 +1,56 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.At; +import net.aoba.Aoba; +import net.aoba.AobaClient; +import net.aoba.module.modules.render.XRay; +import net.minecraft.block.BlockState; +import net.minecraft.client.render.VertexConsumer; +import net.minecraft.client.render.block.BlockModelRenderer; +import net.minecraft.client.render.model.BakedModel; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.random.Random; +import net.minecraft.world.BlockRenderView; + +@Mixin(BlockModelRenderer.class) +public abstract class BlockModelRendererMixin { + + @Inject(at = { @At("HEAD") }, method = { + "renderSmooth(Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/client/render/model/BakedModel;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;ZLnet/minecraft/util/math/random/Random;JI)V", + "renderFlat(Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/client/render/model/BakedModel;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;ZLnet/minecraft/util/math/random/Random;JI)V" }, cancellable = true) + public void onRenderSmoothOrFlat(BlockRenderView world, BakedModel model, + BlockState state, BlockPos pos, MatrixStack matrices, + VertexConsumer vertexConsumer, boolean cull, Random random, long seed, + int overlay, CallbackInfo ci) { + AobaClient aoba = Aoba.getInstance(); + XRay xray = (XRay)aoba.moduleManager.xray; + if (xray.getState()) { + if (xray.isXRayBlock(state.getBlock())) { + ci.cancel(); + return; + } + } + } +} diff --git a/remappedSrc/net/aoba/mixin/CactusBlockMixin.java b/remappedSrc/net/aoba/mixin/CactusBlockMixin.java new file mode 100644 index 00000000..ebf09574 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/CactusBlockMixin.java @@ -0,0 +1,53 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.aoba.Aoba; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.CactusBlock; +import net.minecraft.block.ShapeContext; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.util.shape.VoxelShapes; +import net.minecraft.world.BlockView; + +@Mixin(CactusBlock.class) +public abstract class CactusBlockMixin extends Block { + + public CactusBlockMixin(Settings settings) { + super(settings); + } + + @Inject(at = { @At("HEAD") }, method = { + "getCollisionShape(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/ShapeContext;)Lnet/minecraft/util/shape/VoxelShape;" }, cancellable = true) + private void onGetCollisionShape(BlockState blockState_1, BlockView blockView_1, BlockPos blockPos_1, + ShapeContext entityContext_1, CallbackInfoReturnable cir) { + if(Aoba.getInstance() != null) { + if(Aoba.getInstance().moduleManager.anticactus.getState()) { + cir.setReturnValue(VoxelShapes.fullCube()); + } + } + } +} diff --git a/remappedSrc/net/aoba/mixin/ChatHudMixin.java b/remappedSrc/net/aoba/mixin/ChatHudMixin.java new file mode 100644 index 00000000..52b9de1d --- /dev/null +++ b/remappedSrc/net/aoba/mixin/ChatHudMixin.java @@ -0,0 +1,132 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +import java.util.List; +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.callback.CallbackInfo; +import com.google.common.collect.Lists; +import net.aoba.Aoba; +import net.aoba.cmd.GlobalChat; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.hud.ChatHud; +import net.minecraft.client.gui.hud.ChatHudLine; +import net.minecraft.client.gui.hud.MessageIndicator; +import net.minecraft.util.math.MathHelper; + +@Mixin(ChatHud.class) +public abstract class ChatHudMixin { + + @Shadow + private final List visibleMessages = Lists.newArrayList(); + @Shadow + private MinecraftClient client; + @Shadow + private int scrolledLines; + @Shadow + private boolean hasUnreadNewMessages; + @Shadow + public abstract boolean isChatHidden(); + @Shadow + public abstract int getVisibleLineCount(); + @Shadow + public abstract boolean isChatFocused(); + @Shadow + public abstract double getChatScale(); + @Shadow + public abstract int getWidth(); + @Shadow + public abstract double toChatLineX(double x); + @Shadow + public abstract double toChatLineY(double y); + @Shadow + public abstract int getMessageIndex(double chatLineX, double chatLineY); + @Shadow + public abstract int getLineHeight(); + @Shadow + public abstract int getIndicatorX(ChatHudLine.Visible line); + @Shadow + private static double getMessageOpacityMultiplier(int age) { return 1.0; } + @Shadow + public abstract void drawIndicatorIcon(DrawContext context, int x, int y, MessageIndicator.Icon icon); + + @Inject(at = { @At("HEAD") }, method = {"render(Lnet/minecraft/client/gui/DrawContext;III)V" }, cancellable = true) + public void onRender(DrawContext context, int currentTick, int mouseX, int mouseY, CallbackInfo ci) { + if(GlobalChat.chatType == GlobalChat.ChatType.Global) { + AobaChatRender(context, currentTick, mouseX, mouseY); + ci.cancel(); + } + } + + public void AobaChatRender(DrawContext context, int currentTick, int mouseX, int mouseY) { + int x; + int v; + int u; + int t; + int visibleLinesCount = this.getVisibleLineCount(); + + boolean bl = this.isChatFocused(); + float f = (float)this.getChatScale(); + int k = MathHelper.ceil((float)this.getWidth() / f); + int l = context.getScaledWindowHeight(); + context.getMatrices().push(); + context.getMatrices().scale(f, f, 1.0f); + context.getMatrices().translate(4.0f, 0.0f, 0.0f); + int m = MathHelper.floor((float)(l - 40) / f); + int n = this.getMessageIndex(this.toChatLineX(mouseX), this.toChatLineY(mouseY)); + double opacity = this.client.options.getChatOpacity().getValue() * (double)0.9f + (double)0.1f; + double textOpacity = this.client.options.getTextBackgroundOpacity().getValue(); + double chatSpacing = this.client.options.getChatLineSpacing().getValue(); + int lineHeight = this.getLineHeight(); + int p = (int)Math.round(-8.0 * (chatSpacing + 1.0) + 4.0 * chatSpacing); + + for (int r = 0; r < Aoba.getInstance().globalChat.messages.size() && r < visibleLinesCount; ++r) { + ChatHudLine.Visible visible = Aoba.getInstance().globalChat.messages.get(r); + if (visible == null || (t = currentTick - visible.addedTime()) >= 200 && !bl) continue; + double h = bl ? 1.0 : getMessageOpacityMultiplier(t); + u = (int)(255.0 * h * opacity); + v = (int)(255.0 * h * textOpacity); + if (u <= 3) continue; + x = m - r * lineHeight; + int y = x + p; + context.getMatrices().push(); + context.getMatrices().translate(0.0f, 0.0f, 50.0f); + context.fill(-4, x - lineHeight, 0 + k + 4 + 4, x, v << 24); + MessageIndicator messageIndicator = visible.indicator(); + if (messageIndicator != null) { + int z = messageIndicator.indicatorColor() | u << 24; + context.fill(-4, x - lineHeight, -2, x, z); + if (r == n && messageIndicator.icon() != null) { + int aa = this.getIndicatorX(visible); + int ab = y + this.client.textRenderer.fontHeight; + this.drawIndicatorIcon(context, aa, ab, messageIndicator.icon()); + } + } + context.getMatrices().translate(0.0f, 0.0f, 50.0f); + context.drawTextWithShadow(this.client.textRenderer, visible.content(), 0, y, 0xFFFFFF + (u << 24)); + context.getMatrices().pop(); + } + + context.getMatrices().pop(); + } +} diff --git a/remappedSrc/net/aoba/mixin/ChatInputSuggestorMixin.java b/remappedSrc/net/aoba/mixin/ChatInputSuggestorMixin.java new file mode 100644 index 00000000..70a0e1dd --- /dev/null +++ b/remappedSrc/net/aoba/mixin/ChatInputSuggestorMixin.java @@ -0,0 +1,113 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import com.mojang.brigadier.ParseResults; +import com.mojang.brigadier.suggestion.Suggestions; +import com.mojang.brigadier.suggestion.SuggestionsBuilder; +import net.aoba.Aoba; +import net.aoba.cmd.Command; +import net.aoba.cmd.CommandManager; +import net.minecraft.client.gui.screen.ChatInputSuggestor; +import net.minecraft.client.gui.widget.TextFieldWidget; +import net.minecraft.command.CommandSource; +import net.minecraft.text.Text; +import net.minecraft.text.OrderedText; + +@Mixin(ChatInputSuggestor.class) +public abstract class ChatInputSuggestorMixin { + @Shadow + private TextFieldWidget textField; + @Shadow + @Nullable + private ParseResults parse; + @Shadow + private CompletableFuture pendingSuggestions; + @Shadow + private List messages; + + @Shadow + public abstract void show(boolean narrateFirstSuggestion); + + @Inject(at = { @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/TextFieldWidget;getCursor()I", ordinal = 0) }, method = "refresh()V", cancellable = true) + private void onRefresh(CallbackInfo ci) { + String prefix = CommandManager.PREFIX.getValue(); + String string = this.textField.getText(); + + if(string.length() > 0) { + int cursorPos = this.textField.getCursor(); + String string2 = string.substring(0, cursorPos); + + if(string2.charAt(0) == CommandManager.PREFIX.getValue().charAt(0)) { + int j = 0; + Matcher matcher = Pattern.compile("(\\s+)").matcher(string2); + while (matcher.find()) { + j = matcher.end(); + } + + SuggestionsBuilder builder = new SuggestionsBuilder(string2, j); + if(string2.length() <= prefix.length()) { + if(prefix.startsWith(string2)) { + builder.suggest(prefix + " "); + }else { + return; + } + }else { + int count = StringUtils.countMatches(string2, " "); + List seperated = Arrays.asList(string2.split(" ")); + if(count == 1) { + for (Object strObj : Aoba.getInstance().commandManager.getCommands().keySet().toArray()) { + String str = (String) strObj; + builder.suggest(str + " "); + } + }else { + if(seperated.size() <= 1) return; + Command c = Aoba.getInstance().commandManager.getCommandBySyntax(seperated.get(1)); + if (c == null) { + messages.add(Text.of("Aoba: No commands found with name: " + string2).asOrderedText()); + return; + } + + String[] suggestions = c.getAutocorrect(seperated.get(seperated.size() - 1)); + + if(suggestions == null || suggestions.length == 0) return; + for(String str : suggestions) { + builder.suggest(str + " "); + } + } + } + + this.pendingSuggestions = builder.buildFuture(); + this.show(false); + } + } + } +} diff --git a/remappedSrc/net/aoba/mixin/ChatScreenMixin.java b/remappedSrc/net/aoba/mixin/ChatScreenMixin.java new file mode 100644 index 00000000..99553001 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/ChatScreenMixin.java @@ -0,0 +1,122 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +import org.lwjgl.opengl.GL11; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import org.spongepowered.asm.mixin.injection.At; +import net.aoba.Aoba; +import net.aoba.cmd.CommandManager; +import net.aoba.cmd.GlobalChat; +import net.aoba.cmd.GlobalChat.ChatType; +import net.aoba.gui.colors.Color; +import net.aoba.gui.tabs.components.ButtonComponent; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.screen.ChatScreen; +import net.minecraft.client.gui.widget.TextFieldWidget; +import net.minecraft.client.util.math.MatrixStack; + +@Mixin(ChatScreen.class) +public class ChatScreenMixin extends ScreenMixin{ + @Shadow + protected TextFieldWidget chatField; + + protected ButtonComponent serverChatButton; + protected ButtonComponent globalChatButton; + + @Inject(at = { @At("TAIL") }, method = {"init()V" }, cancellable = true) + public void onInit(CallbackInfo ci) { + MinecraftClient mc = MinecraftClient.getInstance(); + int guiScale = mc.getWindow().calculateScaleFactor(mc.options.getGuiScale().getValue(), mc.forcesUnicodeFont()); + + // Create server chat button. + serverChatButton = new ButtonComponent(null, "Server Chat", new Runnable() { + @Override + public void run() { + GlobalChat.chatType = GlobalChat.ChatType.Minecraft; + serverChatButton.setBackgroundColor(new Color(56, 56, 56)); + globalChatButton.setBackgroundColor(new Color(128, 128, 128)); + } + }, new Color(192, 192, 192), new Color(56, 56, 56)); + serverChatButton.setX(chatField.getX() * guiScale); + serverChatButton.setY((chatField.getY() - chatField.getHeight() - 10) * guiScale); + serverChatButton.setWidth(140); + serverChatButton.setHeight(30); + + // Create global chat button + globalChatButton = new ButtonComponent(null, "Global Chat", new Runnable() { + @Override + public void run() { + GlobalChat.chatType = GlobalChat.ChatType.Global; + globalChatButton.setBackgroundColor(new Color(56, 56, 56)); + serverChatButton.setBackgroundColor(new Color(128, 128, 128)); + } + }, new Color(192, 192, 192), new Color(128, 128, 128)); + globalChatButton.setX((chatField.getX() + 80) * guiScale); + globalChatButton.setY((chatField.getY() - chatField.getHeight() - 10) * guiScale); + globalChatButton.setWidth(140); + globalChatButton.setHeight(30); + + serverChatButton.setVisible(true); + globalChatButton.setVisible(true); + } + + @Override + protected void onClose(CallbackInfo ci) { + serverChatButton.setVisible(false); + globalChatButton.setVisible(false); + } + + @Override + protected void onRender(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) + { + super.onRender(context, mouseX, mouseY, delta, ci); + + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + + MinecraftClient mc = MinecraftClient.getInstance(); + MatrixStack matrixStack = context.getMatrices(); + matrixStack.push(); + + int guiScale = mc.getWindow().calculateScaleFactor(mc.options.getGuiScale().getValue(), mc.forcesUnicodeFont()); + matrixStack.scale(1.0f / guiScale, 1.0f / guiScale, 1.0f); + serverChatButton.draw(context, delta); + globalChatButton.draw(context, delta); + matrixStack.pop(); + GL11.glEnable(GL11.GL_CULL_FACE); + } + + @Inject(at = { + @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;addToMessageHistory(Ljava/lang/String;)V", ordinal = 0, shift = At.Shift.AFTER) }, method = "sendMessage(Ljava/lang/String;Z)Z", cancellable = true) + public void onSendMessage(String message, boolean addToHistory, CallbackInfoReturnable cir) { + if (message.startsWith(CommandManager.PREFIX.getValue())) { + Aoba.getInstance().commandManager.command(message.split(" ")); + cir.setReturnValue(true); + }else if (GlobalChat.chatType == ChatType.Global) { + Aoba.getInstance().globalChat.SendMessage(message); + cir.setReturnValue(true); + } + } +} diff --git a/remappedSrc/net/aoba/mixin/ChunkOcclusionDataBuilderMixin.java b/remappedSrc/net/aoba/mixin/ChunkOcclusionDataBuilderMixin.java new file mode 100644 index 00000000..a7a18336 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/ChunkOcclusionDataBuilderMixin.java @@ -0,0 +1,41 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.aoba.Aoba; +import net.minecraft.client.render.chunk.ChunkOcclusionDataBuilder; +import net.minecraft.util.math.BlockPos; + +@Mixin(ChunkOcclusionDataBuilder.class) +public class ChunkOcclusionDataBuilderMixin { + @Inject(at = {@At("HEAD")}, + method = {"markClosed(Lnet/minecraft/util/math/BlockPos;)V"}, + cancellable = true) + private void onMarkClosed(BlockPos pos, CallbackInfo ci) + { + if(Aoba.getInstance().moduleManager.xray.getState()) { + ci.cancel(); + } + } +} diff --git a/remappedSrc/net/aoba/mixin/ClientConnectionMixin.java b/remappedSrc/net/aoba/mixin/ClientConnectionMixin.java new file mode 100644 index 00000000..6b4111a4 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/ClientConnectionMixin.java @@ -0,0 +1,72 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +import org.jetbrains.annotations.Nullable; +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 io.netty.channel.ChannelHandlerContext; +import net.aoba.Aoba; +import net.aoba.event.events.ReceivePacketEvent; +import net.aoba.event.events.SendPacketEvent; +import net.aoba.misc.FakePlayerEntity; +import net.aoba.module.modules.movement.Freecam; +import net.minecraft.network.ClientConnection; +import net.minecraft.network.PacketCallbacks; +import net.minecraft.network.packet.Packet; +import net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket; + +@Mixin(ClientConnection.class) +public class ClientConnectionMixin { + + @Inject(at = { @At(value = "INVOKE", target = "Lnet/minecraft/network/ClientConnection;handlePacket(Lnet/minecraft/network/packet/Packet;Lnet/minecraft/network/listener/PacketListener;)V", ordinal = 0) }, method = "channelRead0(Lio/netty/channel/ChannelHandlerContext;Lnet/minecraft/network/packet/Packet;)V", cancellable = true) + protected void onChannelRead(ChannelHandlerContext channelHandlerContext, Packet packet, CallbackInfo ci) { + + ReceivePacketEvent event = new ReceivePacketEvent(packet); + Aoba.getInstance().eventManager.Fire(event); + + //Aoba.getInstance().moduleManager.recievePacket(packet); + if(Aoba.getInstance().moduleManager.freecam.getState()){ + if(packet instanceof PlayerPositionLookS2CPacket) { + PlayerPositionLookS2CPacket convertedPacket = (PlayerPositionLookS2CPacket)packet; + Freecam freecam = (Freecam)Aoba.getInstance().moduleManager.freecam; + FakePlayerEntity fake = freecam.getFakePlayer(); + fake.setPos(convertedPacket.getX(), convertedPacket.getY(), convertedPacket.getZ()); + fake.setPitch(convertedPacket.getPitch()); + fake.setYaw(convertedPacket.getYaw()); + ci.cancel(); + } + } + } + + @Inject(at = @At("HEAD"), method = "send(Lnet/minecraft/network/packet/Packet;Lnet/minecraft/network/PacketCallbacks;)V", cancellable = true) + private void onSend(Packet packet, @Nullable PacketCallbacks callback, CallbackInfo ci) + { + SendPacketEvent event = new SendPacketEvent(packet); + Aoba.getInstance().eventManager.Fire(event); + + if(event.IsCancelled()) { + ci.cancel(); + } + } + + +} diff --git a/remappedSrc/net/aoba/mixin/ClientPlayerEntityMixin.java b/remappedSrc/net/aoba/mixin/ClientPlayerEntityMixin.java new file mode 100644 index 00000000..9e5a3820 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/ClientPlayerEntityMixin.java @@ -0,0 +1,98 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +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.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import net.aoba.Aoba; +import net.aoba.event.events.PlayerHealthEvent; +import net.aoba.gui.GuiManager; +import net.aoba.misc.FakePlayerEntity; +import net.aoba.module.modules.movement.Fly; +import net.aoba.module.modules.movement.Freecam; +import net.minecraft.client.network.ClientPlayNetworkHandler; +import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; + +@Mixin(ClientPlayerEntity.class) +public abstract class ClientPlayerEntityMixin extends AbstractClientPlayerEntityMixin { + @Shadow + private ClientPlayNetworkHandler networkHandler; + + @Inject(at = { @At("HEAD") }, method = "tick()V", cancellable = true) + private void onPlayerTick(CallbackInfo ci) { + if (Aoba.getInstance().moduleManager.freecam.getState()) { + Freecam freecam = (Freecam) Aoba.getInstance().moduleManager.freecam; + FakePlayerEntity fakePlayer = freecam.getFakePlayer(); + if(fakePlayer != null) { + this.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(fakePlayer.getX(), fakePlayer.getY(), + fakePlayer.getZ(), fakePlayer.isOnGround())); + this.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(fakePlayer.getYaw(), + fakePlayer.getPitch(), fakePlayer.isOnGround())); + } + } + } + + @Inject(at = {@At("HEAD") }, method="sendMovementPackets()V", cancellable = true) + private void sendMovementPackets(CallbackInfo ci) { + if (Aoba.getInstance().moduleManager.freecam.getState()) { + ci.cancel(); + } + } + + + @Inject (at = {@At("HEAD")}, method="setShowsDeathScreen(Z)V") + private void onShowDeathScreen(boolean state, CallbackInfo ci) { + GuiManager hudManager = Aoba.getInstance().hudManager; + + if(state && hudManager.isClickGuiOpen()) { + hudManager.setClickGuiOpen(false); + } + } + + + @Override + public void onIsSpectator(CallbackInfoReturnable cir) { + if(Aoba.getInstance().moduleManager.freecam.getState()) { + cir.setReturnValue(true); + } + } + + @Override + public void onSetHealth(float health, CallbackInfo ci) { + PlayerHealthEvent event = new PlayerHealthEvent(null, health); + Aoba.getInstance().eventManager.Fire(event); + } + + + @Override + protected void onGetOffGroundSpeed(CallbackInfoReturnable cir) { + if(Aoba.getInstance().moduleManager.fly.getState()) { + Fly fly = (Fly)Aoba.getInstance().moduleManager.fly; + cir.setReturnValue((float)fly.getSpeed()); + }else if(Aoba.getInstance().moduleManager.freecam.getState()) { + Freecam freecam = (Freecam)Aoba.getInstance().moduleManager.freecam; + cir.setReturnValue((float)freecam.getSpeed()); + } + } +} diff --git a/remappedSrc/net/aoba/mixin/ClientPlayerInteractionManagerMixin.java b/remappedSrc/net/aoba/mixin/ClientPlayerInteractionManagerMixin.java new file mode 100644 index 00000000..bebb3468 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/ClientPlayerInteractionManagerMixin.java @@ -0,0 +1,46 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.aoba.Aoba; +import net.aoba.module.modules.combat.Reach; +import net.minecraft.client.network.ClientPlayerInteractionManager; + +@Mixin(ClientPlayerInteractionManager.class) +public class ClientPlayerInteractionManagerMixin { + @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); + } +} diff --git a/remappedSrc/net/aoba/mixin/DeathScreenMixin.java b/remappedSrc/net/aoba/mixin/DeathScreenMixin.java new file mode 100644 index 00000000..9d79cfd3 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/DeathScreenMixin.java @@ -0,0 +1,47 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +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 net.aoba.Aoba; +import net.aoba.event.events.PlayerDeathEvent; +import net.aoba.gui.GuiManager; +import net.minecraft.client.gui.screen.DeathScreen; + +@Mixin(DeathScreen.class) +public class DeathScreenMixin{ + + @Inject(at = { @At("HEAD") }, method = "init()V", cancellable = true) + private void onInit(CallbackInfo ci) { + GuiManager hudManager = Aoba.getInstance().hudManager; + if(hudManager.isClickGuiOpen()) { + hudManager.setClickGuiOpen(false); + } + + PlayerDeathEvent event = new PlayerDeathEvent(); + Aoba.getInstance().eventManager.Fire(event); + + if(event.IsCancelled()) { + ci.cancel(); + } + } +} diff --git a/remappedSrc/net/aoba/mixin/EntityMixin.java b/remappedSrc/net/aoba/mixin/EntityMixin.java new file mode 100644 index 00000000..aa9b6434 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/EntityMixin.java @@ -0,0 +1,57 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +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.callback.CallbackInfoReturnable; +import net.aoba.Aoba; +import net.minecraft.entity.Entity; +import net.minecraft.entity.damage.DamageSource; +import net.minecraft.entity.data.DataTracker; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.fluid.Fluid; +import net.minecraft.registry.tag.TagKey; + +@Mixin(Entity.class) +public abstract class EntityMixin{ + + @Shadow + protected DataTracker dataTracker; + + @Shadow + public abstract boolean isSubmergedIn(TagKey fluidTag); + + @Shadow + public abstract boolean isOnGround(); + + @Inject(at = { @At("HEAD") }, method = "isInvisibleTo(Lnet/minecraft/entity/player/PlayerEntity;)Z", cancellable = true) + private void onIsInvisibleCheck(PlayerEntity message, CallbackInfoReturnable cir) { + if(Aoba.getInstance().moduleManager.antiinvis.getState()) { + cir.setReturnValue(false); + } + } + + @Inject(at = {@At("HEAD")}, method = "damage(Lnet/minecraft/entity/damage/DamageSource;F)Z", cancellable = true) + public void onDamage(DamageSource source, float amount, CallbackInfoReturnable ci) { + + } +} diff --git a/remappedSrc/net/aoba/mixin/EntityRendererMixin.java b/remappedSrc/net/aoba/mixin/EntityRendererMixin.java new file mode 100644 index 00000000..5fd1c582 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/EntityRendererMixin.java @@ -0,0 +1,116 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +import org.joml.Matrix4f; +import org.spongepowered.asm.mixin.Final; +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.callback.CallbackInfo; +import net.aoba.Aoba; +import net.aoba.AobaClient; +import net.aoba.module.modules.combat.Nametags; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.font.TextRenderer; +import net.minecraft.client.render.VertexConsumerProvider; +import net.minecraft.client.render.entity.EntityRenderDispatcher; +import net.minecraft.client.render.entity.EntityRenderer; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.entity.Entity; +import net.minecraft.text.Text; + +@Mixin(EntityRenderer.class) +public abstract class EntityRendererMixin { + @Shadow + @Final + protected EntityRenderDispatcher dispatcher; + + @Inject(at = @At(value = "HEAD"), + method = "renderLabelIfPresent(Lnet/minecraft/entity/Entity;Lnet/minecraft/text/Text;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", + cancellable=true) + protected void onRenderLabelIfPresent(T entity, + Text text, + MatrixStack matrices, + VertexConsumerProvider vertexConsumers, + int light, CallbackInfo ci) { + CustomRenderLabel(entity, text, matrices, vertexConsumers, light); + ci.cancel(); + } + + @Shadow + public TextRenderer getTextRenderer() + { + return null; + } + + /** + * Custom Label Render that will allow us to Render what we'd like in the future. + * TODO: If this can be replaced by an INVOKE @ matrixStack.scale(), I would love to do that. + * @param entity Entity being currently rendered. + * @param text The text to render. + * @param matrices The MatrixStack. + * @param vertexConsumers Vertex Consumers + * @param light Light level. + */ + protected void CustomRenderLabel(T entity, + Text text, + MatrixStack matrices, + VertexConsumerProvider vertexConsumers, + int light) { + AobaClient aoba = Aoba.getInstance(); + + double d = dispatcher.getSquaredDistanceToCamera((Entity)entity); + if (d > 4096.0) { + return; + } + boolean bl = !((Entity)entity).isSneaky(); + float f = ((Entity)entity).getNameLabelHeight(); + int i = "deadmau5".equals(text.getString()) ? -10 : 0; + matrices.push(); + matrices.translate(0.0f, f, 0.0f); + matrices.multiply(dispatcher.getRotation()); + matrices.scale(-0.025f, -0.025f, 0.025f); + if(aoba.moduleManager.nametags.getState()) { + float scale = 1.0f; + Nametags nameTagsModule = (Nametags) aoba.moduleManager.nametags; +// TODO Player Entities are not PlayerEntity. +// if(nameTagsModule.getPlayersOnly()) { +// if(entity instanceof PlayerEntity) { +// scale = (float)nameTagsModule.getNametagScale(); +// } +// }else { + scale = (float)nameTagsModule.getNametagScale(); +//} + + matrices.scale(scale, scale, scale); + } + Matrix4f matrix4f = matrices.peek().getPositionMatrix(); + float g = MinecraftClient.getInstance().options.getTextBackgroundOpacity(0.25f); + int j = (int)(g * 255.0f) << 24; + TextRenderer textRenderer = this.getTextRenderer(); + float h = -textRenderer.getWidth(text) / 2; + textRenderer.draw(text, h, (float)i, 0x20FFFFFF, false, matrix4f, vertexConsumers, bl ? TextRenderer.TextLayerType.SEE_THROUGH : TextRenderer.TextLayerType.NORMAL, j, light); + if (bl) { + textRenderer.draw(text, h, (float)i, -1, false, matrix4f, vertexConsumers, TextRenderer.TextLayerType.NORMAL, 0, light); + } + matrices.pop(); + } +} diff --git a/remappedSrc/net/aoba/mixin/FluidBlockMixin.java b/remappedSrc/net/aoba/mixin/FluidBlockMixin.java new file mode 100644 index 00000000..f09de4aa --- /dev/null +++ b/remappedSrc/net/aoba/mixin/FluidBlockMixin.java @@ -0,0 +1,56 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import org.spongepowered.asm.mixin.injection.At; +import net.aoba.Aoba; +import net.aoba.module.modules.movement.Jesus; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.FluidBlock; +import net.minecraft.block.FluidDrainable; +import net.minecraft.block.ShapeContext; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.util.shape.VoxelShapes; +import net.minecraft.world.BlockView; + +@Mixin(FluidBlock.class) +public abstract class FluidBlockMixin extends Block implements FluidDrainable { + + private FluidBlockMixin(Settings blockSettings) { + super(blockSettings); + } + + @Inject(method = "getCollisionShape", at = @At(value = "HEAD"), cancellable = true) + private void getCollisionShape(BlockState blockState_1, BlockView blockView_1, BlockPos blockPos_1, + ShapeContext entityContext_1, CallbackInfoReturnable cir) { + // If Aoba exists and Jesus is toggled (and NOT in legit mode) + if(Aoba.getInstance() != null) { + Jesus jesus = (Jesus) Aoba.getInstance().moduleManager.jesus; + if (jesus.getState() && !jesus.legit.getValue()) { + cir.setReturnValue(VoxelShapes.fullCube()); + cir.cancel(); + } + } + } +} diff --git a/remappedSrc/net/aoba/mixin/GameRendererMixin.java b/remappedSrc/net/aoba/mixin/GameRendererMixin.java new file mode 100644 index 00000000..0538b87d --- /dev/null +++ b/remappedSrc/net/aoba/mixin/GameRendererMixin.java @@ -0,0 +1,49 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +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.Redirect; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import net.aoba.Aoba; +import net.minecraft.client.render.GameRenderer; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.util.math.MathHelper; + +@Mixin(GameRenderer.class) +public 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) { + if (Aoba.getInstance().moduleManager.nooverlay.getState()) { + ci.cancel(); + } + } + + @Redirect(at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;lerp(FFF)F", ordinal = 0), method = { + "renderWorld(FJLnet/minecraft/client/util/math/MatrixStack;)V" }) + private float nauseaLerp(float delta, float first, float second) { + if (Aoba.getInstance().moduleManager.nooverlay.getState()) + return 0; + + return MathHelper.lerp(delta, first, second); + } +} diff --git a/remappedSrc/net/aoba/mixin/HungerManagerMixin.java b/remappedSrc/net/aoba/mixin/HungerManagerMixin.java new file mode 100644 index 00000000..59ab9615 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/HungerManagerMixin.java @@ -0,0 +1,50 @@ +package net.aoba.mixin; + +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.callback.CallbackInfo; + +import net.aoba.Aoba; +import net.aoba.event.events.FoodLevelEvent; +import net.minecraft.client.MinecraftClient; +import net.minecraft.entity.player.HungerManager; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.world.Difficulty; + +@Mixin(HungerManager.class) +public class HungerManagerMixin { + @Shadow + private int foodLevel; + + @Shadow + private float saturationLevel; + + @Shadow + private float exhaustion; + + @Inject(at = { @At("HEAD") }, method = { "update(Lnet/minecraft/entity/player/PlayerEntity;)V" }, cancellable = true) + private void onHungerUpdate(PlayerEntity player, CallbackInfo ci) { + MinecraftClient mc = MinecraftClient.getInstance(); + + if (player == mc.player) { + Difficulty difficulty = player.method_48926().getDifficulty(); + if (this.exhaustion > 4.0f) { + if (this.saturationLevel <= 0.0f && difficulty != Difficulty.PEACEFUL) { + System.out.println("HUNGER EVENT "); + // Fire Event + int newFoodLevel = Math.max(this.foodLevel - 1, 0); + FoodLevelEvent event = new FoodLevelEvent(newFoodLevel); + Aoba.getInstance().eventManager.Fire(event); + } + } + } + } + + @Inject(at = { @At("HEAD") }, method = { "setFoodLevel(I)V" }, cancellable = true) + private void onSetHunger(int foodLevel, CallbackInfo ci) { + FoodLevelEvent event = new FoodLevelEvent(foodLevel); + Aoba.getInstance().eventManager.Fire(event); + } +} diff --git a/remappedSrc/net/aoba/mixin/IngameHudMixin.java b/remappedSrc/net/aoba/mixin/IngameHudMixin.java new file mode 100644 index 00000000..3f45ba8d --- /dev/null +++ b/remappedSrc/net/aoba/mixin/IngameHudMixin.java @@ -0,0 +1,36 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +import net.aoba.Aoba; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.hud.InGameHud; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(InGameHud.class) +public class IngameHudMixin { + + @Inject(at = {@At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;enableBlend()V", remap = false,ordinal = 3) }, method = {"render(Lnet/minecraft/client/gui/DrawContext;F)V" }) + private void onRender(DrawContext context, float tickDelta, CallbackInfo ci) { + Aoba.getInstance().drawHUD(context, tickDelta); + } +} diff --git a/remappedSrc/net/aoba/mixin/KeyboardMixin.java b/remappedSrc/net/aoba/mixin/KeyboardMixin.java new file mode 100644 index 00000000..a6f3ed83 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/KeyboardMixin.java @@ -0,0 +1,45 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +import org.lwjgl.glfw.GLFW; +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 net.aoba.Aoba; +import net.aoba.event.events.KeyDownEvent; +import net.minecraft.client.Keyboard; + +@Mixin(Keyboard.class) +public class KeyboardMixin { + + @Inject(at = {@At("HEAD")}, method = {"onKey(JIIII)V" }, cancellable = true) + private void OnKeyDown(long window, int key, int scancode, + int action, int modifiers, CallbackInfo ci) { + if(action == GLFW.GLFW_PRESS) { + KeyDownEvent event = new KeyDownEvent(window, key, scancode, action, modifiers); + Aoba.getInstance().eventManager.Fire(event); + if(event.IsCancelled()) { + ci.cancel(); + } + } + } +} diff --git a/remappedSrc/net/aoba/mixin/LightmapTextureManagerMixin.java b/remappedSrc/net/aoba/mixin/LightmapTextureManagerMixin.java new file mode 100644 index 00000000..2ba638da --- /dev/null +++ b/remappedSrc/net/aoba/mixin/LightmapTextureManagerMixin.java @@ -0,0 +1,36 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.At; +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) { + if (Aoba.getInstance().moduleManager.nooverlay.getState()) + cir.setReturnValue(0F); + } +} diff --git a/remappedSrc/net/aoba/mixin/LivingEntityMixin.java b/remappedSrc/net/aoba/mixin/LivingEntityMixin.java new file mode 100644 index 00000000..65e0ce71 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/LivingEntityMixin.java @@ -0,0 +1,20 @@ +package net.aoba.mixin; + +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.callback.CallbackInfoReturnable; + +import net.minecraft.entity.LivingEntity; + +@Mixin(LivingEntity.class) +public abstract class LivingEntityMixin extends EntityMixin { + + @Inject (at = {@At("HEAD")}, method="setHealth(F)V") + public void onSetHealth(float health, CallbackInfo ci) { + return; + } + + +} diff --git a/remappedSrc/net/aoba/mixin/MinecraftClientMixin.java b/remappedSrc/net/aoba/mixin/MinecraftClientMixin.java new file mode 100644 index 00000000..f83ec91c --- /dev/null +++ b/remappedSrc/net/aoba/mixin/MinecraftClientMixin.java @@ -0,0 +1,114 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.Mouse; +import net.minecraft.client.session.Session; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.util.thread.ReentrantThreadExecutor; +import org.objectweb.asm.Opcodes; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.Redirect; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(MinecraftClient.class) +public abstract class MinecraftClientMixin{ + + @Shadow + private int itemUseCooldown; + @Shadow + @Final + private Session session; + + @Shadow + @Final + private Mouse mouse; + + @Shadow + public ClientWorld world; + + private Session aobaSession; + + @Inject(at = @At("TAIL"), method = "initFont(Z)V") + private void init(boolean forcesUnicode, CallbackInfo info) { + Aoba.getInstance().loadAssets(); + } + + @Inject(at = @At("TAIL"), method = "tick()V") + public void tick(CallbackInfo info) { + if (this.world != null) { + TickEvent updateEvent = new TickEvent(); + Aoba.getInstance().eventManager.Fire(updateEvent); + + Aoba.getInstance().update(); + } + } + + @Inject(at = {@At("HEAD")}, method = {"getSession()Lnet/minecraft/client/session/Session;"}, cancellable = true) + private void onGetSession(CallbackInfoReturnable cir) + { + if(aobaSession == null) return; + cir.setReturnValue(aobaSession); + } + + @Redirect(at = @At(value = "FIELD",target = "Lnet/minecraft/client/MinecraftClient;session:Lnet/minecraft/client/session/Session;",opcode = Opcodes.GETFIELD,ordinal = 0),method = {"getSession()Lnet/minecraft/client/session/Session;"}) + private Session getSessionForSessionProperties(MinecraftClient mc) + { + if(aobaSession != null)return aobaSession; + return session; + } + + @Inject(at = {@At(value = "FIELD", target = "Lnet/minecraft/client/MinecraftClient;crosshairTarget:Lnet/minecraft/util/hit/HitResult;", ordinal = 0)}, method = {"doAttack()Z"}, cancellable = true) + private void onDoAttack(CallbackInfoReturnable cir) { + //double mouseX = Math.ceil(mouse.getX()); + //double mouseY = Math.ceil(mouse.getY()); + + //System.out.println("DOuble Click?"); + //MouseLeftClickEvent event = new MouseLeftClickEvent(mouseX, mouseY); + + //Aoba.getInstance().eventManager.Fire(event); + + //if(event.IsCancelled()) { + // cir.setReturnValue(false); + // cir.cancel(); + //} + } + + @Inject(at = {@At(value = "HEAD")}, method = {"close()V"}) + private void onClose(CallbackInfo ci) { + try { + Aoba.getInstance().endClient(); + }catch(Exception e) { + e.printStackTrace(); + } + } + + @Inject(at = {@At(value="HEAD")}, method = {"openGameMenu(Z)V"}) + private void onOpenPauseMenu(boolean pause, CallbackInfo ci) { + Aoba.getInstance().hudManager.setClickGuiOpen(false); + } +} diff --git a/remappedSrc/net/aoba/mixin/MouseMixin.java b/remappedSrc/net/aoba/mixin/MouseMixin.java new file mode 100644 index 00000000..03452bd7 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/MouseMixin.java @@ -0,0 +1,92 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +import org.lwjgl.glfw.GLFW; +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.callback.CallbackInfo; +import net.aoba.Aoba; +import net.aoba.event.events.MouseMoveEvent; +import net.aoba.event.events.MouseScrollEvent; +import net.aoba.event.events.LeftMouseDownEvent; +import net.aoba.event.events.LeftMouseUpEvent; +import net.minecraft.client.Mouse; + +@Mixin(Mouse.class) +public class MouseMixin { + @Shadow + private double x; + @Shadow + private double y; + + @Inject(at = { @At("HEAD") }, method = { "onMouseButton(JIII)V" }, cancellable = true) + private void onMouseButton(long window, int button, int action, int mods, CallbackInfo ci) { + switch (button) { + case GLFW.GLFW_MOUSE_BUTTON_LEFT: + if (action == 1) { + LeftMouseDownEvent event = new LeftMouseDownEvent(x, y); + Aoba.getInstance().eventManager.Fire(event); + + if (event.IsCancelled()) { + ci.cancel(); + } + } else { + LeftMouseUpEvent event = new LeftMouseUpEvent(x, y); + Aoba.getInstance().eventManager.Fire(event); + + if (event.IsCancelled()) { + ci.cancel(); + } + } + break; + case GLFW.GLFW_MOUSE_BUTTON_MIDDLE: + + break; + } + } + + @Inject(at = { @At("HEAD") }, method = { "onMouseScroll(JDD)V" }, cancellable = true) + private void onMouseScroll(long window, double horizontal, double vertical, CallbackInfo ci) { + MouseScrollEvent event = new MouseScrollEvent(horizontal, vertical); + Aoba.getInstance().eventManager.Fire(event); + + if (event.IsCancelled()) { + ci.cancel(); + } + } + + @Inject(at = { @At("HEAD") }, method = { "lockCursor()V" }, cancellable = true) + private void onLockCursor(CallbackInfo ci) { + if (Aoba.getInstance().hudManager.isClickGuiOpen()) + ci.cancel(); + } + + @Inject(at = { @At(value = "INVOKE", target = "Lnet/minecraft/client/Mouse;updateMouse()V") }, method = { + "onCursorPos(JDD)V" }, cancellable = true) + private void onCursorPos(long window, double x, double y, CallbackInfo ci) { + MouseMoveEvent event = new MouseMoveEvent(x, y); + Aoba.getInstance().eventManager.Fire(event); + + if (event.IsCancelled()) + ci.cancel(); + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/mixin/MultiplayerScreenMixin.java b/remappedSrc/net/aoba/mixin/MultiplayerScreenMixin.java new file mode 100644 index 00000000..9508a042 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/MultiplayerScreenMixin.java @@ -0,0 +1,46 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +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 net.aoba.gui.screens.AltScreen; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen; +import net.minecraft.client.gui.widget.ButtonWidget; + +import net.minecraft.text.Text; + +@Mixin(MultiplayerScreen.class) +public class MultiplayerScreenMixin extends Screen { + + protected MultiplayerScreenMixin(Text title) { + super(title); + } + + @Inject(at = {@At("TAIL")}, method = {"init()V"}) + private void onInit(CallbackInfo ci) { + this.addDrawableChild(ButtonWidget.builder(Text.of("Alt Manager"), b -> client.setScreen(new AltScreen((MultiplayerScreen)(Object)this))) + .dimensions(this.width / 2 + 4 + 50, 7, 100, 20).build()); + } + +} diff --git a/remappedSrc/net/aoba/mixin/PlayerEntityMixin.java b/remappedSrc/net/aoba/mixin/PlayerEntityMixin.java new file mode 100644 index 00000000..69264877 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/PlayerEntityMixin.java @@ -0,0 +1,67 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import org.spongepowered.asm.mixin.injection.At; +import net.aoba.Aoba; +import net.aoba.AobaClient; +import net.aoba.event.events.PlayerHealthEvent; +import net.aoba.module.modules.misc.FastBreak; +import net.minecraft.block.BlockState; +import net.minecraft.entity.damage.DamageSource; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.registry.tag.FluidTags; + +@Mixin (PlayerEntity.class) +public abstract class PlayerEntityMixin extends LivingEntityMixin { + + @Shadow + private PlayerInventory inventory; + + @Shadow + public abstract boolean isSpectator(); + + @Inject(method = "getBlockBreakingSpeed", at = @At("HEAD"), cancellable = true) + public void onGetBlockBreakingSpeed(BlockState blockState, CallbackInfoReturnable ci) { + AobaClient aoba = Aoba.getInstance(); + FastBreak fastBreak = (FastBreak)aoba.moduleManager.fastbreak; + if(fastBreak.getState()) { + float speed = inventory.getBlockBreakingSpeed(blockState); + speed *= fastBreak.multiplier.getValue(); + + if(!fastBreak.ignoreWater.getValue()) { + if(isSubmergedIn(FluidTags.WATER) || isSubmergedIn(FluidTags.LAVA) ||!isOnGround()) { + speed /= 5.0F; + } + } + + ci.setReturnValue(speed); + } + } + + @Inject(at = {@At("HEAD")}, method="getOffGroundSpeed()F", cancellable = true) + protected void onGetOffGroundSpeed(CallbackInfoReturnable cir) { + return; + } +} diff --git a/remappedSrc/net/aoba/mixin/RenderTickCounterMixin.java b/remappedSrc/net/aoba/mixin/RenderTickCounterMixin.java new file mode 100644 index 00000000..3f5dc342 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/RenderTickCounterMixin.java @@ -0,0 +1,46 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +import org.objectweb.asm.Opcodes; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import org.spongepowered.asm.mixin.injection.At; + +import net.aoba.Aoba; +import net.aoba.module.modules.misc.Timer; +import net.minecraft.client.render.RenderTickCounter; + +@Mixin(RenderTickCounter.class) +public class RenderTickCounterMixin { + @Shadow + private float lastFrameDuration; + + + @Inject(at = {@At(value = "FIELD", target = "Lnet/minecraft/client/render/RenderTickCounter;prevTimeMillis:J", + opcode = Opcodes.PUTFIELD, ordinal = 0) }, method = {"beginRenderTick(J)I" }) + public void onBeginRenderTick(long long_1, CallbackInfoReturnable cir) { + Timer timer = (Timer) Aoba.getInstance().moduleManager.timer; + if(timer.getState()) { + lastFrameDuration *= timer.getMultiplier(); + } + } +} diff --git a/remappedSrc/net/aoba/mixin/ScreenMixin.java b/remappedSrc/net/aoba/mixin/ScreenMixin.java new file mode 100644 index 00000000..b50ad156 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/ScreenMixin.java @@ -0,0 +1,22 @@ +package net.aoba.mixin; + +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 net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.screen.Screen; + +@Mixin(Screen.class) +public abstract class ScreenMixin { + @Inject(at = {@At("HEAD")}, method = {"render(Lnet/minecraft/client/gui/DrawContext;IIF)V"}, cancellable = true) + protected void onRender(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) + { + + } + + @Inject(at = {@At("HEAD")}, method = {"close()V"}, cancellable = true) + protected void onClose(CallbackInfo ci) { + + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/mixin/SimpleOptionMixin.java b/remappedSrc/net/aoba/mixin/SimpleOptionMixin.java new file mode 100644 index 00000000..5f3b7b08 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/SimpleOptionMixin.java @@ -0,0 +1,56 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +import java.util.function.Consumer; + +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; + +import net.aoba.interfaces.ISimpleOption; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.option.SimpleOption; + +@Mixin(SimpleOption.class) +public class SimpleOptionMixin implements ISimpleOption +{ + @Shadow + T value; + + @Shadow + @Final + private Consumer changeCallback; + + @Override + public void forceSetValue(T newValue) + { + if(!MinecraftClient.getInstance().isRunning()) + { + value = newValue; + return; + } + + if(!value.equals(newValue)) + { + value = newValue; + changeCallback.accept(value); + } + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/mixin/TerrainRenderContextMixin.java b/remappedSrc/net/aoba/mixin/TerrainRenderContextMixin.java new file mode 100644 index 00000000..7817df2e --- /dev/null +++ b/remappedSrc/net/aoba/mixin/TerrainRenderContextMixin.java @@ -0,0 +1,48 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +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 net.aoba.Aoba; +import net.aoba.AobaClient; +import net.aoba.module.modules.render.XRay; +import net.fabricmc.fabric.impl.client.indigo.renderer.render.TerrainRenderContext; +import net.minecraft.block.BlockState; +import net.minecraft.client.render.model.BakedModel; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.util.math.BlockPos; + +@Mixin(TerrainRenderContext.class) +public class TerrainRenderContextMixin { + @Inject(at = { @At("HEAD") }, method = { "tessellateBlock" }, cancellable = true, remap = false) + private void tesselateBlock(BlockState blockState, BlockPos blockPos, final BakedModel model, + MatrixStack matrixStack, CallbackInfo ci) { + AobaClient aoba = Aoba.getInstance(); + XRay xray = (XRay)aoba.moduleManager.xray; + if (xray.getState()) { + if (xray.isXRayBlock(blockState.getBlock())) { + ci.cancel(); + return; + } + } + } +} diff --git a/remappedSrc/net/aoba/mixin/TitleScreenMixin.java b/remappedSrc/net/aoba/mixin/TitleScreenMixin.java new file mode 100644 index 00000000..46f01e67 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/TitleScreenMixin.java @@ -0,0 +1,44 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.At; +import net.aoba.Aoba; +import net.aoba.AobaClient; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.screen.TitleScreen; +import net.minecraft.text.Text; + +@Mixin(TitleScreen.class) +public abstract class TitleScreenMixin extends Screen { + + protected TitleScreenMixin(Text title) { + super(title); + } + + @Inject(at = { @At(value = "INVOKE", target = "Lnet/minecraft/GameVersion;getName()Ljava/lang/String;", ordinal = 0) }, method = "render(Lnet/minecraft/client/gui/DrawContext;IIF)V") + public void onRender(DrawContext context, int mouseX, int mouseY,float delta, CallbackInfo ci) { + Aoba.getInstance(); + context.drawTextWithShadow(this.textRenderer, "Aoba " + AobaClient.AOBA_VERSION, 2, this.height - 20, 0xFF00FF); + } +} diff --git a/remappedSrc/net/aoba/mixin/WorldChunkMixin.java b/remappedSrc/net/aoba/mixin/WorldChunkMixin.java new file mode 100644 index 00000000..2592fa05 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/WorldChunkMixin.java @@ -0,0 +1,28 @@ +package net.aoba.mixin; + +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.callback.CallbackInfoReturnable; + +import net.aoba.Aoba; +import net.aoba.event.events.BlockStateEvent; +import net.minecraft.block.BlockState; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.chunk.WorldChunk; + +@Mixin(WorldChunk.class) +public class WorldChunkMixin { + + @Shadow + private World world; + + @Inject(method = "setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Z)Lnet/minecraft/block/BlockState;", at = { @At(value = "RETURN")}) + private void onSetBlockState(BlockPos pos, BlockState state, boolean moved, CallbackInfoReturnable cir) { + if(world.isClient()) { + Aoba.getInstance().eventManager.Fire(new BlockStateEvent(pos, cir.getReturnValue(), state)); + } + } +} diff --git a/remappedSrc/net/aoba/mixin/WorldRendererMixin.java b/remappedSrc/net/aoba/mixin/WorldRendererMixin.java new file mode 100644 index 00000000..ceed02e1 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/WorldRendererMixin.java @@ -0,0 +1,48 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin; + +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.callback.CallbackInfoReturnable; +import net.aoba.Aoba; +import net.minecraft.client.render.Camera; +import net.minecraft.client.render.GameRenderer; +import net.minecraft.client.render.LightmapTextureManager; +import net.minecraft.client.render.WorldRenderer; +import net.minecraft.client.util.math.MatrixStack; +import org.joml.Matrix4f; + +@Mixin(WorldRenderer.class) +public class WorldRendererMixin { + @Inject(at = { @At("RETURN") }, method = { "render" }) + private void onRenderWorld(MatrixStack matrixStack, float tickDelta, long limitTime, boolean renderBlockOutline, + Camera camera, GameRenderer gameRenderer, LightmapTextureManager lightmapTextureManager, Matrix4f matrix4f, + CallbackInfo info) { + Aoba.getInstance().moduleManager.render(matrixStack); + } + + @Inject(at = @At("HEAD"), method = "hasBlindnessOrDarkness(Lnet/minecraft/client/render/Camera;)Z", cancellable = true) + private void onHasBlindnessOrDarknessEffect(Camera camera, CallbackInfoReturnable cir) { + if (Aoba.getInstance().moduleManager.nooverlay.getState()) + cir.setReturnValue(false); + } +} diff --git a/remappedSrc/net/aoba/mixin/interfaces/IEntityVelocityUpdateS2CPacket.java b/remappedSrc/net/aoba/mixin/interfaces/IEntityVelocityUpdateS2CPacket.java new file mode 100644 index 00000000..62ce8aa8 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/interfaces/IEntityVelocityUpdateS2CPacket.java @@ -0,0 +1,51 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin.interfaces; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Mutable; +import org.spongepowered.asm.mixin.gen.Accessor; +import net.minecraft.network.packet.s2c.play.EntityVelocityUpdateS2CPacket; + +@Mixin(EntityVelocityUpdateS2CPacket.class) +public interface IEntityVelocityUpdateS2CPacket { + @Mutable + @Accessor("velocityX") + void setVelocityX(int velocityX); + + @Mutable + @Accessor("velocityY") + void setVelocityY(int velocityY); + + @Mutable + @Accessor("velocityZ") + void setVelocityZ(int velocityZ); + + @Accessor("id") + int getId(); + + @Accessor("velocityX") + int getVelocityX(); + + @Accessor("velocityY") + int getVelocityY(); + + @Accessor("velocityZ") + int getVelocity(); +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/mixin/interfaces/IExplosionS2CPacket.java b/remappedSrc/net/aoba/mixin/interfaces/IExplosionS2CPacket.java new file mode 100644 index 00000000..5bee8c10 --- /dev/null +++ b/remappedSrc/net/aoba/mixin/interfaces/IExplosionS2CPacket.java @@ -0,0 +1,49 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin.interfaces; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Mutable; +import org.spongepowered.asm.mixin.gen.Accessor; + +import net.minecraft.network.packet.s2c.play.ExplosionS2CPacket; + +@Mixin(ExplosionS2CPacket.class) +public interface IExplosionS2CPacket { + @Mutable + @Accessor("playerVelocityX") + void setVelocityX(float velocityX); + + @Mutable + @Accessor("playerVelocityY") + void setVelocityY(float velocityY); + + @Mutable + @Accessor("playerVelocityZ") + void setVelocityZ(float velocityZ); + + @Accessor("playerVelocityX") + float getVelocityX(); + + @Accessor("playerVelocityY") + float getVelocityY(); + + @Accessor("playerVelocityZ") + float getVelocity(); +} diff --git a/remappedSrc/net/aoba/mixin/interfaces/ILivingEntity.java b/remappedSrc/net/aoba/mixin/interfaces/ILivingEntity.java new file mode 100644 index 00000000..932cdcdd --- /dev/null +++ b/remappedSrc/net/aoba/mixin/interfaces/ILivingEntity.java @@ -0,0 +1,32 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin.interfaces; + +import net.minecraft.entity.LivingEntity; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +@Mixin(LivingEntity.class) +public interface ILivingEntity { + @Accessor("jumpingCooldown") + int getJumpCooldown(); + + @Accessor("jumpingCooldown") + void setJumpCooldown(int val); +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/mixin/interfaces/IMinecraftClient.java b/remappedSrc/net/aoba/mixin/interfaces/IMinecraftClient.java new file mode 100644 index 00000000..4271ee8d --- /dev/null +++ b/remappedSrc/net/aoba/mixin/interfaces/IMinecraftClient.java @@ -0,0 +1,43 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.mixin.interfaces; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Mutable; +import org.spongepowered.asm.mixin.gen.Accessor; +import org.spongepowered.asm.mixin.gen.Invoker; + +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.session.Session; + +@Mixin(MinecraftClient.class) +public interface IMinecraftClient { + @Accessor("itemUseCooldown") + int getItemUseCooldown(); + + @Accessor("itemUseCooldown") + void setItemUseCooldown(int value); + + @Invoker("doItemUse") + void useItem(); + + @Mutable + @Accessor("session") + void setSession(Session session); +} diff --git a/remappedSrc/net/aoba/module/Module.java b/remappedSrc/net/aoba/module/Module.java new file mode 100644 index 00000000..48fcfd58 --- /dev/null +++ b/remappedSrc/net/aoba/module/Module.java @@ -0,0 +1,150 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * A class to represent a generic module. + */ +package net.aoba.module; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.util.ArrayList; +import java.util.List; +import net.aoba.Aoba; +import net.aoba.AobaClient; +import net.aoba.mixin.interfaces.IMinecraftClient; +import net.aoba.settings.Setting; +import net.aoba.settings.SettingManager; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.MinecraftClient; + +public abstract class Module { + private String name; + private String description; + private Category category; + private boolean state; + + protected KeybindSetting keyBind; + private List> settings = new ArrayList>(); + + protected final MinecraftClient MC = AobaClient.MC; + protected final IMinecraftClient IMC = AobaClient.IMC; + + public Module(KeybindSetting keyBind) { + this.keyBind = keyBind; + this.addSetting(keyBind); + SettingManager.registerSetting(this.keyBind, Aoba.getInstance().settingManager.modules_category); + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Module.Category getCategory() { + return this.category; + } + + public void setCategory(Module.Category category) { + this.category = category; + } + + public KeybindSetting getBind() { + return this.keyBind; + } + + + public boolean getState() { + return this.state; + } + + public void setState(boolean state) { + this.onToggle(); + if(this.state = state) return; + if (state) { + this.onEnable(); + this.state = true; + } else { + this.onDisable(); + this.state = false; + } + + } + + public void addSetting(Setting setting) { + this.settings.add(setting); + } + + public List> getSettings() { + return this.settings; + } + + public boolean hasSettings() { + return !this.settings.isEmpty(); + } + + public abstract void onDisable(); + + public abstract void onEnable(); + + public abstract void onToggle(); + + public void toggle() { + if(this.state) { + this.onDisable(); + }else { + this.onEnable(); + } + this.setState(!this.getState()); + } + + public final boolean isCategory(Module.Category category) { + return category == this.category; + } + + @Retention(RetentionPolicy.RUNTIME) + public @interface ModInfo { + String name(); + + String description(); + + Module.Category category(); + + int bind(); + } + + public static enum Category { + Combat(), Movement(), Render(), World(), Misc(); + Module module; + + private Category() { + + } + } +} diff --git a/remappedSrc/net/aoba/module/ModuleManager.java b/remappedSrc/net/aoba/module/ModuleManager.java new file mode 100644 index 00000000..56cf5291 --- /dev/null +++ b/remappedSrc/net/aoba/module/ModuleManager.java @@ -0,0 +1,217 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * A class to represent a system that manages all of the Modules. + */ +package net.aoba.module; + +import java.util.ArrayList; +import net.aoba.Aoba; +import net.aoba.event.events.KeyDownEvent; +import net.aoba.event.events.RenderEvent; +import net.aoba.event.listeners.KeyDownListener; +import org.lwjgl.opengl.GL11; +import net.aoba.module.modules.combat.*; +import net.aoba.module.modules.misc.*; +import net.aoba.module.modules.movement.*; +import net.aoba.module.modules.render.*; +import net.aoba.module.modules.world.*; +import net.aoba.settings.Setting; +import net.aoba.settings.SettingManager; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.util.InputUtil.Key; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.util.math.Vec3d; + +public class ModuleManager implements KeyDownListener { + public ArrayList modules = new ArrayList(); + + private MinecraftClient mc = MinecraftClient.getInstance(); + + //Modules + public Module aimbot = new Aimbot(); + public Module anticactus = new AntiCactus(); + public Module antiinvis = new AntiInvis(); + public Module antiknockback = new AntiKnockback(); + public Module autoeat = new AutoEat(); + public Module autofarm = new AutoFarm(); + public Module autofish = new AutoFish(); + public Module autosign = new AutoSign(); + public Module autosoup = new AutoSoup(); + public Module autoTotem = new AutoTotem(); + public Module autorespawn = new AutoRespawn(); + public Module autowalk = new AutoWalk(); + public Module breadcrumbs = new Breadcrumbs(); + public Module chestesp = new ChestESP(); + public Module criticals = new Criticals(); + public Module crystalaura = new CrystalAura(); + public Module entityesp = new EntityESP(); + public Module fastplace = new FastPlace(); + public Module fastbreak = new FastBreak(); + public Module fly = new Fly(); + public Module freecam = new Freecam(); + public Module fullbright = new Fullbright(); + public Module itemesp = new ItemESP(); + public Module glide = new Glide(); + public Module jesus = new Jesus(); + public Module jetpack = new Jetpack(); + public Module killaura = new KillAura(); + public Module nametags = new Nametags(); + public Module noclip = new Noclip(); + public Module nofall = new NoFall(); + public Module nojumpdelay = new NoJumpDelay(); + public Module nooverlay = new NoOverlay(); + public Module noslowdown = new NoSlowdown(); + public Module nuker = new Nuker(); + public Module playeresp = new PlayerESP(); + public Module pov = new POV(); + public Module reach = new Reach(); + public Module safewalk = new Safewalk(); + public Module sneak = new Sneak(); + public Module spawneresp = new SpawnerESP(); + public Module spider = new Spider(); + public Module sprint = new Sprint(); + public Module step = new Step(); + public Module surround = new Surround(); + public Module tilebreaker = new TileBreaker(); + public Module timer = new Timer(); + public Module tracer = new Tracer(); + public Module trajectory = new Trajectory(); + public Module triggerbot = new TriggerBot(); + public Module xray = new XRay(); + public Module zoom = new Zoom(); + + public ModuleManager() { + // Look at all these modules! + addModule(aimbot); + addModule(anticactus); + addModule(antiinvis); + addModule(antiknockback); + addModule(autoeat); + addModule(autofarm); + addModule(autofish); + addModule(autosign); + addModule(autosoup); + addModule(autoTotem); + addModule(autorespawn); + addModule(autowalk); + addModule(breadcrumbs); + addModule(chestesp); + addModule(criticals); + addModule(crystalaura); + addModule(entityesp); + addModule(fastplace); + addModule(fastbreak); + addModule(fly); + addModule(freecam); + addModule(fullbright); + addModule(glide); + addModule(itemesp); + addModule(jesus); + addModule(jetpack); + addModule(killaura); + addModule(nametags); + addModule(noclip); + addModule(nofall); + addModule(nojumpdelay); + addModule(nooverlay); + addModule(noslowdown); + addModule(nuker); + addModule(playeresp); + addModule(pov); + addModule(reach); + addModule(safewalk); + addModule(sneak); + addModule(spawneresp); + addModule(spider); + addModule(sprint); + addModule(step); + addModule(surround); + addModule(tilebreaker); + addModule(timer); + addModule(triggerbot); + addModule(tracer); + addModule(trajectory); + addModule(xray); + addModule(zoom); + + for(Module module : modules) { + for(Setting setting : module.getSettings()) { + SettingManager.registerSetting(setting, Aoba.getInstance().settingManager.modules_category); + } + } + + Aoba.getInstance().eventManager.AddListener(KeyDownListener.class, this); + } + + public void update() { + } + + public void render(MatrixStack matrixStack) { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glEnable(GL11.GL_LINE_SMOOTH); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_DEPTH_TEST); + + matrixStack.push(); + + Vec3d camPos = mc.getBlockEntityRenderDispatcher().camera.getPos(); + matrixStack.translate(-camPos.x, -camPos.y, -camPos.z); + + RenderEvent renderEvent = new RenderEvent(matrixStack, MinecraftClient.getInstance().getTickDelta()); + Aoba.getInstance().eventManager.Fire(renderEvent); + + matrixStack.pop(); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_LINE_SMOOTH); + } + + public void addModule(Module module) { + modules.add(module); + } + + public void disableAll() { + for(Module module : modules) { + module.setState(false); + } + } + + public Module getModuleByName(String string) { + for(Module module : modules) { + if(module.getName().equalsIgnoreCase(string)) { + return module; + } + } + return null; + } + + @Override + public void OnKeyDown(KeyDownEvent event) { + if(mc.currentScreen == null) { + for(Module module : modules) { + Key binding = module.getBind().getValue(); + if(binding.getCode() == event.GetKey()) { + module.toggle(); + } + } + } + } +} diff --git a/remappedSrc/net/aoba/module/modules/combat/Aimbot.java b/remappedSrc/net/aoba/module/modules/combat/Aimbot.java new file mode 100644 index 00000000..3058ad5f --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/combat/Aimbot.java @@ -0,0 +1,131 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Aimbot Module + */ +package net.aoba.module.modules.combat; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.RenderEvent; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.RenderListener; +import net.aoba.event.listeners.TickListener; +import net.aoba.misc.RenderUtils; +import net.aoba.module.Module; +import net.aoba.settings.types.BooleanSetting; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.command.argument.EntityAnchorArgumentType.EntityAnchor; +import net.minecraft.entity.Entity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.util.math.Vec3d; +import net.minecraft.client.util.InputUtil; + +public class Aimbot extends Module implements TickListener, RenderListener { + + private LivingEntity temp = null; + + private BooleanSetting targetAnimals; + private BooleanSetting targetPlayers; + private FloatSetting frequency; + + private int currentTick = 0; + + public Aimbot() { + super(new KeybindSetting("key.aimbot", "Aimbot Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + this.setName("Aimbot"); + + this.setCategory(Category.Combat); + this.setDescription("Locks your crosshair towards a desire player or entity."); + + targetAnimals = new BooleanSetting("aimbot_target_mobs", "Target Mobs", "Target mobs.", false); + targetPlayers = new BooleanSetting("aimbot_target_players", "Target Players", "Target players.", true); + frequency = new FloatSetting("aimbot_frequency", "Ticks", "How frequent the aimbot updates (Lower = Laggier)", 1.0f, 1.0f, 20.0f, 1.0f); + this.addSetting(targetAnimals); + this.addSetting(targetPlayers); + this.addSetting(frequency); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + Aoba.getInstance().eventManager.RemoveListener(RenderListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + Aoba.getInstance().eventManager.AddListener(RenderListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnRender(RenderEvent event) { + if(temp != null) { + Vec3d offset = RenderUtils.getEntityPositionOffsetInterpolated(temp, event.GetPartialTicks()); + MC.player.lookAt(EntityAnchor.EYES, temp.getEyePos().add(offset)); + } + } + + @Override + public void OnUpdate(TickEvent event) { + currentTick++; + if(currentTick >= frequency.getValue()) { + if (this.targetPlayers.getValue()) { + if (MC.world.getPlayers().size() == 2) { + temp = MC.world.getPlayers().get(1); + } else if (MC.world.getPlayers().size() > 2) { + for (int x = 0; x < MC.world.getPlayers().size(); x++) { + for (int y = 1; y < MC.world.getPlayers().size(); y++) { + if (MC.world.getPlayers().get(x).distanceTo(MC.player) < MC.world.getPlayers().get(y) + .distanceTo(MC.player)) { + temp = MC.world.getPlayers().get(x); + } + } + } + } + } + if (this.targetAnimals.getValue()) { + LivingEntity tempEntity = null; + for (Entity entity : MC.world.getEntities()) { + if (!(entity instanceof LivingEntity)) + continue; + if (entity instanceof ClientPlayerEntity) + continue; + if (tempEntity == null) { + tempEntity = (LivingEntity) entity; + } else { + if (entity.distanceTo(MC.player) < tempEntity.distanceTo(MC.player)) { + tempEntity = (LivingEntity) entity; + } + } + } + temp = tempEntity; + } + + currentTick = 0; + } + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/module/modules/combat/AntiInvis.java b/remappedSrc/net/aoba/module/modules/combat/AntiInvis.java new file mode 100644 index 00000000..3fd1c153 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/combat/AntiInvis.java @@ -0,0 +1,54 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Anti-Invis Module + */ +package net.aoba.module.modules.combat; + +import org.lwjgl.glfw.GLFW; + +import net.aoba.module.Module; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; + +public class AntiInvis extends Module { + + public AntiInvis() { + super(new KeybindSetting("key.antiinvis", "AntiInvis Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("AntiInvis"); + this.setCategory(Category.Combat); + this.setDescription("Reveals players who are invisible."); + } + + @Override + public void onDisable() { + + } + + @Override + public void onEnable() { + + } + + @Override + public void onToggle() { + + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/module/modules/combat/AntiKnockback.java b/remappedSrc/net/aoba/module/modules/combat/AntiKnockback.java new file mode 100644 index 00000000..279af76e --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/combat/AntiKnockback.java @@ -0,0 +1,86 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * AntiKnockback Module + */ +package net.aoba.module.modules.combat; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.ReceivePacketEvent; +import net.aoba.event.listeners.ReceivePacketListener; +import net.aoba.mixin.interfaces.IEntityVelocityUpdateS2CPacket; +import net.aoba.mixin.interfaces.IExplosionS2CPacket; +import net.aoba.module.Module; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.util.InputUtil; +import net.minecraft.network.packet.Packet; +import net.minecraft.network.packet.s2c.play.EntityVelocityUpdateS2CPacket; +import net.minecraft.network.packet.s2c.play.ExplosionS2CPacket; + +public class AntiKnockback extends Module implements ReceivePacketListener { + + public AntiKnockback() { + super(new KeybindSetting("key.antiknockback", "AntiKnockback Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("AntiKnockback"); + + this.setCategory(Category.Combat); + this.setDescription("Prevents knockback."); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(ReceivePacketListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(ReceivePacketListener.class, this); + } + + + @Override + public void onToggle() { + + } + + @Override + public void OnReceivePacket(ReceivePacketEvent readPacketEvent) { + MinecraftClient mc = MinecraftClient.getInstance(); + Packet packet = readPacketEvent.GetPacket(); + + if(packet instanceof EntityVelocityUpdateS2CPacket) { + IEntityVelocityUpdateS2CPacket velocityUpdatePacket = (IEntityVelocityUpdateS2CPacket) packet; + if(velocityUpdatePacket.getId() == mc.player.getId()) { + velocityUpdatePacket.setVelocityX(0); + velocityUpdatePacket.setVelocityY(0); + velocityUpdatePacket.setVelocityZ(0); + } + } + + if(packet instanceof ExplosionS2CPacket) { + IExplosionS2CPacket explosionPacket = (IExplosionS2CPacket)packet; + explosionPacket.setVelocityX(0); + explosionPacket.setVelocityY(0); + explosionPacket.setVelocityZ(0); + } + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/module/modules/combat/AutoRespawn.java b/remappedSrc/net/aoba/module/modules/combat/AutoRespawn.java new file mode 100644 index 00000000..8da70330 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/combat/AutoRespawn.java @@ -0,0 +1,63 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * AutoRespawn Module + */ +package net.aoba.module.modules.combat; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.PlayerDeathEvent; +import net.aoba.event.listeners.PlayerDeathListener; +import net.aoba.module.Module; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; + +public class AutoRespawn extends Module implements PlayerDeathListener { + + public AutoRespawn() { + super(new KeybindSetting("key.autorespawn", "AutoRespawn Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("AutoRespawn"); + + this.setCategory(Category.Combat); + this.setDescription("Automatically respawns when you die."); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(PlayerDeathListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(PlayerDeathListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnPlayerDeath(PlayerDeathEvent readPacketEvent) { + MC.player.requestRespawn(); + MC.setScreen(null); + } +} diff --git a/remappedSrc/net/aoba/module/modules/combat/AutoSoup.java b/remappedSrc/net/aoba/module/modules/combat/AutoSoup.java new file mode 100644 index 00000000..f55ad0db --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/combat/AutoSoup.java @@ -0,0 +1,139 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * AutoSoup Module + */ +package net.aoba.module.modules.combat; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.PlayerHealthEvent; +import net.aoba.event.listeners.PlayerHealthListener; +import net.aoba.module.Module; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.item.StewItem; +import net.minecraft.screen.slot.SlotActionType; +import net.minecraft.util.Hand; + +public class AutoSoup extends Module implements PlayerHealthListener { + + private FloatSetting health; + + private int previousSlot = -1; + + public AutoSoup() { + super(new KeybindSetting("key.autosoup", "AutoSoup Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("AutoSoup"); + this.setCategory(Category.Combat); + this.setDescription("Automatically consumes soup when health is low. (KitPVP)"); + + health = new FloatSetting("autosoup_health", "Min. Health", "Minimum health that the AutoSoup will trigger.", 6f, 1f, 20f, 1f); + this.addSetting(health); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(PlayerHealthListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(PlayerHealthListener.class, this); + } + + @Override + public void onToggle() { + + } + + public void sortInventory() { + for(int i = 0; i < PlayerInventory.getHotbarSize(); i++) { + ItemStack stack = MC.player.getInventory().getStack(i); + if(stack == null || stack.getItem() == Items.BOWL) { + int nextSoup = findSoup(); + if(nextSoup >= 0) { + MC.interactionManager.clickSlot(0, nextSoup, 0, SlotActionType.PICKUP, MC.player); + MC.interactionManager.clickSlot(0, i, 0, SlotActionType.PICKUP, MC.player); + } + } + } + } + + public int findSoup() { + for(int i = 0; i < 36; i++) + { + ItemStack stack = MC.player.getInventory().getStack(i); + if(stack != null && stack.getItem() == Items.MUSHROOM_STEW) { + return i; + } + } + return -1; + } + + public void setHunger(int hunger) { + + } + + @Override + public void OnHealthChanged(PlayerHealthEvent readPacketEvent) { + System.out.println("autosoup"); + float playerHealth = readPacketEvent.getHealth(); + + // If the players HP is below the given threshold. + if(playerHealth < health.getValue()) { + System.out.println("autosoup enabled"); + // Find the first item in the hotbar that is a Stew item. + int foodSlot= -1; + for(int i = 0; i< PlayerInventory.getHotbarSize(); i++) { + Item item = MC.player.getInventory().getStack(i).getItem(); + + if(item instanceof StewItem) { + foodSlot = i; + break; + } + } + + // If a Stew item was found, switch to it and use it. + if(foodSlot >= 0) { + previousSlot = MC.player.getInventory().selectedSlot; + + MC.player.getInventory().selectedSlot = foodSlot; + MC.options.useKey.setPressed(true); + MC.interactionManager.interactItem(MC.player, Hand.MAIN_HAND); + + // Return the player's selected slot back to the previous slot. + if(previousSlot != -1) { + MC.options.useKey.setPressed(false); + MC.player.getInventory().selectedSlot = previousSlot; + previousSlot = -1; + } + }else { + // Otherwise, sort the inventory to try and find some. + sortInventory(); + } + } + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/module/modules/combat/AutoTotem.java b/remappedSrc/net/aoba/module/modules/combat/AutoTotem.java new file mode 100644 index 00000000..bcfd506c --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/combat/AutoTotem.java @@ -0,0 +1,151 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * AutoTotem Module + */ +package net.aoba.module.modules.combat; + +import org.lwjgl.glfw.GLFW; + +import net.aoba.Aoba; +import net.aoba.event.events.PlayerHealthEvent; +import net.aoba.event.events.ReceivePacketEvent; +import net.aoba.event.listeners.PlayerHealthListener; +import net.aoba.event.listeners.ReceivePacketListener; +import net.aoba.module.Module; +import net.aoba.settings.types.BooleanSetting; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.screen.ingame.GenericContainerScreen; +import net.minecraft.client.util.InputUtil; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket; +import net.minecraft.network.packet.s2c.play.EntitySpawnS2CPacket; +import net.minecraft.network.packet.c2s.play.CloseHandledScreenC2SPacket; + +public class AutoTotem extends Module implements PlayerHealthListener, ReceivePacketListener { + + public FloatSetting healthTrigger; + public FloatSetting crystalRadiusTrigger; + public BooleanSetting mainHand; + + public AutoTotem() { + super(new KeybindSetting("key.autototem", "AutoTotem Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("AutoTotem"); + this.setCategory(Category.Combat); + this.setDescription("Automatically replaced totems."); + + healthTrigger = new FloatSetting("autototem_health", "Health", "The health at which the totem will be placed into your hand.", 6.0f, 1.0f, 20.0f, 1.0f); + crystalRadiusTrigger = new FloatSetting("autototem_crystal_radius", "Crystal Radius", "The radius at which a placed end crystal will trigger autototem.", 6.0f, 1.0f, 10.0f, 1.0f); + mainHand = new BooleanSetting("autototem_mainhand", "Mainhand", "Places totem in main hand instead of off-hand", false); + + this.addSetting(healthTrigger); + this.addSetting(crystalRadiusTrigger); + this.addSetting(mainHand); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(PlayerHealthListener.class, this); + Aoba.getInstance().eventManager.RemoveListener(ReceivePacketListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(PlayerHealthListener.class, this); + Aoba.getInstance().eventManager.AddListener(ReceivePacketListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnHealthChanged(PlayerHealthEvent readPacketEvent) { + MinecraftClient mc = MinecraftClient.getInstance(); + + // If current screen is a generic container, we want to prevent autototem from firing. + if (mc.currentScreen instanceof GenericContainerScreen) return; + + + // If the current hand stack is a totem, return; + PlayerInventory inventory = mc.player.getInventory(); + ItemStack handItemStack = inventory.getStack(inventory.selectedSlot); + + if(handItemStack.getItem() == Items.TOTEM_OF_UNDYING) + return; + + + // If the player health is below the Health Trigger, switch to the totem + if(readPacketEvent.getHealth() <= healthTrigger.getValue()) { + SwitchToTotem(); + } + } + + private void SwitchToTotem() { + MinecraftClient mc = MinecraftClient.getInstance(); + + PlayerInventory inventory = mc.player.getInventory(); + + // Search for a Totem of Undying in the player's inventory. + int slot = -1; + for(int i = 0; i <= 36; i++) + { + ItemStack itemStackToCheck = inventory.getStack(i); + Item itemToCheck = itemStackToCheck.getItem(); + + if(itemToCheck == Items.TOTEM_OF_UNDYING) { + slot = i; + break; + } + } + + // Switches the Totem of Undying to the player's main hand. + if(slot != -1) { + mc.getNetworkHandler().sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.STOP_SPRINTING)); + mc.interactionManager.pickFromInventory(slot); + mc.getNetworkHandler().sendPacket(new CloseHandledScreenC2SPacket(mc.player.currentScreenHandler.syncId)); + } + } + + @Override + public void OnReceivePacket(ReceivePacketEvent readPacketEvent) { + // Check to see if the packet is an entity spawn packet, and if the entity is an end crystal. + if (readPacketEvent.GetPacket() instanceof EntitySpawnS2CPacket spawnEntityPacket) { + if (spawnEntityPacket.getEntityType() == EntityType.END_CRYSTAL) { + // Check if the entity is within the range of the player, and switch immediately if so. + MinecraftClient mc = MinecraftClient.getInstance(); + + if(mc.player.getInventory().getStack(mc.player.getInventory().selectedSlot).getItem() == Items.TOTEM_OF_UNDYING) + return; + + if (mc.player.squaredDistanceTo(spawnEntityPacket.getX(), spawnEntityPacket.getY(), spawnEntityPacket.getZ()) < Math.pow(crystalRadiusTrigger.getValue(), 2)) { + SwitchToTotem(); + } + } + } + } +} diff --git a/remappedSrc/net/aoba/module/modules/combat/Criticals.java b/remappedSrc/net/aoba/module/modules/combat/Criticals.java new file mode 100644 index 00000000..84b37af1 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/combat/Criticals.java @@ -0,0 +1,102 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Criticals Module + */ +package net.aoba.module.modules.combat; + +import org.lwjgl.glfw.GLFW; +import io.netty.buffer.Unpooled; +import net.aoba.Aoba; +import net.aoba.event.events.SendPacketEvent; +import net.aoba.event.listeners.SendPacketListener; +import net.aoba.module.Module; +import net.aoba.settings.types.BooleanSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.network.ClientPlayNetworkHandler; +import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.client.util.InputUtil; +import net.minecraft.network.PacketByteBuf; +import net.minecraft.network.packet.Packet; +import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket; +import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; + +public class Criticals extends Module implements SendPacketListener { + + public enum InteractType { + INTERACT, ATTACK, INTERACT_AT + } + + private BooleanSetting legit; + + public Criticals() { + super(new KeybindSetting("key.criticals", "Criticals Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("Criticals"); + this.setCategory(Category.Combat); + this.setDescription("Makes all attacks into critical strikes."); + + legit = new BooleanSetting("criticals_legit", "Legit", "Whether or not we will use the 'legit' mode.", false); + + this.addSetting(legit); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(SendPacketListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(SendPacketListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnSendPacket(SendPacketEvent event) { + Packet packet = event.GetPacket(); + if(packet instanceof PlayerInteractEntityC2SPacket) { + PlayerInteractEntityC2SPacket playerInteractPacket = (PlayerInteractEntityC2SPacket) packet; + PacketByteBuf packetBuf = new PacketByteBuf(Unpooled.buffer()); + playerInteractPacket.write(packetBuf); + packetBuf.readVarInt(); + InteractType type = packetBuf.readEnumConstant(InteractType.class); + + if(type == InteractType.ATTACK) { + MinecraftClient mc = MinecraftClient.getInstance(); + ClientPlayerEntity player = mc.player; + if(player.isOnGround() && !player.isInLava() && !player.isSubmergedInWater()) { + if(legit.getValue()) { + player.jump(); + }else { + ClientPlayNetworkHandler networkHandler = mc.getNetworkHandler(); + networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY() + 0.03125D, mc.player.getZ(), false)); + networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY() + 0.0625D, mc.player.getZ(), false)); + networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY(), mc.player.getZ(), false)); + } + } + } + } + } +} diff --git a/remappedSrc/net/aoba/module/modules/combat/CrystalAura.java b/remappedSrc/net/aoba/module/modules/combat/CrystalAura.java new file mode 100644 index 00000000..d8687bf3 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/combat/CrystalAura.java @@ -0,0 +1,119 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Crystal Aura Module + */ +package net.aoba.module.modules.combat; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +import net.aoba.module.Module; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.client.util.InputUtil; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.decoration.EndCrystalEntity; +import net.minecraft.item.Item; +import net.minecraft.item.Items; +import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket; +import net.minecraft.util.Hand; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; + +public class CrystalAura extends Module implements TickListener { + + private FloatSetting radius; + + public CrystalAura() { + super(new KeybindSetting("key.crystalaura", "Crystal Aura Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("CrystalAura"); + this.setCategory(Category.Combat); + this.setDescription("Attacks anything within your personal space."); + + radius = new FloatSetting("crystalaura_radius", "Radius", "Radius, in blocks, that you can place/attack a crystal.", 5f, 1f, 15f, 1f); + this.addSetting(radius); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnUpdate(TickEvent event) { + for (PlayerEntity player : MC.world.getPlayers()) { + if (player == MC.player || MC.player.distanceTo(player) > this.radius.getValue()) { + continue; + } + // Get the block position below the player. + BlockPos entityPos = player.getBlockPos(); + BlockPos check = entityPos.add(0, -1, 0); + BlockState bs = MC.world.getBlockState(check); + Block block = bs.getBlock(); + if (block != Blocks.OBSIDIAN && block != Blocks.BEDROCK) + continue; + + for (int slot = 0; slot < 9; slot++) { + Item item = MC.player.getInventory().getStack(slot).getItem(); + if (item == Items.END_CRYSTAL) { + MC.player.getInventory().selectedSlot = slot; + break; + } + } + BlockHitResult rayTrace = new BlockHitResult(check.toCenterPos(), Direction.UP, check, false); + MC.interactionManager.interactBlock(MC.player, Hand.MAIN_HAND, rayTrace); + this.MC.player.networkHandler.sendPacket(new PlayerInteractItemC2SPacket(Hand.MAIN_HAND, 0)); + } + + // Hit the entity that has been found. + Entity entity = null; + for (Entity ent : MC.world.getEntities()) { + if (MC.player.distanceTo(ent) < radius.getValue()) { + if (ent instanceof EndCrystalEntity) { + entity = ent; + break; + } + } + } + + if(entity != null) { + MC.player.swingHand(Hand.MAIN_HAND); + MC.interactionManager.attackEntity(MC.player, entity); + MC.player.attack(entity); + } + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/module/modules/combat/KillAura.java b/remappedSrc/net/aoba/module/modules/combat/KillAura.java new file mode 100644 index 00000000..9961af29 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/combat/KillAura.java @@ -0,0 +1,151 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * KillAura Module + */ +package net.aoba.module.modules.combat; + +import java.util.ArrayList; +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +import net.aoba.module.Module; +import net.aoba.settings.types.BooleanSetting; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; +import net.minecraft.entity.Entity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.util.Hand; +import net.minecraft.util.math.Vec2f; + +public class KillAura extends Module implements TickListener { + private enum Priority { + LOWESTHP, CLOSEST + } + + private Priority priority = Priority.CLOSEST; + private FloatSetting radius; + private BooleanSetting targetAnimals; + private BooleanSetting targetMonsters; + private BooleanSetting targetPlayers; + private BooleanSetting legit; + + public KillAura() { + super(new KeybindSetting("key.killaura", "Kill Aura Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("KillAura"); + this.setCategory(Category.Combat); + this.setDescription("Attacks anything within your personal space."); + + radius = new FloatSetting("killaura_radius", "Radius", "Radius", 5f, 0.1f, 10f, 0.1f); + targetAnimals = new BooleanSetting("killaura_target_animals", "Target Animals", "Target animals.", false); + targetMonsters = new BooleanSetting("killaura_target_monsters", "Target Monsters", "Target monsters.", true); + targetPlayers = new BooleanSetting("killaura_target_players", "Target Players", "Target pplayers.", true); + legit = new BooleanSetting("killaura_legit", "Legit", "Whether or not the player will gradually look at the other player.", false); + this.addSetting(radius); + this.addSetting(targetAnimals); + this.addSetting(targetMonsters); + this.addSetting(targetPlayers); + this.addSetting(legit); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnUpdate(TickEvent event) { + if(MC.player.getAttackCooldownProgress(0) == 1) { + ArrayList hitList = new ArrayList(); + LivingEntity entityToAttack = null; + boolean found = false; + + // Add all potential entities to the 'hitlist' + //if(this.targetAnimals.getValue() || this.targetMonsters.getValue()) { + // double radiusSqr = this.radius.getValue() * this.radius.getValue(); + // for (Entity entity : MC.world.getEntities()) { + // if (MC.player.squaredDistanceTo(entity) > radiusSqr) continue; + // if((entity instanceof AnimalEntity && this.targetAnimals.getValue()) || (entity instanceof Monster && this.targetMonsters.getValue())) { + // hitList.add(entity); + // } + // } + //} + + // Add all potential players to the 'hitlist' + if(this.targetPlayers.getValue()) { + for (PlayerEntity player : MC.world.getPlayers()) { + if (player == MC.player || MC.player.squaredDistanceTo(player) > (this.radius.getValue()*this.radius.getValue())) { + continue; + } + hitList.add(player); + } + } + + // For each entity, get the entity that matches a criteria. + for (Entity entity : hitList) { + LivingEntity le = (LivingEntity) entity; + if (entityToAttack == null) { + entityToAttack = le; + } else { + if (this.priority == Priority.LOWESTHP) { + if (le.getHealth() <= entityToAttack.getHealth()) { + entityToAttack = le; + found = true; + } + } else if (this.priority == Priority.CLOSEST) { + if (MC.player.squaredDistanceTo(le) <= MC.player.squaredDistanceTo(entityToAttack)) { + entityToAttack = le; + found = true; + } + } + } + } + + + // If the entity is found, we want to attach it. + if (found) { + if(legit.getValue()) { + float camPitch = MC.cameraEntity.getPitch(); + float camYaw = MC.cameraEntity.getYaw(); + + Vec2f vec2 = new Vec2f((float)(MC.player.getX() - entityToAttack.getX()), (float)(MC.player.getZ() - entityToAttack.getZ())); + vec2 = vec2.normalize(); + + double angleFromPlayer = Math.atan2(vec2.y, vec2.x); + } + MC.interactionManager.attackEntity(MC.player, entityToAttack); + MC.player.swingHand(Hand.MAIN_HAND); + } + } + } +} diff --git a/remappedSrc/net/aoba/module/modules/combat/Nametags.java b/remappedSrc/net/aoba/module/modules/combat/Nametags.java new file mode 100644 index 00000000..5bb0198a --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/combat/Nametags.java @@ -0,0 +1,78 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Nametags Module + */ +package net.aoba.module.modules.combat; + +import org.lwjgl.glfw.GLFW; +import net.aoba.module.Module; +import net.aoba.settings.types.BooleanSetting; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; + +public class Nametags extends Module { + + private FloatSetting scale; + private BooleanSetting onlyPlayers; + private BooleanSetting alwaysVisible; + + public Nametags() { + super(new KeybindSetting("key.nametags", "NameTags Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("Nametags"); + this.setCategory(Category.Combat); + this.setDescription("Scales the nametags to be larger."); + + scale = new FloatSetting("nametags_scale", "Scale", "Scale of the NameTags", 0f, 0f, 5f, 0.25f); + onlyPlayers = new BooleanSetting("nametags_onlyPlayers", "Only Players", "Whether Nametags are only enlarged for players.", false); + alwaysVisible = new BooleanSetting("nametags_alwaysVisible", "Always Visible", "Whether Nametags will always be displayed.", false); + this.addSetting(scale); + this.addSetting(onlyPlayers); + this.addSetting(alwaysVisible); + } + + @Override + public void onDisable() { + + } + + @Override + public void onEnable() { + + } + + @Override + public void onToggle() { + + } + + public double getNametagScale() { + return this.scale.getValue(); + } + + public boolean getPlayersOnly() { + return this.onlyPlayers.getValue(); + } + + public boolean getAlwaysVisible() { + return this.alwaysVisible.getValue(); + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/module/modules/combat/NoOverlay.java b/remappedSrc/net/aoba/module/modules/combat/NoOverlay.java new file mode 100644 index 00000000..f9fc1680 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/combat/NoOverlay.java @@ -0,0 +1,53 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * NoOverlay Module + */ +package net.aoba.module.modules.combat; + +import org.lwjgl.glfw.GLFW; +import net.aoba.module.Module; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; + +public class NoOverlay extends Module { + + public NoOverlay() { + super(new KeybindSetting("key.nooverlay", "NoOverlay Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("NoOverlay"); + this.setCategory(Category.Combat); + this.setDescription("Disables all overlays and potion effects."); + } + + @Override + public void onDisable() { + + } + + @Override + public void onEnable() { + + } + + @Override + public void onToggle() { + + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/module/modules/combat/Reach.java b/remappedSrc/net/aoba/module/modules/combat/Reach.java new file mode 100644 index 00000000..478bfcdf --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/combat/Reach.java @@ -0,0 +1,67 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Reach Module + */ +package net.aoba.module.modules.combat; + +import org.lwjgl.glfw.GLFW; +import net.aoba.module.Module; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; + +public class Reach extends Module { + + private FloatSetting distance; + + public Reach() { + super(new KeybindSetting("key.reach", "Reach Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("Reach"); + this.setCategory(Category.Combat); + this.setDescription("Reaches further."); + + distance = new FloatSetting("reach_distance", "Distance", "Distance, in blocks, that you can reach.", 5f, 1f, 15f, 1f); + this.addSetting(distance); + } + + public float getReach() { + return distance.getValue().floatValue(); + } + + @Override + public void onDisable() { + + } + + @Override + public void onEnable() { + + } + + @Override + public void onToggle() { + + } + + public void setReachLength(float reach) { + this.distance.setValue(reach); + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/module/modules/combat/TriggerBot.java b/remappedSrc/net/aoba/module/modules/combat/TriggerBot.java new file mode 100644 index 00000000..2bf6a304 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/combat/TriggerBot.java @@ -0,0 +1,98 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.module.modules.combat; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +import net.aoba.module.Module; +import net.aoba.settings.types.BooleanSetting; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; +import net.minecraft.entity.Entity; +import net.minecraft.entity.mob.Monster; +import net.minecraft.entity.passive.AnimalEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.util.Hand; +import net.minecraft.util.hit.EntityHitResult; +import net.minecraft.util.hit.HitResult; + +public class TriggerBot extends Module implements TickListener { + private FloatSetting radius; + private BooleanSetting targetAnimals; + private BooleanSetting targetMonsters; + private BooleanSetting targetPlayers; + + public TriggerBot() { + super(new KeybindSetting("key.triggerbot", "TriggerBot Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("Triggerbot"); + this.setCategory(Category.Combat); + this.setDescription("Attacks anything you are looking at."); + + radius = new FloatSetting("triggerbot_radius", "Radius", 5f, 0.1f, 10f, 0.1f); + targetAnimals = new BooleanSetting("triggerbot_target_animals", "Target Animals", "Target animals.", false); + targetMonsters = new BooleanSetting("triggerbot_target_monsters", "Target Monsters", "Target monsters.", true); + targetPlayers = new BooleanSetting("triggerbot_target_players", "Target Players", "Target players.", true); + this.addSetting(radius); + this.addSetting(targetAnimals); + this.addSetting(targetMonsters); + this.addSetting(targetPlayers); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnUpdate(TickEvent event) { + if (MC.player.getAttackCooldownProgress(0) == 1) { + // Get the current target that the player is looking at. + HitResult ray = MC.crosshairTarget; + + // If the target is an Entity, attack it. + if (ray != null && ray.getType() == HitResult.Type.ENTITY) { + EntityHitResult entityResult = (EntityHitResult) ray; + Entity ent = entityResult.getEntity(); + if (ent instanceof AnimalEntity && !this.targetAnimals.getValue()) + return; + if (ent instanceof PlayerEntity && !this.targetPlayers.getValue()) + return; + if (ent instanceof Monster && !this.targetMonsters.getValue()) + return; + + MC.interactionManager.attackEntity(MC.player, entityResult.getEntity()); + MC.player.swingHand(Hand.MAIN_HAND); + } + } + } +} diff --git a/remappedSrc/net/aoba/module/modules/misc/AntiCactus.java b/remappedSrc/net/aoba/module/modules/misc/AntiCactus.java new file mode 100644 index 00000000..d8bd0c37 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/misc/AntiCactus.java @@ -0,0 +1,50 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * AntiCactus Module + */ +package net.aoba.module.modules.misc; + +import org.lwjgl.glfw.GLFW; +import net.aoba.module.Module; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; + +public class AntiCactus extends Module { + + public AntiCactus() { + super(new KeybindSetting("key.anticactus", "AntiCactus Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("AntiCactus"); + this.setCategory(Category.Misc); + this.setDescription("Prevents blocks from hurting you."); + } + + @Override + public void onDisable() { + } + + @Override + public void onEnable() { + } + + @Override + public void onToggle() { + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/module/modules/misc/AutoEat.java b/remappedSrc/net/aoba/module/modules/misc/AutoEat.java new file mode 100644 index 00000000..9829bb10 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/misc/AutoEat.java @@ -0,0 +1,101 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * autoEat Module + */ +package net.aoba.module.modules.misc; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.FoodLevelEvent; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.FoodLevelListener; +import net.aoba.event.listeners.TickListener; +import net.aoba.module.Module; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; +import net.minecraft.item.FoodComponent; +import net.minecraft.item.Item; + +public class AutoEat extends Module implements FoodLevelListener { + private FloatSetting hungerSetting; + + public AutoEat() { + super(new KeybindSetting("key.autoeat", "AntiCactus Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("AutoEat"); + this.setCategory(Category.Misc); + this.setDescription("Automatically eats the best food in your inventory."); + + hungerSetting = new FloatSetting("autoeat_hunger", "Hunger", "Determines when AutoEat will trigger.", 6, 1, 20, 1); + + this.addSetting(hungerSetting); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(FoodLevelListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(FoodLevelListener.class, this); + } + + @Override + public void onToggle() { + + } + + public void setHunger(int hunger) { + hungerSetting.setValue((float)hunger); + } + + @Override + public void OnFoodLevelChanged(FoodLevelEvent readPacketEvent) { + if(readPacketEvent.getFoodLevel() <= hungerSetting.getValue()) { + int foodSlot= -1; + FoodComponent bestFood = null; + for(int i = 0; i< 9; i++) { + Item item = MC.player.getInventory().getStack(i).getItem(); + + if(!item.isFood()) { + continue; + } + FoodComponent food = item.getFoodComponent(); + if(bestFood != null) { + if(food.getHunger() > bestFood.getHunger()) { + bestFood = food; + foodSlot = i; + } + }else { + bestFood = food; + foodSlot = i; + } + + } + + if(bestFood != null) { + MC.player.getInventory().selectedSlot = foodSlot; + MC.options.useKey.setPressed(true); + } + } + } +} diff --git a/remappedSrc/net/aoba/module/modules/misc/AutoFish.java b/remappedSrc/net/aoba/module/modules/misc/AutoFish.java new file mode 100644 index 00000000..83f7a8de --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/misc/AutoFish.java @@ -0,0 +1,80 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * AutoFish Module + */ +package net.aoba.module.modules.misc; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.ReceivePacketEvent; +import net.aoba.event.listeners.ReceivePacketListener; +import net.aoba.module.Module; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; +import net.minecraft.network.packet.Packet; +import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket; +import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket; +import net.minecraft.sound.SoundEvents; +import net.minecraft.util.Hand; + +public class AutoFish extends Module implements ReceivePacketListener { + public AutoFish() { + super(new KeybindSetting("key.autofish", "AutoFish Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("AutoFish"); + this.setCategory(Category.Misc); + this.setDescription("Automatically fishes for you."); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(ReceivePacketListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(ReceivePacketListener.class, this); + } + + @Override + public void onToggle() { + + } + + private void recastRod() { + + PlayerInteractItemC2SPacket packetTryUse = new PlayerInteractItemC2SPacket(Hand.MAIN_HAND, 0); + MC.player.networkHandler.sendPacket(packetTryUse); + MC.player.networkHandler.sendPacket(packetTryUse); + } + + @Override + public void OnReceivePacket(ReceivePacketEvent readPacketEvent) { + Packet packet = readPacketEvent.GetPacket(); + + if(packet instanceof PlaySoundS2CPacket ) { + PlaySoundS2CPacket soundPacket = (PlaySoundS2CPacket)packet; + if(soundPacket.getSound().value().equals(SoundEvents.ENTITY_FISHING_BOBBER_SPLASH)) { + recastRod(); + } + } + } + +} diff --git a/remappedSrc/net/aoba/module/modules/misc/AutoWalk.java b/remappedSrc/net/aoba/module/modules/misc/AutoWalk.java new file mode 100644 index 00000000..40caf852 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/misc/AutoWalk.java @@ -0,0 +1,61 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * AutoWalk Module + */ +package net.aoba.module.modules.misc; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +import net.aoba.module.Module; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; + +public class AutoWalk extends Module implements TickListener { + public AutoWalk() { + super(new KeybindSetting("key.autowalk", "AutoWalk Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("AutoWalk"); + this.setCategory(Category.Misc); + this.setDescription("Places blocks exceptionally fast"); + } + + @Override + public void onDisable() { + MC.options.forwardKey.setPressed(false); + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnUpdate(TickEvent event) { + MC.options.forwardKey.setPressed(true); + } +} diff --git a/remappedSrc/net/aoba/module/modules/misc/FastBreak.java b/remappedSrc/net/aoba/module/modules/misc/FastBreak.java new file mode 100644 index 00000000..ad031379 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/misc/FastBreak.java @@ -0,0 +1,68 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * FastBreak Module + */ +package net.aoba.module.modules.misc; + +import org.lwjgl.glfw.GLFW; +import net.aoba.module.Module; +import net.aoba.settings.types.BooleanSetting; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; + +public class FastBreak extends Module { + + public FloatSetting multiplier; + public BooleanSetting ignoreWater; + + public FastBreak() { + super(new KeybindSetting("key.fastbreak", "FastBreak Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("FastBreak"); + this.setCategory(Category.Misc); + this.setDescription("Breaks blocks quicker based on a multiplier."); + + multiplier = new FloatSetting("fastbreak_multiplier", "Multiplier", "Multiplier for how fast the blocks will break.", 1.25f, 1f, 10f, 0.05f); + ignoreWater = new BooleanSetting("fastbreak_ignore_water", "Ignore Water", "Ignores the slowdown that being in water causes.", false); + + this.addSetting(multiplier); + this.addSetting(ignoreWater); + } + + public void setMultiplier(float multiplier) { this.multiplier.setValue(multiplier); } + + public float getMultiplier() { + return this.multiplier.getValue().floatValue(); + } + + @Override + public void onDisable() { + } + + @Override + public void onEnable() { + } + + @Override + public void onToggle() { + + } +} diff --git a/remappedSrc/net/aoba/module/modules/misc/FastPlace.java b/remappedSrc/net/aoba/module/modules/misc/FastPlace.java new file mode 100644 index 00000000..6cba66fc --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/misc/FastPlace.java @@ -0,0 +1,64 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * FastPlace Module + */ +package net.aoba.module.modules.misc; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +import net.aoba.mixin.interfaces.IMinecraftClient; +import net.aoba.module.Module; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; + +public class FastPlace extends Module implements TickListener{ + IMinecraftClient iMC; + + public FastPlace() { + super(new KeybindSetting("key.fastplace", "FastPlace Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("FastPlace"); + this.setCategory(Category.Misc); + this.setDescription("Places blocks exceptionally fast"); + } + + @Override + public void onDisable() { + IMC.setItemUseCooldown(4); + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnUpdate(TickEvent event) { + IMC.setItemUseCooldown(0); + } +} diff --git a/remappedSrc/net/aoba/module/modules/misc/Timer.java b/remappedSrc/net/aoba/module/modules/misc/Timer.java new file mode 100644 index 00000000..13f80370 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/misc/Timer.java @@ -0,0 +1,63 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Timer Module + */ +package net.aoba.module.modules.misc; + +import org.lwjgl.glfw.GLFW; +import net.aoba.module.Module; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; + +public class Timer extends Module { + private FloatSetting multiplier; + + public Timer() { + super(new KeybindSetting("key.timer", "Timer Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("Timer"); + this.setCategory(Category.Misc); + this.setDescription("Increases the speed of Minecraft."); + + this.multiplier = new FloatSetting("timer_multiplier", "Multiplier", "The multiplier that will affect the game speed.", 1f, 0.1f, 15f, 0.1f); + this.addSetting(multiplier); + } + + public float getMultiplier() { + return this.multiplier.getValue().floatValue(); + } + + public void setMultipler(float multiplier) { + this.multiplier.setValue(multiplier); + } + + @Override + public void onDisable() { + } + + @Override + public void onEnable() { + } + + @Override + public void onToggle() { + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/module/modules/movement/Fly.java b/remappedSrc/net/aoba/module/modules/movement/Fly.java new file mode 100644 index 00000000..9e93e8f3 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/movement/Fly.java @@ -0,0 +1,103 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Fly Module + */ +package net.aoba.module.modules.movement; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +import net.aoba.module.Module; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.client.util.InputUtil; +import net.minecraft.entity.Entity; +import net.minecraft.util.math.Vec3d; + +public class Fly extends Module implements TickListener { + + private FloatSetting flySpeed; + + public Fly() { + super(new KeybindSetting("key.fly", "Fly Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_V, 0))); + + this.setName("Fly"); + this.setCategory(Category.Movement); + this.setDescription("Allows the player to fly."); + + flySpeed = new FloatSetting("fly_speed", "Speed", "Fly speed.", 2f, 0.1f, 15f, 0.5f); + this.addSetting(flySpeed); + } + + public void setSpeed(float speed) { + this.flySpeed.setValue(speed); + } + + public double getSpeed() { + return this.flySpeed.getValue(); + } + + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnUpdate(TickEvent event) { + ClientPlayerEntity player = MC.player; + float speed = this.flySpeed.getValue().floatValue(); + if(MC.player.isRiding()) { + Entity riding = MC.player.getRootVehicle(); + Vec3d velocity = riding.getVelocity(); + double motionY = MC.options.jumpKey.isPressed() ? 0.3 : 0; + riding.setVelocity(velocity.x, motionY, velocity.z); + }else { + if (MC.options.sprintKey.isPressed()) { + speed *= 1.5; + } + player.getAbilities().flying = false; + player.setVelocity(new Vec3d(0, 0, 0)); + + Vec3d vec = new Vec3d(0, 0, 0); + + + if (MC.options.jumpKey.isPressed()) { + vec = new Vec3d(0, speed, 0); + } + if (MC.options.sneakKey.isPressed()) { + vec = new Vec3d(0, -speed, 0); + } + player.setVelocity(vec); + } + } +} diff --git a/remappedSrc/net/aoba/module/modules/movement/Freecam.java b/remappedSrc/net/aoba/module/modules/movement/Freecam.java new file mode 100644 index 00000000..93a23af9 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/movement/Freecam.java @@ -0,0 +1,119 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Freecam Module + */ +package net.aoba.module.modules.movement; + +import java.util.UUID; +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +import net.aoba.misc.FakePlayerEntity; +import net.aoba.module.Module; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.client.util.InputUtil; +import net.minecraft.entity.Entity.RemovalReason; +import net.minecraft.util.math.Vec3d; + +public class Freecam extends Module implements TickListener { + private FakePlayerEntity fakePlayer; + private FloatSetting flySpeed; + + public Freecam() { + super(new KeybindSetting("key.freecam", "Freecam Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("Freecam"); + this.setCategory(Category.Movement); + this.setDescription("Allows the player to clip through blocks (Only work clientside)."); + flySpeed = new FloatSetting("freecam_speed", "Speed", "Speed of the Freecam.", 2f, 0.1f, 15f, 0.5f); + this.addSetting(flySpeed); + } + + public void setSpeed(float speed) { + this.flySpeed.setValue(speed); + } + + public double getSpeed() { + return this.flySpeed.getValue(); + } + + @Override + public void onDisable() { + if(MC.world == null || fakePlayer == null) return; + ClientPlayerEntity player = MC.player; + MC.player.noClip = false; + player.setVelocity(0, 0, 0); + player.copyFrom(fakePlayer); + fakePlayer.despawn(); + MC.world.removeEntity(-3, RemovalReason.DISCARDED); + + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + ClientPlayerEntity player = MC.player; + fakePlayer = new FakePlayerEntity(); + fakePlayer.copyFrom(player); + fakePlayer.setUuid(UUID.randomUUID()); + fakePlayer.headYaw = player.headYaw; + MC.world.addEntity(fakePlayer); + + Aoba.getInstance().moduleManager.fly.setState(false); + Aoba.getInstance().moduleManager.noclip.setState(false); + + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + + } + + public FakePlayerEntity getFakePlayer() { + return this.fakePlayer; + } + + @Override + public void OnUpdate(TickEvent event) { + ClientPlayerEntity player = MC.player; + player.noClip = true; + player.setOnGround(false); + float speed = this.flySpeed.getValue().floatValue(); + if (MC.options.sprintKey.isPressed()) { + speed *= 1.5; + } + + player.getAbilities().flying = false; + player.setVelocity(new Vec3d(0, 0, 0)); + Vec3d vec = new Vec3d(0,0,0); + if (MC.options.jumpKey.isPressed()) { + vec = new Vec3d(0,speed * 0.2f,0); + } + if (MC.options.sneakKey.isPressed()) { + vec = new Vec3d(0,-speed * 0.2f,0); + } + + player.setVelocity(vec); + } +} diff --git a/remappedSrc/net/aoba/module/modules/movement/Glide.java b/remappedSrc/net/aoba/module/modules/movement/Glide.java new file mode 100644 index 00000000..a81f7a27 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/movement/Glide.java @@ -0,0 +1,65 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Glide Module + */ +package net.aoba.module.modules.movement; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +import net.aoba.module.Module; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.client.util.InputUtil; + +public class Glide extends Module implements TickListener { + private float fallSpeed = .25f; + public Glide() { + super(new KeybindSetting("key.glide", "Glide Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("Glide"); + this.setCategory(Category.Movement); + this.setDescription("Allows the player to glide down."); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnUpdate(TickEvent event) { + ClientPlayerEntity player = MC.player; + if(player.getVelocity().y < 0 && (!player.isOnGround() || !player.isInLava() || !player.isSubmergedInWater() || !player.isHoldingOntoLadder())) { + player.setVelocity(player.getVelocity().x, Math.max(player.getVelocity().y, -this.fallSpeed), player.getVelocity().z); + } + } +} diff --git a/remappedSrc/net/aoba/module/modules/movement/Jesus.java b/remappedSrc/net/aoba/module/modules/movement/Jesus.java new file mode 100644 index 00000000..677efe1b --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/movement/Jesus.java @@ -0,0 +1,73 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Jesus Module + */ +package net.aoba.module.modules.movement; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +import net.aoba.module.Module; +import net.aoba.settings.types.BooleanSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; + +public class Jesus extends Module implements TickListener { + + public BooleanSetting legit; + + public Jesus() { + super(new KeybindSetting("key.jesus", "Jesus Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("Jesus"); + this.setCategory(Category.Movement); + this.setDescription("Allows the player to walk on water."); + + // Add Settings + legit = new BooleanSetting("jesus_legit", "Legit", "Whether or not the player will swim as close to the surface as possible.", true); + this.addSetting(legit); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnUpdate(TickEvent event) { + // If Legit is enabled, simply swim. + if (this.legit.getValue()) { + if (MC.player.isInLava() || MC.player.isTouchingWater()) { + MC.options.jumpKey.setPressed(true); + } + } + } +} diff --git a/remappedSrc/net/aoba/module/modules/movement/Jetpack.java b/remappedSrc/net/aoba/module/modules/movement/Jetpack.java new file mode 100644 index 00000000..783ef69b --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/movement/Jetpack.java @@ -0,0 +1,110 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Fly Module + */ +package net.aoba.module.modules.movement; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +import net.aoba.module.Module; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.client.util.InputUtil; +import net.minecraft.entity.Entity; +import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket.OnGroundOnly; +import net.minecraft.particle.ParticleTypes; +import net.minecraft.util.math.Vec3d; + +public class Jetpack extends Module implements TickListener { + + private FloatSetting jetpackSpeed; + + public Jetpack() { + super(new KeybindSetting("key.jetpack", "Jetpack Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("Jetpack"); + this.setCategory(Category.Movement); + this.setDescription("Like fly, but a lot more fun!"); + + jetpackSpeed = new FloatSetting("" + + "jetpack_speed", "Speed", "Jetpack Speed", 0.5f, 0.1f, 5.0f, 0.1f); + this.addSetting(jetpackSpeed); + } + + public void setSpeed(float speed) { + this.jetpackSpeed.setValue(speed); + } + + public double getSpeed() { + return this.jetpackSpeed.getValue(); + } + + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnUpdate(TickEvent event) { + ClientPlayerEntity player = MC.player; + float speed = this.jetpackSpeed.getValue().floatValue(); + + if(MC.player.fallDistance > 2f) { + MC.player.networkHandler.sendPacket(new OnGroundOnly(true)); + } + + if(MC.player.isRiding()) { + Entity riding = MC.player.getRootVehicle(); + Vec3d velocity = riding.getVelocity(); + double motionY = MC.options.jumpKey.isPressed() ? 0.3 : 0; + riding.setVelocity(velocity.x, motionY, velocity.z); + }else { + player.getAbilities().flying = false; + + Vec3d playerSpeed = player.getVelocity(); + if (MC.options.jumpKey.isPressed()) { + double angle = -player.bodyYaw; + float leftThrusterX = (float) Math.sin(Math.toRadians(angle + 90)) * 0.25f; + float leftThrusterZ = (float) Math.cos(Math.toRadians(angle + 90)) * 0.25f; + float rightThrusterX = (float) Math.sin(Math.toRadians(angle + 270)) * 0.25f; + float rightThrusterZ = (float) Math.cos(Math.toRadians(angle + 270)) * 0.25f; + + MC.world.addParticle(ParticleTypes.FLAME, player.getX() + leftThrusterX, player.getY() + 0.5f, player.getZ() + leftThrusterZ, leftThrusterX, -0.5f, leftThrusterZ); + MC.world.addParticle(ParticleTypes.FLAME, player.getX() + rightThrusterX, player.getY() + 0.5f, player.getZ() + rightThrusterZ, rightThrusterX, -0.5f, rightThrusterZ); + playerSpeed = playerSpeed.add(0, speed / 20.0f, 0); + } + player.setVelocity(playerSpeed); + } + } +} diff --git a/remappedSrc/net/aoba/module/modules/movement/NoFall.java b/remappedSrc/net/aoba/module/modules/movement/NoFall.java new file mode 100644 index 00000000..589acfae --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/movement/NoFall.java @@ -0,0 +1,64 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * NoFall Module + */ +package net.aoba.module.modules.movement; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +import net.aoba.module.Module; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; +import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket.OnGroundOnly; + +public class NoFall extends Module implements TickListener { + + public NoFall() { + super(new KeybindSetting("key.nofall", "NoFall Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("No-Fall"); + this.setCategory(Category.Movement); + this.setDescription("Prevents fall damage."); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnUpdate(TickEvent event) { + if(MC.player.fallDistance > 2f) { + MC.player.networkHandler.sendPacket(new OnGroundOnly(true)); + } + } +} diff --git a/remappedSrc/net/aoba/module/modules/movement/NoJumpDelay.java b/remappedSrc/net/aoba/module/modules/movement/NoJumpDelay.java new file mode 100644 index 00000000..2c575543 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/movement/NoJumpDelay.java @@ -0,0 +1,68 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.module.modules.movement; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +import net.aoba.mixin.interfaces.ILivingEntity; +import net.aoba.module.Module; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; + +public class NoJumpDelay extends Module implements TickListener { + + private FloatSetting delay; + + public NoJumpDelay() { + super(new KeybindSetting("key.nojumpdelay", "NoJumpDelay Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("NoJumpDelay"); + this.setCategory(Category.Movement); + this.setDescription("Makes it so the user can jump very quickly."); + + delay = new FloatSetting("nojumpdelay_delay", "Delay", "NoJumpDelay Delay", 1f, 0.0f, 20.0f, 1f); + this.addSetting(delay); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnUpdate(TickEvent event) { + ILivingEntity ent = (ILivingEntity)MC.player; + if(ent.getJumpCooldown() > delay.getValue()) { + ent.setJumpCooldown(delay.getValue().intValue()); + } + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/module/modules/movement/NoSlowdown.java b/remappedSrc/net/aoba/module/modules/movement/NoSlowdown.java new file mode 100644 index 00000000..9716d5ef --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/movement/NoSlowdown.java @@ -0,0 +1,61 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * NoSlowdown Module + */ +package net.aoba.module.modules.movement; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +import net.aoba.module.Module; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; + +public class NoSlowdown extends Module implements TickListener { + + public NoSlowdown() { + super(new KeybindSetting("key.noslowdown", "NoSlowdown Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("NoSlowdown"); + this.setCategory(Category.Movement); + this.setDescription("Prevents the player from being slowed down by blocks."); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnUpdate(TickEvent event) { + //mc.player.setMotionMultiplier(null, Vec3d.ZERO); + } +} diff --git a/remappedSrc/net/aoba/module/modules/movement/Noclip.java b/remappedSrc/net/aoba/module/modules/movement/Noclip.java new file mode 100644 index 00000000..3b240442 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/movement/Noclip.java @@ -0,0 +1,88 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Noclip Module + */ +package net.aoba.module.modules.movement; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +import net.aoba.module.Module; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.client.util.InputUtil; +import net.minecraft.util.math.Vec3d; + +public class Noclip extends Module implements TickListener { + private float flySpeed = 5; + + public Noclip() { + super(new KeybindSetting("key.noclip", "Noclip Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("Noclip"); + this.setCategory(Category.Movement); + this.setDescription("Allows the player to clip through blocks (Only work clientside)."); + } + + public void setSpeed(float speed) { + this.flySpeed = speed; + } + + @Override + public void onDisable() { + if(MC.player != null) { + MC.player.noClip = false; + } + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnUpdate(TickEvent event) { + ClientPlayerEntity player = MC.player; + player.noClip = true; + if (MC.options.sprintKey.isPressed()) { + this.flySpeed *= 1.5; + } + player.setVelocity(new Vec3d(0,0,0)); + + Vec3d vec = new Vec3d(0,0,0); + if (MC.options.jumpKey.isPressed()) { + vec = new Vec3d(0,flySpeed * 0.2f,0); + } + if (MC.options.sneakKey.isPressed()) { + vec = new Vec3d(0,-flySpeed * 0.2f,0); + } + if (MC.options.sprintKey.isPressed()) { + this.flySpeed /= 1.5; + } + player.setVelocity(vec); + } +} diff --git a/remappedSrc/net/aoba/module/modules/movement/Safewalk.java b/remappedSrc/net/aoba/module/modules/movement/Safewalk.java new file mode 100644 index 00000000..6a63b8c9 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/movement/Safewalk.java @@ -0,0 +1,103 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Safewalk Module + */ +package net.aoba.module.modules.movement; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +import net.aoba.module.Module; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; +import net.minecraft.util.math.Vec3d; + +public class Safewalk extends Module implements TickListener { + + public Safewalk() { + super(new KeybindSetting("key.safewalk", "Safewalk Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("Safewalk"); + this.setCategory(Category.Movement); + this.setDescription("Permanently keeps player in sneaking mode."); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnUpdate(TickEvent event) { + double x = MC.player.getVelocity().x; + double y = MC.player.getVelocity().y; + double z = MC.player.getVelocity().z; + if (MC.player.isOnGround()) { + double increment; + for (increment = 0.05D; x != 0.0D;) { + if (x < increment && x >= -increment) { + x = 0.0D; + } else if (x > 0.0D) { + x -= increment; + } else { + x += increment; + } + } + for (; z != 0.0D;) { + if (z < increment && z >= -increment) { + z = 0.0D; + } else if (z > 0.0D) { + z -= increment; + } else { + z += increment; + } + } + for (; x != 0.0D && z != 0.0D;) { + if (x < increment && x >= -increment) { + x = 0.0D; + } else if (x > 0.0D) { + x -= increment; + } else { + x += increment; + } + if (z < increment && z >= -increment) { + z = 0.0D; + } else if (z > 0.0D) { + z -= increment; + } else { + z += increment; + } + } + } + MC.player.setVelocity(new Vec3d(x,y,z)); + } +} + diff --git a/remappedSrc/net/aoba/module/modules/movement/Sneak.java b/remappedSrc/net/aoba/module/modules/movement/Sneak.java new file mode 100644 index 00000000..9fd0fc20 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/movement/Sneak.java @@ -0,0 +1,71 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Sneak Module + */ +package net.aoba.module.modules.movement; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +import net.aoba.module.Module; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.client.util.InputUtil; +import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket; +import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket.Mode; + +public class Sneak extends Module implements TickListener { + + public Sneak() { + super(new KeybindSetting("key.sneakhack", "Sneak Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("Sneak"); + this.setCategory(Category.Movement); + this.setDescription("Makes the player appear like they're sneaking."); + } + + @Override + public void onDisable() { + ClientPlayerEntity player = MC.player; + if(player != null && player.networkHandler != null) { + player.networkHandler.sendPacket(new ClientCommandC2SPacket(player, Mode.RELEASE_SHIFT_KEY)); + } + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnUpdate(TickEvent event) { + ClientPlayerEntity player = MC.player; + MC.player.networkHandler.sendPacket(new ClientCommandC2SPacket(player, Mode.PRESS_SHIFT_KEY)); + MC.player.networkHandler.sendPacket(new ClientCommandC2SPacket(player, Mode.RELEASE_SHIFT_KEY)); + } +} + diff --git a/remappedSrc/net/aoba/module/modules/movement/Spider.java b/remappedSrc/net/aoba/module/modules/movement/Spider.java new file mode 100644 index 00000000..385a78c6 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/movement/Spider.java @@ -0,0 +1,68 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Spider Module + */ +package net.aoba.module.modules.movement; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +import net.aoba.module.Module; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.client.util.InputUtil; +import net.minecraft.util.math.Vec3d; + +public class Spider extends Module implements TickListener { + + public Spider() { + super(new KeybindSetting("key.spider", "Spider Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("Spider"); + this.setCategory(Category.Movement); + this.setDescription("Allows players to climb up blocks."); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnUpdate(TickEvent event) { + ClientPlayerEntity player = MC.player; + if(player.horizontalCollision) { + player.getVelocity().multiply(new Vec3d(1,0,1)); + player.getVelocity().add(new Vec3d(0,0.2,0)); + player.setOnGround(true); + } + } +} diff --git a/remappedSrc/net/aoba/module/modules/movement/Sprint.java b/remappedSrc/net/aoba/module/modules/movement/Sprint.java new file mode 100644 index 00000000..27dfc126 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/movement/Sprint.java @@ -0,0 +1,61 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Sprint Module + */ +package net.aoba.module.modules.movement; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +import net.aoba.module.Module; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; + +public class Sprint extends Module implements TickListener { + + public Sprint() { + super(new KeybindSetting("key.sprinthack", "Sprint Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("Sprint"); + this.setCategory(Category.Movement); + this.setDescription("Permanently keeps player in sprinting mode."); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnUpdate(TickEvent event) { + MC.player.setSprinting(true); + } +} diff --git a/remappedSrc/net/aoba/module/modules/movement/Step.java b/remappedSrc/net/aoba/module/modules/movement/Step.java new file mode 100644 index 00000000..e94d3787 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/movement/Step.java @@ -0,0 +1,66 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Step Module + */ +package net.aoba.module.modules.movement; + +import org.lwjgl.glfw.GLFW; +import net.aoba.module.Module; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; + +public class Step extends Module { + + private FloatSetting stepHeight; + + public Step() { + super(new KeybindSetting("key.step", "Step Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("Step"); + this.setCategory(Category.Movement); + this.setDescription("Steps up blocks."); + + stepHeight = new FloatSetting("step_height", "Height", "Height that the player will step up.", 1f, 0.0f, 2f, 0.5f); + + this.addSetting(stepHeight); + } + + @Override + public void onDisable() { + if(MC.world != null) { + MC.player.setStepHeight(.5f); + } + } + + @Override + public void onEnable() { + MC.player.setStepHeight(stepHeight.getValue().floatValue()); + } + + @Override + public void onToggle() { + + } + + public void setStepHeight(float height) { + this.stepHeight.setValue(height); + } +} diff --git a/remappedSrc/net/aoba/module/modules/render/Breadcrumbs.java b/remappedSrc/net/aoba/module/modules/render/Breadcrumbs.java new file mode 100644 index 00000000..cdb0cb4d --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/render/Breadcrumbs.java @@ -0,0 +1,106 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Breadcrumbs Module + */ +package net.aoba.module.modules.render; + +import java.util.ArrayList; +import java.util.List; +import net.aoba.Aoba; +import net.aoba.event.events.RenderEvent; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.RenderListener; +import net.aoba.event.listeners.TickListener; +import net.aoba.gui.colors.Color; +import net.aoba.gui.colors.RainbowColor; + +import org.lwjgl.glfw.GLFW; +import net.aoba.module.Module; +import net.aoba.settings.types.BooleanSetting; +import net.aoba.settings.types.ColorSetting; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; +import net.minecraft.util.math.Vec3d; +import net.aoba.misc.RenderUtils; + +public class Breadcrumbs extends Module implements RenderListener, TickListener { + private Color currentColor; + + private ColorSetting color = new ColorSetting("breadcrumbs_color", "Color", "Color", new Color(0, 1f, 1f)); + + private RainbowColor rainbowColor; + + public BooleanSetting rainbow = new BooleanSetting("breadcrumbs_rainbow", "Rainbow", "Rainbow", false); + public FloatSetting effectSpeed = new FloatSetting("breadcrumbs_effectspeed", "Effect Spd.", "Effect Spd", 4f, 1f, 20f, 0.1f); + + private float timer = 10; + private float currentTick = 0; + private List positions = new ArrayList(); + + public Breadcrumbs() { + super(new KeybindSetting("key.breadcrumbs", "Breadcrumbs Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("Breadcrumbs"); + this.setCategory(Category.Render); + this.setDescription("Shows breadcrumbs of where you last stepped;"); + currentColor = color.getValue(); + rainbowColor = new RainbowColor(); + + this.addSetting(color); + this.addSetting(rainbow); + this.addSetting(effectSpeed); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(RenderListener.class, this); + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(RenderListener.class, this); + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnRender(RenderEvent event) { + for(int i = 0; i < this.positions.size() - 1; i++) { + RenderUtils.drawLine3D(event.GetMatrixStack(), this.positions.get(i), this.positions.get(i + 1), this.currentColor); + } + } + + @Override + public void OnUpdate(TickEvent event) { + currentTick++; + if(timer == currentTick) { + currentTick = 0; + if(!Aoba.getInstance().moduleManager.freecam.getState()) { + positions.add(MC.player.getPos()); + } + } + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/module/modules/render/ChestESP.java b/remappedSrc/net/aoba/module/modules/render/ChestESP.java new file mode 100644 index 00000000..cb5abbd0 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/render/ChestESP.java @@ -0,0 +1,91 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * ChestESP Module + */ +package net.aoba.module.modules.render; + +import java.util.ArrayList; +import java.util.stream.Collectors; +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.RenderEvent; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.RenderListener; +import net.aoba.event.listeners.TickListener; +import net.aoba.gui.colors.Color; +import net.aoba.gui.colors.RainbowColor; +import net.aoba.misc.ModuleUtils; +import net.aoba.misc.RenderUtils; +import net.aoba.module.Module; +import net.aoba.settings.types.BooleanSetting; +import net.aoba.settings.types.ColorSetting; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.block.entity.ChestBlockEntity; +import net.minecraft.block.entity.TrappedChestBlockEntity; +import net.minecraft.client.util.InputUtil; +import net.minecraft.util.math.Box; + +public class ChestESP extends Module implements RenderListener { + private ColorSetting color = new ColorSetting("chestesp_color", "Color", "Color", new Color(0, 1f, 1f)); + + public BooleanSetting rainbow = new BooleanSetting("chestesp_rainbow", "Rainbow", "Rainbow", false); + public FloatSetting effectSpeed = new FloatSetting("chestesp_effectspeed", "Effect Speed", "Effect Speed", 4f, 1f, 20f, 0.1f); + + + public ChestESP() { + super(new KeybindSetting("key.chestesp", "ChestESP Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("ChestESP"); + this.setCategory(Category.Render); + this.setDescription("Allows the player to see Chests with an ESP."); + + this.addSetting(color); + this.addSetting(rainbow); + this.addSetting(effectSpeed); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(RenderListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(RenderListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnRender(RenderEvent event) { + ArrayList blockEntities = ModuleUtils.getTileEntities().collect(Collectors.toCollection(ArrayList::new)); + for(BlockEntity blockEntity : blockEntities) { + if(blockEntity instanceof ChestBlockEntity || blockEntity instanceof TrappedChestBlockEntity) { + Box box = new Box(blockEntity.getPos()); + RenderUtils.draw3DBox(event.GetMatrixStack(), box, color.getValue()); + } + } + } +} diff --git a/remappedSrc/net/aoba/module/modules/render/EntityESP.java b/remappedSrc/net/aoba/module/modules/render/EntityESP.java new file mode 100644 index 00000000..5642bd73 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/render/EntityESP.java @@ -0,0 +1,120 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * EntityESP Module + */ +package net.aoba.module.modules.render; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.RenderEvent; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.RenderListener; +import net.aoba.event.listeners.TickListener; +import net.aoba.gui.colors.Color; +import net.aoba.misc.RenderUtils; +import net.aoba.module.Module; +import net.aoba.settings.types.BooleanSetting; +import net.aoba.settings.types.ColorSetting; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.mob.Monster; +import net.minecraft.entity.passive.AnimalEntity; +import net.minecraft.util.math.Box; +import net.minecraft.util.math.Vec3d; + +public class EntityESP extends Module implements RenderListener, TickListener { + private ColorSetting color_passive = new ColorSetting("entityesp_color_passive", "Passive Color", "Passive Color", new Color(0, 1f, 1f)); + private ColorSetting color_enemies = new ColorSetting("entityesp_color_enemy", "Enemy Color", "Enemy Color", new Color(0, 1f, 1f)); + private ColorSetting color_misc = new ColorSetting("entityesp_color_misc", "Misc. Color", "Misc. Color", new Color(0, 1f, 1f)); + + public BooleanSetting rainbow = new BooleanSetting("entityesp_rainbow", "Rainbow","Rainbow", false); + public FloatSetting effectSpeed = new FloatSetting("entityesp_effectspeed", "Effect Speed", "Effect Speed", 4f, 1f, 20f, 0.1f); + + public EntityESP() { + super(new KeybindSetting("key.entityesp", "EntityESP Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("EntityESP"); + this.setCategory(Category.Render); + this.setDescription("Allows the player to see entities with an ESP."); + + this.addSetting(color_passive); + this.addSetting(color_enemies); + this.addSetting(color_misc); + + this.addSetting(rainbow); + this.addSetting(effectSpeed); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(RenderListener.class, this); + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(RenderListener.class, this); + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnRender(RenderEvent event) { + MatrixStack matrixStack = event.GetMatrixStack(); + float partialTicks = event.GetPartialTicks(); + + matrixStack.push(); + + for (Entity entity : MC.world.getEntities()) { + if (entity instanceof LivingEntity && !(entity instanceof PlayerEntity)) { + Box boundingBox = entity.getBoundingBox(); + Vec3d offset = RenderUtils.getEntityPositionOffsetInterpolated(entity, partialTicks); + boundingBox = boundingBox.offset(offset); + if (entity instanceof AnimalEntity) { + RenderUtils.draw3DBox(matrixStack, boundingBox, color_passive.getValue()); + } else if (entity instanceof Monster) { + RenderUtils.draw3DBox(matrixStack, boundingBox, color_enemies.getValue()); + } else { + RenderUtils.draw3DBox(matrixStack, boundingBox, color_misc.getValue()); + } + } + } + matrixStack.pop(); + } + + @Override + public void OnUpdate(TickEvent event) { + /* + * if(this.rainbow.getValue()) { + * this.rainbowColor.update(this.effectSpeed.getValue().floatValue()); }else { + * + * this.color.setHSV(hue.getValue().floatValue(), 1f, 1f); } + */ + } +} diff --git a/remappedSrc/net/aoba/module/modules/render/Fullbright.java b/remappedSrc/net/aoba/module/modules/render/Fullbright.java new file mode 100644 index 00000000..41b4c693 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/render/Fullbright.java @@ -0,0 +1,63 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Fullbright Module + */ +package net.aoba.module.modules.render; + +import org.lwjgl.glfw.GLFW; + +import net.aoba.interfaces.ISimpleOption; +import net.aoba.module.Module; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; + +public class Fullbright extends Module { + + private double previousValue = 0.0; + public Fullbright() { + super(new KeybindSetting("key.fullbright", "Fullbright Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("Fullbright"); + this.setCategory(Category.Render); + this.setDescription("Maxes out the brightness."); + } + + @Override + public void onDisable() { + @SuppressWarnings("unchecked") + ISimpleOption gamma = + (ISimpleOption)(Object)MC.options.getGamma(); + gamma.forceSetValue(previousValue); + } + + @Override + public void onEnable() { + this.previousValue = MC.options.getGamma().getValue(); + @SuppressWarnings("unchecked") + ISimpleOption gamma = + (ISimpleOption)(Object)MC.options.getGamma(); + gamma.forceSetValue(10000.0); + } + + @Override + public void onToggle() { + + } +} diff --git a/remappedSrc/net/aoba/module/modules/render/ItemESP.java b/remappedSrc/net/aoba/module/modules/render/ItemESP.java new file mode 100644 index 00000000..dbfe32ff --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/render/ItemESP.java @@ -0,0 +1,76 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * ItemESP Module + */ +package net.aoba.module.modules.render; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.RenderEvent; +import net.aoba.event.listeners.RenderListener; +import net.aoba.gui.colors.Color; +import net.aoba.misc.RenderUtils; +import net.aoba.module.Module; +import net.aoba.settings.types.ColorSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; +import net.minecraft.entity.Entity; +import net.minecraft.entity.ItemEntity; + +public class ItemESP extends Module implements RenderListener { + + private ColorSetting color = new ColorSetting("itemesp_color", "Color", "Color", new Color(0, 1f, 1f)); + + + public ItemESP() { + super(new KeybindSetting("key.itemesp", "ItemESP Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("ItemESP"); + this.setCategory(Category.Render); + this.setDescription("Allows the player to see items with an ESP."); + + this.addSetting(color); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(RenderListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(RenderListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnRender(RenderEvent event) { + for (Entity entity : MC.world.getEntities()) { + if(entity instanceof ItemEntity) { + RenderUtils.draw3DBox(event.GetMatrixStack(), entity.getBoundingBox(), color.getValue()); + } + } + } + +} diff --git a/remappedSrc/net/aoba/module/modules/render/POV.java b/remappedSrc/net/aoba/module/modules/render/POV.java new file mode 100644 index 00000000..a2918df9 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/render/POV.java @@ -0,0 +1,121 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * POV Module + */ +package net.aoba.module.modules.render; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +import net.aoba.misc.FakePlayerEntity; +import net.aoba.module.Module; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.client.util.InputUtil; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.PlayerEntity; + +public class POV extends Module implements TickListener { + private FakePlayerEntity fakePlayer; + private String povString = null; + private Entity povEntity = null; + + private boolean fakePlayerSpawned = false; + + + public POV() { + super(new KeybindSetting("key.pov", "POV Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("POV"); + this.setCategory(Category.Render); + this.setDescription("Allows the player to see someone else's point-of-view."); + } + + @Override + public void onDisable() { + MinecraftClient.getInstance().setCameraEntity(MC.player); + if(fakePlayer != null) { + fakePlayer.despawn(); + MC.world.removeEntity(-3, null); + } + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + + @Override + public void onToggle() { + + } + + public void setEntityPOV(String entity) { + this.povString = entity; + } + + public Entity getEntity() { + return this.povEntity; + } + + public PlayerEntity getEntityAsPlayer() { + if(this.povEntity instanceof PlayerEntity) { + return (PlayerEntity) this.povEntity; + }else { + return null; + } + } + + @Override + public void OnUpdate(TickEvent event) { + ClientPlayerEntity player = MC.player; + povEntity = null; + for(Entity entity : MC.world.getPlayers()) { + if(entity.getName().getString().equals(povString)) { + povEntity = entity; + } + } + if(MinecraftClient.getInstance().getCameraEntity() == povEntity) { + if(!fakePlayerSpawned) { + fakePlayer = new FakePlayerEntity(); + fakePlayer.copyFrom(player); + fakePlayer.headYaw = player.headYaw; + MC.world.addEntity(fakePlayer); + } + fakePlayer.copyFrom(player); + fakePlayer.headYaw = player.headYaw; + }else { + if(fakePlayer != null) { + fakePlayer.despawn(); + MC.world.removeEntity(-3, null); + } + + if(povEntity == null) { + MinecraftClient.getInstance().setCameraEntity(MC.player); + }else { + MinecraftClient.getInstance().setCameraEntity(povEntity); + } + } + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/module/modules/render/PlayerESP.java b/remappedSrc/net/aoba/module/modules/render/PlayerESP.java new file mode 100644 index 00000000..0a5287be --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/render/PlayerESP.java @@ -0,0 +1,77 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * PlayerESP Module + */ +package net.aoba.module.modules.render; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.RenderEvent; +import net.aoba.event.listeners.RenderListener; +import net.aoba.gui.colors.Color; +import net.aoba.misc.RenderUtils; +import net.aoba.module.Module; +import net.aoba.settings.types.ColorSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.network.AbstractClientPlayerEntity; +import net.minecraft.client.util.InputUtil; + +public class PlayerESP extends Module implements RenderListener { + + private ColorSetting color_default = new ColorSetting("playeresp_color_default", "Default Color", "Default Color", new Color(1f, 1f, 0f)); + private ColorSetting color_friendly = new ColorSetting("playeresp_color_friendly", "Friendly Color", "Friendly Color", new Color(0f, 1f, 0f)); + private ColorSetting color_enemy = new ColorSetting("playeresp_color_enemy", "Enemy Color", "Enemy Color", new Color(1f, 0f, 0f)); + + public PlayerESP() { + super(new KeybindSetting("key.playeresp", "PlayerESP Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("PlayerESP"); + this.setCategory(Category.Render); + this.setDescription("Allows the player to see other players with an ESP."); + + this.addSetting(color_default); + this.addSetting(color_friendly); + this.addSetting(color_enemy); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(RenderListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(RenderListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnRender(RenderEvent event) { + for (AbstractClientPlayerEntity entity : MC.world.getPlayers()) { + if(entity != MC.player) { + RenderUtils.draw3DBox(event.GetMatrixStack(), entity.getBoundingBox(), color_default.getValue()); + } + } + } +} diff --git a/remappedSrc/net/aoba/module/modules/render/SpawnerESP.java b/remappedSrc/net/aoba/module/modules/render/SpawnerESP.java new file mode 100644 index 00000000..2b877c1c --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/render/SpawnerESP.java @@ -0,0 +1,81 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * SpawnerESP Module + */ +package net.aoba.module.modules.render; + +import java.util.ArrayList; +import java.util.stream.Collectors; +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.RenderEvent; +import net.aoba.event.listeners.RenderListener; +import net.aoba.gui.colors.Color; +import net.aoba.misc.ModuleUtils; +import net.aoba.misc.RenderUtils; +import net.aoba.module.Module; +import net.aoba.settings.types.ColorSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.block.entity.MobSpawnerBlockEntity; +import net.minecraft.client.util.InputUtil; +import net.minecraft.util.math.Box; + +public class SpawnerESP extends Module implements RenderListener { + + private ColorSetting color = new ColorSetting("spawneresp_color", "Color", "Color", new Color(0, 1f, 1f)); + + public SpawnerESP() { + super(new KeybindSetting("key.spawneresp", "SpawnerESP Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("SpawnerESP"); + this.setCategory(Category.Render); + this.setDescription("Allows the player to see spawners with an ESP."); + + this.addSetting(color); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(RenderListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(RenderListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnRender(RenderEvent event) { + ArrayList blockEntities = ModuleUtils.getTileEntities().collect(Collectors.toCollection(ArrayList::new)); + + for(BlockEntity blockEntity : blockEntities) { + if(blockEntity instanceof MobSpawnerBlockEntity) { + Box box = new Box(blockEntity.getPos()); + RenderUtils.draw3DBox(event.GetMatrixStack(), box, color.getValue()); + } + } + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/module/modules/render/Tracer.java b/remappedSrc/net/aoba/module/modules/render/Tracer.java new file mode 100644 index 00000000..acf8733e --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/render/Tracer.java @@ -0,0 +1,104 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Tracer Module + */ +package net.aoba.module.modules.render; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.RenderEvent; +import net.aoba.event.listeners.RenderListener; +import net.aoba.gui.colors.Color; +import net.aoba.misc.RenderUtils; +import net.aoba.module.Module; +import net.aoba.settings.types.ColorSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.network.AbstractClientPlayerEntity; +import net.minecraft.client.render.Camera; +import net.minecraft.client.util.InputUtil; +import net.minecraft.entity.Entity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.mob.Monster; +import net.minecraft.entity.passive.AnimalEntity; +import net.minecraft.util.math.Vec3d; + +public class Tracer extends Module implements RenderListener { + private ColorSetting color_player = new ColorSetting("tracer_color_player", "Player Color", "Player Color", new Color(1f, 1f, 0f)); + private ColorSetting color_passive = new ColorSetting("tracer_color_passive", "Passive Color", "Passive Color", new Color(0, 1f, 1f)); + private ColorSetting color_enemies = new ColorSetting("tracer_color_enemy", "Enemy Color", "Enemy Color", new Color(0, 1f, 1f)); + private ColorSetting color_misc = new ColorSetting("tracer_color_misc", "Misc. Color", "Misc. Color", new Color(0, 1f, 1f)); + + public Tracer() { + super(new KeybindSetting("key.tracer", "Tracer Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("Tracer"); + this.setCategory(Category.Render); + this.setDescription("Points toward other players and entities with a line."); + + this.addSetting(color_player); + this.addSetting(color_passive); + this.addSetting(color_enemies); + this.addSetting(color_misc); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(RenderListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(RenderListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnRender(RenderEvent event) { + Vec3d eyePosition = new Vec3d(0, 0, 1); + Camera camera = MC.gameRenderer.getCamera(); + Vec3d offset = RenderUtils.getEntityPositionOffsetInterpolated(MC.cameraEntity, event.GetPartialTicks()); + eyePosition = eyePosition.rotateX((float) -Math.toRadians(camera.getPitch())); + eyePosition = eyePosition.rotateY((float) -Math.toRadians(camera.getYaw())); + eyePosition = eyePosition.add(MC.cameraEntity.getEyePos()); + eyePosition = eyePosition.subtract(offset); + for (Entity entity : MC.world.getEntities()) { + if(entity instanceof LivingEntity && (entity != MC.player)) { + Vec3d interpolated = RenderUtils.getEntityPositionInterpolated(entity, MinecraftClient.getInstance().getTickDelta()); + if (entity instanceof AnimalEntity) { + RenderUtils.drawLine3D(event.GetMatrixStack(), eyePosition, interpolated, color_passive.getValue()); + } else if (entity instanceof Monster) { + RenderUtils.drawLine3D(event.GetMatrixStack(), eyePosition, interpolated, color_enemies.getValue()); + } else { + RenderUtils.drawLine3D(event.GetMatrixStack(), eyePosition, interpolated, color_misc.getValue()); + } + } + } + + for(AbstractClientPlayerEntity player : MC.world.getPlayers()) { + Vec3d interpolated = RenderUtils.getEntityPositionInterpolated(player, MinecraftClient.getInstance().getTickDelta()); + RenderUtils.drawLine3D(event.GetMatrixStack(), eyePosition, interpolated, color_player.getValue()); + } + } +} diff --git a/remappedSrc/net/aoba/module/modules/render/Trajectory.java b/remappedSrc/net/aoba/module/modules/render/Trajectory.java new file mode 100644 index 00000000..47a125c0 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/render/Trajectory.java @@ -0,0 +1,121 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Trajectory Module + */ +package net.aoba.module.modules.render; + +import org.joml.Matrix4f; +import org.lwjgl.glfw.GLFW; +import org.lwjgl.opengl.GL11; +import com.mojang.blaze3d.systems.RenderSystem; +import net.aoba.Aoba; +import net.aoba.event.events.RenderEvent; +import net.aoba.event.listeners.RenderListener; +import net.aoba.gui.colors.Color; +import net.aoba.misc.ModuleUtils; +import net.aoba.module.Module; +import net.aoba.settings.types.ColorSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.GameRenderer; +import net.minecraft.client.render.Tessellator; +import net.minecraft.client.render.VertexFormat; +import net.minecraft.client.render.VertexFormats; +import net.minecraft.client.util.InputUtil; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.item.BowItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.math.Vec3d; + +public class Trajectory extends Module implements RenderListener { + + private ColorSetting color = new ColorSetting("trajectory_color", "Color", "Color", new Color(0, 1f, 1f)); + + public Trajectory() { + super(new KeybindSetting("key.trajectory", "Trajectory Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("Trajectory"); + this.setCategory(Category.Render); + this.setDescription("Allows the player to see where they are aiming. (DISABLED)"); + + this.addSetting(color); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(RenderListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(RenderListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnRender(RenderEvent event) { + MinecraftClient mc = MinecraftClient.getInstance(); + MatrixStack matrixStack = event.GetMatrixStack(); + matrixStack.push(); + + RenderSystem.setShaderColor(0, 0, 0, 1); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_DEPTH_TEST); + + Matrix4f matrix = matrixStack.peek().getPositionMatrix(); + Tessellator tessellator = RenderSystem.renderThreadTesselator(); + BufferBuilder bufferBuilder = tessellator.getBuffer(); + RenderSystem.setShader(GameRenderer::getPositionProgram); + + ItemStack itemStack = mc.player.getActiveItem(); + + if(!(ModuleUtils.isThrowable(itemStack))) return; + + float initialVelocity = (52 * BowItem.getPullProgress(mc.player.getItemUseTime())); + Vec3d prevPoint = new Vec3d(0,0,0); + + bufferBuilder.begin(VertexFormat.DrawMode.LINES, VertexFormats.POSITION); + for(int iteration = 0; iteration < 1000; iteration++){ + bufferBuilder.vertex(matrix, (float) prevPoint.x, (float) prevPoint.y, (float) prevPoint.z).next(); + + float distance = (float) ((initialVelocity)*Math.sin(2*mc.player.getRotationVector().x) / 9.0f); + Vec3d nextPoint = mc.player.getRotationVector().multiply(distance); + bufferBuilder.vertex(matrix, (float) nextPoint.x, (float) nextPoint.y, (float) nextPoint.z).next(); + + prevPoint = nextPoint; + } + + + tessellator.draw(); + RenderSystem.setShaderColor(1, 1, 1, 1); + + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_BLEND); + + matrixStack.pop(); + } + +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/module/modules/render/XRay.java b/remappedSrc/net/aoba/module/modules/render/XRay.java new file mode 100644 index 00000000..1da40c51 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/render/XRay.java @@ -0,0 +1,93 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * XRay Module + */ +package net.aoba.module.modules.render; + +import java.util.HashSet; +import java.util.List; +import org.lwjgl.glfw.GLFW; +import com.google.common.collect.Lists; +import net.aoba.interfaces.ISimpleOption; +import net.aoba.module.Module; +import net.aoba.settings.types.BlocksSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.block.Block; +import net.minecraft.block.Blocks; +import net.minecraft.client.util.InputUtil; + +public class XRay extends Module { + public BlocksSetting blocks; + + public XRay() { + super(new KeybindSetting("key.xray", "XRay Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("XRay"); + this.setCategory(Category.Render); + this.setDescription("Allows the player to see ores."); + + + blocks = new BlocksSetting("xray_blocks", "Blocks", "Blocks that can be seen in Xray", + new HashSet(Lists.newArrayList(Blocks.EMERALD_ORE, Blocks.EMERALD_BLOCK, Blocks.DIAMOND_ORE, Blocks.DIAMOND_BLOCK, + Blocks.GOLD_ORE, Blocks.GOLD_BLOCK, Blocks.IRON_ORE, Blocks.IRON_BLOCK, Blocks.COAL_ORE, + Blocks.COAL_BLOCK, Blocks.REDSTONE_BLOCK, Blocks.REDSTONE_ORE, Blocks.LAPIS_ORE, + Blocks.LAPIS_BLOCK, Blocks.NETHER_QUARTZ_ORE, Blocks.MOSSY_COBBLESTONE, Blocks.STONE_BRICKS, + Blocks.OAK_PLANKS, Blocks.DEEPSLATE_EMERALD_ORE, Blocks.DEEPSLATE_DIAMOND_ORE, + Blocks.DEEPSLATE_GOLD_ORE, Blocks.DEEPSLATE_IRON_ORE, Blocks.DEEPSLATE_COAL_ORE))); + blocks.setOnUpdate((HashSet block) -> ReloadRenderer(block)); + this.addSetting(blocks); + } + + @Override + public void onDisable() { + @SuppressWarnings("unchecked") + ISimpleOption gamma = (ISimpleOption) (Object) MC.options.getGamma(); + gamma.forceSetValue(1.0); + MC.worldRenderer.reload(); + } + + @Override + public void onEnable() { + MC.worldRenderer.reload(); + @SuppressWarnings("unchecked") + ISimpleOption gamma = (ISimpleOption) (Object) MC.options.getGamma(); + gamma.forceSetValue(10000.0); + + } + + @Override + public void onToggle() { + + } + + public boolean isXRayBlock(Block b) { + HashSet blockList = blocks.getValue(); + if (blockList.contains(b)) { + return true; + } + return false; + } + + public void ReloadRenderer(HashSet block) { + if(MC.worldRenderer != null && this.getState()) { + MC.worldRenderer.reload(); + } + } +} diff --git a/remappedSrc/net/aoba/module/modules/render/Zoom.java b/remappedSrc/net/aoba/module/modules/render/Zoom.java new file mode 100644 index 00000000..7045bb3b --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/render/Zoom.java @@ -0,0 +1,72 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.module.modules.render; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +import net.aoba.module.Module; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.option.SimpleOption; +import net.minecraft.client.util.InputUtil; + +public class Zoom extends Module implements TickListener { + + private int lastFov; + + private FloatSetting zoomFactor; + + public Zoom() { + super(new KeybindSetting("key.zoom", "Zoom Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("Zoom"); + this.setCategory(Category.Render); + this.setDescription("Zooms the players camera to see further."); + + zoomFactor = new FloatSetting("zoom_factor", "Factor", "The zoom factor that the zoom will use.", 2.0f, 1.0f, 3.6f, 0.1f); + + this.addSetting(zoomFactor); + } + + @Override + public void onDisable() { + MC.options.getFov().setValue(lastFov); + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + lastFov = MC.options.getFov().getValue(); + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnUpdate(TickEvent event) { + SimpleOption fov = MC.options.getFov(); + int newZoom = (int)(lastFov / zoomFactor.getValue()); + fov.setValue(newZoom); + } +} diff --git a/remappedSrc/net/aoba/module/modules/world/AutoFarm.java b/remappedSrc/net/aoba/module/modules/world/AutoFarm.java new file mode 100644 index 00000000..d132fe45 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/world/AutoFarm.java @@ -0,0 +1,135 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * AutoFarm Module + */ +package net.aoba.module.modules.world; + +import net.minecraft.block.Block; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; +import net.minecraft.block.CropBlock; +import net.minecraft.block.FarmlandBlock; +import net.minecraft.client.util.InputUtil; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket; +import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket.Action; +import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket; +import net.minecraft.util.Hand; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.math.Vec3d; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +import net.aoba.misc.ModuleUtils; +import org.lwjgl.glfw.GLFW; +import net.aoba.module.Module; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; + +public class AutoFarm extends Module implements TickListener { + private FloatSetting radius; + + public AutoFarm() { + super(new KeybindSetting("key.autofarm", "AutoFarm Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("AutoFarm"); + this.setCategory(Category.World); + this.setDescription("Destroys blocks that can be instantly broken around the player."); + this.radius = new FloatSetting("autofarm_radius", "Radius", "Radius", 5f, 0f, 15f, 1f); + this.addSetting(radius); + } + + public void setRadius(int radius) { + this.radius.setValue((float)radius); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + } + + @Override + public void OnUpdate(TickEvent event) { + int rad = radius.getValue().intValue(); + for (int x = -rad; x < rad; x++) { + for (int y = -1; y <= 1; y++) { + for (int z = -rad; z < rad; z++) { + BlockPos blockpos = new BlockPos(MC.player.getBlockPos().getX() + x, MC.player.getBlockPos().getY() + y, + MC.player.getBlockPos().getZ() + z); + Block block = MC.world.getBlockState(blockpos).getBlock(); + BlockState blockstate = MC.world.getBlockState(blockpos); + if (block instanceof CropBlock) { + CropBlock crop = (CropBlock) block; + if (!crop.canGrow(MC.world, null, blockpos, blockstate)) { + MC.player.networkHandler.sendPacket(new PlayerActionC2SPacket(Action.START_DESTROY_BLOCK,blockpos, Direction.NORTH)); + MC.player.networkHandler.sendPacket(new PlayerActionC2SPacket(Action.STOP_DESTROY_BLOCK, blockpos, Direction.NORTH)); + }else { + boolean b = false; + for(int i = 0; i< 9; i++) { + ItemStack stack = MC.player.getInventory().getStack(i); + if(stack.getItem() == Items.BONE_MEAL) { + MC.player.getInventory().selectedSlot = i; + b = true; + break; + } + } + if(b) { + BlockHitResult rayTrace = new BlockHitResult(new Vec3d(0,0,0), Direction.UP, blockpos, false); + + this.MC.player.networkHandler.sendPacket(new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, rayTrace, 0)); + } + } + }else if (block instanceof FarmlandBlock) { + BlockPos blockAbovePos = new BlockPos((int) MC.player.getBlockPos().getX() + x, (int) MC.player.getBlockPos().getY() + y + 1, + (int) MC.player.getBlockPos().getZ() + z); + Block blockAbove = MC.world.getBlockState(blockAbovePos).getBlock(); + if(blockAbove == Blocks.AIR) { + boolean b = false; + for(int i = 0; i< 9; i++) { + ItemStack stack = MC.player.getInventory().getStack(i); + if(ModuleUtils.isPlantable(stack)) { + MC.player.getInventory().selectedSlot = i; + b = true; + break; + } + } + if(b) { + BlockHitResult rayTrace = new BlockHitResult(new Vec3d(0,0,0), Direction.UP, blockpos, false); + this.MC.player.networkHandler.sendPacket(new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, rayTrace, 0)); + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/module/modules/world/AutoSign.java b/remappedSrc/net/aoba/module/modules/world/AutoSign.java new file mode 100644 index 00000000..a2443dd7 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/world/AutoSign.java @@ -0,0 +1,62 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * AutoSign Module + */ +package net.aoba.module.modules.world; + +import org.lwjgl.glfw.GLFW; +import net.aoba.cmd.CommandManager; +import net.aoba.module.Module; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; + +public class AutoSign extends Module { + String[] text; + + public AutoSign() { + super(new KeybindSetting("key.autosign", "AutoSign Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("AutoSign"); + this.setCategory(Category.World); + this.setDescription("Automatically places sign."); + } + + public void setText(String[] text) { + this.text = text; + } + + public String[] getText() { + return this.text; + } + + @Override + public void onDisable() { + } + + @Override + public void onEnable() { + CommandManager.sendChatMessage("Place down a sign to set text!"); + this.text = null; + } + + @Override + public void onToggle() { + } +} diff --git a/remappedSrc/net/aoba/module/modules/world/Nuker.java b/remappedSrc/net/aoba/module/modules/world/Nuker.java new file mode 100644 index 00000000..070647b2 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/world/Nuker.java @@ -0,0 +1,171 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * Nuker Module + */ +package net.aoba.module.modules.world; + +import java.util.HashSet; + +import org.lwjgl.glfw.GLFW; + +import com.google.common.collect.Lists; + +import net.aoba.Aoba; +import net.aoba.event.events.BlockStateEvent; +import net.aoba.event.events.RenderEvent; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.BlockStateListener; +import net.aoba.event.listeners.RenderListener; +import net.aoba.event.listeners.TickListener; +import net.aoba.gui.colors.Color; +import net.aoba.misc.RenderUtils; +import net.aoba.module.Module; +import net.aoba.settings.types.BlocksSetting; +import net.aoba.settings.types.BooleanSetting; +import net.aoba.settings.types.ColorSetting; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.client.util.InputUtil; +import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket; +import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket.Action; +import net.minecraft.util.Hand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Box; +import net.minecraft.util.math.Direction; + +public class Nuker extends Module implements RenderListener, TickListener, BlockStateListener { + private BooleanSetting creative = new BooleanSetting("nuker_creative", "Creative", "Creative", false); + private ColorSetting color = new ColorSetting("nuker_color", "Color", "Color", new Color(0, 1f, 1f)); + private FloatSetting radius = new FloatSetting("nuker_radius", "Radius", "Radius", 5f, 0f, 15f, 1f); + private BlocksSetting blacklist = new BlocksSetting("nuker_blacklist", "Blacklist", + "Blocks that will not be broken by Nuker.", new HashSet()); + + private BlockPos currentBlockToBreak = null; + + public Nuker() { + super(new KeybindSetting("key.nuker", "Nuker Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("Nuker"); + this.setCategory(Category.World); + this.setDescription("Destroys blocks around the player."); + + this.addSetting(creative); + this.addSetting(radius); + this.addSetting(color); + this.addSetting(blacklist); + } + + public void setRadius(int radius) { + this.radius.setValue((float) radius); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(RenderListener.class, this); + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + Aoba.getInstance().eventManager.RemoveListener(BlockStateListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(RenderListener.class, this); + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + Aoba.getInstance().eventManager.AddListener(BlockStateListener.class, this); + } + + @Override + public void onToggle() { + } + + @Override + public void OnUpdate(TickEvent event) { + if(creative.getValue()) { + int range = (int) (Math.floor(radius.getValue()) + 1); + Iterable blocks = BlockPos.iterateOutwards(new BlockPos(BlockPos.ofFloored(MC.player.getPos()).up()), range, range, range); + for (BlockPos blockPos : blocks) { + Block block = MC.world.getBlockState(blockPos).getBlock(); + if (block == Blocks.AIR || blacklist.getValue().contains(block)) + continue; + + MC.player.networkHandler.sendPacket(new PlayerActionC2SPacket(Action.START_DESTROY_BLOCK, blockPos, Direction.NORTH)); + MC.player.networkHandler.sendPacket(new PlayerActionC2SPacket(Action.STOP_DESTROY_BLOCK, blockPos, Direction.NORTH)); + MC.player.swingHand(Hand.MAIN_HAND); + } + }else { + if (currentBlockToBreak == null) { + currentBlockToBreak = getNextBlock(); + } + + if(currentBlockToBreak != null) { + + // Check to ensure that the block is not further than we can reach. + int range = (int) (Math.floor(radius.getValue()) + 1); + int rangeSqr = range ^ 2; + if(MC.player.getBlockPos().toCenterPos().distanceTo(currentBlockToBreak.toCenterPos()) > rangeSqr) { + currentBlockToBreak = null; + }else { + MC.player.networkHandler.sendPacket(new PlayerActionC2SPacket(Action.START_DESTROY_BLOCK, currentBlockToBreak, Direction.NORTH)); + MC.player.networkHandler.sendPacket(new PlayerActionC2SPacket(Action.STOP_DESTROY_BLOCK, currentBlockToBreak, Direction.NORTH)); + MC.player.swingHand(Hand.MAIN_HAND); + } + } + } + } + + @Override + public void OnRender(RenderEvent event) { + if(currentBlockToBreak != null) { + RenderUtils.draw3DBox(event.GetMatrixStack(), new Box(currentBlockToBreak), color.getValue()); + } + } + + @Override + public void OnBlockStateChanged(BlockStateEvent event) { + if(currentBlockToBreak != null) { + BlockPos blockPos = event.getBlockPos(); + BlockState oldBlockState = event.getPreviousBlockState(); + if (blockPos.equals(currentBlockToBreak) && (oldBlockState.isAir())) { + currentBlockToBreak = null; + } + } + } + + private BlockPos getNextBlock() { + // Scan to find next block to begin breaking. + int rad = radius.getValue().intValue(); + for (int y = rad; y > -rad; y--) { + for (int x = -rad; x < rad; x++) { + for (int z = -rad; z < rad; z++) { + BlockPos blockpos = new BlockPos(MC.player.getBlockX() + x, (int) MC.player.getBlockY() + y, + (int) MC.player.getBlockZ() + z); + Block block = MC.world.getBlockState(blockpos).getBlock(); + if (block == Blocks.AIR || blacklist.getValue().contains(block)) + continue; + + return blockpos; + } + } + } + return null; + } +} diff --git a/remappedSrc/net/aoba/module/modules/world/Surround.java b/remappedSrc/net/aoba/module/modules/world/Surround.java new file mode 100644 index 00000000..b62948f6 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/world/Surround.java @@ -0,0 +1,172 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.module.modules.world; + +import java.util.ArrayList; +import java.util.List; +import org.lwjgl.glfw.GLFW; +import com.google.common.collect.Lists; +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; +import net.aoba.module.Module; +import net.aoba.settings.types.BooleanSetting; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.block.Block; +import net.minecraft.block.Blocks; +import net.minecraft.client.util.InputUtil; +import net.minecraft.item.ItemStack; +import net.minecraft.network.packet.c2s.play.HandSwingC2SPacket; +import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; +import net.minecraft.network.packet.c2s.play.UpdateSelectedSlotC2SPacket; +import net.minecraft.util.Hand; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +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; + public BooleanSetting alignCharacter; + public BooleanSetting autoDisable; + public BooleanSetting legit; + + public Surround() { + super(new KeybindSetting("key.surround", "Surround Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("Surround"); + this.setCategory(Category.World); + this.setDescription("Surrounds the player with blocks."); + + placeHeight = new FloatSetting("surround_height", "Height", "Height that surround walls will go.", 1f, 1f, 3f, 1.0f); + alignCharacter = new BooleanSetting("surround_align", "Align", "Aligns the character to the nearest block.", false); + autoDisable = new BooleanSetting("surround_autodisable", "Auto-Disable", "Disables the module when the blocks have finished placing.", false); + legit = new BooleanSetting("surround_legit", "Legit", "Whether or not to simulate a player looking and clicking to place.", false); + + + this.addSetting(placeHeight); + this.addSetting(alignCharacter); + this.addSetting(autoDisable); + this.addSetting(legit); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + if(alignCharacter.getValue()) { + BlockPos blockPos = MC.player.getBlockPos(); + MC.player.updatePosition(blockPos.getX() + 0.5f, MC.player.getY(), blockPos.getZ() + 0.5f); + MC.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(blockPos.getX() + 0.5f, MC.player.getY(), blockPos.getZ() + 0.5f, MC.player.isOnGround())); + } + } + + @Override + public void onToggle() { + + } + + @Override + public void OnUpdate(TickEvent event) { + int foundBlockSlot = getBlockInventorySlot(); + int oldSlot = MC.player.getInventory().selectedSlot; + // Disable the module is no block was found in the inventory. + if(foundBlockSlot == -1) { + this.setState(false); + return; + }else { + // Change the selected slot and determien which hand it is in. + MC.player.getInventory().selectedSlot = foundBlockSlot; + MC.player.networkHandler.sendPacket(new UpdateSelectedSlotC2SPacket(foundBlockSlot)); + Hand hand = foundBlockSlot == 40 ? Hand.OFF_HAND : Hand.MAIN_HAND; + + // Get the block positions around the player and place the blocks. + BlockPos playerPosition = MC.player.getBlockPos(); + + int height = placeHeight.getValue().intValue(); + + for(int i = 0; i < (height - 1); i++) { + BlockPos newPos = playerPosition.add(0, i, 0); + List placePositions = Lists.newArrayList(newPos.north(), newPos.east(), newPos.south(), newPos.west()); + for(BlockPos pos : placePositions) { + if(MC.world.getBlockState(pos).isReplaceable()) { + placeBlock(pos, hand); + } + } + } + + + } + + // Return Selected Slot back to original slot. + MC.player.getInventory().selectedSlot = oldSlot; + MC.player.networkHandler.sendPacket(new UpdateSelectedSlotC2SPacket(oldSlot)); + + // Disable state is auto disable is enabled. + if(autoDisable.getValue()) { + setState(false); + } + } + + /** + * Get the inventory slot containing the blocks. + * @return Slot containing item. + */ + private int getBlockInventorySlot() { + for(int i = 0; i < 36; i++) + { + ItemStack stack = MC.player.getInventory().getStack(i); + if(stack != null && blocks.contains(Block.getBlockFromItem(stack.getItem()))) { + return i; + } + } + return -1; + } + + /** + * Places the block at a specific position. + * @param pos Position of the block to place. + * @param hand Hand to place with. + */ + private void placeBlock(BlockPos pos, Hand hand) { + for (Direction direction : Direction.values()) { + if (!MC.world.isInBuildLimit(pos.offset(direction))) + continue; + + if(legit.getValue()) { + MC.player.swingHand(hand); + }else { + MC.player.networkHandler.sendPacket(new HandSwingC2SPacket(hand)); + } + + MC.interactionManager.interactBlock(MC.player, hand, new BlockHitResult(Vec3d.ofCenter(pos), direction.getOpposite(), pos.offset(direction), false)); + break; + } + } +} diff --git a/remappedSrc/net/aoba/module/modules/world/TileBreaker.java b/remappedSrc/net/aoba/module/modules/world/TileBreaker.java new file mode 100644 index 00000000..ad24f800 --- /dev/null +++ b/remappedSrc/net/aoba/module/modules/world/TileBreaker.java @@ -0,0 +1,169 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * TileBreaker Module + */ +package net.aoba.module.modules.world; + +import java.util.ArrayList; +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.RenderEvent; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.RenderListener; +import net.aoba.event.listeners.TickListener; +import net.aoba.gui.colors.Color; +import net.aoba.misc.RenderUtils; +import net.aoba.module.Module; +import net.aoba.settings.types.ColorSetting; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.block.Block; +import net.minecraft.block.Blocks; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.util.InputUtil; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Box; +import net.minecraft.util.math.Direction; +import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket; +import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket.Action; + +public class TileBreaker extends Module implements TickListener, RenderListener { + private MinecraftClient mc; + private ArrayList blocks = new ArrayList(); + private FloatSetting radius; + + private ColorSetting color = new ColorSetting("tilebreaker_color", "Color", "Color", new Color(0, 1f, 1f)); + + public TileBreaker() { + super(new KeybindSetting("key.tilebreaker", "TileBreaker Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("TileBreaker"); + this.setCategory(Category.World); + this.setDescription("Destroys blocks that can be instantly broken around the player."); + this.loadTileBreakerBlocks(); + this.radius = new FloatSetting("tilebreaker_radius", "Radius", "Radius", 5f, 0f, 15f, 1f); + this.addSetting(radius); + mc = MinecraftClient.getInstance(); + + this.addSetting(color); + } + + public void setRadius(int radius) { + this.radius.setValue((float)radius); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(RenderListener.class, this); + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(RenderListener.class, this); + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void onToggle() { + } + + private void loadTileBreakerBlocks() { + this.blocks.add(Blocks.TORCH); + this.blocks.add(Blocks.WALL_TORCH); + this.blocks.add(Blocks.REDSTONE_TORCH); + this.blocks.add(Blocks.REDSTONE_WALL_TORCH); + this.blocks.add(Blocks.FERN); + this.blocks.add(Blocks.LARGE_FERN); + this.blocks.add(Blocks.FLOWER_POT); + this.blocks.add(Blocks.POTATOES); + this.blocks.add(Blocks.CARROTS); + this.blocks.add(Blocks.WHEAT); + this.blocks.add(Blocks.BEETROOTS); + this.blocks.add(Blocks.SUGAR_CANE); + this.blocks.add(Blocks.GRASS_BLOCK); + this.blocks.add(Blocks.TALL_GRASS); + this.blocks.add(Blocks.SEAGRASS); + this.blocks.add(Blocks.TALL_SEAGRASS); + this.blocks.add(Blocks.DEAD_BUSH); + this.blocks.add(Blocks.DANDELION); + this.blocks.add(Blocks.ROSE_BUSH); + this.blocks.add(Blocks.POPPY); + this.blocks.add(Blocks.BLUE_ORCHID); + this.blocks.add(Blocks.ALLIUM); + this.blocks.add(Blocks.AZURE_BLUET); + this.blocks.add(Blocks.RED_TULIP); + this.blocks.add(Blocks.ORANGE_TULIP); + this.blocks.add(Blocks.WHITE_TULIP); + this.blocks.add(Blocks.PINK_TULIP); + this.blocks.add(Blocks.OXEYE_DAISY); + this.blocks.add(Blocks.CORNFLOWER); + this.blocks.add(Blocks.WITHER_ROSE); + this.blocks.add(Blocks.LILY_OF_THE_VALLEY); + this.blocks.add(Blocks.BROWN_MUSHROOM); + this.blocks.add(Blocks.RED_MUSHROOM); + this.blocks.add(Blocks.SUNFLOWER); + this.blocks.add(Blocks.LILAC); + this.blocks.add(Blocks.PEONY); + } + + public boolean isTileBreakerBlock(Block b) { + return this.blocks.contains(b); + } + + @Override + public void OnUpdate(TickEvent event) { + int rad = this.radius.getValue().intValue(); + for (int x = -rad; x < rad; x++) { + for (int y = rad; y > -rad; y--) { + for (int z = -rad; z < rad; z++) { + BlockPos blockpos = new BlockPos( mc.player.getBlockX() + x, + mc.player.getBlockY() + y, + mc.player.getBlockZ() + z); + Block block = mc.world.getBlockState(blockpos).getBlock(); + if (this.isTileBreakerBlock(block)) { + mc.player.networkHandler.sendPacket( + new PlayerActionC2SPacket(Action.START_DESTROY_BLOCK, blockpos, Direction.NORTH)); + mc.player.networkHandler.sendPacket( + new PlayerActionC2SPacket(Action.STOP_DESTROY_BLOCK, blockpos, Direction.NORTH)); + } + } + } + } + } + + @Override + public void OnRender(RenderEvent event) { + int rad = this.radius.getValue().intValue(); + for (int x = -rad; x < rad; x++) { + for (int y = rad; y > -rad; y--) { + for (int z = -rad; z < rad; z++) { + BlockPos blockpos = new BlockPos((int) mc.player.getBlockX() + x, + mc.player.getBlockY() + y, + mc.player.getBlockZ() + z); + Block block = mc.world.getBlockState(blockpos).getBlock(); + if (this.isTileBreakerBlock(block)) { + RenderUtils.draw3DBox(event.GetMatrixStack(), new Box(blockpos), color.getValue()); + } + } + } + } + } +} diff --git a/remappedSrc/net/aoba/settings/Setting.java b/remappedSrc/net/aoba/settings/Setting.java new file mode 100644 index 00000000..cb1ab1d4 --- /dev/null +++ b/remappedSrc/net/aoba/settings/Setting.java @@ -0,0 +1,133 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.settings; + +import java.util.function.Consumer; + +import net.aoba.misc.TextUtils; + +public abstract class Setting { + + public enum TYPE { + BOOLEAN, FLOAT, STRING, INTEGER, STRINGLIST, INDEXEDSTRINGLIST, VECTOR2, KEYBIND, COLOR, BLOCKS + } + + public final String ID; + public final String displayName; + public final String description; + protected final T default_value; + + protected T value; + + public TYPE type; + + // Consumers + private Consumer onUpdate; + + public Setting(String ID, String description, T default_value) { + this.ID = ID; + this.displayName = TextUtils.IDToName(ID); + this.description = description; + this.default_value = default_value; + this.onUpdate = null; + this.value = default_value; + } + + public Setting(String ID, String displayName, String description, T default_value) { + this.ID = ID; + this.displayName = displayName; + this.description = description; + this.default_value = default_value; + this.onUpdate = null; + this.value = default_value; + } + + public Setting(String ID, String description, T default_value, Consumer onUpdate) { + this.ID = ID; + this.displayName = TextUtils.IDToName(ID); + this.description = description; + this.default_value = default_value; + this.onUpdate = onUpdate; + this.value = default_value; + } + + /** + * Getter for the current value. + * @return The value currently stored in the Setting. + */ + public T getValue() { + return value; + } + + /** + * Setter for the current value. + * @param value The value to set. + */ + public void setValue(T value) { + if (isValueValid(value)) { + this.value = value; + } + update(); + } + + /** + * Setter for the current value that does not call update. + * @param value The value to set. + */ + public void silentSetValue(T value) { + if (isValueValid(value)) { + this.value = value; + } + } + + /** + * Resets the value of the setting to the default value. + */ + public void resetValue() { + setValue(default_value); + } + + /** + * Function that handles when the value is updated. + */ + public void update() { + if (onUpdate != null) { + onUpdate.accept(value); + } + } + + public void setOnUpdate(Consumer consumer) { + this.onUpdate = consumer; + } + + /** + * Getter for the default value. + * @return + */ + public T getDefaultValue() { + return default_value; + } + + /** + * Function that will check if a value is valid for this particular setting. + * @param value The value to test. + * @return True if the value is valid. + */ + protected abstract boolean isValueValid(T value); +} diff --git a/remappedSrc/net/aoba/settings/SettingManager.java b/remappedSrc/net/aoba/settings/SettingManager.java new file mode 100644 index 00000000..82d5bfbb --- /dev/null +++ b/remappedSrc/net/aoba/settings/SettingManager.java @@ -0,0 +1,208 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.settings; + +import net.aoba.gui.colors.Color; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.IntegerSetting; +import net.aoba.utils.types.Vector2; +import net.minecraft.block.Block; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.util.InputUtil; +import net.minecraft.client.util.InputUtil.Key; +import net.minecraft.registry.Registries; +import net.minecraft.util.Identifier; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Properties; + +public class SettingManager { + private static boolean DEBUG_STUFF = false; + + public List> config_category = new ArrayList<>(); + public List> modules_category = new ArrayList<>(); + public List> hidden_category = new ArrayList<>(); + + public static void registerSetting(Setting p_setting, List> p_category) { + p_category.add(p_setting); + } + + public static File configFolder; + public static File configFile; + public static Properties config; + + public static void prepare(String name) { + try { + configFolder = new File(MinecraftClient.getInstance().runDirectory + File.separator + "aoba"); + configFile = new File(configFolder + File.separator + name + ".xml"); + + if (!configFolder.exists()) + configFolder.mkdirs(); + + if (!configFile.exists()) + configFile.createNewFile(); + + config = new Properties(); + } catch (Exception ignored) { + + } + } + + public static void saveSettings(String name, List> config_category2) + throws FileNotFoundException, IOException { + System.out.println("Saving config " + name + "."); + prepare(name); + for (Setting setting : config_category2) { + try { + switch (setting.type) { + case FLOAT, INTEGER, BOOLEAN, STRING -> { + config.setProperty(setting.ID, String.valueOf(setting.getValue())); + } + case KEYBIND -> { + Key key = ((Key) setting.getValue()); + config.setProperty(setting.ID, String.valueOf(key.getCode())); + } + case VECTOR2 -> { + config.setProperty(setting.ID, String.valueOf(((Vector2) setting.getValue()).x) + "," + + String.valueOf(((Vector2) setting.getValue()).y)); + } + case COLOR -> { + String s = ((Color) setting.getValue()).getColorAsHex(); + config.setProperty(setting.ID, s); + } + case BLOCKS -> { + @SuppressWarnings("unchecked") + HashSet s = (HashSet) setting.getValue(); + String result = ""; + + int iteration = 0; + for(Block block : s){ + Identifier id = Registries.BLOCK.getId(block); + result += id.getNamespace() + ":" + id.getPath(); + if (iteration != s.size() - 1) { + result += ","; + } + iteration++; + } + + config.setProperty(setting.ID, result); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } + config.storeToXML(new FileOutputStream(configFile), null); + } + + public static void loadSettings(String name, List> config_category2) { + try { + System.out.println("Loading config " + name + "."); + prepare(name); + config.loadFromXML(new FileInputStream(configFile)); + } catch (Exception e) { + e.printStackTrace(); + } + + for (Setting setting : config_category2) { + try { + String value = config.getProperty(setting.ID, null); + + if (DEBUG_STUFF) + System.out.println(setting.displayName + " " + setting.value + " " + Double.parseDouble(value)); + + if (value == null) + break; + + switch (setting.type) { + case FLOAT -> { + float floatValue = Float.parseFloat(value); + if (((FloatSetting) setting).min_value <= floatValue + && ((FloatSetting) setting).max_value >= floatValue) { + setting.setValue(Float.parseFloat(value)); + } + break; + } + case INTEGER -> { + int intValue = Integer.parseInt(value); + if (((IntegerSetting) setting).min_value <= intValue + && ((IntegerSetting) setting).max_value >= intValue) { + setting.setValue(Integer.parseInt(value)); + } + break; + } + case BOOLEAN -> { + setting.setValue(Boolean.parseBoolean(value)); + break; + } + case STRING -> { + setting.setValue(value); + break; + } + case KEYBIND -> { + int keyCode = Integer.parseInt(config.getProperty(setting.ID, null)); + setting.setValue(InputUtil.fromKeyCode(keyCode, 0)); + break; + } + case VECTOR2 -> { + String[] dimensions = value.split(","); + if (dimensions.length == 2) { + setting.setValue(new Vector2(Float.parseFloat(dimensions[0]), Float.parseFloat(dimensions[1]))); + } + break; + } + case COLOR -> { + long hexValue = Long.parseLong(value.replace("#", ""), 16); + int Alpha = (int) ((hexValue) >> 24) & 0xFF; + int R = (int) ((hexValue) >> 16) & 0xFF; + int G = (int) ((hexValue) >> 8) & 0xFF; + int B = (int) (hexValue) & 0xFF; + setting.setValue(new Color(R, G, B, Alpha)); + break; + } + case BLOCKS -> { + String[] ids = value.split(","); + HashSet result = new HashSet(); + for (String str : ids) { + Identifier i = new Identifier(str); + result.add(Registries.BLOCK.get(i)); + } + setting.setValue(result); + break; + } + case INDEXEDSTRINGLIST -> throw new UnsupportedOperationException("Unimplemented case: " + setting.type); + case STRINGLIST -> throw new UnsupportedOperationException("Unimplemented case: " + setting.type); + default -> throw new IllegalArgumentException("Unexpected value: " + setting.type); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + public enum SettingCategories { + CONFIG, MODULES, HIDDEN + } +} diff --git a/remappedSrc/net/aoba/settings/types/BlocksSetting.java b/remappedSrc/net/aoba/settings/types/BlocksSetting.java new file mode 100644 index 00000000..30fed21f --- /dev/null +++ b/remappedSrc/net/aoba/settings/types/BlocksSetting.java @@ -0,0 +1,41 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.settings.types; + +import java.util.HashSet; +import net.aoba.settings.Setting; +import net.minecraft.block.Block; + +public class BlocksSetting extends Setting> { + + public BlocksSetting(String ID, String description, HashSet default_value) { + super(ID, description, default_value); + type = TYPE.BLOCKS; + } + + public BlocksSetting(String ID, String displayName, String description, HashSet default_value) { + super(ID, displayName, description, default_value); + type = TYPE.BLOCKS; + } + + @Override + protected boolean isValueValid(HashSet value) { + return true; + } +} diff --git a/remappedSrc/net/aoba/settings/types/BooleanSetting.java b/remappedSrc/net/aoba/settings/types/BooleanSetting.java new file mode 100644 index 00000000..342abe34 --- /dev/null +++ b/remappedSrc/net/aoba/settings/types/BooleanSetting.java @@ -0,0 +1,56 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.settings.types; + +import java.util.function.Consumer; + +import net.aoba.settings.Setting; + +public class BooleanSetting extends Setting { + + public BooleanSetting(String ID, String description, boolean default_value) { + super(ID, description, default_value); + type = TYPE.BOOLEAN; + } + + public BooleanSetting(String ID, String displayName, String description, boolean default_value) { + super(ID, displayName, description, default_value); + type = TYPE.BOOLEAN; + } + + public BooleanSetting(String ID, String description, boolean default_value, Consumer onUpdate) { + super(ID, description, default_value, onUpdate); + type = TYPE.BOOLEAN; + } + + /** + * Toggles the current value of the setting. + */ + public void toggle() { + setValue(!value); + } + + /** + * Checks whether or not a value is with this setting's valid range. + */ + @Override + protected boolean isValueValid(Boolean value) { + return true; + } +} diff --git a/remappedSrc/net/aoba/settings/types/ColorSetting.java b/remappedSrc/net/aoba/settings/types/ColorSetting.java new file mode 100644 index 00000000..2d5d446a --- /dev/null +++ b/remappedSrc/net/aoba/settings/types/ColorSetting.java @@ -0,0 +1,58 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.settings.types; +import net.aoba.gui.GuiManager; +import net.aoba.gui.colors.Color; +import net.aoba.gui.colors.ColorMode; +import net.aoba.settings.Setting; + +public class ColorSetting extends Setting { + + private ColorMode mode; + + public ColorSetting(String ID, String description, Color default_value) { + super(ID, description, default_value); + type = TYPE.COLOR; + } + + public ColorSetting(String ID, String displayName, String description, Color default_value) { + super(ID, displayName, description, default_value); + type = TYPE.COLOR; + } + + @Override + protected boolean isValueValid(Color value) { + return (value.r <=255 && value.g <= 255 && value.b <= 255); + } + + public void setMode(ColorMode color) { + mode = color; + switch(mode) { + case Normal: + this.setValue(default_value); + break; + case Rainbow: + this.setValue(GuiManager.rainbowColor); + break; + case Random: + this.setValue(GuiManager.randomColor); + break; + } + } +} diff --git a/remappedSrc/net/aoba/settings/types/FloatSetting.java b/remappedSrc/net/aoba/settings/types/FloatSetting.java new file mode 100644 index 00000000..e03b6833 --- /dev/null +++ b/remappedSrc/net/aoba/settings/types/FloatSetting.java @@ -0,0 +1,71 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.settings.types; + +import java.util.function.Consumer; + +import net.aoba.settings.Setting; + +public class FloatSetting extends Setting { + public final float min_value; + public final float max_value; + public final float step; + + public FloatSetting(String ID, String description, float default_value, float min_value, float max_value, float step) { + super(ID, description, default_value); + this.min_value = min_value; + this.max_value = max_value; + this.step = step; + type = TYPE.FLOAT; + } + + public FloatSetting(String ID, String displayName, String description, float default_value, float min_value, float max_value, float step) { + super(ID, displayName, description, default_value); + this.min_value = min_value; + this.max_value = max_value; + this.step = step; + type = TYPE.FLOAT; + } + + public FloatSetting(String ID, String description, float default_value, float min_value, float max_value, float step, Consumer onUpdate) { + super(ID, description, default_value, onUpdate); + this.min_value = min_value; + this.max_value = max_value; + this.step = step; + type = TYPE.FLOAT; + } + + /** + * Setter for the value. Includes rounding to the nearest "step". + */ + @Override + public void setValue(Float value) { + double newValue = Math.max(min_value, Math.min(max_value, value)); + int steps = (int) Math.round((newValue) / step); + super.setValue(step * steps); + } + + /** + * Checks whether or not a value is with this setting's valid range. + */ + @Override + protected boolean isValueValid(Float value) { + return value >= min_value && value <= max_value; + } +} diff --git a/remappedSrc/net/aoba/settings/types/IndexedStringListSetting.java b/remappedSrc/net/aoba/settings/types/IndexedStringListSetting.java new file mode 100644 index 00000000..8958a38a --- /dev/null +++ b/remappedSrc/net/aoba/settings/types/IndexedStringListSetting.java @@ -0,0 +1,90 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.settings.types; + +import java.util.List; +import java.util.function.Consumer; + +public class IndexedStringListSetting extends StringListSetting { + protected int index = 0; + + public IndexedStringListSetting(String ID, String description, List default_value) { + super(ID, description, default_value); + type = TYPE.INDEXEDSTRINGLIST; + } + + public IndexedStringListSetting(String ID, String displayName, String description, List default_value) { + super(ID, displayName, description, default_value); + type = TYPE.INDEXEDSTRINGLIST; + } + + public IndexedStringListSetting(String ID, String description, List default_value, + Consumer> onUpdate) { + super(ID, description, default_value, onUpdate); + type = TYPE.INDEXEDSTRINGLIST; + } + + /** + * Getter for the current index of the setting. + * @return Index of the setting. + */ + public int getIndex() { + return index; + } + + /** + * Getter for the current value stored at a specific index of the setting. + * @return Value at the current index of the setting. + */ + public String getIndexValue() { + return value.get(index); + } + + /** + * Setter for the current index of the setting. + * @param newValue The new index to set the current index to. + */ + public void setIndex(int newValue) { + if (index > value.size()) + index = value.size() - 1; + if (index < 0) + index = 0; + index = newValue; + } + + /** + * Increments the current index of the setter. + */ + public void increment() { + index += 1; + if (index > value.size()) { + index = 0; + } + } + + /** + * Decrements the current index of the setter. + */ + public void decrement() { + index -= 1; + if (index < 0) { + index = value.size() - 1; + } + } +} diff --git a/remappedSrc/net/aoba/settings/types/IntegerSetting.java b/remappedSrc/net/aoba/settings/types/IntegerSetting.java new file mode 100644 index 00000000..08fc1531 --- /dev/null +++ b/remappedSrc/net/aoba/settings/types/IntegerSetting.java @@ -0,0 +1,63 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.settings.types; + +import java.util.function.Consumer; + +import net.aoba.settings.Setting; + +public class IntegerSetting extends Setting { + public final int min_value; + public final int max_value; + public final int step; + + public IntegerSetting(String ID, String description, Integer default_value, int min_value, int max_value, + int step) { + super(ID, description, default_value); + this.min_value = min_value; + this.max_value = max_value; + this.step = step; + type = TYPE.INTEGER; + } + + public IntegerSetting(String ID, String displayName, String description, Integer default_value, int min_value, int max_value, int step) { + super(ID, displayName, description, default_value); + this.min_value = min_value; + this.max_value = max_value; + this.step = step; + type = TYPE.INTEGER; + } + + public IntegerSetting(String ID, String description, int default_value, int min_value, int max_value, int step, + Consumer onUpdate) { + super(ID, description, default_value, onUpdate); + this.min_value = min_value; + this.max_value = max_value; + this.step = step; + type = TYPE.INTEGER; + } + + /** + * Checks whether or not a value is with this setting's valid range. + */ + @Override + protected boolean isValueValid(Integer value) { + return value >= min_value && value <= max_value; + } +} diff --git a/remappedSrc/net/aoba/settings/types/KeybindSetting.java b/remappedSrc/net/aoba/settings/types/KeybindSetting.java new file mode 100644 index 00000000..32a28a03 --- /dev/null +++ b/remappedSrc/net/aoba/settings/types/KeybindSetting.java @@ -0,0 +1,48 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.settings.types; + +import java.util.function.Consumer; +import net.aoba.settings.Setting; +import net.minecraft.client.util.InputUtil.Key; + +public class KeybindSetting extends Setting { + public KeybindSetting(String ID, String description, Key default_value) { + super(ID, description, default_value); + type = TYPE.KEYBIND; + } + + public KeybindSetting(String ID, String displayName, String description, Key default_value) { + super(ID, displayName, description, default_value); + type = TYPE.KEYBIND; + } + + public KeybindSetting(String ID, String description, Key default_value, Consumer onUpdate) { + super(ID, description, default_value, onUpdate); + type = TYPE.KEYBIND; + } + + /** + * Checks whether or not a value is with this setting's valid range. + */ + @Override + protected boolean isValueValid(Key value) { + return true; + } +} \ No newline at end of file diff --git a/remappedSrc/net/aoba/settings/types/StringListSetting.java b/remappedSrc/net/aoba/settings/types/StringListSetting.java new file mode 100644 index 00000000..babdaab4 --- /dev/null +++ b/remappedSrc/net/aoba/settings/types/StringListSetting.java @@ -0,0 +1,98 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.settings.types; + +import java.util.List; +import java.util.function.Consumer; + +import net.aoba.settings.Setting; + +public class StringListSetting extends Setting> { + public StringListSetting(String ID, String description, List default_value) { + super(ID, description, default_value); + type = TYPE.STRINGLIST; + } + + public StringListSetting(String ID, String displayName, String description, List default_value) { + super(ID, displayName, description, default_value); + type = TYPE.STRINGLIST; + } + + public StringListSetting(String ID, String description, List default_value, + Consumer> onUpdate) { + super(ID, description, default_value, onUpdate); + type = TYPE.STRINGLIST; + } + + /** + * Appends a new string to the list. + * @param value String to add to the list. + */ + public void appendString(String value) { + this.value.add(value); + update(); + } + + /** + * Removes a string at an index from the list. + * @param index Index to remove the string from. + */ + public void removeAtIndex(int index) { + if (index >= 0 && index < value.size()) { + value.remove(index); + update(); + } + // TODO: add out of bounds error .. maybe + } + + /** + * Removes a string from the list + * @param newValue The value to remove from the array. + */ + public void removeString(String newValue) { + for(String s : value) { + if(s.equals(newValue)) { + value.remove(s); + update(); + break; + } + } + } + + /** + * Getter for a String at a specific index. + * @param index Index to fetch the string from. + * @return String in the list at index. + */ + public String getValueAt(int index) { + if (index >= 0 && index < value.size()) { + return value.get(index); + } + return null; + // TODO: add out of bounds error .. maybe + } + + /** + * Checks whether or not a value is with this setting's valid range. + */ + @Override + protected boolean isValueValid(List value) { + return true; + } +} diff --git a/remappedSrc/net/aoba/settings/types/StringSetting.java b/remappedSrc/net/aoba/settings/types/StringSetting.java new file mode 100644 index 00000000..e5f6c940 --- /dev/null +++ b/remappedSrc/net/aoba/settings/types/StringSetting.java @@ -0,0 +1,48 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.settings.types; + +import java.util.function.Consumer; + +import net.aoba.settings.Setting; + +public class StringSetting extends Setting { + public StringSetting(String ID, String description, String default_value) { + super(ID, description, default_value); + type = TYPE.STRING; + } + + public StringSetting(String ID, String displayName, String description, String default_value) { + super(ID, displayName, description, default_value); + type = TYPE.STRING; + } + + public StringSetting(String ID, String description, String default_value, Consumer onUpdate) { + super(ID, description, default_value, onUpdate); + type = TYPE.STRING; + } + + /** + * Checks whether or not a value is with this setting's valid range. + */ + @Override + protected boolean isValueValid(String value) { + return true; + } +} diff --git a/remappedSrc/net/aoba/settings/types/Vector2Setting.java b/remappedSrc/net/aoba/settings/types/Vector2Setting.java new file mode 100644 index 00000000..ec649b27 --- /dev/null +++ b/remappedSrc/net/aoba/settings/types/Vector2Setting.java @@ -0,0 +1,85 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.settings.types; + +import net.aoba.settings.Setting; +import net.aoba.utils.types.Vector2; + +import java.util.function.Consumer; + +public class Vector2Setting extends Setting { + + public Vector2Setting(String ID, String description, Vector2 default_value) { + super(ID, description, default_value); + type = TYPE.VECTOR2; + } + + public Vector2Setting(String ID, String displayName, String description, Vector2 default_value) { + super(ID, displayName, description, default_value); + type = TYPE.VECTOR2; + } + + + public Vector2Setting(String ID, String description, Vector2 default_value, Consumer onUpdate) { + super(ID, description, default_value, onUpdate); + type = TYPE.VECTOR2; + } + + /** + * Setter for the X coordinate of the Vector. + * @param x X Coordinate. + */ + public void setX(float x) { + value.x = x; + update(); + } + + /** + * Setter for the Y coordinate of the Vector. + * @param y Y Coordinate. + */ + public void setY(float y) { + value.y = y; + update(); + } + + /** + * Setter for the X coordinate of the Vector without calling the update function. + * @param x X Coordinate. + */ + public void silentSetX(float x) { + value.x = x; + } + + /** + * Setter for the Y coordinate of the Vector without calling the update function. + * @param y Y Coordinate. + */ + public void silentSetY(float y) { + value.y = y; + } + + /** + * Checks whether or not a value is with this setting's valid range. + */ + @Override + protected boolean isValueValid(Vector2 value) { + return true; + } +} diff --git a/remappedSrc/net/aoba/utils/types/Vector2.java b/remappedSrc/net/aoba/utils/types/Vector2.java new file mode 100644 index 00000000..fb398984 --- /dev/null +++ b/remappedSrc/net/aoba/utils/types/Vector2.java @@ -0,0 +1,30 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.utils.types; + +public class Vector2 { + public float x = 0; + public float y = 0; + + public Vector2() {} + public Vector2(float x, float y) { + this.x = x; + this.y = y; + } +} diff --git a/src/main/java/net/aoba/AobaClient.java b/src/main/java/net/aoba/AobaClient.java index 5cd5a928..febbecb8 100644 --- a/src/main/java/net/aoba/AobaClient.java +++ b/src/main/java/net/aoba/AobaClient.java @@ -26,6 +26,7 @@ import net.aoba.cmd.GlobalChat; import net.aoba.event.EventManager; import net.aoba.gui.GuiManager; +import net.aoba.gui.colors.ColorMode; import net.aoba.gui.font.FontManager; import net.aoba.misc.RenderUtils; import net.aoba.mixin.interfaces.IMinecraftClient; @@ -36,8 +37,8 @@ public class AobaClient { public static final String NAME = "Aoba"; - public static final String VERSION = "1.20.4"; - public static final String AOBA_VERSION = "1.4.0"; + public static final String VERSION = "1.20.5"; + public static final String AOBA_VERSION = "1.4.1"; public static MinecraftClient MC; public static IMinecraftClient IMC; @@ -92,6 +93,9 @@ public void loadAssets() { globalChat = new GlobalChat(); globalChat.StartListener(); + + //GuiManager.borderColor.setMode(ColorMode.Rainbow); + //GuiManager.foregroundColor.setMode(ColorMode.Random); } /** diff --git a/src/main/java/net/aoba/event/events/BlockStateEvent.java b/src/main/java/net/aoba/event/events/BlockStateEvent.java new file mode 100644 index 00000000..8a0a28c0 --- /dev/null +++ b/src/main/java/net/aoba/event/events/BlockStateEvent.java @@ -0,0 +1,46 @@ +package net.aoba.event.events; + +import java.util.ArrayList; +import java.util.List; +import net.aoba.event.listeners.AbstractListener; +import net.aoba.event.listeners.BlockStateListener; +import net.minecraft.block.BlockState; +import net.minecraft.util.math.BlockPos; + +public class BlockStateEvent extends AbstractEvent { + private BlockPos blockPos; + private BlockState blockState; + private BlockState previousBlockState; + + public BlockStateEvent(BlockPos blockPos, BlockState state, BlockState previousState) { + this.blockPos = blockPos; + this.blockState = state; + this.previousBlockState = previousState; + } + + public BlockPos getBlockPos() { + return this.blockPos; + } + + public BlockState getBlockState() { + return this.blockState; + } + + public BlockState getPreviousBlockState() { + return this.previousBlockState; + } + + @Override + public void Fire(ArrayList listeners) { + for(AbstractListener listener : List.copyOf(listeners)) { + BlockStateListener blockStateListener = (BlockStateListener) listener; + blockStateListener.OnBlockStateChanged(this); + } + } + + @SuppressWarnings("unchecked") + @Override + public Class GetListenerClassType() { + return BlockStateListener.class; + } +} \ No newline at end of file diff --git a/src/main/java/net/aoba/event/events/RenderEvent.java b/src/main/java/net/aoba/event/events/RenderEvent.java index 7cafc980..a0310d32 100644 --- a/src/main/java/net/aoba/event/events/RenderEvent.java +++ b/src/main/java/net/aoba/event/events/RenderEvent.java @@ -25,18 +25,18 @@ import net.minecraft.client.util.math.MatrixStack; public class RenderEvent extends AbstractEvent { - MatrixStack matrixStack; + MatrixStack matrices; float partialTicks; - public MatrixStack GetMatrixStack() { - return matrixStack; + public MatrixStack GetMatrix() { + return matrices; } public float GetPartialTicks() { return partialTicks; } - public RenderEvent(MatrixStack matrixStack, float partialTicks) { - this.matrixStack = matrixStack; + public RenderEvent(MatrixStack matrix4f, float partialTicks) { + this.matrices = matrix4f; this.partialTicks = partialTicks; } diff --git a/src/main/java/net/aoba/event/listeners/BlockStateListener.java b/src/main/java/net/aoba/event/listeners/BlockStateListener.java new file mode 100644 index 00000000..77d595ad --- /dev/null +++ b/src/main/java/net/aoba/event/listeners/BlockStateListener.java @@ -0,0 +1,9 @@ +package net.aoba.event.listeners; + +import net.aoba.event.events.BlockStateEvent; +import net.aoba.event.events.FontChangedEvent; +import net.aoba.event.events.KeyDownEvent; + +public interface BlockStateListener extends AbstractListener { + public abstract void OnBlockStateChanged(BlockStateEvent event); +} diff --git a/src/main/java/net/aoba/event/listeners/FontChangedListener.java b/src/main/java/net/aoba/event/listeners/FontChangedListener.java index 069bb826..3da06bf9 100644 --- a/src/main/java/net/aoba/event/listeners/FontChangedListener.java +++ b/src/main/java/net/aoba/event/listeners/FontChangedListener.java @@ -1,7 +1,6 @@ package net.aoba.event.listeners; import net.aoba.event.events.FontChangedEvent; -import net.aoba.event.events.KeyDownEvent; public interface FontChangedListener extends AbstractListener { public abstract void OnFontChanged(FontChangedEvent event); diff --git a/src/main/java/net/aoba/gui/GuiManager.java b/src/main/java/net/aoba/gui/GuiManager.java index 60c66107..009e09ef 100644 --- a/src/main/java/net/aoba/gui/GuiManager.java +++ b/src/main/java/net/aoba/gui/GuiManager.java @@ -25,10 +25,15 @@ import net.aoba.event.listeners.LeftMouseDownListener; import net.aoba.event.listeners.LeftMouseUpListener; import net.aoba.event.listeners.KeyDownListener; + +import org.joml.Matrix4f; import org.lwjgl.glfw.GLFW; import org.lwjgl.opengl.GL11; import net.aoba.module.Module; import net.aoba.Aoba; +import net.aoba.gui.colors.Color; +import net.aoba.gui.colors.RainbowColor; +import net.aoba.gui.colors.RandomColor; import net.aoba.gui.hud.AbstractHud; import net.aoba.gui.hud.ArmorHud; import net.aoba.gui.hud.InfoHud; @@ -37,7 +42,6 @@ import net.aoba.gui.tabs.*; import net.aoba.gui.tabs.components.ModuleComponent; import net.aoba.gui.tabs.components.StackPanelComponent; -import net.aoba.misc.RainbowColor; import net.aoba.misc.RenderUtils; import net.aoba.module.Module.Category; import net.aoba.settings.SettingManager; @@ -75,6 +79,9 @@ public class GuiManager implements LeftMouseDownListener, LeftMouseUpListener, K public static ColorSetting borderColor; public static ColorSetting backgroundColor; + public static RainbowColor rainbowColor = new RainbowColor(); + public static RandomColor randomColor = new RandomColor(); + public FloatSetting effectSpeed = new FloatSetting("color_speed", "Effect Spd", 4f, 1f, 20f, 0.1f, null); public BooleanSetting rainbow = new BooleanSetting("rainbow_mode", "Rainbow", false, null); public BooleanSetting ah = new BooleanSetting("armorhud_toggle", "ArmorHUD", false, null); @@ -230,14 +237,15 @@ public void draw(DrawContext drawContext, float tickDelta) { int guiScale = mc.getWindow().calculateScaleFactor(mc.options.getGuiScale().getValue(), mc.forcesUnicodeFont()); matrixStack.scale(1.0f / guiScale, 1.0f / guiScale, 1.0f); - + Window window = mc.getWindow(); + Matrix4f matrix = matrixStack.peek().getPositionMatrix(); /** * Render ClickGUI and Sidebar */ if (this.clickGuiOpen) { - RenderUtils.drawBox(matrixStack, 0, 0, window.getWidth(), window.getHeight(), new Color(26, 26, 26, 100)); + RenderUtils.drawBox(matrix, 0, 0, window.getWidth(), window.getHeight(), new Color(26, 26, 26, 100)); clickGuiNavBar.draw(drawContext, tickDelta); } diff --git a/src/main/java/net/aoba/gui/NavigationBar.java b/src/main/java/net/aoba/gui/NavigationBar.java index aa6b22e2..685cedbd 100644 --- a/src/main/java/net/aoba/gui/NavigationBar.java +++ b/src/main/java/net/aoba/gui/NavigationBar.java @@ -20,10 +20,14 @@ import java.util.ArrayList; import java.util.List; + +import org.joml.Matrix4f; + import net.aoba.Aoba; import net.aoba.AobaClient; import net.aoba.event.events.LeftMouseDownEvent; import net.aoba.event.listeners.LeftMouseDownListener; +import net.aoba.gui.colors.Color; import net.aoba.misc.RenderUtils; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.DrawContext; @@ -77,14 +81,13 @@ public void draw(DrawContext drawContext, float partialTicks) { int centerX = (window.getWidth() / 2); MatrixStack matrixStack = drawContext.getMatrices(); - + Matrix4f matrix = matrixStack.peek().getPositionMatrix(); int width = 100 * options.size(); - GuiManager hudManager = Aoba.getInstance().hudManager; - RenderUtils.drawRoundedBox(matrixStack, centerX - (width / 2), 25, width, 25, 6, GuiManager.backgroundColor.getValue()); - RenderUtils.drawRoundedOutline(matrixStack, centerX - (width / 2), 25, width, 25, 6, GuiManager.borderColor.getValue()); + RenderUtils.drawRoundedBox(matrix, centerX - (width / 2), 25, width, 25, 6, GuiManager.backgroundColor.getValue()); + RenderUtils.drawRoundedOutline(matrix, centerX - (width / 2), 25, width, 25, 6, GuiManager.borderColor.getValue()); - RenderUtils.drawRoundedBox(drawContext.getMatrices(), centerX - (width / 2) + (100 * this.selectedIndex), 25, 100, 25, 5, new Color(150, 150, 150, 100)); + RenderUtils.drawRoundedBox(matrix, centerX - (width / 2) + (100 * this.selectedIndex), 25, 100, 25, 5, new Color(150, 150, 150, 100)); for(int i = 0; i < options.size(); i++) { Page pane = options.get(i); diff --git a/src/main/java/net/aoba/gui/colors/Color.java b/src/main/java/net/aoba/gui/colors/Color.java new file mode 100644 index 00000000..e713625b --- /dev/null +++ b/src/main/java/net/aoba/gui/colors/Color.java @@ -0,0 +1,322 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * A class to represent Colors and their respective functions. + */ + +package net.aoba.gui.colors; + +import org.apache.commons.lang3.StringUtils; +import org.joml.Vector3f; + +public class Color { + public int r; + public int g; + public int b; + public int alpha = 255; + + public float hue; + public float saturation; + public float luminance; + + /** + * Color Constructor using RGB color space. + * + * @param r Red component of a Color. + * @param g Green component of a Color. + * @param b Blue component of a Color. + */ + public Color(int r, int g, int b) { + this.r = r; + this.g = g; + this.b = b; + + HSVFromRGB(r, g, b); + } + + public Color(int r, int g, int b, int alpha) { + this.r = r; + this.g = g; + this.b = b; + + HSVFromRGB(r, g, b); + + this.alpha = alpha; + } + + private void HSVFromRGB(int r, int g, int b) { + // Calculate HSV value + float rPrime = r / 255.0f; + float gPrime = g / 255.0f; + float bPrime = b / 255.0f; + + float cMax = Math.max(rPrime, Math.max(gPrime, bPrime)); + float cMin = Math.min(rPrime, Math.min(gPrime, bPrime)); + + float delta = cMax - cMin; + + // Calculate Hue + if(delta == 0.0f) { + hue = 0.0f; + }else { + if (cMax == rPrime) { + hue = (60.0f * (((gPrime - bPrime) / delta) % 6)); + } else if (cMax == gPrime) { + hue = (60.0f * (((bPrime - rPrime) / delta) + 2)); + } else if (cMax == bPrime) { + hue = (60.0f * (((rPrime - gPrime) / delta) + 2)); + } + } + + // Calculate Saturation + if (cMax == 0.0f) + saturation = 0.0f; + else + saturation = delta / cMax; + + // Calculate Luminance + luminance = cMax; + } + + /** + * Color Constructor using HSV color space. + * + * @param hue + * @param saturation + * @param luminance + */ + public Color(float hue, float saturation, float luminance) { + this.setHSV(hue, saturation, luminance); + } + + /** + * Sets the RGB and HSV fields using inputs from an HSV color space. + * + * @param hue The hue of the HSV color space. + * @param saturation The saturation of the HSV color space. + * @param value + */ + public void setHSV(float hue, float saturation, float luminance) { + this.hue = hue; + this.saturation = saturation; + this.luminance = luminance; + Color vec = hsv2rgb(hue, saturation, luminance); + if(vec != null) { + this.r = vec.r; + this.g = vec.g; + this.b = vec.b; + } + } + + /** + * Sets the RGB fields using inputs from an RGB color space. + * + * @param r Red component of a Color. + * @param g Green component of a Color. + * @param b Blue component of a Color. + */ + public void setRGB(int r, int g, int b) { + this.r = r; + this.g = g; + this.b = b; + } + + public void setRGBA(int r, int g, int b, int alpha) { + this.r = r; + this.g = b; + this.b = b; + this.alpha = alpha; + } + + public void setAlpha(int alpha) { + this.alpha = alpha; + } + + /** + * Returns the Color as a string in format RRRGGGBBB. + * + * @return + */ + public String getColorAsString() { + String rs = Integer.toString((int) (r)); + String gs = Integer.toString((int) (g)); + String bs = Integer.toString((int) (b)); + return rs + gs + bs; + } + + /** + * Returns the color as an Integer for Minecraft Rendering. + * + * @return The color as an integer. + */ + public int getColorAsInt() { + // Perform shifts and Bitwise AND to get color value in integer format. + int Alpha = ((this.alpha) << 24) & 0xFF000000; + int R = ((this.r) << 16) & 0x00FF0000; + int G = ((this.g) << 8) & 0x0000FF00; + int B = (this.b) & 0x000000FF; + // Return the color as a combination of these values. + return Alpha | R | G | B; + } + + /** + * Returns the color as a string in Hex format. + * + * @return The color represented as Hex. + */ + public String getColorAsHex() { + return String.format("#%06X", this.getColorAsInt()); + } + + /** + * Gets the Red component as a float. + * + * @return Red component as a float. + */ + public float getRedFloat() { + return ((float) this.r) / 255.0f; + } + + /** + * Gets the Green component as a float. + * + * @return Green component as a float. + */ + public float getGreenFloat() { + return ((float) this.g) / 255.0f; + } + + /** + * Gets the Blue component as a float. + * + * @return Blue component as a float. + */ + public float getBlueFloat() { + return ((float) this.b) / 255.0f; + } + + public float getAlphaFloat() { + return ((float) this.alpha) / 255.0f; + } + + /** + * Converts RGB codes to a String. + * + * @param r Red component. + * @param g Green component. + * @param b Blue component. + * @return Color as a String. + */ + public static String rgbToString(int r, int g, int b) { + String rs = Integer.toString((int) (r)); + String gs = Integer.toString((int) (g)); + String bs = Integer.toString((int) (b)); + return rs + gs + bs; + } + + /** + * Converts RGB codes to an Integer. + * + * @param r Red component. + * @param g Green component. + * @param b Blue component. + * @return Color as an Integer. + */ + public static int rgbToInt(int r, int g, int b) { + String rs = Integer.toString((int) (r)); + String gs = Integer.toString((int) (g)); + String bs = Integer.toString((int) (b)); + return Integer.parseInt(rs + gs + bs); + } + + /** + * Converts RGB codes to Hex. + * + * @param r Red component. + * @param g Green component. + * @param b Blue component. + * @return Color as Hex. + */ + public static int convertRGBToHex(int r, int g, int b) { + String strr = StringUtils.leftPad(Integer.toHexString(r), 2, '0'); + String strg = StringUtils.leftPad(Integer.toHexString(g), 2, '0'); + String strb = StringUtils.leftPad(Integer.toHexString(b), 2, '0'); + String string = strr + strg + strb; + return Integer.parseInt(string, 16); + } + + /** + * Converts Hex codes to RGB. + * + * @param hex Color as Hex. + * @return Color from Hex Code. + */ + public static Color convertHextoRGB(String hex) { + String RString = hex.charAt(1) + "" + hex.charAt(2); + String GString = hex.charAt(3) + "" + hex.charAt(4); + String BString = hex.charAt(5) + "" + hex.charAt(6); + + float r = Integer.valueOf(RString, 16); + float g = Integer.valueOf(GString, 16); + float b = Integer.valueOf(BString, 16); + return new Color(r, g, b); + } + + /** + * Converts HSV into RGB color space. + * + * @param hue The hue of the HSV color space. + * @param saturation The saturation of the HSV color space. + * @param luminance The luminance of the HSV color space. + * @return The color represented by HSV. + */ + public static Color hsv2rgb(float hue, float saturation, float luminance) { + // Get the side that the colour is contained in. + float h = (hue / 60); + float chroma = luminance * saturation; + float x = chroma * (1 - Math.abs((h % 2) - 1)); + + // Depending on the side, set the Chroma component to the correct Color. + Vector3f rgbVec; + if (h >= 0 && h <= 1) { + rgbVec = new Vector3f(chroma, x, 0); + } else if (h >= 1 && h <= 2) { + rgbVec = new Vector3f(x, chroma, 0); + } else if (h >= 2 && h <= 3) { + rgbVec = new Vector3f(0, chroma, x); + } else if (h >= 3 && h <= 4) { + rgbVec = new Vector3f(0, x, chroma); + } else if (h >= 4 && h <= 5) { + rgbVec = new Vector3f(x, 0, chroma); + } else if (h >= 5 && h <= 6) { + rgbVec = new Vector3f(chroma, 0, x); + } else { + rgbVec = null; + } + + // If the Color does exist, add luminance and convert to RGB. + if (rgbVec != null) { + float m = luminance - chroma; + return new Color((int) (255.0f * (rgbVec.x + m)), (int) (255.0f * (rgbVec.y + m)), + (int) (255.0f * (rgbVec.z + m))); + } + return null; + } + +} diff --git a/src/main/java/net/aoba/gui/colors/ColorMode.java b/src/main/java/net/aoba/gui/colors/ColorMode.java new file mode 100644 index 00000000..8e26f483 --- /dev/null +++ b/src/main/java/net/aoba/gui/colors/ColorMode.java @@ -0,0 +1,7 @@ +package net.aoba.gui.colors; + +public enum ColorMode { + Normal, + Rainbow, + Random, +} \ No newline at end of file diff --git a/src/main/java/net/aoba/gui/colors/Colors.java b/src/main/java/net/aoba/gui/colors/Colors.java new file mode 100644 index 00000000..a31bb16d --- /dev/null +++ b/src/main/java/net/aoba/gui/colors/Colors.java @@ -0,0 +1,34 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.gui.colors; + +public class Colors { + public static final Color Red = new Color(255, 0, 0); + public static final Color Orange = new Color(255, 165, 0); + public static final Color Yellow = new Color(255, 255, 0); + public static final Color Green = new Color(0, 255, 0); + public static final Color Cyan = new Color(0, 255, 255); + public static final Color Blue = new Color(0, 0, 255); + public static final Color Purple = new Color(255, 0, 255); + public static final Color Pink = new Color(255, 192, 203); + public static final Color Black = new Color(0, 0, 0); + public static final Color Charcoal = new Color(54, 69, 79); + public static final Color Gray = new Color(127, 127, 127); + public static final Color White = new Color(255, 255, 255); +} diff --git a/src/main/java/net/aoba/gui/colors/RainbowColor.java b/src/main/java/net/aoba/gui/colors/RainbowColor.java new file mode 100644 index 00000000..dccde131 --- /dev/null +++ b/src/main/java/net/aoba/gui/colors/RainbowColor.java @@ -0,0 +1,38 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * A class to represent a Color that iterates. + */ +package net.aoba.gui.colors; + +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; + +public class RainbowColor extends Color implements TickListener { + public RainbowColor() { + super(255, 0, 0); + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void OnUpdate(TickEvent event) { + this.setHSV(((this.hue + 1f) % 361), 1f, 1f); + } +} diff --git a/src/main/java/net/aoba/gui/colors/RandomColor.java b/src/main/java/net/aoba/gui/colors/RandomColor.java new file mode 100644 index 00000000..44fe86ee --- /dev/null +++ b/src/main/java/net/aoba/gui/colors/RandomColor.java @@ -0,0 +1,17 @@ +package net.aoba.gui.colors; + +import net.aoba.Aoba; +import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.TickListener; + +public class RandomColor extends Color implements TickListener { + public RandomColor() { + super(0, 0, 0); + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + + @Override + public void OnUpdate(TickEvent event) { + this.setHSV(((float)(Math.random() * 360f)), 1f, 1f); + } +} diff --git a/src/main/java/net/aoba/gui/font/FontManager.java b/src/main/java/net/aoba/gui/font/FontManager.java index 4426be5f..aad89b98 100644 --- a/src/main/java/net/aoba/gui/font/FontManager.java +++ b/src/main/java/net/aoba/gui/font/FontManager.java @@ -28,10 +28,16 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Set; + +import org.lwjgl.PointerBuffer; import org.lwjgl.stb.STBTTFontinfo; import org.lwjgl.stb.STBTruetype; +import org.lwjgl.system.MemoryStack; import org.lwjgl.system.MemoryUtil; import org.lwjgl.system.Struct; +import org.lwjgl.util.freetype.FT_Face; +import org.lwjgl.util.freetype.FreeType; import net.aoba.Aoba; import net.aoba.event.events.FontChangedEvent; @@ -39,7 +45,9 @@ import net.aoba.settings.types.StringSetting; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.Font; +import net.minecraft.client.font.FontFilterType.FilterMap; import net.minecraft.client.font.FontStorage; +import net.minecraft.client.font.FreeTypeUtil; import net.minecraft.client.font.TextRenderer; import net.minecraft.client.font.TrueTypeFont; import net.minecraft.client.font.TrueTypeFontLoader; @@ -79,17 +87,17 @@ public boolean accept(File dir, String name) { }); for (File file : files) { - List list = new ArrayList(); + List list = new ArrayList(); try { Font font = LoadTTFFont(file, 12.5f, 2, new TrueTypeFontLoader.Shift(-1, 0), ""); - list.add(font); + list.add(new Font.FontFilterPair(font, FilterMap.NO_FILTER)); } catch (Exception e) { e.printStackTrace(); } FontStorage storage = new FontStorage(MC.getTextureManager(), new Identifier("aoba:" + file.getName())); - storage.setFonts(list); + storage.setFonts(list, Set.of()); fontRenderers.put(file.getName().replace(".ttf", ""), new TextRenderer(id -> storage, true)); } } @@ -112,7 +120,7 @@ public void SetRenderer(TextRenderer renderer) { private static Font LoadTTFFont(File location, float size, float oversample, Shift shift, String skip) throws IOException { TrueTypeFont trueTypeFont = null; - Struct sTBTTFontinfo = null; + STBTTFontinfo sTBTTFontinfo = null; ByteBuffer byteBuffer = null; InputStream inputStream = new FileInputStream(location); @@ -123,12 +131,19 @@ private static Font LoadTTFFont(File location, float size, float oversample, Shi byteBuffer.put(test, 0, test.length); byteBuffer.flip(); - if (!STBTruetype.stbtt_InitFont((STBTTFontinfo) sTBTTFontinfo, byteBuffer)) { - inputStream.close(); - throw new IOException("Invalid ttf"); - } - trueTypeFont = new TrueTypeFont(byteBuffer, (STBTTFontinfo) sTBTTFontinfo, size, oversample, shift.x(), - shift.y(), skip); + MemoryStack memoryStack = MemoryStack.stackPush(); + PointerBuffer pointerBuffer = memoryStack.mallocPointer(1); + FreeTypeUtil.checkFatalError(FreeType.FT_New_Memory_Face(FreeTypeUtil.initialize(), byteBuffer, 0L, pointerBuffer), "Initializing font face"); + FT_Face fT_Face = FT_Face.create(pointerBuffer.get()); + + String string = FreeType.FT_Get_Font_Format(fT_Face); + if (!"TrueType".equals(string)) { + throw new IOException("Font is not in TTF format, was " + string); + } + FreeTypeUtil.checkFatalError(FreeType.FT_Select_Charmap(fT_Face, FreeType.FT_ENCODING_UNICODE), "Find unicode charmap"); + trueTypeFont = new TrueTypeFont(byteBuffer, fT_Face, size, oversample, shift.x(), + shift.y(), skip); + } catch (Throwable throwable) { try { if (inputStream != null) { diff --git a/src/main/java/net/aoba/gui/hud/AbstractHud.java b/src/main/java/net/aoba/gui/hud/AbstractHud.java index 2dfc42f8..e13ce6c3 100644 --- a/src/main/java/net/aoba/gui/hud/AbstractHud.java +++ b/src/main/java/net/aoba/gui/hud/AbstractHud.java @@ -20,7 +20,7 @@ import net.aoba.Aoba; import net.aoba.gui.AbstractGui; -import net.aoba.gui.Color; +import net.aoba.gui.colors.Color; import net.aoba.settings.SettingManager; import net.aoba.settings.types.BooleanSetting; import net.minecraft.client.gui.DrawContext; diff --git a/src/main/java/net/aoba/gui/hud/InfoHud.java b/src/main/java/net/aoba/gui/hud/InfoHud.java index f1c13264..ef044c3a 100644 --- a/src/main/java/net/aoba/gui/hud/InfoHud.java +++ b/src/main/java/net/aoba/gui/hud/InfoHud.java @@ -17,6 +17,8 @@ */ package net.aoba.gui.hud; +import org.joml.Matrix4f; + import net.aoba.gui.GuiManager; import net.aoba.misc.RenderUtils; import net.aoba.utils.types.Vector2; @@ -74,12 +76,13 @@ public void update() { public void draw(DrawContext drawContext, float partialTicks) { if(this.visible) { MatrixStack matrixStack = drawContext.getMatrices(); - // Draws background depending on components width and height + Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); + // Draws background depending on components width and height Vector2 pos = position.getValue(); - RenderUtils.drawRoundedBox(matrixStack, pos.x, pos.y, width, height, 6, GuiManager.backgroundColor.getValue()); - RenderUtils.drawRoundedOutline(matrixStack, pos.x, pos.y, width, height, 6, GuiManager.borderColor.getValue()); + RenderUtils.drawRoundedBox(matrix4f, pos.x, pos.y, width, height, 6, GuiManager.backgroundColor.getValue()); + RenderUtils.drawRoundedOutline(matrix4f, pos.x, pos.y, width, height, 6, GuiManager.borderColor.getValue()); RenderUtils.drawString(drawContext, positionText, pos.x + 5, pos.y + 4, GuiManager.foregroundColor.getValue()); RenderUtils.drawString(drawContext, timeText, pos.x + 5, pos.y + 24, GuiManager.foregroundColor.getValue()); diff --git a/src/main/java/net/aoba/gui/hud/ModuleSelectorHud.java b/src/main/java/net/aoba/gui/hud/ModuleSelectorHud.java index eb488e2b..1026d338 100644 --- a/src/main/java/net/aoba/gui/hud/ModuleSelectorHud.java +++ b/src/main/java/net/aoba/gui/hud/ModuleSelectorHud.java @@ -18,11 +18,13 @@ package net.aoba.gui.hud; import java.util.ArrayList; + +import org.joml.Matrix4f; import org.lwjgl.glfw.GLFW; import net.aoba.Aoba; import net.aoba.AobaClient; -import net.aoba.gui.Color; import net.aoba.gui.GuiManager; +import net.aoba.gui.colors.Color; import net.aoba.misc.RenderUtils; import net.aoba.module.Module; import net.aoba.module.Module.Category; @@ -116,6 +118,7 @@ public void draw(DrawContext drawContext, float partialTicks) { // Gets the client and window. MinecraftClient mc = MinecraftClient.getInstance(); MatrixStack matrixStack = drawContext.getMatrices(); + Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); Window window = mc.getWindow(); Vector2 pos = position.getValue(); @@ -124,9 +127,8 @@ public void draw(DrawContext drawContext, float partialTicks) { RenderUtils.drawString(drawContext, "Aoba " + AobaClient.VERSION, 8, 8, GuiManager.foregroundColor.getValue()); // Draws the table including all of the categories. - GuiManager hudManager = Aoba.getInstance().hudManager; - RenderUtils.drawRoundedBox(matrixStack, pos.x, pos.y, width, height * this.categories.length, 6f, GuiManager.backgroundColor.getValue()); - RenderUtils.drawRoundedOutline(matrixStack, pos.x, pos.y, width, height * this.categories.length, 6f, GuiManager.borderColor.getValue()); + RenderUtils.drawRoundedBox(matrix4f, pos.x, pos.y, width, height * this.categories.length, 6f, GuiManager.backgroundColor.getValue()); + RenderUtils.drawRoundedOutline(matrix4f, pos.x, pos.y, width, height * this.categories.length, 6f, GuiManager.borderColor.getValue()); // For every category, draw a cell for it. for (int i = 0; i < this.categories.length; i++) { @@ -142,8 +144,8 @@ public void draw(DrawContext drawContext, float partialTicks) { // If any particular category menu is open. if (isCategoryMenuOpen) { // Draw the table underneath - RenderUtils.drawRoundedBox(matrixStack, pos.x + width, pos.y + (height * this.index), 165, height * modules.size(), 6f, GuiManager.backgroundColor.getValue()); - RenderUtils.drawRoundedOutline(matrixStack, pos.x + width, pos.y + (height * this.index), 165, height * modules.size(), 6f, GuiManager.borderColor.getValue()); + RenderUtils.drawRoundedBox(matrix4f, pos.x + width, pos.y + (height * this.index), 165, height * modules.size(), 6f, GuiManager.backgroundColor.getValue()); + RenderUtils.drawRoundedOutline(matrix4f, pos.x + width, pos.y + (height * this.index), 165, height * modules.size(), 6f, GuiManager.borderColor.getValue()); // For every mod, draw a cell for it. for (int i = 0; i < modules.size(); i++) { diff --git a/src/main/java/net/aoba/gui/hud/RadarHud.java b/src/main/java/net/aoba/gui/hud/RadarHud.java index 9212ea50..0af3ecbe 100644 --- a/src/main/java/net/aoba/gui/hud/RadarHud.java +++ b/src/main/java/net/aoba/gui/hud/RadarHud.java @@ -17,9 +17,11 @@ */ package net.aoba.gui.hud; +import org.joml.Matrix4f; + import net.aoba.Aoba; -import net.aoba.gui.Color; import net.aoba.gui.GuiManager; +import net.aoba.gui.colors.Color; import net.aoba.misc.RenderUtils; import net.aoba.utils.types.Vector2; import net.minecraft.client.gui.DrawContext; @@ -42,18 +44,19 @@ public RadarHud( int x, int y, int width, int height) { public void draw(DrawContext drawContext, float partialTicks) { if(this.visible) { MatrixStack matrixStack = drawContext.getMatrices(); + Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); Vector2 pos = position.getValue(); // Draws background depending on components width and height GuiManager hudManager = Aoba.getInstance().hudManager; - RenderUtils.drawRoundedBox(matrixStack, pos.x, pos.y, width, height, 6, GuiManager.backgroundColor.getValue()); - RenderUtils.drawRoundedOutline(matrixStack, pos.x, pos.y, width, height, 6, GuiManager.borderColor.getValue()); + RenderUtils.drawRoundedBox(matrix4f, pos.x, pos.y, width, height, 6, GuiManager.backgroundColor.getValue()); + RenderUtils.drawRoundedOutline(matrix4f, pos.x, pos.y, width, height, 6, GuiManager.borderColor.getValue()); // Draw the 'Radar' - RenderUtils.drawBox(matrixStack, pos.x , pos.y + (height / 2), width - 1, 1, new Color(128,128,128, 255)); - RenderUtils.drawBox(matrixStack, pos.x + (width / 2), pos.y, 1, height, new Color(128,128,128, 255)); - RenderUtils.drawBox(matrixStack, pos.x + (width / 2) - 2, pos.y + (height / 2) - 2, 5, 5, GuiManager.foregroundColor.getValue()); + RenderUtils.drawBox(matrix4f, pos.x , pos.y + (height / 2), width - 1, 1, new Color(128,128,128, 255)); + RenderUtils.drawBox(matrix4f, pos.x + (width / 2), pos.y, 1, height, new Color(128,128,128, 255)); + RenderUtils.drawBox(matrix4f, pos.x + (width / 2) - 2, pos.y + (height / 2) - 2, 5, 5, GuiManager.foregroundColor.getValue()); float sin_theta = (float) Math.sin(Math.toRadians(-mc.player.getRotationClient().y)); float cos_theta = (float) Math.cos(Math.toRadians(-mc.player.getRotationClient().y)); @@ -85,7 +88,7 @@ public void draw(DrawContext drawContext, float partialTicks) { float radius_x = (float)((cos_theta * (fake_x - center_x)) - (sin_theta * (fake_y - center_y))) + center_x; float radius_y = (float)((sin_theta * (fake_x - center_x)) + (cos_theta * (fake_y - center_y))) + center_y; - RenderUtils.drawBox(matrixStack, (int)(Math.min(pos.x + width - 5, Math.max(pos.x, radius_x))) , (int)(Math.min(pos.y - 5 + height, Math.max(pos.y, radius_y))), 3, 3, c); + RenderUtils.drawBox(matrix4f, (int)(Math.min(pos.x + width - 5, Math.max(pos.x, radius_x))) , (int)(Math.min(pos.y - 5 + height, Math.max(pos.y, radius_y))), 3, 3, c); } // Render Players @@ -100,7 +103,7 @@ public void draw(DrawContext drawContext, float partialTicks) { float radius_x = (float)((cos_theta * (fake_x - center_x)) - (sin_theta * (fake_y - center_y))) + center_x; float radius_y = (float)((sin_theta * (fake_x - center_x)) + (cos_theta * (fake_y - center_y))) + center_y; - RenderUtils.drawBox(matrixStack, (int)(Math.min(pos.x + width - 5, Math.max(pos.x, radius_x))), (int)(Math.min(pos.y + 25 + height, Math.max(pos.y, radius_y))), 3, 3, new Color(255, 255, 255, 255)); + RenderUtils.drawBox(matrix4f, (int)(Math.min(pos.x + width - 5, Math.max(pos.x, radius_x))), (int)(Math.min(pos.y + 25 + height, Math.max(pos.y, radius_y))), 3, 3, new Color(255, 255, 255, 255)); RenderUtils.drawStringWithScale(drawContext, entity.getName().getString(), (int)(Math.min(pos.x + width - 5, Math.max(pos.x, radius_x))) - (mc.textRenderer.getWidth(entity.getName()) * 0.5f), (int)(Math.min(pos.y + 25 + height, Math.max(pos.y, radius_y))) - 10, GuiManager.foregroundColor.getValue(), 1.0f); } } diff --git a/src/main/java/net/aoba/gui/tabs/ClickGuiTab.java b/src/main/java/net/aoba/gui/tabs/ClickGuiTab.java index 858e1ff8..84653ae4 100644 --- a/src/main/java/net/aoba/gui/tabs/ClickGuiTab.java +++ b/src/main/java/net/aoba/gui/tabs/ClickGuiTab.java @@ -22,13 +22,15 @@ package net.aoba.gui.tabs; +import org.joml.Matrix4f; + import net.aoba.Aoba; import net.aoba.event.events.LeftMouseDownEvent; import net.aoba.event.listeners.LeftMouseDownListener; import net.aoba.event.listeners.MouseMoveListener; import net.aoba.gui.AbstractGui; -import net.aoba.gui.Color; import net.aoba.gui.GuiManager; +import net.aoba.gui.colors.Color; import net.aoba.gui.tabs.components.Component; import net.aoba.misc.RenderUtils; import net.aoba.settings.SettingManager; @@ -119,30 +121,30 @@ public void postupdate() { @Override public void draw(DrawContext drawContext, float partialTicks) { MatrixStack matrixStack = drawContext.getMatrices(); + Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); Vector2 pos = position.getValue(); - if (drawBorder) { // Draws background depending on components width and height - RenderUtils.drawRoundedBox(matrixStack, pos.x, pos.y, width, height + 30, 6, GuiManager.backgroundColor.getValue()); - RenderUtils.drawRoundedOutline(matrixStack, pos.x, pos.y, width, height + 30, 6, GuiManager.borderColor.getValue()); + RenderUtils.drawRoundedBox(matrix4f, pos.x, pos.y, width, height + 30, 6, GuiManager.backgroundColor.getValue()); + RenderUtils.drawRoundedOutline(matrix4f, pos.x, pos.y, width, height + 30, 6, GuiManager.borderColor.getValue()); if(icon != null) { - RenderUtils.drawTexturedQuad(drawContext, icon, pos.x + 8, pos.y + 4, 22, 22, GuiManager.foregroundColor.getValue()); + RenderUtils.drawTexturedQuad(matrix4f, icon, pos.x + 8, pos.y + 4, 22, 22, GuiManager.foregroundColor.getValue()); RenderUtils.drawString(drawContext, this.title, pos.x + 38, pos.y + 8, GuiManager.foregroundColor.getValue()); }else RenderUtils.drawString(drawContext, this.title, pos.x + 8, pos.y + 8, GuiManager.foregroundColor.getValue()); - RenderUtils.drawLine(matrixStack, pos.x, pos.y + 30, pos.x + width, pos.y + 30, new Color(0, 0, 0, 100)); + RenderUtils.drawLine(matrix4f, pos.x, pos.y + 30, pos.x + width, pos.y + 30, new Color(0, 0, 0, 100)); if (this.pinnable) { if (this.isPinned.getValue()) { - RenderUtils.drawRoundedBox(matrixStack, pos.x + width - 23, pos.y + 8, 15, 15, 6f, new Color(154, 0, 0, 200)); - RenderUtils.drawRoundedOutline(matrixStack, pos.x + width - 23, pos.y + 8, 15, 15, 6f, new Color(0, 0, 0, 200)); + RenderUtils.drawRoundedBox(matrix4f, pos.x + width - 23, pos.y + 8, 15, 15, 6f, new Color(154, 0, 0, 200)); + RenderUtils.drawRoundedOutline(matrix4f, pos.x + width - 23, pos.y + 8, 15, 15, 6f, new Color(0, 0, 0, 200)); } else { - RenderUtils.drawRoundedBox(matrixStack, pos.x + width - 23, pos.y + 8, 15, 15, 6f, new Color(128, 128, 128, 50)); - RenderUtils.drawRoundedOutline(matrixStack, pos.x + width - 23, pos.y + 8, 15, 15, 6f, new Color(0, 0, 0, 50)); + RenderUtils.drawRoundedBox(matrix4f, pos.x + width - 23, pos.y + 8, 15, 15, 6f, new Color(128, 128, 128, 50)); + RenderUtils.drawRoundedOutline(matrix4f, pos.x + width - 23, pos.y + 8, 15, 15, 6f, new Color(0, 0, 0, 50)); } } } diff --git a/src/main/java/net/aoba/gui/tabs/HudsTab.java b/src/main/java/net/aoba/gui/tabs/HudsTab.java index ad7dfade..6b949c39 100644 --- a/src/main/java/net/aoba/gui/tabs/HudsTab.java +++ b/src/main/java/net/aoba/gui/tabs/HudsTab.java @@ -26,8 +26,8 @@ import net.aoba.Aoba; import net.aoba.event.events.MouseScrollEvent; import net.aoba.event.listeners.MouseScrollListener; -import net.aoba.gui.Color; import net.aoba.gui.GuiManager; +import net.aoba.gui.colors.Color; import net.aoba.gui.font.FontManager; import net.aoba.gui.hud.AbstractHud; import net.aoba.gui.tabs.components.ColorPickerComponent; diff --git a/src/main/java/net/aoba/gui/tabs/ModuleSettingsTab.java b/src/main/java/net/aoba/gui/tabs/ModuleSettingsTab.java index a6dfb889..a157caad 100644 --- a/src/main/java/net/aoba/gui/tabs/ModuleSettingsTab.java +++ b/src/main/java/net/aoba/gui/tabs/ModuleSettingsTab.java @@ -18,13 +18,15 @@ package net.aoba.gui.tabs; +import org.joml.Matrix4f; + import net.aoba.Aoba; import net.aoba.event.events.LeftMouseDownEvent; import net.aoba.event.listeners.LeftMouseDownListener; import net.aoba.event.listeners.MouseMoveListener; import net.aoba.gui.AbstractGui; -import net.aoba.gui.Color; import net.aoba.gui.GuiManager; +import net.aoba.gui.colors.Color; import net.aoba.gui.tabs.components.BlocksComponent; import net.aoba.gui.tabs.components.CheckboxComponent; import net.aoba.gui.tabs.components.ColorPickerComponent; @@ -126,19 +128,19 @@ public void postupdate() { @Override public void draw(DrawContext drawContext, float partialTicks) { MatrixStack matrixStack = drawContext.getMatrices(); - + Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); + Vector2 pos = position.getValue(); // Draws background depending on components width and height - GuiManager hudManager = Aoba.getInstance().hudManager; - RenderUtils.drawRoundedBox(matrixStack, pos.x, pos.y, width, height + 30, 6, GuiManager.backgroundColor.getValue()); - RenderUtils.drawRoundedOutline(matrixStack, pos.x, pos.y, width, height + 30, 6, GuiManager.borderColor.getValue()); + RenderUtils.drawRoundedBox(matrix4f, pos.x, pos.y, width, height + 30, 6, GuiManager.backgroundColor.getValue()); + RenderUtils.drawRoundedOutline(matrix4f, pos.x, pos.y, width, height + 30, 6, GuiManager.borderColor.getValue()); RenderUtils.drawString(drawContext, this.title, pos.x + 8, pos.y + 8, GuiManager.foregroundColor.getValue()); - RenderUtils.drawLine(matrixStack, pos.x, pos.y + 30, pos.x + width, pos.y + 30, new Color(0, 0, 0, 100)); + RenderUtils.drawLine(matrix4f, pos.x, pos.y + 30, pos.x + width, pos.y + 30, new Color(0, 0, 0, 100)); - RenderUtils.drawLine(matrixStack, pos.x + width - 23, pos.y + 8, pos.x + width - 8, pos.y + 23, new Color(255, 0, 0, 255)); - RenderUtils.drawLine(matrixStack, pos.x + width - 23, pos.y + 23, pos.x + width - 8, pos.y + 8, new Color(255, 0, 0, 255)); + RenderUtils.drawLine(matrix4f, pos.x + width - 23, pos.y + 8, pos.x + width - 8, pos.y + 23, new Color(255, 0, 0, 255)); + RenderUtils.drawLine(matrix4f, pos.x + width - 23, pos.y + 23, pos.x + width - 8, pos.y + 8, new Color(255, 0, 0, 255)); for (Component child : children) { child.draw(drawContext, partialTicks); diff --git a/src/main/java/net/aoba/gui/tabs/OptionsTab.java b/src/main/java/net/aoba/gui/tabs/OptionsTab.java index 76b824c2..0256ae84 100644 --- a/src/main/java/net/aoba/gui/tabs/OptionsTab.java +++ b/src/main/java/net/aoba/gui/tabs/OptionsTab.java @@ -19,12 +19,15 @@ package net.aoba.gui.tabs; import java.util.ArrayList; + +import org.joml.Matrix4f; + import net.aoba.Aoba; import net.aoba.event.events.MouseScrollEvent; import net.aoba.event.listeners.MouseScrollListener; import net.aoba.gui.AbstractGui; -import net.aoba.gui.Color; import net.aoba.gui.GuiManager; +import net.aoba.gui.colors.Color; import net.aoba.misc.RenderUtils; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.util.Window; @@ -54,12 +57,13 @@ public void update() { @Override public void draw(DrawContext drawContext, float partialTicks) { MatrixStack matrixStack = drawContext.getMatrices(); - + Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); + Vector2 pos = position.getValue(); - RenderUtils.drawRoundedBox(matrixStack, pos.x, pos.y, width, height, 6, GuiManager.backgroundColor.getValue()); - RenderUtils.drawRoundedOutline(matrixStack, pos.x, pos.y, width, height, 6, GuiManager.borderColor.getValue()); - RenderUtils.drawLine(matrixStack, pos.x + 480, pos.y, pos.x + 480, pos.y + height, new Color(0, 0, 0, 200)); + RenderUtils.drawRoundedBox(matrix4f, pos.x, pos.y, width, height, 6, GuiManager.backgroundColor.getValue()); + RenderUtils.drawRoundedOutline(matrix4f, pos.x, pos.y, width, height, 6, GuiManager.borderColor.getValue()); + RenderUtils.drawLine(matrix4f, pos.x + 480, pos.y, pos.x + 480, pos.y + height, new Color(0, 0, 0, 200)); ArrayList modules = Aoba.getInstance().moduleManager.modules; diff --git a/src/main/java/net/aoba/gui/tabs/components/BlocksComponent.java b/src/main/java/net/aoba/gui/tabs/components/BlocksComponent.java index 4a9bf57b..94138cb7 100644 --- a/src/main/java/net/aoba/gui/tabs/components/BlocksComponent.java +++ b/src/main/java/net/aoba/gui/tabs/components/BlocksComponent.java @@ -18,14 +18,16 @@ package net.aoba.gui.tabs.components; +import org.joml.Matrix4f; + import net.aoba.Aoba; import net.aoba.event.events.LeftMouseDownEvent; import net.aoba.event.events.MouseScrollEvent; import net.aoba.event.listeners.LeftMouseDownListener; import net.aoba.event.listeners.MouseScrollListener; -import net.aoba.gui.Color; import net.aoba.gui.GuiManager; import net.aoba.gui.IGuiElement; +import net.aoba.gui.colors.Color; import net.aoba.misc.RenderUtils; import net.aoba.settings.types.BlocksSetting; import net.minecraft.block.Block; @@ -73,11 +75,13 @@ public BlocksComponent(IGuiElement parent, BlocksSetting setting) { */ @Override public void draw(DrawContext drawContext, float partialTicks) { + MatrixStack matrixStack = drawContext.getMatrices(); + Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); + RenderUtils.drawString(drawContext, text, actualX + 6, actualY + 6, 0xFFFFFF); RenderUtils.drawString(drawContext, collapsed ? ">>" : "<<", (actualX + actualWidth - 24), actualY + 6, GuiManager.foregroundColor.getValue().getColorAsInt()); if(!collapsed) { - MatrixStack matrixStack = drawContext.getMatrices(); matrixStack.push(); matrixStack.scale(2.0f, 2.0f, 2.0f); for(int i = scroll; i < visibleRows + scroll; i++) { @@ -89,7 +93,7 @@ public void draw(DrawContext drawContext, float partialTicks) { Block block = Registries.BLOCK.get(index); if(blocks.getValue().contains(block)) { - RenderUtils.drawBox(matrixStack, ((actualX + (j * 36) + 4) / 2.0f), ((actualY + ((i-scroll) * 36) + 25) / 2.0f), 16, 16, new Color(0, 255, 0, 55)); + RenderUtils.drawBox(matrix4f, ((actualX + (j * 36) + 4) / 2.0f), ((actualY + ((i-scroll) * 36) + 25) / 2.0f), 16, 16, new Color(0, 255, 0, 55)); } drawContext.drawItem(new ItemStack(block.asItem()), (int) ((actualX + (j * 36) + 6) / 2.0f), (int) ((actualY + ((i-scroll) * 36) + 25) / 2.0f) ); } diff --git a/src/main/java/net/aoba/gui/tabs/components/ButtonComponent.java b/src/main/java/net/aoba/gui/tabs/components/ButtonComponent.java index 8dc068a4..6bef6d8a 100644 --- a/src/main/java/net/aoba/gui/tabs/components/ButtonComponent.java +++ b/src/main/java/net/aoba/gui/tabs/components/ButtonComponent.java @@ -18,11 +18,13 @@ package net.aoba.gui.tabs.components; +import org.joml.Matrix4f; + import net.aoba.Aoba; import net.aoba.event.events.LeftMouseDownEvent; import net.aoba.event.listeners.LeftMouseDownListener; -import net.aoba.gui.Color; import net.aoba.gui.IGuiElement; +import net.aoba.gui.colors.Color; import net.aoba.misc.RenderUtils; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.util.math.MatrixStack; @@ -99,7 +101,8 @@ public void setBackgroundColor(Color color) { @Override public void draw(DrawContext drawContext, float partialTicks) { MatrixStack matrixStack = drawContext.getMatrices(); - RenderUtils.drawOutlinedBox(matrixStack, actualX + 2, actualY, actualWidth - 4, actualHeight - 2, borderColor, backgroundColor); + Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); + RenderUtils.drawOutlinedBox(matrix4f, actualX + 2, actualY, actualWidth - 4, actualHeight - 2, borderColor, backgroundColor); RenderUtils.drawString(drawContext, this.text, actualX + 8, actualY + 8, 0xFFFFFF); } diff --git a/src/main/java/net/aoba/gui/tabs/components/CheckboxComponent.java b/src/main/java/net/aoba/gui/tabs/components/CheckboxComponent.java index 5b6414fc..403d5300 100644 --- a/src/main/java/net/aoba/gui/tabs/components/CheckboxComponent.java +++ b/src/main/java/net/aoba/gui/tabs/components/CheckboxComponent.java @@ -18,12 +18,14 @@ package net.aoba.gui.tabs.components; +import org.joml.Matrix4f; + import net.aoba.Aoba; import net.aoba.event.events.LeftMouseDownEvent; import net.aoba.event.listeners.LeftMouseDownListener; -import net.aoba.gui.Color; import net.aoba.gui.GuiManager; import net.aoba.gui.IGuiElement; +import net.aoba.gui.colors.Color; import net.aoba.misc.RenderUtils; import net.aoba.settings.types.BooleanSetting; import net.minecraft.client.gui.DrawContext; @@ -58,12 +60,14 @@ public void draw(DrawContext drawContext, float partialTicks) { super.draw(drawContext, partialTicks); MatrixStack matrixStack = drawContext.getMatrices(); + Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); + RenderUtils.drawString(drawContext, this.text, actualX + 6, actualY + 8, 0xFFFFFF); if (this.checkbox.getValue()) { - RenderUtils.drawOutlinedBox(matrixStack, actualX + actualWidth - 24, actualY + 5, 20, 20, + RenderUtils.drawOutlinedBox(matrix4f, actualX + actualWidth - 24, actualY + 5, 20, 20, new Color(0, 154, 0, 200)); } else { - RenderUtils.drawOutlinedBox(matrixStack, actualX + actualWidth - 24, actualY + 5, 20, 20, + RenderUtils.drawOutlinedBox(matrix4f, actualX + actualWidth - 24, actualY + 5, 20, 20, new Color(154, 0, 0, 200)); } } diff --git a/src/main/java/net/aoba/gui/tabs/components/ColorPickerComponent.java b/src/main/java/net/aoba/gui/tabs/components/ColorPickerComponent.java index 1b303c57..b356a4c6 100644 --- a/src/main/java/net/aoba/gui/tabs/components/ColorPickerComponent.java +++ b/src/main/java/net/aoba/gui/tabs/components/ColorPickerComponent.java @@ -18,6 +18,8 @@ package net.aoba.gui.tabs.components; +import org.joml.Matrix4f; + import net.aoba.Aoba; import net.aoba.event.events.LeftMouseDownEvent; import net.aoba.event.events.LeftMouseUpEvent; @@ -25,14 +27,15 @@ import net.aoba.event.listeners.LeftMouseDownListener; import net.aoba.event.listeners.LeftMouseUpListener; import net.aoba.event.listeners.MouseMoveListener; -import net.aoba.gui.Color; import net.aoba.gui.GuiManager; import net.aoba.gui.IGuiElement; +import net.aoba.gui.colors.Color; import net.aoba.misc.RenderUtils; import net.aoba.settings.types.ColorSetting; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.util.math.MatrixStack; + public class ColorPickerComponent extends Component implements LeftMouseDownListener, LeftMouseUpListener, MouseMoveListener { private String text; @@ -150,6 +153,7 @@ public void update() { @Override public void draw(DrawContext drawContext, float partialTicks) { MatrixStack matrixStack = drawContext.getMatrices(); + Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); RenderUtils.drawString(drawContext, this.text, actualX + 6, actualY + 6, 0xFFFFFF); RenderUtils.drawString(drawContext, collapsed ? ">>" : "<<", (actualX + actualWidth - 24), actualY + 6, GuiManager.foregroundColor.getValue().getColorAsInt()); @@ -157,31 +161,30 @@ public void draw(DrawContext drawContext, float partialTicks) { if(!collapsed) { Color newColor = new Color(255, 0, 0); newColor.setHSV(this.hue, 1.0f, 1.0f); - RenderUtils.drawHorizontalGradient(matrixStack, actualX + 4, actualY + 29, actualWidth - 76, actualHeight - 33, new Color(255, 255, 255), newColor); - RenderUtils.drawVerticalGradient(matrixStack, actualX + 4, actualY+ 29, actualWidth - 76, actualHeight - 33, new Color(0, 0, 0, 0), new Color(0, 0, 0)); + RenderUtils.drawHorizontalGradient(matrix4f, actualX + 4, actualY + 29, actualWidth - 76, actualHeight - 33, new Color(255, 255, 255), newColor); + RenderUtils.drawVerticalGradient(matrix4f, actualX + 4, actualY+ 29, actualWidth - 76, actualHeight - 33, new Color(0, 0, 0, 0), new Color(0, 0, 0)); // Draw Hue Rectangle float increment = ((this.actualHeight - 33) / 6.0f); - RenderUtils.drawVerticalGradient(matrixStack, actualX + actualWidth - 68, actualY + 29, 30, increment, new Color(255, 0, 0), new Color(255, 255, 0)); - RenderUtils.drawVerticalGradient(matrixStack, actualX + actualWidth - 68, actualY + 29 + increment, 30,increment, new Color(255, 255, 0), new Color(0, 255, 0)); - RenderUtils.drawVerticalGradient(matrixStack, actualX + actualWidth - 68, actualY + 29 + (2 * increment), 30, increment, new Color(0, 255, 0), new Color(0, 255, 255)); - RenderUtils.drawVerticalGradient(matrixStack, actualX + actualWidth - 68, actualY + 29 + (3 * increment), 30, increment, new Color(0, 255, 255), new Color(0, 0, 255)); - RenderUtils.drawVerticalGradient(matrixStack, actualX + actualWidth - 68, actualY + 29 + (4 * increment), 30, increment, new Color(0, 0, 255), new Color(255, 0, 255)); - RenderUtils.drawVerticalGradient(matrixStack, actualX + actualWidth - 68, actualY + 29 + (5 * increment), 30, increment, new Color(255, 0, 255), new Color(255, 0, 0)); + RenderUtils.drawVerticalGradient(matrix4f, actualX + actualWidth - 68, actualY + 29, 30, increment, new Color(255, 0, 0), new Color(255, 255, 0)); + RenderUtils.drawVerticalGradient(matrix4f, actualX + actualWidth - 68, actualY + 29 + increment, 30,increment, new Color(255, 255, 0), new Color(0, 255, 0)); + RenderUtils.drawVerticalGradient(matrix4f, actualX + actualWidth - 68, actualY + 29 + (2 * increment), 30, increment, new Color(0, 255, 0), new Color(0, 255, 255)); + RenderUtils.drawVerticalGradient(matrix4f, actualX + actualWidth - 68, actualY + 29 + (3 * increment), 30, increment, new Color(0, 255, 255), new Color(0, 0, 255)); + RenderUtils.drawVerticalGradient(matrix4f, actualX + actualWidth - 68, actualY + 29 + (4 * increment), 30, increment, new Color(0, 0, 255), new Color(255, 0, 255)); + RenderUtils.drawVerticalGradient(matrix4f, actualX + actualWidth - 68, actualY + 29 + (5 * increment), 30, increment, new Color(255, 0, 255), new Color(255, 0, 0)); // Draw Alpha Rectangle - RenderUtils.drawVerticalGradient(matrixStack, actualX + actualWidth - 34 , actualY + 29, 30, actualHeight - 33, new Color(255, 255, 255), new Color(0, 0, 0)); + RenderUtils.drawVerticalGradient(matrix4f, actualX + actualWidth - 34 , actualY + 29, 30, actualHeight - 33, new Color(255, 255, 255), new Color(0, 0, 0)); // Draw Outlines - RenderUtils.drawOutline(matrixStack, actualX + 4, actualY + 29, actualWidth - 76, actualHeight - 33); - RenderUtils.drawOutline(matrixStack, actualX + actualWidth - 68, actualY + 29, 30, actualHeight - 33); - RenderUtils.drawOutline(matrixStack, actualX + actualWidth - 34, actualY + 29, 30, actualHeight - 33); + RenderUtils.drawOutline(matrix4f, actualX + 4, actualY + 29, actualWidth - 76, actualHeight - 33); + RenderUtils.drawOutline(matrix4f, actualX + actualWidth - 68, actualY + 29, 30, actualHeight - 33); + RenderUtils.drawOutline(matrix4f, actualX + actualWidth - 34, actualY + 29, 30, actualHeight - 33); // Draw Indicators - RenderUtils.drawCircle(matrixStack, actualX + 4 + (saturation * (actualWidth - 72)), actualY + 29 + ((1.0f - luminance) * (actualHeight - 33)), 3, new Color(255, 255, 255, 255)); - RenderUtils.drawOutlinedBox(matrixStack, actualX + actualWidth - 68, actualY + 29 + ((hue / 360.0f) * (actualHeight - 33)), 30, 3, new Color(255, 255, 255, 255)); - RenderUtils.drawOutlinedBox(matrixStack, actualX + actualWidth - 34, actualY + 29 + (((255.0f - alpha) / 255.0f) * (actualHeight - 33)), 30, 3, new Color(255, 255, 255, 255)); + RenderUtils.drawCircle(matrix4f, actualX + 4 + (saturation * (actualWidth - 72)), actualY + 29 + ((1.0f - luminance) * (actualHeight - 33)), 3, new Color(255, 255, 255, 255)); + RenderUtils.drawOutlinedBox(matrix4f, actualX + actualWidth - 68, actualY + 29 + ((hue / 360.0f) * (actualHeight - 33)), 30, 3, new Color(255, 255, 255, 255)); + RenderUtils.drawOutlinedBox(matrix4f, actualX + actualWidth - 34, actualY + 29 + (((255.0f - alpha) / 255.0f) * (actualHeight - 33)), 30, 3, new Color(255, 255, 255, 255)); } - } } \ No newline at end of file diff --git a/src/main/java/net/aoba/gui/tabs/components/Component.java b/src/main/java/net/aoba/gui/tabs/components/Component.java index 89653a3f..7a91b34a 100644 --- a/src/main/java/net/aoba/gui/tabs/components/Component.java +++ b/src/main/java/net/aoba/gui/tabs/components/Component.java @@ -19,13 +19,17 @@ package net.aoba.gui.tabs.components; import java.util.ArrayList; + +import org.joml.Matrix4f; + import net.aoba.Aoba; import net.aoba.event.events.MouseMoveEvent; import net.aoba.event.listeners.MouseMoveListener; -import net.aoba.gui.Color; import net.aoba.gui.IGuiElement; +import net.aoba.gui.colors.Color; import net.aoba.misc.RenderUtils; import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.util.math.MatrixStack; public abstract class Component implements IGuiElement, MouseMoveListener { private static boolean DEBUG = false; @@ -412,7 +416,9 @@ public void update() { public void draw(DrawContext drawContext, float partialTicks) { if (this.visible) { if (this.hovered && DEBUG) { - RenderUtils.drawOutline(drawContext.getMatrices(), this.actualX, this.actualY, this.actualWidth, + MatrixStack matrixStack = drawContext.getMatrices(); + Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); + RenderUtils.drawOutline(matrix4f, this.actualX, this.actualY, this.actualWidth, this.actualHeight); } diff --git a/src/main/java/net/aoba/gui/tabs/components/HudComponent.java b/src/main/java/net/aoba/gui/tabs/components/HudComponent.java index 9a65eafa..5e6dc0de 100644 --- a/src/main/java/net/aoba/gui/tabs/components/HudComponent.java +++ b/src/main/java/net/aoba/gui/tabs/components/HudComponent.java @@ -18,14 +18,17 @@ package net.aoba.gui.tabs.components; +import org.joml.Matrix4f; + import net.aoba.Aoba; import net.aoba.event.events.LeftMouseDownEvent; import net.aoba.event.listeners.LeftMouseDownListener; -import net.aoba.gui.Color; import net.aoba.gui.IGuiElement; +import net.aoba.gui.colors.Color; import net.aoba.gui.hud.AbstractHud; import net.aoba.misc.RenderUtils; import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.util.math.MatrixStack; public class HudComponent extends Component implements LeftMouseDownListener { private String text; @@ -47,6 +50,10 @@ public void update() { @Override public void draw(DrawContext drawContext, float partialTicks) { super.draw(drawContext, partialTicks); + + MatrixStack matrixStack = drawContext.getMatrices(); + Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); + RenderUtils.drawString(drawContext, this.text, actualX + 8, actualY + 8, 0xFFFFFF); if(this.hud.activated.getValue()) { diff --git a/src/main/java/net/aoba/gui/tabs/components/KeybindComponent.java b/src/main/java/net/aoba/gui/tabs/components/KeybindComponent.java index ae41d814..6c6898d1 100644 --- a/src/main/java/net/aoba/gui/tabs/components/KeybindComponent.java +++ b/src/main/java/net/aoba/gui/tabs/components/KeybindComponent.java @@ -18,6 +18,7 @@ package net.aoba.gui.tabs.components; +import org.joml.Matrix4f; import org.lwjgl.glfw.GLFW; import net.aoba.Aoba; @@ -25,12 +26,13 @@ import net.aoba.event.events.LeftMouseDownEvent; import net.aoba.event.listeners.KeyDownListener; import net.aoba.event.listeners.LeftMouseDownListener; -import net.aoba.gui.Color; import net.aoba.gui.IGuiElement; +import net.aoba.gui.colors.Color; import net.aoba.misc.RenderUtils; import net.aoba.settings.types.KeybindSetting; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.util.InputUtil; +import net.minecraft.client.util.math.MatrixStack; public class KeybindComponent extends Component implements LeftMouseDownListener, KeyDownListener { private boolean listeningForKey; @@ -52,9 +54,13 @@ public void update() { @Override public void draw(DrawContext drawContext, float partialTicks) { super.draw(drawContext, partialTicks); + + MatrixStack matrixStack = drawContext.getMatrices(); + Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); + RenderUtils.drawString(drawContext, "Keybind", actualX + 8, actualY + 8, 0xFFFFFF); - RenderUtils.drawBox(drawContext.getMatrices(), actualX + actualWidth - 100, actualY + 2, 98, actualHeight - 4, new Color(115, 115, 115, 200)); - RenderUtils.drawOutline(drawContext.getMatrices(), actualX + actualWidth - 100, actualY + 2, 98, actualHeight - 4); + RenderUtils.drawBox(matrix4f, actualX + actualWidth - 100, actualY + 2, 98, actualHeight - 4, new Color(115, 115, 115, 200)); + RenderUtils.drawOutline(matrix4f, actualX + actualWidth - 100, actualY + 2, 98, actualHeight - 4); String keyBindText = this.keyBind.getValue().getLocalizedText().getString(); if(keyBindText.equals("scancode.0") || keyBindText.equals("key.keyboard.0")) diff --git a/src/main/java/net/aoba/gui/tabs/components/ListComponent.java b/src/main/java/net/aoba/gui/tabs/components/ListComponent.java index c3708e02..d55090c6 100644 --- a/src/main/java/net/aoba/gui/tabs/components/ListComponent.java +++ b/src/main/java/net/aoba/gui/tabs/components/ListComponent.java @@ -19,14 +19,18 @@ package net.aoba.gui.tabs.components; import java.util.List; + +import org.joml.Matrix4f; + import net.aoba.Aoba; import net.aoba.event.events.LeftMouseDownEvent; import net.aoba.event.listeners.LeftMouseDownListener; -import net.aoba.gui.Color; import net.aoba.gui.IGuiElement; +import net.aoba.gui.colors.Color; import net.aoba.misc.RenderUtils; import net.aoba.settings.types.StringSetting; import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.util.math.MatrixStack; public class ListComponent extends Component implements LeftMouseDownListener { private StringSetting listSetting; @@ -59,6 +63,9 @@ public ListComponent(IGuiElement parent, List options, StringSetting lis @Override public void draw(DrawContext drawContext, float partialTicks) { + MatrixStack matrixStack = drawContext.getMatrices(); + Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); + float stringWidth = Aoba.getInstance().fontManager.GetRenderer().getWidth(listSetting.getValue()); RenderUtils.drawString(drawContext, listSetting.getValue(), actualX + (actualWidth / 2.0f) - stringWidth, actualY + 8, 0xFFFFFF); diff --git a/src/main/java/net/aoba/gui/tabs/components/ModuleComponent.java b/src/main/java/net/aoba/gui/tabs/components/ModuleComponent.java index 27d77650..e5170fb7 100644 --- a/src/main/java/net/aoba/gui/tabs/components/ModuleComponent.java +++ b/src/main/java/net/aoba/gui/tabs/components/ModuleComponent.java @@ -18,16 +18,19 @@ package net.aoba.gui.tabs.components; +import org.joml.Matrix4f; + import net.aoba.Aoba; import net.aoba.event.events.LeftMouseDownEvent; import net.aoba.event.listeners.LeftMouseDownListener; import net.aoba.module.Module; -import net.aoba.gui.Color; import net.aoba.gui.GuiManager; import net.aoba.gui.IGuiElement; +import net.aoba.gui.colors.Color; import net.aoba.gui.tabs.ModuleSettingsTab; import net.aoba.misc.RenderUtils; import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.Identifier; public class ModuleComponent extends Component implements LeftMouseDownListener { @@ -58,10 +61,14 @@ public void update() { @Override public void draw(DrawContext drawContext, float partialTicks) { super.draw(drawContext, partialTicks); + + MatrixStack matrixStack = drawContext.getMatrices(); + Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); + RenderUtils.drawString(drawContext, this.text, actualX + 8, actualY + 8, module.getState() ? 0x00FF00 : this.hovered ? GuiManager.foregroundColor.getValue().getColorAsInt() : 0xFFFFFF); if(module.hasSettings()) { Color hudColor = GuiManager.foregroundColor.getValue(); - RenderUtils.drawTexturedQuad(drawContext, gear, (actualX + actualWidth - 20), (actualY + 6), 16, 16, hudColor); + RenderUtils.drawTexturedQuad(matrix4f, gear, (actualX + actualWidth - 20), (actualY + 6), 16, 16, hudColor); } } diff --git a/src/main/java/net/aoba/gui/tabs/components/SliderComponent.java b/src/main/java/net/aoba/gui/tabs/components/SliderComponent.java index ea116417..3106e2fb 100644 --- a/src/main/java/net/aoba/gui/tabs/components/SliderComponent.java +++ b/src/main/java/net/aoba/gui/tabs/components/SliderComponent.java @@ -18,6 +18,8 @@ package net.aoba.gui.tabs.components; +import org.joml.Matrix4f; + import net.aoba.Aoba; import net.aoba.event.events.LeftMouseDownEvent; import net.aoba.event.events.LeftMouseUpEvent; @@ -25,9 +27,9 @@ import net.aoba.event.listeners.LeftMouseDownListener; import net.aoba.event.listeners.LeftMouseUpListener; import net.aoba.event.listeners.MouseMoveListener; -import net.aoba.gui.Color; import net.aoba.gui.GuiManager; import net.aoba.gui.IGuiElement; +import net.aoba.gui.colors.Color; import net.aoba.misc.RenderUtils; import net.aoba.settings.types.FloatSetting; import net.minecraft.client.MinecraftClient; @@ -129,14 +131,14 @@ public void update() { @Override public void draw(DrawContext drawContext, float partialTicks) { MatrixStack matrixStack = drawContext.getMatrices(); - + Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); + // Draw the rest of the box. float xLength = ((actualWidth - 18) * (float) ((slider.getValue() - slider.min_value) / (slider.max_value - slider.min_value))); - GuiManager hudManager = Aoba.getInstance().hudManager; - RenderUtils.drawBox(matrixStack, actualX + 10, actualY + 35, xLength, 2, GuiManager.foregroundColor.getValue()); - RenderUtils.drawBox(matrixStack, actualX + 10 + xLength, actualY + 35, (actualWidth - xLength - 18), 2, new Color(255, 255, 255, 255)); - RenderUtils.drawCircle(matrixStack, actualX + 10 + xLength, actualY + 35, 6, GuiManager.foregroundColor.getValue()); + RenderUtils.drawBox(matrix4f, actualX + 10, actualY + 35, xLength, 2, GuiManager.foregroundColor.getValue()); + RenderUtils.drawBox(matrix4f, actualX + 10 + xLength, actualY + 35, (actualWidth - xLength - 18), 2, new Color(255, 255, 255, 255)); + RenderUtils.drawCircle(matrix4f, actualX + 10 + xLength, actualY + 35, 6, GuiManager.foregroundColor.getValue()); if (this.slider == null) return; diff --git a/src/main/java/net/aoba/gui/tabs/components/StringComponent.java b/src/main/java/net/aoba/gui/tabs/components/StringComponent.java index 8e01e0ba..1da286a9 100644 --- a/src/main/java/net/aoba/gui/tabs/components/StringComponent.java +++ b/src/main/java/net/aoba/gui/tabs/components/StringComponent.java @@ -20,15 +20,18 @@ import java.util.ArrayList; +import org.joml.Matrix4f; + import net.aoba.Aoba; import net.aoba.event.events.FontChangedEvent; import net.aoba.event.listeners.FontChangedListener; import net.aoba.event.listeners.LeftMouseDownListener; -import net.aoba.gui.Color; import net.aoba.gui.IGuiElement; -import net.aoba.misc.Colors; +import net.aoba.gui.colors.Color; +import net.aoba.gui.colors.Colors; import net.aoba.misc.RenderUtils; import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.Formatting; public class StringComponent extends Component implements FontChangedListener { @@ -66,6 +69,9 @@ public StringComponent(String text, IGuiElement parent, Color color, boolean bol @Override public void draw(DrawContext drawContext, float partialTicks) { + MatrixStack matrixStack = drawContext.getMatrices(); + Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); + int i = 0; for (String str : text) { if(bold) diff --git a/src/main/java/net/aoba/misc/RenderUtils.java b/src/main/java/net/aoba/misc/RenderUtils.java index c95eb529..df44dc28 100644 --- a/src/main/java/net/aoba/misc/RenderUtils.java +++ b/src/main/java/net/aoba/misc/RenderUtils.java @@ -23,11 +23,13 @@ import net.aoba.Aoba; import net.aoba.AobaClient; -import net.aoba.gui.Color; +import net.aoba.gui.colors.Color; +import net.aoba.gui.colors.Colors; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.Font; import net.minecraft.client.font.FontStorage; import net.minecraft.client.font.TextRenderer; +import net.minecraft.client.font.TextRenderer.TextLayerType; import net.minecraft.client.font.TrueTypeFont; import net.minecraft.client.font.TrueTypeFontLoader; import net.minecraft.client.font.TrueTypeFontLoader.Shift; @@ -52,7 +54,7 @@ public class RenderUtils { static final float ROUND_QUALITY = 10; - public static void drawTexturedQuad(DrawContext drawContext, Identifier texture, float x1, float y1, float width, float height, Color color) { + public static void drawTexturedQuad(Matrix4f matrix4f, Identifier texture, float x1, float y1, float width, float height, Color color) { float red = color.getRedFloat(); float green = color.getGreenFloat(); float blue = color.getBlueFloat(); @@ -64,7 +66,6 @@ public static void drawTexturedQuad(DrawContext drawContext, Identifier texture, RenderSystem.setShaderTexture(0, texture); RenderSystem.setShader(GameRenderer::getPositionColorTexProgram); RenderSystem.enableBlend(); - Matrix4f matrix4f = drawContext.getMatrices().peek().getPositionMatrix(); BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer(); bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR_TEXTURE); bufferBuilder.vertex(matrix4f, x1, y1, 0).color(red, green, blue, alpha).texture(0, 0).next(); @@ -75,23 +76,22 @@ public static void drawTexturedQuad(DrawContext drawContext, Identifier texture, RenderSystem.disableBlend(); } - public static void drawBox(MatrixStack matrixStack, float x, float y, float width, float height, Color color) { + public static void drawBox(Matrix4f matrix4f, float x, float y, float width, float height, Color color) { RenderSystem.setShaderColor(color.getRedFloat(), color.getGreenFloat(), color.getBlueFloat(), color.getAlphaFloat()); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_LINE_SMOOTH); - Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x, y, 0).next(); - bufferBuilder.vertex(matrix, x + width, y, 0).next(); - bufferBuilder.vertex(matrix, x + width, y + height, 0).next(); - bufferBuilder.vertex(matrix, x, y + height, 0).next(); + bufferBuilder.vertex(matrix4f, x, y, 0).next(); + bufferBuilder.vertex(matrix4f, x + width, y, 0).next(); + bufferBuilder.vertex(matrix4f, x + width, y + height, 0).next(); + bufferBuilder.vertex(matrix4f, x, y + height, 0).next(); tessellator.draw(); @@ -100,13 +100,12 @@ public static void drawBox(MatrixStack matrixStack, float x, float y, float widt GL11.glDisable(GL11.GL_BLEND); } - public static void drawCircle(MatrixStack matrixStack, float x, float y, float radius, Color color) { + public static void drawCircle(Matrix4f matrix4f, float x, float y, float radius, Color color) { RenderSystem.setShaderColor(color.getRedFloat(), color.getGreenFloat(), color.getBlueFloat(), color.getAlphaFloat()); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_LINE_SMOOTH); - Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); @@ -123,9 +122,9 @@ public static void drawCircle(MatrixStack matrixStack, float x, float y, float r float radiusX2 = (float)Math.cos(angle2) * radius; float radiusY2 = (float)Math.sin(angle2) * radius; - bufferBuilder.vertex(matrix, x, y, 0).next(); - bufferBuilder.vertex(matrix, x + radiusX1, y + radiusY1, 0).next(); - bufferBuilder.vertex(matrix, x + radiusX2, y + radiusY2, 0).next(); + bufferBuilder.vertex(matrix4f, x, y, 0).next(); + bufferBuilder.vertex(matrix4f, x + radiusX1, y + radiusY1, 0).next(); + bufferBuilder.vertex(matrix4f, x + radiusX2, y + radiusY2, 0).next(); } tessellator.draw(); @@ -135,73 +134,72 @@ public static void drawCircle(MatrixStack matrixStack, float x, float y, float r GL11.glDisable(GL11.GL_BLEND); } - public static void drawRoundedBox(MatrixStack matrixStack, float x, float y, float width, float height, float radius, Color color) { + public static void drawRoundedBox(Matrix4f matrix4f, float x, float y, float width, float height, float radius, Color color) { RenderSystem.setShaderColor(color.getRedFloat(), color.getGreenFloat(), color.getBlueFloat(), color.getAlphaFloat()); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_LINE_SMOOTH); - Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); bufferBuilder.begin(VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION); - buildFilledArc(bufferBuilder, matrix, x + radius, y + radius, radius, 180.0f, 90.0f); - buildFilledArc(bufferBuilder, matrix, x + width - radius, y + radius, radius, 270.0f, 90.0f); - buildFilledArc(bufferBuilder, matrix, x + width - radius, y + height - radius, radius, 0.0f, 90.0f); - buildFilledArc(bufferBuilder, matrix, x + radius, y + height - radius, radius, 90.0f, 90.0f); + buildFilledArc(bufferBuilder, matrix4f, x + radius, y + radius, radius, 180.0f, 90.0f); + buildFilledArc(bufferBuilder, matrix4f, x + width - radius, y + radius, radius, 270.0f, 90.0f); + buildFilledArc(bufferBuilder, matrix4f, x + width - radius, y + height - radius, radius, 0.0f, 90.0f); + buildFilledArc(bufferBuilder, matrix4f, x + radius, y + height - radius, radius, 90.0f, 90.0f); // |--- - bufferBuilder.vertex(matrix, x + radius, y, 0).next(); - bufferBuilder.vertex(matrix, x + width - radius, y, 0).next(); - bufferBuilder.vertex(matrix, x + radius, y + radius, 0).next(); + bufferBuilder.vertex(matrix4f, x + radius, y, 0).next(); + bufferBuilder.vertex(matrix4f, x + width - radius, y, 0).next(); + bufferBuilder.vertex(matrix4f, x + radius, y + radius, 0).next(); // ---| - bufferBuilder.vertex(matrix, x + radius, y + radius, 0).next(); - bufferBuilder.vertex(matrix, x + width - radius, y, 0).next(); - bufferBuilder.vertex(matrix, x + width - radius, y + radius, 0).next(); + bufferBuilder.vertex(matrix4f, x + radius, y + radius, 0).next(); + bufferBuilder.vertex(matrix4f, x + width - radius, y, 0).next(); + bufferBuilder.vertex(matrix4f, x + width - radius, y + radius, 0).next(); // _|| - bufferBuilder.vertex(matrix, x + width - radius, y + radius, 0).next(); - bufferBuilder.vertex(matrix, x + width, y + radius, 0).next(); - bufferBuilder.vertex(matrix, x + width - radius, y + height - radius, 0).next(); + bufferBuilder.vertex(matrix4f, x + width - radius, y + radius, 0).next(); + bufferBuilder.vertex(matrix4f, x + width, y + radius, 0).next(); + bufferBuilder.vertex(matrix4f, x + width - radius, y + height - radius, 0).next(); // ||| - bufferBuilder.vertex(matrix, x + width, y + radius, 0).next(); - bufferBuilder.vertex(matrix, x + width, y + height - radius, 0).next(); - bufferBuilder.vertex(matrix, x + width - radius, y + height - radius, 0).next(); + bufferBuilder.vertex(matrix4f, x + width, y + radius, 0).next(); + bufferBuilder.vertex(matrix4f, x + width, y + height - radius, 0).next(); + bufferBuilder.vertex(matrix4f, x + width - radius, y + height - radius, 0).next(); /// __| - bufferBuilder.vertex(matrix, x + width - radius, y + height - radius, 0).next(); - bufferBuilder.vertex(matrix, x + width - radius, y + height, 0).next(); - bufferBuilder.vertex(matrix, x + radius, y + height - radius, 0).next(); + bufferBuilder.vertex(matrix4f, x + width - radius, y + height - radius, 0).next(); + bufferBuilder.vertex(matrix4f, x + width - radius, y + height, 0).next(); + bufferBuilder.vertex(matrix4f, x + radius, y + height - radius, 0).next(); // |__ - bufferBuilder.vertex(matrix, x + radius, y + height - radius, 0).next(); - bufferBuilder.vertex(matrix, x + radius, y + height, 0).next(); - bufferBuilder.vertex(matrix, x + width - radius, y + height, 0).next(); + bufferBuilder.vertex(matrix4f, x + radius, y + height - radius, 0).next(); + bufferBuilder.vertex(matrix4f, x + radius, y + height, 0).next(); + bufferBuilder.vertex(matrix4f, x + width - radius, y + height, 0).next(); // ||| - bufferBuilder.vertex(matrix, x + radius, y + height - radius, 0).next(); - bufferBuilder.vertex(matrix, x, y + height - radius, 0).next(); - bufferBuilder.vertex(matrix, x , y + radius, 0).next(); + bufferBuilder.vertex(matrix4f, x + radius, y + height - radius, 0).next(); + bufferBuilder.vertex(matrix4f, x, y + height - radius, 0).next(); + bufferBuilder.vertex(matrix4f, x , y + radius, 0).next(); /// ||- - bufferBuilder.vertex(matrix, x , y + radius, 0).next(); - bufferBuilder.vertex(matrix, x + radius , y + radius, 0).next(); - bufferBuilder.vertex(matrix, x + radius, y + height - radius, 0).next(); + bufferBuilder.vertex(matrix4f, x , y + radius, 0).next(); + bufferBuilder.vertex(matrix4f, x + radius , y + radius, 0).next(); + bufferBuilder.vertex(matrix4f, x + radius, y + height - radius, 0).next(); /// |-/ - bufferBuilder.vertex(matrix, x + radius , y + radius, 0).next(); - bufferBuilder.vertex(matrix, x + width - radius , y + radius, 0).next(); - bufferBuilder.vertex(matrix, x + radius , y + height - radius, 0).next(); + bufferBuilder.vertex(matrix4f, x + radius , y + radius, 0).next(); + bufferBuilder.vertex(matrix4f, x + width - radius , y + radius, 0).next(); + bufferBuilder.vertex(matrix4f, x + radius , y + height - radius, 0).next(); /// /_| - bufferBuilder.vertex(matrix, x + radius , y + height - radius, 0).next(); - bufferBuilder.vertex(matrix, x + width - radius , y + height - radius, 0).next(); - bufferBuilder.vertex(matrix, x + width - radius , y + radius, 0).next(); + bufferBuilder.vertex(matrix4f, x + radius , y + height - radius, 0).next(); + bufferBuilder.vertex(matrix4f, x + width - radius , y + height - radius, 0).next(); + bufferBuilder.vertex(matrix4f, x + width - radius , y + radius, 0).next(); tessellator.draw(); @@ -210,13 +208,12 @@ public static void drawRoundedBox(MatrixStack matrixStack, float x, float y, flo GL11.glDisable(GL11.GL_BLEND); } - public static void drawRoundedOutline(MatrixStack matrixStack, float x, float y, float width, float height, float radius, Color color) { + public static void drawRoundedOutline(Matrix4f matrix4f, float x, float y, float width, float height, float radius, Color color) { RenderSystem.setShaderColor(color.getRedFloat(), color.getGreenFloat(), color.getBlueFloat(), color.getAlphaFloat()); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_DEPTH_TEST); - Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); @@ -224,24 +221,24 @@ public static void drawRoundedOutline(MatrixStack matrixStack, float x, float y, bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); // Top Left Arc and Top - buildArc(bufferBuilder, matrix, x + radius, y + radius, radius, 180.0f, 90.0f); - bufferBuilder.vertex(matrix, x + radius, y, 0).next(); - bufferBuilder.vertex(matrix, x + width - radius, y, 0).next(); + buildArc(bufferBuilder, matrix4f, x + radius, y + radius, radius, 180.0f, 90.0f); + bufferBuilder.vertex(matrix4f, x + radius, y, 0).next(); + bufferBuilder.vertex(matrix4f, x + width - radius, y, 0).next(); // Top Right Arc and Right - buildArc(bufferBuilder, matrix, x + width - radius, y + radius, radius, 270.0f, 90.0f); - bufferBuilder.vertex(matrix, x + width, y + radius, 0).next(); - bufferBuilder.vertex(matrix, x + width, y + height - radius, 0).next(); + buildArc(bufferBuilder, matrix4f, x + width - radius, y + radius, radius, 270.0f, 90.0f); + bufferBuilder.vertex(matrix4f, x + width, y + radius, 0).next(); + bufferBuilder.vertex(matrix4f, x + width, y + height - radius, 0).next(); // Bottom Right - buildArc(bufferBuilder, matrix, x + width - radius, y + height - radius, radius, 0.0f, 90.0f); - bufferBuilder.vertex(matrix, x + width - radius, y + height, 0).next(); - bufferBuilder.vertex(matrix, x + radius, y + height, 0).next(); + buildArc(bufferBuilder, matrix4f, x + width - radius, y + height - radius, radius, 0.0f, 90.0f); + bufferBuilder.vertex(matrix4f, x + width - radius, y + height, 0).next(); + bufferBuilder.vertex(matrix4f, x + radius, y + height, 0).next(); // Bottom Left - buildArc(bufferBuilder, matrix, x + radius, y + height - radius, radius, 90.0f, 90.0f); - bufferBuilder.vertex(matrix, x, y + height - radius, 0).next(); - bufferBuilder.vertex(matrix, x, y + radius, 0).next(); + buildArc(bufferBuilder, matrix4f, x + radius, y + height - radius, radius, 90.0f, 90.0f); + bufferBuilder.vertex(matrix4f, x, y + height - radius, 0).next(); + bufferBuilder.vertex(matrix4f, x, y + radius, 0).next(); tessellator.draw(); @@ -249,23 +246,22 @@ public static void drawRoundedOutline(MatrixStack matrixStack, float x, float y, GL11.glDisable(GL11.GL_DEPTH_TEST); } - public static void drawOutlinedBox(MatrixStack matrixStack, float x, float y, float width, float height, Color outlineColor, Color backgroundColor) { + public static void drawOutlinedBox(Matrix4f matrix4f, float x, float y, float width, float height, Color outlineColor, Color backgroundColor) { RenderSystem.setShaderColor(backgroundColor.getRedFloat(), backgroundColor.getGreenFloat(), backgroundColor.getBlueFloat(), backgroundColor.getAlphaFloat()); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_DEPTH_TEST); - Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x, y, 0).next(); - bufferBuilder.vertex(matrix, x + width, y, 0).next(); - bufferBuilder.vertex(matrix, x + width, y + height, 0).next(); - bufferBuilder.vertex(matrix, x, y + height, 0).next(); + bufferBuilder.vertex(matrix4f, x, y, 0).next(); + bufferBuilder.vertex(matrix4f, x + width, y, 0).next(); + bufferBuilder.vertex(matrix4f, x + width, y + height, 0).next(); + bufferBuilder.vertex(matrix4f, x, y + height, 0).next(); tessellator.draw(); @@ -273,11 +269,11 @@ public static void drawOutlinedBox(MatrixStack matrixStack, float x, float y, fl RenderSystem.setShader(GameRenderer::getPositionProgram); bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x, y, 0).next(); - bufferBuilder.vertex(matrix, x + width, y, 0).next(); - bufferBuilder.vertex(matrix, x + width, y + height, 0).next(); - bufferBuilder.vertex(matrix, x, y + height, 0).next(); - bufferBuilder.vertex(matrix, x, y, 0).next(); + bufferBuilder.vertex(matrix4f, x, y, 0).next(); + bufferBuilder.vertex(matrix4f, x + width, y, 0).next(); + bufferBuilder.vertex(matrix4f, x + width, y + height, 0).next(); + bufferBuilder.vertex(matrix4f, x, y + height, 0).next(); + bufferBuilder.vertex(matrix4f, x, y, 0).next(); tessellator.draw(); RenderSystem.setShaderColor(1, 1, 1, 1); @@ -286,25 +282,24 @@ public static void drawOutlinedBox(MatrixStack matrixStack, float x, float y, fl GL11.glDisable(GL11.GL_BLEND); } - public static void drawOutlinedBox(MatrixStack matrixStack, float x, float y, float width, float height, Color color) { - drawOutlinedBox(matrixStack, x, y, width, height, Colors.Black, color); + public static void drawOutlinedBox(Matrix4f matrix4f, float x, float y, float width, float height, Color color) { + drawOutlinedBox(matrix4f, x, y, width, height, Colors.Black, color); } - public static void drawLine(MatrixStack matrixStack, float x1, float y1, float x2, float y2, Color color) { + public static void drawLine(Matrix4f matrix4f, float x1, float y1, float x2, float y2, Color color) { RenderSystem.setShaderColor(color.getRedFloat(), color.getGreenFloat(), color.getBlueFloat(), color.getAlphaFloat()); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_DEPTH_TEST); - Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x1, y1, 0).next(); - bufferBuilder.vertex(matrix, x2, y2, 0).next(); + bufferBuilder.vertex(matrix4f, x1, y1, 0).next(); + bufferBuilder.vertex(matrix4f, x2, y2, 0).next(); tessellator.draw(); RenderSystem.setShaderColor(1, 1, 1, 1); @@ -313,66 +308,63 @@ public static void drawLine(MatrixStack matrixStack, float x1, float y1, float x GL11.glDisable(GL11.GL_BLEND); } - public static void drawHorizontalGradient(MatrixStack matrixStack, float x, float y, float width, float height, Color startColor, Color endColor) { + public static void drawHorizontalGradient(Matrix4f matrix4f, float x, float y, float width, float height, Color startColor, Color endColor) { GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_DEPTH_TEST); - Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionColorProgram); bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); - bufferBuilder.vertex(matrix, x, y, 0.0F).color(startColor.getColorAsInt()).next(); - bufferBuilder.vertex(matrix, x + width, y, 0.0F).color(endColor.getColorAsInt()).next(); - bufferBuilder.vertex(matrix, x + width, y + height, 0.0F).color(endColor.getColorAsInt()).next(); - bufferBuilder.vertex(matrix, x, y + height, 0.0F).color(startColor.getColorAsInt()).next(); + bufferBuilder.vertex(matrix4f, x, y, 0.0F).color(startColor.getColorAsInt()).next(); + bufferBuilder.vertex(matrix4f, x + width, y, 0.0F).color(endColor.getColorAsInt()).next(); + bufferBuilder.vertex(matrix4f, x + width, y + height, 0.0F).color(endColor.getColorAsInt()).next(); + bufferBuilder.vertex(matrix4f, x, y + height, 0.0F).color(startColor.getColorAsInt()).next(); tessellator.draw(); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glDisable(GL11.GL_BLEND); } - public static void drawVerticalGradient(MatrixStack matrixStack, float x, float y, float width, float height, Color startColor, Color endColor) { + public static void drawVerticalGradient(Matrix4f matrix4f, float x, float y, float width, float height, Color startColor, Color endColor) { GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_DEPTH_TEST); - Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionColorProgram); bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); - bufferBuilder.vertex(matrix, x, y, 0.0F).color(startColor.getColorAsInt()).next(); - bufferBuilder.vertex(matrix, x + width, y, 0.0F).color(startColor.getColorAsInt()).next(); - bufferBuilder.vertex(matrix, x + width, y + height, 0.0F).color(endColor.getColorAsInt()).next(); - bufferBuilder.vertex(matrix, x, y + height, 0.0F).color(endColor.getColorAsInt()).next(); + bufferBuilder.vertex(matrix4f, x, y, 0.0F).color(startColor.getColorAsInt()).next(); + bufferBuilder.vertex(matrix4f, x + width, y, 0.0F).color(startColor.getColorAsInt()).next(); + bufferBuilder.vertex(matrix4f, x + width, y + height, 0.0F).color(endColor.getColorAsInt()).next(); + bufferBuilder.vertex(matrix4f, x, y + height, 0.0F).color(endColor.getColorAsInt()).next(); tessellator.draw(); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glDisable(GL11.GL_BLEND); } - public static void drawOutline(MatrixStack matrixStack, float x, float y, float width, float height) { + public static void drawOutline(Matrix4f matrix4f, float x, float y, float width, float height) { RenderSystem.setShaderColor(0, 0, 0, 1); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_DEPTH_TEST); - Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x, y, 0).next(); - bufferBuilder.vertex(matrix, x + width, y, 0).next(); - bufferBuilder.vertex(matrix, x + width, y + height, 0).next(); - bufferBuilder.vertex(matrix, x, y + height, 0).next(); - bufferBuilder.vertex(matrix, x, y, 0).next(); + bufferBuilder.vertex(matrix4f, x, y, 0).next(); + bufferBuilder.vertex(matrix4f, x + width, y, 0).next(); + bufferBuilder.vertex(matrix4f, x + width, y + height, 0).next(); + bufferBuilder.vertex(matrix4f, x, y + height, 0).next(); + bufferBuilder.vertex(matrix4f, x, y, 0).next(); tessellator.draw(); RenderSystem.setShaderColor(1, 1, 1, 1); @@ -381,24 +373,23 @@ public static void drawOutline(MatrixStack matrixStack, float x, float y, float GL11.glDisable(GL11.GL_BLEND); } - public static void drawOutline(MatrixStack matrixStack, float x, float y, float width, float height, Color color) { + public static void drawOutline(Matrix4f matrix4f, float x, float y, float width, float height, Color color) { RenderSystem.setShaderColor(color.getRedFloat(), color.getGreenFloat(), color.getBlueFloat(), color.getAlphaFloat()); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_DEPTH_TEST); - Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION); - bufferBuilder.vertex(matrix, x, y, 0).next(); - bufferBuilder.vertex(matrix, x + width, y, 0).next(); - bufferBuilder.vertex(matrix, x + width, y + height, 0).next(); - bufferBuilder.vertex(matrix, x, y + height, 0).next(); - bufferBuilder.vertex(matrix, x, y, 0).next(); + bufferBuilder.vertex(matrix4f, x, y, 0).next(); + bufferBuilder.vertex(matrix4f, x + width, y, 0).next(); + bufferBuilder.vertex(matrix4f, x + width, y + height, 0).next(); + bufferBuilder.vertex(matrix4f, x, y + height, 0).next(); + bufferBuilder.vertex(matrix4f, x, y, 0).next(); tessellator.draw(); RenderSystem.setShaderColor(1, 1, 1, 1); @@ -407,54 +398,53 @@ public static void drawOutline(MatrixStack matrixStack, float x, float y, float GL11.glDisable(GL11.GL_BLEND); } - public static void draw3DBox(MatrixStack matrixStack, Box box, Color color) { + public static void draw3DBox(Matrix4f matrix4f, Box box, Color color) { RenderSystem.setShaderColor(color.getRedFloat(), color.getGreenFloat(), color.getBlueFloat(), 1.0f); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_DEPTH_TEST); - Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.minZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.minY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.minY, (float) box.minZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.minZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.minY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.minY, (float) box.maxZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.maxZ).next(); - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.minY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.minY, (float) box.maxZ).next(); - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.maxZ).next(); - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.minY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.minY, (float) box.minZ).next(); - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.minZ).next(); - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.minY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.maxY, (float) box.minZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.minZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.minY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.maxY, (float) box.minZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.maxZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.minY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.maxY, (float) box.maxZ).next(); - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.maxZ).next(); - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.minY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.maxY, (float) box.maxZ).next(); - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.minZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.maxY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.maxY, (float) box.minZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.minZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.maxY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.maxY, (float) box.maxZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.maxZ).next(); - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.maxY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.maxY, (float) box.maxZ).next(); - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.maxZ).next(); - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.maxY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.maxY, (float) box.minZ).next(); tessellator.draw(); @@ -463,35 +453,35 @@ public static void draw3DBox(MatrixStack matrixStack, Box box, Color color) { bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.minZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.minZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.maxZ).next(); - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.maxZ).next(); - - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.minZ).next(); - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.maxZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.maxZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.minZ).next(); - - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.minZ).next(); - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.minZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.minZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.minZ).next(); - - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.minZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.minZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.maxZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.maxZ).next(); - - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.maxZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.minY, (float) box.maxZ).next(); - bufferBuilder.vertex(matrix, (float) box.maxX, (float) box.maxY, (float) box.maxZ).next(); - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.maxZ).next(); - - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.minZ).next(); - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.minY, (float) box.maxZ).next(); - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.maxZ).next(); - bufferBuilder.vertex(matrix, (float) box.minX, (float) box.maxY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.minY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.minY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.minY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.minY, (float) box.maxZ).next(); + + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.maxY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.maxY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.maxY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.maxY, (float) box.minZ).next(); + + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.minY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.maxY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.maxY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.minY, (float) box.minZ).next(); + + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.minY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.maxY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.maxY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.minY, (float) box.maxZ).next(); + + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.minY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.minY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.maxX, (float) box.maxY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.maxY, (float) box.maxZ).next(); + + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.minY, (float) box.minZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.minY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.maxY, (float) box.maxZ).next(); + bufferBuilder.vertex(matrix4f, (float) box.minX, (float) box.maxY, (float) box.minZ).next(); tessellator.draw(); RenderSystem.setShaderColor(1, 1, 1, 1); @@ -499,21 +489,20 @@ public static void draw3DBox(MatrixStack matrixStack, Box box, Color color) { GL11.glDisable(GL11.GL_BLEND); } - public static void drawLine3D(MatrixStack matrixStack, Vec3d pos, Vec3d pos2, Color color) { + public static void drawLine3D(Matrix4f matrix4f, Vec3d pos, Vec3d pos2, Color color) { RenderSystem.setShaderColor(color.getRedFloat(), color.getGreenFloat(), color.getBlueFloat(), color.getAlphaFloat()); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_DEPTH_TEST); - Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION); - bufferBuilder.vertex(matrix, (float) pos.x, (float) pos.y, (float) pos.z).next(); - bufferBuilder.vertex(matrix, (float) pos2.x, (float) pos2.y, (float) pos2.z).next(); + bufferBuilder.vertex(matrix4f, (float) pos.x, (float) pos.y, (float) pos.z).next(); + bufferBuilder.vertex(matrix4f, (float) pos2.x, (float) pos2.y, (float) pos2.z).next(); tessellator.draw(); RenderSystem.setShaderColor(1, 1, 1, 1); @@ -606,9 +595,9 @@ private static void buildArc(BufferBuilder bufferBuilder, Matrix4f matrix, float * @return Vec3d representing the interpolated position of the entity. */ public static Vec3d getEntityPositionInterpolated(Entity entity, float delta) { - return new Vec3d(MathHelper.lerp(delta, entity.lastRenderX, entity.getX()), - MathHelper.lerp(delta, entity.lastRenderY, entity.getY()), - MathHelper.lerp(delta, entity.lastRenderZ, entity.getZ())); + return new Vec3d(MathHelper.lerp(delta, entity.prevX, entity.getX()), + MathHelper.lerp(delta, entity.prevY, entity.getY()), + MathHelper.lerp(delta, entity.prevZ, entity.getZ())); } /** @@ -621,5 +610,4 @@ public static Vec3d getEntityPositionOffsetInterpolated(Entity entity, float del Vec3d interpolated = getEntityPositionInterpolated(entity, delta); return entity.getPos().subtract(interpolated); } - } diff --git a/src/main/java/net/aoba/mixin/AbstractBlockStateMixin.java b/src/main/java/net/aoba/mixin/AbstractBlockStateMixin.java index 2ff6e134..2734926e 100644 --- a/src/main/java/net/aoba/mixin/AbstractBlockStateMixin.java +++ b/src/main/java/net/aoba/mixin/AbstractBlockStateMixin.java @@ -17,29 +17,18 @@ */ package net.aoba.mixin; - 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.CallbackInfoReturnable; -import com.google.common.collect.ImmutableMap; -import com.mojang.serialization.MapCodec; import net.aoba.Aoba; import net.minecraft.block.AbstractBlock.AbstractBlockState; -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.state.State; -import net.minecraft.state.property.Property; import net.minecraft.util.math.BlockPos; import net.minecraft.world.BlockView; @Mixin(AbstractBlockState.class) -public abstract class AbstractBlockStateMixin extends State { +public abstract class AbstractBlockStateMixin { - private AbstractBlockStateMixin(Block object, ImmutableMap, Comparable> immutableMap, MapCodec mapCodec) - { - super(object, immutableMap, mapCodec); - } @Inject(at = @At("TAIL"), method = { "getAmbientOcclusionLightLevel(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)F"}, cancellable = true) private void onGetAmbientOcclusionLightLevel(BlockView blockView, BlockPos blockPos, CallbackInfoReturnable cir) diff --git a/src/main/java/net/aoba/mixin/ChatHudMixin.java b/src/main/java/net/aoba/mixin/ChatHudMixin.java index 52b9de1d..ee474e78 100644 --- a/src/main/java/net/aoba/mixin/ChatHudMixin.java +++ b/src/main/java/net/aoba/mixin/ChatHudMixin.java @@ -70,8 +70,8 @@ public abstract class ChatHudMixin { @Shadow public abstract void drawIndicatorIcon(DrawContext context, int x, int y, MessageIndicator.Icon icon); - @Inject(at = { @At("HEAD") }, method = {"render(Lnet/minecraft/client/gui/DrawContext;III)V" }, cancellable = true) - public void onRender(DrawContext context, int currentTick, int mouseX, int mouseY, CallbackInfo ci) { + @Inject(at = { @At("HEAD") }, method = {"render(Lnet/minecraft/client/gui/DrawContext;IIIZ)V" }, cancellable = true) + public void onRender(DrawContext context, int currentTick, int mouseX, int mouseY, boolean focused, CallbackInfo ci) { if(GlobalChat.chatType == GlobalChat.ChatType.Global) { AobaChatRender(context, currentTick, mouseX, mouseY); ci.cancel(); diff --git a/src/main/java/net/aoba/mixin/ChatScreenMixin.java b/src/main/java/net/aoba/mixin/ChatScreenMixin.java index 0b28880a..ca222a96 100644 --- a/src/main/java/net/aoba/mixin/ChatScreenMixin.java +++ b/src/main/java/net/aoba/mixin/ChatScreenMixin.java @@ -29,7 +29,7 @@ import net.aoba.cmd.CommandManager; import net.aoba.cmd.GlobalChat; import net.aoba.cmd.GlobalChat.ChatType; -import net.aoba.gui.Color; +import net.aoba.gui.colors.Color; import net.aoba.gui.tabs.components.ButtonComponent; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.DrawContext; @@ -110,13 +110,11 @@ protected void onRender(DrawContext context, int mouseX, int mouseY, float delta @Inject(at = { @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;addToMessageHistory(Ljava/lang/String;)V", ordinal = 0, shift = At.Shift.AFTER) }, method = "sendMessage(Ljava/lang/String;Z)Z", cancellable = true) - public void onSendMessage(String message, boolean addToHistory, CallbackInfoReturnable cir) { + public void onSendMessage(String message, boolean addToHistory, CallbackInfo ci) { if (message.startsWith(CommandManager.PREFIX.getValue())) { Aoba.getInstance().commandManager.command(message.split(" ")); - cir.setReturnValue(true); }else if (GlobalChat.chatType == ChatType.Global) { Aoba.getInstance().globalChat.SendMessage(message); - cir.setReturnValue(true); } } } diff --git a/src/main/java/net/aoba/mixin/ClientPlayerEntityMixin.java b/src/main/java/net/aoba/mixin/ClientPlayerEntityMixin.java index 3e55391c..342263a8 100644 --- a/src/main/java/net/aoba/mixin/ClientPlayerEntityMixin.java +++ b/src/main/java/net/aoba/mixin/ClientPlayerEntityMixin.java @@ -30,6 +30,7 @@ import net.aoba.misc.FakePlayerEntity; import net.aoba.module.modules.movement.Fly; import net.aoba.module.modules.movement.Freecam; +import net.aoba.module.modules.movement.Step; import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; @@ -61,8 +62,6 @@ private void sendMovementPackets(CallbackInfo ci) { } - - @Inject (at = {@At("HEAD")}, method="setShowsDeathScreen(Z)V") private void onShowDeathScreen(boolean state, CallbackInfo ci) { GuiManager hudManager = Aoba.getInstance().hudManager; @@ -91,11 +90,18 @@ public void onSetHealth(float health, CallbackInfo ci) { protected void onGetOffGroundSpeed(CallbackInfoReturnable cir) { if(Aoba.getInstance().moduleManager.fly.getState()) { Fly fly = (Fly)Aoba.getInstance().moduleManager.fly; - System.out.println("FLY IS ON!"); cir.setReturnValue((float)fly.getSpeed()); }else if(Aoba.getInstance().moduleManager.freecam.getState()) { Freecam freecam = (Freecam)Aoba.getInstance().moduleManager.freecam; cir.setReturnValue((float)freecam.getSpeed()); } } + + @Override + public void onGetStepHeight(CallbackInfoReturnable cir) { + Step stepHack = (Step) Aoba.getInstance().moduleManager.step; + if(stepHack.getState()) { + cir.setReturnValue(cir.getReturnValue()); + } + } } diff --git a/src/main/java/net/aoba/mixin/ClientPlayerInteractionManagerMixin.java b/src/main/java/net/aoba/mixin/ClientPlayerInteractionManagerMixin.java index bebb3468..ecad2573 100644 --- a/src/main/java/net/aoba/mixin/ClientPlayerInteractionManagerMixin.java +++ b/src/main/java/net/aoba/mixin/ClientPlayerInteractionManagerMixin.java @@ -29,18 +29,16 @@ @Mixin(ClientPlayerInteractionManager.class) public class ClientPlayerInteractionManagerMixin { - @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); - } + // 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); } + */ } diff --git a/src/main/java/net/aoba/mixin/EntityMixin.java b/src/main/java/net/aoba/mixin/EntityMixin.java index aa9b6434..4d00d1ce 100644 --- a/src/main/java/net/aoba/mixin/EntityMixin.java +++ b/src/main/java/net/aoba/mixin/EntityMixin.java @@ -24,6 +24,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import net.aoba.Aoba; +import net.aoba.module.modules.movement.Step; import net.minecraft.entity.Entity; import net.minecraft.entity.damage.DamageSource; import net.minecraft.entity.data.DataTracker; @@ -54,4 +55,9 @@ private void onIsInvisibleCheck(PlayerEntity message, CallbackInfoReturnable ci) { } + + @Inject(at= {@At("HEAD")}, method = "getStepHeight()F", cancellable=true) + public void onGetStepHeight(CallbackInfoReturnable cir) { + + } } diff --git a/src/main/java/net/aoba/mixin/EntityRendererMixin.java b/src/main/java/net/aoba/mixin/EntityRendererMixin.java index 5fd1c582..c2ae6597 100644 --- a/src/main/java/net/aoba/mixin/EntityRendererMixin.java +++ b/src/main/java/net/aoba/mixin/EntityRendererMixin.java @@ -44,13 +44,14 @@ public abstract class EntityRendererMixin { protected EntityRenderDispatcher dispatcher; @Inject(at = @At(value = "HEAD"), - method = "renderLabelIfPresent(Lnet/minecraft/entity/Entity;Lnet/minecraft/text/Text;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", + method = "renderLabelIfPresent(Lnet/minecraft/entity/Entity;Lnet/minecraft/text/Text;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;IF)V", cancellable=true) protected void onRenderLabelIfPresent(T entity, Text text, MatrixStack matrices, VertexConsumerProvider vertexConsumers, - int light, CallbackInfo ci) { + int light, + float tickDelta, CallbackInfo ci) { CustomRenderLabel(entity, text, matrices, vertexConsumers, light); ci.cancel(); } @@ -82,10 +83,10 @@ protected void CustomRenderLabel(T entity, return; } boolean bl = !((Entity)entity).isSneaky(); - float f = ((Entity)entity).getNameLabelHeight(); + // TODO: Get name line height int i = "deadmau5".equals(text.getString()) ? -10 : 0; matrices.push(); - matrices.translate(0.0f, f, 0.0f); + matrices.translate(0.0f, 1.0f, 0.0f); matrices.multiply(dispatcher.getRotation()); matrices.scale(-0.025f, -0.025f, 0.025f); if(aoba.moduleManager.nametags.getState()) { diff --git a/src/main/java/net/aoba/mixin/GameRendererMixin.java b/src/main/java/net/aoba/mixin/GameRendererMixin.java index 0538b87d..a07b8c38 100644 --- a/src/main/java/net/aoba/mixin/GameRendererMixin.java +++ b/src/main/java/net/aoba/mixin/GameRendererMixin.java @@ -18,6 +18,7 @@ package net.aoba.mixin; +import org.objectweb.asm.Opcodes; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -39,7 +40,7 @@ private void onBobViewWhenHurt(MatrixStack matrixStack, float f, CallbackInfo ci } @Redirect(at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;lerp(FFF)F", ordinal = 0), method = { - "renderWorld(FJLnet/minecraft/client/util/math/MatrixStack;)V" }) + "renderWorld(FJ)V" }) private float nauseaLerp(float delta, float first, float second) { if (Aoba.getInstance().moduleManager.nooverlay.getState()) return 0; diff --git a/src/main/java/net/aoba/mixin/IngameHudMixin.java b/src/main/java/net/aoba/mixin/IngameHudMixin.java index 3f45ba8d..32161930 100644 --- a/src/main/java/net/aoba/mixin/IngameHudMixin.java +++ b/src/main/java/net/aoba/mixin/IngameHudMixin.java @@ -29,7 +29,7 @@ @Mixin(InGameHud.class) public class IngameHudMixin { - @Inject(at = {@At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;enableBlend()V", remap = false,ordinal = 3) }, method = {"render(Lnet/minecraft/client/gui/DrawContext;F)V" }) + @Inject(at = {@At(value = "HEAD") }, method = {"render(Lnet/minecraft/client/gui/DrawContext;F)V" }) private void onRender(DrawContext context, float tickDelta, CallbackInfo ci) { Aoba.getInstance().drawHUD(context, tickDelta); } diff --git a/src/main/java/net/aoba/mixin/MinecraftClientMixin.java b/src/main/java/net/aoba/mixin/MinecraftClientMixin.java index f83ec91c..fdc39b0c 100644 --- a/src/main/java/net/aoba/mixin/MinecraftClientMixin.java +++ b/src/main/java/net/aoba/mixin/MinecraftClientMixin.java @@ -53,11 +53,17 @@ public abstract class MinecraftClientMixin{ private Session aobaSession; - @Inject(at = @At("TAIL"), method = "initFont(Z)V") - private void init(boolean forcesUnicode, CallbackInfo info) { + @Inject(at = @At("HEAD"), method = "onFinishedLoading(Lnet/minecraft/client/MinecraftClient$LoadingContext;)V") + private void onfinishedloading(CallbackInfo info) { Aoba.getInstance().loadAssets(); } + // TODO: this was moved to the FontManager class. + //@Inject(at = @At("TAIL"), method = "initFont(Z)V") + //private void onInitFont(boolean forcesUnicode, CallbackInfo info) { + // Aoba.getInstance().loadAssets(); + //} + @Inject(at = @At("TAIL"), method = "tick()V") public void tick(CallbackInfo info) { if (this.world != null) { diff --git a/src/main/java/net/aoba/mixin/MouseMixin.java b/src/main/java/net/aoba/mixin/MouseMixin.java index 03452bd7..0da89166 100644 --- a/src/main/java/net/aoba/mixin/MouseMixin.java +++ b/src/main/java/net/aoba/mixin/MouseMixin.java @@ -25,6 +25,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import net.aoba.Aoba; +import net.aoba.AobaClient; import net.aoba.event.events.MouseMoveEvent; import net.aoba.event.events.MouseScrollEvent; import net.aoba.event.events.LeftMouseDownEvent; @@ -80,13 +81,15 @@ private void onLockCursor(CallbackInfo ci) { ci.cancel(); } - @Inject(at = { @At(value = "INVOKE", target = "Lnet/minecraft/client/Mouse;updateMouse()V") }, method = { - "onCursorPos(JDD)V" }, cancellable = true) + @Inject(at = { @At("HEAD") }, method = { "onCursorPos(JDD)V" }, cancellable = true) private void onCursorPos(long window, double x, double y, CallbackInfo ci) { - MouseMoveEvent event = new MouseMoveEvent(x, y); - Aoba.getInstance().eventManager.Fire(event); + AobaClient aoba = Aoba.getInstance(); + if(aoba.eventManager != null) { + MouseMoveEvent event = new MouseMoveEvent(x, y); + aoba.eventManager.Fire(event); - if (event.IsCancelled()) - ci.cancel(); + if (event.IsCancelled()) + ci.cancel(); + } } } \ No newline at end of file diff --git a/src/main/java/net/aoba/mixin/RenderTickCounterMixin.java b/src/main/java/net/aoba/mixin/RenderTickCounterMixin.java index 3f5dc342..6cce10ed 100644 --- a/src/main/java/net/aoba/mixin/RenderTickCounterMixin.java +++ b/src/main/java/net/aoba/mixin/RenderTickCounterMixin.java @@ -26,6 +26,7 @@ import org.spongepowered.asm.mixin.injection.At; import net.aoba.Aoba; +import net.aoba.AobaClient; import net.aoba.module.modules.misc.Timer; import net.minecraft.client.render.RenderTickCounter; @@ -38,9 +39,12 @@ public class RenderTickCounterMixin { @Inject(at = {@At(value = "FIELD", target = "Lnet/minecraft/client/render/RenderTickCounter;prevTimeMillis:J", opcode = Opcodes.PUTFIELD, ordinal = 0) }, method = {"beginRenderTick(J)I" }) public void onBeginRenderTick(long long_1, CallbackInfoReturnable cir) { - Timer timer = (Timer) Aoba.getInstance().moduleManager.timer; - if(timer.getState()) { - lastFrameDuration *= timer.getMultiplier(); + AobaClient aoba = Aoba.getInstance(); + if(aoba.moduleManager != null) { + Timer timer = (Timer) Aoba.getInstance().moduleManager.timer; + if(timer.getState()) { + lastFrameDuration *= timer.getMultiplier(); + } } } } diff --git a/src/main/java/net/aoba/mixin/WorldChunkMixin.java b/src/main/java/net/aoba/mixin/WorldChunkMixin.java new file mode 100644 index 00000000..2592fa05 --- /dev/null +++ b/src/main/java/net/aoba/mixin/WorldChunkMixin.java @@ -0,0 +1,28 @@ +package net.aoba.mixin; + +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.callback.CallbackInfoReturnable; + +import net.aoba.Aoba; +import net.aoba.event.events.BlockStateEvent; +import net.minecraft.block.BlockState; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.chunk.WorldChunk; + +@Mixin(WorldChunk.class) +public class WorldChunkMixin { + + @Shadow + private World world; + + @Inject(method = "setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Z)Lnet/minecraft/block/BlockState;", at = { @At(value = "RETURN")}) + private void onSetBlockState(BlockPos pos, BlockState state, boolean moved, CallbackInfoReturnable cir) { + if(world.isClient()) { + Aoba.getInstance().eventManager.Fire(new BlockStateEvent(pos, cir.getReturnValue(), state)); + } + } +} diff --git a/src/main/java/net/aoba/mixin/WorldRendererMixin.java b/src/main/java/net/aoba/mixin/WorldRendererMixin.java index ceed02e1..cb3f1c17 100644 --- a/src/main/java/net/aoba/mixin/WorldRendererMixin.java +++ b/src/main/java/net/aoba/mixin/WorldRendererMixin.java @@ -24,21 +24,29 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import net.aoba.Aoba; +import net.minecraft.client.MinecraftClient; import net.minecraft.client.render.Camera; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.LightmapTextureManager; +import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.client.render.WorldRenderer; import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.util.math.Vec3d; + import org.joml.Matrix4f; +import org.objectweb.asm.Opcodes; @Mixin(WorldRenderer.class) public class WorldRendererMixin { - @Inject(at = { @At("RETURN") }, method = { "render" }) - private void onRenderWorld(MatrixStack matrixStack, float tickDelta, long limitTime, boolean renderBlockOutline, - Camera camera, GameRenderer gameRenderer, LightmapTextureManager lightmapTextureManager, Matrix4f matrix4f, - CallbackInfo info) { - Aoba.getInstance().moduleManager.render(matrixStack); + @Inject(at = @At("HEAD"), method = "renderChunkDebugInfo(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;Lnet/minecraft/client/render/Camera;)V", cancellable = true) + private void onRenderChunkDebugInfo(MatrixStack matrices, + VertexConsumerProvider vertexConsumers, + Camera camera, CallbackInfo ci) { + if(Aoba.getInstance().moduleManager != null) { + Aoba.getInstance().moduleManager.render(matrices); + } } + @Inject(at = @At("HEAD"), method = "hasBlindnessOrDarkness(Lnet/minecraft/client/render/Camera;)Z", cancellable = true) private void onHasBlindnessOrDarknessEffect(Camera camera, CallbackInfoReturnable cir) { diff --git a/src/main/java/net/aoba/module/ModuleManager.java b/src/main/java/net/aoba/module/ModuleManager.java index 56cf5291..27ceab05 100644 --- a/src/main/java/net/aoba/module/ModuleManager.java +++ b/src/main/java/net/aoba/module/ModuleManager.java @@ -26,6 +26,8 @@ import net.aoba.event.events.KeyDownEvent; import net.aoba.event.events.RenderEvent; import net.aoba.event.listeners.KeyDownListener; + +import org.joml.Matrix4f; import org.lwjgl.opengl.GL11; import net.aoba.module.modules.combat.*; import net.aoba.module.modules.misc.*; @@ -163,22 +165,20 @@ public ModuleManager() { public void update() { } - public void render(MatrixStack matrixStack) { + public void render(MatrixStack matrices) { GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glEnable(GL11.GL_LINE_SMOOTH); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_DEPTH_TEST); - matrixStack.push(); - + matrices.push(); Vec3d camPos = mc.getBlockEntityRenderDispatcher().camera.getPos(); - matrixStack.translate(-camPos.x, -camPos.y, -camPos.z); - - RenderEvent renderEvent = new RenderEvent(matrixStack, MinecraftClient.getInstance().getTickDelta()); + matrices.translate(-camPos.x, -camPos.y, -camPos.z); + RenderEvent renderEvent = new RenderEvent(matrices, MinecraftClient.getInstance().getTickDelta()); Aoba.getInstance().eventManager.Fire(renderEvent); + matrices.pop(); - matrixStack.pop(); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glDisable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_LINE_SMOOTH); diff --git a/src/main/java/net/aoba/module/modules/combat/Criticals.java b/src/main/java/net/aoba/module/modules/combat/Criticals.java index 84b37af1..a467598e 100644 --- a/src/main/java/net/aoba/module/modules/combat/Criticals.java +++ b/src/main/java/net/aoba/module/modules/combat/Criticals.java @@ -79,7 +79,9 @@ public void OnSendPacket(SendPacketEvent event) { if(packet instanceof PlayerInteractEntityC2SPacket) { PlayerInteractEntityC2SPacket playerInteractPacket = (PlayerInteractEntityC2SPacket) packet; PacketByteBuf packetBuf = new PacketByteBuf(Unpooled.buffer()); - playerInteractPacket.write(packetBuf); + + // TODO: Fix packet write. + //playerInteractPacket.write(packetBuf); packetBuf.readVarInt(); InteractType type = packetBuf.readEnumConstant(InteractType.class); diff --git a/src/main/java/net/aoba/module/modules/misc/AutoEat.java b/src/main/java/net/aoba/module/modules/misc/AutoEat.java index 9829bb10..34945e6e 100644 --- a/src/main/java/net/aoba/module/modules/misc/AutoEat.java +++ b/src/main/java/net/aoba/module/modules/misc/AutoEat.java @@ -31,7 +31,9 @@ import net.aoba.settings.types.FloatSetting; import net.aoba.settings.types.KeybindSetting; import net.minecraft.client.util.InputUtil; -import net.minecraft.item.FoodComponent; +import net.minecraft.component.DataComponentTypes; +import net.minecraft.component.type.FoodComponent; +import net.minecraft.component.type.FoodComponents; import net.minecraft.item.Item; public class AutoEat extends Module implements FoodLevelListener { @@ -76,12 +78,13 @@ public void OnFoodLevelChanged(FoodLevelEvent readPacketEvent) { for(int i = 0; i< 9; i++) { Item item = MC.player.getInventory().getStack(i).getItem(); - if(!item.isFood()) { + // TODO: ensure it works. + FoodComponent food = item.getComponents().get(DataComponentTypes.FOOD); + if(food == null) continue; - } - FoodComponent food = item.getFoodComponent(); + if(bestFood != null) { - if(food.getHunger() > bestFood.getHunger()) { + if(food.nutrition() > bestFood.nutrition()) { bestFood = food; foodSlot = i; } diff --git a/src/main/java/net/aoba/module/modules/movement/Step.java b/src/main/java/net/aoba/module/modules/movement/Step.java index e94d3787..c090b03c 100644 --- a/src/main/java/net/aoba/module/modules/movement/Step.java +++ b/src/main/java/net/aoba/module/modules/movement/Step.java @@ -45,14 +45,12 @@ public Step() { @Override public void onDisable() { - if(MC.world != null) { - MC.player.setStepHeight(.5f); - } + } @Override public void onEnable() { - MC.player.setStepHeight(stepHeight.getValue().floatValue()); + } @Override @@ -60,6 +58,10 @@ public void onToggle() { } + public float getStepHeight() { + return stepHeight.getValue(); + } + public void setStepHeight(float height) { this.stepHeight.setValue(height); } diff --git a/src/main/java/net/aoba/module/modules/render/Breadcrumbs.java b/src/main/java/net/aoba/module/modules/render/Breadcrumbs.java index 038d55e2..27a159fc 100644 --- a/src/main/java/net/aoba/module/modules/render/Breadcrumbs.java +++ b/src/main/java/net/aoba/module/modules/render/Breadcrumbs.java @@ -28,6 +28,9 @@ import net.aoba.event.events.TickEvent; import net.aoba.event.listeners.RenderListener; import net.aoba.event.listeners.TickListener; +import net.aoba.gui.colors.Color; +import net.aoba.gui.colors.RainbowColor; + import org.lwjgl.glfw.GLFW; import net.aoba.module.Module; import net.aoba.settings.types.BooleanSetting; @@ -36,8 +39,6 @@ import net.aoba.settings.types.KeybindSetting; import net.minecraft.client.util.InputUtil; import net.minecraft.util.math.Vec3d; -import net.aoba.gui.Color; -import net.aoba.misc.RainbowColor; import net.aoba.misc.RenderUtils; public class Breadcrumbs extends Module implements RenderListener, TickListener { @@ -88,7 +89,7 @@ public void onToggle() { @Override public void OnRender(RenderEvent event) { for(int i = 0; i < this.positions.size() - 1; i++) { - RenderUtils.drawLine3D(event.GetMatrixStack(), this.positions.get(i), this.positions.get(i + 1), this.currentColor); + RenderUtils.drawLine3D(event.GetMatrix().peek().getPositionMatrix(), this.positions.get(i), this.positions.get(i + 1), this.currentColor); } } @@ -101,11 +102,5 @@ public void OnUpdate(TickEvent event) { positions.add(MC.player.getPos()); } } - if(this.rainbow.getValue()) { - this.rainbowColor.update(this.effectSpeed.getValue().floatValue()); - this.currentColor = this.rainbowColor.getColor(); - }else { - this.currentColor = color.getValue(); - } } } \ No newline at end of file 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 6434b31b..a6f224f2 100644 --- a/src/main/java/net/aoba/module/modules/render/ChestESP.java +++ b/src/main/java/net/aoba/module/modules/render/ChestESP.java @@ -29,9 +29,9 @@ import net.aoba.event.events.TickEvent; import net.aoba.event.listeners.RenderListener; import net.aoba.event.listeners.TickListener; -import net.aoba.gui.Color; +import net.aoba.gui.colors.Color; +import net.aoba.gui.colors.RainbowColor; import net.aoba.misc.ModuleUtils; -import net.aoba.misc.RainbowColor; import net.aoba.misc.RenderUtils; import net.aoba.module.Module; import net.aoba.settings.types.BooleanSetting; @@ -44,10 +44,7 @@ import net.minecraft.client.util.InputUtil; import net.minecraft.util.math.Box; -public class ChestESP extends Module implements RenderListener, TickListener { - private Color currentColor; - private RainbowColor rainbowColor; - +public class ChestESP extends Module implements RenderListener { private ColorSetting color = new ColorSetting("chestesp_color", "Color", "Color", new Color(0, 1f, 1f)); public BooleanSetting rainbow = new BooleanSetting("chestesp_rainbow", "Rainbow", "Rainbow", false); @@ -61,8 +58,6 @@ public ChestESP() { this.setCategory(Category.Render); this.setDescription("Allows the player to see Chests with an ESP."); - currentColor = color.getValue(); - rainbowColor = new RainbowColor(); this.addSetting(color); this.addSetting(rainbow); this.addSetting(effectSpeed); @@ -71,13 +66,11 @@ public ChestESP() { @Override public void onDisable() { Aoba.getInstance().eventManager.RemoveListener(RenderListener.class, this); - Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); } @Override public void onEnable() { Aoba.getInstance().eventManager.AddListener(RenderListener.class, this); - Aoba.getInstance().eventManager.AddListener(TickListener.class, this); } @Override @@ -91,19 +84,8 @@ public void OnRender(RenderEvent event) { for(BlockEntity blockEntity : blockEntities) { if(blockEntity instanceof ChestBlockEntity || blockEntity instanceof TrappedChestBlockEntity) { Box box = new Box(blockEntity.getPos()); - RenderUtils.draw3DBox(event.GetMatrixStack(), box, currentColor); + RenderUtils.draw3DBox(event.GetMatrix().peek().getPositionMatrix(), box, color.getValue()); } } } - - @Override - public void OnUpdate(TickEvent event) { - if(this.rainbow.getValue()) { - this.rainbowColor.update(this.effectSpeed.getValue().floatValue()); - this.currentColor = this.rainbowColor.getColor(); - }else { - this.currentColor = color.getValue(); - } - } - } 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 5c65822c..3db51ea9 100644 --- a/src/main/java/net/aoba/module/modules/render/EntityESP.java +++ b/src/main/java/net/aoba/module/modules/render/EntityESP.java @@ -21,13 +21,14 @@ */ package net.aoba.module.modules.render; +import org.joml.Matrix4f; import org.lwjgl.glfw.GLFW; import net.aoba.Aoba; import net.aoba.event.events.RenderEvent; import net.aoba.event.events.TickEvent; import net.aoba.event.listeners.RenderListener; import net.aoba.event.listeners.TickListener; -import net.aoba.gui.Color; +import net.aoba.gui.colors.Color; import net.aoba.misc.RenderUtils; import net.aoba.module.Module; import net.aoba.settings.types.BooleanSetting; @@ -86,28 +87,30 @@ public void onToggle() { @Override public void OnRender(RenderEvent event) { - MatrixStack matrixStack = event.GetMatrixStack(); + Matrix4f matrix4f = event.GetMatrix().peek().getPositionMatrix(); float partialTicks = event.GetPartialTicks(); - matrixStack.push(); + for (Entity entity : MC.world.getEntities()) { if (entity instanceof LivingEntity && !(entity instanceof PlayerEntity)) { - Box boundingBox = entity.getBoundingBox(); - Vec3d offset = RenderUtils.getEntityPositionOffsetInterpolated(entity, partialTicks); - boundingBox = boundingBox.offset(offset); + //double x = Math.lerp(partialTicks, entity.lastRenderX, entity.getX()); + //double y = Math.lerp(partialTicks, entity.lastRenderY, entity.getY()); + //double z = Math.lerp(partialTicks, entity.lastRenderZ, entity.getZ()); + Box boundingBox = entity.getBoundingBox(); + //Vec3d offset = RenderUtils.getEntityPositionOffsetInterpolated(entity, partialTicks); + //boundingBox = boundingBox.offset(offset); if (entity instanceof AnimalEntity) { - RenderUtils.draw3DBox(matrixStack, boundingBox, color_passive.getValue()); + RenderUtils.draw3DBox(matrix4f, boundingBox, color_passive.getValue()); } else if (entity instanceof Monster) { - RenderUtils.draw3DBox(matrixStack, boundingBox, color_enemies.getValue()); + RenderUtils.draw3DBox(matrix4f, boundingBox, color_enemies.getValue()); } else { - RenderUtils.draw3DBox(matrixStack, boundingBox, color_misc.getValue()); + RenderUtils.draw3DBox(matrix4f, boundingBox, color_misc.getValue()); } } } - matrixStack.pop(); } @Override 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 53ba6397..c01b586f 100644 --- a/src/main/java/net/aoba/module/modules/render/ItemESP.java +++ b/src/main/java/net/aoba/module/modules/render/ItemESP.java @@ -25,7 +25,7 @@ import net.aoba.Aoba; import net.aoba.event.events.RenderEvent; import net.aoba.event.listeners.RenderListener; -import net.aoba.gui.Color; +import net.aoba.gui.colors.Color; import net.aoba.misc.RenderUtils; import net.aoba.module.Module; import net.aoba.settings.types.ColorSetting; @@ -68,7 +68,7 @@ public void onToggle() { public void OnRender(RenderEvent event) { for (Entity entity : MC.world.getEntities()) { if(entity instanceof ItemEntity) { - RenderUtils.draw3DBox(event.GetMatrixStack(), entity.getBoundingBox(), color.getValue()); + RenderUtils.draw3DBox(event.GetMatrix().peek().getPositionMatrix(), entity.getBoundingBox(), color.getValue()); } } } diff --git a/src/main/java/net/aoba/module/modules/render/PlayerESP.java b/src/main/java/net/aoba/module/modules/render/PlayerESP.java index f0d7b05d..5c41d26c 100644 --- a/src/main/java/net/aoba/module/modules/render/PlayerESP.java +++ b/src/main/java/net/aoba/module/modules/render/PlayerESP.java @@ -25,7 +25,7 @@ import net.aoba.Aoba; import net.aoba.event.events.RenderEvent; import net.aoba.event.listeners.RenderListener; -import net.aoba.gui.Color; +import net.aoba.gui.colors.Color; import net.aoba.misc.RenderUtils; import net.aoba.module.Module; import net.aoba.settings.types.ColorSetting; @@ -70,7 +70,7 @@ public void onToggle() { public void OnRender(RenderEvent event) { for (AbstractClientPlayerEntity entity : MC.world.getPlayers()) { if(entity != MC.player) { - RenderUtils.draw3DBox(event.GetMatrixStack(), entity.getBoundingBox(), color_default.getValue()); + RenderUtils.draw3DBox(event.GetMatrix().peek().getPositionMatrix(), entity.getBoundingBox(), color_default.getValue()); } } } 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 5c28ce43..594a6810 100644 --- a/src/main/java/net/aoba/module/modules/render/SpawnerESP.java +++ b/src/main/java/net/aoba/module/modules/render/SpawnerESP.java @@ -27,7 +27,7 @@ import net.aoba.Aoba; import net.aoba.event.events.RenderEvent; import net.aoba.event.listeners.RenderListener; -import net.aoba.gui.Color; +import net.aoba.gui.colors.Color; import net.aoba.misc.ModuleUtils; import net.aoba.misc.RenderUtils; import net.aoba.module.Module; @@ -74,7 +74,7 @@ public void OnRender(RenderEvent event) { for(BlockEntity blockEntity : blockEntities) { if(blockEntity instanceof MobSpawnerBlockEntity) { Box box = new Box(blockEntity.getPos()); - RenderUtils.draw3DBox(event.GetMatrixStack(), box, color.getValue()); + RenderUtils.draw3DBox(event.GetMatrix().peek().getPositionMatrix(), box, color.getValue()); } } } diff --git a/src/main/java/net/aoba/module/modules/render/Tracer.java b/src/main/java/net/aoba/module/modules/render/Tracer.java index 82f1bffc..3b7d23d7 100644 --- a/src/main/java/net/aoba/module/modules/render/Tracer.java +++ b/src/main/java/net/aoba/module/modules/render/Tracer.java @@ -25,7 +25,7 @@ import net.aoba.Aoba; import net.aoba.event.events.RenderEvent; import net.aoba.event.listeners.RenderListener; -import net.aoba.gui.Color; +import net.aoba.gui.colors.Color; import net.aoba.misc.RenderUtils; import net.aoba.module.Module; import net.aoba.settings.types.ColorSetting; @@ -87,18 +87,18 @@ public void OnRender(RenderEvent event) { if(entity instanceof LivingEntity && (entity != MC.player)) { Vec3d interpolated = RenderUtils.getEntityPositionInterpolated(entity, MinecraftClient.getInstance().getTickDelta()); if (entity instanceof AnimalEntity) { - RenderUtils.drawLine3D(event.GetMatrixStack(), eyePosition, interpolated, color_passive.getValue()); + RenderUtils.drawLine3D(event.GetMatrix().peek().getPositionMatrix(), eyePosition, interpolated, color_passive.getValue()); } else if (entity instanceof Monster) { - RenderUtils.drawLine3D(event.GetMatrixStack(), eyePosition, interpolated, color_enemies.getValue()); + RenderUtils.drawLine3D(event.GetMatrix().peek().getPositionMatrix(), eyePosition, interpolated, color_enemies.getValue()); } else { - RenderUtils.drawLine3D(event.GetMatrixStack(), eyePosition, interpolated, color_misc.getValue()); + RenderUtils.drawLine3D(event.GetMatrix().peek().getPositionMatrix(), eyePosition, interpolated, color_misc.getValue()); } } } for(AbstractClientPlayerEntity player : MC.world.getPlayers()) { Vec3d interpolated = RenderUtils.getEntityPositionInterpolated(player, MinecraftClient.getInstance().getTickDelta()); - RenderUtils.drawLine3D(event.GetMatrixStack(), eyePosition, interpolated, color_player.getValue()); + RenderUtils.drawLine3D(event.GetMatrix().peek().getPositionMatrix(), eyePosition, interpolated, color_player.getValue()); } } } diff --git a/src/main/java/net/aoba/module/modules/render/Trajectory.java b/src/main/java/net/aoba/module/modules/render/Trajectory.java index 8df3bf54..f4013250 100644 --- a/src/main/java/net/aoba/module/modules/render/Trajectory.java +++ b/src/main/java/net/aoba/module/modules/render/Trajectory.java @@ -28,7 +28,7 @@ import net.aoba.Aoba; import net.aoba.event.events.RenderEvent; import net.aoba.event.listeners.RenderListener; -import net.aoba.gui.Color; +import net.aoba.gui.colors.Color; import net.aoba.misc.ModuleUtils; import net.aoba.module.Module; import net.aoba.settings.types.ColorSetting; @@ -77,15 +77,13 @@ public void onToggle() { @Override public void OnRender(RenderEvent event) { MinecraftClient mc = MinecraftClient.getInstance(); - MatrixStack matrixStack = event.GetMatrixStack(); - matrixStack.push(); - + + Matrix4f matrix4f = event.GetMatrix().peek().getPositionMatrix(); RenderSystem.setShaderColor(0, 0, 0, 1); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_DEPTH_TEST); - Matrix4f matrix = matrixStack.peek().getPositionMatrix(); Tessellator tessellator = RenderSystem.renderThreadTesselator(); BufferBuilder bufferBuilder = tessellator.getBuffer(); RenderSystem.setShader(GameRenderer::getPositionProgram); @@ -99,11 +97,11 @@ public void OnRender(RenderEvent event) { bufferBuilder.begin(VertexFormat.DrawMode.LINES, VertexFormats.POSITION); for(int iteration = 0; iteration < 1000; iteration++){ - bufferBuilder.vertex(matrix, (float) prevPoint.x, (float) prevPoint.y, (float) prevPoint.z).next(); + bufferBuilder.vertex(matrix4f, (float) prevPoint.x, (float) prevPoint.y, (float) prevPoint.z).next(); float distance = (float) ((initialVelocity)*Math.sin(2*mc.player.getRotationVector().x) / 9.0f); Vec3d nextPoint = mc.player.getRotationVector().multiply(distance); - bufferBuilder.vertex(matrix, (float) nextPoint.x, (float) nextPoint.y, (float) nextPoint.z).next(); + bufferBuilder.vertex(matrix4f, (float) nextPoint.x, (float) nextPoint.y, (float) nextPoint.z).next(); prevPoint = nextPoint; } @@ -114,8 +112,7 @@ public void OnRender(RenderEvent event) { GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glDisable(GL11.GL_BLEND); - - matrixStack.pop(); + } } \ No newline at end of file diff --git a/src/main/java/net/aoba/module/modules/render/XRay.java b/src/main/java/net/aoba/module/modules/render/XRay.java index 2db8d6bf..1da40c51 100644 --- a/src/main/java/net/aoba/module/modules/render/XRay.java +++ b/src/main/java/net/aoba/module/modules/render/XRay.java @@ -21,6 +21,7 @@ */ package net.aoba.module.modules.render; +import java.util.HashSet; import java.util.List; import org.lwjgl.glfw.GLFW; import com.google.common.collect.Lists; @@ -42,14 +43,15 @@ public XRay() { this.setCategory(Category.Render); this.setDescription("Allows the player to see ores."); + blocks = new BlocksSetting("xray_blocks", "Blocks", "Blocks that can be seen in Xray", - Lists.newArrayList(Blocks.EMERALD_ORE, Blocks.EMERALD_BLOCK, Blocks.DIAMOND_ORE, Blocks.DIAMOND_BLOCK, + new HashSet(Lists.newArrayList(Blocks.EMERALD_ORE, Blocks.EMERALD_BLOCK, Blocks.DIAMOND_ORE, Blocks.DIAMOND_BLOCK, Blocks.GOLD_ORE, Blocks.GOLD_BLOCK, Blocks.IRON_ORE, Blocks.IRON_BLOCK, Blocks.COAL_ORE, Blocks.COAL_BLOCK, Blocks.REDSTONE_BLOCK, Blocks.REDSTONE_ORE, Blocks.LAPIS_ORE, Blocks.LAPIS_BLOCK, Blocks.NETHER_QUARTZ_ORE, Blocks.MOSSY_COBBLESTONE, Blocks.STONE_BRICKS, Blocks.OAK_PLANKS, Blocks.DEEPSLATE_EMERALD_ORE, Blocks.DEEPSLATE_DIAMOND_ORE, - Blocks.DEEPSLATE_GOLD_ORE, Blocks.DEEPSLATE_IRON_ORE, Blocks.DEEPSLATE_COAL_ORE)); - blocks.setOnUpdate((List block) -> ReloadRenderer(block)); + Blocks.DEEPSLATE_GOLD_ORE, Blocks.DEEPSLATE_IRON_ORE, Blocks.DEEPSLATE_COAL_ORE))); + blocks.setOnUpdate((HashSet block) -> ReloadRenderer(block)); this.addSetting(blocks); } @@ -76,14 +78,14 @@ public void onToggle() { } public boolean isXRayBlock(Block b) { - List blockList = blocks.getValue(); + HashSet blockList = blocks.getValue(); if (blockList.contains(b)) { return true; } return false; } - public void ReloadRenderer(List block) { + public void ReloadRenderer(HashSet block) { if(MC.worldRenderer != null && this.getState()) { MC.worldRenderer.reload(); } diff --git a/src/main/java/net/aoba/module/modules/world/Nuker.java b/src/main/java/net/aoba/module/modules/world/Nuker.java index e4c9ca2d..3cf56575 100644 --- a/src/main/java/net/aoba/module/modules/world/Nuker.java +++ b/src/main/java/net/aoba/module/modules/world/Nuker.java @@ -21,62 +21,76 @@ */ package net.aoba.module.modules.world; +import java.util.HashSet; + import org.lwjgl.glfw.GLFW; import com.google.common.collect.Lists; import net.aoba.Aoba; +import net.aoba.event.events.BlockStateEvent; import net.aoba.event.events.RenderEvent; import net.aoba.event.events.TickEvent; +import net.aoba.event.listeners.BlockStateListener; import net.aoba.event.listeners.RenderListener; import net.aoba.event.listeners.TickListener; -import net.aoba.gui.Color; +import net.aoba.gui.colors.Color; import net.aoba.misc.RenderUtils; import net.aoba.module.Module; import net.aoba.settings.types.BlocksSetting; +import net.aoba.settings.types.BooleanSetting; import net.aoba.settings.types.ColorSetting; import net.aoba.settings.types.FloatSetting; import net.aoba.settings.types.KeybindSetting; import net.minecraft.block.Block; +import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.client.util.InputUtil; import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket.Action; +import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Box; import net.minecraft.util.math.Direction; -public class Nuker extends Module implements RenderListener, TickListener { +public class Nuker extends Module implements RenderListener, TickListener, BlockStateListener { + private BooleanSetting creative = new BooleanSetting("nuker_creative", "Creative", "Creative", false); private ColorSetting color = new ColorSetting("nuker_color", "Color", "Color", new Color(0, 1f, 1f)); private FloatSetting radius = new FloatSetting("nuker_radius", "Radius", "Radius", 5f, 0f, 15f, 1f); - private BlocksSetting blacklist = new BlocksSetting("nuker_blacklist", "Blacklist", "Blocks that will not be broken by Nuker.", Lists.newArrayList()); - + private BlocksSetting blacklist = new BlocksSetting("nuker_blacklist", "Blacklist", + "Blocks that will not be broken by Nuker.", new HashSet()); + + private BlockPos currentBlockToBreak = null; + public Nuker() { super(new KeybindSetting("key.nuker", "Nuker Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); this.setName("Nuker"); this.setCategory(Category.World); this.setDescription("Destroys blocks around the player."); - + + this.addSetting(creative); this.addSetting(radius); this.addSetting(color); this.addSetting(blacklist); } public void setRadius(int radius) { - this.radius.setValue((float)radius); + this.radius.setValue((float) radius); } @Override public void onDisable() { Aoba.getInstance().eventManager.RemoveListener(RenderListener.class, this); Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); + Aoba.getInstance().eventManager.RemoveListener(BlockStateListener.class, this); } @Override public void onEnable() { Aoba.getInstance().eventManager.AddListener(RenderListener.class, this); Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + Aoba.getInstance().eventManager.AddListener(BlockStateListener.class, this); } @Override @@ -85,20 +99,34 @@ public void onToggle() { @Override public void OnUpdate(TickEvent event) { - int rad = radius.getValue().intValue(); - for (int x = -rad; x < rad; x++) { - for (int y = rad; y > -rad; y--) { - for (int z = -rad; z < rad; z++) { - BlockPos blockpos = new BlockPos(MC.player.getBlockX() + x, (int) MC.player.getBlockY() + y, - (int) MC.player.getBlockZ() + z); - Block block = MC.world.getBlockState(blockpos).getBlock(); - if (block == Blocks.AIR || blacklist.getValue().contains(block)) - continue; - - MC.player.networkHandler.sendPacket( - new PlayerActionC2SPacket(Action.START_DESTROY_BLOCK, blockpos, Direction.NORTH)); - MC.player.networkHandler - .sendPacket(new PlayerActionC2SPacket(Action.STOP_DESTROY_BLOCK, blockpos, Direction.NORTH)); + if(creative.getValue()) { + int range = (int) (Math.floor(radius.getValue()) + 1); + Iterable blocks = BlockPos.iterateOutwards(new BlockPos(BlockPos.ofFloored(MC.player.getPos()).up()), range, range, range); + for (BlockPos blockPos : blocks) { + Block block = MC.world.getBlockState(blockPos).getBlock(); + if (block == Blocks.AIR || blacklist.getValue().contains(block)) + continue; + + MC.player.networkHandler.sendPacket(new PlayerActionC2SPacket(Action.START_DESTROY_BLOCK, blockPos, Direction.NORTH)); + MC.player.networkHandler.sendPacket(new PlayerActionC2SPacket(Action.STOP_DESTROY_BLOCK, blockPos, Direction.NORTH)); + MC.player.swingHand(Hand.MAIN_HAND); + } + }else { + if (currentBlockToBreak == null) { + currentBlockToBreak = getNextBlock(); + } + + if(currentBlockToBreak != null) { + + // Check to ensure that the block is not further than we can reach. + int range = (int) (Math.floor(radius.getValue()) + 1); + int rangeSqr = range ^ 2; + if(MC.player.getBlockPos().toCenterPos().distanceTo(currentBlockToBreak.toCenterPos()) > rangeSqr) { + currentBlockToBreak = null; + }else { + MC.player.networkHandler.sendPacket(new PlayerActionC2SPacket(Action.START_DESTROY_BLOCK, currentBlockToBreak, Direction.NORTH)); + MC.player.networkHandler.sendPacket(new PlayerActionC2SPacket(Action.STOP_DESTROY_BLOCK, currentBlockToBreak, Direction.NORTH)); + MC.player.swingHand(Hand.MAIN_HAND); } } } @@ -106,20 +134,38 @@ public void OnUpdate(TickEvent event) { @Override public void OnRender(RenderEvent event) { + if(currentBlockToBreak != null) { + RenderUtils.draw3DBox(event.GetMatrix().peek().getPositionMatrix(), new Box(currentBlockToBreak), color.getValue()); + } + } + + @Override + public void OnBlockStateChanged(BlockStateEvent event) { + if(currentBlockToBreak != null) { + BlockPos blockPos = event.getBlockPos(); + BlockState oldBlockState = event.getPreviousBlockState(); + if (blockPos.equals(currentBlockToBreak) && (oldBlockState.isAir())) { + currentBlockToBreak = null; + } + } + } + + private BlockPos getNextBlock() { + // Scan to find next block to begin breaking. int rad = radius.getValue().intValue(); - for (int x = -rad; x < rad; x++) { - for (int y = rad; y > -rad; y--) { + for (int y = rad; y > -rad; y--) { + for (int x = -rad; x < rad; x++) { for (int z = -rad; z < rad; z++) { - BlockPos blockpos = new BlockPos(MC.player.getBlockX()+ x, MC.player.getBlockY() + y, - MC.player.getBlockZ()+ z); + BlockPos blockpos = new BlockPos(MC.player.getBlockX() + x, (int) MC.player.getBlockY() + y, + (int) MC.player.getBlockZ() + z); Block block = MC.world.getBlockState(blockpos).getBlock(); - - if (block == Blocks.AIR || block == Blocks.WATER || block == Blocks.LAVA || blacklist.getValue().contains(block)) + if (block == Blocks.AIR || blacklist.getValue().contains(block)) continue; - - RenderUtils.draw3DBox(event.GetMatrixStack(), new Box(blockpos), color.getValue()); + + return blockpos; } } } + return null; } } diff --git a/src/main/java/net/aoba/module/modules/world/TileBreaker.java b/src/main/java/net/aoba/module/modules/world/TileBreaker.java index eec4c692..68f3a8f6 100644 --- a/src/main/java/net/aoba/module/modules/world/TileBreaker.java +++ b/src/main/java/net/aoba/module/modules/world/TileBreaker.java @@ -28,7 +28,7 @@ import net.aoba.event.events.TickEvent; import net.aoba.event.listeners.RenderListener; import net.aoba.event.listeners.TickListener; -import net.aoba.gui.Color; +import net.aoba.gui.colors.Color; import net.aoba.misc.RenderUtils; import net.aoba.module.Module; import net.aoba.settings.types.ColorSetting; @@ -160,7 +160,7 @@ public void OnRender(RenderEvent event) { mc.player.getBlockZ() + z); Block block = mc.world.getBlockState(blockpos).getBlock(); if (this.isTileBreakerBlock(block)) { - RenderUtils.draw3DBox(event.GetMatrixStack(), new Box(blockpos), color.getValue()); + RenderUtils.draw3DBox(event.GetMatrix().peek().getPositionMatrix(), new Box(blockpos), color.getValue()); } } } diff --git a/src/main/java/net/aoba/settings/SettingManager.java b/src/main/java/net/aoba/settings/SettingManager.java index e4675541..82d5bfbb 100644 --- a/src/main/java/net/aoba/settings/SettingManager.java +++ b/src/main/java/net/aoba/settings/SettingManager.java @@ -18,7 +18,7 @@ package net.aoba.settings; -import net.aoba.gui.Color; +import net.aoba.gui.colors.Color; import net.aoba.settings.types.FloatSetting; import net.aoba.settings.types.IntegerSetting; import net.aoba.utils.types.Vector2; @@ -34,6 +34,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import java.util.Properties; @@ -92,17 +93,20 @@ public static void saveSettings(String name, List> config_category2) config.setProperty(setting.ID, s); } case BLOCKS -> { - List s = (List) setting.getValue(); + @SuppressWarnings("unchecked") + HashSet s = (HashSet) setting.getValue(); String result = ""; - int sSize = s.size(); - for (int i = 0; i < sSize; i++) { - Block block = s.get(i); + + int iteration = 0; + for(Block block : s){ Identifier id = Registries.BLOCK.getId(block); result += id.getNamespace() + ":" + id.getPath(); - if (i != sSize - 1) { + if (iteration != s.size() - 1) { result += ","; } + iteration++; } + config.setProperty(setting.ID, result); } } @@ -180,7 +184,7 @@ public static void loadSettings(String name, List> config_category2) } case BLOCKS -> { String[] ids = value.split(","); - List result = new ArrayList(); + HashSet result = new HashSet(); for (String str : ids) { Identifier i = new Identifier(str); result.add(Registries.BLOCK.get(i)); diff --git a/src/main/java/net/aoba/settings/types/BlocksSetting.java b/src/main/java/net/aoba/settings/types/BlocksSetting.java index f929370b..30fed21f 100644 --- a/src/main/java/net/aoba/settings/types/BlocksSetting.java +++ b/src/main/java/net/aoba/settings/types/BlocksSetting.java @@ -18,24 +18,24 @@ package net.aoba.settings.types; -import java.util.List; +import java.util.HashSet; import net.aoba.settings.Setting; import net.minecraft.block.Block; -public class BlocksSetting extends Setting> { +public class BlocksSetting extends Setting> { - public BlocksSetting(String ID, String description, List default_value) { + public BlocksSetting(String ID, String description, HashSet default_value) { super(ID, description, default_value); type = TYPE.BLOCKS; } - public BlocksSetting(String ID, String displayName, String description, List default_value) { + public BlocksSetting(String ID, String displayName, String description, HashSet default_value) { super(ID, displayName, description, default_value); type = TYPE.BLOCKS; } @Override - protected boolean isValueValid(List value) { + protected boolean isValueValid(HashSet value) { return true; } } diff --git a/src/main/java/net/aoba/settings/types/ColorSetting.java b/src/main/java/net/aoba/settings/types/ColorSetting.java index 81a6f03c..2d5d446a 100644 --- a/src/main/java/net/aoba/settings/types/ColorSetting.java +++ b/src/main/java/net/aoba/settings/types/ColorSetting.java @@ -17,12 +17,15 @@ */ package net.aoba.settings.types; - -import net.aoba.gui.Color; +import net.aoba.gui.GuiManager; +import net.aoba.gui.colors.Color; +import net.aoba.gui.colors.ColorMode; import net.aoba.settings.Setting; public class ColorSetting extends Setting { + private ColorMode mode; + public ColorSetting(String ID, String description, Color default_value) { super(ID, description, default_value); type = TYPE.COLOR; @@ -37,4 +40,19 @@ public ColorSetting(String ID, String displayName, String description, Color def protected boolean isValueValid(Color value) { return (value.r <=255 && value.g <= 255 && value.b <= 255); } + + public void setMode(ColorMode color) { + mode = color; + switch(mode) { + case Normal: + this.setValue(default_value); + break; + case Rainbow: + this.setValue(GuiManager.rainbowColor); + break; + case Random: + this.setValue(GuiManager.randomColor); + break; + } + } } diff --git a/src/main/resources/aoba.mixins.json b/src/main/resources/aoba.mixins.json index f777748a..0b30885a 100644 --- a/src/main/resources/aoba.mixins.json +++ b/src/main/resources/aoba.mixins.json @@ -2,7 +2,7 @@ "required": true, "minVersion": "0.8", "package": "net.aoba.mixin", - "compatibilityLevel": "JAVA_17", + "compatibilityLevel": "JAVA_21", "mixins": [ "interfaces.ILivingEntity", "interfaces.IMinecraftClient", @@ -42,6 +42,7 @@ "ScreenMixin", "SimpleOptionMixin", "TitleScreenMixin", + "WorldChunkMixin", "WorldRendererMixin" ], "injectors": { diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 879e2c9a..046ee17a 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,9 +1,9 @@ { "schemaVersion": 1, "id": "aoba", - "version": "1.4.0", + "version": "1.4.1", "name": "Aoba Hacked Client", - "description": "Custom hacked client running on Fabric 1.20.4", + "description": "Custom hacked client running on Fabric 1.20.5", "authors": [ "Cocolots" ], @@ -22,9 +22,9 @@ "aoba.mixins.json" ], "depends": { - "fabricloader": ">=0.15.7", - "fabric-api": ">=0.96.3", - "minecraft": "1.20.4", - "java": ">=16" + "fabricloader": ">=0.15.10", + "fabric-api": ">=0.97.7", + "minecraft": "1.20.5", + "java": ">=21" } }