From b56dc934a5bd5bfbc0a6d0db7d21eab2e6e45ce8 Mon Sep 17 00:00:00 2001 From: feud <8michael@proton.me> Date: Fri, 10 Jan 2025 11:16:35 -0800 Subject: [PATCH] Initial commit --- README.md | 1 + build.gradle | 132 ++ gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 59203 bytes gradle/wrapper/gradle-wrapper.properties | 6 + gradlew | 164 ++ gradlew.bat | 90 ++ src/main/java/keystrokesmod/Raven.java | 143 ++ .../java/keystrokesmod/clickgui/ClickGui.java | 321 ++++ .../clickgui/components/Component.java | 29 + .../components/impl/BindComponent.java | 105 ++ .../components/impl/ButtonComponent.java | 65 + .../components/impl/CategoryComponent.java | 374 +++++ .../components/impl/DescriptionComponent.java | 34 + .../components/impl/ModuleComponent.java | 313 ++++ .../components/impl/SliderComponent.java | 132 ++ .../keystrokesmod/event/AllPacketsEvent.java | 16 + .../keystrokesmod/event/GuiUpdateEvent.java | 14 + .../java/keystrokesmod/event/JumpEvent.java | 40 + .../keystrokesmod/event/PostMotionEvent.java | 6 + .../event/PostPlayerInputEvent.java | 6 + .../keystrokesmod/event/PostUpdateEvent.java | 6 + .../keystrokesmod/event/PreInputEvent.java | 5 + .../keystrokesmod/event/PreMotionEvent.java | 106 ++ .../event/PrePlayerInputEvent.java | 57 + .../keystrokesmod/event/PreUpdateEvent.java | 6 + .../event/ReceivePacketEvent.java | 18 + .../keystrokesmod/event/SendPacketEvent.java | 18 + .../java/keystrokesmod/event/StrafeEvent.java | 49 + .../keystroke/KeySrokeRenderer.java | 99 ++ .../keystrokesmod/keystroke/KeyStroke.java | 19 + .../keystroke/KeyStrokeConfigGui.java | 90 ++ .../keystroke/KeyStrokeKeyRenderer.java | 55 + .../keystroke/KeyStrokeMouse.java | 72 + .../keystroke/keystrokeCommand.java | 27 + .../keystrokesmod/mixins/MixinLoader.java | 48 + .../mixins/impl/client/MixinMinecraft.java | 33 + .../client/MixinMovementInputFromOptions.java | 61 + .../mixins/impl/client/MixinWorld.java | 29 + .../mixins/impl/client/MixinWorldInfo.java | 31 + .../mixins/impl/entity/MixinEntity.java | 69 + .../impl/entity/MixinEntityLivingBase.java | 129 ++ .../mixins/impl/entity/MixinEntityPlayer.java | 182 +++ .../impl/entity/MixinEntityPlayerSP.java | 356 +++++ .../mixins/impl/network/MixinModList.java | 44 + .../impl/network/MixinNetworkManager.java | 46 + .../impl/render/MixinEntityRenderer.java | 28 + .../mixins/impl/render/MixinFontRenderer.java | 40 + .../mixins/impl/render/MixinGuiChat.java | 55 + .../mixins/impl/render/MixinGuiScreen.java | 28 + .../mixins/impl/render/MixinItemRenderer.java | 75 + .../mixins/impl/render/MixinLayerCape.java | 39 + .../mixins/impl/render/MixinModelBiped.java | 38 + .../mixins/impl/render/MixinRenderGlobal.java | 84 + .../render/MixinRendererLivingEntity.java | 89 ++ .../mixins/interfaces/IMixinItemRenderer.java | 6 + .../java/keystrokesmod/module/Module.java | 226 +++ .../keystrokesmod/module/ModuleManager.java | 230 +++ .../module/impl/client/ChatCommands.java | 18 + .../module/impl/client/CommandLine.java | 34 + .../keystrokesmod/module/impl/client/Gui.java | 37 + .../module/impl/client/Settings.java | 88 ++ .../module/impl/combat/AimAssist.java | 85 + .../module/impl/combat/AutoClicker.java | 260 +++ .../module/impl/combat/BurstClicker.java | 101 ++ .../module/impl/combat/ClickAssist.java | 143 ++ .../module/impl/combat/HitBox.java | 172 ++ .../module/impl/combat/JumpReset.java | 66 + .../module/impl/combat/KillAura.java | 1214 ++++++++++++++ .../module/impl/combat/Reach.java | 155 ++ .../module/impl/combat/Reduce.java | 33 + .../module/impl/combat/RodAimbot.java | 113 ++ .../module/impl/combat/TPAura.java | 66 + .../module/impl/combat/Velocity.java | 160 ++ .../module/impl/combat/WTap.java | 68 + .../keystrokesmod/module/impl/fun/Fun.java | 176 +++ .../module/impl/minigames/AutoRequeue.java | 56 + .../module/impl/minigames/AutoWho.java | 68 + .../module/impl/minigames/BedWars.java | 190 +++ .../module/impl/minigames/BridgeInfo.java | 276 ++++ .../module/impl/minigames/DuelsStats.java | 226 +++ .../module/impl/minigames/MurderMystery.java | 200 +++ .../module/impl/minigames/SkyWars.java | 87 + .../module/impl/minigames/SpeedBuilders.java | 574 +++++++ .../module/impl/minigames/SumoFences.java | 130 ++ .../module/impl/movement/Bhop.java | 149 ++ .../module/impl/movement/Boost.java | 56 + .../module/impl/movement/Fly.java | 150 ++ .../module/impl/movement/InvMove.java | 131 ++ .../module/impl/movement/KeepSprint.java | 53 + .../module/impl/movement/LongJump.java | 431 +++++ .../module/impl/movement/NoSlow.java | 256 +++ .../module/impl/movement/Speed.java | 33 + .../module/impl/movement/Sprint.java | 178 +++ .../module/impl/movement/StopMotion.java | 30 + .../module/impl/movement/Teleport.java | 112 ++ .../module/impl/movement/Timer.java | 40 + .../module/impl/movement/VClip.java | 29 + .../module/impl/other/Anticheat.java | 180 +++ .../module/impl/other/ChatBypass.java | 119 ++ .../module/impl/other/DebugAC.java | 134 ++ .../module/impl/other/FakeChat.java | 35 + .../module/impl/other/LatencyAlerts.java | 64 + .../module/impl/other/NameHider.java | 37 + .../keystrokesmod/module/impl/other/Test.java | 36 + .../module/impl/other/ViewPackets.java | 171 ++ .../module/impl/player/AntiAFK.java | 197 +++ .../module/impl/player/AntiFireball.java | 152 ++ .../module/impl/player/AutoJump.java | 42 + .../module/impl/player/AutoPlace.java | 139 ++ .../module/impl/player/AutoSwap.java | 19 + .../module/impl/player/AutoTool.java | 93 ++ .../module/impl/player/BedAura.java | 460 ++++++ .../module/impl/player/Blink.java | 171 ++ .../module/impl/player/DelayRemover.java | 40 + .../module/impl/player/Disabler.java | 184 +++ .../module/impl/player/FakeLag.java | 91 ++ .../module/impl/player/FastMine.java | 105 ++ .../module/impl/player/FastPlace.java | 85 + .../module/impl/player/Freecam.java | 193 +++ .../module/impl/player/InvManager.java | 746 +++++++++ .../module/impl/player/NoFall.java | 130 ++ .../module/impl/player/NoRotate.java | 107 ++ .../module/impl/player/Safewalk.java | 133 ++ .../module/impl/player/Scaffold.java | 894 +++++++++++ .../module/impl/player/Tower.java | 325 ++++ .../module/impl/player/WaterBucket.java | 72 + .../module/impl/render/AntiShuffle.java | 17 + .../module/impl/render/BedESP.java | 160 ++ .../module/impl/render/BreakProgress.java | 119 ++ .../module/impl/render/Chams.java | 70 + .../module/impl/render/ChestESP.java | 54 + .../module/impl/render/ExtendCamera.java | 49 + .../keystrokesmod/module/impl/render/HUD.java | 415 +++++ .../module/impl/render/Indicators.java | 311 ++++ .../module/impl/render/ItemESP.java | 166 ++ .../module/impl/render/MobESP.java | 109 ++ .../module/impl/render/Nametags.java | 355 +++++ .../module/impl/render/NoCameraClip.java | 9 + .../module/impl/render/NoHurtCam.java | 14 + .../module/impl/render/PlayerESP.java | 315 ++++ .../module/impl/render/Potions.java | 16 + .../module/impl/render/Radar.java | 96 ++ .../module/impl/render/Shaders.java | 77 + .../module/impl/render/TargetHUD.java | 302 ++++ .../module/impl/render/Tracers.java | 99 ++ .../module/impl/render/Trajectories.java | 220 +++ .../module/impl/render/Xray.java | 167 ++ .../module/impl/world/AntiBot.java | 126 ++ .../module/impl/world/Weather.java | 18 + .../keystrokesmod/module/setting/Setting.java | 17 + .../module/setting/impl/ButtonSetting.java | 70 + .../setting/impl/DescriptionSetting.java | 21 + .../module/setting/impl/SliderSetting.java | 129 ++ .../keystrokesmod/script/ClassObject.java | 22 + .../java/keystrokesmod/script/Diagnostic.java | 38 + .../java/keystrokesmod/script/Manager.java | 66 + .../java/keystrokesmod/script/Script.java | 199 +++ .../keystrokesmod/script/ScriptDefaults.java | 1286 +++++++++++++++ .../keystrokesmod/script/ScriptEvents.java | 142 ++ .../keystrokesmod/script/ScriptManager.java | 224 +++ .../script/SecureClassLoader.java | 24 + .../keystrokesmod/script/classes/Block.java | 38 + .../keystrokesmod/script/classes/Bridge.java | 35 + .../keystrokesmod/script/classes/Entity.java | 390 +++++ .../keystrokesmod/script/classes/Image.java | 58 + .../script/classes/ItemStack.java | 99 ++ .../keystrokesmod/script/classes/Json.java | 86 + .../script/classes/NetworkPlayer.java | 56 + .../script/classes/PlayerState.java | 40 + .../keystrokesmod/script/classes/Request.java | 98 ++ .../script/classes/Response.java | 37 + .../script/classes/TileEntity.java | 36 + .../keystrokesmod/script/classes/Vec3.java | 92 ++ .../keystrokesmod/script/classes/World.java | 100 ++ .../script/packets/clientbound/S06.java | 24 + .../script/packets/clientbound/S08.java | 17 + .../script/packets/clientbound/S12.java | 22 + .../script/packets/clientbound/S23.java | 25 + .../script/packets/clientbound/S27.java | 17 + .../script/packets/clientbound/S29.java | 27 + .../script/packets/clientbound/S2A.java | 23 + .../script/packets/clientbound/S2F.java | 24 + .../script/packets/clientbound/S3A.java | 17 + .../script/packets/clientbound/S3E.java | 44 + .../script/packets/clientbound/S48.java | 20 + .../script/packets/clientbound/SPacket.java | 11 + .../script/packets/serverbound/C01.java | 22 + .../script/packets/serverbound/C02.java | 43 + .../script/packets/serverbound/C03.java | 49 + .../script/packets/serverbound/C07.java | 32 + .../script/packets/serverbound/C08.java | 33 + .../script/packets/serverbound/C09.java | 22 + .../script/packets/serverbound/C0A.java | 13 + .../script/packets/serverbound/C0B.java | 27 + .../script/packets/serverbound/C0D.java | 20 + .../script/packets/serverbound/C0E.java | 37 + .../script/packets/serverbound/C0F.java | 25 + .../script/packets/serverbound/C10.java | 26 + .../script/packets/serverbound/C13.java | 39 + .../script/packets/serverbound/C16.java | 23 + .../script/packets/serverbound/CPacket.java | 20 + .../packets/serverbound/PacketHandler.java | 172 ++ .../keystrokesmod/utility/BlockUtils.java | 128 ++ .../keystrokesmod/utility/CPSCalculator.java | 69 + .../java/keystrokesmod/utility/Commands.java | 503 ++++++ .../utility/DebugInfoRenderer.java | 21 + .../keystrokesmod/utility/ModuleUtils.java | 179 +++ .../keystrokesmod/utility/MovementFix.java | 96 ++ .../keystrokesmod/utility/NetworkUtils.java | 142 ++ .../keystrokesmod/utility/PacketUtils.java | 30 + .../keystrokesmod/utility/PacketsHandler.java | 134 ++ src/main/java/keystrokesmod/utility/Ping.java | 47 + .../keystrokesmod/utility/PlayerData.java | 78 + .../keystrokesmod/utility/ProfileUtils.java | 106 ++ .../keystrokesmod/utility/RandomUtils.java | 29 + .../keystrokesmod/utility/Reflection.java | 367 +++++ .../keystrokesmod/utility/RenderUtils.java | 956 +++++++++++ .../keystrokesmod/utility/RotationUtils.java | 485 ++++++ .../utility/ScaffoldBlockCount.java | 79 + .../java/keystrokesmod/utility/Theme.java | 63 + .../java/keystrokesmod/utility/Timer.java | 80 + .../java/keystrokesmod/utility/Utils.java | 1398 +++++++++++++++++ .../utility/command/Command.java | 38 + .../utility/command/CommandManager.java | 92 ++ .../utility/command/impl/Binds.java | 77 + .../utility/command/impl/Cname.java | 21 + .../utility/command/impl/Enemy.java | 26 + .../utility/command/impl/Friend.java | 26 + .../utility/command/impl/Help.java | 24 + .../utility/command/impl/Name.java | 19 + .../utility/command/impl/Ping.java | 16 + .../keystrokesmod/utility/command/impl/Q.java | 60 + .../utility/command/impl/QList.java | 53 + .../utility/profile/Manager.java | 48 + .../utility/profile/Profile.java | 28 + .../utility/profile/ProfileManager.java | 311 ++++ .../utility/profile/ProfileModule.java | 52 + .../utility/shader/BlurUtils.java | 29 + .../utility/shader/KawaseBloom.java | 118 ++ .../utility/shader/KawaseBlur.java | 103 ++ .../utility/shader/RoundedUtils.java | 192 +++ .../utility/shader/ShaderUtils.java | 495 ++++++ .../keystrokesmod/textures/capes/anime.png | Bin 0 -> 51473 bytes .../keystrokesmod/textures/capes/rvn_aqua.png | Bin 0 -> 10377 bytes .../textures/capes/rvn_green.png | Bin 0 -> 9683 bytes .../textures/capes/rvn_purple.png | Bin 0 -> 10460 bytes .../keystrokesmod/textures/capes/rvn_red.png | Bin 0 -> 8820 bytes .../textures/capes/rvn_white.png | Bin 0 -> 10599 bytes .../textures/capes/rvn_yellow.png | Bin 0 -> 10255 bytes .../assets/minecraft/shaders/vertex.vsh | 6 + src/main/resources/mcmod.info | 15 + src/main/resources/mixins.raven.json | 27 + 252 files changed, 30609 insertions(+) create mode 100644 README.md create mode 100644 build.gradle create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100644 gradlew create mode 100644 gradlew.bat create mode 100644 src/main/java/keystrokesmod/Raven.java create mode 100644 src/main/java/keystrokesmod/clickgui/ClickGui.java create mode 100644 src/main/java/keystrokesmod/clickgui/components/Component.java create mode 100644 src/main/java/keystrokesmod/clickgui/components/impl/BindComponent.java create mode 100644 src/main/java/keystrokesmod/clickgui/components/impl/ButtonComponent.java create mode 100644 src/main/java/keystrokesmod/clickgui/components/impl/CategoryComponent.java create mode 100644 src/main/java/keystrokesmod/clickgui/components/impl/DescriptionComponent.java create mode 100644 src/main/java/keystrokesmod/clickgui/components/impl/ModuleComponent.java create mode 100644 src/main/java/keystrokesmod/clickgui/components/impl/SliderComponent.java create mode 100644 src/main/java/keystrokesmod/event/AllPacketsEvent.java create mode 100644 src/main/java/keystrokesmod/event/GuiUpdateEvent.java create mode 100644 src/main/java/keystrokesmod/event/JumpEvent.java create mode 100644 src/main/java/keystrokesmod/event/PostMotionEvent.java create mode 100644 src/main/java/keystrokesmod/event/PostPlayerInputEvent.java create mode 100644 src/main/java/keystrokesmod/event/PostUpdateEvent.java create mode 100644 src/main/java/keystrokesmod/event/PreInputEvent.java create mode 100644 src/main/java/keystrokesmod/event/PreMotionEvent.java create mode 100644 src/main/java/keystrokesmod/event/PrePlayerInputEvent.java create mode 100644 src/main/java/keystrokesmod/event/PreUpdateEvent.java create mode 100644 src/main/java/keystrokesmod/event/ReceivePacketEvent.java create mode 100644 src/main/java/keystrokesmod/event/SendPacketEvent.java create mode 100644 src/main/java/keystrokesmod/event/StrafeEvent.java create mode 100644 src/main/java/keystrokesmod/keystroke/KeySrokeRenderer.java create mode 100644 src/main/java/keystrokesmod/keystroke/KeyStroke.java create mode 100644 src/main/java/keystrokesmod/keystroke/KeyStrokeConfigGui.java create mode 100644 src/main/java/keystrokesmod/keystroke/KeyStrokeKeyRenderer.java create mode 100644 src/main/java/keystrokesmod/keystroke/KeyStrokeMouse.java create mode 100644 src/main/java/keystrokesmod/keystroke/keystrokeCommand.java create mode 100644 src/main/java/keystrokesmod/mixins/MixinLoader.java create mode 100644 src/main/java/keystrokesmod/mixins/impl/client/MixinMinecraft.java create mode 100644 src/main/java/keystrokesmod/mixins/impl/client/MixinMovementInputFromOptions.java create mode 100644 src/main/java/keystrokesmod/mixins/impl/client/MixinWorld.java create mode 100644 src/main/java/keystrokesmod/mixins/impl/client/MixinWorldInfo.java create mode 100644 src/main/java/keystrokesmod/mixins/impl/entity/MixinEntity.java create mode 100644 src/main/java/keystrokesmod/mixins/impl/entity/MixinEntityLivingBase.java create mode 100644 src/main/java/keystrokesmod/mixins/impl/entity/MixinEntityPlayer.java create mode 100644 src/main/java/keystrokesmod/mixins/impl/entity/MixinEntityPlayerSP.java create mode 100644 src/main/java/keystrokesmod/mixins/impl/network/MixinModList.java create mode 100644 src/main/java/keystrokesmod/mixins/impl/network/MixinNetworkManager.java create mode 100644 src/main/java/keystrokesmod/mixins/impl/render/MixinEntityRenderer.java create mode 100644 src/main/java/keystrokesmod/mixins/impl/render/MixinFontRenderer.java create mode 100644 src/main/java/keystrokesmod/mixins/impl/render/MixinGuiChat.java create mode 100644 src/main/java/keystrokesmod/mixins/impl/render/MixinGuiScreen.java create mode 100644 src/main/java/keystrokesmod/mixins/impl/render/MixinItemRenderer.java create mode 100644 src/main/java/keystrokesmod/mixins/impl/render/MixinLayerCape.java create mode 100644 src/main/java/keystrokesmod/mixins/impl/render/MixinModelBiped.java create mode 100644 src/main/java/keystrokesmod/mixins/impl/render/MixinRenderGlobal.java create mode 100644 src/main/java/keystrokesmod/mixins/impl/render/MixinRendererLivingEntity.java create mode 100644 src/main/java/keystrokesmod/mixins/interfaces/IMixinItemRenderer.java create mode 100644 src/main/java/keystrokesmod/module/Module.java create mode 100644 src/main/java/keystrokesmod/module/ModuleManager.java create mode 100644 src/main/java/keystrokesmod/module/impl/client/ChatCommands.java create mode 100644 src/main/java/keystrokesmod/module/impl/client/CommandLine.java create mode 100644 src/main/java/keystrokesmod/module/impl/client/Gui.java create mode 100644 src/main/java/keystrokesmod/module/impl/client/Settings.java create mode 100644 src/main/java/keystrokesmod/module/impl/combat/AimAssist.java create mode 100644 src/main/java/keystrokesmod/module/impl/combat/AutoClicker.java create mode 100644 src/main/java/keystrokesmod/module/impl/combat/BurstClicker.java create mode 100644 src/main/java/keystrokesmod/module/impl/combat/ClickAssist.java create mode 100644 src/main/java/keystrokesmod/module/impl/combat/HitBox.java create mode 100644 src/main/java/keystrokesmod/module/impl/combat/JumpReset.java create mode 100644 src/main/java/keystrokesmod/module/impl/combat/KillAura.java create mode 100644 src/main/java/keystrokesmod/module/impl/combat/Reach.java create mode 100644 src/main/java/keystrokesmod/module/impl/combat/Reduce.java create mode 100644 src/main/java/keystrokesmod/module/impl/combat/RodAimbot.java create mode 100644 src/main/java/keystrokesmod/module/impl/combat/TPAura.java create mode 100644 src/main/java/keystrokesmod/module/impl/combat/Velocity.java create mode 100644 src/main/java/keystrokesmod/module/impl/combat/WTap.java create mode 100644 src/main/java/keystrokesmod/module/impl/fun/Fun.java create mode 100644 src/main/java/keystrokesmod/module/impl/minigames/AutoRequeue.java create mode 100644 src/main/java/keystrokesmod/module/impl/minigames/AutoWho.java create mode 100644 src/main/java/keystrokesmod/module/impl/minigames/BedWars.java create mode 100644 src/main/java/keystrokesmod/module/impl/minigames/BridgeInfo.java create mode 100644 src/main/java/keystrokesmod/module/impl/minigames/DuelsStats.java create mode 100644 src/main/java/keystrokesmod/module/impl/minigames/MurderMystery.java create mode 100644 src/main/java/keystrokesmod/module/impl/minigames/SkyWars.java create mode 100644 src/main/java/keystrokesmod/module/impl/minigames/SpeedBuilders.java create mode 100644 src/main/java/keystrokesmod/module/impl/minigames/SumoFences.java create mode 100644 src/main/java/keystrokesmod/module/impl/movement/Bhop.java create mode 100644 src/main/java/keystrokesmod/module/impl/movement/Boost.java create mode 100644 src/main/java/keystrokesmod/module/impl/movement/Fly.java create mode 100644 src/main/java/keystrokesmod/module/impl/movement/InvMove.java create mode 100644 src/main/java/keystrokesmod/module/impl/movement/KeepSprint.java create mode 100644 src/main/java/keystrokesmod/module/impl/movement/LongJump.java create mode 100644 src/main/java/keystrokesmod/module/impl/movement/NoSlow.java create mode 100644 src/main/java/keystrokesmod/module/impl/movement/Speed.java create mode 100644 src/main/java/keystrokesmod/module/impl/movement/Sprint.java create mode 100644 src/main/java/keystrokesmod/module/impl/movement/StopMotion.java create mode 100644 src/main/java/keystrokesmod/module/impl/movement/Teleport.java create mode 100644 src/main/java/keystrokesmod/module/impl/movement/Timer.java create mode 100644 src/main/java/keystrokesmod/module/impl/movement/VClip.java create mode 100644 src/main/java/keystrokesmod/module/impl/other/Anticheat.java create mode 100644 src/main/java/keystrokesmod/module/impl/other/ChatBypass.java create mode 100644 src/main/java/keystrokesmod/module/impl/other/DebugAC.java create mode 100644 src/main/java/keystrokesmod/module/impl/other/FakeChat.java create mode 100644 src/main/java/keystrokesmod/module/impl/other/LatencyAlerts.java create mode 100644 src/main/java/keystrokesmod/module/impl/other/NameHider.java create mode 100644 src/main/java/keystrokesmod/module/impl/other/Test.java create mode 100644 src/main/java/keystrokesmod/module/impl/other/ViewPackets.java create mode 100644 src/main/java/keystrokesmod/module/impl/player/AntiAFK.java create mode 100644 src/main/java/keystrokesmod/module/impl/player/AntiFireball.java create mode 100644 src/main/java/keystrokesmod/module/impl/player/AutoJump.java create mode 100644 src/main/java/keystrokesmod/module/impl/player/AutoPlace.java create mode 100644 src/main/java/keystrokesmod/module/impl/player/AutoSwap.java create mode 100644 src/main/java/keystrokesmod/module/impl/player/AutoTool.java create mode 100644 src/main/java/keystrokesmod/module/impl/player/BedAura.java create mode 100644 src/main/java/keystrokesmod/module/impl/player/Blink.java create mode 100644 src/main/java/keystrokesmod/module/impl/player/DelayRemover.java create mode 100644 src/main/java/keystrokesmod/module/impl/player/Disabler.java create mode 100644 src/main/java/keystrokesmod/module/impl/player/FakeLag.java create mode 100644 src/main/java/keystrokesmod/module/impl/player/FastMine.java create mode 100644 src/main/java/keystrokesmod/module/impl/player/FastPlace.java create mode 100644 src/main/java/keystrokesmod/module/impl/player/Freecam.java create mode 100644 src/main/java/keystrokesmod/module/impl/player/InvManager.java create mode 100644 src/main/java/keystrokesmod/module/impl/player/NoFall.java create mode 100644 src/main/java/keystrokesmod/module/impl/player/NoRotate.java create mode 100644 src/main/java/keystrokesmod/module/impl/player/Safewalk.java create mode 100644 src/main/java/keystrokesmod/module/impl/player/Scaffold.java create mode 100644 src/main/java/keystrokesmod/module/impl/player/Tower.java create mode 100644 src/main/java/keystrokesmod/module/impl/player/WaterBucket.java create mode 100644 src/main/java/keystrokesmod/module/impl/render/AntiShuffle.java create mode 100644 src/main/java/keystrokesmod/module/impl/render/BedESP.java create mode 100644 src/main/java/keystrokesmod/module/impl/render/BreakProgress.java create mode 100644 src/main/java/keystrokesmod/module/impl/render/Chams.java create mode 100644 src/main/java/keystrokesmod/module/impl/render/ChestESP.java create mode 100644 src/main/java/keystrokesmod/module/impl/render/ExtendCamera.java create mode 100644 src/main/java/keystrokesmod/module/impl/render/HUD.java create mode 100644 src/main/java/keystrokesmod/module/impl/render/Indicators.java create mode 100644 src/main/java/keystrokesmod/module/impl/render/ItemESP.java create mode 100644 src/main/java/keystrokesmod/module/impl/render/MobESP.java create mode 100644 src/main/java/keystrokesmod/module/impl/render/Nametags.java create mode 100644 src/main/java/keystrokesmod/module/impl/render/NoCameraClip.java create mode 100644 src/main/java/keystrokesmod/module/impl/render/NoHurtCam.java create mode 100644 src/main/java/keystrokesmod/module/impl/render/PlayerESP.java create mode 100644 src/main/java/keystrokesmod/module/impl/render/Potions.java create mode 100644 src/main/java/keystrokesmod/module/impl/render/Radar.java create mode 100644 src/main/java/keystrokesmod/module/impl/render/Shaders.java create mode 100644 src/main/java/keystrokesmod/module/impl/render/TargetHUD.java create mode 100644 src/main/java/keystrokesmod/module/impl/render/Tracers.java create mode 100644 src/main/java/keystrokesmod/module/impl/render/Trajectories.java create mode 100644 src/main/java/keystrokesmod/module/impl/render/Xray.java create mode 100644 src/main/java/keystrokesmod/module/impl/world/AntiBot.java create mode 100644 src/main/java/keystrokesmod/module/impl/world/Weather.java create mode 100644 src/main/java/keystrokesmod/module/setting/Setting.java create mode 100644 src/main/java/keystrokesmod/module/setting/impl/ButtonSetting.java create mode 100644 src/main/java/keystrokesmod/module/setting/impl/DescriptionSetting.java create mode 100644 src/main/java/keystrokesmod/module/setting/impl/SliderSetting.java create mode 100644 src/main/java/keystrokesmod/script/ClassObject.java create mode 100644 src/main/java/keystrokesmod/script/Diagnostic.java create mode 100644 src/main/java/keystrokesmod/script/Manager.java create mode 100644 src/main/java/keystrokesmod/script/Script.java create mode 100644 src/main/java/keystrokesmod/script/ScriptDefaults.java create mode 100644 src/main/java/keystrokesmod/script/ScriptEvents.java create mode 100644 src/main/java/keystrokesmod/script/ScriptManager.java create mode 100644 src/main/java/keystrokesmod/script/SecureClassLoader.java create mode 100644 src/main/java/keystrokesmod/script/classes/Block.java create mode 100644 src/main/java/keystrokesmod/script/classes/Bridge.java create mode 100644 src/main/java/keystrokesmod/script/classes/Entity.java create mode 100644 src/main/java/keystrokesmod/script/classes/Image.java create mode 100644 src/main/java/keystrokesmod/script/classes/ItemStack.java create mode 100644 src/main/java/keystrokesmod/script/classes/Json.java create mode 100644 src/main/java/keystrokesmod/script/classes/NetworkPlayer.java create mode 100644 src/main/java/keystrokesmod/script/classes/PlayerState.java create mode 100644 src/main/java/keystrokesmod/script/classes/Request.java create mode 100644 src/main/java/keystrokesmod/script/classes/Response.java create mode 100644 src/main/java/keystrokesmod/script/classes/TileEntity.java create mode 100644 src/main/java/keystrokesmod/script/classes/Vec3.java create mode 100644 src/main/java/keystrokesmod/script/classes/World.java create mode 100644 src/main/java/keystrokesmod/script/packets/clientbound/S06.java create mode 100644 src/main/java/keystrokesmod/script/packets/clientbound/S08.java create mode 100644 src/main/java/keystrokesmod/script/packets/clientbound/S12.java create mode 100644 src/main/java/keystrokesmod/script/packets/clientbound/S23.java create mode 100644 src/main/java/keystrokesmod/script/packets/clientbound/S27.java create mode 100644 src/main/java/keystrokesmod/script/packets/clientbound/S29.java create mode 100644 src/main/java/keystrokesmod/script/packets/clientbound/S2A.java create mode 100644 src/main/java/keystrokesmod/script/packets/clientbound/S2F.java create mode 100644 src/main/java/keystrokesmod/script/packets/clientbound/S3A.java create mode 100644 src/main/java/keystrokesmod/script/packets/clientbound/S3E.java create mode 100644 src/main/java/keystrokesmod/script/packets/clientbound/S48.java create mode 100644 src/main/java/keystrokesmod/script/packets/clientbound/SPacket.java create mode 100644 src/main/java/keystrokesmod/script/packets/serverbound/C01.java create mode 100644 src/main/java/keystrokesmod/script/packets/serverbound/C02.java create mode 100644 src/main/java/keystrokesmod/script/packets/serverbound/C03.java create mode 100644 src/main/java/keystrokesmod/script/packets/serverbound/C07.java create mode 100644 src/main/java/keystrokesmod/script/packets/serverbound/C08.java create mode 100644 src/main/java/keystrokesmod/script/packets/serverbound/C09.java create mode 100644 src/main/java/keystrokesmod/script/packets/serverbound/C0A.java create mode 100644 src/main/java/keystrokesmod/script/packets/serverbound/C0B.java create mode 100644 src/main/java/keystrokesmod/script/packets/serverbound/C0D.java create mode 100644 src/main/java/keystrokesmod/script/packets/serverbound/C0E.java create mode 100644 src/main/java/keystrokesmod/script/packets/serverbound/C0F.java create mode 100644 src/main/java/keystrokesmod/script/packets/serverbound/C10.java create mode 100644 src/main/java/keystrokesmod/script/packets/serverbound/C13.java create mode 100644 src/main/java/keystrokesmod/script/packets/serverbound/C16.java create mode 100644 src/main/java/keystrokesmod/script/packets/serverbound/CPacket.java create mode 100644 src/main/java/keystrokesmod/script/packets/serverbound/PacketHandler.java create mode 100644 src/main/java/keystrokesmod/utility/BlockUtils.java create mode 100644 src/main/java/keystrokesmod/utility/CPSCalculator.java create mode 100644 src/main/java/keystrokesmod/utility/Commands.java create mode 100644 src/main/java/keystrokesmod/utility/DebugInfoRenderer.java create mode 100644 src/main/java/keystrokesmod/utility/ModuleUtils.java create mode 100644 src/main/java/keystrokesmod/utility/MovementFix.java create mode 100644 src/main/java/keystrokesmod/utility/NetworkUtils.java create mode 100644 src/main/java/keystrokesmod/utility/PacketUtils.java create mode 100644 src/main/java/keystrokesmod/utility/PacketsHandler.java create mode 100644 src/main/java/keystrokesmod/utility/Ping.java create mode 100644 src/main/java/keystrokesmod/utility/PlayerData.java create mode 100644 src/main/java/keystrokesmod/utility/ProfileUtils.java create mode 100644 src/main/java/keystrokesmod/utility/RandomUtils.java create mode 100644 src/main/java/keystrokesmod/utility/Reflection.java create mode 100644 src/main/java/keystrokesmod/utility/RenderUtils.java create mode 100644 src/main/java/keystrokesmod/utility/RotationUtils.java create mode 100644 src/main/java/keystrokesmod/utility/ScaffoldBlockCount.java create mode 100644 src/main/java/keystrokesmod/utility/Theme.java create mode 100644 src/main/java/keystrokesmod/utility/Timer.java create mode 100644 src/main/java/keystrokesmod/utility/Utils.java create mode 100644 src/main/java/keystrokesmod/utility/command/Command.java create mode 100644 src/main/java/keystrokesmod/utility/command/CommandManager.java create mode 100644 src/main/java/keystrokesmod/utility/command/impl/Binds.java create mode 100644 src/main/java/keystrokesmod/utility/command/impl/Cname.java create mode 100644 src/main/java/keystrokesmod/utility/command/impl/Enemy.java create mode 100644 src/main/java/keystrokesmod/utility/command/impl/Friend.java create mode 100644 src/main/java/keystrokesmod/utility/command/impl/Help.java create mode 100644 src/main/java/keystrokesmod/utility/command/impl/Name.java create mode 100644 src/main/java/keystrokesmod/utility/command/impl/Ping.java create mode 100644 src/main/java/keystrokesmod/utility/command/impl/Q.java create mode 100644 src/main/java/keystrokesmod/utility/command/impl/QList.java create mode 100644 src/main/java/keystrokesmod/utility/profile/Manager.java create mode 100644 src/main/java/keystrokesmod/utility/profile/Profile.java create mode 100644 src/main/java/keystrokesmod/utility/profile/ProfileManager.java create mode 100644 src/main/java/keystrokesmod/utility/profile/ProfileModule.java create mode 100644 src/main/java/keystrokesmod/utility/shader/BlurUtils.java create mode 100644 src/main/java/keystrokesmod/utility/shader/KawaseBloom.java create mode 100644 src/main/java/keystrokesmod/utility/shader/KawaseBlur.java create mode 100644 src/main/java/keystrokesmod/utility/shader/RoundedUtils.java create mode 100644 src/main/java/keystrokesmod/utility/shader/ShaderUtils.java create mode 100644 src/main/resources/assets/keystrokesmod/textures/capes/anime.png create mode 100644 src/main/resources/assets/keystrokesmod/textures/capes/rvn_aqua.png create mode 100644 src/main/resources/assets/keystrokesmod/textures/capes/rvn_green.png create mode 100644 src/main/resources/assets/keystrokesmod/textures/capes/rvn_purple.png create mode 100644 src/main/resources/assets/keystrokesmod/textures/capes/rvn_red.png create mode 100644 src/main/resources/assets/keystrokesmod/textures/capes/rvn_white.png create mode 100644 src/main/resources/assets/keystrokesmod/textures/capes/rvn_yellow.png create mode 100644 src/main/resources/assets/minecraft/shaders/vertex.vsh create mode 100644 src/main/resources/mcmod.info create mode 100644 src/main/resources/mixins.raven.json diff --git a/README.md b/README.md new file mode 100644 index 0000000..8456f58 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Raven bS Premium diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..4e70812 --- /dev/null +++ b/build.gradle @@ -0,0 +1,132 @@ +buildscript { + repositories { + mavenCentral() + maven { url 'https://plugins.gradle.org/m2/' } + maven { + name = "forge" + url = "http://files.minecraftforge.net/maven" + } + maven { + url 'https://repo.spongepowered.org/maven' + } + } + dependencies { + classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT' + classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1' + classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT' + } +} + +apply plugin: 'com.github.johnrengelman.shadow' +apply plugin: 'net.minecraftforge.gradle.forge' +apply plugin: 'org.spongepowered.mixin' +apply plugin: 'java' + +group = "keystrokesmod" +archivesBaseName = "raven-bS" + +compileJava { + sourceCompatibility = '1.8' + targetCompatibility = '1.8' + options.encoding 'UTF-8' +} + +minecraft { + version = "1.8.9-11.15.1.2318-1.8.9" + runDir = "run" + + mappings = "stable_20" + makeObfSourceJar = false + clientJvmArgs += '-Dfml.coreMods.load=keystrokesmod.mixins.MixinLoader' +} + +mixin { + defaultObfuscationEnv searge + sourceSets { + main { + ext.refMap = 'mixins.raven.refmap.json' + } + } +} + +repositories { + mavenCentral() + maven { + url 'https://repo.spongepowered.org/maven' + } +} + +configurations { + embed + compile.extendsFrom embed +} + +dependencies { + implementation group: 'commons-io', name: 'commons-io', version: '2.11.0' + embed('org.spongepowered:mixin:0.6-SNAPSHOT') { + exclude module: 'gson' + exclude module: 'guava' + exclude module: 'jarjar' + exclude module: 'commons-codec' + exclude module: 'commons-io' + exclude module: 'launchwrapper' + exclude module: 'asm-commons' + exclude module: 'slf4j-api' + } + implementation 'org.jetbrains:annotations:24.1.0' +} + +processResources { + inputs.property "version", project.version + inputs.property "mcversion", project.minecraft.version + + from(sourceSets.main.resources.srcDirs) { + include 'mcmod.info' + + expand 'version': project.version, 'mcversion': project.minecraft.version + } + + from(sourceSets.main.resources.srcDirs) { + exclude 'mcmod.info' + } +} + +jar { + from(configurations.embed.collect { + it.isDirectory() ? it : zipTree(it) + }) { + exclude 'dummyThing', + 'LICENSE.txt', + 'META-INF/MUMFREY.RSA', + 'META-INF/maven/**', + 'org/**/*.html' + exclude 'LICENSE.md' + exclude 'pack.mcmeta' + exclude '**/module-info.class' + exclude '*.so' + exclude '*.dylib' + exclude '*.dll' + exclude '*.jnilib' + exclude 'ibxm/**' + exclude 'com/jcraft/**' + exclude 'org/lwjgl/**' + exclude 'net/java/**' + + exclude 'META-INF/proguard/**' + exclude 'META-INF/versions/**' + exclude 'META-INF/com.android.tools/**' + + exclude 'fabric.mod.json' + } + manifest { + attributes( + 'MixinConfigs': 'mixins.raven.json', + 'TweakClass': 'org.spongepowered.asm.launch.MixinTweaker', + 'TweakOrder': 0, + "FMLCorePlugin": "keystrokesmod.mixins.MixinLoader", + "ForceLoadAsMod": true, + 'FMLCorePluginContainsFMLMod': true, + "ModSide": "CLIENT" + ) + } +} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..e708b1c023ec8b20f512888fe07c5bd3ff77bb8f GIT binary patch literal 59203 zcma&O1CT9Y(k9%tZQHhO+qUh#ZQHhO+qmuS+qP|E@9xZO?0h@l{(r>DQ>P;GjjD{w zH}lENr;dU&FbEU?00aa80D$0M0RRB{U*7-#kbjS|qAG&4l5%47zyJ#WrfA#1$1Ctx zf&Z_d{GW=lf^w2#qRJ|CvSJUi(^E3iv~=^Z(zH}F)3Z%V3`@+rNB7gTVU{Bb~90p|f+0(v;nz01EG7yDMX9@S~__vVgv%rS$+?IH+oZ03D5zYrv|^ zC1J)SruYHmCki$jLBlTaE5&dFG9-kq3!^i>^UQL`%gn6)jz54$WDmeYdsBE9;PqZ_ zoGd=P4+|(-u4U1dbAVQrFWoNgNd;0nrghPFbQrJctO>nwDdI`Q^i0XJDUYm|T|RWc zZ3^Qgo_Qk$%Fvjj-G}1NB#ZJqIkh;kX%V{THPqOyiq)d)0+(r9o(qKlSp*hmK#iIY zA^)Vr$-Hz<#SF=0@tL@;dCQsm`V9s1vYNq}K1B)!XSK?=I1)tX+bUV52$YQu*0%fnWEukW>mxkz+%3-S!oguE8u#MGzST8_Dy^#U?fA@S#K$S@9msUiX!gd_ow>08w5)nX{-KxqMOo7d?k2&?Vf z&diGDtZr(0cwPe9z9FAUSD9KC)7(n^lMWuayCfxzy8EZsns%OEblHFSzP=cL6}?J| z0U$H!4S_TVjj<`6dy^2j`V`)mC;cB%* z8{>_%E1^FH!*{>4a7*C1v>~1*@TMcLK{7nEQ!_igZC}ikJ$*<$yHy>7)oy79A~#xE zWavoJOIOC$5b6*q*F_qN1>2#MY)AXVyr$6x4b=$x^*aqF*L?vmj>Mgv+|ITnw_BoW zO?jwHvN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F}^!?^KE#+ZDv+xd5O&3EmomZzsv?>E-~ygGum45fk!SBN&|eo1rKw^?aZJ4 E2O(~oYXATM literal 0 HcmV?d00001 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..13b4b2c --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Mon Sep 14 12:28:28 PDT 2015 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-bin.zip diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..91a7e26 --- /dev/null +++ b/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +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. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..8a0b282 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,90 @@ +@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 + +@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= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +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. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +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. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="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! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/src/main/java/keystrokesmod/Raven.java b/src/main/java/keystrokesmod/Raven.java new file mode 100644 index 0000000..62cb0be --- /dev/null +++ b/src/main/java/keystrokesmod/Raven.java @@ -0,0 +1,143 @@ +package keystrokesmod; + +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; + +import keystrokesmod.keystroke.KeySrokeRenderer; +import keystrokesmod.keystroke.KeyStrokeConfigGui; +import keystrokesmod.keystroke.keystrokeCommand; +import keystrokesmod.module.Module; +import keystrokesmod.clickgui.ClickGui; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.utility.ModuleUtils; +import keystrokesmod.script.ScriptManager; +import keystrokesmod.utility.*; +import keystrokesmod.utility.command.CommandManager; +import keystrokesmod.utility.profile.Profile; +import keystrokesmod.utility.profile.ProfileManager; +import net.minecraft.client.Minecraft; +import net.minecraftforge.client.ClientCommandHandler; +import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.common.Mod.EventHandler; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; + +@Mod( + modid = "keystrokes", + name = "KeystrokesMod", + version = "KMV5", + acceptedMinecraftVersions = "[1.8.9]" +) +public class Raven { + public static boolean debug = false; + public static Minecraft mc = Minecraft.getMinecraft(); + private static KeySrokeRenderer keySrokeRenderer; + private static boolean isKeyStrokeConfigGuiToggled; + private static final ScheduledExecutorService ex = Executors.newScheduledThreadPool(2); + public static ModuleManager moduleManager; + public static ClickGui clickGui; + public static ProfileManager profileManager; + public static ScriptManager scriptManager; + public static CommandManager commandManager; + public static Profile currentProfile; + public static PacketsHandler packetsHandler; + private static boolean firstLoad; + + public Raven() { + moduleManager = new ModuleManager(); + } + + @EventHandler + public void init(FMLInitializationEvent e) { + Runtime.getRuntime().addShutdownHook(new Thread(ex::shutdown)); + ClientCommandHandler.instance.registerCommand(new keystrokeCommand()); + FMLCommonHandler.instance().bus().register(this); + FMLCommonHandler.instance().bus().register(new DebugInfoRenderer()); + FMLCommonHandler.instance().bus().register(new CPSCalculator()); + FMLCommonHandler.instance().bus().register(new MovementFix(mc)); + FMLCommonHandler.instance().bus().register(new KeySrokeRenderer()); + FMLCommonHandler.instance().bus().register(new Ping()); + FMLCommonHandler.instance().bus().register(packetsHandler = new PacketsHandler()); + FMLCommonHandler.instance().bus().register(new ModuleUtils(mc)); + Reflection.getFields(); + Reflection.getMethods(); + moduleManager.register(); + scriptManager = new ScriptManager(); + keySrokeRenderer = new KeySrokeRenderer(); + clickGui = new ClickGui(); + profileManager = new ProfileManager(); + scriptManager.loadScripts(); + profileManager.loadProfiles(); + profileManager.loadProfile("default"); + Reflection.setKeyBindings(); + FMLCommonHandler.instance().bus().register(ModuleManager.scaffold); + FMLCommonHandler.instance().bus().register(ModuleManager.tower); + commandManager = new CommandManager(); + + } + + @SubscribeEvent + public void onTick(ClientTickEvent e) { + if (e.phase == Phase.END) { + if (Utils.nullCheck()) { + if (Reflection.sendMessage) { + Utils.sendMessage("&cThere was an error, relaunch the game."); + Reflection.sendMessage = false; + } + for (Module module : getModuleManager().getModules()) { + if (mc.currentScreen == null && module.canBeEnabled()) { + module.keybind(); + } + else if (mc.currentScreen instanceof ClickGui) { + module.guiUpdate(); + } + + if (module.isEnabled()) { + module.onUpdate(); + } + } + if (mc.currentScreen == null) { + for (Profile profile : Raven.profileManager.profiles) { + profile.getModule().keybind(); + } + for (Module module : Raven.scriptManager.scripts.values()) { + module.keybind(); + } + } + } + + if (isKeyStrokeConfigGuiToggled) { + isKeyStrokeConfigGuiToggled = false; + mc.displayGuiScreen(new KeyStrokeConfigGui()); + } + } + } + + @SubscribeEvent + public void onEntityJoinWorld(EntityJoinWorldEvent e) { + if (e.entity == mc.thePlayer && !firstLoad) { + firstLoad = true; + scriptManager.loadScripts(); + } + } + + public static ModuleManager getModuleManager() { + return moduleManager; + } + + public static ScheduledExecutorService getExecutor() { + return ex; + } + + public static KeySrokeRenderer getKeyStrokeRenderer() { + return keySrokeRenderer; + } + + public static void toggleKeyStrokeConfigGui() { + isKeyStrokeConfigGuiToggled = true; + } +} diff --git a/src/main/java/keystrokesmod/clickgui/ClickGui.java b/src/main/java/keystrokesmod/clickgui/ClickGui.java new file mode 100644 index 0000000..af00fbc --- /dev/null +++ b/src/main/java/keystrokesmod/clickgui/ClickGui.java @@ -0,0 +1,321 @@ +package keystrokesmod.clickgui; + +import keystrokesmod.Raven; +import keystrokesmod.clickgui.components.Component; +import keystrokesmod.clickgui.components.impl.BindComponent; +import keystrokesmod.clickgui.components.impl.CategoryComponent; +import keystrokesmod.clickgui.components.impl.ModuleComponent; +import keystrokesmod.module.Module; +import keystrokesmod.module.impl.client.CommandLine; +import keystrokesmod.module.impl.client.Gui; +import keystrokesmod.utility.Commands; +import keystrokesmod.utility.Timer; +import keystrokesmod.utility.Utils; +import keystrokesmod.utility.shader.BlurUtils; +import keystrokesmod.utility.shader.RoundedUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraftforge.client.event.GuiScreenEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.client.config.GuiButtonExt; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +public class ClickGui extends GuiScreen { + private ScheduledFuture sf; + private Timer logoSmoothWidth; + private Timer logoSmoothLength; + private Timer smoothEntity; + private Timer backgroundFade; + private Timer blurSmooth; + private ScaledResolution sr; + private GuiButtonExt commandLineSend; + private GuiTextField commandLineInput; + public static ArrayList categories; + public int originalScale; + + public ClickGui() { + categories = new ArrayList(); + int y = 5; + Module.category[] values; + int length = (values = Module.category.values()).length; + + for (int i = 0; i < length; ++i) { + Module.category c = values[i]; + CategoryComponent categoryComponent = new CategoryComponent(c); + categoryComponent.setY(y); + categories.add(categoryComponent); + y += 20; + } + } + + public void initMain() { + (this.logoSmoothWidth = this.smoothEntity = this.blurSmooth = this.backgroundFade = new Timer(500.0F)).start(); + this.sf = Raven.getExecutor().schedule(() -> { + (this.logoSmoothLength = new Timer(650.0F)).start(); + }, 650L, TimeUnit.MILLISECONDS); + } + + @Override + public void initGui() { + super.initGui(); + this.sr = new ScaledResolution(this.mc); + for (CategoryComponent categoryComponent : categories) { + categoryComponent.setScreenHeight(this.sr.getScaledHeight()); + } + (this.commandLineInput = new GuiTextField(1, this.mc.fontRendererObj, 22, this.height - 100, 150, 20)).setMaxStringLength(256); + this.buttonList.add(this.commandLineSend = new GuiButtonExt(2, 22, this.height - 70, 150, 20, "Send")); + this.commandLineSend.visible = CommandLine.a; + } + + public void drawScreen(int x, int y, float p) { + if (Gui.backgroundBlur.getInput() != 0) { + BlurUtils.prepareBlur(); + RoundedUtils.drawRound(0, 0, this.width, this.height, 0.0f, true, Color.black); + float inputToRange = (float) (3 * ((Gui.backgroundBlur.getInput() + 35) / 100)); + BlurUtils.blurEnd(2, this.blurSmooth.getValueFloat(1, inputToRange, 1)); + } + if (Gui.darkBackground.isToggled()) { + drawRect(0, 0, this.width, this.height, (int) (this.backgroundFade.getValueFloat(0.0F, 0.7F, 2) * 255.0F) << 24); + } + int r; + if (!Gui.removeWatermark.isToggled()) { + int h = this.height / 4; + int wd = this.width / 2; + int w_c = 30 - this.logoSmoothWidth.getValueInt(0, 30, 3); + this.drawCenteredString(this.fontRendererObj, "r", wd + 1 - w_c, h - 25, Utils.getChroma(2L, 1500L)); + this.drawCenteredString(this.fontRendererObj, "a", wd - w_c, h - 15, Utils.getChroma(2L, 1200L)); + this.drawCenteredString(this.fontRendererObj, "v", wd - w_c, h - 5, Utils.getChroma(2L, 900L)); + this.drawCenteredString(this.fontRendererObj, "e", wd - w_c, h + 5, Utils.getChroma(2L, 600L)); + this.drawCenteredString(this.fontRendererObj, "n", wd - w_c, h + 15, Utils.getChroma(2L, 300L)); + this.drawCenteredString(this.fontRendererObj, "bS", wd + 1 + w_c, h + 30, Utils.getChroma(2L, 0L)); + this.drawVerticalLine(wd - 10 - w_c, h - 30, h + 43, Color.white.getRGB()); + this.drawVerticalLine(wd + 10 + w_c, h - 30, h + 43, Color.white.getRGB()); + if (this.logoSmoothLength != null) { + r = this.logoSmoothLength.getValueInt(0, 20, 2); + this.drawHorizontalLine(wd - 10, wd - 10 + r, h - 29, -1); + this.drawHorizontalLine(wd + 10, wd + 10 - r, h + 42, -1); + } + } + + for (CategoryComponent c : categories) { + c.render(this.fontRendererObj); + c.mousePosition(x, y); + + for (Component m : c.getModules()) { + m.drawScreen(x, y); + } + } + + GL11.glColor3f(1.0f, 1.0f, 1.0f); + if (!Gui.removePlayerModel.isToggled()) { + GlStateManager.pushMatrix(); + GlStateManager.disableBlend(); + GuiInventory.drawEntityOnScreen(this.width + 15 - this.smoothEntity.getValueInt(0, 40, 2), this.height - 10, 40, (float) (this.width - 25 - x), (float) (this.height - 50 - y), this.mc.thePlayer); + GlStateManager.enableBlend(); + GlStateManager.popMatrix(); + } + + + if (CommandLine.a) { + if (!this.commandLineSend.visible) { + this.commandLineSend.visible = true; + } + + r = CommandLine.animate.isToggled() ? CommandLine.an.getValueInt(0, 200, 2) : 200; + if (CommandLine.b) { + r = 200 - r; + if (r == 0) { + CommandLine.b = false; + CommandLine.a = false; + this.commandLineSend.visible = false; + } + } + drawRect(0, 0, r, this.height, -1089466352); + this.drawHorizontalLine(0, r - 1, (this.height - 345), -1); + this.drawHorizontalLine(0, r - 1, (this.height - 115), -1); + drawRect(r - 1, 0, r, this.height, -1); + Commands.rc(this.fontRendererObj, this.height, r, this.sr.getScaleFactor()); + int x2 = r - 178; + this.commandLineInput.xPosition = x2; + this.commandLineSend.xPosition = x2; + this.commandLineInput.drawTextBox(); + super.drawScreen(x, y, p); + } + else if (CommandLine.b) { + CommandLine.b = false; + } + } + + public void mouseClicked(int x, int y, int m) throws IOException { + Iterator var4 = categories.iterator(); + + while (true) { + CategoryComponent category; + do { + do { + if (!var4.hasNext()) { + if (CommandLine.a) { + this.commandLineInput.mouseClicked(x, y, m); + super.mouseClicked(x, y, m); + } + + return; + } + + category = (CategoryComponent) var4.next(); + if (category.v(x, y) && !category.i(x, y) && m == 0) { + category.overTitle(true); + category.xx = x - category.getX(); + category.yy = y - category.getY(); + } + + if (category.overTitle(x, y) && m == 1) { + category.mouseClicked(!category.isOpened()); + } + + if (category.i(x, y) && m == 0) { + category.cv(!category.p()); + } + } while (!category.isOpened()); + } while (category.getModules().isEmpty()); + + for (Component c : category.getModules()) { + if (c.onClick(x, y, m) && c instanceof ModuleComponent) { + category.openModule((ModuleComponent) c); + } + } + + } + } + + public void mouseReleased(int x, int y, int s) { + if (s == 0) { + Iterator iterator = categories.iterator(); + while (iterator.hasNext()) { + CategoryComponent category = iterator.next(); + category.overTitle(false); + if (category.isOpened() && !category.getModules().isEmpty()) { + for (Component module : category.getModules()) { + module.mouseReleased(x, y, s); + } + } + } + } + } + + @Override + public void handleMouseInput() throws IOException { + super.handleMouseInput(); + int wheelInput = Mouse.getDWheel(); + if (wheelInput != 0) { + for (CategoryComponent category : categories) { + category.onScroll(wheelInput); + } + } + } + + @Override + public void setWorldAndResolution(Minecraft p_setWorldAndResolution_1_, final int p_setWorldAndResolution_2_, final int p_setWorldAndResolution_3_) { + this.mc = p_setWorldAndResolution_1_; + originalScale = this.mc.gameSettings.guiScale; + this.mc.gameSettings.guiScale = (int) Gui.guiScale.getInput() + 1; + this.itemRender = p_setWorldAndResolution_1_.getRenderItem(); + this.fontRendererObj = p_setWorldAndResolution_1_.fontRendererObj; + final ScaledResolution scaledresolution = new ScaledResolution(this.mc); + this.width = scaledresolution.getScaledWidth(); + this.height = scaledresolution.getScaledHeight(); + if (!MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.InitGuiEvent.Pre(this, this.buttonList))) { + this.buttonList.clear(); + this.initGui(); + } + MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.InitGuiEvent.Post(this, this.buttonList)); + } + + @Override + public void keyTyped(char t, int k) { + if (k == Keyboard.KEY_ESCAPE && !binding()) { + this.mc.displayGuiScreen(null); + } else { + Iterator iterator = categories.iterator(); + while (iterator.hasNext()) { + CategoryComponent category = iterator.next(); + + if (category.isOpened() && !category.getModules().isEmpty()) { + for (Component module : category.getModules()) { + module.keyTyped(t, k); + } + } + } + if (CommandLine.a) { + String cm = this.commandLineInput.getText(); + if (k == 28 && !cm.isEmpty()) { + Commands.rCMD(this.commandLineInput.getText()); + this.commandLineInput.setText(""); + return; + } + this.commandLineInput.textboxKeyTyped(t, k); + } + } + } + + public void actionPerformed(GuiButton b) { + if (b == this.commandLineSend) { + Commands.rCMD(this.commandLineInput.getText()); + this.commandLineInput.setText(""); + } + } + + @Override + public void onGuiClosed() { + this.logoSmoothLength = null; + if (this.sf != null) { + this.sf.cancel(true); + this.sf = null; + } + for (CategoryComponent c : categories) { + c.dragging = false; + for (Component m : c.getModules()) { + m.onGuiClosed(); + } + } + this.mc.gameSettings.guiScale = originalScale; + } + + public boolean doesGuiPauseGame() { + return false; + } + + private boolean binding() { + for (CategoryComponent c : categories) { + for (ModuleComponent m : c.getModules()) { + for (Component component : m.settings) { + if (component instanceof BindComponent && ((BindComponent) component).isBinding) { + return true; + } + } + } + } + return false; + } + + public static int[] calculateBlur(int setting) { + int passes = (int) (setting * 6.0 / 100.0 + 1.0); + int offset = (int) (setting * 3.0 / 100.0); + + return new int[]{passes, offset}; + } +} diff --git a/src/main/java/keystrokesmod/clickgui/components/Component.java b/src/main/java/keystrokesmod/clickgui/components/Component.java new file mode 100644 index 0000000..acc94f1 --- /dev/null +++ b/src/main/java/keystrokesmod/clickgui/components/Component.java @@ -0,0 +1,29 @@ +package keystrokesmod.clickgui.components; + +public class Component { + public void render() { + } + + public void drawScreen(int x, int y) { + } + + public boolean onClick(int x, int y, int b) { + return false; + } + + public void mouseReleased(int x, int y, int m) { + } + + public void keyTyped(char t, int k) { + } + + public void updateHeight(int n) { + } + + public int getHeight() { + return 0; + } + + public void onGuiClosed() { + } +} diff --git a/src/main/java/keystrokesmod/clickgui/components/impl/BindComponent.java b/src/main/java/keystrokesmod/clickgui/components/impl/BindComponent.java new file mode 100644 index 0000000..8de45a3 --- /dev/null +++ b/src/main/java/keystrokesmod/clickgui/components/impl/BindComponent.java @@ -0,0 +1,105 @@ +package keystrokesmod.clickgui.components.impl; + +import keystrokesmod.Raven; +import keystrokesmod.clickgui.components.Component; +import keystrokesmod.module.Module; +import keystrokesmod.module.impl.client.Gui; +import keystrokesmod.utility.Theme; +import keystrokesmod.utility.profile.ProfileModule; +import net.minecraft.client.Minecraft; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +public class BindComponent extends Component { + public boolean isBinding; + private ModuleComponent moduleComponent; + private int bind; + private int x; + private int y; + + public BindComponent(ModuleComponent moduleComponent, int bind) { + this.moduleComponent = moduleComponent; + this.x = moduleComponent.categoryComponent.getX() + moduleComponent.categoryComponent.getWidth(); + this.y = moduleComponent.categoryComponent.getY() + moduleComponent.yPos; + this.bind = bind; + } + + public void updateHeight(int n) { + this.bind = n; + } + + public void render() { + GL11.glPushMatrix(); + GL11.glScaled(0.5D, 0.5D, 0.5D); + this.drawString(!this.moduleComponent.mod.canBeEnabled() && this.moduleComponent.mod.script == null ? "Module cannot be bound." : this.isBinding ? "Press a key..." : "Current bind: '§e" + (this.moduleComponent.mod.getKeycode() >= 1000 ? "M" + (this.moduleComponent.mod.getKeycode() - 1000) : Keyboard.getKeyName(this.moduleComponent.mod.getKeycode())) + "§r'"); + GL11.glPopMatrix(); + } + + public void drawScreen(int x, int y) { + this.y = this.moduleComponent.categoryComponent.getModuleY() + this.bind; + this.x = this.moduleComponent.categoryComponent.getX(); + } + + public boolean onClick(int x, int y, int b) { + if (this.i(x, y) && this.moduleComponent.isOpened && this.moduleComponent.mod.canBeEnabled()) { + if (b == 0) { + this.isBinding = !this.isBinding; + } + else if (b == 1 && this.moduleComponent.mod.moduleCategory() != Module.category.profiles) { + this.moduleComponent.mod.setHidden(!this.moduleComponent.mod.isHidden()); + if (Raven.currentProfile != null) { + ((ProfileModule) Raven.currentProfile.getModule()).saved = false; + } + } + else if (b > 1) { + if (this.isBinding) { + this.moduleComponent.mod.setBind(b + 1000); + if (Raven.currentProfile != null) { + ((ProfileModule) Raven.currentProfile.getModule()).saved = false; + } + this.isBinding = false; + } + } + } + return false; + } + + public void keyTyped(char t, int keybind) { + if (this.isBinding) { + if (keybind == Keyboard.KEY_0 || keybind == Keyboard.KEY_ESCAPE) { + if (this.moduleComponent.mod instanceof Gui) { + this.moduleComponent.mod.setBind(54); + } else { + this.moduleComponent.mod.setBind(0); + } + if (Raven.currentProfile != null) { + ((ProfileModule) Raven.currentProfile.getModule()).saved = false; + } + } + else { + if (Raven.currentProfile != null) { + ((ProfileModule) Raven.currentProfile.getModule()).saved = false; + } + this.moduleComponent.mod.setBind(keybind); + } + + this.isBinding = false; + } + } + + public boolean i(int x, int y) { + return x > this.x && x < this.x + this.moduleComponent.categoryComponent.getWidth() && y > this.y - 1 && y < this.y + 12; + } + + public int getHeight() { + return 16; + } + + private void drawString(String s) { + Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(s, (float) ((this.moduleComponent.categoryComponent.getX() + 4) * 2), (float) ((this.moduleComponent.categoryComponent.getY() + this.bind + 3) * 2), !this.moduleComponent.mod.hidden ? Theme.getGradient(Theme.descriptor[0], Theme.descriptor[1], 0) : Theme.getGradient(Theme.hiddenBind[0], Theme.hiddenBind[1], 0)); + } + + public void onGuiClosed() { + this.isBinding = false; + } +} diff --git a/src/main/java/keystrokesmod/clickgui/components/impl/ButtonComponent.java b/src/main/java/keystrokesmod/clickgui/components/impl/ButtonComponent.java new file mode 100644 index 0000000..584697d --- /dev/null +++ b/src/main/java/keystrokesmod/clickgui/components/impl/ButtonComponent.java @@ -0,0 +1,65 @@ +package keystrokesmod.clickgui.components.impl; + +import keystrokesmod.Raven; +import keystrokesmod.clickgui.components.Component; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.utility.profile.ProfileModule; +import net.minecraft.client.Minecraft; +import org.lwjgl.opengl.GL11; + +import java.awt.*; + +public class ButtonComponent extends Component { + private final int c = (new Color(20, 255, 0)).getRGB(); + private Module mod; + private ButtonSetting buttonSetting; + private ModuleComponent p; + private int o; + private int x; + private int y; + + public ButtonComponent(Module mod, ButtonSetting op, ModuleComponent b, int o) { + this.mod = mod; + this.buttonSetting = op; + this.p = b; + this.x = b.categoryComponent.getX() + b.categoryComponent.getWidth(); + this.y = b.categoryComponent.getY() + b.yPos; + this.o = o; + } + + public void render() { + GL11.glPushMatrix(); + GL11.glScaled(0.5D, 0.5D, 0.5D); + Minecraft.getMinecraft().fontRendererObj.drawString((this.buttonSetting.isMethodButton ? "[=] " : (this.buttonSetting.isToggled() ? "[+] " : "[-] ")) + this.buttonSetting.getName(), (float) ((this.p.categoryComponent.getX() + 4) * 2), (float) ((this.p.categoryComponent.getY() + this.o + 4) * 2), this.buttonSetting.isToggled() ? this.c : -1, false); + GL11.glPopMatrix(); + } + + public void updateHeight(int n) { + this.o = n; + } + + public void drawScreen(int x, int y) { + this.y = this.p.categoryComponent.getModuleY() + this.o; + this.x = this.p.categoryComponent.getX(); + } + + public boolean onClick(int x, int y, int b) { + if (this.i(x, y) && b == 0 && this.p.isOpened) { + if (this.buttonSetting.isMethodButton) { + this.buttonSetting.runMethod(); + return false; + } + this.buttonSetting.toggle(); + this.mod.guiButtonToggled(this.buttonSetting); + if (Raven.currentProfile != null) { + ((ProfileModule) Raven.currentProfile.getModule()).saved = false; + } + } + return false; + } + + public boolean i(int x, int y) { + return x > this.x && x < this.x + this.p.categoryComponent.getWidth() && y > this.y && y < this.y + 11; + } +} diff --git a/src/main/java/keystrokesmod/clickgui/components/impl/CategoryComponent.java b/src/main/java/keystrokesmod/clickgui/components/impl/CategoryComponent.java new file mode 100644 index 0000000..bea979e --- /dev/null +++ b/src/main/java/keystrokesmod/clickgui/components/impl/CategoryComponent.java @@ -0,0 +1,374 @@ +package keystrokesmod.clickgui.components.impl; + +import keystrokesmod.Raven; +import keystrokesmod.clickgui.components.Component; +import keystrokesmod.module.Module; +import keystrokesmod.module.impl.client.Gui; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Timer; +import keystrokesmod.utility.Utils; +import keystrokesmod.utility.profile.Manager; +import keystrokesmod.utility.profile.Profile; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.util.Collection; +import java.util.Comparator; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.stream.Collectors; + +public class CategoryComponent { + public List modules = new CopyOnWriteArrayList<>(); + public Module.category categoryName; + public boolean opened; + public int width; + public int y; + public int x; + public int titleHeight; + public boolean dragging; + public int xx; + public int yy; + public boolean n4m = false; + public String pvp; + public boolean pin = false; + public boolean hovering = false; + public boolean hoveringOverCategory = false; + public Timer smoothTimer; + private Timer textTimer; + public Timer smoothScrollTimer; + public ScaledResolution scale; + public float big; + private float bigSettings; + private final int translucentBackground = new Color(0, 0, 0, 110).getRGB(); + private final int regularOutline = new Color(81, 99, 149).getRGB(); + private final int regularOutline2 = new Color(97, 67, 133).getRGB(); + private final int categoryNameColor = new Color(220, 220, 220).getRGB(); + private float lastHeight; + public int moduleY; + private int lastModuleY; + private int screenHeight; + private boolean scrolled; + private int targetModuleY; + private float closedHeight; + + public CategoryComponent(Module.category category) { + this.categoryName = category; + this.width = 92; + this.x = 5; + this.moduleY = this.y = 5; + this.titleHeight = 13; + this.smoothTimer = null; + this.textTimer = null; + this.xx = 0; + this.opened = false; + this.dragging = false; + int moduleRenderX = this.titleHeight + 3; + this.scale = new ScaledResolution(Minecraft.getMinecraft()); + this.targetModuleY = this.moduleY; + + for (Module mod : Raven.getModuleManager().inCategory(this.categoryName)) { + ModuleComponent b = new ModuleComponent(mod, this, moduleRenderX); + this.modules.add(b); + moduleRenderX += 16; + } + } + + public List getModules() { + return this.modules; + } + + public void reloadModules(boolean isProfile) { + this.modules.clear(); + this.titleHeight = 13; + int moduleRenderY = this.titleHeight + 3; + + if ((this.categoryName == Module.category.profiles && isProfile) || (this.categoryName == Module.category.scripts && !isProfile)) { + ModuleComponent manager = new ModuleComponent(isProfile ? new Manager() : new keystrokesmod.script.Manager(), this, moduleRenderY); + this.modules.add(manager); + + if ((Raven.profileManager == null && isProfile) || (Raven.scriptManager == null && !isProfile)) { + return; + } + + if (isProfile) { + for (Profile profile : Raven.profileManager.profiles) { + moduleRenderY += 16; + ModuleComponent b = new ModuleComponent(profile.getModule(), this, moduleRenderY); + this.modules.add(b); + } + } + else { + Collection modulesCollection = Raven.scriptManager.scripts.values(); + List sortedModules = modulesCollection.stream().sorted(Comparator.comparing(Module::getName, String.CASE_INSENSITIVE_ORDER)).collect(Collectors.toList()); + for (Module module : sortedModules) { + moduleRenderY += 16; + ModuleComponent b = new ModuleComponent(module, this, moduleRenderY); + this.modules.add(b); + } + } + } + } + + public void setX(int n) { + this.x = n; + } + + public void setY(int y) { + this.moduleY = this.y = y; + this.targetModuleY = y; + } + + public void overTitle(boolean d) { + this.dragging = d; + } + + public boolean p() { + return this.pin; + } + + public void cv(boolean on) { + this.pin = on; + } + + public boolean isOpened() { + return this.opened; + } + + public void mouseClicked(boolean on) { + this.opened = on; + (this.smoothTimer = new Timer(500)).start(); + (this.textTimer = new Timer(200)).start(); + } + + public void openModule(ModuleComponent component) { + if (!component.isOpened) { + closedHeight = this.y + this.titleHeight + big + 4; + } + (this.smoothTimer = new Timer(200)).start(); + } + + public void onScroll(int mouseScrollInput) { + if (!hoveringOverCategory || !this.opened) { + return; + } + int scrollSpeed = (int) Gui.scrollSpeed.getInput(); + if (mouseScrollInput > 0) { + this.targetModuleY += scrollSpeed; + } else if (mouseScrollInput < 0) { + this.targetModuleY -= scrollSpeed; + } + scrolled = true; + + (smoothScrollTimer = new Timer(200)).start(); + } + + public void render(FontRenderer renderer) { + this.targetModuleY = Math.min(this.targetModuleY, this.y); + if (this.targetModuleY + this.bigSettings < this.y + this.big + this.titleHeight) { + this.targetModuleY = (int) (this.y + this.big - this.bigSettings); + } + + this.width = 92; + int modulesHeight = 0; + int settingsHeight = 0; + if (!this.modules.isEmpty() && this.opened) { + for (ModuleComponent c : this.modules) { + settingsHeight += c.getHeight(); + int height = !c.isOpened ? 16 : c.getModuleHeight(); + if (modulesHeight + height > this.screenHeight * 0.9d) { + modulesHeight = (int) (this.screenHeight * 0.9d); + continue; + } + modulesHeight += c.getHeight(); + } + big = modulesHeight; + bigSettings = settingsHeight; + } + + float middlePos = (float) (this.x + this.width / 2 - Minecraft.getMinecraft().fontRendererObj.getStringWidth(this.categoryName.name()) / 2); + float xPos = opened ? middlePos : this.x + 12; + float extra = this.y + this.titleHeight + modulesHeight + 4; + + if (smoothTimer != null && System.currentTimeMillis() - smoothTimer.last >= 330) { + smoothTimer = null; + } + + if (extra != lastHeight && smoothTimer != null) { + double diff = lastHeight - extra; + if (diff < 0) { + extra = smoothTimer.getValueFloat(lastHeight, this.y + this.titleHeight + modulesHeight + 4, 1); + } + else if (diff > 0) { + extra = smoothTimer.getValueFloat(this.opened ? closedHeight : lastHeight, this.y + this.titleHeight + modulesHeight + 4, 1); + } + } + + float namePos = textTimer == null ? xPos : textTimer.getValueFloat(this.x + 12, middlePos, 1); + if (!this.opened) { + namePos = textTimer == null ? xPos : middlePos - textTimer.getValueFloat(0, this.width / 2 - Minecraft.getMinecraft().fontRendererObj.getStringWidth(this.categoryName.name()) / 2 - 12, 1); + } + + if (scrolled && smoothScrollTimer != null) { + if (System.currentTimeMillis() - smoothScrollTimer.last <= 200) { + float interpolated = smoothScrollTimer.getValueFloat(lastModuleY, targetModuleY, 4); + moduleY = (int) interpolated; + } + else { + moduleY = targetModuleY; + scrolled = false; + smoothScrollTimer = null; + } + } + else { + moduleY = targetModuleY; + } + lastModuleY = moduleY; + + lastHeight = extra; + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_SCISSOR_TEST); + RenderUtils.scissor(0, this.y - 2, this.x + this.width + 4, extra - this.y + 4); + RenderUtils.drawRoundedGradientOutlinedRectangle(this.x - 2, this.y, this.x + this.width + 2, extra, 9, translucentBackground, + ((opened || hovering) && Gui.rainBowOutlines.isToggled()) ? RenderUtils.setAlpha(Utils.getChroma(2, 0), 0.5) : regularOutline, ((opened || hovering) && Gui.rainBowOutlines.isToggled()) ? RenderUtils.setAlpha(Utils.getChroma(2, 700), 0.5) : regularOutline2); + renderItemForCategory(this.categoryName, this.x + 1, this.y + 4, opened || hovering); + renderer.drawString(this.n4m ? this.pvp : this.categoryName.name(), namePos, (float) (this.y + 4), categoryNameColor, false); + RenderUtils.scissor(0, this.y + this.titleHeight + 3, this.x + this.width + 4, extra - this.y - 4 - this.titleHeight); + + if (!this.n4m) { + int prevY = this.y; + this.y = this.moduleY; + + if (this.opened || smoothTimer != null) { + for (Component c2 : this.modules) { + c2.render(); + } + } + this.y = prevY; + } + GL11.glDisable(GL11.GL_SCISSOR_TEST); + GL11.glPopMatrix(); + } + + public void updateHeight() { + int y = this.titleHeight + 3; + + for (Component component : this.modules) { + component.updateHeight(y); + y += component.getHeight(); + } + } + + public int getX() { + return this.x; + } + + public int getY() { + return this.y; + } + + public int getModuleY() { + return this.moduleY; + } + + public int getWidth() { + return this.width; + } + + public void mousePosition(int x, int y) { + if (this.dragging) { + this.setX(x - this.xx); + this.setY(y - this.yy); + } + hoveringOverCategory = overCategory(x, y); + hovering = overTitle(x, y); + } + + public boolean i(int x, int y) { + return x >= this.x + 92 - 13 && x <= this.x + this.width && (float) y >= (float) this.y + 2.0F && y <= this.y + this.titleHeight + 1; + } + + public boolean overTitle(int x, int y) { + return x >= this.x && x <= this.x + this.width && (float) y >= (float) this.y + 2.0F && y <= this.y + this.titleHeight + 1; + } + + public boolean overCategory(int x, int y) { + return x >= this.x - 2 && x <= this.x + this.width + 2 && (float) y >= (float) this.y + 2.0F && y <= this.y + this.titleHeight + big + 1; + } + + public boolean v(int x, int y) { + return x >= this.x && x <= this.x + this.width && y >= this.y && y <= this.y + this.titleHeight; + } + + private void renderItemForCategory(Module.category category, int x, int y, boolean enchant) { + RenderItem renderItem = Minecraft.getMinecraft().getRenderItem(); + double scale = 0.55; + GlStateManager.pushMatrix(); + GlStateManager.scale(scale, scale, scale); + ItemStack itemStack = null; + switch (category) { + case combat: + itemStack = new ItemStack(Items.diamond_sword); + break; + case movement: + itemStack = new ItemStack(Items.diamond_boots); + break; + case player: + itemStack = new ItemStack(Items.golden_apple); + break; + case world: + itemStack = new ItemStack(Items.map); + break; + case render: + itemStack = new ItemStack(Items.ender_eye); + break; + case minigames: + itemStack = new ItemStack(Items.gold_ingot); + break; + case fun: + itemStack = new ItemStack(Items.slime_ball); + break; + case other: + itemStack = new ItemStack(Items.clock); + break; + case client: + itemStack = new ItemStack(Items.compass); + break; + case profiles: + itemStack = new ItemStack(Items.book); + break; + case scripts: + itemStack = new ItemStack(Items.redstone); + break; + } + if (itemStack != null) { + if (enchant) { + if (category != Module.category.player) { + itemStack.addEnchantment(Enchantment.unbreaking, 2); + } else { + itemStack.setItemDamage(1); + } + } + RenderHelper.enableGUIStandardItemLighting(); + GlStateManager.disableBlend(); + renderItem.renderItemAndEffectIntoGUI(itemStack, (int) (x / scale), (int) (y / scale)); + GlStateManager.enableBlend(); + RenderHelper.disableStandardItemLighting(); + } + GlStateManager.scale(1, 1, 1); + GlStateManager.popMatrix(); + } + + public void setScreenHeight(int screenHeight) { + this.screenHeight = screenHeight; + } +} diff --git a/src/main/java/keystrokesmod/clickgui/components/impl/DescriptionComponent.java b/src/main/java/keystrokesmod/clickgui/components/impl/DescriptionComponent.java new file mode 100644 index 0000000..821d47a --- /dev/null +++ b/src/main/java/keystrokesmod/clickgui/components/impl/DescriptionComponent.java @@ -0,0 +1,34 @@ +package keystrokesmod.clickgui.components.impl; + +import keystrokesmod.clickgui.components.Component; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.utility.Theme; +import net.minecraft.client.Minecraft; +import org.lwjgl.opengl.GL11; + +public class DescriptionComponent extends Component { + private DescriptionSetting desc; + private ModuleComponent p; + private int o; + private int x; + private int y; + + public DescriptionComponent(DescriptionSetting desc, ModuleComponent b, int o) { + this.desc = desc; + this.p = b; + this.x = b.categoryComponent.getX() + b.categoryComponent.getWidth(); + this.y = b.categoryComponent.getY() + b.yPos; + this.o = o; + } + + public void render() { + GL11.glPushMatrix(); + GL11.glScaled(0.5D, 0.5D, 0.5D); + Minecraft.getMinecraft().fontRendererObj.drawString(this.desc.getDesc(), (float) ((this.p.categoryComponent.getX() + 4) * 2), (float) ((this.p.categoryComponent.getY() + this.o + 4) * 2), Theme.getGradient(Theme.descriptor[0], Theme.descriptor[1], 0), true); + GL11.glPopMatrix(); + } + + public void updateHeight(int n) { + this.o = n; + } +} diff --git a/src/main/java/keystrokesmod/clickgui/components/impl/ModuleComponent.java b/src/main/java/keystrokesmod/clickgui/components/impl/ModuleComponent.java new file mode 100644 index 0000000..3cc6c5c --- /dev/null +++ b/src/main/java/keystrokesmod/clickgui/components/impl/ModuleComponent.java @@ -0,0 +1,313 @@ +package keystrokesmod.clickgui.components.impl; + +import keystrokesmod.Raven; +import keystrokesmod.clickgui.components.Component; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.Setting; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Timer; +import keystrokesmod.utility.Utils; +import keystrokesmod.utility.profile.Manager; +import keystrokesmod.utility.profile.ProfileModule; +import net.minecraft.client.Minecraft; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.util.ArrayList; +import java.util.Iterator; + +public class ModuleComponent extends Component { + private int originalHoverAlpha = 120; + private final int c2 = (new Color(154, 2, 255)).getRGB(); + private final int hoverColor = (new Color(0, 0, 0, originalHoverAlpha)).getRGB(); + private final int unsavedColor = new Color(114, 188, 250).getRGB(); + private final int invalidColor = new Color(255, 80, 80).getRGB(); + private final int enabledColor = new Color(24, 154, 255).getRGB(); + private final int disabledColor = new Color(192, 192, 192).getRGB(); + public Module mod; + public CategoryComponent categoryComponent; + public int yPos; + public ArrayList settings; + public boolean isOpened; + private boolean hovering; + private Timer hoverTimer; + private boolean hoverStarted; + private Timer smoothTimer; + private int smoothingY = 16; + + public ModuleComponent(Module mod, CategoryComponent p, int yPos) { + this.mod = mod; + this.categoryComponent = p; + this.yPos = yPos; + this.settings = new ArrayList(); + this.isOpened = false; + int y = yPos + 12; + if (mod != null && !mod.getSettings().isEmpty()) { + for (Setting v : mod.getSettings()) { + if (v instanceof SliderSetting) { + SliderSetting n = (SliderSetting) v; + SliderComponent s = new SliderComponent(n, this, y); + this.settings.add(s); + y += 12; + } else if (v instanceof ButtonSetting) { + ButtonSetting b = (ButtonSetting) v; + ButtonComponent c = new ButtonComponent(mod, b, this, y); + this.settings.add(c); + y += 12; + } else if (v instanceof DescriptionSetting) { + DescriptionSetting d = (DescriptionSetting) v; + DescriptionComponent m = new DescriptionComponent(d, this, y); + this.settings.add(m); + y += 12; + } + } + } + this.settings.add(new BindComponent(this, y)); + } + + public void updateHeight(int newY) { + this.yPos = newY; + int y = this.yPos + 16; + Iterator var3 = this.settings.iterator(); + + while (true) { + while (var3.hasNext()) { + Component co = (Component) var3.next(); + co.updateHeight(y); + if (co instanceof SliderComponent) { + y += 16; + } else if (co instanceof ButtonComponent || co instanceof BindComponent || co instanceof DescriptionComponent) { + y += 12; + } + } + + return; + } + } + + public static void e() { + GL11.glDisable(2929); + GL11.glEnable(3042); + GL11.glDisable(3553); + GL11.glBlendFunc(770, 771); + GL11.glDepthMask(true); + GL11.glEnable(2848); + GL11.glHint(3154, 4354); + GL11.glHint(3155, 4354); + } + + public static void f() { + GL11.glEnable(3553); + GL11.glDisable(3042); + GL11.glEnable(2929); + GL11.glDisable(2848); + GL11.glHint(3154, 4352); + GL11.glHint(3155, 4352); + GL11.glEdgeFlag(true); + } + + public static void g() { + GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.0F); + } + + public static void v(float x, float y, float x1, float y1, int t, int b) { + e(); + GL11.glShadeModel(7425); + GL11.glBegin(7); + g(); + GL11.glVertex2f(x, y1); + GL11.glVertex2f(x1, y1); + g(); + GL11.glVertex2f(x1, y); + GL11.glVertex2f(x, y); + GL11.glEnd(); + GL11.glShadeModel(7424); + f(); + } + + public void render() { + if (hovering || hoverTimer != null) { + double hoverAlpha = (hovering && hoverTimer != null) ? hoverTimer.getValueFloat(0, originalHoverAlpha, 1) : (hoverTimer != null && !hovering) ? originalHoverAlpha - hoverTimer.getValueFloat(0, originalHoverAlpha, 1) : originalHoverAlpha; + if (hoverAlpha == 0) { + hoverTimer = null; + } + RenderUtils.drawRoundedRectangle(this.categoryComponent.getX(), this.categoryComponent.getY() + yPos, this.categoryComponent.getX() + this.categoryComponent.getWidth(), this.categoryComponent.getY() + 16 + this.yPos, 8, Utils.mergeAlpha(hoverColor, (int) hoverAlpha)); + } + + v((float) this.categoryComponent.getX(), (float) (this.categoryComponent.getY() + this.yPos), (float) (this.categoryComponent.getX() + this.categoryComponent.getWidth()), (float) (this.categoryComponent.getY() + 15 + this.yPos), this.mod.isEnabled() ? this.c2 : -12829381, this.mod.isEnabled() ? this.c2 : -12302777); + GL11.glPushMatrix(); + + int button_rgb = this.mod.isEnabled() ? enabledColor : disabledColor; + if (this.mod.script != null && this.mod.script.error) { + button_rgb = invalidColor; + } + if (this.mod.moduleCategory() == Module.category.profiles && !(this.mod instanceof Manager) && !((ProfileModule) this.mod).saved && Raven.currentProfile.getModule() == this.mod) { + button_rgb = unsavedColor; + } + + if (smoothTimer != null && System.currentTimeMillis() - smoothTimer.last >= 300) { + smoothTimer = null; + } + if (smoothTimer != null) { + int height = getModuleHeight(); + if (isOpened) { + smoothingY = smoothTimer.getValueInt(16, height, 1); + if (smoothingY == height) { + smoothTimer = null; + } + } + else { + smoothingY = smoothTimer.getValueInt(height, 16, 1); + if (smoothingY == 16) { + smoothTimer = null; + } + } + this.categoryComponent.updateHeight(); + } + + Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(this.mod.getName(), (float) (this.categoryComponent.getX() + this.categoryComponent.getWidth() / 2 - Minecraft.getMinecraft().fontRendererObj.getStringWidth(this.mod.getName()) / 2), (float) (this.categoryComponent.getY() + this.yPos + 4), button_rgb); + + GL11.glPopMatrix(); + boolean scissorRequired = smoothTimer != null; + if (scissorRequired) { + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_SCISSOR_TEST); + RenderUtils.scissor(this.categoryComponent.getX() - 2, this.categoryComponent.getY() + this.yPos + 4, this.categoryComponent.getWidth() + 4, smoothingY + 4); + } + + if (this.isOpened || smoothTimer != null) { + for (Component settingComponent : this.settings) { + settingComponent.render(); + } + } + + if (scissorRequired) { + GL11.glDisable(GL11.GL_SCISSOR_TEST); + GL11.glPopMatrix(); + } + } + + public int getHeight() { + if (smoothTimer != null) { + return smoothingY; + } + if (!this.isOpened) { + return 16; + } + else { + int h = 16; + Iterator var2 = this.settings.iterator(); + + while (true) { + while (var2.hasNext()) { + Component c = (Component) var2.next(); + if (c instanceof SliderComponent) { + h += 16; + } + else if (c instanceof ButtonComponent || c instanceof BindComponent || c instanceof DescriptionComponent) { + h += 12; + } + } + + return h; + } + } + } + + public int getModuleHeight() { + int h = 16; + Iterator var2 = this.settings.iterator(); + + while (true) { + while (var2.hasNext()) { + Component c = (Component) var2.next(); + if (c instanceof SliderComponent) { + h += 16; + } + else if (c instanceof ButtonComponent || c instanceof BindComponent || c instanceof DescriptionComponent) { + h += 12; + } + } + + return h; + } + } + + public void drawScreen(int x, int y) { + if (!this.settings.isEmpty()) { + for (Component c : this.settings) { + c.drawScreen(x, y); + } + } + if (overModuleName(x, y) && this.categoryComponent.opened) { + hovering = true; + if (hoverTimer == null) { + (hoverTimer = new Timer(75)).start(); + hoverStarted = true; + } + } + else { + if (hovering && hoverStarted) { + (hoverTimer = new Timer(75)).start(); + } + hoverStarted = false; + hovering = false; + } + } + + public String getName() { + return mod.getName(); + } + + public boolean onClick(int x, int y, int mouse) { + if (this.overModuleName(x, y) && mouse == 0 && this.mod.canBeEnabled()) { + this.mod.toggle(); + if (this.mod.moduleCategory() != Module.category.profiles) { + if (Raven.currentProfile != null) { + ((ProfileModule) Raven.currentProfile.getModule()).saved = false; + } + } + } + + if (this.overModuleName(x, y) && mouse == 1) { + this.isOpened = !this.isOpened; + (this.smoothTimer = new Timer(200)).start(); + this.categoryComponent.updateHeight(); + return true; + } + + for (Component settingComponent : this.settings) { + settingComponent.onClick(x, y, mouse); + } + return false; + } + + public void mouseReleased(int x, int y, int m) { + for (Component c : this.settings) { + c.mouseReleased(x, y, m); + } + + } + + public void keyTyped(char t, int k) { + for (Component c : this.settings) { + c.keyTyped(t, k); + } + } + + public void onGuiClosed() { + for (Component c : this.settings) { + c.onGuiClosed(); + } + smoothTimer = null; + hoverTimer = null; + smoothingY = getHeight(); + } + + public boolean overModuleName(int x, int y) { + return x > this.categoryComponent.getX() && x < this.categoryComponent.getX() + this.categoryComponent.getWidth() && y > this.categoryComponent.getModuleY() + this.yPos && y < this.categoryComponent.getModuleY() + 16 + this.yPos; + } +} diff --git a/src/main/java/keystrokesmod/clickgui/components/impl/SliderComponent.java b/src/main/java/keystrokesmod/clickgui/components/impl/SliderComponent.java new file mode 100644 index 0000000..436b3c9 --- /dev/null +++ b/src/main/java/keystrokesmod/clickgui/components/impl/SliderComponent.java @@ -0,0 +1,132 @@ +package keystrokesmod.clickgui.components.impl; + +import keystrokesmod.Raven; +import keystrokesmod.clickgui.components.Component; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Utils; +import keystrokesmod.utility.profile.ProfileModule; +import net.minecraft.client.Minecraft; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.math.BigDecimal; +import java.math.RoundingMode; + +public class SliderComponent extends Component { + private SliderSetting sliderSetting; + private ModuleComponent moduleComponent; + private int o; + private int x; + private int y; + private boolean heldDown = false; + private double w; + + public SliderComponent(SliderSetting sliderSetting, ModuleComponent moduleComponent, int o) { + this.sliderSetting = sliderSetting; + this.moduleComponent = moduleComponent; + this.x = moduleComponent.categoryComponent.getX() + moduleComponent.categoryComponent.getWidth(); + this.y = moduleComponent.categoryComponent.getY() + moduleComponent.yPos; + this.o = o; + } + + public void render() { + RenderUtils.drawRoundedRectangle(this.moduleComponent.categoryComponent.getX() + 4, this.moduleComponent.categoryComponent.getY() + this.o + 11, this.moduleComponent.categoryComponent.getX() + 4 + this.moduleComponent.categoryComponent.getWidth() - 8, this.moduleComponent.categoryComponent.getY() + this.o + 15, 4, -12302777); + int l = this.moduleComponent.categoryComponent.getX() + 4; + int r = this.moduleComponent.categoryComponent.getX() + 4 + (int) this.w; + if (r - l > 84) { + r = l + 84; + } + + RenderUtils.drawRoundedRectangle(l, this.moduleComponent.categoryComponent.getY() + this.o + 11, r, this.moduleComponent.categoryComponent.getY() + this.o + 15, 4, Color.getHSBColor((float) (System.currentTimeMillis() % 11000L) / 11000.0F, 0.75F, 0.9F).getRGB()); + GL11.glPushMatrix(); + GL11.glScaled(0.5D, 0.5D, 0.5D); + String value; + double input = this.sliderSetting.getInput(); + String suffix = this.sliderSetting.getSuffix(); + if (input == -1 && this.sliderSetting.canBeDisabled) { + value = "§cDisabled"; + suffix = ""; + } + else { + if (input != 1 && (suffix.equals(" second") || suffix.equals(" block") || suffix.equals(" tick")) && this.moduleComponent.mod.moduleCategory() != Module.category.scripts) { + suffix += "s"; + } + if (this.sliderSetting.isString) { + value = this.sliderSetting.getOptions()[(int) this.sliderSetting.getInput()]; + } + else { + value = Utils.isWholeNumber(input) ? (int) input + "" : String.valueOf(input); + } + } + Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(this.sliderSetting.getName() + ": " + (this.sliderSetting.isString ? "§e" : "§b") +value + suffix, (float) ((int) ((float) (this.moduleComponent.categoryComponent.getX() + 4) * 2.0F)), (float) ((int) ((float) (this.moduleComponent.categoryComponent.getY() + this.o + 3) * 2.0F)), -1); + GL11.glPopMatrix(); + } + + public void updateHeight(int n) { + this.o = n; + } + + public void drawScreen(int x, int y) { + this.y = this.moduleComponent.categoryComponent.getModuleY() + this.o; + this.x = this.moduleComponent.categoryComponent.getX(); + double d = Math.min(this.moduleComponent.categoryComponent.getWidth() - 8, Math.max(0, x - this.x)); + + if (this.heldDown) { + this.moduleComponent.mod.onSlide(this.sliderSetting); + if (d == 0.0D && this.sliderSetting.canBeDisabled) { + this.sliderSetting.setValueRaw(-1); + } + else { + double n = roundToInterval(d / (double) (this.moduleComponent.categoryComponent.getWidth() - 8) * (this.sliderSetting.getMax() - this.sliderSetting.getMin()) + this.sliderSetting.getMin(), 4); + this.sliderSetting.setValue(n); + } + + if (this.sliderSetting.getInput() != this.sliderSetting.getMin() && ModuleManager.hud != null && ModuleManager.hud.isEnabled() && !ModuleManager.organizedModules.isEmpty()) { + ModuleManager.sort(); + } + + if (Raven.currentProfile != null) { + ((ProfileModule) Raven.currentProfile.getModule()).saved = false; + } + } + + this.w = this.sliderSetting.getInput() == -1 ? 0 : (double) (this.moduleComponent.categoryComponent.getWidth() - 8) * (this.sliderSetting.getInput() - this.sliderSetting.getMin()) / (this.sliderSetting.getMax() - this.sliderSetting.getMin()); + } + + private static double roundToInterval(double v, int p) { + if (p < 0) { + return 0.0D; + } else { + BigDecimal bd = new BigDecimal(v); + bd = bd.setScale(p, RoundingMode.HALF_UP); + return bd.doubleValue(); + } + } + + public boolean onClick(int x, int y, int b) { + if ((this.u(x, y) || this.i(x, y)) && b == 0 && this.moduleComponent.isOpened) { + this.heldDown = true; + } + return false; + } + + public void mouseReleased(int x, int y, int m) { + this.heldDown = false; + } + + public boolean u(int x, int y) { + return x > this.x && x < this.x + this.moduleComponent.categoryComponent.getWidth() / 2 + 1 && y > this.y && y < this.y + 16; + } + + public boolean i(int x, int y) { + return x > this.x + this.moduleComponent.categoryComponent.getWidth() / 2 && x < this.x + this.moduleComponent.categoryComponent.getWidth() && y > this.y && y < this.y + 16; + } + + @Override + public void onGuiClosed() { + this.heldDown = false; + } +} diff --git a/src/main/java/keystrokesmod/event/AllPacketsEvent.java b/src/main/java/keystrokesmod/event/AllPacketsEvent.java new file mode 100644 index 0000000..4eb872f --- /dev/null +++ b/src/main/java/keystrokesmod/event/AllPacketsEvent.java @@ -0,0 +1,16 @@ +package keystrokesmod.event; + +import net.minecraft.network.Packet; +import net.minecraftforge.fml.common.eventhandler.Event; + +public class AllPacketsEvent extends Event { + private Packet packet; + + public AllPacketsEvent(Packet packet) { + this.packet = packet; + } + + public Packet getPacket() { + return packet; + } +} diff --git a/src/main/java/keystrokesmod/event/GuiUpdateEvent.java b/src/main/java/keystrokesmod/event/GuiUpdateEvent.java new file mode 100644 index 0000000..9e6558d --- /dev/null +++ b/src/main/java/keystrokesmod/event/GuiUpdateEvent.java @@ -0,0 +1,14 @@ +package keystrokesmod.event; + +import net.minecraft.client.gui.GuiScreen; +import net.minecraftforge.fml.common.eventhandler.Event; + +public class GuiUpdateEvent extends Event { + public GuiScreen guiScreen; + public boolean opened; + + public GuiUpdateEvent(GuiScreen guiScreen, boolean opened) { + this.guiScreen = guiScreen; + this.opened = opened; + } +} diff --git a/src/main/java/keystrokesmod/event/JumpEvent.java b/src/main/java/keystrokesmod/event/JumpEvent.java new file mode 100644 index 0000000..ad1e67c --- /dev/null +++ b/src/main/java/keystrokesmod/event/JumpEvent.java @@ -0,0 +1,40 @@ +package keystrokesmod.event; + +import net.minecraftforge.fml.common.eventhandler.Cancelable; +import net.minecraftforge.fml.common.eventhandler.Event; + +@Cancelable +public class JumpEvent extends Event { + private float motionY, yaw; + private boolean applySprint; + + public JumpEvent(float motionY, float yaw, boolean applySprint) { + this.motionY = motionY; + this.yaw = yaw; + this.applySprint = applySprint; + } + + public float getMotionY() { + return motionY; + } + + public void setMotionY(float motionY) { + this.motionY = motionY; + } + + public float getYaw() { + return yaw; + } + + public void setYaw(float yaw) { + this.yaw = yaw; + } + + public boolean applySprint() { + return applySprint; + } + + public void setSprint(boolean applySprint) { + this.applySprint = applySprint; + } +} diff --git a/src/main/java/keystrokesmod/event/PostMotionEvent.java b/src/main/java/keystrokesmod/event/PostMotionEvent.java new file mode 100644 index 0000000..fdb0584 --- /dev/null +++ b/src/main/java/keystrokesmod/event/PostMotionEvent.java @@ -0,0 +1,6 @@ +package keystrokesmod.event; + +import net.minecraftforge.fml.common.eventhandler.Event; + +public class PostMotionEvent extends Event { +} diff --git a/src/main/java/keystrokesmod/event/PostPlayerInputEvent.java b/src/main/java/keystrokesmod/event/PostPlayerInputEvent.java new file mode 100644 index 0000000..8bf80fd --- /dev/null +++ b/src/main/java/keystrokesmod/event/PostPlayerInputEvent.java @@ -0,0 +1,6 @@ +package keystrokesmod.event; + +import net.minecraftforge.fml.common.eventhandler.Event; + +public class PostPlayerInputEvent extends Event { +} diff --git a/src/main/java/keystrokesmod/event/PostUpdateEvent.java b/src/main/java/keystrokesmod/event/PostUpdateEvent.java new file mode 100644 index 0000000..a76b17f --- /dev/null +++ b/src/main/java/keystrokesmod/event/PostUpdateEvent.java @@ -0,0 +1,6 @@ +package keystrokesmod.event; + +import net.minecraftforge.fml.common.eventhandler.Event; + +public class PostUpdateEvent extends Event { +} diff --git a/src/main/java/keystrokesmod/event/PreInputEvent.java b/src/main/java/keystrokesmod/event/PreInputEvent.java new file mode 100644 index 0000000..27a7bd4 --- /dev/null +++ b/src/main/java/keystrokesmod/event/PreInputEvent.java @@ -0,0 +1,5 @@ +package keystrokesmod.event; + +import net.minecraftforge.fml.common.eventhandler.Event; +public class PreInputEvent extends Event { +} diff --git a/src/main/java/keystrokesmod/event/PreMotionEvent.java b/src/main/java/keystrokesmod/event/PreMotionEvent.java new file mode 100644 index 0000000..84e2dd2 --- /dev/null +++ b/src/main/java/keystrokesmod/event/PreMotionEvent.java @@ -0,0 +1,106 @@ +package keystrokesmod.event; + +import keystrokesmod.script.classes.PlayerState; +import net.minecraftforge.fml.common.eventhandler.Event; + +public class PreMotionEvent extends Event { + private double posX; + public double posY; + private double posZ; + private float yaw; + private float pitch; + private boolean onGround; + private static boolean setRenderYaw; + private boolean isSprinting; + private boolean isSneaking; + public static boolean setRotations; + + public PreMotionEvent(double posX, double posY, double posZ, float yaw, float pitch, boolean onGround, boolean isSprinting, boolean isSneaking) { + this.posX = posX; + this.posY = posY; + this.posZ = posZ; + this.yaw = yaw; + this.pitch = pitch; + this.onGround = onGround; + this.isSprinting = isSprinting; + this.isSneaking = isSneaking; + } + + public double getPosX() { + return posX; + } + + public double getPosY() { + return posY; + } + + public double getPosZ() { + return posZ; + } + + public float getYaw() { + return yaw; + } + + public float getPitch() { + return pitch; + } + + public boolean isOnGround() { + return onGround; + } + + public void setPosX(double posX) { + this.posX = posX; + } + + public void setPosY(double posY) { + this.posY = posY; + } + + public void setPosZ(double posZ) { + this.posZ = posZ; + } + + public void setYaw(float yaw) { + this.yaw = yaw; + this.setRenderYaw = true; + setRotations = true; + } + + public void setPitch(float pitch) { + this.pitch = pitch; + setRotations = true; + } + + public void setOnGround(boolean onGround) { + this.onGround = onGround; + } + + public static boolean setRenderYaw() { + return setRenderYaw; + } + + public void setRenderYaw(boolean setRenderYaw) { + this.setRenderYaw = setRenderYaw; + } + public boolean isSprinting() { + return isSprinting; + } + + public void setSprinting(boolean sprinting) { + this.isSprinting = sprinting; + } + + public boolean isSneaking() { + return isSneaking; + } + + public void setSneaking(boolean sneaking) { + this.isSneaking = sneaking; + } + + public boolean isEquals(PlayerState e) { + return e.x == this.posX && e.y == this.posY && e.z == this.posZ && e.yaw == this.yaw && e.pitch == this.pitch && e.onGround == this.onGround && e.isSprinting == this.isSprinting && e.isSneaking == this.isSneaking; + } +} diff --git a/src/main/java/keystrokesmod/event/PrePlayerInputEvent.java b/src/main/java/keystrokesmod/event/PrePlayerInputEvent.java new file mode 100644 index 0000000..ccef1b0 --- /dev/null +++ b/src/main/java/keystrokesmod/event/PrePlayerInputEvent.java @@ -0,0 +1,57 @@ +package keystrokesmod.event; + +import net.minecraftforge.fml.common.eventhandler.Event; + +public class PrePlayerInputEvent extends Event { + private float forward, strafe; + private boolean jump, sneak; + private double sneakSlowDownMultiplier; + + public PrePlayerInputEvent(float forward, float strafe, boolean jump, boolean sneak, double sneakSlowDownMultiplier) { + this.forward = forward; + this.strafe = strafe; + this.jump = jump; + this.sneak = sneak; + this.sneakSlowDownMultiplier = sneakSlowDownMultiplier; + } + + public float getForward() { + return forward; + } + + public void setForward(float forward) { + this.forward = forward; + } + + public float getStrafe() { + return strafe; + } + + public void setStrafe(float strafe) { + this.strafe = strafe; + } + + public boolean isJump() { + return jump; + } + + public void setJump(boolean jump) { + this.jump = jump; + } + + public boolean isSneak() { + return sneak; + } + + public void setSneak(boolean sneak) { + this.sneak = sneak; + } + + public double getSneakSlowDownMultiplier() { + return sneakSlowDownMultiplier; + } + + public void setSneakSlowDownMultiplier(double sneakSlowDownMultiplier) { + this.sneakSlowDownMultiplier = sneakSlowDownMultiplier; + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/event/PreUpdateEvent.java b/src/main/java/keystrokesmod/event/PreUpdateEvent.java new file mode 100644 index 0000000..67787c4 --- /dev/null +++ b/src/main/java/keystrokesmod/event/PreUpdateEvent.java @@ -0,0 +1,6 @@ +package keystrokesmod.event; + +import net.minecraftforge.fml.common.eventhandler.Event; + +public class PreUpdateEvent extends Event { +} diff --git a/src/main/java/keystrokesmod/event/ReceivePacketEvent.java b/src/main/java/keystrokesmod/event/ReceivePacketEvent.java new file mode 100644 index 0000000..06d4cd5 --- /dev/null +++ b/src/main/java/keystrokesmod/event/ReceivePacketEvent.java @@ -0,0 +1,18 @@ +package keystrokesmod.event; + +import net.minecraft.network.Packet; +import net.minecraftforge.fml.common.eventhandler.Cancelable; +import net.minecraftforge.fml.common.eventhandler.Event; + +@Cancelable +public class ReceivePacketEvent extends Event { + private Packet packet; + + public ReceivePacketEvent(Packet packet) { + this.packet = packet; + } + + public Packet getPacket() { + return packet; + } +} diff --git a/src/main/java/keystrokesmod/event/SendPacketEvent.java b/src/main/java/keystrokesmod/event/SendPacketEvent.java new file mode 100644 index 0000000..37f1c9c --- /dev/null +++ b/src/main/java/keystrokesmod/event/SendPacketEvent.java @@ -0,0 +1,18 @@ +package keystrokesmod.event; + +import net.minecraft.network.Packet; +import net.minecraftforge.fml.common.eventhandler.Cancelable; +import net.minecraftforge.fml.common.eventhandler.Event; + +@Cancelable +public class SendPacketEvent extends Event { + private Packet packet; + + public SendPacketEvent(Packet packet) { + this.packet = packet; + } + + public Packet getPacket() { + return packet; + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/event/StrafeEvent.java b/src/main/java/keystrokesmod/event/StrafeEvent.java new file mode 100644 index 0000000..98d6a23 --- /dev/null +++ b/src/main/java/keystrokesmod/event/StrafeEvent.java @@ -0,0 +1,49 @@ +package keystrokesmod.event; + +import net.minecraftforge.fml.common.eventhandler.Event; + +public class StrafeEvent extends Event { + private float forward; + private float strafe; + private float friction; + private float yaw; + + public StrafeEvent(float strafe, float forward, float friction, float yaw) { + this.strafe = strafe; + this.forward = forward; + this.friction = friction; + this.yaw = yaw; + } + + public float getStrafe() { + return strafe; + } + + public void setStrafe(float strafe) { + this.strafe = strafe; + } + + public float getForward() { + return forward; + } + + public void setForward(float forward) { + this.forward = forward; + } + + public float getFriction() { + return friction; + } + + public void setFriction(float friction) { + this.friction = friction; + } + + public float getYaw() { + return yaw; + } + + public void setYaw(float yaw) { + this.yaw = yaw; + } +} diff --git a/src/main/java/keystrokesmod/keystroke/KeySrokeRenderer.java b/src/main/java/keystrokesmod/keystroke/KeySrokeRenderer.java new file mode 100644 index 0000000..c8576f3 --- /dev/null +++ b/src/main/java/keystrokesmod/keystroke/KeySrokeRenderer.java @@ -0,0 +1,99 @@ +package keystrokesmod.keystroke; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; + +import java.awt.*; +import java.io.IOException; + +public class KeySrokeRenderer { + private static final int[] a = new int[]{16777215, 16711680, 65280, 255, 16776960, 11141290}; + private Minecraft mc = Minecraft.getMinecraft(); + private KeyStrokeKeyRenderer[] b = new KeyStrokeKeyRenderer[4]; + private KeyStrokeMouse[] c = new KeyStrokeMouse[2]; + + public KeySrokeRenderer() { + this.b[0] = new KeyStrokeKeyRenderer(this.mc.gameSettings.keyBindForward, 26, 2); + this.b[1] = new KeyStrokeKeyRenderer(this.mc.gameSettings.keyBindBack, 26, 26); + this.b[2] = new KeyStrokeKeyRenderer(this.mc.gameSettings.keyBindLeft, 2, 26); + this.b[3] = new KeyStrokeKeyRenderer(this.mc.gameSettings.keyBindRight, 50, 26); + this.c[0] = new KeyStrokeMouse(0, 2, 50); + this.c[1] = new KeyStrokeMouse(1, 38, 50); + } + + @SubscribeEvent + public void onRenderTick(RenderTickEvent e) { + if (this.mc.currentScreen != null) { + if (this.mc.currentScreen instanceof KeyStrokeConfigGui) { + try { + this.mc.currentScreen.handleInput(); + } catch (IOException var3) { + } + } + + } else if (this.mc.inGameHasFocus && !this.mc.gameSettings.showDebugInfo) { + this.renderKeystrokes(); + } + } + + public void renderKeystrokes() { + if (KeyStroke.e) { + int x = KeyStroke.x; + int y = KeyStroke.y; + int g = this.getColor(KeyStroke.currentColorNumber); + boolean h = KeyStroke.d; + ScaledResolution res = new ScaledResolution(this.mc); + int width = 74; + int height = h ? 74 : 50; + if (x < 0) { + KeyStroke.x = 0; + x = KeyStroke.x; + } else if (x > res.getScaledWidth() - width) { + KeyStroke.x = res.getScaledWidth() - width; + x = KeyStroke.x; + } + + if (y < 0) { + KeyStroke.y = 0; + y = KeyStroke.y; + } else if (y > res.getScaledHeight() - height) { + KeyStroke.y = res.getScaledHeight() - height; + y = KeyStroke.y; + } + + this.drawMovementKeys(x, y, g); + if (h) { + this.drawMouseButtons(x, y, g); + } + + } + } + + private int getColor(int index) { + return index == 6 ? Color.getHSBColor((float) (System.currentTimeMillis() % 3750L) / 3750.0F, 1.0F, 1.0F).getRGB() : a[index]; + } + + private void drawMovementKeys(int x, int y, int textColor) { + KeyStrokeKeyRenderer[] var4 = this.b; + int var5 = var4.length; + + for (int var6 = 0; var6 < var5; ++var6) { + KeyStrokeKeyRenderer key = var4[var6]; + key.renderKey(x, y, textColor); + } + + } + + private void drawMouseButtons(int x, int y, int textColor) { + KeyStrokeMouse[] var4 = this.c; + int var5 = var4.length; + + for (int var6 = 0; var6 < var5; ++var6) { + KeyStrokeMouse button = var4[var6]; + button.n(x, y, textColor); + } + + } +} diff --git a/src/main/java/keystrokesmod/keystroke/KeyStroke.java b/src/main/java/keystrokesmod/keystroke/KeyStroke.java new file mode 100644 index 0000000..62b619a --- /dev/null +++ b/src/main/java/keystrokesmod/keystroke/KeyStroke.java @@ -0,0 +1,19 @@ +package keystrokesmod.keystroke; + +public class KeyStroke { + public static int x; + public static int y; + public static int currentColorNumber; + public static boolean d; + public static boolean e; + public static boolean f; + + public KeyStroke() { + x = 0; + y = 0; + currentColorNumber = 0; + d = false; + e = true; + f = false; + } +} diff --git a/src/main/java/keystrokesmod/keystroke/KeyStrokeConfigGui.java b/src/main/java/keystrokesmod/keystroke/KeyStrokeConfigGui.java new file mode 100644 index 0000000..f0241ec --- /dev/null +++ b/src/main/java/keystrokesmod/keystroke/KeyStrokeConfigGui.java @@ -0,0 +1,90 @@ +package keystrokesmod.keystroke; + +import java.io.IOException; + +import keystrokesmod.utility.CPSCalculator; +import keystrokesmod.Raven; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; + +public class KeyStrokeConfigGui extends GuiScreen { + private static final String[] colors = new String[]{"White", "Red", "Green", "Blue", "Yellow", "Purple", "Rainbow"}; + private GuiButton modeBtn; + private GuiButton textColorBtn; + private GuiButton showMouseBtn; + private GuiButton outlineBtn; + private boolean d = false; + private int lx; + private int ly; + + public void initGui() { + this.buttonList.add(this.modeBtn = new GuiButton(0, this.width / 2 - 70, this.height / 2 - 28, 140, 20, "Mod: " + (KeyStroke.e ? "Enabled" : "Disabled"))); + this.buttonList.add(this.textColorBtn = new GuiButton(1, this.width / 2 - 70, this.height / 2 - 6, 140, 20, "Text color: " + colors[KeyStroke.currentColorNumber])); + this.buttonList.add(this.showMouseBtn = new GuiButton(2, this.width / 2 - 70, this.height / 2 + 16, 140, 20, "Show mouse buttons: " + (KeyStroke.d ? "On" : "Off"))); + this.buttonList.add(this.outlineBtn = new GuiButton(3, this.width / 2 - 70, this.height / 2 + 38, 140, 20, "Outline: " + (KeyStroke.f ? "On" : "Off"))); + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + Raven.getKeyStrokeRenderer().renderKeystrokes(); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + protected void actionPerformed(GuiButton button) { + if (button == this.modeBtn) { + KeyStroke.e = !KeyStroke.e; + this.modeBtn.displayString = "Mod: " + (KeyStroke.e ? "Enabled" : "Disabled"); + } else if (button == this.textColorBtn) { + KeyStroke.currentColorNumber = KeyStroke.currentColorNumber == 6 ? 0 : KeyStroke.currentColorNumber + 1; + this.textColorBtn.displayString = "Text color: " + colors[KeyStroke.currentColorNumber]; + } else if (button == this.showMouseBtn) { + KeyStroke.d = !KeyStroke.d; + this.showMouseBtn.displayString = "Show mouse buttons: " + (KeyStroke.d ? "On" : "Off"); + } else if (button == this.outlineBtn) { + KeyStroke.f = !KeyStroke.f; + this.outlineBtn.displayString = "Outline: " + (KeyStroke.f ? "On" : "Off"); + } + + } + + protected void mouseClicked(int mouseX, int mouseY, int button) { + try { + super.mouseClicked(mouseX, mouseY, button); + } catch (IOException var9) { + } + + if (button == 0) { + CPSCalculator.aL(); + int startX = KeyStroke.x; + int startY = KeyStroke.y; + int endX = startX + 74; + int endY = startY + (KeyStroke.d ? 74 : 50); + if (mouseX >= startX && mouseX <= endX && mouseY >= startY && mouseY <= endY) { + this.d = true; + this.lx = mouseX; + this.ly = mouseY; + } + } else if (button == 1) { + CPSCalculator.aR(); + } + + } + + protected void mouseReleased(int mouseX, int mouseY, int action) { + super.mouseReleased(mouseX, mouseY, action); + this.d = false; + } + + protected void mouseClickMove(int mouseX, int mouseY, int lastButtonClicked, long timeSinceMouseClick) { + super.mouseClickMove(mouseX, mouseY, lastButtonClicked, timeSinceMouseClick); + if (this.d) { + KeyStroke.x = KeyStroke.x + mouseX - this.lx; + KeyStroke.y = KeyStroke.y + mouseY - this.ly; + this.lx = mouseX; + this.ly = mouseY; + } + } + + public boolean doesGuiPauseGame() { + return false; + } +} diff --git a/src/main/java/keystrokesmod/keystroke/KeyStrokeKeyRenderer.java b/src/main/java/keystrokesmod/keystroke/KeyStrokeKeyRenderer.java new file mode 100644 index 0000000..ce3ed6a --- /dev/null +++ b/src/main/java/keystrokesmod/keystroke/KeyStrokeKeyRenderer.java @@ -0,0 +1,55 @@ +package keystrokesmod.keystroke; + +import java.awt.Color; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.KeyBinding; +import org.lwjgl.input.Keyboard; + +public class KeyStrokeKeyRenderer { + private Minecraft a = Minecraft.getMinecraft(); + private KeyBinding keyBinding; + private int c; + private int d; + private boolean e = true; + private long f = 0L; + private int g = 255; + private double h = 1.0D; + + public KeyStrokeKeyRenderer(KeyBinding i, int j, int k) { + this.keyBinding = i; + this.c = j; + this.d = k; + } + + public void renderKey(int l, int m, int color) { + boolean o = this.keyBinding.isKeyDown(); + String p = Keyboard.getKeyName(this.keyBinding.getKeyCode()); + if (o != this.e) { + this.e = o; + this.f = System.currentTimeMillis(); + } + + if (o) { + this.g = Math.min(255, (int) (2L * (System.currentTimeMillis() - this.f))); + this.h = Math.max(0.0D, 1.0D - (double) (System.currentTimeMillis() - this.f) / 20.0D); + } else { + this.g = Math.max(0, 255 - (int) (2L * (System.currentTimeMillis() - this.f))); + this.h = Math.min(1.0D, (double) (System.currentTimeMillis() - this.f) / 20.0D); + } + + int q = color >> 16 & 255; + int r = color >> 8 & 255; + int s = color & 255; + int c = (new Color(q, r, s)).getRGB(); + net.minecraft.client.gui.Gui.drawRect(l + this.c, m + this.d, l + this.c + 22, m + this.d + 22, 2013265920 + (this.g << 16) + (this.g << 8) + this.g); + if (KeyStroke.f) { + net.minecraft.client.gui.Gui.drawRect(l + this.c, m + this.d, l + this.c + 22, m + this.d + 1, c); + net.minecraft.client.gui.Gui.drawRect(l + this.c, m + this.d + 21, l + this.c + 22, m + this.d + 22, c); + net.minecraft.client.gui.Gui.drawRect(l + this.c, m + this.d, l + this.c + 1, m + this.d + 22, c); + net.minecraft.client.gui.Gui.drawRect(l + this.c + 21, m + this.d, l + this.c + 22, m + this.d + 22, c); + } + + this.a.fontRendererObj.drawString(p, l + this.c + 8, m + this.d + 8, -16777216 + ((int) ((double) q * this.h) << 16) + ((int) ((double) r * this.h) << 8) + (int) ((double) s * this.h)); + } +} diff --git a/src/main/java/keystrokesmod/keystroke/KeyStrokeMouse.java b/src/main/java/keystrokesmod/keystroke/KeyStrokeMouse.java new file mode 100644 index 0000000..12c0741 --- /dev/null +++ b/src/main/java/keystrokesmod/keystroke/KeyStrokeMouse.java @@ -0,0 +1,72 @@ +package keystrokesmod.keystroke; + +import keystrokesmod.utility.CPSCalculator; +import net.minecraft.client.Minecraft; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.util.ArrayList; +import java.util.List; + +public class KeyStrokeMouse { + private static String[] a = new String[]{"LMB", "RMB"}; + private Minecraft b = Minecraft.getMinecraft(); + private int c; + private int d; + private int e; + private List f = new ArrayList(); + private boolean g = true; + private long h = 0L; + private int i = 255; + private double j = 1.0D; + + public KeyStrokeMouse(int k, int l, int m) { + this.c = k; + this.d = l; + this.e = m; + } + + public void n(int o, int p, int color) { + boolean r = Mouse.isButtonDown(this.c); + String s = a[this.c]; + if (r != this.g) { + this.g = r; + this.h = System.currentTimeMillis(); + if (r) { + this.f.add(this.h); + } + } + + if (r) { + this.i = Math.min(255, (int) (2L * (System.currentTimeMillis() - this.h))); + this.j = Math.max(0.0D, 1.0D - (double) (System.currentTimeMillis() - this.h) / 20.0D); + } else { + this.i = Math.max(0, 255 - (int) (2L * (System.currentTimeMillis() - this.h))); + this.j = Math.min(1.0D, (double) (System.currentTimeMillis() - this.h) / 20.0D); + } + + int t = color >> 16 & 255; + int u = color >> 8 & 255; + int v = color & 255; + int c = (new Color(t, u, v)).getRGB(); + net.minecraft.client.gui.Gui.drawRect(o + this.d, p + this.e, o + this.d + 34, p + this.e + 22, 2013265920 + (this.i << 16) + (this.i << 8) + this.i); + if (KeyStroke.f) { + net.minecraft.client.gui.Gui.drawRect(o + this.d, p + this.e, o + this.d + 34, p + this.e + 1, c); + net.minecraft.client.gui.Gui.drawRect(o + this.d, p + this.e + 21, o + this.d + 34, p + this.e + 22, c); + net.minecraft.client.gui.Gui.drawRect(o + this.d, p + this.e, o + this.d + 1, p + this.e + 22, c); + net.minecraft.client.gui.Gui.drawRect(o + this.d + 33, p + this.e, o + this.d + 34, p + this.e + 22, c); + } + + this.b.fontRendererObj.drawString(s, o + this.d + 8, p + this.e + 4, -16777216 + ((int) ((double) t * this.j) << 16) + ((int) ((double) u * this.j) << 8) + (int) ((double) v * this.j)); + String w = CPSCalculator.f() + " CPS"; + String x = CPSCalculator.i() + " CPS"; + int y = this.b.fontRendererObj.getStringWidth(w); + int z = this.b.fontRendererObj.getStringWidth(x); + boolean a2 = this.c == 0; + int b2 = a2 ? y : z; + GL11.glScalef(0.5F, 0.5F, 0.5F); + this.b.fontRendererObj.drawString(a2 ? w : x, (o + this.d + 17) * 2 - b2 / 2, (p + this.e + 14) * 2, -16777216 + ((int) (255.0D * this.j) << 16) + ((int) (255.0D * this.j) << 8) + (int) (255.0D * this.j)); + GL11.glScalef(2.0F, 2.0F, 2.0F); + } +} diff --git a/src/main/java/keystrokesmod/keystroke/keystrokeCommand.java b/src/main/java/keystrokesmod/keystroke/keystrokeCommand.java new file mode 100644 index 0000000..55bc038 --- /dev/null +++ b/src/main/java/keystrokesmod/keystroke/keystrokeCommand.java @@ -0,0 +1,27 @@ +package keystrokesmod.keystroke; + +import keystrokesmod.Raven; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; + +public class keystrokeCommand extends CommandBase { + public String getCommandName() { + return "keystrokesmod"; + } + + public void processCommand(ICommandSender sender, String[] args) { + Raven.toggleKeyStrokeConfigGui(); + } + + public String getCommandUsage(ICommandSender sender) { + return "/keystrokesmod"; + } + + public int getRequiredPermissionLevel() { + return 0; + } + + public boolean canCommandSenderUseCommand(ICommandSender sender) { + return true; + } +} diff --git a/src/main/java/keystrokesmod/mixins/MixinLoader.java b/src/main/java/keystrokesmod/mixins/MixinLoader.java new file mode 100644 index 0000000..dc05381 --- /dev/null +++ b/src/main/java/keystrokesmod/mixins/MixinLoader.java @@ -0,0 +1,48 @@ +package keystrokesmod.mixins; + +import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.launch.MixinBootstrap; +import org.spongepowered.asm.mixin.MixinEnvironment; +import org.spongepowered.asm.mixin.Mixins; + +import java.util.Map; + +@IFMLLoadingPlugin.MCVersion("1.8.9") +public class MixinLoader implements IFMLLoadingPlugin { + public MixinLoader() { + MixinBootstrap.init(); + Mixins.addConfiguration("mixins.raven.json"); + MixinEnvironment.getDefaultEnvironment().setSide(MixinEnvironment.Side.CLIENT); + } + + @NotNull + @Override + public String[] getASMTransformerClass() { + return new String[0]; + } + + @Nullable + @Override + public String getModContainerClass() { + return null; + } + + @Nullable + @Override + public String getSetupClass() { + return null; + } + + @Override + public void injectData(Map data) { + + } + + @Nullable + @Override + public String getAccessTransformerClass() { + return null; + } +} diff --git a/src/main/java/keystrokesmod/mixins/impl/client/MixinMinecraft.java b/src/main/java/keystrokesmod/mixins/impl/client/MixinMinecraft.java new file mode 100644 index 0000000..99f9bec --- /dev/null +++ b/src/main/java/keystrokesmod/mixins/impl/client/MixinMinecraft.java @@ -0,0 +1,33 @@ +package keystrokesmod.mixins.impl.client; + +import keystrokesmod.event.GuiUpdateEvent; +import keystrokesmod.event.PreInputEvent; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraftforge.common.MinecraftForge; +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; + +@Mixin(Minecraft.class) +public class MixinMinecraft { + @Inject(method = "runTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/profiler/Profiler;endStartSection(Ljava/lang/String;)V", ordinal = 2)) + private void onRunTick(CallbackInfo ci) { + MinecraftForge.EVENT_BUS.post(new PreInputEvent()); + } + + @Inject(method = "displayGuiScreen(Lnet/minecraft/client/gui/GuiScreen;)V", at = @At("HEAD")) + public void onDisplayGuiScreen(GuiScreen guiScreen, CallbackInfo ci) { + Minecraft mc = (Minecraft) (Object) this; + GuiScreen previousGui = mc.currentScreen; + GuiScreen setGui = guiScreen; + boolean opened = setGui != null; + if (!opened) { + setGui = previousGui; + } + + GuiUpdateEvent event = new GuiUpdateEvent(setGui, opened); + MinecraftForge.EVENT_BUS.post(event); + } +} diff --git a/src/main/java/keystrokesmod/mixins/impl/client/MixinMovementInputFromOptions.java b/src/main/java/keystrokesmod/mixins/impl/client/MixinMovementInputFromOptions.java new file mode 100644 index 0000000..56915dd --- /dev/null +++ b/src/main/java/keystrokesmod/mixins/impl/client/MixinMovementInputFromOptions.java @@ -0,0 +1,61 @@ +package keystrokesmod.mixins.impl.client; + +import keystrokesmod.event.PostPlayerInputEvent; +import keystrokesmod.event.PrePlayerInputEvent; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.MovementInput; +import net.minecraft.util.MovementInputFromOptions; +import net.minecraftforge.common.MinecraftForge; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; + +@Mixin(MovementInputFromOptions.class) +public class MixinMovementInputFromOptions extends MovementInput { + @Shadow + @Final + private GameSettings gameSettings; + + @Overwrite + public void updatePlayerMoveState() { + this.moveStrafe = 0.0F; + this.moveForward = 0.0F; + + if (this.gameSettings.keyBindForward.isKeyDown()) { + ++this.moveForward; + } + + if (this.gameSettings.keyBindBack.isKeyDown()) { + --this.moveForward; + } + + if (this.gameSettings.keyBindLeft.isKeyDown()) { + ++this.moveStrafe; + } + + if (this.gameSettings.keyBindRight.isKeyDown()) { + --this.moveStrafe; + } + + this.jump = this.gameSettings.keyBindJump.isKeyDown(); + this.sneak = this.gameSettings.keyBindSneak.isKeyDown(); + + PrePlayerInputEvent moveInputEvent = new PrePlayerInputEvent(moveForward, moveStrafe, jump, sneak, 0.3D); + + MinecraftForge.EVENT_BUS.post(moveInputEvent); + + double sneakMultiplier = moveInputEvent.getSneakSlowDownMultiplier(); + this.moveForward = moveInputEvent.getForward(); + this.moveStrafe = moveInputEvent.getStrafe(); + this.jump = moveInputEvent.isJump(); + this.sneak = moveInputEvent.isSneak(); + + if (this.sneak) { + this.moveStrafe = (float) ((double) this.moveStrafe * sneakMultiplier); + this.moveForward = (float) ((double) this.moveForward * sneakMultiplier); + } + + MinecraftForge.EVENT_BUS.post(new PostPlayerInputEvent()); + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/mixins/impl/client/MixinWorld.java b/src/main/java/keystrokesmod/mixins/impl/client/MixinWorld.java new file mode 100644 index 0000000..cae9fc3 --- /dev/null +++ b/src/main/java/keystrokesmod/mixins/impl/client/MixinWorld.java @@ -0,0 +1,29 @@ +package keystrokesmod.mixins.impl.client; + +import keystrokesmod.module.ModuleManager; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +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; + +@SideOnly(Side.CLIENT) +@Mixin(World.class) +public class MixinWorld { + + @Inject(method = "getThunderStrength", at = @At("RETURN"), cancellable = true) + public void setThunderStrength(CallbackInfoReturnable clr) { + if (ModuleManager.weather != null && ModuleManager.weather.isEnabled() && ModuleManager.weather.lightning.getInput() > 0) { + clr.setReturnValue((float) ModuleManager.weather.lightning.getInput()); + } + } + + @Inject(method = "getRainStrength", at = @At("RETURN"), cancellable = true) + public void setPrecipitationStrength(CallbackInfoReturnable clr) { + if (ModuleManager.weather != null && ModuleManager.weather.isEnabled() && ModuleManager.weather.rain.isToggled()) { + clr.setReturnValue(1F); + } + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/mixins/impl/client/MixinWorldInfo.java b/src/main/java/keystrokesmod/mixins/impl/client/MixinWorldInfo.java new file mode 100644 index 0000000..b00361b --- /dev/null +++ b/src/main/java/keystrokesmod/mixins/impl/client/MixinWorldInfo.java @@ -0,0 +1,31 @@ +package keystrokesmod.mixins.impl.client; + +import keystrokesmod.module.ModuleManager; +import net.minecraft.world.storage.WorldInfo; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +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; + +@Mixin(WorldInfo.class) +public abstract class MixinWorldInfo { + @Shadow + private long worldTime; + + @Overwrite + public long getWorldTime() { + if (ModuleManager.weather != null && ModuleManager.weather.isEnabled()) { + return (long) (ModuleManager.weather.time.getInput() * 1000); + } + return worldTime; + } + + @Inject(method = "isRaining", at = @At("RETURN"), cancellable = true) + private void setPrecipitation(CallbackInfoReturnable clr) { + if (ModuleManager.weather != null && ModuleManager.weather.isEnabled() && ModuleManager.weather.rain.isToggled()) { + clr.setReturnValue(true); + } + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/mixins/impl/entity/MixinEntity.java b/src/main/java/keystrokesmod/mixins/impl/entity/MixinEntity.java new file mode 100644 index 0000000..2b78ac0 --- /dev/null +++ b/src/main/java/keystrokesmod/mixins/impl/entity/MixinEntity.java @@ -0,0 +1,69 @@ +package keystrokesmod.mixins.impl.entity; + +import keystrokesmod.event.StrafeEvent; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.player.Safewalk; +import keystrokesmod.utility.*; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import net.minecraftforge.common.MinecraftForge; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.ModifyVariable; + +@Mixin(Entity.class) +public abstract class MixinEntity { + @Shadow + public double motionX; + @Shadow + public double motionZ; + @Shadow + public float rotationYaw; + + @ModifyVariable(method = "moveEntity", at = @At(value = "STORE", ordinal = 0), name = "flag") + private boolean injectSafeWalk(boolean flag) { + Entity entity = (Entity) (Object) this; + Minecraft mc = Minecraft.getMinecraft(); + + if (entity == mc.thePlayer && entity.onGround) { + if (Safewalk.canSafeWalk() || ModuleManager.scaffold.canSafewalk()) { + //Utils.print("Safewalking"); + return true; + } + } + return flag; + } + + @Overwrite + public void moveFlying(float strafe, float forward, float friction) { + StrafeEvent strafeEvent = new StrafeEvent(strafe, forward, friction, this.rotationYaw); + if((Object) this == Minecraft.getMinecraft().thePlayer) { + MinecraftForge.EVENT_BUS.post(strafeEvent); + } + + strafe = strafeEvent.getStrafe(); + forward = strafeEvent.getForward(); + friction = strafeEvent.getFriction(); + float yaw = strafeEvent.getYaw(); + + float f = (strafe * strafe) + (forward * forward); + + if (f >= 1.0E-4F) { + f = MathHelper.sqrt_float(f); + if (f < 1.0F) { + f = 1.0F; + } + + f = friction / f; + strafe *= f; + forward *= f; + float f1 = MathHelper.sin(yaw * (float)Math.PI / 180.0F); + float f2 = MathHelper.cos(yaw * (float)Math.PI / 180.0F); + this.motionX += strafe * f2 - forward * f1; + this.motionZ += forward * f2 + strafe * f1; + } + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/mixins/impl/entity/MixinEntityLivingBase.java b/src/main/java/keystrokesmod/mixins/impl/entity/MixinEntityLivingBase.java new file mode 100644 index 0000000..bfecb71 --- /dev/null +++ b/src/main/java/keystrokesmod/mixins/impl/entity/MixinEntityLivingBase.java @@ -0,0 +1,129 @@ +package keystrokesmod.mixins.impl.entity; + +import com.google.common.collect.Maps; +import keystrokesmod.event.JumpEvent; +import keystrokesmod.event.PreMotionEvent; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.client.Settings; +import keystrokesmod.utility.RotationUtils; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +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 java.util.Map; + +@Mixin(EntityLivingBase.class) +public abstract class MixinEntityLivingBase extends Entity { + public MixinEntityLivingBase(World worldIn) { + super(worldIn); + } + + private final Map activePotionsMap = Maps.newHashMap(); + + @Shadow + public PotionEffect getActivePotionEffect(Potion potionIn) { + return (PotionEffect) this.activePotionsMap.get(Integer.valueOf(potionIn.id)); + } + + @Shadow + public boolean isPotionActive(Potion potionIn) { + return this.activePotionsMap.containsKey(Integer.valueOf(potionIn.id)); + } + + @Shadow + public float rotationYawHead; + + @Shadow + public float renderYawOffset; + + @Shadow + public float swingProgress; + + @Inject(method = "func_110146_f", at = @At("HEAD"), cancellable = true) + protected void injectFunc110146_f(float p_110146_1_, float p_110146_2_, CallbackInfoReturnable cir) { + float rotationYaw = this.rotationYaw; + if (Settings.fullBody != null && Settings.rotateBody != null && !Settings.fullBody.isToggled() && Settings.rotateBody.isToggled() && (EntityLivingBase) (Object) this instanceof EntityPlayerSP) { + if (this.swingProgress > 0F) { + p_110146_1_ = RotationUtils.renderYaw; + } + rotationYaw = RotationUtils.renderYaw; + rotationYawHead = RotationUtils.renderYaw; + } + + float f = MathHelper.wrapAngleTo180_float(p_110146_1_ - this.renderYawOffset); + this.renderYawOffset += f * 0.3F; + float f1 = MathHelper.wrapAngleTo180_float(rotationYaw - this.renderYawOffset); + boolean flag = f1 < 90.0F || f1 >= 90.0F; + + if (f1 < -75.0F) { + f1 = -75.0F; + } + + if (f1 >= 75.0F) { + f1 = 75.0F; + } + + this.renderYawOffset = rotationYaw - f1; + + if (f1 * f1 > 2500.0F) { + this.renderYawOffset += f1 * 0.2F; + } + + if (flag) { + p_110146_2_ *= -1.0F; + } + + cir.setReturnValue(p_110146_2_); + } + + @Shadow + protected float getJumpUpwardsMotion() { + return 0.42F; + } + + @Overwrite + protected void jump() { + JumpEvent jumpEvent = new JumpEvent(this.getJumpUpwardsMotion(), this.rotationYaw, this.isSprinting()); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(jumpEvent); + if (jumpEvent.isCanceled()) { + return; + } + + if (Settings.movementFix != null && Settings.movementFix.isToggled() && PreMotionEvent.setRenderYaw()) { + jumpEvent.setYaw(RotationUtils.renderYaw); + } + + this.motionY = jumpEvent.getMotionY(); + + if (this.isPotionActive(Potion.jump)) { + this.motionY += (double) ((float) (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F); + } + + if (jumpEvent.applySprint()) { + float f = jumpEvent.getYaw() * 0.017453292F; + this.motionX -= (double) (MathHelper.sin(f) * 0.2F); + this.motionZ += (double) (MathHelper.cos(f) * 0.2F); + } + + this.isAirBorne = true; + ForgeHooks.onLivingJump(((EntityLivingBase) (Object) this)); + } + + @Inject(method = "isPotionActive(Lnet/minecraft/potion/Potion;)Z", at = @At("HEAD"), cancellable = true) + private void isPotionActive(Potion p_isPotionActive_1_, final CallbackInfoReturnable callbackInfoReturnable) { + if (ModuleManager.potions != null && ModuleManager.potions.isEnabled() && ((p_isPotionActive_1_ == Potion.confusion && ModuleManager.potions.removeNausea.isToggled()) || (p_isPotionActive_1_ == Potion.blindness && ModuleManager.potions.removeBlindness.isToggled()))) { + callbackInfoReturnable.setReturnValue(false); + } + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/mixins/impl/entity/MixinEntityPlayer.java b/src/main/java/keystrokesmod/mixins/impl/entity/MixinEntityPlayer.java new file mode 100644 index 0000000..605442f --- /dev/null +++ b/src/main/java/keystrokesmod/mixins/impl/entity/MixinEntityPlayer.java @@ -0,0 +1,182 @@ +package keystrokesmod.mixins.impl.entity; + +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.combat.Reduce; +import keystrokesmod.module.impl.movement.KeepSprint; +import net.minecraft.client.Minecraft; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.*; +import net.minecraft.entity.boss.EntityDragonPart; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.potion.Potion; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatList; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +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; + +@Mixin(EntityPlayer.class) +public abstract class MixinEntityPlayer extends EntityLivingBase { + public MixinEntityPlayer(World p_i1594_1_) { + super(p_i1594_1_); + } + + @Shadow + public abstract ItemStack getHeldItem(); + + @Shadow + public abstract void onCriticalHit(Entity p_onCriticalHit_1_); + + @Shadow + public abstract void onEnchantmentCritical(Entity p_onEnchantmentCritical_1_); + + @Shadow + public abstract void triggerAchievement(StatBase p_triggerAchievement_1_); + + @Shadow + public abstract ItemStack getCurrentEquippedItem(); + + @Shadow + public abstract void destroyCurrentEquippedItem(); + + @Shadow + public abstract void addStat(StatBase p_addStat_1_, int p_addStat_2_); + + @Shadow + public abstract void addExhaustion(float p_addExhaustion_1_); + @Shadow + private ItemStack itemInUse; + @Shadow + public abstract boolean isUsingItem(); + + @Overwrite + public void attackTargetEntityWithCurrentItem(Entity p_attackTargetEntityWithCurrentItem_1_) { + if (ForgeHooks.onPlayerAttackTarget(((EntityPlayer) (Object) this), p_attackTargetEntityWithCurrentItem_1_)) { + if (p_attackTargetEntityWithCurrentItem_1_.canAttackWithItem() && !p_attackTargetEntityWithCurrentItem_1_.hitByEntity(this)) { + float f = (float) this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); + int i = 0; + float f1 = 0.0F; + if (p_attackTargetEntityWithCurrentItem_1_ instanceof EntityLivingBase) { + f1 = EnchantmentHelper.func_152377_a(this.getHeldItem(), ((EntityLivingBase) p_attackTargetEntityWithCurrentItem_1_).getCreatureAttribute()); + } else { + f1 = EnchantmentHelper.func_152377_a(this.getHeldItem(), EnumCreatureAttribute.UNDEFINED); + } + + i += EnchantmentHelper.getKnockbackModifier(this); + if (this.isSprinting()) { + ++i; + } + + if (f > 0.0F || f1 > 0.0F) { + boolean flag = this.fallDistance > 0.0F && !this.onGround && !this.isOnLadder() && !this.isInWater() && !this.isPotionActive(Potion.blindness) && this.ridingEntity == null && p_attackTargetEntityWithCurrentItem_1_ instanceof EntityLivingBase; + if (flag && f > 0.0F) { + f *= 1.5F; + } + + f += f1; + boolean flag1 = false; + int j = EnchantmentHelper.getFireAspectModifier(this); + if (p_attackTargetEntityWithCurrentItem_1_ instanceof EntityLivingBase && j > 0 && !p_attackTargetEntityWithCurrentItem_1_.isBurning()) { + flag1 = true; + p_attackTargetEntityWithCurrentItem_1_.setFire(1); + } + + double d0 = p_attackTargetEntityWithCurrentItem_1_.motionX; + double d1 = p_attackTargetEntityWithCurrentItem_1_.motionY; + double d2 = p_attackTargetEntityWithCurrentItem_1_.motionZ; + boolean flag2 = p_attackTargetEntityWithCurrentItem_1_.attackEntityFrom(DamageSource.causePlayerDamage(((EntityPlayer) (Object) this)), f); + if (flag2) { + if (i > 0) { + p_attackTargetEntityWithCurrentItem_1_.addVelocity((double) (-MathHelper.sin(this.rotationYaw * 3.1415927F / 180.0F) * (float) i * 0.5F), 0.1, (double) (MathHelper.cos(this.rotationYaw * 3.1415927F / 180.0F) * (float) i * 0.5F)); + if (ModuleManager.reduce != null && ModuleManager.reduce.isEnabled()) { + Reduce.reduce(p_attackTargetEntityWithCurrentItem_1_); + } + else if (ModuleManager.keepSprint != null && ModuleManager.keepSprint.isEnabled()) { + KeepSprint.keepSprint(p_attackTargetEntityWithCurrentItem_1_); + } + else { + this.motionX *= 0.6D; + this.motionZ *= 0.6D; + this.setSprinting(false); + } + } + + if (p_attackTargetEntityWithCurrentItem_1_ instanceof EntityPlayerMP && p_attackTargetEntityWithCurrentItem_1_.velocityChanged) { + ((EntityPlayerMP) p_attackTargetEntityWithCurrentItem_1_).playerNetServerHandler.sendPacket(new S12PacketEntityVelocity(p_attackTargetEntityWithCurrentItem_1_)); + p_attackTargetEntityWithCurrentItem_1_.velocityChanged = false; + p_attackTargetEntityWithCurrentItem_1_.motionX = d0; + p_attackTargetEntityWithCurrentItem_1_.motionY = d1; + p_attackTargetEntityWithCurrentItem_1_.motionZ = d2; + } + + if (flag) { + this.onCriticalHit(p_attackTargetEntityWithCurrentItem_1_); + } + + if (f1 > 0.0F) { + this.onEnchantmentCritical(p_attackTargetEntityWithCurrentItem_1_); + } + + if (f >= 18.0F) { + this.triggerAchievement(AchievementList.overkill); + } + + this.setLastAttacker(p_attackTargetEntityWithCurrentItem_1_); + if (p_attackTargetEntityWithCurrentItem_1_ instanceof EntityLivingBase) { + EnchantmentHelper.applyThornEnchantments((EntityLivingBase) p_attackTargetEntityWithCurrentItem_1_, this); + } + + EnchantmentHelper.applyArthropodEnchantments(this, p_attackTargetEntityWithCurrentItem_1_); + ItemStack itemstack = this.getCurrentEquippedItem(); + Entity entity = p_attackTargetEntityWithCurrentItem_1_; + if (p_attackTargetEntityWithCurrentItem_1_ instanceof EntityDragonPart) { + IEntityMultiPart ientitymultipart = ((EntityDragonPart) p_attackTargetEntityWithCurrentItem_1_).entityDragonObj; + if (ientitymultipart instanceof EntityLivingBase) { + entity = (EntityLivingBase) ientitymultipart; + } + } + + if (itemstack != null && entity instanceof EntityLivingBase) { + itemstack.hitEntity((EntityLivingBase) entity, ((EntityPlayer) (Object) this)); + if (itemstack.stackSize <= 0) { + this.destroyCurrentEquippedItem(); + } + } + + if (p_attackTargetEntityWithCurrentItem_1_ instanceof EntityLivingBase) { + this.addStat(StatList.damageDealtStat, Math.round(f * 10.0F)); + if (j > 0) { + p_attackTargetEntityWithCurrentItem_1_.setFire(j * 4); + } + } + + this.addExhaustion(0.3F); + } else if (flag1) { + p_attackTargetEntityWithCurrentItem_1_.extinguish(); + } + } + } + + } + } + + @Inject(method = "isBlocking", at = @At("RETURN"), cancellable = true) + private void isBlocking(CallbackInfoReturnable cir) { + if (ModuleManager.killAura != null && ModuleManager.killAura.isEnabled() && ModuleManager.killAura.blockingClient && ((Object) this) == Minecraft.getMinecraft().thePlayer) { + cir.setReturnValue(true); + } + cir.setReturnValue(cir.getReturnValue()); + } + +} diff --git a/src/main/java/keystrokesmod/mixins/impl/entity/MixinEntityPlayerSP.java b/src/main/java/keystrokesmod/mixins/impl/entity/MixinEntityPlayerSP.java new file mode 100644 index 0000000..b1582bf --- /dev/null +++ b/src/main/java/keystrokesmod/mixins/impl/entity/MixinEntityPlayerSP.java @@ -0,0 +1,356 @@ +package keystrokesmod.mixins.impl.entity; + +import com.mojang.authlib.GameProfile; +import keystrokesmod.event.PostMotionEvent; +import keystrokesmod.event.PostUpdateEvent; +import keystrokesmod.event.PreMotionEvent; +import keystrokesmod.event.PreUpdateEvent; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.combat.WTap; +import keystrokesmod.module.impl.movement.NoSlow; +import keystrokesmod.utility.RotationUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.network.play.client.C0CPacketInput; +import net.minecraft.potion.Potion; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MovementInput; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; + +@Mixin(EntityPlayerSP.class) +public abstract class MixinEntityPlayerSP extends AbstractClientPlayer { + @Shadow + public int sprintingTicksLeft; + + private boolean canSprint; + + public MixinEntityPlayerSP(World p_i45074_1_, GameProfile p_i45074_2_) { + super(p_i45074_1_, p_i45074_2_); + } + + @Override + @Shadow + public abstract void setSprinting(boolean p_setSprinting_1_); + + @Shadow + protected int sprintToggleTimer; + @Shadow + public float prevTimeInPortal; + @Shadow + public float timeInPortal; + @Shadow + protected Minecraft mc; + @Shadow + public MovementInput movementInput; + + @Override + @Shadow + public abstract void sendPlayerAbilities(); + + @Shadow + protected abstract boolean isCurrentViewEntity(); + + @Shadow + public abstract boolean isRidingHorse(); + + @Shadow + private int horseJumpPowerCounter; + @Shadow + private float horseJumpPower; + + @Shadow + protected abstract void sendHorseJump(); + + @Shadow + private boolean serverSprintState; + @Shadow + @Final + public NetHandlerPlayClient sendQueue; + + @Override + @Shadow + public abstract boolean isSneaking(); + + @Shadow + private boolean serverSneakState; + @Shadow + private double lastReportedPosX; + @Shadow + private double lastReportedPosY; + @Shadow + private double lastReportedPosZ; + @Shadow + private float lastReportedYaw; + @Shadow + private float lastReportedPitch; + @Shadow + private int positionUpdateTicks; + + @Overwrite + public void onUpdate() { + if (this.worldObj.isBlockLoaded(new BlockPos(this.posX, 0.0, this.posZ))) { + RotationUtils.prevRenderPitch = RotationUtils.renderPitch; + RotationUtils.prevRenderYaw = RotationUtils.renderYaw; + + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new PreUpdateEvent()); + + super.onUpdate(); + + if (this.isRiding()) { + this.sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(this.rotationYaw, this.rotationPitch, this.onGround)); + this.sendQueue.addToSendQueue(new C0CPacketInput(this.moveStrafing, this.moveForward, this.movementInput.jump, this.movementInput.sneak)); + } else { + this.onUpdateWalkingPlayer(); + } + + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new PostUpdateEvent()); + } + } + + @Overwrite + public void onUpdateWalkingPlayer() { + PreMotionEvent preMotionEvent = new PreMotionEvent( + this.posX, + this.getEntityBoundingBox().minY, + this.posZ, + this.rotationYaw, + this.rotationPitch, + this.onGround, + this.isSprinting(), + this.isSneaking() + ); + + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(preMotionEvent); + + RotationUtils.serverRotations = new float[] { preMotionEvent.getYaw(), preMotionEvent.getPitch() }; + + boolean flag = preMotionEvent.isSprinting(); + if (flag != this.serverSprintState) { + if (flag) { + this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.START_SPRINTING)); + } else { + this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.STOP_SPRINTING)); + } + + this.serverSprintState = flag; + } + + boolean flag1 = preMotionEvent.isSneaking(); + if (flag1 != this.serverSneakState) { + if (flag1) { + this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.START_SNEAKING)); + } else { + this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.STOP_SNEAKING)); + } + + this.serverSneakState = flag1; + } + + if (this.isCurrentViewEntity()) { + if (PreMotionEvent.setRenderYaw()) { + RotationUtils.setRenderYaw(preMotionEvent.getYaw()); + preMotionEvent.setRenderYaw(false); + } + + RotationUtils.renderPitch = preMotionEvent.getPitch(); + RotationUtils.renderYaw = preMotionEvent.getYaw(); + + double d0 = preMotionEvent.getPosX() - this.lastReportedPosX; + double d1 = preMotionEvent.getPosY() - this.lastReportedPosY; + double d2 = preMotionEvent.getPosZ() - this.lastReportedPosZ; + double d3 = preMotionEvent.getYaw() - this.lastReportedYaw; + double d4 = preMotionEvent.getPitch() - this.lastReportedPitch; + boolean flag2 = d0 * d0 + d1 * d1 + d2 * d2 > 9.0E-4 || this.positionUpdateTicks >= 20; + boolean flag3 = d3 != 0.0 || d4 != 0.0; + if (this.ridingEntity == null) { + if (flag2 && flag3) { + this.sendQueue.addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(preMotionEvent.getPosX(), preMotionEvent.getPosY(), preMotionEvent.getPosZ(), preMotionEvent.getYaw(), preMotionEvent.getPitch(), preMotionEvent.isOnGround())); + } else if (flag2) { + this.sendQueue.addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(preMotionEvent.getPosX(), preMotionEvent.getPosY(), preMotionEvent.getPosZ(), preMotionEvent.isOnGround())); + } else if (flag3) { + this.sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(preMotionEvent.getYaw(), preMotionEvent.getPitch(), preMotionEvent.isOnGround())); + } else { + this.sendQueue.addToSendQueue(new C03PacketPlayer(preMotionEvent.isOnGround())); + } + } else { + this.sendQueue.addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(this.motionX, -999.0D, this.motionZ, preMotionEvent.getYaw(), preMotionEvent.getPitch(), preMotionEvent.isOnGround())); + flag2 = false; + } + + ++this.positionUpdateTicks; + + if (flag2) { + this.lastReportedPosX = preMotionEvent.getPosX(); + this.lastReportedPosY = preMotionEvent.getPosY(); + this.lastReportedPosZ = preMotionEvent.getPosZ(); + this.positionUpdateTicks = 0; + } + + if (flag3) { + this.lastReportedYaw = preMotionEvent.getYaw(); + this.lastReportedPitch = preMotionEvent.getPitch(); + } + } + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new PostMotionEvent()); + } + + @Overwrite + public void onLivingUpdate() { + if (this.sprintingTicksLeft > 0) { + --this.sprintingTicksLeft; + if (this.sprintingTicksLeft == 0) { + this.setSprinting(false); + } + } + + if (this.sprintToggleTimer > 0) { + --this.sprintToggleTimer; + } + + this.prevTimeInPortal = this.timeInPortal; + if (this.inPortal) { + if (this.mc.currentScreen != null && !this.mc.currentScreen.doesGuiPauseGame()) { + this.mc.displayGuiScreen((GuiScreen) null); + } + + if (this.timeInPortal == 0.0F) { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("portal.trigger"), this.rand.nextFloat() * 0.4F + 0.8F)); + } + + this.timeInPortal += 0.0125F; + if (this.timeInPortal >= 1.0F) { + this.timeInPortal = 1.0F; + } + + this.inPortal = false; + } else if (this.isPotionActive(Potion.confusion) && this.getActivePotionEffect(Potion.confusion).getDuration() > 60) { + this.timeInPortal += 0.006666667F; + if (this.timeInPortal > 1.0F) { + this.timeInPortal = 1.0F; + } + } else { + if (this.timeInPortal > 0.0F) { + this.timeInPortal -= 0.05F; + } + + if (this.timeInPortal < 0.0F) { + this.timeInPortal = 0.0F; + } + } + + if (this.timeUntilPortal > 0) { + --this.timeUntilPortal; + } + + boolean flag = this.movementInput.jump; + boolean flag1 = this.movementInput.sneak; + float f = 0.8F; + boolean flag2 = this.movementInput.moveForward >= f; + this.movementInput.updatePlayerMoveState(); + boolean stopSprint = ModuleManager.noSlow == null || !ModuleManager.noSlow.isEnabled() || NoSlow.slowed.getInput() == 80; + if (this.isUsingItem() && !this.isRiding()) { + MovementInput var10000 = this.movementInput; + float slowed = NoSlow.getSlowed(); + var10000.moveStrafe *= slowed; + var10000 = this.movementInput; + var10000.moveForward *= slowed; + if (stopSprint) { + this.sprintToggleTimer = 0; + } + } + + this.pushOutOfBlocks(this.posX - (double) this.width * 0.35, this.getEntityBoundingBox().minY + 0.5, this.posZ + (double) this.width * 0.35); + this.pushOutOfBlocks(this.posX - (double) this.width * 0.35, this.getEntityBoundingBox().minY + 0.5, this.posZ - (double) this.width * 0.35); + this.pushOutOfBlocks(this.posX + (double) this.width * 0.35, this.getEntityBoundingBox().minY + 0.5, this.posZ - (double) this.width * 0.35); + this.pushOutOfBlocks(this.posX + (double) this.width * 0.35, this.getEntityBoundingBox().minY + 0.5, this.posZ + (double) this.width * 0.35); + boolean flag3 = (float) this.getFoodStats().getFoodLevel() > 6.0F || this.capabilities.allowFlying; + if (this.onGround && !flag1 && !flag2 && this.movementInput.moveForward >= f && !this.isSprinting() && flag3 && (!this.isUsingItem() || !stopSprint) && !this.isPotionActive(Potion.blindness)) { + if (this.sprintToggleTimer <= 0 && !this.mc.gameSettings.keyBindSprint.isKeyDown()) { + this.sprintToggleTimer = 7; + } else { + this.setSprinting(true); + } + } + + if (!this.isSprinting() && this.mc.gameSettings.keyBindSprint.isKeyDown() && (ModuleManager.sprint.omniSprint() || NoSlow.groundSpeed() || this.movementInput.moveForward >= f && flag3) && (!(this.isUsingItem() || mc.thePlayer.isBlocking()) || !stopSprint) && !this.isPotionActive(Potion.blindness)) { + this.setSprinting(true); + } + + if (this.isSprinting() && (!ModuleManager.sprint.omniSprint() && !NoSlow.groundSpeed() && (this.movementInput.moveForward < f || !flag3)) || this.isCollidedHorizontally || (ModuleManager.scaffold != null && ModuleManager.scaffold.isEnabled && (!ModuleManager.scaffold.sprint() || ModuleManager.tower.canTower())) || (ModuleManager.wTap.isEnabled() && WTap.stopSprint)) { + this.setSprinting(false); + WTap.stopSprint = false; + } + + if (this.capabilities.allowFlying) { + if (this.mc.playerController.isSpectatorMode()) { + if (!this.capabilities.isFlying) { + this.capabilities.isFlying = true; + this.sendPlayerAbilities(); + } + } else if (!flag && this.movementInput.jump) { + if (this.flyToggleTimer == 0) { + this.flyToggleTimer = 7; + } else { + this.capabilities.isFlying = !this.capabilities.isFlying; + this.sendPlayerAbilities(); + this.flyToggleTimer = 0; + } + } + } + + if (this.capabilities.isFlying && this.isCurrentViewEntity()) { + if (this.movementInput.sneak) { + this.motionY -= (double) (this.capabilities.getFlySpeed() * 3.0F); + } + + if (this.movementInput.jump) { + this.motionY += (double) (this.capabilities.getFlySpeed() * 3.0F); + } + } + + if (this.isRidingHorse()) { + if (this.horseJumpPowerCounter < 0) { + ++this.horseJumpPowerCounter; + if (this.horseJumpPowerCounter == 0) { + this.horseJumpPower = 0.0F; + } + } + + if (flag && !this.movementInput.jump) { + this.horseJumpPowerCounter = -10; + this.sendHorseJump(); + } else if (!flag && this.movementInput.jump) { + this.horseJumpPowerCounter = 0; + this.horseJumpPower = 0.0F; + } else if (flag) { + ++this.horseJumpPowerCounter; + if (this.horseJumpPowerCounter < 10) { + this.horseJumpPower = (float) this.horseJumpPowerCounter * 0.1F; + } else { + this.horseJumpPower = 0.8F + 2.0F / (float) (this.horseJumpPowerCounter - 9) * 0.1F; + } + } + } else { + this.horseJumpPower = 0.0F; + } + + super.onLivingUpdate(); + if (this.onGround && this.capabilities.isFlying && !this.mc.playerController.isSpectatorMode()) { + this.capabilities.isFlying = false; + this.sendPlayerAbilities(); + } + + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/mixins/impl/network/MixinModList.java b/src/main/java/keystrokesmod/mixins/impl/network/MixinModList.java new file mode 100644 index 0000000..9339d12 --- /dev/null +++ b/src/main/java/keystrokesmod/mixins/impl/network/MixinModList.java @@ -0,0 +1,44 @@ +package keystrokesmod.mixins.impl.network; + +import io.netty.buffer.ByteBuf; +import net.minecraft.client.Minecraft; +import net.minecraftforge.fml.common.network.ByteBufUtils; +import net.minecraftforge.fml.common.network.handshake.FMLHandshakeMessage; +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 java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +@Mixin(FMLHandshakeMessage.ModList.class) +public abstract class MixinModList { + private static final List exemptMods = Arrays.asList("FML", "mcp", "Forge"); + @Shadow(remap = false) + private Map modTags; + + @Inject(method = "toBytes", at = @At(value = "HEAD"), cancellable = true, remap = false) + public void toBytes(ByteBuf buffer, CallbackInfo callbackInfo) { + if (Minecraft.getMinecraft().isSingleplayer()) return; + + callbackInfo.cancel(); + + ArrayList> shownTags = new ArrayList<>(); + for (Map.Entry modTag : this.modTags.entrySet()) { + if (exemptMods.contains(modTag.getKey())) { + shownTags.add(modTag); + } + } + + ByteBufUtils.writeVarInt(buffer, shownTags.size(), 2); + + for (Map.Entry modTag : shownTags) { + ByteBufUtils.writeUTF8String(buffer, modTag.getKey()); + ByteBufUtils.writeUTF8String(buffer, modTag.getValue()); + } + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/mixins/impl/network/MixinNetworkManager.java b/src/main/java/keystrokesmod/mixins/impl/network/MixinNetworkManager.java new file mode 100644 index 0000000..f33b260 --- /dev/null +++ b/src/main/java/keystrokesmod/mixins/impl/network/MixinNetworkManager.java @@ -0,0 +1,46 @@ +package keystrokesmod.mixins.impl.network; + +import io.netty.channel.ChannelHandlerContext; +import keystrokesmod.event.AllPacketsEvent; +import keystrokesmod.event.ReceivePacketEvent; +import keystrokesmod.event.SendPacketEvent; +import keystrokesmod.utility.PacketUtils; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +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; + +@Mixin(NetworkManager.class) +public class MixinNetworkManager { + @Inject(method = "sendPacket(Lnet/minecraft/network/Packet;)V", at = @At("HEAD"), cancellable = true) + public void sendPacket(Packet p_sendPacket_1_, CallbackInfo ci) { + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new AllPacketsEvent(p_sendPacket_1_)); + if (PacketUtils.skipSendEvent.contains(p_sendPacket_1_)) { + PacketUtils.skipSendEvent.remove(p_sendPacket_1_); + return; + } + + SendPacketEvent sendPacketEvent = new SendPacketEvent(p_sendPacket_1_); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(sendPacketEvent); + + if (sendPacketEvent.isCanceled()) { + ci.cancel(); + } + } + + @Inject(method = "channelRead0(Lio/netty/channel/ChannelHandlerContext;Lnet/minecraft/network/Packet;)V", at = @At("HEAD"), cancellable = true) + public void receivePacket(ChannelHandlerContext p_channelRead0_1_, Packet p_channelRead0_2_, CallbackInfo ci) { + if (PacketUtils.skipReceiveEvent.contains(p_channelRead0_2_)) { + PacketUtils.skipReceiveEvent.remove(p_channelRead0_2_); + return; + } + ReceivePacketEvent receivePacketEvent = new ReceivePacketEvent(p_channelRead0_2_); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(receivePacketEvent); + + if (receivePacketEvent.isCanceled()) { + ci.cancel(); + } + } +} diff --git a/src/main/java/keystrokesmod/mixins/impl/render/MixinEntityRenderer.java b/src/main/java/keystrokesmod/mixins/impl/render/MixinEntityRenderer.java new file mode 100644 index 0000000..d587b67 --- /dev/null +++ b/src/main/java/keystrokesmod/mixins/impl/render/MixinEntityRenderer.java @@ -0,0 +1,28 @@ +package keystrokesmod.mixins.impl.render; + +import keystrokesmod.module.ModuleManager; +import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.Vec3; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +@Mixin(EntityRenderer.class) +public class MixinEntityRenderer { + @Redirect(method = "hurtCameraEffect", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;rotate(FFFF)V")) + public void injectNoHurtCam(float angle, float x, float y, float z) { + if (ModuleManager.noHurtCam != null && ModuleManager.noHurtCam.isEnabled()) { + angle = (float) (angle / 14 * ModuleManager.noHurtCam.multiplier.getInput()); + } + GlStateManager.rotate(angle, x, y, z); + } + + @Redirect(method = "orientCamera", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Vec3;distanceTo(Lnet/minecraft/util/Vec3;)D")) + public double injectNoCameraClip(Vec3 raytrace, Vec3 original) { + if (ModuleManager.noCameraClip != null && ModuleManager.noCameraClip.isEnabled()) { + return ModuleManager.extendCamera != null && ModuleManager.extendCamera.isEnabled() ? ModuleManager.extendCamera.distance.getInput() : 4; + } + return raytrace.distanceTo(original); + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/mixins/impl/render/MixinFontRenderer.java b/src/main/java/keystrokesmod/mixins/impl/render/MixinFontRenderer.java new file mode 100644 index 0000000..34369f3 --- /dev/null +++ b/src/main/java/keystrokesmod/mixins/impl/render/MixinFontRenderer.java @@ -0,0 +1,40 @@ +package keystrokesmod.mixins.impl.render; + +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.other.NameHider; +import keystrokesmod.module.impl.render.AntiShuffle; +import net.minecraft.client.gui.FontRenderer; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.ModifyVariable; + +@Mixin(FontRenderer.class) +public class MixinFontRenderer { + @ModifyVariable(method = "renderString", at = @At("HEAD"), require = 1, ordinal = 0, argsOnly = true) + private String renderString(String string) { + if (string == null) + return null; + if ((ModuleManager.nameHider != null) && ModuleManager.nameHider.isEnabled()) { + string = NameHider.getFakeName(string); + } + if ((ModuleManager.antiShuffle != null) && ModuleManager.antiShuffle.isEnabled()) { + string = AntiShuffle.removeObfuscation(string); + } + + return string; + } + + @ModifyVariable(method = "getStringWidth", at = @At("HEAD"), require = 1, ordinal = 0, argsOnly = true) + private String getStringWidth(String string) { + if (string == null) + return null; + if ((ModuleManager.nameHider != null) && ModuleManager.nameHider.isEnabled()) { + string = NameHider.getFakeName(string); + } + if ((ModuleManager.antiShuffle != null) && ModuleManager.antiShuffle.isEnabled()) { + string = AntiShuffle.removeObfuscation(string); + } + + return string; + } +} diff --git a/src/main/java/keystrokesmod/mixins/impl/render/MixinGuiChat.java b/src/main/java/keystrokesmod/mixins/impl/render/MixinGuiChat.java new file mode 100644 index 0000000..aa21741 --- /dev/null +++ b/src/main/java/keystrokesmod/mixins/impl/render/MixinGuiChat.java @@ -0,0 +1,55 @@ +package keystrokesmod.mixins.impl.render; + +import keystrokesmod.Raven; +import keystrokesmod.module.ModuleManager; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.client.gui.GuiTextField; +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 java.util.List; + +@Mixin(GuiChat.class) +public abstract class MixinGuiChat extends MixinGuiScreen +{ + @Shadow + protected GuiTextField inputField; + + @Shadow + private List foundPlayerNames; + @Shadow + private boolean waitingOnAutocomplete; + + @Shadow + public abstract void onAutocompleteResponse(String[] p_onAutocompleteResponse_1_); + + @Inject(method = "keyTyped", at = @At("RETURN")) + private void updateLength(CallbackInfo callbackInfo) { + if (inputField.getText().startsWith((".")) && ModuleManager.canExecuteChatCommand()) { + Raven.commandManager.autoComplete(inputField.getText()); + } + else { + inputField.setMaxStringLength(100); + } + } + + @Inject(method = "sendAutocompleteRequest", at = @At("HEAD"), cancellable = true) + private void handleClientCommandCompletion(String full, final String ignored, CallbackInfo callbackInfo) { + if (Raven.commandManager.autoComplete(full) && ModuleManager.canExecuteChatCommand()) { + waitingOnAutocomplete = true; + + String[] latestAutoComplete = Raven.commandManager.latestAutoComplete; + + if (full.toLowerCase().endsWith(latestAutoComplete[latestAutoComplete.length - 1].toLowerCase())) { + return; + } + + this.onAutocompleteResponse(latestAutoComplete); + + callbackInfo.cancel(); + } + } +} diff --git a/src/main/java/keystrokesmod/mixins/impl/render/MixinGuiScreen.java b/src/main/java/keystrokesmod/mixins/impl/render/MixinGuiScreen.java new file mode 100644 index 0000000..2cb3b55 --- /dev/null +++ b/src/main/java/keystrokesmod/mixins/impl/render/MixinGuiScreen.java @@ -0,0 +1,28 @@ +package keystrokesmod.mixins.impl.render; + +import keystrokesmod.Raven; +import keystrokesmod.module.ModuleManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +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; + +@Mixin(GuiScreen.class) +public abstract class MixinGuiScreen +{ + @Shadow + public Minecraft mc; + + @Inject(method = "sendChatMessage(Ljava/lang/String;Z)V", at = @At("HEAD"), cancellable = true) + private void messageSend(String msg, boolean addToChat, final CallbackInfo callbackInfo) { + if (msg.startsWith(".") && addToChat && ModuleManager.canExecuteChatCommand()) { + this.mc.ingameGUI.getChatGUI().addToSentMessages(msg); + + Raven.commandManager.executeCommand(msg); + callbackInfo.cancel(); + } + } +} diff --git a/src/main/java/keystrokesmod/mixins/impl/render/MixinItemRenderer.java b/src/main/java/keystrokesmod/mixins/impl/render/MixinItemRenderer.java new file mode 100644 index 0000000..6f66dbe --- /dev/null +++ b/src/main/java/keystrokesmod/mixins/impl/render/MixinItemRenderer.java @@ -0,0 +1,75 @@ +package keystrokesmod.mixins.impl.render; + +import keystrokesmod.mixins.interfaces.IMixinItemRenderer; +import keystrokesmod.utility.Utils; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.item.ItemStack; +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; + +@Mixin(ItemRenderer.class) +public class MixinItemRenderer implements IMixinItemRenderer { + private ItemStack originalItemToRender; + @Shadow + private ItemStack itemToRender; + public boolean cancelUpdate = false; + public boolean cancelReset = false; + @Shadow + private float equippedProgress; + @Shadow + private float prevEquippedProgress; + + @Inject(method = "renderItemInFirstPerson", at = @At("HEAD")) + private void modifyRenderItemPre(float p_renderItemInFirstPerson_1_, CallbackInfo info) { + originalItemToRender = itemToRender; + itemToRender = Utils.getSpoofedItem(originalItemToRender); + } + + @Inject(method = "renderItemInFirstPerson", at = @At("RETURN")) + private void modifyRenderItemPost(float p_renderItemInFirstPerson_1_, CallbackInfo info) { + itemToRender = originalItemToRender; + } + + @Inject(method = "updateEquippedItem", at = @At("HEAD"), cancellable = true) + private void onUpdateEquippedItem(CallbackInfo ci) { + if (cancelUpdate) { + cancelUpdate = false; + equippedProgress = 1.0F; + prevEquippedProgress = 1.0f; + ci.cancel(); + } + } + + @Inject(method = "resetEquippedProgress", at = @At("HEAD"), cancellable = true) + public void injectResetEquippedProgress(CallbackInfo ci) { + if (cancelReset) { + cancelReset = false; + equippedProgress = 1.0F; + prevEquippedProgress = 1.0f; + ci.cancel(); + } + } + + @Inject(method = "resetEquippedProgress2", at = @At("HEAD"), cancellable = true) + public void injectResetEquippedProgress2(CallbackInfo ci) { + if (cancelReset) { + cancelReset = false; + equippedProgress = 1.0F; + prevEquippedProgress = 1.0f; + ci.cancel(); + } + } + + @Override + public void setCancelUpdate(boolean cancel) { + this.cancelUpdate = cancel; + } + + @Override + public void setCancelReset(boolean reset) { + this.cancelReset = reset; + } +} diff --git a/src/main/java/keystrokesmod/mixins/impl/render/MixinLayerCape.java b/src/main/java/keystrokesmod/mixins/impl/render/MixinLayerCape.java new file mode 100644 index 0000000..5464017 --- /dev/null +++ b/src/main/java/keystrokesmod/mixins/impl/render/MixinLayerCape.java @@ -0,0 +1,39 @@ +package keystrokesmod.mixins.impl.render; + +import keystrokesmod.module.impl.client.Settings; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.renderer.entity.RenderPlayer; +import net.minecraft.client.renderer.entity.layers.LayerCape; +import net.minecraft.entity.player.EnumPlayerModelParts; +import net.minecraft.util.ResourceLocation; +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.Redirect; + +@Mixin(LayerCape.class) +public class MixinLayerCape { + @Shadow + private final RenderPlayer playerRenderer; + + public MixinLayerCape(RenderPlayer playerRendererIn) { + this.playerRenderer = playerRendererIn; + } + + @Redirect(method = "doRenderLayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/entity/AbstractClientPlayer;isWearing(Lnet/minecraft/entity/player/EnumPlayerModelParts;)Z")) + private boolean modifyIsWearing(AbstractClientPlayer player, EnumPlayerModelParts part) { + if (player.equals(Minecraft.getMinecraft().thePlayer) && Settings.customCapes.getInput() > 0) { + return true; + } + return player.isWearing(part); + } + + @Redirect(method = "doRenderLayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/entity/AbstractClientPlayer;getLocationCape()Lnet/minecraft/util/ResourceLocation;")) + private ResourceLocation modifyGetLocationCape(AbstractClientPlayer player) { + if (player.equals(Minecraft.getMinecraft().thePlayer) && Settings.customCapes.getInput() > 0) { + return Settings.loadedCapes.get((int) (Settings.customCapes.getInput() - 1)); + } + return player.getLocationCape(); + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/mixins/impl/render/MixinModelBiped.java b/src/main/java/keystrokesmod/mixins/impl/render/MixinModelBiped.java new file mode 100644 index 0000000..351d3f3 --- /dev/null +++ b/src/main/java/keystrokesmod/mixins/impl/render/MixinModelBiped.java @@ -0,0 +1,38 @@ +package keystrokesmod.mixins.impl.render; + +import keystrokesmod.utility.RotationUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +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; + +@Mixin(ModelBiped.class) +public class MixinModelBiped { + + @Shadow + public ModelRenderer bipedRightArm; + + @Shadow + public int heldItemRight; + + @Shadow + public ModelRenderer bipedHead; + + @Inject(method = "setRotationAngles", at = @At(value = "FIELD", target = "Lnet/minecraft/client/model/ModelBiped;swingProgress:F")) + private void revertSwordAnimation(float p_setRotationAngles_1_, float p_setRotationAngles_2_, float p_setRotationAngles_3_, float p_setRotationAngles_4_, float p_setRotationAngles_5_, float p_setRotationAngles_6_, Entity p_setRotationAngles_7_, CallbackInfo callbackInfo) { + if (heldItemRight == 3) + this.bipedRightArm.rotateAngleY = 0F; + + if (p_setRotationAngles_7_ instanceof EntityPlayer + && p_setRotationAngles_7_.equals(Minecraft.getMinecraft().thePlayer)) { + this.bipedHead.rotateAngleX = (float) Math.toRadians(RotationUtils.interpolateValue(Utils.getTimer().renderPartialTicks, RotationUtils.prevRenderPitch, RotationUtils.renderPitch)); + } + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/mixins/impl/render/MixinRenderGlobal.java b/src/main/java/keystrokesmod/mixins/impl/render/MixinRenderGlobal.java new file mode 100644 index 0000000..8188482 --- /dev/null +++ b/src/main/java/keystrokesmod/mixins/impl/render/MixinRenderGlobal.java @@ -0,0 +1,84 @@ +package keystrokesmod.mixins.impl.render; + +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.world.AntiBot; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +@Mixin(RenderGlobal.class) +public class MixinRenderGlobal { // credit: pablolnmak + @Shadow + @Final + private Minecraft mc; + + @Unique + private boolean shouldRender() { + return ModuleManager.playerESP != null && ModuleManager.playerESP.isEnabled() && ModuleManager.playerESP.outline.isToggled(); + } + + @Redirect(method = "isRenderEntityOutlines", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/entity/EntityPlayerSP;isSpectator()Z")) + private boolean forceIsSpectator(EntityPlayerSP instance) { + if (shouldRender()) { + return true; + } + else { + return instance.isSpectator(); + } + } + + @Redirect(method = "isRenderEntityOutlines", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/settings/KeyBinding;isKeyDown()Z")) + private boolean forceIsKeyDown(KeyBinding instance) { + if (shouldRender()) { + return true; + } + else { + return instance.isKeyDown(); + } + } + + @Redirect(method = "renderEntities", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;shouldRenderInPass(I)Z", ordinal = 1)) + private boolean forceShouldRenderInPass(Entity instance, int pass, Entity renderViewEntity, ICamera camera, float partialTicks) { + if (pass == 1) { + return true; + } + else { + return instance.shouldRenderInPass(pass); + } + } + + @Redirect(method = "renderEntities", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;isInRangeToRender3d(DDD)Z", ordinal = 1)) + private boolean forceIsInRangeToRender(Entity instance, double x, double y, double z, Entity renderViewEntity, ICamera camera, float partialTicks) { + return instance.isInRangeToRender3d(x, y, z) && isOutlineActive(instance, renderViewEntity, camera); + } + + @Unique + private boolean isOutlineActive(Entity entityIn, Entity viewer, ICamera camera) { + boolean flag = viewer instanceof EntityLivingBase && ((EntityLivingBase) viewer).isPlayerSleeping(); + if (entityIn == viewer && this.mc.gameSettings.thirdPersonView == 0 && !flag) { + return false; + } + else if (shouldRender()) { + return (entityIn != viewer && !AntiBot.isBot(entityIn)) || (entityIn == viewer && ModuleManager.playerESP.renderSelf.isToggled()); + } + else { + if (this.mc.thePlayer.isSpectator() && this.mc.gameSettings.keyBindSpectatorOutlines.isKeyDown() && entityIn instanceof EntityPlayer) { + return entityIn.ignoreFrustumCheck || camera.isBoundingBoxInFrustum(entityIn.getEntityBoundingBox()) || entityIn.isRiding(); + } + else { + return false; + } + } + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/mixins/impl/render/MixinRendererLivingEntity.java b/src/main/java/keystrokesmod/mixins/impl/render/MixinRendererLivingEntity.java new file mode 100644 index 0000000..c4b2ac5 --- /dev/null +++ b/src/main/java/keystrokesmod/mixins/impl/render/MixinRendererLivingEntity.java @@ -0,0 +1,89 @@ +package keystrokesmod.mixins.impl.render; + +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.world.AntiBot; +import keystrokesmod.utility.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RendererLivingEntity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.scoreboard.ScorePlayerTeam; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.ModifyVariable; +import org.spongepowered.asm.mixin.injection.Redirect; + +import java.awt.*; + +@Mixin(RendererLivingEntity.class) +public abstract class MixinRendererLivingEntity extends Render { // credit: pablolnmak + @Shadow + protected boolean renderOutlines; + + protected MixinRendererLivingEntity(RenderManager renderManager) { + super(renderManager); + } + + @Unique + private boolean shouldRender() { + return ModuleManager.playerESP != null && ModuleManager.playerESP.isEnabled() && ModuleManager.playerESP.outline.isToggled(); + } + + @Redirect(method = "doRender(Lnet/minecraft/entity/EntityLivingBase;DDDFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/RendererLivingEntity;setScoreTeamColor(Lnet/minecraft/entity/EntityLivingBase;)Z")) + private boolean setOutlineColor(RendererLivingEntity instance, T entityLivingBaseIn) { + int i = 16777215; + boolean drawOutline = shouldRender() && ((entityLivingBaseIn != Minecraft.getMinecraft().thePlayer && !AntiBot.isBot(entityLivingBaseIn)) || (entityLivingBaseIn == Minecraft.getMinecraft().thePlayer && ModuleManager.playerESP.renderSelf.isToggled())); + + if (!drawOutline || ModuleManager.playerESP.teamColor.isToggled()) + { + if (entityLivingBaseIn instanceof EntityPlayer) + { + ScorePlayerTeam scoreplayerteam = (ScorePlayerTeam)entityLivingBaseIn.getTeam(); + + if (scoreplayerteam != null) + { + String s = FontRenderer.getFormatFromString(scoreplayerteam.getColorPrefix()); + + if (s.length() >= 2) + { + i = this.getFontRendererFromRenderManager().getColorCode(s.charAt(1)); + } + } + } + } + else if (ModuleManager.playerESP.rainbow.isToggled()) { + i = Utils.getChroma(2L, 0L); + } + else { + i = (new Color((int) ModuleManager.playerESP.red.getInput(), (int) ModuleManager.playerESP.green.getInput(), (int) ModuleManager.playerESP.blue.getInput())).getRGB(); + } + + if (drawOutline && ModuleManager.playerESP.redOnDamage.isToggled() && entityLivingBaseIn.hurtTime != 0) { + i = Color.RED.getRGB(); + } + + float f1 = (float)(i >> 16 & 255) / 255.0F; + float f2 = (float)(i >> 8 & 255) / 255.0F; + float f = (float)(i & 255) / 255.0F; + GlStateManager.disableLighting(); + GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); + GlStateManager.color(f1, f2, f, 1.0F); + GlStateManager.disableTexture2D(); + GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GlStateManager.disableTexture2D(); + GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); + return true; + } + + @ModifyVariable(method = "renderModel", at = @At(value = "STORE"), ordinal = 0) + private boolean modifyInvisibleFlag(boolean flag) { + return flag || (this.renderOutlines && shouldRender() && ModuleManager.playerESP.showInvis.isToggled()); + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/mixins/interfaces/IMixinItemRenderer.java b/src/main/java/keystrokesmod/mixins/interfaces/IMixinItemRenderer.java new file mode 100644 index 0000000..6315bed --- /dev/null +++ b/src/main/java/keystrokesmod/mixins/interfaces/IMixinItemRenderer.java @@ -0,0 +1,6 @@ +package keystrokesmod.mixins.interfaces; + +public interface IMixinItemRenderer { + void setCancelUpdate(boolean cancel); + void setCancelReset(boolean reset); +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/Module.java b/src/main/java/keystrokesmod/module/Module.java new file mode 100644 index 0000000..e962a0c --- /dev/null +++ b/src/main/java/keystrokesmod/module/Module.java @@ -0,0 +1,226 @@ +package keystrokesmod.module; + +import keystrokesmod.Raven; +import keystrokesmod.module.setting.Setting; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.script.Script; +import keystrokesmod.utility.Utils; +import keystrokesmod.utility.profile.ProfileModule; +import net.minecraft.client.Minecraft; +import net.minecraftforge.fml.common.FMLCommonHandler; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; + +import java.util.ArrayList; +import java.util.Iterator; + +public class Module { + public boolean alwaysOn; + protected ArrayList settings; + private String moduleName; + private Module.category moduleCategory; + private boolean enabled; + private int keycode; + protected static Minecraft mc; + private boolean isToggled = false; + public boolean canBeEnabled = true; + public boolean ignoreOnSave = false; + public boolean hidden = false; + public Script script = null; + public boolean closetModule = false; + + public Module(String moduleName, Module.category moduleCategory, int keycode) { + this.moduleName = moduleName; + this.moduleCategory = moduleCategory; + this.keycode = keycode; + this.enabled = false; + mc = Minecraft.getMinecraft(); + this.settings = new ArrayList(); + } + + public static Module getModule(Class a) { + Iterator var1 = ModuleManager.modules.iterator(); + + Module module; + do { + if (!var1.hasNext()) { + return null; + } + + module = (Module) var1.next(); + } while (module.getClass() != a); + + return module; + } + + public Module(String name, Module.category moduleCategory) { + this.moduleName = name; + this.moduleCategory = moduleCategory; + this.keycode = 0; + this.enabled = false; + mc = Minecraft.getMinecraft(); + this.settings = new ArrayList(); + } + + public Module(Script script) { + super(); + this.enabled = false; + this.moduleName = script.name; + this.script = script; + this.keycode = 0; + this.moduleCategory = category.scripts; + this.settings = new ArrayList<>(); + } + + public void keybind() { + if (this.keycode != 0) { + try { + if (!this.isToggled && (this.keycode >= 1000 ? Mouse.isButtonDown(this.keycode - 1000) : Keyboard.isKeyDown(this.keycode))) { + this.toggle(); + this.isToggled = true; + } + else if ((this.keycode >= 1000 ? !Mouse.isButtonDown(this.keycode - 1000) : !Keyboard.isKeyDown(this.keycode))) { + this.isToggled = false; + } + } + catch (Exception e) { + e.printStackTrace(); + Utils.sendMessage("&cFailed to check keybinding. Setting to none"); + this.keycode = 0; + } + } + } + + public boolean canBeEnabled() { + if (this.script != null && script.error) { + return false; + } + return this.canBeEnabled; + } + + public boolean isHidden() { + return hidden; + } + + public void setHidden(boolean hidden) { + this.hidden = hidden; + } + + public void enable() { + if (!this.canBeEnabled() || this.isEnabled()) { + return; + } + this.setEnabled(true); + ModuleManager.organizedModules.add(this); + if (ModuleManager.hud.isEnabled()) { + ModuleManager.sort(); + } + + if (this.script != null) { + Raven.scriptManager.onEnable(script); + } + else { + if (!alwaysOn) { + FMLCommonHandler.instance().bus().register(this); + } + this.onEnable(); + } + } + + public void disable() { + if (!this.isEnabled()) { + return; + } + this.setEnabled(false); + ModuleManager.organizedModules.remove(this); + if (this.script != null) { + Raven.scriptManager.onDisable(script); + } + else { + if (!alwaysOn) { + FMLCommonHandler.instance().bus().unregister(this); + } + this.onDisable(); + } + } + + public String getInfo() { + return ""; + } + + public int getInfoType() { + return 0; + } + + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + + public String getName() { + return this.moduleName; + } + + public ArrayList getSettings() { + return this.settings; + } + + public void registerSetting(Setting Setting) { + this.settings.add(Setting); + } + + public Module.category moduleCategory() { + return this.moduleCategory; + } + + public boolean isEnabled() { + return this.enabled; + } + + public void onEnable() { + } + + public void onDisable() { + } + + public void toggle() { + if (this.isEnabled()) { + this.disable(); + } else { + this.enable(); + } + if (Raven.currentProfile != null) { + ((ProfileModule) Raven.currentProfile.getModule()).saved = false; + } + } + + public void onUpdate() {} + + public void guiUpdate() {} + + public void guiButtonToggled(ButtonSetting b) {} + + public void onSlide(SliderSetting setting) {} + + public int getKeycode() { + return this.keycode; + } + + public void setBind(int keybind) { + this.keycode = keybind; + } + + public static enum category { + combat, + movement, + player, + world, + render, + minigames, + fun, + other, + client, + profiles, + scripts; + } +} diff --git a/src/main/java/keystrokesmod/module/ModuleManager.java b/src/main/java/keystrokesmod/module/ModuleManager.java new file mode 100644 index 0000000..497a5ff --- /dev/null +++ b/src/main/java/keystrokesmod/module/ModuleManager.java @@ -0,0 +1,230 @@ +package keystrokesmod.module; + +import keystrokesmod.module.impl.client.ChatCommands; +import keystrokesmod.module.impl.client.CommandLine; +import keystrokesmod.module.impl.client.Gui; +import keystrokesmod.module.impl.client.Settings; +import keystrokesmod.module.impl.combat.*; +import keystrokesmod.module.impl.fun.Fun; +import keystrokesmod.module.impl.minigames.*; +import keystrokesmod.module.impl.movement.*; +import keystrokesmod.module.impl.other.*; +import keystrokesmod.module.impl.player.*; +import keystrokesmod.module.impl.render.*; +import keystrokesmod.module.impl.world.*; +import keystrokesmod.utility.Utils; +import keystrokesmod.utility.ModuleUtils; +import keystrokesmod.utility.profile.Manager; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +public class ModuleManager { + public static List modules = new ArrayList<>(); + public static List organizedModules = new ArrayList<>(); + public static Module nameHider; + public static Module fastPlace; + public static MurderMystery murderMystery; + public static InvMove invmove; + public static SkyWars skyWars; + public static AntiFireball antiFireball; + public static AutoSwap autoSwap; + public static BedAura bedAura; + public static FastMine fastMine; + public static Module antiShuffle; + public static Module commandLine; + public static Module antiBot; + public static NoSlow noSlow; + public static KillAura killAura; + public static Module autoClicker; + public static Module hitBox; + public static Module reach; + public static BedESP bedESP; + public static Chams chams; + public static HUD hud; + public static Module timer; + public static Module fly; + public static Module wTap; + public static Potions potions; + public static TargetHUD targetHUD; + public static NoFall noFall; + public static Disabler disabler; + public static NoRotate noRotate; + public static PlayerESP playerESP; + public static Module reduce; + public static Safewalk safeWalk; + public static Module keepSprint; + public static ExtendCamera extendCamera; + public static InvManager invManager; + public static Tower tower; + public static NoCameraClip noCameraClip; + public static Module bedwars; + public static Bhop bhop; + public static NoHurtCam noHurtCam; + public static Scaffold scaffold; + public static AutoTool autoTool; + public static Sprint sprint; + public static Weather weather; + public static ChatCommands chatCommands; + public static LongJump LongJump; + public static Blink blink; + public static Velocity velocity; + + public void register() { + this.addModule(autoClicker = new AutoClicker()); + this.addModule(LongJump = new LongJump()); + this.addModule(new AimAssist()); + this.addModule(new BurstClicker()); + this.addModule(weather = new Weather()); + this.addModule(chatCommands = new ChatCommands()); + this.addModule(new ClickAssist()); + this.addModule(tower = new Tower()); + this.addModule(skyWars = new SkyWars()); + this.addModule(new DebugAC()); + this.addModule(new DelayRemover()); + this.addModule(hitBox = new HitBox()); + this.addModule(new Radar()); + this.addModule(new Settings()); + this.addModule(reach = new Reach()); + this.addModule(extendCamera = new ExtendCamera()); + this.addModule(new RodAimbot()); + this.addModule(velocity = new Velocity()); + this.addModule(bhop = new Bhop()); + this.addModule(invManager = new InvManager()); + this.addModule(new ChatBypass()); + this.addModule(scaffold = new Scaffold()); + this.addModule(blink = new Blink()); + this.addModule(new AutoRequeue()); + this.addModule(new AntiAFK()); + this.addModule(new Boost()); + this.addModule(autoTool = new AutoTool()); + this.addModule(noHurtCam = new NoHurtCam()); + this.addModule(new SpeedBuilders()); + this.addModule(new Teleport()); + this.addModule(fly = new Fly()); + this.addModule(invmove = new InvMove()); + this.addModule(new TPAura()); + this.addModule(new Trajectories()); + this.addModule(potions = new Potions()); + this.addModule(autoSwap = new AutoSwap()); + this.addModule(keepSprint = new KeepSprint()); + this.addModule(bedAura = new BedAura()); + this.addModule(noSlow = new NoSlow()); + this.addModule(new Indicators()); + this.addModule(new Speed()); + this.addModule(new LatencyAlerts()); + this.addModule(noCameraClip = new NoCameraClip()); + this.addModule(sprint = new Sprint()); + this.addModule(new StopMotion()); + this.addModule(timer = new Timer()); + this.addModule(new VClip()); + this.addModule(new AutoJump()); + this.addModule(new AutoPlace()); + this.addModule(fastPlace = new FastPlace()); + this.addModule(new Freecam()); + this.addModule(noFall = new NoFall()); + this.addModule(disabler = new Disabler()); + this.addModule(safeWalk = new Safewalk()); + this.addModule(reduce = new Reduce()); + this.addModule(antiBot = new AntiBot()); + this.addModule(antiShuffle = new AntiShuffle()); + this.addModule(chams = new Chams()); + this.addModule(new ChestESP()); + this.addModule(new Nametags()); + this.addModule(playerESP = new PlayerESP()); + this.addModule(new Tracers()); + this.addModule(hud = new HUD()); + this.addModule(new Anticheat()); + this.addModule(new BreakProgress()); + this.addModule(wTap = new WTap()); + this.addModule(new Xray()); + this.addModule(new BridgeInfo()); + this.addModule(targetHUD = new TargetHUD()); + this.addModule(new DuelsStats()); + this.addModule(antiFireball = new AntiFireball()); + this.addModule(bedESP = new BedESP()); + this.addModule(murderMystery = new MurderMystery()); + this.addModule(new keystrokesmod.script.Manager()); + this.addModule(new SumoFences()); + this.addModule(new Fun.ExtraBobbing()); + this.addModule(killAura = new KillAura()); + this.addModule(new Fun.FlameTrail()); + this.addModule(new Fun.SlyPort()); + this.addModule(new ItemESP()); + this.addModule(new MobESP()); + this.addModule(new Fun.Spin()); + this.addModule(noRotate = new NoRotate()); + this.addModule(new FakeChat()); + this.addModule(nameHider = new NameHider()); + this.addModule(new FakeLag()); + this.addModule(new Test()); + this.addModule(new WaterBucket()); + this.addModule(commandLine = new CommandLine()); + this.addModule(bedwars = new BedWars()); + this.addModule(fastMine = new FastMine()); + this.addModule(new JumpReset()); + this.addModule(new Manager()); + this.addModule(new ViewPackets()); + this.addModule(new AutoWho()); + this.addModule(new Gui()); + this.addModule(new Shaders()); + antiBot.enable(); + Collections.sort(this.modules, Comparator.comparing(Module::getName)); + } + + public void addModule(Module m) { + modules.add(m); + } + + public List getModules() { + return modules; + } + + public List inCategory(Module.category categ) { + ArrayList categML = new ArrayList<>(); + + for (Module mod : this.getModules()) { + if (mod.moduleCategory().equals(categ)) { + categML.add(mod); + } + } + + return categML; + } + + public Module getModule(String moduleName) { + for (Module module : modules) { + if (module.getName().equals(moduleName)) { + return module; + } + } + return null; + } + + public Module getModule(Class clazz) { + for (Module module : modules) { + if (module.getClass().equals(clazz)) { + return module; + } + } + return null; + } + + public static void sort() { + if (HUD.alphabeticalSort.isToggled()) { + Collections.sort(organizedModules, Comparator.comparing(Module::getName)); + } else { + organizedModules.sort((o1, o2) -> Utils.mc.fontRendererObj.getStringWidth(o2.getName() + ((HUD.showInfo.isToggled() && !o2.getInfo().isEmpty()) ? " " + o2.getInfo() : "")) - Utils.mc.fontRendererObj.getStringWidth(o1.getName() + (HUD.showInfo.isToggled() && !o1.getInfo().isEmpty() ? " " + o1.getInfo() : ""))); + } + } + + public static boolean canExecuteChatCommand() { + return ModuleManager.chatCommands != null && ModuleManager.chatCommands.isEnabled(); + } + + public static boolean lowercaseChatCommands() { + return ModuleManager.chatCommands != null && ModuleManager.chatCommands.isEnabled() && ModuleManager.chatCommands.lowercase(); + } +} diff --git a/src/main/java/keystrokesmod/module/impl/client/ChatCommands.java b/src/main/java/keystrokesmod/module/impl/client/ChatCommands.java new file mode 100644 index 0000000..7591a0a --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/client/ChatCommands.java @@ -0,0 +1,18 @@ +package keystrokesmod.module.impl.client; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; + +public class ChatCommands extends Module { + public ButtonSetting lowercase; + public ChatCommands() { + super("Chat Commands", category.client); + this.registerSetting(new DescriptionSetting("Use §o§e.help§r for help.")); + this.registerSetting(lowercase = new ButtonSetting("Lowercase", false)); + } + + public boolean lowercase() { + return this.lowercase != null && this.lowercase.isToggled(); + } +} diff --git a/src/main/java/keystrokesmod/module/impl/client/CommandLine.java b/src/main/java/keystrokesmod/module/impl/client/CommandLine.java new file mode 100644 index 0000000..be257e7 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/client/CommandLine.java @@ -0,0 +1,34 @@ +package keystrokesmod.module.impl.client; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.utility.Commands; +import keystrokesmod.utility.Timer; + +public class CommandLine extends Module { + public static boolean a = false; + public static boolean b = false; + public static Timer an; + public static ButtonSetting animate; + + public CommandLine() { + super("Command line", Module.category.client, 0); + this.registerSetting(animate = new ButtonSetting("Animate", true)); + } + + public void onEnable() { + Commands.setccs(); + a = true; + b = false; + (an = new Timer(500.0F)).start(); + } + + public void onDisable() { + b = true; + if (an != null) { + an.start(); + } + + Commands.od(); + } +} diff --git a/src/main/java/keystrokesmod/module/impl/client/Gui.java b/src/main/java/keystrokesmod/module/impl/client/Gui.java new file mode 100644 index 0000000..bc1e290 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/client/Gui.java @@ -0,0 +1,37 @@ +package keystrokesmod.module.impl.client; + +import keystrokesmod.Raven; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Utils; + +public class Gui extends Module { + public static SliderSetting guiScale; + public static SliderSetting backgroundBlur; + public static SliderSetting scrollSpeed; + public static ButtonSetting removePlayerModel; + public static ButtonSetting darkBackground; + public static ButtonSetting removeWatermark; + public static ButtonSetting rainBowOutlines; + + public Gui() { + super("Gui", category.client, 54); + this.registerSetting(guiScale = new SliderSetting("Gui scale", 2, new String[]{ "Small", "Normal", "Large" })); + this.registerSetting(backgroundBlur = new SliderSetting("Background blur", "%", 0, 0, 100, 1)); + this.registerSetting(scrollSpeed = new SliderSetting("Scroll speed", 50, 2, 90, 1)); + this.registerSetting(darkBackground = new ButtonSetting("Dark background", true)); + this.registerSetting(rainBowOutlines = new ButtonSetting("Rainbow outlines", true)); + this.registerSetting(removePlayerModel = new ButtonSetting("Remove player model", false)); + this.registerSetting(removeWatermark = new ButtonSetting("Remove watermark", false)); + } + + public void onEnable() { + if (Utils.nullCheck() && mc.currentScreen != Raven.clickGui) { + mc.displayGuiScreen(Raven.clickGui); + Raven.clickGui.initMain(); + } + + this.disable(); + } +} diff --git a/src/main/java/keystrokesmod/module/impl/client/Settings.java b/src/main/java/keystrokesmod/module/impl/client/Settings.java new file mode 100644 index 0000000..d2605a4 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/client/Settings.java @@ -0,0 +1,88 @@ +package keystrokesmod.module.impl.client; + +import keystrokesmod.Raven; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.util.ResourceLocation; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + +public class Settings extends Module { + public static SliderSetting customCapes; + public static ButtonSetting weaponAxe; + public static ButtonSetting weaponRod; + public static ButtonSetting weaponStick; + public static ButtonSetting middleClickFriends; + public static ButtonSetting setChatAsInventory; + public static ButtonSetting rotateBody; + public static ButtonSetting fullBody; + public static ButtonSetting movementFix; + public static SliderSetting randomYawFactor; + public static SliderSetting offset; + public static SliderSetting timeMultiplier; + public static ButtonSetting sendMessage; + private String[] capes = new String[]{"None", "Anime", "Aqua", "Green", "Purple", "Red", "White", "Yellow"}; + public static List loadedCapes = new ArrayList<>(); + + public Settings() { + super("Settings", category.client, 0); + this.registerSetting(new DescriptionSetting("General")); + this.registerSetting(customCapes = new SliderSetting("Custom cape", 0, capes)); + this.registerSetting(weaponAxe = new ButtonSetting("Set axe as weapon", false)); + this.registerSetting(weaponRod = new ButtonSetting("Set rod as weapon", false)); + this.registerSetting(weaponStick = new ButtonSetting("Set stick as weapon", false)); + this.registerSetting(middleClickFriends = new ButtonSetting("Middle click friends", false)); + this.registerSetting(setChatAsInventory = new ButtonSetting("Set chat as inventory", false)); + this.registerSetting(new DescriptionSetting("Rotations")); + this.registerSetting(rotateBody = new ButtonSetting("Rotate body", true)); + this.registerSetting(fullBody = new ButtonSetting("Full body", false)); + this.registerSetting(movementFix = new ButtonSetting("Movement fix", false)); + this.registerSetting(randomYawFactor = new SliderSetting("Random yaw factor", 1.0, 0.0, 10.0, 1.0)); + this.registerSetting(new DescriptionSetting("Profiles")); + this.registerSetting(sendMessage = new ButtonSetting("Send message on enable", true)); + this.registerSetting(new DescriptionSetting("Theme colors")); + this.registerSetting(offset = new SliderSetting("Offset", 0.5, -3.0, 3.0, 0.1)); + this.registerSetting(timeMultiplier = new SliderSetting("Time multiplier", 0.5, 0.1, 4.0, 0.1)); + this.canBeEnabled = false; + loadCapes(); + } + + public void loadCapes() { + try { + for (int i = 1; i < capes.length; i++) { + String name = capes[i].toLowerCase(); + if (i > 1) { + name = "rvn_" + name; + } + InputStream stream = Raven.class.getResourceAsStream("/assets/keystrokesmod/textures/capes/" + name + ".png"); + if (stream == null) { + continue; + } + BufferedImage bufferedImage = ImageIO.read(stream); + loadedCapes.add(mc.renderEngine.getDynamicTextureLocation(name, new DynamicTexture(bufferedImage))); + } + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public static boolean inInventory() { + if (mc.currentScreen instanceof GuiInventory) { + return true; + } + if (mc.currentScreen instanceof GuiChat && setChatAsInventory.isToggled()) { + return true; + } + return false; + } +} diff --git a/src/main/java/keystrokesmod/module/impl/combat/AimAssist.java b/src/main/java/keystrokesmod/module/impl/combat/AimAssist.java new file mode 100644 index 0000000..6793400 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/combat/AimAssist.java @@ -0,0 +1,85 @@ +package keystrokesmod.module.impl.combat; + +import keystrokesmod.Raven; +import keystrokesmod.module.Module; +import keystrokesmod.module.impl.world.AntiBot; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Utils; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +public class AimAssist extends Module { + private SliderSetting speed; + private SliderSetting fov; + private SliderSetting distance; + private ButtonSetting clickAim; + private ButtonSetting weaponOnly; + private ButtonSetting aimInvis; + private ButtonSetting blatantMode; + private ButtonSetting ignoreTeammates; + + public AimAssist() { + super("AimAssist", category.combat, 0); + this.registerSetting(speed = new SliderSetting("Speed", 45.0D, 1.0D, 100.0D, 1.0D)); + this.registerSetting(fov = new SliderSetting("FOV", 90.0D, 15.0D, 180.0D, 1.0D)); + this.registerSetting(distance = new SliderSetting("Distance", 4.5D, 1.0D, 10.0D, 0.5D)); + this.registerSetting(clickAim = new ButtonSetting("Click aim", true)); + this.registerSetting(weaponOnly = new ButtonSetting("Weapon only", false)); + this.registerSetting(aimInvis = new ButtonSetting("Aim invis", false)); + this.registerSetting(blatantMode = new ButtonSetting("Blatant mode", false)); + this.registerSetting(ignoreTeammates = new ButtonSetting("Ignore teammates", false)); + } + + public void onUpdate() { + if (mc.currentScreen == null && mc.inGameHasFocus) { + if (!weaponOnly.isToggled() || Utils.holdingWeapon()) { + if (!clickAim.isToggled() || Utils.isClicking()) { + Entity en = this.getEnemy(); + if (en != null) { + if (Raven.debug) { + Utils.sendMessage(this.getName() + " &e" + en.getName()); + } + if (blatantMode.isToggled()) { + Utils.aim(en, 0.0F, false); + } else { + double n = Utils.n(en); + if (n > 1.0D || n < -1.0D) { + float val = (float) (-(n / (101.0D - (speed.getInput())))); + mc.thePlayer.rotationYaw += val; + } + } + } + + } + } + } + } + + private Entity getEnemy() { + final int n = (int)fov.getInput(); + for (final EntityPlayer entityPlayer : mc.theWorld.playerEntities) { + if (entityPlayer != mc.thePlayer && entityPlayer.deathTime == 0) { + if (Utils.isFriended(entityPlayer)) { + continue; + } + if (ignoreTeammates.isToggled() && Utils.isTeamMate(entityPlayer)) { + continue; + } + if (!aimInvis.isToggled() && entityPlayer.isInvisible()) { + continue; + } + if (mc.thePlayer.getDistanceToEntity(entityPlayer) > distance.getInput()) { + continue; + } + if (AntiBot.isBot(entityPlayer)) { + continue; + } + if (!blatantMode.isToggled() && n != 360 && !Utils.inFov((float)n, entityPlayer)) { + continue; + } + return entityPlayer; + } + } + return null; + } +} diff --git a/src/main/java/keystrokesmod/module/impl/combat/AutoClicker.java b/src/main/java/keystrokesmod/module/impl/combat/AutoClicker.java new file mode 100644 index 0000000..4c9e67d --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/combat/AutoClicker.java @@ -0,0 +1,260 @@ +package keystrokesmod.module.impl.combat; + +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Reflection; +import keystrokesmod.utility.Utils; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemBlock; +import net.minecraft.util.BlockPos; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; +import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Random; + +public class AutoClicker extends Module { + public SliderSetting minCPS; + public SliderSetting maxCPS; + public SliderSetting jitter; + public SliderSetting blockHitChance; + public static ButtonSetting leftClick; + public ButtonSetting rightClick; + public ButtonSetting breakBlocks; + public ButtonSetting inventoryFill; + public ButtonSetting weaponOnly; + public ButtonSetting blocksOnly; + public ButtonSetting disableCreative; + private Random rand = null; + private Method gs; + private long i; + private long j; + private long k; + private long l; + private double m; + private boolean n; + private boolean hol; + private boolean blocked; + + public AutoClicker() { + super("AutoClicker", Module.category.combat, 0); + this.registerSetting(new DescriptionSetting("Best with delay remover.")); + this.registerSetting(minCPS = new SliderSetting("Min CPS", 9.0, 1.0, 20.0, 0.5)); + this.registerSetting(maxCPS = new SliderSetting("Max CPS", 12.0, 1.0, 20.0, 0.5)); + this.registerSetting(jitter = new SliderSetting("Jitter", 0.0, 0.0, 3.0, 0.1)); + this.registerSetting(blockHitChance = new SliderSetting("Block hit chance", "%", 0.0, 0.0, 100.0, 1.0)); + this.registerSetting(leftClick = new ButtonSetting("Left click", true)); + this.registerSetting(rightClick = new ButtonSetting("Right click", false)); + this.registerSetting(breakBlocks = new ButtonSetting("Break blocks", false)); + this.registerSetting(inventoryFill = new ButtonSetting("Inventory fill", false)); + this.registerSetting(weaponOnly = new ButtonSetting("Weapon only", false)); + this.registerSetting(blocksOnly = new ButtonSetting("Blocks only", true)); + this.registerSetting(disableCreative = new ButtonSetting("Disable in creative", false)); + this.closetModule = true; + + try { + this.gs = GuiScreen.class.getDeclaredMethod("func_73864_a", Integer.TYPE, Integer.TYPE, Integer.TYPE); + } catch (Exception var4) { + try { + this.gs = GuiScreen.class.getDeclaredMethod("mouseClicked", Integer.TYPE, Integer.TYPE, Integer.TYPE); + } catch (Exception var3) { + } + } + + if (this.gs != null) { + this.gs.setAccessible(true); + } + + } + + public void onEnable() { + if (this.gs == null) { + this.disable(); + } + this.blocked = Mouse.isButtonDown(1); + this.rand = new Random(); + } + + public void onDisable() { + this.i = 0L; + this.j = 0L; + this.hol = false; + this.blocked = false; + } + + public void guiUpdate() { + Utils.correctValue(minCPS, maxCPS); + } + + @SubscribeEvent + public void onRenderTick(RenderTickEvent ev) { + if (ev.phase != Phase.END && Utils.nullCheck() && !mc.thePlayer.isEating()) { + if (disableCreative.isToggled() && mc.thePlayer.capabilities.isCreativeMode) { + return; + } + if (ModuleManager.scaffold.isEnabled) { + return; + } + if (mc.currentScreen == null && mc.inGameHasFocus) { + if (weaponOnly.isToggled() && !Utils.holdingWeapon()) { + return; + } + + if (leftClick.isToggled() && Mouse.isButtonDown(0)) { + this.dc(mc.gameSettings.keyBindAttack.getKeyCode(), 0); + } + else if (rightClick.isToggled() && Mouse.isButtonDown(1)) { + if (blocksOnly.isToggled() && (mc.thePlayer.getCurrentEquippedItem() == null || !(mc.thePlayer.getCurrentEquippedItem().getItem() instanceof ItemBlock))) { + return; + } + this.dc(mc.gameSettings.keyBindUseItem.getKeyCode(), 1); + } + else { + this.i = 0L; + this.j = 0L; + } + } + else if (inventoryFill.isToggled() && mc.currentScreen instanceof GuiInventory) { + if (!Mouse.isButtonDown(0) || !Keyboard.isKeyDown(54) && !Keyboard.isKeyDown(42)) { + this.i = 0L; + this.j = 0L; + } else if (this.i != 0L && this.j != 0L) { + if (System.currentTimeMillis() > this.j) { + this.gd(); + this.inventoryClick(mc.currentScreen); + } + } else { + this.gd(); + } + } + + } + } + + public void dc(int key, int mouse) { + if (breakBlocks.isToggled() && mouse == 0 && mc.objectMouseOver != null) { + BlockPos p = mc.objectMouseOver.getBlockPos(); + if (p != null) { + Block bl = mc.theWorld.getBlockState(p).getBlock(); + if (bl != Blocks.air && !(bl instanceof BlockLiquid)) { + if (!this.hol && (!ModuleManager.killAura.isEnabled() || KillAura.target == null)) { + KeyBinding.setKeyBindState(key, true); + KeyBinding.onTick(key); + this.hol = true; + } + + return; + } + + if (this.hol) { + KeyBinding.setKeyBindState(key, false); + this.hol = false; + } + } + } + + if (jitter.getInput() > 0.0D) { + double a = jitter.getInput() * 0.45D; + EntityPlayerSP var10000; + if (this.rand.nextBoolean()) { + var10000 = mc.thePlayer; + var10000.rotationYaw = (float) ((double) var10000.rotationYaw + (double) this.rand.nextFloat() * a); + } else { + var10000 = mc.thePlayer; + var10000.rotationYaw = (float) ((double) var10000.rotationYaw - (double) this.rand.nextFloat() * a); + } + + if (this.rand.nextBoolean()) { + var10000 = mc.thePlayer; + var10000.rotationPitch = (float) ((double) var10000.rotationPitch + (double) this.rand.nextFloat() * a * 0.45D); + } else { + var10000 = mc.thePlayer; + var10000.rotationPitch = (float) ((double) var10000.rotationPitch - (double) this.rand.nextFloat() * a * 0.45D); + } + } + + if (this.j > 0L && this.i > 0L) { + double blockHitC = blockHitChance.getInput(); + if (System.currentTimeMillis() > this.j && (!ModuleManager.killAura.isEnabled() || KillAura.target == null)) { + KeyBinding.setKeyBindState(key, true); + KeyBinding.onTick(key); + Reflection.setButton(mouse, true); + if (mouse == 0 && blockHitC > 0.0 && Mouse.isButtonDown(1) && Math.random() >= (100.0 - blockHitC) / 100.0) { + final int getKeyCode = mc.gameSettings.keyBindUseItem.getKeyCode(); + KeyBinding.setKeyBindState(getKeyCode, true); + KeyBinding.onTick(getKeyCode); + Reflection.setButton(1, true); + blocked = true; + } + this.gd(); + } + else if (System.currentTimeMillis() > this.i || blocked) { + KeyBinding.setKeyBindState(key, false); + Reflection.setButton(mouse, false); + if (mouse == 0 && blockHitC > 0.0) { + KeyBinding.setKeyBindState(mc.gameSettings.keyBindUseItem.getKeyCode(), false); + Reflection.setButton(1, false); + blocked = false; + } + } + } + else { + this.gd(); + } + + } + + public void gd() { + double c = Utils.getRandomValue(minCPS, maxCPS, this.rand) + 0.4D * this.rand.nextDouble(); + long d = (long) ((int) Math.round(1000.0D / c)); + if (System.currentTimeMillis() > this.k) { + if (!this.n && this.rand.nextInt(100) >= 85) { + this.n = true; + this.m = 1.1D + this.rand.nextDouble() * 0.15D; + } else { + this.n = false; + } + + this.k = System.currentTimeMillis() + 500L + (long) this.rand.nextInt(1500); + } + + if (this.n) { + d = (long) ((double) d * this.m); + } + + if (System.currentTimeMillis() > this.l) { + if (this.rand.nextInt(100) >= 80) { + d += 50L + (long) this.rand.nextInt(100); + } + + this.l = System.currentTimeMillis() + 500L + (long) this.rand.nextInt(1500); + } + + this.j = System.currentTimeMillis() + d; + this.i = System.currentTimeMillis() + d / 2L - (long) this.rand.nextInt(10); + } + + private void inventoryClick(GuiScreen s) { + int x = Mouse.getX() * s.width / mc.displayWidth; + int y = s.height - Mouse.getY() * s.height / mc.displayHeight - 1; + + try { + this.gs.invoke(s, x, y, 0); + } catch (IllegalAccessException | InvocationTargetException var5) { + } + + } +} diff --git a/src/main/java/keystrokesmod/module/impl/combat/BurstClicker.java b/src/main/java/keystrokesmod/module/impl/combat/BurstClicker.java new file mode 100644 index 0000000..841bd76 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/combat/BurstClicker.java @@ -0,0 +1,101 @@ +package keystrokesmod.module.impl.combat; + +import keystrokesmod.Raven; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Reflection; +import keystrokesmod.utility.Utils; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.item.ItemBlock; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; + +public class BurstClicker extends Module { + private SliderSetting clicks; + private SliderSetting delay; + private ButtonSetting delayRandomizer; + private ButtonSetting placeWhenBlock; + private boolean l_c = false; + private boolean l_r = false; + + public BurstClicker() { + super("BurstClicker", category.combat, 0); + this.registerSetting(new DescriptionSetting("Artificial dragclicking.")); + this.registerSetting(clicks = new SliderSetting("Clicks", 0.0D, 0.0D, 50.0D, 1.0D)); + this.registerSetting(delay = new SliderSetting("Delay (ms)", 5.0D, 1.0D, 40.0D, 1.0D)); + this.registerSetting(delayRandomizer = new ButtonSetting("Delay randomizer", true)); + this.registerSetting(placeWhenBlock = new ButtonSetting("Place when block", false)); + } + + public void onEnable() { + if (clicks.getInput() != 0.0D && mc.currentScreen == null && mc.inGameHasFocus) { + Raven.getExecutor().execute(() -> { + try { + int cl = (int) clicks.getInput(); + int del = (int) delay.getInput(); + + for (int i = 0; i < cl * 2 && this.isEnabled() && Utils.nullCheck() && mc.currentScreen == null && mc.inGameHasFocus; ++i) { + if (i % 2 == 0) { + this.l_c = true; + if (del != 0) { + int realDel = del; + if (delayRandomizer.isToggled()) { + realDel = del + Utils.getRandom().nextInt(25) * (Utils.getRandom().nextBoolean() ? -1 : 1); + if (realDel <= 0) { + realDel = del / 3 - realDel; + } + } + + Thread.sleep(realDel); + } + } else { + this.l_r = true; + } + } + + this.disable(); + } catch (InterruptedException var5) { + } + + }); + } else { + this.disable(); + } + } + + public void onDisable() { + this.l_c = false; + this.l_r = false; + } + + @SubscribeEvent + public void r(RenderTickEvent ev) { + if (Utils.nullCheck()) { + if (this.l_c) { + this.c(true); + this.l_c = false; + } else if (this.l_r) { + this.c(false); + this.l_r = false; + } + } + + } + + private void c(boolean st) { + boolean r = placeWhenBlock.isToggled() && mc.thePlayer.getHeldItem() != null && mc.thePlayer.getHeldItem().getItem() instanceof ItemBlock; + if (r) { + Reflection.rightClick(); + } else { + int key = mc.gameSettings.keyBindAttack.getKeyCode(); + KeyBinding.setKeyBindState(key, st); + if (st) { + KeyBinding.onTick(key); + } + } + + Reflection.setButton(r ? 1 : 0, st); + } +} diff --git a/src/main/java/keystrokesmod/module/impl/combat/ClickAssist.java b/src/main/java/keystrokesmod/module/impl/combat/ClickAssist.java new file mode 100644 index 0000000..cd738c1 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/combat/ClickAssist.java @@ -0,0 +1,143 @@ +package keystrokesmod.module.impl.combat; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.CPSCalculator; +import keystrokesmod.utility.Utils; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraftforge.client.event.MouseEvent; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.input.Mouse; + +import java.awt.*; + +public class ClickAssist extends Module { + private SliderSetting chanceLeft, chanceRight; + private ButtonSetting rightClick, blocksOnly, weaponOnly, onlyWhileTargeting, aboveCPS, leftClick, disableInCreative; + private Robot bot; + private boolean ignNL = false; + private boolean ignNR = false; + + public ClickAssist() { + super("ClickAssist", Module.category.combat, 0); + this.registerSetting(new DescriptionSetting("Boost your CPS.")); + this.registerSetting(disableInCreative = new ButtonSetting("Disable in creative", true)); + this.registerSetting(leftClick = new ButtonSetting("Left click", true)); + this.registerSetting(chanceLeft = new SliderSetting("Chance left", 80.0D, 0.0D, 100.0D, 1.0D)); + this.registerSetting(weaponOnly = new ButtonSetting("Weapon only", true)); + this.registerSetting(onlyWhileTargeting = new ButtonSetting("Only while targeting", false)); + this.registerSetting(rightClick = new ButtonSetting("Right click", false)); + this.registerSetting(chanceRight = new SliderSetting("Chance right", 80.0D, 0.0D, 100.0D, 1.0D)); + this.registerSetting(blocksOnly = new ButtonSetting("Blocks only", true)); + this.registerSetting(aboveCPS = new ButtonSetting("Above 5 cps", false)); + this.closetModule = true; + } + + public void onEnable() { + try { + this.bot = new Robot(); + } catch (AWTException var2) { + this.disable(); + } + + } + + public void onDisable() { + this.ignNL = false; + this.ignNR = false; + this.bot = null; + } + + @SubscribeEvent(priority = EventPriority.HIGH) + public void onMouseUpdate(MouseEvent ev) { + if (disableInCreative.isToggled() && mc.thePlayer.capabilities.isCreativeMode) { + return; + } + if (ev.button >= 0 && ev.buttonstate && Utils.nullCheck()) { + if (mc.currentScreen == null && !mc.thePlayer.isEating()) { + double ch; + if (ev.button == 0 && leftClick.isToggled() && chanceLeft.getInput() != 0.0D) { + if (this.ignNL) { + this.ignNL = false; + } + else { + if (chanceLeft.getInput() == 0) { + return; + } + if (weaponOnly.isToggled() && !Utils.holdingWeapon()) { + return; + } + + if (onlyWhileTargeting.isToggled() && (mc.objectMouseOver == null || mc.objectMouseOver.entityHit == null)) { + return; + } + + if (chanceLeft.getInput() != 100.0D) { + ch = Math.random(); + if (ch >= chanceLeft.getInput() / 100.0D) { + this.fix(0); + return; + } + } + + this.bot.mouseRelease(16); + this.bot.mousePress(16); + this.ignNL = true; + } + } + else if (ev.button == 1 && rightClick.isToggled()) { + if (this.ignNR) { + this.ignNR = false; + } + else { + if (chanceRight.getInput() == 0) { + return; + } + if (blocksOnly.isToggled()) { + ItemStack item = mc.thePlayer.getHeldItem(); + if (item == null || !(item.getItem() instanceof ItemBlock)) { + this.fix(1); + return; + } + } + + if (aboveCPS.isToggled() && CPSCalculator.i() <= 5) { + this.fix(1); + return; + } + + if (chanceRight.getInput() != 100.0D) { + ch = Math.random(); + if (ch >= chanceRight.getInput() / 100.0D) { + this.fix(1); + return; + } + } + + this.bot.mouseRelease(4); + this.bot.mousePress(4); + this.ignNR = true; + } + } + } + this.fix(0); + this.fix(1); + } + } + + private void fix(int t) { + if (t == 0) { + if (this.ignNL && !Mouse.isButtonDown(0)) { + this.bot.mouseRelease(16); + } + } + else if (t == 1 && this.ignNR && !Mouse.isButtonDown(1)) { + this.bot.mouseRelease(4); + } + + } +} diff --git a/src/main/java/keystrokesmod/module/impl/combat/HitBox.java b/src/main/java/keystrokesmod/module/impl/combat/HitBox.java new file mode 100644 index 0000000..3cb54f8 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/combat/HitBox.java @@ -0,0 +1,172 @@ +package keystrokesmod.module.impl.combat; + +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Utils; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraftforge.client.event.MouseEvent; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.util.List; + +public class HitBox extends Module { + public static SliderSetting multiplier; + public ButtonSetting showHitbox; + public ButtonSetting playersOnly; + public ButtonSetting weaponOnly; + private Entity pointedEntity; + private MovingObjectPosition mv; + + public HitBox() { + super("HitBox", category.combat, 0); + this.registerSetting(multiplier = new SliderSetting("Multiplier", "x", 1.2, 1.0, 5.0, 0.05)); + this.registerSetting(playersOnly = new ButtonSetting("Players only", true)); + this.registerSetting(showHitbox = new ButtonSetting("Show new hitbox", false)); + this.registerSetting(weaponOnly = new ButtonSetting("Weapon only", false)); + this.closetModule = true; + } + + @Override + public String getInfo() { + return ((int) multiplier.getInput() == multiplier.getInput() ? (int) multiplier.getInput() + "" : multiplier.getInput()) + multiplier.getSuffix(); + } + + @Override + public int getInfoType() { + return 1; + } + + @SubscribeEvent + public void onMouse(MouseEvent e) { + if (e.button != 0 || !e.buttonstate || !Utils.nullCheck() || multiplier.getInput() == 1 || mc.thePlayer.isBlocking() || mc.currentScreen != null) { + return; + } + if (weaponOnly.isToggled() && !Utils.holdingWeapon()) { + return; + } + Entity c = getEntity(1.0F); + if (c == null) { + return; + } + if (c instanceof EntityPlayer) { + if (Utils.isFriended((EntityPlayer) c)) { + return; + } + } + else if (playersOnly.isToggled()) { + return; + } + mc.objectMouseOver = mv; + } + + @SubscribeEvent + public void onRenderWorld(RenderWorldLastEvent e) { + if (showHitbox.isToggled() && Utils.nullCheck()) { + for (Entity en : mc.theWorld.loadedEntityList) { + if (en != mc.thePlayer && en instanceof EntityLivingBase && ((EntityLivingBase) en).deathTime == 0 && !(en instanceof EntityArmorStand) && !en.isInvisible()) { + this.rh(en, Color.WHITE); + } + } + } + } + + public static double getExpand(Entity en) { + return multiplier.getInput(); + } + + public Entity getEntity(float partialTicks) { + if (mc.getRenderViewEntity() != null && mc.theWorld != null) { + mc.pointedEntity = null; + pointedEntity = null; + double d0 = mc.playerController.extendedReach() ? 6.0 : (ModuleManager.reach.isEnabled() ? Utils.getRandomValue(Reach.min, Reach.max, Utils.getRandom()) : 3.0); + mv = mc.getRenderViewEntity().rayTrace(d0, partialTicks); + double d2 = d0; + Vec3 vec3 = mc.getRenderViewEntity().getPositionEyes(partialTicks); + + if (mv != null) { + d2 = mv.hitVec.distanceTo(vec3); + } + + Vec3 vec4 = mc.getRenderViewEntity().getLook(partialTicks); + Vec3 vec5 = vec3.addVector(vec4.xCoord * d0, vec4.yCoord * d0, vec4.zCoord * d0); + Vec3 vec6 = null; + float f1 = 1.0F; + List list = mc.theWorld.getEntitiesWithinAABBExcludingEntity(mc.getRenderViewEntity(), mc.getRenderViewEntity().getEntityBoundingBox().addCoord(vec4.xCoord * d0, vec4.yCoord * d0, vec4.zCoord * d0).expand((double) f1, (double) f1, (double) f1)); + double d3 = d2; + + for (Object o : list) { + Entity entity = (Entity) o; + if (entity.canBeCollidedWith()) { + float ex = (float) ((double) entity.getCollisionBorderSize() * getExpand(entity)); + AxisAlignedBB ax = entity.getEntityBoundingBox().expand((double) ex, (double) ex, (double) ex); + MovingObjectPosition mop = ax.calculateIntercept(vec3, vec5); + if (ax.isVecInside(vec3)) { + if (0.0D < d3 || d3 == 0.0D) { + pointedEntity = entity; + vec6 = mop == null ? vec3 : mop.hitVec; + d3 = 0.0D; + } + } else if (mop != null) { + double d4 = vec3.distanceTo(mop.hitVec); + if (d4 < d3 || d3 == 0.0D) { + if (entity == mc.getRenderViewEntity().ridingEntity && !entity.canRiderInteract()) { + if (d3 == 0.0D) { + pointedEntity = entity; + vec6 = mop.hitVec; + } + } else { + pointedEntity = entity; + vec6 = mop.hitVec; + d3 = d4; + } + } + } + } + } + + if (pointedEntity != null && (d3 < d2 || mv == null)) { + mv = new MovingObjectPosition(pointedEntity, vec6); + if (pointedEntity instanceof EntityLivingBase || pointedEntity instanceof EntityItemFrame) { + return pointedEntity; + } + } + } + return null; + } + + private void rh(Entity e, Color c) { + if (e instanceof EntityLivingBase) { + double x = e.lastTickPosX + (e.posX - e.lastTickPosX) * (double) Utils.getTimer().renderPartialTicks - mc.getRenderManager().viewerPosX; + double y = e.lastTickPosY + (e.posY - e.lastTickPosY) * (double) Utils.getTimer().renderPartialTicks - mc.getRenderManager().viewerPosY; + double z = e.lastTickPosZ + (e.posZ - e.lastTickPosZ) * (double) Utils.getTimer().renderPartialTicks - mc.getRenderManager().viewerPosZ; + float ex = (float) ((double) e.getCollisionBorderSize() * multiplier.getInput()); + AxisAlignedBB bbox = e.getEntityBoundingBox().expand((double) ex, (double) ex, (double) ex); + AxisAlignedBB axis = new AxisAlignedBB(bbox.minX - e.posX + x, bbox.minY - e.posY + y, bbox.minZ - e.posZ + z, bbox.maxX - e.posX + x, bbox.maxY - e.posY + y, bbox.maxZ - e.posZ + z); + GL11.glBlendFunc(770, 771); + GL11.glEnable(3042); + GL11.glDisable(3553); + GL11.glDisable(2929); + GL11.glDepthMask(false); + GL11.glLineWidth(2.0F); + GL11.glColor3d((double) c.getRed(), (double) c.getGreen(), (double) c.getBlue()); + RenderGlobal.drawSelectionBoundingBox(axis); + GL11.glEnable(3553); + GL11.glEnable(2929); + GL11.glDepthMask(true); + GL11.glDisable(3042); + } + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/combat/JumpReset.java b/src/main/java/keystrokesmod/module/impl/combat/JumpReset.java new file mode 100644 index 0000000..4dc99fc --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/combat/JumpReset.java @@ -0,0 +1,66 @@ +package keystrokesmod.module.impl.combat; + +import keystrokesmod.event.JumpEvent; +import keystrokesmod.event.PreInputEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Utils; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class JumpReset extends Module { + private SliderSetting chance; + private SliderSetting motion; + private boolean jump; + + public JumpReset() { + super("Jump Reset", category.combat); + this.registerSetting(chance = new SliderSetting("Chance", "%", 80, 0, 100, 1)); + this.registerSetting(motion = new SliderSetting("Jump motion", 0.42, 0, 1, 0.01)); + this.closetModule = true; + } + + public void onDisable() { + jump = false; + } + + @SubscribeEvent + public void onPreInput(PreInputEvent e) { + if (Utils.nullCheck()) { + if (chance.getInput() == 0) { + return; + } + if (mc.thePlayer.maxHurtTime <= 0) { + jump = false; + return; + } + if (mc.thePlayer.hurtTime == mc.thePlayer.maxHurtTime) { + jump = true; + } + if (!jump || mc.thePlayer.hurtTime == 0) { + jump = false; + return; + } + if (chance.getInput() != 100.0D) { + double ch = Math.random(); + if (ch >= chance.getInput() / 100.0D) { + return; + } + } + if (jump && mc.thePlayer.onGround) { + mc.thePlayer.jump(); + jump = false; + } + } + } + + @SubscribeEvent + public void onJump(JumpEvent e) { + if (!Utils.nullCheck() || !jump) { + return; + } + if (motion.getInput() != 0.42) { + e.setMotionY((float) motion.getInput()); + } + jump = false; + } +} diff --git a/src/main/java/keystrokesmod/module/impl/combat/KillAura.java b/src/main/java/keystrokesmod/module/impl/combat/KillAura.java new file mode 100644 index 0000000..c3c6b1f --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/combat/KillAura.java @@ -0,0 +1,1214 @@ +package keystrokesmod.module.impl.combat; + +import keystrokesmod.Raven; +import keystrokesmod.event.*; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.client.Settings; +import keystrokesmod.module.impl.movement.LongJump; +import keystrokesmod.module.impl.world.AntiBot; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.*; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.monster.EntitySilverfish; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.network.Packet; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.network.play.client.*; +import net.minecraft.util.*; +import net.minecraftforge.client.event.MouseEvent; +import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import org.lwjgl.input.Mouse; + +import java.util.*; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.atomic.AtomicBoolean; + +import static net.minecraft.util.EnumFacing.DOWN; + +public class KillAura extends Module { + private SliderSetting aps; + public SliderSetting autoBlockMode; + private SliderSetting fov; + private SliderSetting attackRange; + private SliderSetting swingRange; + private SliderSetting blockRange; + private SliderSetting rotationMode; + private SliderSetting rotationSmoothing; + private SliderSetting sortMode; + private SliderSetting switchDelay; + private SliderSetting targets; + private ButtonSetting attackMobs; + private ButtonSetting targetInvis; + private ButtonSetting disableInInventory; + private ButtonSetting disableWhileBlocking; + private ButtonSetting disableWhileMining; + private ButtonSetting hitThroughBlocks; + private ButtonSetting ignoreTeammates; + public ButtonSetting manualBlock; + private ButtonSetting prioritizeEnemies; + private ButtonSetting requireMouseDown; + private ButtonSetting silentSwing; + private ButtonSetting weaponOnly; + + private String[] autoBlockModes = new String[] { "Manual", "Vanilla", "Partial", "Interact A", "Interact B", "Hypixel", "Hypixel 2" }; + private String[] rotationModes = new String[] { "Silent", "Lock view", "None" }; + private String[] sortModes = new String[] { "Distance", "Health", "Hurttime", "Yaw" }; + + // autoblock related + private String[] swapBlacklist = { "compass", "snowball", "spawn", "skull" }; + + // target variables + public static EntityLivingBase target; + public static EntityLivingBase attackingEntity; + private HashMap hitMap = new HashMap<>(); // entity id, ticks existed client + public boolean isTargeting; + private List hostileMobs = new ArrayList<>(); + private Map golems = new HashMap<>(); // entity id, is teammate + public boolean justUnTargeted; + public int unTargetTicks; + + // blocking related + public boolean blockingClient; + public boolean blockingServer; + private int interactTicks; + private boolean firstCycle; + private boolean partialDown; + private int partialTicks; + + // blink related + private ConcurrentLinkedQueue blinkedPackets = new ConcurrentLinkedQueue<>(); + private ConcurrentLinkedQueue regularPackets = new ConcurrentLinkedQueue<>(); + private AtomicBoolean blinking = new AtomicBoolean(false); + public boolean lag; + public boolean swapped; + + // other + private long lastTime = 0L; + private long delay; + private boolean shouldAttack; + private int previousAutoBlockMode; + private int fistTick; + private boolean reset; + private boolean rotated; + private boolean sendUnBlock; + private int delayTicks = 0; + private boolean lastPressedLeft; + private boolean lastPressedRight; + public boolean fixStates; + + public KillAura() { + super("KillAura", category.combat); + this.registerSetting(aps = new SliderSetting("APS", 16.0, 1.0, 20.0, 0.5)); + this.registerSetting(autoBlockMode = new SliderSetting("Autoblock", 0, autoBlockModes)); + this.registerSetting(fov = new SliderSetting("FOV", 360.0, 30.0, 360.0, 4.0)); + this.registerSetting(attackRange = new SliderSetting("Range (attack)", 3.0, 3.0, 6.0, 0.05)); + this.registerSetting(swingRange = new SliderSetting("Range (swing)", 3.3, 3.0, 8.0, 0.05)); + this.registerSetting(blockRange = new SliderSetting("Range (block)", 6.0, 3.0, 12.0, 0.05)); + this.registerSetting(rotationMode = new SliderSetting("Rotation mode", 0, rotationModes)); + this.registerSetting(rotationSmoothing = new SliderSetting("Rotation smoothing", 0, 0, 10, 1)); + this.registerSetting(sortMode = new SliderSetting("Sort mode", 0, sortModes)); + this.registerSetting(switchDelay = new SliderSetting("Switch delay", "ms", 200.0, 50.0, 1000.0, 25.0)); + this.registerSetting(targets = new SliderSetting("Targets", 3.0, 1.0, 10.0, 1.0)); + this.registerSetting(targetInvis = new ButtonSetting("Target invis", true)); + this.registerSetting(attackMobs = new ButtonSetting("Attack mobs", false)); + this.registerSetting(disableInInventory = new ButtonSetting("Disable in inventory", true)); + this.registerSetting(disableWhileBlocking = new ButtonSetting("Disable while blocking", false)); + this.registerSetting(disableWhileMining = new ButtonSetting("Disable while mining", false)); + this.registerSetting(hitThroughBlocks = new ButtonSetting("Hit through blocks", true)); + this.registerSetting(ignoreTeammates = new ButtonSetting("Ignore teammates", true)); + this.registerSetting(manualBlock = new ButtonSetting("Manual block", false)); // does absolutely nothing + this.registerSetting(prioritizeEnemies = new ButtonSetting("Prioritize enemies", false)); + this.registerSetting(requireMouseDown = new ButtonSetting("Require mouse down", false)); + this.registerSetting(silentSwing = new ButtonSetting("Silent swing while blocking", false)); + this.registerSetting(weaponOnly = new ButtonSetting("Weapon only", false)); + } + + @Override + public String getInfo() { + if (rotationMode.getInput() == 2) { // None, return FOV if rotation mode is none + return String.valueOf((int) this.fov.getInput()); + } + return rotationModes[(int) rotationMode.getInput()]; + } + + @Override + public void onEnable() { + if (rotationMode.getInput() == 0 && autoBlockMode.getInput() <= 1) { + delayTicks = 1; + } + } + + @Override + public void onDisable() { + handleBlocking(false); + hitMap.clear(); + if (blinkAutoBlock()) { // interact autoblock + resetBlinkState(true); + } + blinking.set(false); + interactTicks = 0; + setTarget(null); + if (rotated || reset) { + resetYaw(); + } + rotated = false; + partialTicks = 0; + delayTicks = 0; + if (isTargeting) { + isTargeting = false; + justUnTargeted = true; + } + } + + + @SubscribeEvent + public void onPreUpdate(PreUpdateEvent e) { + if (mc.currentScreen == null || mc.currentScreen.allowUserInput) { + boolean pressedLeft = Mouse.isButtonDown(0); + if (pressedLeft && !lastPressedLeft) { + onCustomMouse(0, true); + } + if (!pressedLeft && lastPressedLeft) { + onCustomMouse(0, false); + } + if (target == null) { + boolean pressedRight = Mouse.isButtonDown(1); + if (pressedRight && !lastPressedRight) { + onCustomMouse(1, true); + } + if (!pressedRight && lastPressedRight) { + onCustomMouse(1, false); + } + lastPressedRight = pressedRight; + } + lastPressedLeft = pressedLeft; + } + /*if (sendUnBlock) { + Reflection.setItemInUse(blockingClient = false); + sendDigPacket(); + sendUnBlock = false; + Utils.print("sendUnBlock"); + return; + }*/ + delayTicks--; + if (ModuleManager.blink.isEnabled()) { + if (blinking.get() || lag) { + resetBlinkState(true); + } + setTarget(null); + return; + } + if (ModuleManager.scaffold.isEnabled || LongJump.stopKillAura) { + if (blinking.get() || lag) { + resetBlinkState(false); + } + setTarget(null); + return; + } + if (!basicCondition() || !settingCondition()) { + if (blinking.get() || lag) { + resetBlinkState(false); + } + setTarget(null); + return; + } + if (target == null) { + if (blinking.get() || lag) { + resetBlinkState(true); + //Utils.print("null target reset blink"); + } + handleBlocking(false); + return; + } + if (delayTicks >= 0) { + return; + } + if (reset) { + resetYaw(); + reset = false; + } + double distanceToBB = getDistanceToBoundingBox(target); + boolean inBlockRange = distanceToBB <= blockRange.getInput(); + if (!autoBlockOverride() || !inBlockRange) { // regular swing & attack if autoblock isnt overriding or isnt in autoblock range + handleSwingAndAttack(distanceToBB, false); + } + if (inBlockRange && autoBlockOverride() && manualBlock()) { + handleAutoBlock(distanceToBB); + } + if ((blinkAutoBlock() && !Utils.holdingSword()) || !inBlockRange) { // for blink autoblocks + if (blinking.get() || lag) { + resetBlinkState(true); + //Utils.print("2"); + } + } + if (inBlockRange && manualBlock()) { + handleBlocking(true); + } + if (mc.currentScreen == null || mc.currentScreen.allowUserInput) { + boolean pressedRight = Mouse.isButtonDown(1); + if (pressedRight && !lastPressedRight) { + onCustomMouse(1, true); + } + if (!pressedRight && lastPressedRight) { + onCustomMouse(1, false); + } + lastPressedRight = pressedRight; + } + } + + @SubscribeEvent(priority = EventPriority.LOW) + public void onPreMotion(PreMotionEvent e) { + if (delayTicks >= 0) { + if (rotated) { + resetYaw(e); + } + return; + } + if (!basicCondition() || !settingCondition()) { + setTarget(null); + if (rotated) { + resetYaw(e); + } + return; + } + handleTarget(); + if (target == null) { + if (rotated) { + resetYaw(e); + } + return; + } + if (rotationMode.getInput() != 2) { + if (inRange(target, attackRange.getInput() - 0.005)) { + float[] rotations = RotationUtils.getRotations(target, e.getYaw(), e.getPitch()); + float[] smoothedRotations = getRotationsSmoothed(rotations); + if (rotationMode.getInput() == 0) { // silent + e.setYaw(smoothedRotations[0]); + e.setPitch(smoothedRotations[1]); + rotated = true; + } + else { + mc.thePlayer.rotationYaw = smoothedRotations[0]; + mc.thePlayer.rotationPitch = smoothedRotations[1]; + } + } + else if (rotationMode.getInput() == 0) { + if (rotated) { + reset = true; + e.setYaw(RotationUtils.serverRotations[0]); + e.setPitch(RotationUtils.serverRotations[1]); + fistTick = mc.thePlayer.ticksExisted + 1; + rotated = false; + } + } + } + } + + public void onUpdate() { + if (rotationMode.getInput() == 1 && target != null) { + if (inRange(target, attackRange.getInput() - 0.005)) { + float[] rotations = RotationUtils.getRotations(target, mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch); + float[] smoothedRotations = getRotationsSmoothed(rotations); + mc.thePlayer.rotationYaw = smoothedRotations[0]; + mc.thePlayer.rotationPitch = smoothedRotations[1]; + } + } + if (attackingEntity != null && inRange(target, attackRange.getInput())) { + isTargeting = true; + fixStates = false; + } + else if (isTargeting) { + isTargeting = false; + justUnTargeted = true; + } + } + + @SubscribeEvent + public void onRenderTick(TickEvent.RenderTickEvent event) { + if (!Utils.nullCheck()) { + return; + } + if (event.phase == TickEvent.Phase.START) { + if (System.currentTimeMillis() - this.lastTime >= delay && target != null) { + this.lastTime = System.currentTimeMillis(); + updateAttackDelay(); + if (target != null) { + shouldAttack = true; + } + } + } + else if (event.phase == TickEvent.Phase.END && mc.thePlayer.ticksExisted == fistTick && rotationMode.getInput() == 0) { + mc.thePlayer.renderArmPitch = mc.thePlayer.rotationPitch; + mc.thePlayer.renderArmYaw = mc.thePlayer.rotationYaw; + } + } + + @SubscribeEvent(priority = EventPriority.HIGH) + public void onSendPacket(SendPacketEvent e) { + if (!Utils.nullCheck()) { + return; + } + Packet packet = e.getPacket(); + if (packet.getClass().getSimpleName().startsWith("S")) { + return; + } + if (packet instanceof C08PacketPlayerBlockPlacement) { + if (delayTicks >= 0) { + if (((C08PacketPlayerBlockPlacement) packet).getStack() != null && ((C08PacketPlayerBlockPlacement) packet).getStack().getItem() instanceof ItemSword && ((C08PacketPlayerBlockPlacement) packet).getPlacedBlockDirection() != 255) { + e.setCanceled(true); + } + } + } + if (blinking.get() && !e.isCanceled()) { // blink + if (packet instanceof C00PacketLoginStart || packet instanceof C00Handshake) { + return; + } + blinkedPackets.add(packet); + if (packet instanceof C08PacketPlayerBlockPlacement || packet instanceof C09PacketHeldItemChange || packet instanceof C02PacketUseEntity || packet instanceof C07PacketPlayerDigging) { + // Nothing + } + else { + regularPackets.add(packet); + } + e.setCanceled(true); + } + } + + @SubscribeEvent + public void onMouse(MouseEvent e) { + if (e.button == 0 || e.button == 1) { + if (!Utils.holdingWeapon() || target == null || rotationMode.getInput() != 0) { + return; + } + e.setCanceled(true); + } + } + + public void onCustomMouse(int button, boolean state) { + if (blinkAutoBlock() || autoBlockMode.getInput() == 3 || rotationMode.getInput() != 0) { + return; + } + if (button == 1) { + if (state) { + if (target != null) { + if (basicCondition() && settingCondition()) { + if (!ModuleManager.bedAura.rotate) { + if (isLookingAtEntity()) { + if (!mc.thePlayer.isBlocking() || !disableWhileBlocking.isToggled()) { + interactAt(true, true, false, true); + } + } + } + } + Reflection.setItemInUse(blockingClient = true); + sendBlockPacket(); + // cancel + } + else { + delayTicks = 1; + } + } + else { + KeyBinding.setKeyBindState(mc.gameSettings.keyBindUseItem.getKeyCode(), false); + Reflection.setItemInUse(blockingClient = false); + sendUnBlock = true; + } + } + else if (button == 0) { + if (!state) { + delayTicks = 1; + } + if (state && mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && !Mouse.isButtonDown(1)) { + KeyBinding.setKeyBindState(mc.gameSettings.keyBindAttack.getKeyCode(), true); + KeyBinding.onTick(mc.gameSettings.keyBindAttack.getKeyCode()); + } +// Utils.sendMessage(!mc.thePlayer.isBlocking() + " " + (mc.objectMouseOver != null) + " " + (mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + " " + state); +// if (!state) { +// delayTicks = 2; +// } +// if (state) { +// if (target == null) { +// +// } +// else { +// // cancel +// if (!mc.thePlayer.isBlocking() && mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { +// int key = mc.gameSettings.keyBindAttack.getKeyCode(); +// KeyBinding.setKeyBindState(key, true); +// Utils.sendMessage("set to true"); +// } +// } +// } + } + } + + @SubscribeEvent + public void onWorldJoin(EntityJoinWorldEvent e) { + if (e.entity == mc.thePlayer) { + hitMap.clear(); + } + } + + private void setTarget(Entity entity) { + if (entity == null || !(entity instanceof EntityLivingBase)) { + if (blockingClient) { + Reflection.setItemInUse(blockingClient = false); + sendUnBlock = true; + } + partialTicks = 0; + interactTicks = 0; + handleBlocking(false); + target = null; + attackingEntity = null; + } + else { + target = (EntityLivingBase) entity; + } + } + + /*@SubscribeEvent + public void onSetAttackTarget(LivingSetAttackTargetEvent e) { + if (e.entity != null && !hostileMobs.contains(e.entity)) { + if (!(e.target instanceof EntityPlayer) || !e.target.getName().equals(mc.thePlayer.getName())) { + return; + } + hostileMobs.add(e.entity); + } + if (e.target == null && hostileMobs.contains(e.entity)) { + hostileMobs.remove(e.entity); + if (Raven.debug) { + Utils.sendModuleMessage(this, "&7mob stopped attack player"); + } + } + }*/ + + private void handleTarget() { + // Narrow down the targets available + List availableTargets = new ArrayList<>(); + double maxRange = getMaxRange(); + for (Entity entity : mc.theWorld.loadedEntityList) { + if (entity == null || entity == mc.thePlayer || entity.isDead) { + continue; + } + if (entity instanceof EntityPlayer) { + if (Utils.isFriended((EntityPlayer) entity)) { + continue; + } + if (((EntityPlayer) entity).deathTime != 0) { + continue; + } + if (AntiBot.isBot(entity) || (Utils.isTeamMate(entity) && ignoreTeammates.isToggled())) { + continue; + } + } +// else if (entity instanceof EntityCreature && attackMobs.isToggled()) { +// if (((EntityCreature) entity).tasks == null || ((EntityCreature) entity).isAIDisabled() || ((EntityCreature) entity).deathTime != 0) { // no ai +// continue; +// } +// if (!entity.getClass().getCanonicalName().startsWith("net.minecraft.entity.monster.")) { +// continue; +// } +// } + else { + continue; + } + if (entity.isInvisible() && !targetInvis.isToggled()) { + continue; + } + float fovInput = (float) fov.getInput(); + if (fovInput != 360.0f && !Utils.inFov(fovInput, entity)) { + continue; + } + if (mc.thePlayer.getDistanceToEntity(entity) < maxRange + maxRange / 3) { // simple distance check + availableTargets.add((EntityLivingBase) entity); + } + } + // Init as a new class and adding to list + List toClassTargets = new ArrayList<>(); + for (EntityLivingBase target : availableTargets) { + double distanceRayCasted = getDistanceToBoundingBox(target); + if (distanceRayCasted > maxRange) { + continue; + } + if (target instanceof EntityCreature && !isHostile((EntityCreature) target)) { + continue; + } + if (!hitThroughBlocks.isToggled() && (!Utils.canPlayerBeSeen(target) || !inRange(target, attackRange.getInput() - 0.005))) { + continue; + } + toClassTargets.add(new KillAuraTarget(distanceRayCasted, target.getHealth(), target.hurtTime, RotationUtils.distanceFromYaw(target, false), target.getEntityId(), (target instanceof EntityPlayer) ? Utils.isEnemy((EntityPlayer) target) : false)); + } + // Sorting targets + Comparator comparator = null; + switch ((int) sortMode.getInput()) { + case 0: + comparator = Comparator.comparingDouble(entity -> entity.distance); + break; + case 1: + comparator = Comparator.comparingDouble(entityPlayer -> (double)entityPlayer.health); + break; + case 2: + comparator = Comparator.comparingDouble(entityPlayer2 -> (double)entityPlayer2.hurttime); + break; + case 3: + comparator = Comparator.comparingDouble(entity2 -> entity2.yawDelta); + break; + } + if (prioritizeEnemies.isToggled()) { + List enemies = new ArrayList<>(); + for (KillAuraTarget entity : toClassTargets) { + if (entity.isEnemy) { + enemies.add(entity); + } + } + if (!enemies.isEmpty()) { + toClassTargets = new ArrayList<>(enemies); + } + } + if (sortMode.getInput() != 0) { + Collections.sort(toClassTargets, Comparator.comparingDouble(entity -> entity.distance)); + } + Collections.sort(toClassTargets, comparator); // then sort by selected sorting mode + + List attackTargets = new ArrayList<>(); + for (KillAuraTarget killAuraTarget : toClassTargets) { + if (killAuraTarget.distance <= attackRange.getInput() - 0.005) { + attackTargets.add(killAuraTarget); + } + } + + if (!attackTargets.isEmpty()) { + // Switch aura + int ticksExisted = mc.thePlayer.ticksExisted; + int switchDelayTicks = (int) (switchDelay.getInput() / 50); + long noHitTicks = (long) Math.min(attackTargets.size(), targets.getInput()) * switchDelayTicks; + for (KillAuraTarget auraTarget : attackTargets) { + Integer firstHit = hitMap.get(auraTarget.entityId); + if (firstHit == null || ticksExisted - firstHit >= switchDelayTicks) { + continue; + } + if (auraTarget.distance < attackRange.getInput() - 0.005) { + setTarget(mc.theWorld.getEntityByID(auraTarget.entityId)); + return; + } + } + + for (KillAuraTarget auraTarget : attackTargets) { + Integer firstHit = hitMap.get(auraTarget.entityId); + if (firstHit == null || ticksExisted >= firstHit + noHitTicks) { + hitMap.put(auraTarget.entityId, ticksExisted); + setTarget(mc.theWorld.getEntityByID(auraTarget.entityId)); + return; + } + } + } + else if (!toClassTargets.isEmpty()) { + KillAuraTarget killAuraTarget = toClassTargets.get(0); + setTarget(mc.theWorld.getEntityByID(killAuraTarget.entityId)); + } + else { + setTarget(null); + } + } + + private void handleSwingAndAttack(double distance, boolean swung) { + boolean inAttackDistance = inRange(target, attackRange.getInput() - 0.005); + if ((distance <= swingRange.getInput() || inAttackDistance) && shouldAttack && !swung) { // swing if in swing range or needs to attack + if (!mc.thePlayer.isBlocking() || !disableWhileBlocking.isToggled()) { + swingItem(); + } + } + if (inAttackDistance) { + attackingEntity = target; + if (shouldAttack) { + shouldAttack = false; + if (ModuleManager.bedAura.rotate) { + return; + } + if (!isLookingAtEntity()) { + return; + } + if (!mc.thePlayer.isBlocking() || !disableWhileBlocking.isToggled()) { + swingItem(); + mc.playerController.attackEntity(mc.thePlayer, target); + } + } + } + else { + attackingEntity = null; + } + } + + private void handleBlocking(boolean blockState) { + if (!Utils.holdingSword()) { + if (blockingClient) { + Reflection.setItemInUse(blockingClient = false); + } + return; + } + if (this.blockingClient == blockState && autoBlockMode.getInput() != 3) { + return; + } + if (autoBlockMode.getInput() != previousAutoBlockMode) { + if (previousAutoBlockMode == 4 || previousAutoBlockMode == 5 || previousAutoBlockMode == 6) { // if == interact + resetBlinkState(true); + } + } + int keyCode = mc.gameSettings.keyBindUseItem.getKeyCode(); + switch ((int) autoBlockMode.getInput()) { + case 0: // manual, do nothing + break; + case 1: // vanilla + setKeyBindState(keyCode, blockState, false); + this.blockingClient = blockState; + break; + case 3: // interact a + case 4: // interact b + case 5: // interact c + case 6: // interact d + Reflection.setItemInUse(this.blockingClient = blockState); + break; + case 2: // partial + if (!blockState) { + rightClick(partialDown = false); + break; + } + partialTicks++; + if (partialDown) { + rightClick(partialDown = false); + partialTicks = 0; + break; + } + else if (partialTicks == 2) { + rightClick(partialDown = true); + } + break; + } + previousAutoBlockMode = (int) autoBlockMode.getInput(); + } + + private void rightClick(boolean state) { + int keyCode = mc.gameSettings.keyBindUseItem.getKeyCode(); + KeyBinding.setKeyBindState(keyCode, state); + if (state) { + KeyBinding.onTick(keyCode); + } + Reflection.setButton(1, state); + } + + private double getMaxRange() { + return Math.max(Math.max(swingRange.getInput(), attackRange.getInput() - 0.005), blockRange.getInput()); + } + + public boolean autoBlockOverride() { + return blinkAutoBlock() && Utils.holdingSword(); + } + + public boolean blinkAutoBlock() { + return (autoBlockMode.getInput() == 4 || autoBlockMode.getInput() == 5 || autoBlockMode.getInput() == 6 || autoBlockMode.getInput() == 7); + } + + private float unwrapYaw(float yaw, float prevYaw) { + return prevYaw + ((((yaw - prevYaw + 180f) % 360f) + 360f) % 360f - 180f); + } + + private boolean isLookingAtEntity() { // + if (rotationMode.getInput() == 0 && rotationSmoothing.getInput() > 0) { // silent + return RotationUtils.isPossibleToHit(attackingEntity, attackRange.getInput() - 0.005, RotationUtils.serverRotations); + } + return true; + } + + private void handleAutoBlock(double distance) { + boolean inAttackDistance = inRange(target, attackRange.getInput() - 0.005); + if (inAttackDistance) { + attackingEntity = target; + } + boolean swung = false; + if ((distance <= swingRange.getInput() || inAttackDistance) && shouldAttack) { // swing if in swing range or needs to attack + swung = true; + if (!inAttackDistance) { + shouldAttack = false; + } + } + if (ModuleManager.bedAura.stopAutoblock) { + resetBlinkState(false); + blockingServer = false; + lag = false; + return; + } + switch ((int) autoBlockMode.getInput()) { + case 3: // interact a + if (interactTicks >= 2) { + interactTicks = 0; + } + interactTicks++; + switch (interactTicks) { + case 1: + blinking.set(true); + if (lag) { + sendDigPacket(); + } + break; + case 2: + handleInteractAndAttack(distance, true, true, swung); + sendBlockPacket(); + releasePackets(); // release + lag = true; + break; + } + break; + case 4: // interact b + if (interactTicks >= 2) { + interactTicks = 0; + } + interactTicks++; + switch (interactTicks) { + case 1: + blinking.set(true); + if (lag) { + setSwapSlot(); + swapped = true; + } + break; + case 2: + if (lag) { + setCurrentSlot(); + } + handleInteractAndAttack(distance, true, true, swung); + sendBlockPacket(); + releasePackets(); // release + lag = true; + break; + } + break; + case 5: // hypixel + if (interactTicks >= 3) { + interactTicks = 0; + } + interactTicks++; + switch (interactTicks) { + case 1: + blinking.set(true); + if (lag) { + setSwapSlot(); + swapped = true; + } + break; + case 2: + if (lag) { + setCurrentSlot(); + } + handleInteractAndAttack(distance, true, true, swung); + sendBlockPacket(); + releasePackets(); // release + lag = true; + break; + } + break; + case 6: // hypixel 2 + if (interactTicks >= 3) { + interactTicks = 0; + } + interactTicks++; + if (!firstCycle) { + switch (interactTicks) { + case 1: + blinking.set(true); + if (lag) { + setSwapSlot(); + swapped = true; + } + break; + case 2: + if (lag) { + setCurrentSlot(); + } + handleInteractAndAttack(distance, true, true, swung); + sendBlockPacket(); + releasePackets(); // release + lag = true; + break; + case 3: + firstCycle = true; + break; + } + break; + } + else { + switch (interactTicks) { + case 1: + blinking.set(true); + if (lag) { + setSwapSlot(); + swapped = true; + } + break; + case 2: + if (lag) { + setCurrentSlot(); + } + handleInteractAndAttack(distance, true, true, swung); + sendBlockPacket(); + releasePackets(); // release + firstCycle = false; + interactTicks = 0; + lag = true; + break; + } + break; + } + } + } + + private void setSwapSlot() { + int bestSwapSlot = getBestSwapSlot(); + mc.thePlayer.sendQueue.addToSendQueue(new C09PacketHeldItemChange(bestSwapSlot)); + Raven.packetsHandler.playerSlot.set(bestSwapSlot); + } + + private void setCurrentSlot() { + mc.thePlayer.sendQueue.addToSendQueue(new C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem)); + Raven.packetsHandler.playerSlot.set(mc.thePlayer.inventory.currentItem); + } + + private void resetYaw(PreMotionEvent e) { + reset = true; + e.setYaw(RotationUtils.serverRotations[0]); + e.setPitch(RotationUtils.serverRotations[1]); + fistTick = mc.thePlayer.ticksExisted + 1; + rotated = false; + } + + private boolean basicCondition() { + if (!Utils.nullCheck()) { + return false; + } + if (mc.thePlayer.isDead) { + return false; + } + return true; + } + + private boolean settingCondition() { + if (requireMouseDown.isToggled() && !Mouse.isButtonDown(0)) { + return false; + } + else if (weaponOnly.isToggled() && !Utils.holdingWeapon()) { + return false; + } + else if (disableWhileMining.isToggled() && isMining()) { + return false; + } + else if (disableInInventory.isToggled() && Settings.inInventory()) { + return false; + } + else if (ModuleManager.bedAura != null && ModuleManager.bedAura.isEnabled() && !ModuleManager.bedAura.allowAura.isToggled() && ModuleManager.bedAura.currentBlock != null) { + return false; + } + return true; + } + + private boolean isMining() { + return Mouse.isButtonDown(0) && mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && mc.objectMouseOver.getBlockPos() != null; + } + + private void sendBlockPacket() { + mc.getNetHandler().addToSendQueue(new C08PacketPlayerBlockPlacement(mc.thePlayer.getHeldItem())); + } + + private void setKeyBindState(int keycode, boolean state, boolean invokeTick) { + KeyBinding.setKeyBindState(keycode, state); + if (invokeTick) { + KeyBinding.onTick(keycode); + } + } + + private void updateAttackDelay() { + delay = (long)(1000.0 / aps.getInput() + Utils.randomizeInt(-4, 4)); + } + + private void swingItem() { + if (silentSwing.isToggled() && mc.thePlayer.isBlocking()) { + mc.thePlayer.sendQueue.addToSendQueue(new C0APacketAnimation()); + } + else { + mc.thePlayer.swingItem(); + } + } + + private double getDistanceToBoundingBox(Entity target) { + if (mc.thePlayer == null) { + return 0; + } + Vec3 playerEyePos = mc.thePlayer.getPositionEyes(Utils.getTimer().renderPartialTicks); + AxisAlignedBB boundingBox = target.getEntityBoundingBox(); + double nearestX = MathHelper.clamp_double(playerEyePos.xCoord, boundingBox.minX, boundingBox.maxX); + double nearestY = MathHelper.clamp_double(playerEyePos.yCoord, boundingBox.minY, boundingBox.maxY); + double nearestZ = MathHelper.clamp_double(playerEyePos.zCoord, boundingBox.minZ, boundingBox.maxZ); + Vec3 nearestPoint = new Vec3(nearestX, nearestY, nearestZ); + return playerEyePos.distanceTo(nearestPoint); + } + + public int getBestSwapSlot() { + int currentSlot = mc.thePlayer.inventory.currentItem; + int bestSlot = -1; + double bestDamage = -1; + for (int i = 0; i < 9; ++i) { + if (i == currentSlot) { + continue; + } + ItemStack stack = mc.thePlayer.inventory.getStackInSlot(i); + double damage = Utils.getDamage(stack); + if (damage != 0) { + if (damage > bestDamage) { + bestDamage = damage; + bestSlot = i; + } + } + } + if (bestSlot == -1) { + for (int i = 0; i < 9; ++i) { + if (i == currentSlot) { + continue; + } + ItemStack stack = mc.thePlayer.inventory.getStackInSlot(i); + if (stack == null || Arrays.stream(swapBlacklist).noneMatch(stack.getUnlocalizedName().toLowerCase()::contains)) { + bestSlot = i; + break; + } + } + } + + return bestSlot; + } + + public void resetYaw() { + float serverYaw = RotationUtils.serverRotations[0]; + float unwrappedYaw = unwrapYaw(MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw), serverYaw); + mc.thePlayer.rotationYaw = unwrappedYaw; + mc.thePlayer.prevRotationYaw = unwrappedYaw; + } + + private void interactAt(boolean interactAt, boolean interact, boolean noEvent, boolean requireInteractAt) { + if (attackingEntity == null) { + return; + } + if (ModuleManager.bedAura.rotate) { + return; + } + boolean sent = false; + if (interactAt) { + boolean canHit = RotationUtils.isPossibleToHit(attackingEntity, attackRange.getInput() - 0.005, RotationUtils.serverRotations); + if (!canHit) { + return; + } + MovingObjectPosition mov = RotationUtils.rayTrace(10, Utils.getTimer().renderPartialTicks, RotationUtils.serverRotations, hitThroughBlocks.isToggled() ? attackingEntity : null); + if (mov != null && mov.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && mov.entityHit == attackingEntity) { + Vec3 hitVec = mov.hitVec; + hitVec = new Vec3(hitVec.xCoord - attackingEntity.posX, hitVec.yCoord - attackingEntity.posY, hitVec.zCoord - attackingEntity.posZ); + if (!noEvent) { + mc.thePlayer.sendQueue.addToSendQueue(new C02PacketUseEntity(attackingEntity, hitVec)); + } + else { + PacketUtils.sendPacketNoEvent(new C02PacketUseEntity(attackingEntity, hitVec)); + } + sent = true; + } + } + if (requireInteractAt && !sent) { + return; + } + if (interact) { + if (!noEvent) { + mc.thePlayer.sendQueue.addToSendQueue(new C02PacketUseEntity(attackingEntity, C02PacketUseEntity.Action.INTERACT)); + } + else { + PacketUtils.sendPacketNoEvent(new C02PacketUseEntity(attackingEntity, C02PacketUseEntity.Action.INTERACT)); + } + } + } + + private float[] getRotationsSmoothed(float rotations[]) { + float serverYaw = RotationUtils.serverRotations[0]; + float serverPitch = RotationUtils.serverRotations[1]; + float unwrappedYaw = unwrapYaw(rotations[0], serverYaw); + + float deltaYaw = unwrappedYaw - serverYaw; + float deltaPitch = rotations[1] - serverPitch; + + float yawSmoothing = (float) rotationSmoothing.getInput(); + float pitchSmoothing = yawSmoothing; + + float strafe = mc.thePlayer.moveStrafing; + if (strafe < 0 && deltaYaw < 0 || strafe > 0 && deltaYaw > 0) { + yawSmoothing = Math.max(1f, yawSmoothing / 2f); + } + + float motionY = (float) mc.thePlayer.motionY; + if (motionY > 0 && deltaPitch > 0 || motionY < 0 && deltaPitch < 0) { + pitchSmoothing = Math.max(1f, pitchSmoothing / 2f); + } + + serverYaw += deltaYaw / Math.max(1f, yawSmoothing); + serverPitch += deltaPitch / Math.max(1f, pitchSmoothing); + + return new float[] { serverYaw, serverPitch }; + } + + private void handleInteractAndAttack(double distance, boolean interactAt, boolean interact, boolean swung) { + if (ModuleManager.antiFireball != null && ModuleManager.antiFireball.isEnabled() && ModuleManager.antiFireball.fireball != null && ModuleManager.antiFireball.attack) { + if (ModuleManager.bedAura.rotate) { + return; + } + if (!ModuleManager.antiFireball.silentSwing.isToggled()) { + mc.thePlayer.swingItem(); + } + else { + mc.thePlayer.sendQueue.addToSendQueue(new C0APacketAnimation()); + } + mc.playerController.attackEntity(mc.thePlayer, ModuleManager.antiFireball.fireball); + if (interact) { + mc.thePlayer.sendQueue.addToSendQueue(new C02PacketUseEntity(ModuleManager.antiFireball.fireball, C02PacketUseEntity.Action.INTERACT)); + } + } + else { + handleSwingAndAttack(distance, swung); + interactAt(interactAt, interact, false, false); + } + } + + public void resetBlinkState(boolean unblock) { + blinking.set(false); + blinkedPackets.clear(); + releasePackets(); + //Utils.print("blink state reset"); + blockingServer = false; + fixStates = true; + interactTicks = 0; + } + + public void sendDigPacket() { + if (!Utils.holdingSword()) { + return; + } + PacketUtils.sendPacketNoEvent(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, DOWN)); + //Utils.print("Unblock"); + } + + private void releasePackets() { + try { + synchronized (blinkedPackets) { + for (Packet packet : blinkedPackets) { + Raven.packetsHandler.handlePacket(packet); + PacketUtils.sendPacketNoEvent(packet); + regularPackets.clear(); + //Utils.print("blink packets"); + } + } + } + catch (Exception e) { + e.printStackTrace(); + Utils.sendModuleMessage(this, "&cThere was an error releasing blinked packets"); + } + blinkedPackets.clear(); + try { + synchronized (regularPackets) { + for (Packet packet : regularPackets) { + Raven.packetsHandler.handlePacket(packet); + PacketUtils.sendPacketNoEvent(packet); + //Utils.print("regular packets"); + } + } + } + catch (Exception e) { + e.printStackTrace(); + Utils.sendModuleMessage(this, "&cThere was an error releasing regular packets"); + } + regularPackets.clear(); + } + + private boolean inRange(final Entity target, final double distance) { + return RotationUtils.isPossibleToHit(target, distance, RotationUtils.getRotations(target)); + } + + private boolean isHostile(EntityCreature entityCreature) { + if (entityCreature instanceof EntitySilverfish) { + String teamColor = Utils.getFirstColorCode(entityCreature.getCustomNameTag()); + String teamColorSelf = Utils.getFirstColorCode(mc.thePlayer.getDisplayName().getFormattedText()); + if (!teamColor.isEmpty() && teamColorSelf.equals(teamColor)) { // same team + return false; + } + return true; + } + else if (entityCreature instanceof EntityIronGolem) { + if (!golems.containsKey(entityCreature.getEntityId())) { + double nearestDistance = -1; + EntityArmorStand nearestArmorStand = null; + for (Entity entity : mc.theWorld.loadedEntityList) { + if (!(entity instanceof EntityArmorStand)) { + continue; + } + String stripped = Utils.stripString(entity.getDisplayName().getFormattedText()); + if (stripped.contains("[") && stripped.endsWith("]")) { + double distanceSq = entity.getDistanceSq(entityCreature.posX, entityCreature.posY, entityCreature.posZ); + if (distanceSq < nearestDistance || nearestDistance == -1) { + nearestDistance = distanceSq; + nearestArmorStand = (EntityArmorStand) entity; + } + } + } + if (nearestArmorStand != null) { + String teamColor = Utils.getFirstColorCode(nearestArmorStand.getDisplayName().getFormattedText()); + String teamColorSelf = Utils.getFirstColorCode(mc.thePlayer.getDisplayName().getFormattedText()); + boolean isTeam = false; + if (!teamColor.isEmpty() && teamColorSelf.equals(teamColor)) { // same team + isTeam = true; + } + golems.put(entityCreature.getEntityId(), isTeam); + return !isTeam; + } + } + else { + return !golems.getOrDefault(entityCreature.getEntityId(), false); + } + } + return hostileMobs.contains(entityCreature); + } + + private boolean manualBlock() { + return !manualBlock.isToggled() || Mouse.isButtonDown(1); + } + + static class KillAuraTarget { + double distance; + float health; + int hurttime; + double yawDelta; + int entityId; + boolean isEnemy; + + public KillAuraTarget(double distance, float health, int hurttime, double yawDelta, int entityId, boolean isEnemy) { + this.distance = distance; + this.health = health; + this.hurttime = hurttime; + this.yawDelta = yawDelta; + this.entityId = entityId; + this.isEnemy = isEnemy; + } + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/combat/Reach.java b/src/main/java/keystrokesmod/module/impl/combat/Reach.java new file mode 100644 index 0000000..e1ef018 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/combat/Reach.java @@ -0,0 +1,155 @@ +package keystrokesmod.module.impl.combat; + +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.RotationUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraftforge.client.event.MouseEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.input.Mouse; + +import java.util.List; + +public class Reach extends Module { + public static SliderSetting min; + public static SliderSetting max; + public static ButtonSetting weaponOnly; + public static ButtonSetting movingOnly; + public static ButtonSetting sprintOnly; + public static ButtonSetting hitThroughBlocks; + + public Reach() { + super("Reach", Module.category.combat, 0); + this.registerSetting(min = new SliderSetting("Min", 3.1D, 3.0D, 6.0D, 0.05D)); + this.registerSetting(max = new SliderSetting("Max", 3.3D, 3.0D, 6.0D, 0.05D)); + this.registerSetting(weaponOnly = new ButtonSetting("Weapon only", false)); + this.registerSetting(movingOnly = new ButtonSetting("Moving only", false)); + this.registerSetting(sprintOnly = new ButtonSetting("Sprint only", false)); + this.registerSetting(hitThroughBlocks = new ButtonSetting("Hit through blocks", false)); + this.closetModule = true; + } + + public void guiUpdate() { + Utils.correctValue(min, max); + } + + @SubscribeEvent + public void e(MouseEvent ev) { + if (ev.button >= 0 && ev.buttonstate && Utils.nullCheck() && (!ModuleManager.autoClicker.isEnabled() || !AutoClicker.leftClick.isToggled() || !Mouse.isButtonDown(0))) { + call(); + } + } + + public static boolean call() { + if (!Utils.nullCheck()) { + return false; + } else if (weaponOnly.isToggled() && !Utils.holdingWeapon()) { + return false; + } else if (movingOnly.isToggled() && (double) mc.thePlayer.moveForward == 0.0D && (double) mc.thePlayer.moveStrafing == 0.0D) { + return false; + } else if (sprintOnly.isToggled() && !mc.thePlayer.isSprinting()) { + return false; + } else { + if (!hitThroughBlocks.isToggled() && mc.objectMouseOver != null) { + BlockPos p = mc.objectMouseOver.getBlockPos(); + if (p != null && mc.theWorld.getBlockState(p).getBlock() != Blocks.air) { + return false; + } + } + + double r = Utils.getRandomValue(min, max, Utils.getRandom()); + Object[] o = getEntity(r, 0.0D); + if (o == null) { + return false; + } else { + Entity en = (Entity) o[0]; + mc.objectMouseOver = new MovingObjectPosition(en, (Vec3) o[1]); + mc.pointedEntity = en; + return true; + } + } + } + + private static Object[] getEntity(double reach, double expand) { + if (!ModuleManager.reach.isEnabled()) { + reach = mc.playerController.extendedReach() ? 6.0D : 3.0D; + } + return getEntity(reach, expand, null); + } + + public static Object[] getEntity(double reach, double expand, float[] rotations) { + Entity zz2 = mc.getRenderViewEntity(); + Entity entity = null; + if (zz2 == null) { + return null; + } else { + mc.mcProfiler.startSection("pick"); + Vec3 zz3 = zz2.getPositionEyes(1.0F); + Vec3 zz4; + if (rotations != null) { + zz4 = RotationUtils.getVectorForRotation(rotations[1], rotations[0]); + } + else { + zz4 = zz2.getLook(1.0F); + } + Vec3 zz5 = zz3.addVector(zz4.xCoord * reach, zz4.yCoord * reach, zz4.zCoord * reach); + Vec3 hitVec = null; + List zz8 = mc.theWorld.getEntitiesWithinAABBExcludingEntity(zz2, zz2.getEntityBoundingBox().addCoord(zz4.xCoord * reach, zz4.yCoord * reach, zz4.zCoord * reach).expand(1.0D, 1.0D, 1.0D)); + double zz9 = reach; + + for (int zz10 = 0; zz10 < zz8.size(); ++zz10) { + Entity zz11 = (Entity) zz8.get(zz10); + if (zz11.canBeCollidedWith()) { + float ex = (float) ((double) zz11.getCollisionBorderSize() * HitBox.getExpand(zz11)); + AxisAlignedBB zz13 = zz11.getEntityBoundingBox().expand(ex, ex, ex); + zz13 = zz13.expand(expand, expand, expand); + MovingObjectPosition zz14 = zz13.calculateIntercept(zz3, zz5); + if (zz13.isVecInside(zz3)) { + if (0.0D < zz9 || zz9 == 0.0D) { + entity = zz11; + hitVec = zz14 == null ? zz3 : zz14.hitVec; + zz9 = 0.0D; + } + } else if (zz14 != null) { + double zz15 = zz3.distanceTo(zz14.hitVec); + if (zz15 < zz9 || zz9 == 0.0D) { + if (zz11 == zz2.ridingEntity) { + if (zz9 == 0.0D) { + entity = zz11; + hitVec = zz14.hitVec; + } + } else { + entity = zz11; + hitVec = zz14.hitVec; + zz9 = zz15; + } + } + } + } + } + + if (zz9 < reach && !(entity instanceof EntityLivingBase) && !(entity instanceof EntityItemFrame)) { + entity = null; + } + + mc.mcProfiler.endSection(); + if (entity != null && hitVec != null) { + return new Object[]{entity, hitVec}; + } + else { + return null; + } + } + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/combat/Reduce.java b/src/main/java/keystrokesmod/module/impl/combat/Reduce.java new file mode 100644 index 0000000..d0e2253 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/combat/Reduce.java @@ -0,0 +1,33 @@ +package keystrokesmod.module.impl.combat; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import net.minecraft.entity.Entity; + +public class Reduce extends Module { + private static SliderSetting chance; + private static SliderSetting reduction; + + public Reduce() { + super("Reduce", category.combat); + this.registerSetting(new DescriptionSetting("Overrides KeepSprint.")); + this.registerSetting(reduction = new SliderSetting("Attack reduction %", 60.0, 60.0, 100.0, 0.5)); + this.registerSetting(chance = new SliderSetting("Chance", "%", 100.0, 0.0, 100.0, 1.0)); + this.closetModule = true; + } + + public static void reduce(Entity entity) { + if (chance.getInput() == 0) { + return; + } + if (chance.getInput() != 100.0 && Math.random() >= chance.getInput() / 100.0) { + mc.thePlayer.motionX *= 0.6; + mc.thePlayer.motionZ *= 0.6; + return; + } + double n = (100.0 - (float)reduction.getInput()) / 100.0; + mc.thePlayer.motionX *= n; + mc.thePlayer.motionZ *= n; + } +} diff --git a/src/main/java/keystrokesmod/module/impl/combat/RodAimbot.java b/src/main/java/keystrokesmod/module/impl/combat/RodAimbot.java new file mode 100644 index 0000000..0e5bb46 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/combat/RodAimbot.java @@ -0,0 +1,113 @@ +package keystrokesmod.module.impl.combat; + +import keystrokesmod.event.PreMotionEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.impl.world.AntiBot; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Reflection; +import keystrokesmod.utility.RotationUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemFishingRod; +import net.minecraftforge.client.event.MouseEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class RodAimbot extends Module { + private SliderSetting fov; + private SliderSetting predicatedTicks; + private SliderSetting distance; + private ButtonSetting aimInvis; + private ButtonSetting ignoreTeammates; + public boolean rotate; + private boolean rightClick; + private EntityPlayer entity; + + public RodAimbot() { + super("RodAimbot", Module.category.combat, 0); + this.registerSetting(fov = new SliderSetting("FOV", 180, 30, 360, 4)); + this.registerSetting(predicatedTicks = new SliderSetting("Predicted ticks", 5.0, 0.0, 20.0, 1.0)); + this.registerSetting(distance = new SliderSetting("Distance", 6, 3, 30, 0.5)); + this.registerSetting(aimInvis = new ButtonSetting("Aim invis", false)); + this.registerSetting(ignoreTeammates = new ButtonSetting("Ignore teammates", false)); + } + + public void onDisable() { + rotate = false; + rightClick = false; + entity = null; + } + + @SubscribeEvent + public void onMouse(final MouseEvent mouseEvent) { + if (mouseEvent.button != 1 || !mouseEvent.buttonstate || !Utils.nullCheck() || mc.currentScreen != null) { + return; + } + if (mc.thePlayer.getCurrentEquippedItem() == null || !(mc.thePlayer.getCurrentEquippedItem().getItem() instanceof ItemFishingRod) || mc.thePlayer.fishEntity != null) { + return; + } + entity = this.getEntity(); + if (entity == null) { + return; + } + mouseEvent.setCanceled(true); + rightClick = true; + rotate = true; + } + + @SubscribeEvent + public void onPreMotion(PreMotionEvent event) { + if (!Utils.nullCheck()) { + return; + } + if (rightClick || rotate) { + if (mc.thePlayer.getCurrentEquippedItem() == null || !(mc.thePlayer.getCurrentEquippedItem().getItem() instanceof ItemFishingRod)) { + return; + } + float[] rotations = RotationUtils.getRotationsPredicated(entity, (int)predicatedTicks.getInput()); + if (rotations == null) { + return; + } + event.setYaw(rotations[0]); + event.setPitch(rotations[1]); + if (!rightClick && rotate) { + rotate = false; + } + if (rightClick) { + Reflection.rightClick(); + rightClick = false; + } + } + } + + private EntityPlayer getEntity() { + for (final EntityPlayer entityPlayer : mc.theWorld.playerEntities) { + if (entityPlayer != mc.thePlayer) { + if (entityPlayer.deathTime != 0) { + continue; + } + if (!aimInvis.isToggled() && entityPlayer.isInvisible()) { + continue; + } + if (mc.thePlayer.getDistanceSqToEntity(entityPlayer) > distance.getInput() * distance.getInput()) { + continue; + } + if (Utils.isFriended(entityPlayer)) { + continue; + } + final float n = (float)fov.getInput(); + if (n != 360.0f && !Utils.inFov(n, entityPlayer)) { + continue; + } + if (AntiBot.isBot(entityPlayer)) { + continue; + } + if (ignoreTeammates.isToggled() && Utils.isTeamMate(entityPlayer)) { + continue; + } + return entityPlayer; + } + } + return null; + } +} diff --git a/src/main/java/keystrokesmod/module/impl/combat/TPAura.java b/src/main/java/keystrokesmod/module/impl/combat/TPAura.java new file mode 100644 index 0000000..aaebdea --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/combat/TPAura.java @@ -0,0 +1,66 @@ +package keystrokesmod.module.impl.combat; + +import keystrokesmod.module.Module; +import keystrokesmod.module.impl.world.AntiBot; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Utils; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.event.entity.living.LivingEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class TPAura extends Module { + private SliderSetting range; + private ButtonSetting weaponOnly; + private double x = 0; + private double z = 0; + private double y = 0; + public TPAura() { + super("TPAura", category.combat); + this.registerSetting(range = new SliderSetting("Range", 0, 0, 50, 1)); + this.registerSetting(weaponOnly = new ButtonSetting("Weapon only", false)); + } + + @SubscribeEvent + public void onLivingUpdate(LivingEvent.LivingUpdateEvent e) { + if (Utils.nullCheck() && mc.thePlayer.maxHurtTime > 0 && mc.thePlayer.hurtTime == mc.thePlayer.maxHurtTime) { + this.updatePosition(); + } + } + + private void updatePosition() { + this.x = Utils.randomizeInt(-15, 15) / 10.0; + this.y = Utils.randomizeInt(10, 15) / 10.0; + this.z = Utils.randomizeInt(-15, 15) / 10.0; + } + + @Override + public void onEnable() { + if (range.getInput() == 0.0) { + Utils.sendMessage("&cTPAura range values are set to 0."); + this.disable(); + return; + } + this.updatePosition(); + } + + public void onUpdate() { + if (weaponOnly.isToggled() && !Utils.holdingWeapon()) { + return; + } + double rangeSq = range.getInput() * range.getInput(); + for (EntityPlayer entityPlayer : mc.theWorld.playerEntities) { + if (entityPlayer != mc.thePlayer && entityPlayer.deathTime == 0) { + if (mc.thePlayer.getDistanceSqToEntity(entityPlayer) > rangeSq) { + continue; + } + if (AntiBot.isBot(entityPlayer) || Utils.isFriended(entityPlayer)) { + continue; + } + mc.thePlayer.setPosition(entityPlayer.posX + this.x, entityPlayer.posY + this.y, entityPlayer.posZ + this.z); + Utils.attackEntity(entityPlayer, true, false); + break; + } + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/combat/Velocity.java b/src/main/java/keystrokesmod/module/impl/combat/Velocity.java new file mode 100644 index 0000000..80fc23e --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/combat/Velocity.java @@ -0,0 +1,160 @@ +package keystrokesmod.module.impl.combat; + +import keystrokesmod.event.ReceivePacketEvent; +import keystrokesmod.event.SendPacketEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.movement.LongJump; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Utils; +import keystrokesmod.utility.ModuleUtils; +import net.minecraft.network.Packet; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.network.play.server.S27PacketExplosion; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import org.lwjgl.input.Keyboard; + +public class Velocity extends Module { + private SliderSetting velocityModes; + private SliderSetting horizontal; + private SliderSetting vertical; + private SliderSetting chance; + private ButtonSetting onlyWhileTargeting; + private ButtonSetting disableS; + private ButtonSetting zzWhileNotTargeting; + private ButtonSetting disableExplosions; + private ButtonSetting allowSelfFireball; + private boolean stopFBvelo; + public boolean disableVelo; + + private String[] velocityModesString = new String[] { "Normal", "Hypixel" }; + + + public Velocity() { + super("Velocity", category.combat); + this.registerSetting(velocityModes = new SliderSetting("Modes", 0, velocityModesString)); + this.registerSetting(horizontal = new SliderSetting("Horizontal", 0.0, 0.0, 100.0, 1.0)); + this.registerSetting(vertical = new SliderSetting("Vertical", 0.0, 0.0, 100.0, 1.0)); + this.registerSetting(chance = new SliderSetting("Chance", "%", 100.0D, 0.0D, 100.0D, 1.0D)); + this.registerSetting(onlyWhileTargeting = new ButtonSetting("Only while targeting", false)); + this.registerSetting(disableS = new ButtonSetting("Disable while holding S", false)); + this.registerSetting(zzWhileNotTargeting = new ButtonSetting("00 while not targeting", false)); + this.registerSetting(disableExplosions = new ButtonSetting("Disable explosions", false)); + this.registerSetting(allowSelfFireball = new ButtonSetting("Allow self fireball", false)); + } + + @SubscribeEvent + public void onReceivePacket(ReceivePacketEvent e) { + if (velocityModes.getInput() == 1) { + if (!Utils.nullCheck() || LongJump.stopVelocity || e.isCanceled()) { + return; + } + if (e.getPacket() instanceof S27PacketExplosion) { + Packet packet = e.getPacket(); + S27PacketExplosion s27PacketExplosion = (S27PacketExplosion) e.getPacket(); + S27PacketExplosion s27 = (S27PacketExplosion) packet; + + if (allowSelfFireball.isToggled() && ModuleUtils.threwFireball) { + if ((mc.thePlayer.getPosition().distanceSq(s27.getX(), s27.getY(), s27.getZ()) <= ModuleUtils.MAX_EXPLOSION_DIST_SQ) || disableVelo) { + disableVelo = true; + ModuleUtils.threwFireball = false; + e.setCanceled(false); + return; + } + } + if (!dontEditMotion() && !disableVelo && !disableExplosions.isToggled() && !ModuleManager.bedAura.cancelKnockback()) { + if (horizontal.getInput() == 0 && vertical.getInput() > 0) { + mc.thePlayer.motionY += s27PacketExplosion.func_149144_d() * vertical.getInput() / 100.0; + } else if (horizontal.getInput() > 0 && vertical.getInput() == 0) { + mc.thePlayer.motionX += s27PacketExplosion.func_149149_c() * horizontal.getInput() / 100.0; + mc.thePlayer.motionZ += s27PacketExplosion.func_149147_e() * horizontal.getInput() / 100.0; + } else if (horizontal.getInput() > 0 && vertical.getInput() > 0) { + mc.thePlayer.motionX += s27PacketExplosion.func_149149_c() * horizontal.getInput() / 100.0; + mc.thePlayer.motionY += s27PacketExplosion.func_149144_d() * vertical.getInput() / 100.0; + mc.thePlayer.motionZ += s27PacketExplosion.func_149147_e() * horizontal.getInput() / 100.0; + } + } + if (disableExplosions.isToggled()) stopFBvelo = true; + e.setCanceled(true); + disableVelo = false; + } + if (e.getPacket() instanceof S12PacketEntityVelocity) { + if (((S12PacketEntityVelocity) e.getPacket()).getEntityID() == mc.thePlayer.getEntityId()) { + S12PacketEntityVelocity s12PacketEntityVelocity = (S12PacketEntityVelocity) e.getPacket(); + + if (!dontEditMotion() && !disableVelo && !stopFBvelo && !ModuleManager.bedAura.cancelKnockback()) { + if (horizontal.getInput() == 0 && vertical.getInput() > 0) { + mc.thePlayer.motionY = ((double) s12PacketEntityVelocity.getMotionY() / 8000) * vertical.getInput() / 100.0; + } else if (horizontal.getInput() > 0 && vertical.getInput() == 0) { + mc.thePlayer.motionX = ((double) s12PacketEntityVelocity.getMotionX() / 8000) * horizontal.getInput() / 100.0; + mc.thePlayer.motionZ = ((double) s12PacketEntityVelocity.getMotionZ() / 8000) * horizontal.getInput() / 100.0; + } else if (horizontal.getInput() > 0 && vertical.getInput() > 0) { + mc.thePlayer.motionX = ((double) s12PacketEntityVelocity.getMotionX() / 8000) * horizontal.getInput() / 100.0; + mc.thePlayer.motionY = ((double) s12PacketEntityVelocity.getMotionY() / 8000) * vertical.getInput() / 100.0; + mc.thePlayer.motionZ = ((double) s12PacketEntityVelocity.getMotionZ() / 8000) * horizontal.getInput() / 100.0; + } + } + stopFBvelo = false; + if (!disableVelo) { + e.setCanceled(true); + } + } + } + } + } + + @Override + public String getInfo() { + return (int) horizontal.getInput() + "%" + " " + (int) vertical.getInput() + "%"; + } + + @Override + public int getInfoType() { + return 1; + } + + @SubscribeEvent + public void onLivingUpdate(LivingUpdateEvent ev) { + if (velocityModes.getInput() == 0) { + if (Utils.nullCheck() && !LongJump.stopVelocity && !ModuleManager.bedAura.cancelKnockback()) { + if (mc.thePlayer.maxHurtTime <= 0 || mc.thePlayer.hurtTime != mc.thePlayer.maxHurtTime) { + return; + } + if (onlyWhileTargeting.isToggled() && (mc.objectMouseOver == null || mc.objectMouseOver.entityHit == null)) { + return; + } + if (disableS.isToggled() && Keyboard.isKeyDown(mc.gameSettings.keyBindBack.getKeyCode())) { + return; + } + if (chance.getInput() == 0) { + return; + } + if (chance.getInput() != 100) { + double ch = Math.random(); + if (ch >= chance.getInput() / 100.0D) { + return; + } + } + if (horizontal.getInput() != 100.0D) { + mc.thePlayer.motionX *= horizontal.getInput() / 100; + mc.thePlayer.motionZ *= horizontal.getInput() / 100; + } + if (vertical.getInput() != 100.0D) { + mc.thePlayer.motionY *= vertical.getInput() / 100; + } + } + } + } + + private boolean dontEditMotion() { + if (zzWhileNotTargeting.isToggled() && !ModuleManager.killAura.isTargeting) { + return true; + } + + return false; + } + +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/combat/WTap.java b/src/main/java/keystrokesmod/module/impl/combat/WTap.java new file mode 100644 index 0000000..a2bfd6b --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/combat/WTap.java @@ -0,0 +1,68 @@ +package keystrokesmod.module.impl.combat; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Utils; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.event.entity.player.AttackEntityEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.HashMap; + +public class WTap extends Module { + private SliderSetting chance; + private ButtonSetting playersOnly; + private final HashMap targets = new HashMap<>(); + public static boolean stopSprint = false; + public WTap() { + super("WTap", category.combat); + this.registerSetting(chance = new SliderSetting("Chance", "%", 100, 0, 100, 1)); + this.registerSetting(playersOnly = new ButtonSetting("Players only", true)); + this.closetModule = true; + } + + @SubscribeEvent + public void onAttack(AttackEntityEvent event) { + if (!Utils.nullCheck() || event.entityPlayer != mc.thePlayer || !mc.thePlayer.isSprinting()) { + return; + } + if (chance.getInput() == 0) { + return; + } + if (playersOnly.isToggled()) { + if (!(event.target instanceof EntityPlayer)) { + return; + } + final EntityPlayer entityPlayer = (EntityPlayer)event.target; + if (entityPlayer.maxHurtTime == 0 || entityPlayer.hurtTime > 3) { + return; + } + } + else if (!(event.target instanceof EntityLivingBase)) { + return; + } + if (((EntityLivingBase)event.target).deathTime != 0) { + return; + } + final long currentTimeMillis = System.currentTimeMillis(); + final Long n = this.targets.get(event.target.getEntityId()); + if (n != null && Utils.timeBetween(n, currentTimeMillis) <= 200L) { + return; + } + if (chance.getInput() != 100.0D) { + double ch = Math.random(); + if (ch >= chance.getInput() / 100.0D) { + return; + } + } + this.targets.put(event.target.getEntityId(), currentTimeMillis); + stopSprint = true; + } + + public void onDisable() { + stopSprint = false; + this.targets.clear(); + } +} diff --git a/src/main/java/keystrokesmod/module/impl/fun/Fun.java b/src/main/java/keystrokesmod/module/impl/fun/Fun.java new file mode 100644 index 0000000..c1b952f --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/fun/Fun.java @@ -0,0 +1,176 @@ +package keystrokesmod.module.impl.fun; + +import keystrokesmod.module.Module; +import keystrokesmod.module.impl.world.AntiBot; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Utils; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.Vec3; + +import java.util.Iterator; + +public class Fun { + public static class Spin extends Module { + public SliderSetting rotation; + public SliderSetting speed; + private float yaw; + + public Spin() { + super("Spin", category.fun, 0); + this.registerSetting(rotation = new SliderSetting("Rotation", 360.0D, 30.0D, 360.0D, 1.0D)); + this.registerSetting(speed = new SliderSetting("Speed", 25.0D, 1.0D, 60.0D, 1.0D)); + } + + public void onEnable() { + this.yaw = mc.thePlayer.rotationYaw; + } + + public void onDisable() { + this.yaw = 0.0F; + } + + public void onUpdate() { + double left = (double) this.yaw + rotation.getInput() - (double) mc.thePlayer.rotationYaw; + EntityPlayerSP var10000; + if (left < speed.getInput()) { + var10000 = mc.thePlayer; + var10000.rotationYaw = (float) ((double) var10000.rotationYaw + left); + this.disable(); + } else { + var10000 = mc.thePlayer; + var10000.rotationYaw = (float) ((double) var10000.rotationYaw + speed.getInput()); + if ((double) mc.thePlayer.rotationYaw >= (double) this.yaw + rotation.getInput()) { + this.disable(); + } + } + + } + } + + public static class SlyPort extends Module { + public SliderSetting range; + public ButtonSetting playSound; + public ButtonSetting playersOnly; + public ButtonSetting aim; + + public SlyPort() { + super("SlyPort", Module.category.fun, 0); + this.registerSetting(new DescriptionSetting("Teleport behind enemies.")); + this.registerSetting(range = new SliderSetting("Range", 6.0D, 2.0D, 15.0D, 1.0D)); + this.registerSetting(aim = new ButtonSetting("Aim", true)); + this.registerSetting(playSound = new ButtonSetting("Play sound", true)); + this.registerSetting(playersOnly = new ButtonSetting("Players only", true)); + } + + public void onEnable() { + Entity en = this.ge(); + if (en != null) { + this.tp(en); + } + + this.disable(); + } + + private void tp(Entity en) { + if (playSound.isToggled()) { + mc.thePlayer.playSound("mob.endermen.portal", 1.0F, 1.0F); + } + + Vec3 vec = en.getLookVec(); + double x = en.posX - vec.xCoord * 2.5D; + double z = en.posZ - vec.zCoord * 2.5D; + mc.thePlayer.setPosition(x, mc.thePlayer.posY, z); + if (aim.isToggled()) { + Utils.aim(en, 0.0F, false); + } + + } + + private Entity ge() { + Entity en = null; + double r = Math.pow(this.range.getInput(), 2.0D); + double dist = r + 1.0D; + Iterator var6 = mc.theWorld.loadedEntityList.iterator(); + + while (true) { + Entity ent; + do { + do { + do { + do { + if (!var6.hasNext()) { + return en; + } + + ent = (Entity) var6.next(); + } while (ent == mc.thePlayer); + } while (!(ent instanceof EntityLivingBase)); + } while (((EntityLivingBase) ent).deathTime != 0); + } while (this.playersOnly.isToggled() && !(ent instanceof EntityPlayer)); + + if (!AntiBot.isBot(ent)) { + double d = mc.thePlayer.getDistanceSqToEntity(ent); + if (!(d > r) && !(dist < d)) { + dist = d; + en = ent; + } + } + } + } + } + + public static class FlameTrail extends Module { + public SliderSetting a; + + public FlameTrail() { + super("Flame Trail", category.fun, 0); + } + + public void onUpdate() { + Vec3 vec = mc.thePlayer.getLookVec(); + double x = mc.thePlayer.posX - vec.xCoord * 2.0D; + double y = mc.thePlayer.posY + ((double) mc.thePlayer.getEyeHeight() - 0.2D); + double z = mc.thePlayer.posZ - vec.zCoord * 2.0D; + mc.thePlayer.worldObj.spawnParticle(EnumParticleTypes.FLAME, x, y, z, 0.0D, 0.0D, 0.0D, new int[]{0}); + } + } + + public static class ExtraBobbing extends Module { + public SliderSetting level; + private boolean b; + + public ExtraBobbing() { + super("Extra Bobbing", category.fun, 0); + this.registerSetting(level = new SliderSetting("Level", 1.0D, 0.0D, 8.0D, 0.1D)); + } + + public void onEnable() { + this.b = mc.gameSettings.viewBobbing; + if (!this.b) { + mc.gameSettings.viewBobbing = true; + } + + } + + public void onDisable() { + mc.gameSettings.viewBobbing = this.b; + } + + public void onUpdate() { + if (!mc.gameSettings.viewBobbing) { + mc.gameSettings.viewBobbing = true; + } + + if (mc.thePlayer.movementInput.moveForward != 0.0F || mc.thePlayer.movementInput.moveStrafe != 0.0F) { + EntityPlayerSP var10000 = mc.thePlayer; + var10000.cameraYaw = (float) ((double) var10000.cameraYaw + level.getInput() / 2.0D); + } + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/minigames/AutoRequeue.java b/src/main/java/keystrokesmod/module/impl/minigames/AutoRequeue.java new file mode 100644 index 0000000..82f641a --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/minigames/AutoRequeue.java @@ -0,0 +1,56 @@ +package keystrokesmod.module.impl.minigames; + +import keystrokesmod.event.PreUpdateEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Utils; +import net.minecraft.util.IChatComponent; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class AutoRequeue extends Module { + private SliderSetting delay; + private String receivedMessage = ""; + private long receiveTime = 0; + public AutoRequeue() { + super("AutoRequeue", category.minigames); + this.registerSetting(new DescriptionSetting("Automatically requeues games.")); + this.registerSetting(delay = new SliderSetting("Delay", " second", 0.5, 0, 5, 0.1)); + this.closetModule = true; + } + + @Override + public void onDisable() { + receivedMessage = ""; + } + + @SubscribeEvent + public void onPreUpdate(PreUpdateEvent e) { + if (!receivedMessage.isEmpty() && System.currentTimeMillis() - receiveTime >= delay.getInput() * 1000) { + mc.thePlayer.sendChatMessage(receivedMessage); + receivedMessage = ""; + } + } + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent e) { + if (e.type == 2 || !Utils.nullCheck()) { + return; + } + String stripped = Utils.stripColor(e.message.getUnformattedText()); + if (stripped.isEmpty() || !stripped.contains("play again")) { + return; + } + if (e.message != null) { + for (IChatComponent component : e.message.getSiblings()) { + if (component != null && component.getFormattedText().contains("Click here")) { + if (component.getChatStyle() != null && component.getChatStyle().getChatClickEvent() != null && component.getChatStyle().getChatClickEvent().getValue().startsWith("/")) { + this.receivedMessage = component.getChatStyle().getChatClickEvent().getValue(); + this.receiveTime = System.currentTimeMillis(); + } + } + } + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/minigames/AutoWho.java b/src/main/java/keystrokesmod/module/impl/minigames/AutoWho.java new file mode 100644 index 0000000..be5852b --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/minigames/AutoWho.java @@ -0,0 +1,68 @@ +package keystrokesmod.module.impl.minigames; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.utility.Utils; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class AutoWho extends Module { + private ButtonSetting artifical; + private ButtonSetting hideMessage; + private ButtonSetting removeBots; + private ButtonSetting onGameStart; + + public AutoWho() { + super("AutoWho", category.minigames); + this.registerSetting(new DescriptionSetting("Automatically execute /who.")); + this.registerSetting(new DescriptionSetting(Utils.formatColor("Use '&enick [nick]&r' when nicked."))); + this.registerSetting(artifical = new ButtonSetting("Artificial", false)); + this.registerSetting(hideMessage = new ButtonSetting("Hide message", false)); + this.registerSetting(removeBots = new ButtonSetting("Remove bots", true)); + this.registerSetting(onGameStart = new ButtonSetting("On game start", false)); + } + + @SubscribeEvent + public void onChatReceive(ClientChatReceivedEvent e) { + if (e.type == 2 || !Utils.nullCheck()) { + return; + } + final String r = Utils.stripColor(e.message.getUnformattedText()); + if (r.isEmpty()) { + return; + } + if (!onGameStart.isToggled() && (r.replace("!", "").trim().startsWith(Utils.getServerName()) && ((r.contains("(") && r.contains(")")) || r.contains("/"))) || onGameStart.isToggled() && r.contains("Protect your bed and destroy the enemy beds.")) { + this.artificial(); + } + else if (hideMessage.isToggled() && r.startsWith("ONLINE: ")) { + e.setCanceled(true); + Utils.log.info("[CHAT] " + r); + } + } + + private void artificial() { + if (artifical.isToggled()) { + String online = hideMessage.isToggled() ? "ONLINE: " : "&b&lONLINE: &r"; + for (NetworkPlayerInfo networkPlayerInfo : Utils.getTablist(true)) { + if (removeBots.isToggled() && networkPlayerInfo.getResponseTime() > 1) { + continue; + } + if (hideMessage.isToggled()) { + online = online + networkPlayerInfo.getGameProfile().getName() + ", "; + } else { + online = online + ScorePlayerTeam.formatPlayerName(networkPlayerInfo.getPlayerTeam(), networkPlayerInfo.getGameProfile().getName()) + "�" + "7, "; + } + } + if (hideMessage.isToggled()) { + Utils.log.info("[CHAT] " + (online + mc.thePlayer.getName())); + return; + } + Utils.sendRawMessage(online + mc.thePlayer.getDisplayName().getFormattedText()); + } else { + mc.thePlayer.sendChatMessage("/who"); + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/minigames/BedWars.java b/src/main/java/keystrokesmod/module/impl/minigames/BedWars.java new file mode 100644 index 0000000..8d355df --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/minigames/BedWars.java @@ -0,0 +1,190 @@ +package keystrokesmod.module.impl.minigames; + +import keystrokesmod.module.Module; +import keystrokesmod.module.impl.world.AntiBot; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.block.BlockObsidian; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemEnderPearl; +import net.minecraft.item.ItemFireball; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.awt.*; +import java.util.*; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; + +public class BedWars extends Module { + public static ButtonSetting whitelistOwnBed; + private ButtonSetting diamondArmor; + private ButtonSetting fireball; + private ButtonSetting enderPearl; + private ButtonSetting obsidian; + private ButtonSetting shouldPing; + private BlockPos spawnPos; + private boolean check; + public static boolean outsideSpawn = true; + private List armoredPlayer = new ArrayList<>(); + private Map lastHeldMap = new ConcurrentHashMap<>(); + private Set obsidianPos = new HashSet<>(); + private int obsidianColor = new Color(0, 0,0).getRGB(); + + public BedWars() { + super("Bed Wars", category.minigames); + this.registerSetting(whitelistOwnBed = new ButtonSetting("Whitelist own bed", true)); + this.registerSetting(new DescriptionSetting("Game alerts")); + this.registerSetting(diamondArmor = new ButtonSetting("Diamond armor", true)); + this.registerSetting(fireball = new ButtonSetting("Fireball", false)); + this.registerSetting(obsidian = new ButtonSetting("Obsidian", true)); + this.registerSetting(enderPearl = new ButtonSetting("Ender pearl", true)); + this.registerSetting(shouldPing = new ButtonSetting("Should ping", true)); + this.closetModule = true; + } + + public void onEnable() { + check = false; + outsideSpawn = true; + } + + public void onDisable() { + outsideSpawn = true; + } + + @SubscribeEvent + public void onRenderWorld(RenderWorldLastEvent e) { + if (Utils.nullCheck()) { + if (this.obsidianPos.isEmpty()) { + return; + } + try { + Iterator iterator = this.obsidianPos.iterator(); + while (iterator.hasNext()) { + BlockPos blockPos = iterator.next(); + if (!(mc.theWorld.getBlockState(blockPos).getBlock() instanceof BlockObsidian)) { + iterator.remove(); + continue; + } + RenderUtils.renderBlock(blockPos, obsidianColor, false, true); + } + } + catch (Exception exception) {} + } + } + + @SubscribeEvent + public void onEntityJoinWorld(EntityJoinWorldEvent e) { + if (!Utils.nullCheck() || e.entity == null) { + return; + } + if (e.entity == mc.thePlayer) { + armoredPlayer.clear(); + lastHeldMap.clear(); + obsidianPos.clear(); + } + } + + public void onUpdate() { + if (Utils.getBedwarsStatus() == 2) { + if (diamondArmor.isToggled() || enderPearl.isToggled() || obsidian.isToggled()) { + for (EntityPlayer p : mc.theWorld.playerEntities) { + if (p == null) { + continue; + } + if (p == mc.thePlayer) { + continue; + } + if (AntiBot.isBot(p)) { + continue; + } + String name = p.getName(); + ItemStack item = p.getHeldItem(); + if (diamondArmor.isToggled()) { + ItemStack leggings = p.inventory.armorInventory[1]; + if (!armoredPlayer.contains(name) && p.inventory != null && leggings != null && leggings.getItem() != null && leggings.getItem() == Items.diamond_leggings) { + armoredPlayer.add(name); + Utils.sendMessage("&eAlert: &r" + p.getDisplayName().getFormattedText() + " &7has purchased &bDiamond Armor"); + ping(); + } + } + if (item != null && !lastHeldMap.containsKey(name)) { + String itemType = getItemType(item); + if (itemType != null) { + lastHeldMap.put(name, itemType); + double distance = Math.round(mc.thePlayer.getDistanceToEntity(p)); + handleAlert(itemType, p.getDisplayName().getFormattedText(), Utils.isWholeNumber(distance) ? (int) distance + "" : String.valueOf(distance)); + } + } else if (lastHeldMap.containsKey(name)) { + String itemType = lastHeldMap.get(name); + if (!itemType.equals(getItemType(item))) { + lastHeldMap.remove(name); + } + } + } + } + if (whitelistOwnBed.isToggled()) { + if (check) { + spawnPos = mc.thePlayer.getPosition(); + check = false; + } + if (spawnPos == null) { + outsideSpawn = true; + } + else { + outsideSpawn = mc.thePlayer.getDistanceSq(spawnPos) > 800; + } + } + else { + outsideSpawn = true; + } + } + } + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent c) { + if (!Utils.nullCheck()) { + return; + } + String strippedMessage = Utils.stripColor(c.message.getUnformattedText()); + if (strippedMessage.startsWith(" ") && strippedMessage.contains("Protect your bed and destroy the enemy beds.")) { + check = true; + } + } + + private String getItemType(ItemStack item) { + if (item == null || item.getItem() == null) { + return null; + } + String unlocalizedName = item.getItem().getUnlocalizedName(); + if (item.getItem() instanceof ItemEnderPearl && enderPearl.isToggled()) { + return "&7an §3Ender Pearl"; + } + else if (unlocalizedName.contains("tile.obsidian") && obsidian.isToggled()) { + return "§dObsidian"; + } + else if (item.getItem() instanceof ItemFireball && fireball.isToggled()) { + return "&7a §6Fireball"; + } + return null; + } + + private void handleAlert(String itemType, String name, String info) { + String alert = "&eAlert: &r" + name + " &7is holding " + itemType + " &7(" + "§d" + info + "m" + "&7)"; + Utils.sendMessage(alert); + ping(); + } + + private void ping() { + if (shouldPing.isToggled()) { + mc.thePlayer.playSound("note.pling", 1.0f, 1.0f); + } + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/minigames/BridgeInfo.java b/src/main/java/keystrokesmod/module/impl/minigames/BridgeInfo.java new file mode 100644 index 0000000..04c7957 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/minigames/BridgeInfo.java @@ -0,0 +1,276 @@ +package keystrokesmod.module.impl.minigames; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.fml.client.config.GuiButtonExt; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; +import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; + +import java.awt.*; +import java.io.IOException; +import java.util.Iterator; + +public class BridgeInfo extends Module { + private static final int rgb = (new Color(0, 200, 200)).getRGB(); + private final String bd = new String("the brid"); + private final String g1t = new String("Defend!"); + private final String g2t = new String("Jump in to score!"); + private final String qt = new String("First player to score 5 goals wins"); + private final String t1 = new String("Enemy: "); + private final String t2 = new String("Distance to goal: "); + private final String t3 = new String("Enemy distance to goal: "); + private final String t4 = new String("Blocks: "); + private static int hudX = 5; + private static int hudY = 70; + private String en = ""; + private BlockPos g1p = null; + private BlockPos g2p = null; + private boolean q = false; + private double d1 = 0.0D; + private double d2 = 0.0D; + private int blc = 0; + + public BridgeInfo() { + super("Bridge Info", Module.category.minigames, 0); + this.registerSetting(new DescriptionSetting(new String("Only for solos."))); + this.registerSetting(new ButtonSetting("Edit position", () -> { + mc.displayGuiScreen(new BridgeInfo.eh()); + })); + } + + public void onDisable() { + this.reset(); + } + + public void onUpdate() { + if (!this.en.isEmpty() && this.isBridge()) { + EntityPlayer enem = null; + Iterator var2 = mc.theWorld.loadedEntityList.iterator(); + + while (var2.hasNext()) { + Entity e = (Entity) var2.next(); + if (e instanceof EntityPlayer) { + if (e.getName().equals(this.en)) { + enem = (EntityPlayer) e; + } + } else if (e instanceof EntityArmorStand) { + if (e.getName().contains(this.g1t)) { + this.g1p = e.getPosition(); + } else if (e.getName().contains(this.g2t)) { + this.g2p = e.getPosition(); + } + } + } + + if (this.g1p != null && this.g2p != null) { + this.d1 = Utils.round(mc.thePlayer.getDistance((double) this.g2p.getX(), (double) this.g2p.getY(), (double) this.g2p.getZ()) - 1.4D, 1); + if (this.d1 < 0.0D) { + this.d1 = 0.0D; + } + + this.d2 = enem == null ? 0.0D : Utils.round(enem.getDistance((double) this.g1p.getX(), (double) this.g1p.getY(), (double) this.g1p.getZ()) - 1.4D, 1); + if (this.d2 < 0.0D) { + this.d2 = 0.0D; + } + } + + int blc2 = 0; + + for (int i = 0; i < 9; ++i) { + ItemStack stack = mc.thePlayer.inventory.getStackInSlot(i); + if (stack != null && stack.getItem() instanceof ItemBlock && ((ItemBlock) stack.getItem()).block.equals(Blocks.stained_hardened_clay)) { + blc2 += stack.stackSize; + } + } + + this.blc = blc2; + } + } + + @SubscribeEvent + public void a(RenderTickEvent ev) { + if (ev.phase == Phase.END && Utils.nullCheck() && this.isBridge()) { + if (mc.currentScreen != null || mc.gameSettings.showDebugInfo) { + return; + } + + mc.fontRendererObj.drawString(this.t1 + this.en, (float) hudX, (float) hudY, rgb, true); + mc.fontRendererObj.drawString(this.t2 + this.d1, (float) hudX, (float) (hudY + 11), rgb, true); + mc.fontRendererObj.drawString(this.t3 + this.d2, (float) hudX, (float) (hudY + 22), rgb, true); + mc.fontRendererObj.drawString(this.t4 + this.blc, (float) hudX, (float) (hudY + 33), rgb, true); + } + + } + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent c) { + if (Utils.nullCheck()) { + String s = Utils.stripColor(c.message.getUnformattedText()); + if (s.startsWith(" ")) { + if (s.contains(this.qt)) { + this.q = true; + } else if (this.q && s.contains("Opponent:")) { + String n = s.split(":")[1].trim(); + if (n.contains("[")) { + n = n.split("] ")[1]; + } + + this.en = n; + this.q = false; + } + } + } + + } + + @SubscribeEvent + public void w(EntityJoinWorldEvent j) { + if (j.entity == mc.thePlayer) { + this.reset(); + } + + } + + private boolean isBridge() { + if (Utils.isHypixel()) { + Iterator var1 = Utils.gsl().iterator(); + + while (var1.hasNext()) { + String s = (String) var1.next(); + String s2 = s.toLowerCase(); + if (s2.contains("mode") && s2.contains(this.bd)) { + return true; + } + } + } + + return false; + } + + private void reset() { + this.en = ""; + this.q = false; + this.g1p = null; + this.g2p = null; + this.d1 = 0.0D; + this.d2 = 0.0D; + this.blc = 0; + } + + static class eh extends GuiScreen { + final String a = new String("Enemy: Player123-Distance to goal: 17.2-Enemy distance to goal: 16.3-Blocks: 98"); + GuiButtonExt rp; + boolean d = false; + int miX = 0; + int miY = 0; + int maX = 0; + int maY = 0; + int aX = 5; + int aY = 70; + int laX = 0; + int laY = 0; + int lmX = 0; + int lmY = 0; + + public void initGui() { + super.initGui(); + this.buttonList.add(this.rp = new GuiButtonExt(1, this.width - 90, 5, 85, 20, new String("Reset position"))); + this.aX = BridgeInfo.hudX; + this.aY = BridgeInfo.hudY; + } + + public void drawScreen(int mX, int mY, float pt) { + drawRect(0, 0, this.width, this.height, -1308622848); + int miX = this.aX; + int miY = this.aY; + int maX = miX + 140; + int maY = miY + 41; + this.d(this.mc.fontRendererObj, this.a); + this.miX = miX; + this.miY = miY; + this.maX = maX; + this.maY = maY; + BridgeInfo.hudX = miX; + BridgeInfo.hudY = miY; + ScaledResolution res = new ScaledResolution(this.mc); + int x = res.getScaledWidth() / 2 - 84; + int y = res.getScaledHeight() / 2 - 20; + RenderUtils.drawColoredString("Edit the HUD position by dragging.", '-', x, y, 2L, 0L, true, this.mc.fontRendererObj); + + try { + this.handleInput(); + } catch (IOException var12) { + } + + super.drawScreen(mX, mY, pt); + } + + private void d(FontRenderer fr, String t) { + int x = this.miX; + int y = this.miY; + String[] var5 = t.split("-"); + int var6 = var5.length; + + for (int var7 = 0; var7 < var6; ++var7) { + String s = var5[var7]; + fr.drawString(s, (float) x, (float) y, BridgeInfo.rgb, true); + y += fr.FONT_HEIGHT + 2; + } + + } + + protected void mouseClickMove(int mX, int mY, int b, long t) { + super.mouseClickMove(mX, mY, b, t); + if (b == 0) { + if (this.d) { + this.aX = this.laX + (mX - this.lmX); + this.aY = this.laY + (mY - this.lmY); + } else if (mX > this.miX && mX < this.maX && mY > this.miY && mY < this.maY) { + this.d = true; + this.lmX = mX; + this.lmY = mY; + this.laX = this.aX; + this.laY = this.aY; + } + + } + } + + protected void mouseReleased(int mX, int mY, int s) { + super.mouseReleased(mX, mY, s); + if (s == 0) { + this.d = false; + } + + } + + public void actionPerformed(GuiButton b) { + if (b == this.rp) { + this.aX = BridgeInfo.hudX = 5; + this.aY = BridgeInfo.hudY = 70; + } + + } + + public boolean doesGuiPauseGame() { + return false; + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/minigames/DuelsStats.java b/src/main/java/keystrokesmod/module/impl/minigames/DuelsStats.java new file mode 100644 index 0000000..b5ced32 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/minigames/DuelsStats.java @@ -0,0 +1,226 @@ +package keystrokesmod.module.impl.minigames; + +import keystrokesmod.Raven; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.ProfileUtils; +import keystrokesmod.utility.NetworkUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.ArrayList; +import java.util.List; + +public class DuelsStats extends Module { + public static SliderSetting mode; + public static ButtonSetting a; + public static ButtonSetting threatLevel; + public static String nick = ""; + private String ign = ""; + private String en = ""; + private static final String[] thr_lvl = new String[]{"§4VERY HIGH", "§cHIGH", "§6MODERATE", "§aLOW", "§2VERY LOW"}; + private List q = new ArrayList(); + + public DuelsStats() { + super("Duels Stats", Module.category.minigames, 0); + this.registerSetting(mode = new SliderSetting("Mode", 0, thr_lvl)); + this.registerSetting(a = new ButtonSetting("Send ign on join", false)); + this.registerSetting(threatLevel = new ButtonSetting("Threat Level", true)); + } + + public void onEnable() { + if (mc.thePlayer != null) { + this.ign = mc.thePlayer.getName(); + } + else { + this.disable(); + } + } + + public void onDisable() { + this.en = ""; + this.q.clear(); + } + + public void onUpdate() { + if (this.id() && this.en.isEmpty()) { + List pl = mc.theWorld.playerEntities; + pl.remove(mc.thePlayer); + + for (EntityPlayer p : pl) { + String n = p.getName(); + if (!n.equals(this.ign) && !n.equals(nick) && !this.q.contains(n) && p.getDisplayName().getUnformattedText().contains("§k")) { + this.ef(n); + break; + } + } + } + + } + + @SubscribeEvent + public void onMessageReceived(ClientChatReceivedEvent c) { + if (Utils.nullCheck() && this.id()) { + String s = Utils.stripColor(c.message.getUnformattedText()); + if (s.contains(" ")) { + String[] sp = s.split(" "); + String n; + if (sp.length == 4 && sp[1].equals("has") && sp[2].equals("joined") && sp[3].equals("(2/2)!")) { + n = sp[0]; + if (!n.equals(this.ign) && !n.equals(nick) && this.en.isEmpty()) { + this.q.remove(n); + this.ef(n); + } + } else if (sp.length == 3 && sp[1].equals("has") && sp[2].equals("quit!")) { + n = sp[0]; + if (this.en.equals(n)) { + this.en = ""; + } + + this.q.add(n); + } + } + + } + } + + @SubscribeEvent + public void onEntityJoin(EntityJoinWorldEvent j) { + if (j.entity == mc.thePlayer) { + this.en = ""; + this.q.clear(); + } + + } + + private void ef(String n) { + this.en = n; + if (a.isToggled()) { + Utils.sendMessage("&eOpponent found: " + "&3" + n); + } + + if (NetworkUtils.API_KEY.isEmpty()) { + Utils.sendMessage("&cAPI Key is empty!"); + } else { + ProfileUtils.DM dm = ProfileUtils.DM.values()[(int) (mode.getInput() - 1.0D)]; + Raven.getExecutor().execute(() -> { + int[] s = ProfileUtils.getHypixelStats(n, dm); + if (s != null) { + if (s[0] == -1) { + Utils.sendMessage("&3" + n + " " + "&eis nicked!"); + return; + } + + double wlr = s[1] != 0 ? Utils.round((double) s[0] / (double) s[1], 2) : (double) s[0]; + Utils.sendMessage("&7&m-------------------------"); + if (dm != ProfileUtils.DM.OVERALL) { + Utils.sendMessage("&eMode: &3" + dm.name()); + } + + Utils.sendMessage("&eOpponent: &3" + n); + Utils.sendMessage("&eWins: &3" + s[0]); + Utils.sendMessage("&eLosses: &3" + s[1]); + Utils.sendMessage("&eWLR: &3" + wlr); + Utils.sendMessage("&eWS: &3" + s[2]); + if (threatLevel.isToggled()) { + Utils.sendMessage("&eThreat: &3" + gtl(s[0], s[1], wlr, s[2])); + } + + Utils.sendMessage("&7&m-------------------------"); + } else { + Utils.sendMessage("&cThere was an error."); + } + + }); + } + } + + private boolean id() { + if (Utils.isHypixel()) { + int l = 0; + + for (String s : Utils.gsl()) { + if (s.contains("Map:")) { + ++l; + } else if (s.contains("Players:") && s.contains("/2")) { + ++l; + } + } + + return l == 2; + } else { + return false; + } + } + + public static String gtl(int w, int l, double wlr, int ws) { + int t = 0; + int m = w + l; + if (m <= 13) { + t += 2; + } + + if (ws >= 30) { + t += 9; + } else if (ws >= 15) { + t += 7; + } else if (ws >= 8) { + t += 5; + } else if (ws >= 4) { + t += 3; + } else if (ws >= 1) { + ++t; + } + + if (wlr >= 20.0D) { + t += 8; + } else if (wlr >= 10.0D) { + t += 5; + } else if (wlr >= 5.0D) { + t += 4; + } else if (wlr >= 3.0D) { + t += 2; + } else if (wlr >= 0.8D) { + ++t; + } + + if (w >= 20000) { + t += 4; + } else if (w >= 10000) { + t += 3; + } else if (w >= 5000) { + t += 2; + } else if (w >= 1000) { + ++t; + } + + if (l == 0) { + if (w == 0) { + t += 3; + } else { + t += 4; + } + } else if (l <= 10 && wlr >= 4.0D) { + t += 2; + } + + String thr; + if (t == 0) { + thr = thr_lvl[4]; + } else if (t <= 3) { + thr = thr_lvl[3]; + } else if (t <= 6) { + thr = thr_lvl[2]; + } else if (t <= 10) { + thr = thr_lvl[1]; + } else { + thr = thr_lvl[0]; + } + + return thr; + } +} diff --git a/src/main/java/keystrokesmod/module/impl/minigames/MurderMystery.java b/src/main/java/keystrokesmod/module/impl/minigames/MurderMystery.java new file mode 100644 index 0000000..4e83e06 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/minigames/MurderMystery.java @@ -0,0 +1,200 @@ +package keystrokesmod.module.impl.minigames; + +import keystrokesmod.module.Module; +import keystrokesmod.module.impl.world.AntiBot; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemBow; +import net.minecraft.item.ItemSword; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.util.*; +import java.util.List; + +public class MurderMystery extends Module { + private ButtonSetting alert; + private ButtonSetting highlightMurderer; + private ButtonSetting highlightBow; + private ButtonSetting highlightInnocent; + private ButtonSetting highlightDead; + private ButtonSetting goldEsp; + private final List murderers = new ArrayList(); + private final List hasBow = new ArrayList(); + private boolean override; + + public MurderMystery() { + super("Murder Mystery", category.minigames); + this.registerSetting(alert = new ButtonSetting("Alert murderer", true)); + this.registerSetting(highlightMurderer = new ButtonSetting("Highlight murderer", true)); + this.registerSetting(highlightBow = new ButtonSetting("Highlight bow", true)); + this.registerSetting(highlightInnocent = new ButtonSetting("Highlight innocent", true)); + this.registerSetting(highlightDead = new ButtonSetting("Highlight dead", true)); + this.registerSetting(goldEsp = new ButtonSetting("Gold ESP", true)); + } + + public void onDisable() { + this.clear(); + } + + @SubscribeEvent + public void onRenderWordLast(RenderWorldLastEvent e) { + if (Utils.nullCheck()) { + if (!this.isMurderMystery()) { + this.clear(); + } + else { + override = false; + for (EntityPlayer en : mc.theWorld.playerEntities) { + if (en != mc.thePlayer && !en.isInvisible()) { + if (AntiBot.isBot(en) && !highlightDead.isToggled()) { + continue; + } + if (en.getHeldItem() != null && en.getHeldItem().hasDisplayName()) { + Item heldItem = en.getHeldItem().getItem(); + if (heldItem instanceof ItemSword || heldItem instanceof ItemAxe || en.getHeldItem().getDisplayName().contains("aKnife")) { + if (!murderers.contains(en)) { + murderers.add(en); + if (alert.isToggled()) { + mc.thePlayer.playSound("note.pling", 1.0F, 1.0F); + Utils.sendMessage("&eAlert: &b" + en.getName() + " &7is the &cmurderer&7! (&d" + (int) mc.thePlayer.getDistanceToEntity(en) + "m&7)"); + } + } + } + else if (heldItem instanceof ItemBow && highlightBow.isToggled() && !hasBow.contains(en)) { + hasBow.add(en); + } + } + override = true; + int rgb = Color.green.getRGB(); + if (murderers.contains(en) && highlightMurderer.isToggled()) { + rgb = Color.red.getRGB(); + } + else if (hasBow.contains(en) && highlightBow.isToggled()) { + rgb = Color.orange.getRGB(); + } + else if (!highlightInnocent.isToggled()) { + continue; + } + if (!highlightDead.isToggled() && getBoundingBoxVolume(en) <= 0.009) { + continue; + } + RenderUtils.renderEntity(en, 2, 0.0D, 0.0D, rgb, false); + } + } + if (!goldEsp.isToggled()) { + return; + } + float renderPartialTicks = Utils.getTimer().renderPartialTicks; + int n4 = -331703; + for (Entity entity : mc.theWorld.loadedEntityList) { + if (entity instanceof EntityItem) { + if (entity.ticksExisted < 3) { + continue; + } + EntityItem entityItem = (EntityItem) entity; + if (entityItem.getEntityItem().stackSize == 0) { + continue; + } + Item getItem = entityItem.getEntityItem().getItem(); + if (getItem == null) { + continue; + } + double n5 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * renderPartialTicks; + double n6 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * renderPartialTicks; + double n7 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * renderPartialTicks; + double n8 = mc.thePlayer.lastTickPosX + (mc.thePlayer.posX - mc.thePlayer.lastTickPosX) * renderPartialTicks - n5; + double n9 = mc.thePlayer.lastTickPosY + (mc.thePlayer.posY - mc.thePlayer.lastTickPosY) * renderPartialTicks - n6; + double n10 = mc.thePlayer.lastTickPosZ + (mc.thePlayer.posZ - mc.thePlayer.lastTickPosZ) * renderPartialTicks - n7; + GlStateManager.pushMatrix(); + drawBox(n4, n5, n6, n7, MathHelper.sqrt_double(n8 * n8 + n9 * n9 + n10 * n10)); + GlStateManager.popMatrix(); + } + } + } + } + } + + public void drawBox(int n, double n4, double n5, double n6, double n7) { + n4 -= mc.getRenderManager().viewerPosX; + n5 -= mc.getRenderManager().viewerPosY; + n6 -= mc.getRenderManager().viewerPosZ; + GL11.glPushMatrix(); + GL11.glBlendFunc(770, 771); + GL11.glEnable(3042); + GL11.glLineWidth(2.0f); + GL11.glDisable(3553); + GL11.glDisable(2929); + GL11.glDepthMask(false); + float n8 = (n >> 16 & 0xFF) / 255.0f; + float n9 = (n >> 8 & 0xFF) / 255.0f; + float n10 = (n & 0xFF) / 255.0f; + float min = Math.min(Math.max(0.2f, (float) (0.009999999776482582 * n7)), 0.4f); + RenderUtils.drawBoundingBox(new AxisAlignedBB(n4 - min, n5, n6 - min, n4 + min, n5 + min * 2.0f, n6 + min), n8, n9, n10, 0.35f); + GL11.glEnable(3553); + GL11.glEnable(2929); + GL11.glDepthMask(true); + GL11.glDisable(3042); + GL11.glPopMatrix(); + } + + private boolean isMurderMystery() { + if (Utils.isHypixel()) { + if (mc.thePlayer.getWorldScoreboard() == null || mc.thePlayer.getWorldScoreboard().getObjectiveInDisplaySlot(1) == null) { + return false; + } + + String d = mc.thePlayer.getWorldScoreboard().getObjectiveInDisplaySlot(1).getDisplayName(); + if (!d.contains("MURDER") && !d.contains("MYSTERY")) { + return false; + } + + Iterator var2 = Utils.gsl().iterator(); + + while (var2.hasNext()) { + String l = (String) var2.next(); + String s = Utils.stripColor(l); + if (s.contains("Role:") || s.contains("Innocents Left:")) { + return true; + } + } + } + + return false; + } + + public boolean isEmpty() { + return murderers.isEmpty() && hasBow.isEmpty() && !override; + } + + private void clear() { + override = false; + murderers.clear(); + hasBow.clear(); + } + + private double getBoundingBoxVolume(Entity entity) { + AxisAlignedBB boundingBox = entity.getEntityBoundingBox(); + + if (boundingBox == null) { + return 0; + } + + double length = boundingBox.maxX - boundingBox.minX; + double width = boundingBox.maxZ - boundingBox.minZ; + double height = boundingBox.maxY - boundingBox.minY; + + return length * width * height; + } +} diff --git a/src/main/java/keystrokesmod/module/impl/minigames/SkyWars.java b/src/main/java/keystrokesmod/module/impl/minigames/SkyWars.java new file mode 100644 index 0000000..f07743c --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/minigames/SkyWars.java @@ -0,0 +1,87 @@ +package keystrokesmod.module.impl.minigames; + +import keystrokesmod.event.PreUpdateEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.impl.world.AntiBot; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.awt.*; +import java.util.*; + +public class SkyWars extends Module { + public ButtonSetting strengthIndicator; + public Map strengthPlayers = new HashMap<>(); + private int strengthColor = new Color(255, 0, 0).getRGB(); + private String[] killMessages = new String[] {" by ", " to ", " with ", " of ", " from ", " knight ", " for "}; + public SkyWars() { + super("Sky Wars", category.minigames); + this.registerSetting(strengthIndicator = new ButtonSetting("Strength indicator", true)); + } + + @Override + public void onDisable() { + strengthPlayers.clear(); + } + + @SubscribeEvent + public void onPreUpdate(PreUpdateEvent e) { + if (!strengthIndicator.isToggled() || !Utils.nullCheck() || strengthPlayers.isEmpty() || Utils.getSkyWarsStatus() != 2) { + return; + } + ArrayList keysList = new ArrayList<>(strengthPlayers.keySet()); + for (EntityPlayer entityPlayer : keysList) { + long storedTime = strengthPlayers.get(entityPlayer); + long timePassed = System.currentTimeMillis() - storedTime; + if (timePassed < 5000 && !AntiBot.isBot(entityPlayer)) { + continue; + } + strengthPlayers.remove(entityPlayer); + } + } + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent e) { + if (e.type == 2 || !Utils.nullCheck() || !strengthIndicator.isToggled() || Utils.getSkyWarsStatus() != 2) { + return; + } + String stripped = Utils.stripColor(e.message.getUnformattedText()); + if (stripped.isEmpty()) { + return; + } + if (stripped.endsWith(".") && Arrays.stream(killMessages).anyMatch(stripped::contains)) { + String[] parts = stripped.split(" "); + for (String part : parts) { + if (!part.endsWith(".")) { + continue; + } + String name = part.substring(0, part.length() - 1); + for (EntityPlayer entity : mc.theWorld.playerEntities) { + if (!entity.getName().trim().equals(name) || entity == mc.thePlayer) { + continue; + } + strengthPlayers.put(entity, System.currentTimeMillis()); + break; + } + } + } + } + + @SubscribeEvent + public void onRenderWorld(RenderWorldLastEvent renderWorldLastEvent) { + if (!strengthIndicator.isToggled() || !Utils.nullCheck() || strengthPlayers.isEmpty() || Utils.getSkyWarsStatus() != 2) { + return; + } + for (EntityPlayer entityPlayer : strengthPlayers.keySet()) { + if (AntiBot.isBot(entityPlayer)) { + continue; + } + RenderUtils.renderEntity(entityPlayer, 2, 0, 0, strengthColor, false); + } + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/minigames/SpeedBuilders.java b/src/main/java/keystrokesmod/module/impl/minigames/SpeedBuilders.java new file mode 100644 index 0000000..8298756 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/minigames/SpeedBuilders.java @@ -0,0 +1,574 @@ +package keystrokesmod.module.impl.minigames; + +import keystrokesmod.event.PreUpdateEvent; +import keystrokesmod.event.ReceivePacketEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.BlockUtils; +import keystrokesmod.utility.Reflection; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.block.*; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.util.*; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.client.event.DrawBlockHighlightEvent; +import net.minecraftforge.client.event.MouseEvent; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import org.lwjgl.input.Mouse; + +import java.awt.*; +import java.util.*; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; + +public class SpeedBuilders extends Module { + + private SliderSetting placeDelay; + private ButtonSetting antiMiss; + private ButtonSetting autoPlace; + private ButtonSetting autoSwap; + private ButtonSetting hoverPlace; + private ButtonSetting infoHud; + private ButtonSetting renderBlocks; + private ButtonSetting renderOnlyPlaceable; + private ConcurrentHashMap buildInfo = new ConcurrentHashMap<>(); + private BlockPos platformCenter; + private boolean listenForPacket; + public List platformPositions = Arrays.asList( + new BlockPos(45, 71, -18), + new BlockPos(-16, 71, 45), + new BlockPos(18, 71, 45), + new BlockPos(45, 71, 16), + new BlockPos(-18, 71, -45), + new BlockPos(-45, 71, -16), + new BlockPos(-45, 71, 18), + new BlockPos(16, 71, -45) + ); + private int highlightColor = new Color(31, 255, 22, 44).getRGB(); + private int notPlaceableColor = new Color(184, 255, 183, 30).getRGB(); + private boolean doneCollecting; + private double blockCount; + private long lastPlace = 0L; + private BlockPos lastPlacePos = null; + private int lastPlaceTick = 0; + private boolean eliminated; + + public SpeedBuilders() { + super("Speed Builders", category.minigames); + this.registerSetting(new DescriptionSetting("Middle click to toggle auto.")); + this.registerSetting(placeDelay = new SliderSetting("Place delay", " tick", 0.5, 0, 10, 0.5)); + this.registerSetting(antiMiss = new ButtonSetting("Anti miss", false)); + this.registerSetting(autoPlace = new ButtonSetting("Auto place", false)); + this.registerSetting(autoSwap = new ButtonSetting("Auto swap", true)); + this.registerSetting(hoverPlace = new ButtonSetting("Hover place", true)); + this.registerSetting(infoHud = new ButtonSetting("Info HUD", true)); + this.registerSetting(renderBlocks = new ButtonSetting("Render blocks", true)); + this.registerSetting(renderOnlyPlaceable = new ButtonSetting("Render only placeable", false)); + } + + @Override + public void onDisable() { + lastPlaceTick = 0; + } + + @SubscribeEvent + public void onPreUpdate(PreUpdateEvent e) { + int gameStatus = getGameStatus(); + if (gameStatus == -1 || platformCenter == null) { + return; + } + if (gameStatus == 4) { + doneCollecting = true; + } + if (gameStatus == 1 && !doneCollecting) { + buildInfo = getBuildInfo(platformCenter); + if (!buildInfo.isEmpty()) { + blockCount = buildInfo.size(); + } + } + if (gameStatus == 2) { + doneCollecting = false; + for (Map.Entry entry : buildInfo.entrySet()) { + IBlockState currentState = mc.theWorld.getBlockState(entry.getKey()); + IBlockState requiredState = entry.getValue().requiredState; + + if (currentState == null || requiredState == null) { + entry.getValue().isPlaced = false; + continue; + } + + if (currentState.equals(requiredState) ||(requiredState.getBlock() instanceof BlockLeaves && (currentState.getBlock().equals(requiredState.getBlock())))) { + entry.getValue().isPlaced = true; + } + else { + entry.getValue().isPlaced = false; + } + } + + if (getLookInfo() != null) { + MovingObjectPosition mop = getLookInfo(); + if (mop.sideHit != null) { + BlockPos targetPos = mop.getBlockPos(); + BlockPos facePos = targetPos.offset(mop.sideHit); + + BuildBlockInfo info = buildInfo.get(facePos); + if (info != null && !info.isPlaced) { + if (autoSwap.isToggled()) { + int requiredMeta = info.requiredState.getBlock().getMetaFromState(info.requiredState); + int slot = getSlot(info.requiredState.getBlock(), requiredMeta); + if (slot != -1 && slot != mc.thePlayer.inventory.currentItem) { + mc.thePlayer.inventory.currentItem = slot; + } + } + if ((hoverPlace.isToggled()) && holdingSameBlock(info.requiredState) && !autoPlace.isToggled() && correctPlaceState(info.requiredState, targetPos, mop.sideHit, mop.hitVec, mc.thePlayer.getHeldItem())) { + if (lastPlaceTick++ < placeDelay.getInput()) { + return; + } + Reflection.rightClick(); + lastPlaceTick = 0; + } + } + } + } + } + } + + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onBlockHighlight(DrawBlockHighlightEvent ev) { + if (autoPlace.isToggled() && hoverPlace.isToggled() && Utils.nullCheck() && mc.currentScreen == null && getGameStatus() == 2) { + ItemStack i = mc.thePlayer.getHeldItem(); + if (i != null && i.getItem() instanceof ItemBlock) { + MovingObjectPosition m = mc.objectMouseOver; + if (m != null && m.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + if (getLookInfo() != null) { + MovingObjectPosition mop = getLookInfo(); + if (mop.sideHit != null) { + BlockPos targetPos = mop.getBlockPos(); + BlockPos facePos = targetPos.offset(mop.sideHit); + + BuildBlockInfo info = buildInfo.get(facePos); + if (info != null && !info.isPlaced && correctPlaceState(info.requiredState, targetPos, mop.sideHit, mop.hitVec, mc.thePlayer.getHeldItem())) { + BlockPos pos = m.getBlockPos(); + if (this.lastPlacePos == null || pos.getX() != this.lastPlacePos.getX() || pos.getY() != this.lastPlacePos.getY() || pos.getZ() != this.lastPlacePos.getZ()) { + Block b = mc.theWorld.getBlockState(pos).getBlock(); + if (b != null && b != Blocks.air && !(b instanceof BlockLiquid)) { + if (Mouse.isButtonDown(1) || hoverPlace.isToggled()) { + long n = System.currentTimeMillis(); + if (n - this.lastPlace >= placeDelay.getInput() * 50) { + this.lastPlace = n; + if (mc.playerController.onPlayerRightClick(mc.thePlayer, mc.theWorld, i, pos, m.sideHit, m.hitVec)) { + Reflection.setButton(1, true); + mc.thePlayer.swingItem(); + mc.getItemRenderer().resetEquippedProgress(); + Reflection.setButton(1, false); + this.lastPlacePos = pos; + } + } + } + } + } + } + } + } + } + } + } + } + + @SubscribeEvent + public void onMouse(MouseEvent e) { + if (!e.buttonstate || !Utils.nullCheck() || mc.currentScreen != null) { + return; + } + if (e.button == 1 && antiMiss.isToggled() && getLookInfo() != null && getGameStatus() == 2) { + MovingObjectPosition mop = getLookInfo(); + if (mop.sideHit != null) { + BlockPos targetPos = mop.getBlockPos(); + BlockPos facePos = targetPos.offset(mop.sideHit); + + BuildBlockInfo info = buildInfo.get(facePos); + if (info == null || !holdingSameBlock(info.requiredState) || !correctPlaceState(info.requiredState, targetPos, mop.sideHit, mop.hitVec, mc.thePlayer.getHeldItem())) { + e.setCanceled(true); + } + } + } + else if (e.button == 2) { + if (autoSwap.isToggled()) { + autoSwap.disable(); + hoverPlace.disable(); + } + else { + autoSwap.enable(); + hoverPlace.enable(); + } + } + } + + @SubscribeEvent + public void onRenderWorld(RenderWorldLastEvent ev) { + if (!Utils.nullCheck() || getGameStatus() != 2 || !renderBlocks.isToggled()) { + return; + } + + for (Map.Entry buildData : buildInfo.entrySet()) { + BuildBlockInfo info = buildData.getValue(); + if (info.isPlaced) { + continue; + } + if (!holdingSameBlock(info.requiredState)) { + continue; + } + BlockPos pos = buildData.getKey(); + boolean useWhite = true; + for (EnumFacing dir : EnumFacing.values()) { + BlockPos neighborPos = pos.offset(dir); + if (BlockUtils.getBlock(neighborPos) != Blocks.air) { + useWhite = false; + } + } + if (renderOnlyPlaceable.isToggled() && useWhite) { + continue; + } + RenderUtils.renderBlockModel(buildData.getValue().requiredState, pos.getX(), pos.getY(), pos.getZ(), useWhite ? notPlaceableColor : highlightColor); + } + } + + @SubscribeEvent + public void onRenderTick(TickEvent.RenderTickEvent e) { + if (e.phase != TickEvent.Phase.END || !Utils.nullCheck() || !infoHud.isToggled() || mc.currentScreen != null) { + return; + } + int gameStatus = getGameStatus(); + + List lines = new ArrayList<>(); + lines.add("§6Speed Builders"); + lines.add("§7Status: §b" + ((gameStatus == 1 || gameStatus == 4) + ? "Showing" : (gameStatus == 2) + ? "Building" : (gameStatus == 3) + ? "Judging" : "§cDisabled")); + if (gameStatus == 2 && !eliminated) { + double placedCount = 0; + for (BuildBlockInfo info : buildInfo.values()) { + if (info.isPlaced) placedCount++; + } + double percentage = 0.0; + if (buildInfo.isEmpty()) { + percentage = 100.0; + placedCount = blockCount; + } + else if (blockCount > 0) { + percentage = ((placedCount) / blockCount) * 100.0; + } + lines.add("§7Progress: §b" + (int) placedCount + "§7/§b" + (int) blockCount + " " + Math.round(percentage) + "%"); + } + lines.add("§7Auto: " + (autoEnabled() ? "§aENABLED" : "§cDISABLED")); + + int padding = 4; + int maxWidth = 0; + for (String line : lines) { + int lineWidth = mc.fontRendererObj.getStringWidth(line); + if (lineWidth > maxWidth) { + maxWidth = lineWidth; + } + } + + int lineHeight = mc.fontRendererObj.FONT_HEIGHT; + int lineSpacing = 3; + int totalHeight = lines.size() * lineHeight + (lines.size() - 1) * lineSpacing + padding * 2; + int totalWidth = maxWidth + padding * 2; + + float x = -5; + float y = 110; + + RenderUtils.drawRoundedRectangle(x, y, x + totalWidth + 7, y + totalHeight - 2, 7, Utils.mergeAlpha(Color.black.getRGB(), 120)); + + float textX = x + padding; + float textY = y + padding; + + for (int i = 0; i < lines.size(); i++) { + mc.fontRendererObj.drawString(lines.get(i), (int) (textX + 5), (int) (textY + i * (lineHeight + lineSpacing)), -1); + } + } + + @SubscribeEvent + public void onEntityJoin(EntityJoinWorldEvent e) { + if (!Utils.nullCheck() || e.entity == null) { + return; + } + if (e.entity == mc.thePlayer) { + buildInfo.clear(); + platformCenter = null; + listenForPacket = false; + doneCollecting = false; + eliminated = false; + } + } + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent e) { + if (e.type == 2 || !Utils.nullCheck() || getGameStatus() == -1 || listenForPacket) { + return; + } + String stripped = Utils.stripColor(e.message.getUnformattedText()); + if (stripped.isEmpty()) { + return; + } + if (stripped.contains("Perfectly recreate the build you are shown each") || stripped.contains("The game starts in 1 second!")) { + listenForPacket = true; + } + if (stripped.startsWith(Utils.getServerName()) && stripped.contains(" got a perfect build in ") && stripped.endsWith("s!")) { + buildInfo.clear(); + doneCollecting = false; + } + if (stripped.startsWith("Player eliminated: " + Utils.getServerName()) && stripped.endsWith("%)")) { + eliminated = true; + } + } + + @SubscribeEvent + public void onReceivePacket(ReceivePacketEvent e) { + if (listenForPacket && Utils.nullCheck() && e.getPacket() instanceof S08PacketPlayerPosLook) { + Vec3 setPos = new Vec3(((S08PacketPlayerPosLook) e.getPacket()).getX(), ((S08PacketPlayerPosLook) e.getPacket()).getY(), ((S08PacketPlayerPosLook) e.getPacket()).getZ()); + if (platformCenter == null) { + platformCenter = findCenter(setPos); + } + listenForPacket = false; + } + } + + public int getGameStatus() { + List sidebar = Utils.getSidebarLines(); + if (sidebar == null || sidebar.isEmpty()) { + return -1; + } + if (!Utils.stripColor(sidebar.get(0)).startsWith("BUILD BATTLE")) { + return -1; + } + for (int i = 0; i < sidebar.size() - 1; i++) { + String currentLine = Utils.stripColor(sidebar.get(i)); + String nextLine = Utils.stripColor(sidebar.get(i + 1)); + + if (currentLine.startsWith("Round:")) { + if (nextLine.startsWith("Starts In: 00:03") && Utils.stripColor(sidebar.get(i + 3)).startsWith("Theme:")) { + return 4; + } + if (nextLine.startsWith("Starts In:")) { + return 1; + } + if (nextLine.startsWith("Time Left:")) { + return 2; + } + if (nextLine.startsWith("Judging:")) { + return 3; + } + } + } + return 0; + } + + public BlockPos findCenter(Vec3 position) { + BlockPos closestPos = null; + double closestDistSq = Double.MAX_VALUE; + double maxDistance = 30.0; + double maxDistSq = maxDistance * maxDistance; + + for (BlockPos pos : platformPositions) { + double dx = pos.getX() - position.xCoord; + double dy = pos.getY() - position.yCoord; + double dz = pos.getZ() - position.zCoord; + double distSq = Math.abs(dx * dx + dy * dy + dz * dz); + + if (distSq <= maxDistSq && distSq < closestDistSq) { + closestDistSq = distSq; + closestPos = pos; + } + } + return closestPos; + } + + public ConcurrentHashMap getBuildInfo(BlockPos centerPos) { + ConcurrentHashMap blockInfo = new ConcurrentHashMap<>(); + int startX = centerPos.getX() - 3; + int endX = centerPos.getX() + 3; + int startZ = centerPos.getZ() - 3; + int endZ = centerPos.getZ() + 3; + + int startY = centerPos.getY() + 1; + int endY = startY + 30; + + for (int x = startX; x <= endX; x++) { + for (int z = startZ; z <= endZ; z++) { + for (int y = startY; y <= endY; y++) { + BlockPos currentPos = new BlockPos(x, y, z); + IBlockState state = mc.theWorld.getBlockState(currentPos); + if (state.getBlock() == Blocks.air) { + continue; + } + blockInfo.put(currentPos, new BuildBlockInfo(state)); + } + } + } + + return blockInfo; + } + + public boolean autoEnabled() { + return autoSwap.isToggled() && hoverPlace.isToggled(); + } + + public boolean holdingSameBlock(IBlockState requiredState) { + if (mc.thePlayer == null || requiredState == null) { + return false; + } + + ItemStack heldItem = mc.thePlayer.getHeldItem(); + if (heldItem == null) { + return false; + } + + Item item = heldItem.getItem(); + Block requiredBlock = requiredState.getBlock(); + + if ((requiredBlock == Blocks.water || requiredBlock == Blocks.flowing_water) && item == Items.water_bucket) { + return true; + } + + if (!(item instanceof ItemBlock)) { + return false; + } + + Block heldBlock = ((ItemBlock) item).getBlock(); + int heldMeta = heldItem.getItemDamage(); + int requiredMeta = requiredBlock.getMetaFromState(requiredState); + + if (requiredBlock == Blocks.leaves || requiredBlock == Blocks.leaves2) { + requiredMeta = requiredMeta & 3; + heldMeta = heldMeta & 3; + } + + if (removeMeta(heldBlock)) { + heldMeta = 0; + requiredMeta = 0; + } + + return heldBlock == requiredBlock && heldMeta == requiredMeta; + } + + + public MovingObjectPosition getLookInfo() { + MovingObjectPosition movingObjectPosition = mc.objectMouseOver; + if (movingObjectPosition == null || movingObjectPosition.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK || movingObjectPosition.getBlockPos() == null) { + return null; + } + return mc.objectMouseOver; + } + + private int getSlot(Block block, int meta) { + if (removeMeta(block)) { + meta = 0; + } + if (block == Blocks.leaves || block == Blocks.leaves2) { + meta &= 3; + } + + for (int i = 0; i < 9; ++i) { + ItemStack itemStack = mc.thePlayer.inventory.mainInventory[i]; + if (itemStack != null && itemStack.getItem() instanceof ItemBlock && itemStack.stackSize > 0) { + Block invBlock = ((ItemBlock) itemStack.getItem()).getBlock(); + int invMeta = itemStack.getItemDamage(); + + if (removeMeta(block)) { + invMeta = 0; + } + + if (invBlock == Blocks.leaves || invBlock == Blocks.leaves2) { + invMeta &= 3; + } + + if (invBlock == block && invMeta == meta) { + return i; + } + } + } + return -1; + } + + private boolean removeMeta(Block block) { + return (block instanceof BlockStairs || block instanceof BlockDoublePlant || block instanceof BlockFlower || block instanceof BlockSkull || block instanceof BlockLadder || block instanceof BlockPumpkin || block instanceof BlockCauldron || block instanceof BlockRail || block instanceof BlockRailBase || block instanceof BlockTripWireHook || block instanceof BlockTripWire || block instanceof BlockDispenser || block instanceof BlockDropper || block instanceof BlockHopper || block instanceof BlockTorch || block instanceof BlockButton || block instanceof BlockLever || block instanceof BlockTrapDoor || block instanceof BlockSlab); + } + + private boolean correctPlaceState(IBlockState requiredState, BlockPos blockPos, EnumFacing enumFacing, Vec3 hitVec, ItemStack heldItem) { + if (requiredState == null || blockPos == null || enumFacing == null || hitVec == null || heldItem == null || !(heldItem.getItem() instanceof ItemBlock)) { + return false; + } + + if (requiredState.getBlock() instanceof BlockLeaves || requiredState.getBlock() instanceof BlockButton) { + return true; + } + + ItemBlock itemBlock = (ItemBlock) heldItem.getItem(); + Block block = itemBlock.getBlock(); + int meta = heldItem.getItemDamage(); + + Vec3 relativeHitVec = hitVec.subtract(new Vec3(blockPos.getX(), blockPos.getY(), blockPos.getZ())); + + IBlockState simulatedState = block.onBlockPlaced(mc.theWorld, blockPos, enumFacing, + (float) relativeHitVec.xCoord, (float) relativeHitVec.yCoord, (float) relativeHitVec.zCoord, meta, mc.thePlayer); + + if (simulatedState == null) { + return false; + } + + if (simulatedState.getBlock() != requiredState.getBlock()) { + return false; + } + + int simulatedMeta = simulatedState.getBlock().getMetaFromState(simulatedState); + int requiredMeta = requiredState.getBlock().getMetaFromState(requiredState); + if (simulatedMeta != requiredMeta) { + return false; + } + if (simulatedState.getProperties().containsKey(BlockDirectional.FACING) && requiredState.getProperties().containsKey(BlockDirectional.FACING)) { + EnumFacing simulatedFacing = simulatedState.getValue(BlockDirectional.FACING); + EnumFacing requiredFacing = requiredState.getValue(BlockDirectional.FACING); + if (simulatedFacing != requiredFacing) { + return false; + } + } + if (simulatedState.getBlock() instanceof BlockStairs && requiredState.getBlock() instanceof BlockStairs) { + EnumFacing simulatedFacing = simulatedState.getValue(BlockStairs.FACING); + EnumFacing requiredFacing = requiredState.getValue(BlockStairs.FACING); + BlockStairs.EnumHalf simulatedHalf = simulatedState.getValue(BlockStairs.HALF); + BlockStairs.EnumHalf requiredHalf = requiredState.getValue(BlockStairs.HALF); + + if (simulatedFacing != requiredFacing || simulatedHalf != requiredHalf) { + return false; + } + } + + return true; + } + + class BuildBlockInfo { + public IBlockState requiredState; + public boolean isPlaced; + + public BuildBlockInfo(IBlockState state) { + this.requiredState = state; + this.isPlaced = false; + } + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/minigames/SumoFences.java b/src/main/java/keystrokesmod/module/impl/minigames/SumoFences.java new file mode 100644 index 0000000..ea3e05e --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/minigames/SumoFences.java @@ -0,0 +1,130 @@ +package keystrokesmod.module.impl.minigames; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Utils; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.MovingObjectPosition.MovingObjectType; +import net.minecraftforge.client.event.MouseEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.input.Mouse; + +import java.util.Arrays; +import java.util.List; +import java.util.TimerTask; + +public class SumoFences extends Module { + public static SliderSetting fenceHeight; + public SliderSetting blockType; + private java.util.Timer t; + private final List maps = Arrays.asList("Sumo", "Space Mine", "White Crystal", "Fort"); + private IBlockState f; + private static final List f_p = Arrays.asList(new BlockPos(9, 65, -2), new BlockPos(9, 65, -1), new BlockPos(9, 65, 0), new BlockPos(9, 65, 1), new BlockPos(9, 65, 2), new BlockPos(9, 65, 3), new BlockPos(8, 65, 3), new BlockPos(8, 65, 4), new BlockPos(8, 65, 5), new BlockPos(7, 65, 5), new BlockPos(7, 65, 6), new BlockPos(7, 65, 7), new BlockPos(6, 65, 7), new BlockPos(5, 65, 7), new BlockPos(5, 65, 8), new BlockPos(4, 65, 8), new BlockPos(3, 65, 8), new BlockPos(3, 65, 9), new BlockPos(2, 65, 9), new BlockPos(1, 65, 9), new BlockPos(0, 65, 9), new BlockPos(-1, 65, 9), new BlockPos(-2, 65, 9), new BlockPos(-3, 65, 9), new BlockPos(-3, 65, 8), new BlockPos(-4, 65, 8), new BlockPos(-5, 65, 8), new BlockPos(-5, 65, 7), new BlockPos(-6, 65, 7), new BlockPos(-7, 65, 7), new BlockPos(-7, 65, 6), new BlockPos(-7, 65, 5), new BlockPos(-8, 65, 5), new BlockPos(-8, 65, 4), new BlockPos(-8, 65, 3), new BlockPos(-9, 65, 3), new BlockPos(-9, 65, 2), new BlockPos(-9, 65, 1), new BlockPos(-9, 65, 0), new BlockPos(-9, 65, -1), new BlockPos(-9, 65, -2), new BlockPos(-9, 65, -3), new BlockPos(-8, 65, -3), new BlockPos(-8, 65, -4), new BlockPos(-8, 65, -5), new BlockPos(-7, 65, -5), new BlockPos(-7, 65, -6), new BlockPos(-7, 65, -7), new BlockPos(-6, 65, -7), new BlockPos(-5, 65, -7), new BlockPos(-5, 65, -8), new BlockPos(-4, 65, -8), new BlockPos(-3, 65, -8), new BlockPos(-3, 65, -9), new BlockPos(-2, 65, -9), new BlockPos(-1, 65, -9), new BlockPos(0, 65, -9), new BlockPos(1, 65, -9), new BlockPos(2, 65, -9), new BlockPos(3, 65, -9), new BlockPos(3, 65, -8), new BlockPos(4, 65, -8), new BlockPos(5, 65, -8), new BlockPos(5, 65, -7), new BlockPos(6, 65, -7), new BlockPos(7, 65, -7), new BlockPos(7, 65, -6), new BlockPos(7, 65, -5), new BlockPos(8, 65, -5), new BlockPos(8, 65, -4), new BlockPos(8, 65, -3), new BlockPos(9, 65, -3)); + private String[] mode = new String[]{"Oak fence", "Leaves", "Glass", "Barrier"}; + + public SumoFences() { + super("Sumo Fences", category.minigames, 0); + this.f = Blocks.oak_fence.getDefaultState(); + this.registerSetting(new DescriptionSetting("Fences for Hypixel sumo.")); + this.registerSetting(fenceHeight = new SliderSetting("Fence height", 4.0D, 1.0D, 6.0D, 1.0D)); + this.registerSetting(blockType = new SliderSetting("Block type", 0, mode)); + } + + public void onEnable() { + (this.t = new java.util.Timer()).scheduleAtFixedRate(this.t(), 0L, 500L); + } + + public void onDisable() { + if (this.t != null) { + this.t.cancel(); + this.t.purge(); + this.t = null; + } + + for (BlockPos p : f_p) { + for (int i = 0; (double) i < fenceHeight.getInput(); ++i) { + BlockPos p2 = new BlockPos(p.getX(), p.getY() + i, p.getZ()); + if (mc.theWorld.getBlockState(p2).getBlock() == this.f) { + mc.theWorld.setBlockState(p2, Blocks.air.getDefaultState()); + } + } + } + } + + @SubscribeEvent + public void onMouse(MouseEvent e) { + if (e.buttonstate && (e.button == 0 || e.button == 1) && Utils.nullCheck() && this.isSumo()) { + MovingObjectPosition mop = mc.objectMouseOver; + if (mop != null && mop.typeOfHit == MovingObjectType.BLOCK) { + int x = mop.getBlockPos().getX(); + int z = mop.getBlockPos().getZ(); + + for (BlockPos pos : f_p) { + if (pos.getX() == x && pos.getZ() == z) { + e.setCanceled(true); + if (e.button == 0) { + Utils.rsa(); + } + Mouse.poll(); + break; + } + } + } + } + } + + public TimerTask t() { + return new TimerTask() { + public void run() { + if (SumoFences.this.isSumo()) { + for (BlockPos p : SumoFences.f_p) { + for (int i = 0; (double) i < SumoFences.fenceHeight.getInput(); ++i) { + BlockPos p2 = new BlockPos(p.getX(), p.getY() + i, p.getZ()); + if (mc.theWorld.getBlockState(p2).getBlock() == Blocks.air) { + mc.theWorld.setBlockState(p2, SumoFences.this.f); + } + } + } + + } + } + }; + } + + private boolean isSumo() { + if (Utils.isHypixel()) { + for (String l : Utils.gsl()) { + String s = Utils.stripColor(l); + if (s.startsWith("Map:")) { + if (this.maps.contains(s.substring(5))) { + return true; + } + } else if (s.equals("Mode: Sumo Duel")) { + return true; + } + } + } + + return false; + } + + public void guiUpdate() { + switch ((int) blockType.getInput()) { + case 0: + this.f = Blocks.oak_fence.getDefaultState(); + break; + case 1: + this.f = Blocks.leaves.getDefaultState(); + break; + case 2: + this.f = Blocks.glass.getDefaultState(); + break; + case 3: + this.f = Blocks.barrier.getDefaultState(); + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/movement/Bhop.java b/src/main/java/keystrokesmod/module/impl/movement/Bhop.java new file mode 100644 index 0000000..2c023dd --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/movement/Bhop.java @@ -0,0 +1,149 @@ +package keystrokesmod.module.impl.movement; + +import keystrokesmod.event.PostPlayerInputEvent; +import keystrokesmod.event.PreMotionEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.client.Settings; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.RotationUtils; +import keystrokesmod.utility.Utils; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.input.Keyboard; + +public class Bhop extends Module { + public SliderSetting mode; + public static SliderSetting speedSetting; + private ButtonSetting liquidDisable; + private ButtonSetting sneakDisable; + public ButtonSetting rotateYawOption; + public String[] modes = new String[]{"Strafe", "Ground", "8 tick", "7 tick"}; + public boolean hopping, lowhop, didMove, collided, setRotation; + + public Bhop() { + super("Bhop", Module.category.movement); + this.registerSetting(mode = new SliderSetting("Mode", 0, modes)); + this.registerSetting(speedSetting = new SliderSetting("Speed", 2.0, 0.5, 8.0, 0.1)); + this.registerSetting(liquidDisable = new ButtonSetting("Disable in liquid", true)); + this.registerSetting(sneakDisable = new ButtonSetting("Disable while sneaking", true)); + this.registerSetting(rotateYawOption = new ButtonSetting("Rotate Yaw", false)); + } + + @Override + public String getInfo() { + return modes[(int) mode.getInput()]; + } + + @SubscribeEvent + public void onPostPlayerInput(PostPlayerInputEvent e) { + if (hopping) { + mc.thePlayer.movementInput.jump = false; + } + } + + @SubscribeEvent + public void onPreMotion(PreMotionEvent e) { + if (((mc.thePlayer.isInWater() || mc.thePlayer.isInLava()) && liquidDisable.isToggled()) || (mc.thePlayer.isSneaking() && sneakDisable.isToggled())) { + return; + } + if (ModuleManager.bedAura.isEnabled() && ModuleManager.bedAura.disableBHop.isToggled() && ModuleManager.bedAura.currentBlock != null && RotationUtils.inRange(ModuleManager.bedAura.currentBlock, ModuleManager.bedAura.range.getInput())) { + return; + } + if (ModuleManager.scaffold.moduleEnabled && (ModuleManager.tower.canTower() || ModuleManager.scaffold.fastScaffoldKeepY)) { + return; + } + if (mode.getInput() >= 1) { + if (mc.thePlayer.isCollidedHorizontally) { + collided = true; + } else if (mc.thePlayer.onGround) { + collided = false; + } + if (mc.thePlayer.onGround) { + mc.thePlayer.jump(); + double horizontalSpeed = Utils.getHorizontalSpeed(); + double speedModifier = 0.4847; + final int speedAmplifier = Utils.getSpeedAmplifier(); + switch (speedAmplifier) { + case 1: + speedModifier = 0.5152; + break; + case 2: + speedModifier = 0.587; + break; + case 3: + speedModifier = 0.6289; + break; + } + double additionalSpeed = speedModifier * ((speedSetting.getInput() - 1.0) / 3.0 + 1.0); + if (horizontalSpeed < additionalSpeed) { + horizontalSpeed = additionalSpeed; + } + if (Utils.isMoving() && !Utils.noSlowingBackWithBow()) { + mc.thePlayer.setSprinting(true); + Utils.setSpeed(horizontalSpeed); + didMove = true; + } + hopping = true; + } + } + switch ((int) mode.getInput()) { + case 0: + if (Utils.isMoving()) { + if (mc.thePlayer.onGround) { + mc.thePlayer.jump(); + } + mc.thePlayer.setSprinting(true); + Utils.setSpeed(Utils.getHorizontalSpeed() + 0.005 * speedSetting.getInput()); + hopping = true; + break; + } + break; + case 1: + break; + case 2: + if (mode.getInput() == 2 && didMove) { + int simpleY = (int) Math.round((e.posY % 1) * 10000); + + if (mc.thePlayer.hurtTime == 0 && !collided) { + switch (simpleY) { + case 13: + mc.thePlayer.motionY = mc.thePlayer.motionY - 0.02483; + break; + case 2000: + mc.thePlayer.motionY = mc.thePlayer.motionY - 0.1913; + didMove = false; + break; + } + } + } + break; + case 3: + if (mode.getInput() == 3 && didMove) { + int simpleY = (int) Math.round((e.posY % 1) * 10000); + + if (mc.thePlayer.hurtTime == 0 && !collided) { + switch (simpleY) { + case 4200: + mc.thePlayer.motionY = 0.39; + lowhop = true; + break; + case 1138: + mc.thePlayer.motionY = mc.thePlayer.motionY - 0.13; + lowhop = false; + break; + case 2031: + mc.thePlayer.motionY = mc.thePlayer.motionY - 0.2; + didMove = false; + break; + } + } + } + break; + } + } + + public void onDisable() { + hopping = false; + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/movement/Boost.java b/src/main/java/keystrokesmod/module/impl/movement/Boost.java new file mode 100644 index 0000000..3054df0 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/movement/Boost.java @@ -0,0 +1,56 @@ +package keystrokesmod.module.impl.movement; + +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Utils; + +public class Boost extends Module { + public static DescriptionSetting c; + public static SliderSetting a; + public static SliderSetting b; + private int i = 0; + private boolean t = false; + + public Boost() { + super("Boost", Module.category.movement, 0); + this.registerSetting(c = new DescriptionSetting("20 ticks are in 1 second")); + this.registerSetting(a = new SliderSetting("Multiplier", 2.0D, 1.0D, 3.0D, 0.05D)); + this.registerSetting(b = new SliderSetting("Time (ticks)", 15.0D, 1.0D, 80.0D, 1.0D)); + } + + public void onEnable() { + if (ModuleManager.timer.isEnabled()) { + this.t = true; + ModuleManager.timer.disable(); + } + + } + + public void onDisable() { + this.i = 0; + if (Utils.getTimer().timerSpeed != 1.0F) { + Utils.resetTimer(); + } + + if (this.t) { + ModuleManager.timer.enable(); + } + + this.t = false; + } + + public void onUpdate() { + if (this.i == 0) { + this.i = mc.thePlayer.ticksExisted; + } + + Utils.getTimer().timerSpeed = (float) a.getInput(); + if ((double) this.i == (double) mc.thePlayer.ticksExisted - b.getInput()) { + Utils.resetTimer(); + this.disable(); + } + + } +} diff --git a/src/main/java/keystrokesmod/module/impl/movement/Fly.java b/src/main/java/keystrokesmod/module/impl/movement/Fly.java new file mode 100644 index 0000000..67dca84 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/movement/Fly.java @@ -0,0 +1,150 @@ +package keystrokesmod.module.impl.movement; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Utils; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import org.apache.commons.lang3.RandomUtils; + +public class Fly extends Module { + private SliderSetting mode; + public static SliderSetting horizontalSpeed; + private SliderSetting verticalSpeed; + private ButtonSetting showBPS; + private ButtonSetting stopMotion; + private boolean d; + private boolean a = false; + private String[] modes = new String[]{"Vanilla", "Fast", "Fast 2"}; + + public Fly() { + super("Fly", category.movement); + this.registerSetting(mode = new SliderSetting("Fly", 0, modes)); + this.registerSetting(horizontalSpeed = new SliderSetting("Horizontal speed", 2.0, 1.0, 9.0, 0.1)); + this.registerSetting(verticalSpeed = new SliderSetting("Vertical speed", 2.0, 1.0, 9.0, 0.1)); + this.registerSetting(showBPS = new ButtonSetting("Show BPS", false)); + this.registerSetting(stopMotion = new ButtonSetting("Stop motion", false)); + } + + public void onEnable() { + this.d = mc.thePlayer.capabilities.isFlying; + } + + public void onUpdate() { + switch ((int) mode.getInput()) { + case 0: + mc.thePlayer.motionY = 0.0; + mc.thePlayer.capabilities.setFlySpeed((float)(0.05000000074505806 * horizontalSpeed.getInput())); + mc.thePlayer.capabilities.isFlying = true; + break; + case 1: + mc.thePlayer.onGround = true; + if (mc.currentScreen == null) { + if (Utils.jumpDown()) { + mc.thePlayer.motionY = 0.3 * verticalSpeed.getInput(); + } + else if (Utils.jumpDown()) { + mc.thePlayer.motionY = -0.3 * verticalSpeed.getInput(); + } + else { + mc.thePlayer.motionY = 0.0; + } + } + else { + mc.thePlayer.motionY = 0.0; + } + mc.thePlayer.capabilities.setFlySpeed(0.2f); + mc.thePlayer.capabilities.isFlying = true; + setSpeed(0.85 * horizontalSpeed.getInput()); + break; + case 2: + double nextDouble = RandomUtils.nextDouble(1.0E-7, 1.2E-7); + if (mc.thePlayer.ticksExisted % 2 == 0) { + nextDouble = -nextDouble; + } + if (!mc.thePlayer.onGround) { + mc.thePlayer.setPosition(mc.thePlayer.posX, mc.thePlayer.posY + nextDouble, mc.thePlayer.posZ); + } + mc.thePlayer.motionY = 0.0; + setSpeed(0.4 * horizontalSpeed.getInput()); + break; + } + + } + + public void onDisable() { + if (mc.thePlayer.capabilities.allowFlying) { + mc.thePlayer.capabilities.isFlying = this.d; + } + else { + mc.thePlayer.capabilities.isFlying = false; + } + this.d = false; + switch ((int) mode.getInput()) { + case 0: + case 1: { + mc.thePlayer.capabilities.setFlySpeed(0.05F); + break; + } + case 2: { + a = false; + break; + } + } + if (stopMotion.isToggled()) { + mc.thePlayer.motionZ = 0; + mc.thePlayer.motionY = 0; + mc.thePlayer.motionX = 0; + } + } + + @SubscribeEvent + public void onRenderTick(TickEvent.RenderTickEvent e) { + if (!showBPS.isToggled() || e.phase != TickEvent.Phase.END || !Utils.nullCheck()) { + return; + } + if (mc.currentScreen != null || mc.gameSettings.showDebugInfo) { + return; + } + RenderUtils.renderBPS(true, false); + } + + public static void setSpeed(final double n) { + if (n == 0.0) { + mc.thePlayer.motionZ = 0; + mc.thePlayer.motionX = 0; + return; + } + double n3 = mc.thePlayer.movementInput.moveForward; + double n4 = mc.thePlayer.movementInput.moveStrafe; + float rotationYaw = mc.thePlayer.rotationYaw; + if (n3 == 0.0 && n4 == 0.0) { + mc.thePlayer.motionZ = 0; + mc.thePlayer.motionX = 0; + } + else { + if (n3 != 0.0) { + if (n4 > 0.0) { + rotationYaw += ((n3 > 0.0) ? -45 : 45); + } + else if (n4 < 0.0) { + rotationYaw += ((n3 > 0.0) ? 45 : -45); + } + n4 = 0.0; + if (n3 > 0.0) { + n3 = 1.0; + } + else if (n3 < 0.0) { + n3 = -1.0; + } + } + final double radians = Math.toRadians(rotationYaw + 90.0f); + final double sin = Math.sin(radians); + final double cos = Math.cos(radians); + mc.thePlayer.motionX = n3 * n * cos + n4 * n * sin; + mc.thePlayer.motionZ = n3 * n * sin - n4 * n * cos; + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/movement/InvMove.java b/src/main/java/keystrokesmod/module/impl/movement/InvMove.java new file mode 100644 index 0000000..a4a2e0b --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/movement/InvMove.java @@ -0,0 +1,131 @@ +package keystrokesmod.module.impl.movement; + +import keystrokesmod.clickgui.ClickGui; +import net.minecraft.client.gui.GuiChat; +import keystrokesmod.event.JumpEvent; +import keystrokesmod.event.PreUpdateEvent; +import keystrokesmod.event.SendPacketEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.client.Settings; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.PacketUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.network.Packet; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraft.network.play.client.C0EPacketClickWindow; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.input.Keyboard; + +import java.util.concurrent.ConcurrentLinkedQueue; + +public class InvMove extends Module { + private SliderSetting modes; + + + private int ticks; + private boolean stopMoving; + private String[] modesString = new String[] { "Vanilla", "Stop movement" }; + + public InvMove() { + super("InvMove", Module.category.movement); + this.registerSetting(modes = new SliderSetting("Modes", 1, modesString)); + } + + public void onDisable() { + reset(); + } + + @SubscribeEvent + public void onSendPacket(SendPacketEvent e) { + if (e.getPacket() instanceof C0EPacketClickWindow) { + if (modes.getInput() == 1) { + stopMoving = true; + ticks = 0; + } + } + } + + @SubscribeEvent + public void onPreUpdate(PreUpdateEvent e) { + if (!guiCheck()) { + reset(); + return; + } + allowBinds(true); + if (modes.getInput() == 1) { + if (!(mc.currentScreen instanceof ClickGui)) { + if (stopMoving) { + ticks++; + allowBinds(false); + if (ticks >= 9) { + ticks = 0; + stopMoving = false; + } + } + } else { + reset(); + } + } + + boolean foodLvlMet = (float)mc.thePlayer.getFoodStats().getFoodLevel() > 6.0F || mc.thePlayer.capabilities.allowFlying; // from mc + if (((Keyboard.isKeyDown(mc.gameSettings.keyBindSprint.getKeyCode()) || ModuleManager.sprint.isEnabled()) && mc.thePlayer.movementInput.moveForward >= 0.8F && foodLvlMet && !mc.thePlayer.isSprinting())) { + mc.thePlayer.setSprinting(true); + } + if (Keyboard.isKeyDown(208) && mc.thePlayer.rotationPitch < 90.0F) { + mc.thePlayer.rotationPitch += 6.0F; + } + if (Keyboard.isKeyDown(200) && mc.thePlayer.rotationPitch > -90.0F) { + mc.thePlayer.rotationPitch -= 6.0F; + } + if (Keyboard.isKeyDown(205)) { + mc.thePlayer.rotationYaw += 6.0F; + } + if (Keyboard.isKeyDown(203)) { + mc.thePlayer.rotationYaw -= 6.0F; + } + } + + private void reset() { + ticks = 0; + stopMoving = false; + } + + private boolean guiCheck() { + //Utils.sendModuleMessage(this, "&7screen " + mc.currentScreen); + if (mc.currentScreen == null) { + return false; + } + if (mc.currentScreen instanceof ClickGui) { + return true; + } + if (mc.currentScreen instanceof GuiChat) { + return false; + } + return true; + } + + private void allowBinds(boolean allowKeys) { + if (allowKeys) { + KeyBinding.setKeyBindState(mc.gameSettings.keyBindForward.getKeyCode(), Keyboard.isKeyDown(mc.gameSettings.keyBindForward.getKeyCode())); + KeyBinding.setKeyBindState(mc.gameSettings.keyBindBack.getKeyCode(), Keyboard.isKeyDown(mc.gameSettings.keyBindBack.getKeyCode())); + KeyBinding.setKeyBindState(mc.gameSettings.keyBindRight.getKeyCode(), Keyboard.isKeyDown(mc.gameSettings.keyBindRight.getKeyCode())); + KeyBinding.setKeyBindState(mc.gameSettings.keyBindLeft.getKeyCode(), Keyboard.isKeyDown(mc.gameSettings.keyBindLeft.getKeyCode())); + KeyBinding.setKeyBindState(mc.gameSettings.keyBindJump.getKeyCode(), Utils.jumpDown()); + KeyBinding.setKeyBindState(mc.gameSettings.keyBindSprint.getKeyCode(), Keyboard.isKeyDown(mc.gameSettings.keyBindSprint.getKeyCode())); + } else { + KeyBinding.setKeyBindState(mc.gameSettings.keyBindForward.getKeyCode(),false); + KeyBinding.setKeyBindState(mc.gameSettings.keyBindBack.getKeyCode(), false); + KeyBinding.setKeyBindState(mc.gameSettings.keyBindRight.getKeyCode(),false); + KeyBinding.setKeyBindState(mc.gameSettings.keyBindLeft.getKeyCode(),false); + KeyBinding.setKeyBindState(mc.gameSettings.keyBindJump.getKeyCode(),false); + KeyBinding.setKeyBindState(mc.gameSettings.keyBindSprint.getKeyCode(),false); + } + } + +} diff --git a/src/main/java/keystrokesmod/module/impl/movement/KeepSprint.java b/src/main/java/keystrokesmod/module/impl/movement/KeepSprint.java new file mode 100644 index 0000000..b9092f5 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/movement/KeepSprint.java @@ -0,0 +1,53 @@ +package keystrokesmod.module.impl.movement; + +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.combat.KillAura; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import net.minecraft.entity.Entity; +import net.minecraft.util.Vec3; + +public class KeepSprint extends Module { + private DescriptionSetting description; + public static SliderSetting slow; + public static ButtonSetting disableWhileJump; + public static ButtonSetting reduceReachHits; + + public KeepSprint() { + super("KeepSprint", Module.category.movement, 0); + this.registerSetting(new DescriptionSetting(new String("Default is 40% motion reduction."))); + this.registerSetting(slow = new SliderSetting("Slow %", 40.0D, 0.0D, 40.0D, 1.0D)); + this.registerSetting(disableWhileJump = new ButtonSetting("Disable while jumping", false)); + this.registerSetting(reduceReachHits = new ButtonSetting("Only reduce reach hits", false)); + } + + public static void keepSprint(Entity en) { + boolean vanilla = false; + if (disableWhileJump.isToggled() && !mc.thePlayer.onGround) { + vanilla = true; + } + else if (reduceReachHits.isToggled() && !mc.thePlayer.capabilities.isCreativeMode) { + double n = -1.0; + final Vec3 getPositionEyes = mc.thePlayer.getPositionEyes(1.0f); + if (ModuleManager.killAura != null && ModuleManager.killAura.isEnabled() && KillAura.target != null) { + n = getPositionEyes.distanceTo(KillAura.target.getPositionEyes(1.0f)); + } + else if (ModuleManager.reach != null && ModuleManager.reach.isEnabled()) { + n = getPositionEyes.distanceTo(mc.objectMouseOver.hitVec); + } + if (n != -1.0 && n <= 3.0) { + vanilla = true; + } + } + if (vanilla) { + mc.thePlayer.motionX *= 0.6; + mc.thePlayer.motionZ *= 0.6; + } else { + float n2 = (100.0f - (float) slow.getInput()) / 100.0f; + mc.thePlayer.motionX *= n2; + mc.thePlayer.motionZ *= n2; + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/movement/LongJump.java b/src/main/java/keystrokesmod/module/impl/movement/LongJump.java new file mode 100644 index 0000000..622e412 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/movement/LongJump.java @@ -0,0 +1,431 @@ +package keystrokesmod.module.impl.movement; + +import keystrokesmod.event.PrePlayerInputEvent; +import keystrokesmod.event.*; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Reflection; +import keystrokesmod.utility.Utils; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.*; +import net.minecraft.potion.PotionEffect; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class LongJump extends Module { + private SliderSetting boostSetting; + private SliderSetting motionTicks; + private SliderSetting verticalMotion; + private SliderSetting motionDecay; + + private ButtonSetting allowStrafe; + private ButtonSetting invertYaw; + private ButtonSetting stopMovement; + private ButtonSetting hideExplosion; + + private SliderSetting temporaryFlightKey; + private SliderSetting pitchVal; + + private float yaw; + private float pitch; + + private boolean notMoving; + private boolean enabled; + + private int boostTicks; + private int lastSlot = -1; + private int stopTime; + private int rotateTick; + private int motionDecayVal; + + private long fireballTime; + private long MAX_EXPLOSION_DIST_SQ = 9; + private long FIREBALL_TIMEOUT = 750L; + + public static boolean stopVelocity; + public static boolean stopKillAura; + public static boolean stopScaffold; + public static boolean slotReset; + public static int slotResetTicks; + + private String[] modes = new String[]{"Fireball", "Fireball Auto"}; + public LongJump() { + super("Long Jump", category.movement); + this.registerSetting(boostSetting = new SliderSetting("Horizontal boost", 1.7, 0.0, 2.0, 0.1)); + this.registerSetting(verticalMotion = new SliderSetting("Vertical motion", 0, 0.4, 0.9, 0.01)); + this.registerSetting(motionDecay = new SliderSetting("Motion decay", 17, 1, 40, 1)); + this.registerSetting(allowStrafe = new ButtonSetting("Allow strafe", false)); + this.registerSetting(invertYaw = new ButtonSetting("Invert yaw", true)); + this.registerSetting(stopMovement = new ButtonSetting("Stop movement", false)); + this.registerSetting(hideExplosion = new ButtonSetting("Hide explosion", false)); + + this.registerSetting(temporaryFlightKey = new SliderSetting("Vertical key", 91, keyNames)); + + //this.registerSetting(new DescriptionSetting("Dev:")); + //this.registerSetting(pitchVal = new SliderSetting("Stop movement Pitch", 55, 55, 80, 0.1)); + } + + String[] keyNames = { + "LMB", "RMB", "MMB", + "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", + "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", + "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", + "BACK", "CAPITAL", "COMMA", "DELETE", "DOWN", "END", "ESCAPE", "F1", "F2", "F3", "F4", "F5", + "F6", "F7", "HOME", "INSERT", "LBRACKET", "LCONTROL", "LMENU", "LMETA", "LSHIFT", "MINUS", + "NUMPAD0", "NUMPAD1", "NUMPAD2", "NUMPAD3", "NUMPAD4", "NUMPAD5", "NUMPAD6", "NUMPAD7", + "NUMPAD8", "NUMPAD9", "PERIOD", "RETURN", "RCONTROL", "RSHIFT", "RBRACKET", "SEMICOLON", + "SLASH", "SPACE", "TAB", "GRAVE" + }; + + public void onEnable() { + slotReset = false; + slotResetTicks = 0; + enabled = true; + ModuleManager.bhop.disable(); + stopKillAura = true; + stopScaffold = true; + } + + public void onDisable() { + fireballTime = rotateTick = stopTime = 0; + boostTicks = -1; + resetSlot(); + enabled = notMoving = stopVelocity = false; + } + + /*public boolean onChat(String chatMessage) { + String msg = util.strip(chatMessage); + + if (msg.equals("Build height limit reached!")) { + client.print("fb fly build height"); + modules.disable(scriptName); + return false; + } + return true; + }*/ + + @SubscribeEvent + public void onPreUpdate(PreUpdateEvent e) { + if (enabled) { + if (!Utils.isMoving()) notMoving = true; + if (boostSetting.getInput() == 0 && verticalMotion.getInput() == 0) { + Utils.print("&cValues are set to 0!"); + disable(); + return; + } + int fireballSlot = setupFireballSlot(true); + if (fireballSlot != -1) { + lastSlot = mc.thePlayer.inventory.currentItem; + mc.thePlayer.inventory.currentItem = fireballSlot; + //("Set fireball slot"); + rotateTick = 1; + if (stopMovement.isToggled()) { + stopTime = 1; + } + } // auto disables if -1 + enabled = false; + } + + if (notMoving) { + motionDecayVal = 21; + } else { + motionDecayVal = (int) motionDecay.getInput(); + } + if (stopTime == -1 && ++boostTicks > (!temporaryFlightKey() ? 33/*flat motion ticks*/ : (!notMoving ? 32/*normal motion ticks*/ : 33/*vertical motion ticks*/))) { + disable(); + return; + } + + if (fireballTime > 0 && (System.currentTimeMillis() - fireballTime) > FIREBALL_TIMEOUT) { + Utils.print("&cFireball timed out."); + disable(); + return; + } + if (boostTicks > 0) { + modifyVertical(); // has to be onPreUpdate + //Utils.print("Modifying vertical"); + if (allowStrafe.isToggled()) { + Utils.setSpeed(Utils.getHorizontalSpeed(mc.thePlayer)); + //Utils.print("Speed"); + } + } + + if (stopMovement.isToggled() && !notMoving) { + if (stopTime > 0) { + ++stopTime; + } + } + } + + @SubscribeEvent(priority = EventPriority.LOWEST) + public void onPreMotion(PreMotionEvent e) { + if (!Utils.nullCheck()) { + return; + } + if (rotateTick > 0) { + if ((invertYaw.isToggled() || stopMovement.isToggled()) && !notMoving) { + if (!stopMovement.isToggled()) { + if (rotateTick == 1) { + yaw = mc.thePlayer.rotationYaw - 180f; + pitch = 90f; + } + } else { + if (rotateTick == 1) { + yaw = mc.thePlayer.rotationYaw - 180f; + pitch = 66.3f;//(float) pitchVal.getInput(); + } + } + } else { + if (rotateTick == 1) { + yaw = mc.thePlayer.rotationYaw; + pitch = 90f; + } + } + if (rotateTick > 1) { + yaw = mc.thePlayer.rotationYaw; + pitch = mc.thePlayer.rotationPitch; + } + e.setYaw(yaw); + e.setPitch(pitch); + } + if (rotateTick > 0 && ++rotateTick >= 3) { + rotateTick = 0; + int fireballSlot = setupFireballSlot(false); + if (fireballSlot != -1) { + mc.thePlayer.inventory.currentItem = fireballSlot; // we are probably already on the slot but make sure + fireballTime = System.currentTimeMillis(); + Reflection.rightClick(); + stopVelocity = true; + //Utils.print("Right click"); + } + } + if (boostTicks == 1) { + if (invertYaw.isToggled()) { + //client.setMotion(client.getMotion().x, client.getMotion().y + 0.035d, client.getMotion().z); + } + modifyHorizontal(); + stopVelocity = false; + } + + } + + @SubscribeEvent(priority = EventPriority.LOWEST) // called last in order to apply fix + public void onMoveInput(PrePlayerInputEvent e) { + mc.thePlayer.movementInput.jump = false; + if (rotateTick > 0 || fireballTime > 0) { + if (Utils.isMoving()) e.setForward(1); + e.setStrafe(0); + } + if (notMoving && boostTicks < 3) { + e.setForward(0); + e.setStrafe(0); + Utils.setSpeed(0); + } + if (stopMovement.isToggled() && !notMoving && stopTime >= 1) { + e.setForward(0); + e.setStrafe(0); + Utils.setSpeed(0); + } + } + + @SubscribeEvent + public void onReceivePacket(ReceivePacketEvent e) { + Packet packet = e.getPacket(); + if (packet instanceof S27PacketExplosion) { + S27PacketExplosion s27 = (S27PacketExplosion) packet; + if (fireballTime == 0 || mc.thePlayer.getPosition().distanceSq(s27.getX(), s27.getY(), s27.getZ()) > MAX_EXPLOSION_DIST_SQ) { + e.setCanceled(true); + //Utils.print("0 fb time / out of dist"); + } + + stopTime = -1; + fireballTime = 0; + resetSlot(); + boostTicks = 0; // +1 on next pre update + //Utils.print("set start vals"); + + //client.print(client.getPlayer().getTicksExisted() + " s27 " + boostTicks + " " + client.getPlayer().getHurtTime() + " " + client.getPlayer().getSpeed()); + } else if (packet instanceof S08PacketPlayerPosLook) { + Utils.print("&cReceived setback, disabling."); + disable(); + } + + if (hideExplosion.isToggled() && fireballTime != 0 && (packet instanceof S0EPacketSpawnObject || packet instanceof S2APacketParticles || packet instanceof S29PacketSoundEffect)) { + e.setCanceled(true); + } + } + + private int getFireballSlot() { + int n = -1; + for (int i = 0; i < 9; ++i) { + final ItemStack getStackInSlot = mc.thePlayer.inventory.getStackInSlot(i); + if (getStackInSlot != null && getStackInSlot.getItem() == Items.fire_charge) { + n = i; + break; + } + } + return n; + } + + private int setupFireballSlot(boolean pre) { + // only cancel bad packet right click on the tick we are sending it + int fireballSlot = getFireballSlot(); + if (fireballSlot == -1) { + Utils.print("&cFireball not found."); + disable(); + } else if (ModuleManager.scaffold.isEnabled || (pre && Utils.distanceToGround(mc.thePlayer) > 3)/* || (!pre && !PacketUtil.canRightClickItem())*/) { //needs porting + Utils.print("&cCan't throw fireball right now."); + disable(); + fireballSlot = -1; + } + return fireballSlot; + } + + private void resetSlot() { + if (lastSlot != -1) { + mc.thePlayer.inventory.currentItem = lastSlot; + lastSlot = -1; + } + slotReset = true; + } + + private int getSpeedLevel() { + for (PotionEffect potionEffect : mc.thePlayer.getActivePotionEffects()) { + if (potionEffect.getEffectName().equals("potion.moveSpeed")) { + return potionEffect.getAmplifier() + 1; + } + return 0; + } + return 0; + } + + // only apply horizontal boost once + void modifyHorizontal() { + if (boostSetting.getInput() != 0) { + //client.print("&7horizontal &b" + boostTicks + " " + client.getPlayer().getHurtTime()); + + double speed = boostSetting.getInput() - Utils.randomizeDouble(0.0001, 0); + if (Utils.isMoving()) { + Utils.setSpeed(speed); + //Utils.print("og speed"); + } + } + } + + private void modifyVertical() { + if (verticalMotion.getInput() != 0) { + double ver = ((!notMoving ? verticalMotion.getInput() : 1.16 /*vertical*/) * (1.0 / (1.0 + (0.05 * getSpeedLevel())))) + Utils.randomizeDouble(0.0001, 0.1); + double decay = motionDecay.getInput() / 1000; + if (boostTicks > 1 && !temporaryFlightKey()) { + if (boostTicks > 1 || boostTicks <= (!notMoving ? 32/*horizontal motion ticks*/ : 33/*vertical motion ticks*/)) { + mc.thePlayer.motionY = Utils.randomizeDouble(0.0101, 0.01); + } + } else { + if (boostTicks >= 1 && boostTicks <= (!notMoving ? 32/*horizontal motion ticks*/ : 33/*vertical motion ticks*/)) { + mc.thePlayer.motionY = ver - boostTicks * decay; + } else if (boostTicks >= (!notMoving ? 32/*horizontal motion ticks*/ : 33/*vertical motion ticks*/) + 3) { + mc.thePlayer.motionY = mc.thePlayer.motionY + 0.028; + Utils.print("?"); + } + } + } + } + + private boolean temporaryFlightKey() { + if (notMoving) return true; + if (temporaryFlightKey.getInput() > 2) { + return Utils.keybinds.isKeyDown(getKeyCode(keyNames[(int) temporaryFlightKey.getInput()])); + } else { + return Utils.keybinds.isMouseDown((int) temporaryFlightKey.getInput()); + } + } + + private int getKeyCode(String keyName) { + switch (keyName) { + case "0": return 11; + case "1": return 2; + case "2": return 3; + case "3": return 4; + case "4": return 5; + case "5": return 6; + case "6": return 7; + case "7": return 8; + case "8": return 9; + case "9": return 10; + case "A": return 30; + case "B": return 48; + case "C": return 46; + case "D": return 32; + case "E": return 18; + case "F": return 33; + case "G": return 34; + case "H": return 35; + case "I": return 23; + case "J": return 36; + case "K": return 37; + case "L": return 38; + case "M": return 50; + case "N": return 49; + case "O": return 24; + case "P": return 25; + case "Q": return 16; + case "R": return 19; + case "S": return 31; + case "T": return 20; + case "U": return 22; + case "V": return 47; + case "W": return 17; + case "X": return 45; + case "Y": return 21; + case "Z": return 44; + case "BACK": return 14; + case "CAPITAL": return 58; + case "COMMA": return 51; + case "DELETE": return 211; + case "DOWN": return 208; + case "END": return 207; + case "ESCAPE": return 1; + case "F1": return 59; + case "F2": return 60; + case "F3": return 61; + case "F4": return 62; + case "F5": return 63; + case "F6": return 64; + case "F7": return 65; + case "HOME": return 199; + case "INSERT": return 210; + case "LBRACKET": return 26; + case "LCONTROL": return 29; + case "LMENU": return 56; + case "LMETA": return 219; + case "LSHIFT": return 42; + case "MINUS": return 12; + case "NUMPAD0": return 82; + case "NUMPAD1": return 79; + case "NUMPAD2": return 80; + case "NUMPAD3": return 81; + case "NUMPAD4": return 75; + case "NUMPAD5": return 76; + case "NUMPAD6": return 77; + case "NUMPAD7": return 71; + case "NUMPAD8": return 72; + case "NUMPAD9": return 73; + case "PERIOD": return 52; + case "RETURN": return 28; + case "RCONTROL": return 157; + case "RSHIFT": return 54; + case "RBRACKET": return 27; + case "SEMICOLON": return 39; + case "SLASH": return 53; + case "SPACE": return 57; + case "TAB": return 15; + case "GRAVE": return 41; + default: return -1; + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/movement/NoSlow.java b/src/main/java/keystrokesmod/module/impl/movement/NoSlow.java new file mode 100644 index 0000000..9bf49f3 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/movement/NoSlow.java @@ -0,0 +1,256 @@ +package keystrokesmod.module.impl.movement; + +import keystrokesmod.Raven; +import keystrokesmod.event.*; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.BlockUtils; +import keystrokesmod.utility.Reflection; +import keystrokesmod.utility.Utils; +import net.minecraft.item.*; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.util.BlockPos; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.input.Mouse; + +public class NoSlow extends Module { + public static SliderSetting mode; + public static SliderSetting slowed; + public static ButtonSetting disableBow; + public static ButtonSetting disablePotions; + public static ButtonSetting swordOnly; + public static ButtonSetting vanillaSword; + public static ButtonSetting groundSpeedOption; + private String[] modes = new String[]{"Vanilla", "Pre", "Post", "Alpha", "Float"}; + private boolean postPlace; + private boolean canFloat; + private boolean reSendConsume; + private boolean setRotation; + public static boolean noSlowing; + + public NoSlow() { + super("NoSlow", category.movement, 0); + this.registerSetting(new DescriptionSetting("Default is 80% motion reduction.")); + this.registerSetting(mode = new SliderSetting("Mode", 0, modes)); + this.registerSetting(slowed = new SliderSetting("Slow %", 80.0D, 0.0D, 80.0D, 1.0D)); + this.registerSetting(disableBow = new ButtonSetting("Disable bow", false)); + this.registerSetting(disablePotions = new ButtonSetting("Disable potions", false)); + this.registerSetting(swordOnly = new ButtonSetting("Sword only", false)); + this.registerSetting(vanillaSword = new ButtonSetting("Vanilla sword", false)); + this.registerSetting(groundSpeedOption = new ButtonSetting("Ground Speed", false)); + } + + @Override + public void onDisable() { + resetFloat(); + } + + public void onUpdate() { + if (ModuleManager.bedAura.stopAutoblock) { + return; + } + postPlace = false; + if (vanillaSword.isToggled() && Utils.holdingSword()) { + return; + } + boolean apply = getSlowed() != 0.2f; + if (!apply || !mc.thePlayer.isUsingItem()) { + return; + } + switch ((int) mode.getInput()) { + case 1: + if (mc.thePlayer.ticksExisted % 3 == 0 && !Raven.packetsHandler.C07.get()) { + mc.thePlayer.sendQueue.addToSendQueue(new C08PacketPlayerBlockPlacement(mc.thePlayer.getHeldItem())); + } + break; + case 2: + postPlace = true; + break; + case 3: + if (mc.thePlayer.ticksExisted % 3 == 0 && !Raven.packetsHandler.C07.get()) { + mc.thePlayer.sendQueue.addToSendQueue(new C08PacketPlayerBlockPlacement(new BlockPos(-1, -1, -1), 1, null, 0, 0, 0)); + } + break; + case 4: + if (reSendConsume) { + if (mc.thePlayer.onGround) { + mc.thePlayer.jump(); + break; + } else { + mc.playerController.sendUseItem(mc.thePlayer, mc.theWorld, mc.thePlayer.getHeldItem()); + canFloat = true; + reSendConsume = false; + } + } + break; + } + } + + @SubscribeEvent + public void onPostMotion(PostMotionEvent e) { + if (postPlace && mode.getInput() == 2) { + if (mc.thePlayer.ticksExisted % 3 == 0 && !Raven.packetsHandler.C07.get()) { + mc.thePlayer.sendQueue.addToSendQueue(new C08PacketPlayerBlockPlacement(mc.thePlayer.getHeldItem())); + } + postPlace = false; + } + } + + @SubscribeEvent + public void onPostPlayerInput(PostPlayerInputEvent e) { + if ((canFloat && mc.thePlayer.onGround)) { + if (groundSpeedOption.isToggled() && !Utils.jumpDown() && !ModuleManager.bhop.isEnabled() && Utils.isMoving() && !Utils.bowBackwards()) { + Utils.setSpeed(getSpeedModifier()); + } + } + } + + @SubscribeEvent + public void onPreMotion(PreMotionEvent e) { + if (ModuleManager.bedAura.stopAutoblock || mode.getInput() != 4) { + resetFloat(); + return; + } + postPlace = false; + if (!Mouse.isButtonDown(1)) { + resetFloat(); + noSlowing = false; + //Utils.print("!Noslowing"); + return; + } + if (!canFloat) { + return; + } + if (canFloat) { + e.setPosY(e.getPosY() + 1E-14); + noSlowing = true; + //Utils.print("Noslowing"); + } + if (mc.thePlayer.onGround) { + if (mc.thePlayer.moveStrafing == 0 && mc.thePlayer.moveForward <= 0 && Utils.isMoving()) { + setRotation = true; + } else { + setRotation = false; + } + } + if (Utils.noSlowingBackWithBow()) setRotation = false; + if (groundSpeedOption.isToggled()) { + if (setRotation) { + if (!ModuleManager.killAura.isTargeting && !Utils.noSlowingBackWithBow()) { + float playerYaw = mc.thePlayer.rotationYaw; + e.setYaw(playerYaw -= 55); + } + } + } + } + + @SubscribeEvent + public void onPacketSend(SendPacketEvent e) { + if (e.getPacket() instanceof C08PacketPlayerBlockPlacement && mode.getInput() == 4 && getSlowed() != 0.2f && holdingConsumable(((C08PacketPlayerBlockPlacement) e.getPacket()).getStack()) && !BlockUtils.isInteractable(mc.objectMouseOver) && holdingEdible(((C08PacketPlayerBlockPlacement) e.getPacket()).getStack())) { + if (ModuleManager.skyWars.isEnabled() && Utils.getSkyWarsStatus() == 1) { + return; + } + if (!canFloat) { + if (!mc.thePlayer.onGround) { + canFloat = true; + } else { + if (mc.thePlayer.onGround) { + mc.thePlayer.jump(); + } + reSendConsume = true; + e.setCanceled(true); + } + } + } + } + + @SubscribeEvent + public void onJump(JumpEvent e) { + if (reSendConsume) { + e.setSprint(false); + } + } + + public static float getSlowed() { + if (mc.thePlayer.getHeldItem() == null || ModuleManager.noSlow == null || !ModuleManager.noSlow.isEnabled()) { + return 0.2f; + } + else { + if (swordOnly.isToggled() && !(mc.thePlayer.getHeldItem().getItem() instanceof ItemSword)) { + return 0.2f; + } + if (mc.thePlayer.getHeldItem().getItem() instanceof ItemBow && disableBow.isToggled()) { + return 0.2f; + } + else if (mc.thePlayer.getHeldItem().getItem() instanceof ItemPotion && !ItemPotion.isSplash(mc.thePlayer.getHeldItem().getItemDamage()) && disablePotions.isToggled()) { + return 0.2f; + } + } + float val = (100.0F - (float) slowed.getInput()) / 100.0F; + return val; + } + + public static boolean groundSpeed() { + return groundSpeedOption.isToggled() && noSlowing; + } + + @Override + public String getInfo() { + return modes[(int) mode.getInput()]; + } + + private void resetFloat() { + reSendConsume = false; + canFloat = setRotation = false; + } + + private double getSpeedModifier() { + double speedModifier = 0.2; + final int speedAmplifier = Utils.getSpeedAmplifier(); + switch (speedAmplifier) { + case 0: + speedModifier = 0.2; + break; + case 1: + speedModifier = 0.23; + break; + case 2: + speedModifier = 0.28; + break; + case 3: + speedModifier = 0.32; + break; + case 4: + speedModifier = 0.37; + break; + } + return speedModifier; + } + + private boolean holdingConsumable(ItemStack itemStack) { + Item heldItem = itemStack.getItem(); + if (heldItem instanceof ItemFood || heldItem instanceof ItemBow || (heldItem instanceof ItemPotion && !ItemPotion.isSplash(mc.thePlayer.getHeldItem().getItemDamage())) || (heldItem instanceof ItemSword && !vanillaSword.isToggled())) { + return true; + } + return false; + } + + private boolean holdingEdible(ItemStack stack) { + if (stack.getItem() instanceof ItemFood && mc.thePlayer.getFoodStats().getFoodLevel() == 20) { + ItemFood food = (ItemFood) stack.getItem(); + boolean alwaysEdible = false; + try { + alwaysEdible = Reflection.alwaysEdible.getBoolean(food); + } + catch (Exception e) { + Utils.sendMessage("&cError checking food edibility, check logs."); + e.printStackTrace(); + } + return alwaysEdible; + } + return true; + } +} diff --git a/src/main/java/keystrokesmod/module/impl/movement/Speed.java b/src/main/java/keystrokesmod/module/impl/movement/Speed.java new file mode 100644 index 0000000..63a6206 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/movement/Speed.java @@ -0,0 +1,33 @@ +package keystrokesmod.module.impl.movement; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Utils; + +public class Speed extends Module { + public static SliderSetting speed; + private ButtonSetting strafeOnly; + + public Speed() { + super("Speed", Module.category.movement, 0); + this.registerSetting(speed = new SliderSetting("Speed", 1.2D, 1.0D, 1.5D, 0.01D)); + this.registerSetting(strafeOnly = new ButtonSetting("Strafe only", false)); + } + + public void onUpdate() { + double csp = Utils.getHorizontalSpeed(); + if (csp != 0.0D) { + if (mc.thePlayer.onGround && !mc.thePlayer.capabilities.isFlying) { + if (!strafeOnly.isToggled() || mc.thePlayer.moveStrafing != 0.0F) { + if (mc.thePlayer.hurtTime != mc.thePlayer.maxHurtTime || mc.thePlayer.maxHurtTime <= 0) { + if (!Utils.jumpDown()) { + double val = speed.getInput() - (speed.getInput() - 1.0D) * 0.5D; + Utils.ss(csp * val, true); + } + } + } + } + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/movement/Sprint.java b/src/main/java/keystrokesmod/module/impl/movement/Sprint.java new file mode 100644 index 0000000..1a956e0 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/movement/Sprint.java @@ -0,0 +1,178 @@ +package keystrokesmod.module.impl.movement; + +import keystrokesmod.event.PreMotionEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.settings.KeyBinding; +import net.minecraftforge.fml.client.config.GuiButtonExt; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +import java.io.IOException; + +public class Sprint extends Module { + private ButtonSetting displayText; + private ButtonSetting rainbow; + public SliderSetting omniDirectional; + public String text = "[Sprint (Toggled)]"; + public float posX = 5; + public float posY = 5; + + private String[] omniDirectionalModes = new String[] { "Disabled", "Vanilla", "Hypixel" }; + + public Sprint() { + super("Sprint", category.movement, 0); + this.registerSetting(new DescriptionSetting("Command: '§esprint [msg]§r'")); + this.registerSetting(new ButtonSetting("Edit text position", () -> { + mc.displayGuiScreen(new EditScreen()); + })); + this.registerSetting(displayText = new ButtonSetting("Display text", false)); + this.registerSetting(rainbow = new ButtonSetting("Rainbow", false)); + this.registerSetting(omniDirectional = new SliderSetting("Omni-Directional", 0, omniDirectionalModes)); + this.closetModule = true; + } + + @SubscribeEvent + public void onPreMotion(PreMotionEvent e) { + + if (Utils.noSlowingBackWithBow()) { + ModuleManager.bhop.setRotation = false; + return; + } + if (ModuleManager.sprint.isEnabled() && ModuleManager.sprint.omniDirectional.getInput() == 2) { + if (mc.thePlayer.onGround && mc.thePlayer.moveStrafing == 0 && mc.thePlayer.moveForward <= -0.5 && !Utils.jumpDown()) { + if (!ModuleManager.killAura.isTargeting && !Utils.noSlowingBackWithBow() && !ModuleManager.safeWalk.canSafeWalk()) { + float playerYaw = mc.thePlayer.rotationYaw; + e.setYaw(playerYaw -= 55); + } + } + } + } + + public void onUpdate() { + if (Utils.nullCheck() && mc.inGameHasFocus) { + KeyBinding.setKeyBindState(mc.gameSettings.keyBindSprint.getKeyCode(), true); + } + } + + @SubscribeEvent + public void onRenderTick(TickEvent.RenderTickEvent e) { + if (e.phase != TickEvent.Phase.END || !displayText.isToggled() || !Utils.nullCheck()) { + return; + } + if (mc.currentScreen != null || mc.gameSettings.showDebugInfo) { + return; + } + mc.fontRendererObj.drawStringWithShadow(text, posX, posY, rainbow.isToggled() ? Utils.getChroma(2, 0) : -1); + } + + public boolean omniSprint() { + if (Utils.noSlowingBackWithBow() || Utils.safeWalkBackwards() || !Utils.isMoving()) { + return false; + } + if (mc.thePlayer.moveForward <= 0.5 && Utils.jumpDown()) { + return false; + } + if (ModuleManager.sprint.omniDirectional.getInput() > 0) { + return true; + } + return false; + } + + static class EditScreen extends GuiScreen { + GuiButtonExt resetPosition; + boolean d = false; + int miX = 0; + int miY = 0; + int maX = 0; + int maY = 0; + float aX = 5; + float aY = 5; + int laX = 0; + int laY = 0; + int lmX = 0; + int lmY = 0; + int clickMinX = 0; + + public void initGui() { + super.initGui(); + this.buttonList.add(this.resetPosition = new GuiButtonExt(1, this.width - 90, this.height - 25, 85, 20, "Reset position")); + this.aX = ModuleManager.sprint.posX; + this.aY =ModuleManager.sprint.posY; + } + + public void drawScreen(int mX, int mY, float pt) { + drawRect(0, 0, this.width, this.height, -1308622848); + int miX = (int) this.aX; + int miY = (int) this.aY; + String text = ModuleManager.sprint.text; + int maX = miX + this.mc.fontRendererObj.getStringWidth(text); + int maY = miY + this.mc.fontRendererObj.FONT_HEIGHT; + this.mc.fontRendererObj.drawStringWithShadow(text, this.aX, this.aY, -1); + this.miX = miX; + this.miY = miY; + this.maX = maX; + this.maY = maY; + this.clickMinX = miX; + ModuleManager.sprint.posX = miX; + ModuleManager.sprint.posY = miY; + ScaledResolution res = new ScaledResolution(this.mc); + int x = res.getScaledWidth() / 2 - 84; + int y = res.getScaledHeight() / 2 - 20; + RenderUtils.drawColoredString("Edit the HUD position by dragging.", '-', x, y, 2L, 0L, true, this.mc.fontRendererObj); + + try { + this.handleInput(); + } + catch (IOException var12) { + } + + super.drawScreen(mX, mY, pt); + } + + protected void mouseClickMove(int mX, int mY, int b, long t) { + super.mouseClickMove(mX, mY, b, t); + if (b == 0) { + if (this.d) { + this.aX = this.laX + (mX - this.lmX); + this.aY = this.laY + (mY - this.lmY); + } + else if (mX > this.clickMinX && mX < this.maX && mY > this.miY && mY < this.maY) { + this.d = true; + this.lmX = mX; + this.lmY = mY; + this.laX = (int) this.aX; + this.laY = (int) this.aY; + } + + } + } + + protected void mouseReleased(int mX, int mY, int s) { + super.mouseReleased(mX, mY, s); + if (s == 0) { + this.d = false; + } + } + + public void actionPerformed(GuiButton b) { + if (b == this.resetPosition) { + this.aX = ModuleManager.sprint.posX = 5; + this.aY = ModuleManager.sprint.posY = 5; + } + + } + + public boolean doesGuiPauseGame() { + return false; + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/movement/StopMotion.java b/src/main/java/keystrokesmod/module/impl/movement/StopMotion.java new file mode 100644 index 0000000..6769efb --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/movement/StopMotion.java @@ -0,0 +1,30 @@ +package keystrokesmod.module.impl.movement; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; + +public class StopMotion extends Module { + private ButtonSetting stopX; + private ButtonSetting stopY; + private ButtonSetting stopZ; + + public StopMotion() { + super("Stop Motion", Module.category.movement, 0); + this.registerSetting(stopX = new ButtonSetting("Stop X", true)); + this.registerSetting(stopY = new ButtonSetting("Stop Y", true)); + this.registerSetting(stopZ = new ButtonSetting("Stop Z", true)); + } + + public void onEnable() { + if (stopX.isToggled()) { + mc.thePlayer.motionX = 0; + } + if (stopY.isToggled()) { + mc.thePlayer.motionY = 0; + } + if (stopZ.isToggled()) { + mc.thePlayer.motionZ = 0; + } + this.disable(); + } +} diff --git a/src/main/java/keystrokesmod/module/impl/movement/Teleport.java b/src/main/java/keystrokesmod/module/impl/movement/Teleport.java new file mode 100644 index 0000000..0f39ac0 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/movement/Teleport.java @@ -0,0 +1,112 @@ +package keystrokesmod.module.impl.movement; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.RotationUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraftforge.client.event.MouseEvent; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.awt.*; +import java.util.ArrayList; + +public class Teleport extends Module { + private ButtonSetting rightClick; + private ButtonSetting highlightTarget; + private ButtonSetting highlightPath; + private BlockPos targetPos; + private ArrayList path = new ArrayList<>(); + public Teleport() { + super("Teleport", category.movement); + this.registerSetting(rightClick = new ButtonSetting("Right click teleport", true)); + this.registerSetting(highlightTarget = new ButtonSetting("Highlight target", true)); + this.registerSetting(highlightPath = new ButtonSetting("Highlight path", false)); + } + + public void teleport(BlockPos targetBlock, boolean sendMessage) { + targetBlock = targetBlock.up(1); + ArrayList pathList = this.path = getPath(targetBlock); + int packetsSent = 0; + for (Vec3 pathPos : pathList) { + mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(pathPos.xCoord, pathPos.yCoord, pathPos.zCoord, true)); + if (++packetsSent >= 175) { + if (sendMessage) { + Utils.sendMessage("&eToo many packets, ending loop."); + break; + } + break; + } + } + mc.thePlayer.setPosition(targetBlock.getX(), targetBlock.getY(), targetBlock.getZ()); + if (sendMessage) { + Utils.sendMessage("&eTeleported to &d(" + targetBlock.getX() + ", " + targetBlock.getY() + ", " + targetBlock.getZ() + ") &ewith &b" + packetsSent + " &epackets."); + } + } + + @SubscribeEvent + public void onRenderWorld(RenderWorldLastEvent e) { + if (!rightClick.isToggled() || !highlightTarget.isToggled() || this.targetPos == null || !Utils.nullCheck()) { + return; + } + RenderUtils.renderBlock(targetPos, Color.orange.getRGB(), true, true); + if (highlightPath.isToggled()) { + int positions = 0; + for (Vec3 pos : this.path) { + if (positions >= 175) { + break; + } + RenderUtils.renderBlock(new BlockPos(pos.xCoord, pos.yCoord, pos.zCoord), Color.yellow.getRGB(), false, true); + ++positions; + } + } + } + + private ArrayList getPath(BlockPos target) { + ArrayList path = new ArrayList<>(); + double newX = (double)target.getX() + 0.5; + double newY = target.getY() + 1; + double newZ = (double)target.getZ() + 0.5; + double distance = this.mc.thePlayer.getDistance(newX, newY, newZ); + double d = 0; + while (d < distance) { + path.add(new Vec3(this.mc.thePlayer.posX + (newX - (double)this.mc.thePlayer.getHorizontalFacing().getFrontOffsetX() - this.mc.thePlayer.posX) * d / distance, this.mc.thePlayer.posY + (newY - this.mc.thePlayer.posY) * d / distance, this.mc.thePlayer.posZ + (newZ - (double)this.mc.thePlayer.getHorizontalFacing().getFrontOffsetZ() - this.mc.thePlayer.posZ) * d / distance)); + d += 2.0; + } + return path; + } + + @SubscribeEvent + public void onMouse(MouseEvent mouseEvent) { + if (mouseEvent.button != 1 || !mouseEvent.buttonstate || !rightClick.isToggled() || !Utils.nullCheck()) { + return; + } + MovingObjectPosition rayCast = RotationUtils.rayCast(150.0, mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch, true); + if (rayCast == null || rayCast.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK) { + return; + } + final BlockPos getBlockPos = rayCast.getBlockPos(); + this.targetPos = getBlockPos; + teleport(getBlockPos, true); + } + + @Override + public void onEnable() { + this.targetPos = null; + this.path.clear(); + if (rightClick.isToggled()) { + return; + } + MovingObjectPosition rayCast = RotationUtils.rayCast(150.0, mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch, true); + if (rayCast == null || rayCast.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK) { + return; + } + teleport(rayCast.getBlockPos(), true); + this.disable(); + } +} diff --git a/src/main/java/keystrokesmod/module/impl/movement/Timer.java b/src/main/java/keystrokesmod/module/impl/movement/Timer.java new file mode 100644 index 0000000..f968c05 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/movement/Timer.java @@ -0,0 +1,40 @@ +package keystrokesmod.module.impl.movement; + +import keystrokesmod.clickgui.ClickGui; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Utils; + +public class Timer extends Module { + private SliderSetting speed; + private ButtonSetting strafeOnly; + + public Timer() { + super("Timer", Module.category.movement, 0); + this.registerSetting(speed = new SliderSetting("Speed", 1.0D, 0.5D, 2.5D, 0.01D)); + this.registerSetting(strafeOnly = new ButtonSetting("Strafe only", false)); + } + + @Override + public String getInfo() { + return Utils.isWholeNumber(speed.getInput()) ? (int) speed.getInput() + "" : speed.getInput() + ""; + } + + public void onUpdate() { + if (!(mc.currentScreen instanceof ClickGui)) { + if (strafeOnly.isToggled() && mc.thePlayer.moveStrafing == 0) { + Utils.resetTimer(); + return; + } + Utils.getTimer().timerSpeed = (float) speed.getInput(); + } + else { + Utils.resetTimer(); + } + } + + public void onDisable() { + Utils.resetTimer(); + } +} diff --git a/src/main/java/keystrokesmod/module/impl/movement/VClip.java b/src/main/java/keystrokesmod/module/impl/movement/VClip.java new file mode 100644 index 0000000..4a7e426 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/movement/VClip.java @@ -0,0 +1,29 @@ +package keystrokesmod.module.impl.movement; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Utils; + +public class VClip extends Module { + private SliderSetting distance; + private ButtonSetting sendMessage; + + public VClip() { + super("VClip", Module.category.movement, 0); + this.registerSetting(distance = new SliderSetting("Distance", 3.0, -20.0, 20.0, 0.5)); + this.registerSetting(sendMessage = new ButtonSetting("Send message", true)); + } + + public void onEnable() { + final double distance = this.distance.getInput(); + if (this.distance.getInput() != 0.0D) { + mc.thePlayer.setPosition(mc.thePlayer.posX, mc.thePlayer.posY + distance, mc.thePlayer.posZ); + if (sendMessage.isToggled()) { + Utils.sendMessage("&7Teleported you " + ((distance > 0.0) ? "upwards" : "downwards") + " by &b" + distance + " &7blocks."); + } + } + + this.disable(); + } +} diff --git a/src/main/java/keystrokesmod/module/impl/other/Anticheat.java b/src/main/java/keystrokesmod/module/impl/other/Anticheat.java new file mode 100644 index 0000000..2b55922 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/other/Anticheat.java @@ -0,0 +1,180 @@ +package keystrokesmod.module.impl.other; + +import keystrokesmod.module.Module; +import keystrokesmod.module.impl.world.AntiBot; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.BlockUtils; +import keystrokesmod.utility.PlayerData; +import keystrokesmod.utility.Utils; +import net.minecraft.block.BlockAir; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.event.ClickEvent; +import net.minecraft.item.ItemBlock; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatStyle; +import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.HashMap; +import java.util.UUID; + +public class Anticheat extends Module { + private SliderSetting interval; + private ButtonSetting enemyAdd; + private ButtonSetting autoReport; + private ButtonSetting ignoreTeammates; + private ButtonSetting atlasSuspect; + private ButtonSetting shouldPing; + private ButtonSetting autoBlock; + private ButtonSetting noFall; + private ButtonSetting noSlow; + private ButtonSetting scaffold; + private ButtonSetting legitScaffold; + private HashMap> flags = new HashMap<>(); + private HashMap players = new HashMap<>(); + private long lastAlert; + public Anticheat() { + super("Anticheat", category.other); + this.registerSetting(new DescriptionSetting("Tries to detect cheaters.")); + this.registerSetting(interval = new SliderSetting("Flag interval", " second", 20.0, 0.0, 60.0, 1.0)); + this.registerSetting(enemyAdd = new ButtonSetting("Add cheaters as enemy", false)); + this.registerSetting(autoReport = new ButtonSetting("Auto report", false)); + this.registerSetting(ignoreTeammates = new ButtonSetting("Ignore teammates", false)); + this.registerSetting(atlasSuspect = new ButtonSetting("Only atlas suspect", false)); + this.registerSetting(shouldPing = new ButtonSetting("Should ping", true)); + this.registerSetting(new DescriptionSetting("Detected cheats")); + this.registerSetting(autoBlock = new ButtonSetting("Autoblock", true)); + this.registerSetting(noFall = new ButtonSetting("NoFall", true)); + this.registerSetting(noSlow = new ButtonSetting("NoSlow", true)); + this.registerSetting(scaffold = new ButtonSetting("Scaffold", true)); + this.registerSetting(legitScaffold = new ButtonSetting("Legit scaffold", true)); + this.closetModule = true; + } + + private void alert(final EntityPlayer entityPlayer, ButtonSetting mode) { + if (Utils.isFriended(entityPlayer) || (ignoreTeammates.isToggled() && Utils.isTeamMate(entityPlayer))) { + return; + } + if (atlasSuspect.isToggled()) { + if (!entityPlayer.getName().equals("Suspect§r")) { + return; + } + } + else if (enemyAdd.isToggled()) { + Utils.addEnemy(entityPlayer.getName()); + } + final long currentTimeMillis = System.currentTimeMillis(); + if (interval.getInput() > 0.0) { + HashMap hashMap = flags.get(entityPlayer.getUniqueID()); + if (hashMap == null) { + hashMap = new HashMap<>(); + } + else { + final Long n = hashMap.get(mode); + if (n != null && Utils.timeBetween(n, currentTimeMillis) <= interval.getInput() * 1000.0) { + return; + } + } + hashMap.put(mode, currentTimeMillis); + flags.put(entityPlayer.getUniqueID(), hashMap); + } + final ChatComponentText chatComponentText = new ChatComponentText(Utils.formatColor("&7[&dR&7]&r " + entityPlayer.getDisplayName().getUnformattedText() + " &7detected for &d" + mode.getName())); + final ChatStyle chatStyle = new ChatStyle(); + chatStyle.setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/wdr " + entityPlayer.getName())); + chatComponentText.appendSibling(new ChatComponentText(Utils.formatColor(" §7[§cWDR§7]")).setChatStyle(chatStyle)); + mc.thePlayer.addChatMessage(chatComponentText); + if (shouldPing.isToggled() && Utils.timeBetween(lastAlert, currentTimeMillis) >= 1500L) { + mc.thePlayer.playSound("note.pling", 1.0f, 1.0f); + lastAlert = currentTimeMillis; + } + if (autoReport.isToggled() && !Utils.isFriended(entityPlayer)) { + mc.thePlayer.sendChatMessage("/wdr " + Utils.stripColor(entityPlayer.getGameProfile().getName())); + } + } + + public void onUpdate() { + if (mc.isSingleplayer()) { + return; + } + for (EntityPlayer entityPlayer : mc.theWorld.playerEntities) { + if (entityPlayer == null) { + continue; + } + if (entityPlayer == mc.thePlayer) { + continue; + } + if (AntiBot.isBot(entityPlayer)) { + continue; + } + PlayerData data = players.get(entityPlayer.getUniqueID()); + if (data == null) { + data = new PlayerData(); + } + data.update(entityPlayer); + this.performCheck(entityPlayer, data); + data.updateServerPos(entityPlayer); + data.updateSneak(entityPlayer); + players.put(entityPlayer.getUniqueID(), data); + } + } + + @SubscribeEvent + public void onEntityJoin(EntityJoinWorldEvent e) { + if (e.entity == mc.thePlayer) { + players.clear(); + flags.clear(); + } + } + + public void onDisable() { + players.clear(); + flags.clear(); + lastAlert = 0L; + } + + private void performCheck(EntityPlayer entityPlayer, PlayerData playerData) { + if (autoBlock.isToggled() && playerData.autoBlockTicks >= 10) { + alert(entityPlayer, autoBlock); + return; + } + if (legitScaffold.isToggled() && playerData.sneakTicks >= 3) { + alert(entityPlayer, legitScaffold); + return; + } + if (noSlow.isToggled() && playerData.noSlowTicks >= 11 && playerData.speed >= 0.08) { + alert(entityPlayer, noSlow); + return; + } + if (scaffold.isToggled() && entityPlayer.isSwingInProgress && entityPlayer.rotationPitch >= 70.0f && entityPlayer.getHeldItem() != null && entityPlayer.getHeldItem().getItem() instanceof ItemBlock && playerData.fastTick >= 20 && entityPlayer.ticksExisted - playerData.lastSneakTick >= 30 && entityPlayer.ticksExisted - playerData.aboveVoidTicks >= 20) { + boolean overAir = true; + BlockPos blockPos = entityPlayer.getPosition().down(2); + for (int i = 0; i < 4; ++i) { + if (!(BlockUtils.getBlock(blockPos) instanceof BlockAir)) { + overAir = false; + break; + } + blockPos = blockPos.down(); + } + if (overAir) { + alert(entityPlayer, scaffold); + return; + } + } + if (noFall.isToggled() && !entityPlayer.capabilities.isFlying) { + double serverPosX = entityPlayer.serverPosX / 32; + double serverPosY = entityPlayer.serverPosY / 32; + double serverPosZ= entityPlayer.serverPosZ / 32; + double deltaX = Math.abs(playerData.serverPosX - serverPosX); + double deltaY = playerData.serverPosY - serverPosY; + double deltaZ = Math.abs(playerData.serverPosZ - serverPosZ); + if (deltaY >= 5 && deltaX <= 10 && deltaZ <= 10 && deltaY <= 40) { + if (!Utils.overVoid(serverPosX, serverPosY, serverPosZ) && Utils.distanceToGround(entityPlayer) > 3 && !Utils.onLadder(entityPlayer) && !entityPlayer.isInWater() && !entityPlayer.isInLava()) { + alert(entityPlayer, noFall); + } + } + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/other/ChatBypass.java b/src/main/java/keystrokesmod/module/impl/other/ChatBypass.java new file mode 100644 index 0000000..8aac0c5 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/other/ChatBypass.java @@ -0,0 +1,119 @@ +package keystrokesmod.module.impl.other; + +import keystrokesmod.event.SendPacketEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.utility.PacketUtils; +import keystrokesmod.utility.Reflection; +import keystrokesmod.utility.Utils; +import net.minecraft.network.Packet; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.Arrays; +import java.util.List; + +public class ChatBypass extends Module { + private ButtonSetting filterKnownWords; + List filteredWords = Arrays.asList( + // blocked words + "kill", "retard", "anal", "beaner", "bestiality", "blowjob", "cameltoe", "chink", "clit", "cock", "coon", "cunnilingus", "cunt", "dick", "dildo", "dilf", "dyke", "ejaculate", "ejaculati" /*ing & ion*/, + "fag", "foreskin", "gilf", "hentai", "jerkoff", "jizz", "kike", "kill yourself", "kill urself", "kys", "loli", "masturbate", "masturbati" /*ing & ion*/, "milf", "nazi", "nigga", "nigger", + "orgy", "pedo", "penis", "porn", "pussy", "rape", "raping", "redtube", "retard", "schlong", "shemale", "sex", "swastika", "tits", "titties", "trannie", "tranny", "vagina", "whore", "xhamster", + "xvideos", "end", + // censored words + "arse", "ass", "bastard", "bitch", "boob", "douche", "fuck", "hitler", "shit", "twat", "wank" + ); + + List allowedCommands = Arrays.asList( + "ac", "achat", "pc", "pchat", "gc", "gchat", "shout", "msg", "message", "r", "reply", "t", "tell", "w", "whisper" + ); + + public ChatBypass() { + super("Chat Bypass", category.other); + this.registerSetting(filterKnownWords = new ButtonSetting("Only filter known words", true)); + } + + @SubscribeEvent + public void onSendPacket(SendPacketEvent e) { + if (!Utils.nullCheck()) { + return; + } + if (!(e.getPacket() instanceof C01PacketChatMessage)) return; + Packet packet = e.getPacket(); + C01PacketChatMessage c01 = (C01PacketChatMessage) e.getPacket(); + String msg = c01.getMessage(); + String[] split = splitCommand(msg); + + if (split == null || split[1].isEmpty()) { + return; // filter commands + } + + msg = split[1]; // set msg to just message to ignore command + + if (filterKnownWords.isToggled()) { + StringBuilder newMsg = new StringBuilder(); + String[] words = msg.split(" "); + for (String word : words) { + String lowerCaseWord = word.toLowerCase(); + for (String filteredWord : filteredWords) { + int index = lowerCaseWord.indexOf(filteredWord.toLowerCase()); + if (index != -1) { + String matched = word.substring(index, index + filteredWord.length()), + replaced = doReplace(matched); + word = word.substring(0, index) + replaced + word.substring(index + filteredWord.length()); + } + } + newMsg.append(word).append(" "); + } + msg = newMsg.toString().trim(); + } else { + msg = doReplace(msg); + } + + if (split[0] != null) { // if command existed, re-add + msg = split[0] + " " + msg; + } + + PacketUtils.sendPacketNoEvent(new C01PacketChatMessage(msg)); + e.setCanceled(true); // cancel original packet + } + + private String[] splitCommand(String msg) { + if (msg.startsWith("/")) { + if (!isValidCommand(msg)) { + return null; + } + int spaceIndex = msg.indexOf(" "); + if (spaceIndex != -1) { // command arguments found + return new String[]{ + msg.substring(0, spaceIndex), // command + msg.substring(spaceIndex + 1) // args + }; + } + } + return new String[]{null, msg}; + } + + private String doReplace(String text) { + return text + .replace("a", replace_a).replace("e", replace_e).replace("i", replace_i) + .replace("o", replace_o).replace("u", replace_u).replace("y", replace_y) + .replace("A", replace_A).replace("E", replace_E).replace("I", replace_I) + .replace("O", replace_O).replace("U", replace_U).replace("Y", replace_Y); + } + + // assumes its already a command (starts with /) + private boolean isValidCommand(String msg) { + for (String cmd : allowedCommands) { + String _cmd = "/" + cmd + " "; + if (msg.startsWith(_cmd)) { + return true; + } + } + return false; + } + + String replace_a = "\u00E1", replace_e = "\u00E9", replace_i = "\u00A1", replace_o = "\u00F3", replace_u = "\u00FA", replace_y = "\u00FF", + replace_A = "\u00C1", replace_E = "\u00C9", replace_I = replace_i, replace_O = "\u00D3", replace_U = "\u00DA", replace_Y = replace_y; +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/other/DebugAC.java b/src/main/java/keystrokesmod/module/impl/other/DebugAC.java new file mode 100644 index 0000000..e33b473 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/other/DebugAC.java @@ -0,0 +1,134 @@ +package keystrokesmod.module.impl.other; + +import keystrokesmod.event.AllPacketsEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.utility.BlockUtils; +import keystrokesmod.utility.RotationUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.block.Block; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityCreature; +import net.minecraft.init.Blocks; +import net.minecraft.network.play.client.*; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MovingObjectPosition; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; + +public class DebugAC extends Module { + private ButtonSetting debugMob; + private ButtonSetting debugBlock; + private ButtonSetting alertPost; + public static long lastC03; + + public DebugAC() { + super("Debug AC", category.other); + this.registerSetting(debugBlock = new ButtonSetting("Debug block", true)); + this.registerSetting(debugMob = new ButtonSetting("Debug mob", true)); + this.registerSetting(alertPost = new ButtonSetting("Alert post", false)); + } + + public void onDisable() { + + } + + @SubscribeEvent + public void onRenderTick(TickEvent.RenderTickEvent ev) { + if (ev.phase != TickEvent.Phase.END || !Utils.nullCheck()) { + return; + } + + if (debugBlock.isToggled()) { + MovingObjectPosition mouse = RotationUtils.rayCast(mc.playerController.getBlockReachDistance(), mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch, false); + if (mouse == null || mouse.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK || mouse.getBlockPos() == null) { + return; + } + + BlockPos pos = mouse.getBlockPos(); + Block block = BlockUtils.getBlock(pos); + if (block == null || block == Blocks.air) { + return; + } + + IBlockState state = mc.theWorld.getBlockState(pos); + + mc.fontRendererObj.drawStringWithShadow("§7BlockPos: §b" + pos.getX() + "§7, §b" + pos.getY() + "§7, §b" + pos.getZ(), 30, 20, -1); + mc.fontRendererObj.drawStringWithShadow("§7HitVec: §b" + Utils.round(mouse.hitVec.xCoord, 3) + "§7, §b" + Utils.round(mouse.hitVec.yCoord, 3) + "§7, §b" + Utils.round(mouse.hitVec.zCoord, 3), 30, 30, -1); + mc.fontRendererObj.drawStringWithShadow("§7Face: §b" + mouse.sideHit.name(), 30, 40, -1); + mc.fontRendererObj.drawStringWithShadow("§7Unlocalized Name: §b" + block.getUnlocalizedName(), 30, 50, -1); + mc.fontRendererObj.drawStringWithShadow("§7Registry Name: §b" + block.getRegistryName(), 30, 60, -1); + + int y = 70; + + for (IProperty property : block.getBlockState().getProperties()) { + Class valueClass = property.getValueClass(); + String propName = property.getName(); + + Object currentValue = state.getValue(property); + + Collection allowedValues = property.getAllowedValues(); + + mc.fontRendererObj.drawStringWithShadow("§7Property Name: §b" + propName, 30, y, -1); + y += 10; + mc.fontRendererObj.drawStringWithShadow("§7Value Type: §b" + valueClass.getName(), 30, y, -1); + y += 10; + + if (currentValue != null) { + mc.fontRendererObj.drawStringWithShadow("§7Current Value: §b" + currentValue, 30, y, -1); + y += 10; + + if (valueClass.isEnum()) { + Enum enumValue = (Enum) currentValue; + mc.fontRendererObj.drawStringWithShadow("§7Current Enum Name: §b" + enumValue.name(), 30, y, -1); + y += 10; + mc.fontRendererObj.drawStringWithShadow("§7Current Enum Ordinal: §b" + enumValue.ordinal(), 30, y, -1); + y += 10; + } + } + + mc.fontRendererObj.drawStringWithShadow("§7Allowed Values: §b" + allowedValues, 30, y, -1); + y += 10; + + if (valueClass.isEnum()) { + Object[] enumConstants = valueClass.getEnumConstants(); + if (Arrays.toString(enumConstants).equals(allowedValues.toString())) { + break; + } + mc.fontRendererObj.drawStringWithShadow("§7Enum Constants: §b" + Arrays.toString(enumConstants), 30, y, -1); + y += 10; + } + + y += 5; + } + } + if (debugMob.isToggled()) { + MovingObjectPosition movingObjectPosition = mc.objectMouseOver; + if (movingObjectPosition == null || movingObjectPosition.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY || movingObjectPosition.entityHit == null || !(movingObjectPosition.entityHit instanceof EntityCreature)) { + return; + } + int xPos = 30; + int yPos = 20; + EntityCreature mob = (EntityCreature) movingObjectPosition.entityHit; + String mobName = mob.getName(); + String attackerName = mob.getAttackTarget() == null ? "&7null" : mob.getAttackTarget().getDisplayName().getFormattedText(); + List info = Arrays.asList(mobName, attackerName); + for (String data : info) { + mc.fontRendererObj.drawStringWithShadow(data, xPos, yPos, -1); + yPos += mc.fontRendererObj.FONT_HEIGHT + 3; + } + } + } + + @SubscribeEvent + public void onAllPacketSent(AllPacketsEvent e) { + if (e.getPacket() instanceof C03PacketPlayer) { + lastC03 = System.currentTimeMillis(); + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/other/FakeChat.java b/src/main/java/keystrokesmod/module/impl/other/FakeChat.java new file mode 100644 index 0000000..de8e6f7 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/other/FakeChat.java @@ -0,0 +1,35 @@ +package keystrokesmod.module.impl.other; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.utility.Utils; +import net.minecraft.util.ChatComponentText; + +public class FakeChat extends Module { + public static String msg = "&eThis is a fake chat message."; + public static final String command = "fakechat"; + public static final String c4 = "&cInvalid message."; + + public FakeChat() { + super("Fake Chat", Module.category.other, 0); + this.registerSetting(new DescriptionSetting("Command: '§e" + command + " [msg]§r'")); + } + + public void onEnable() { + if (msg.contains("\\n")) { + String[] split = msg.split("\\\\n"); + + for (String s : split) { + this.sm(s); + } + } else { + this.sm(msg); + } + + this.disable(); + } + + private void sm(String txt) { + mc.thePlayer.addChatMessage(new ChatComponentText(Utils.formatColor(txt))); + } +} diff --git a/src/main/java/keystrokesmod/module/impl/other/LatencyAlerts.java b/src/main/java/keystrokesmod/module/impl/other/LatencyAlerts.java new file mode 100644 index 0000000..2f4683b --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/other/LatencyAlerts.java @@ -0,0 +1,64 @@ +package keystrokesmod.module.impl.other; + +import keystrokesmod.event.ReceivePacketEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Utils; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.List; + +public class LatencyAlerts extends Module { + private SliderSetting interval; + private SliderSetting highLatency; + private ButtonSetting ignoreLimbo; + private long lastPacket; + private long lastAlert; + public LatencyAlerts() { + super("Latency Alerts", category.other); + this.registerSetting(new DescriptionSetting("Detects packet loss.")); + this.registerSetting(interval = new SliderSetting("Alert interval", " second", 3.0, 0.0, 5.0, 0.1)); + this.registerSetting(highLatency = new SliderSetting("High latency", " second", 0.5, 0.1, 5.0, 0.1)); + this.registerSetting(ignoreLimbo = new ButtonSetting("Ignore limbo", true)); + this.closetModule = true; + } + + @SubscribeEvent + public void onPacketReceive(ReceivePacketEvent e) { + lastPacket = System.currentTimeMillis(); + } + + public void onUpdate() { + if (mc.isSingleplayer() || (ignoreLimbo.isToggled() && inLimbo())) { + lastPacket = System.currentTimeMillis(); + lastAlert = System.currentTimeMillis(); + return; + } + long currentMs = System.currentTimeMillis(); + if (currentMs - lastPacket >= highLatency.getInput() * 1000 && currentMs - lastAlert >= interval.getInput() * 1000) { + Utils.sendMessage("&7Packet loss detected: " + "§c" + Math.abs(System.currentTimeMillis() - lastPacket) + "&7ms"); + lastAlert = System.currentTimeMillis(); + } + } + + public void onDisable() { + lastPacket = 0; + lastAlert = 0; + } + + public void onEnable() { + lastPacket = System.currentTimeMillis(); + } + + public boolean inLimbo() { + List scoreboard = Utils.getSidebarLines(); + if (scoreboard == null || scoreboard.isEmpty()) { + if (mc.theWorld.provider.getDimensionName().equals("The End")) { + return true; + } + } + return false; + } +} diff --git a/src/main/java/keystrokesmod/module/impl/other/NameHider.java b/src/main/java/keystrokesmod/module/impl/other/NameHider.java new file mode 100644 index 0000000..bdcd797 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/other/NameHider.java @@ -0,0 +1,37 @@ +package keystrokesmod.module.impl.other; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.utility.Utils; +import net.minecraft.client.network.NetworkPlayerInfo; + +public class NameHider extends Module { + public static String fakeName = "raven"; + public static ButtonSetting hideAllNames; + + public NameHider() { + super("Name Hider", Module.category.other); + this.registerSetting(new DescriptionSetting("Command: '§ecname [name]§r'")); + this.registerSetting(hideAllNames = new ButtonSetting("Hide all names", false)); + } + + public static String getFakeName(String s) { + if (mc.thePlayer != null) { + if (hideAllNames.isToggled()) { + s = s.replace(Utils.getServerName(), "You"); + NetworkPlayerInfo getPlayerInfo = mc.getNetHandler().getPlayerInfo(mc.thePlayer.getUniqueID()); + for (NetworkPlayerInfo networkPlayerInfo : mc.getNetHandler().getPlayerInfoMap()) { + if (networkPlayerInfo.equals(getPlayerInfo)) { + continue; + } + s = s.replace(networkPlayerInfo.getGameProfile().getName(), fakeName); + } + } + else { + s = s.replace(Utils.getServerName(), fakeName); + } + } + return s; + } +} diff --git a/src/main/java/keystrokesmod/module/impl/other/Test.java b/src/main/java/keystrokesmod/module/impl/other/Test.java new file mode 100644 index 0000000..f1bdbea --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/other/Test.java @@ -0,0 +1,36 @@ +package keystrokesmod.module.impl.other; + +import com.mojang.authlib.GameProfile; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import net.minecraft.client.entity.EntityOtherPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class Test extends Module { + public EntityOtherPlayerMP fakeEntity = null; + private ButtonSetting spawnDummy; + + public Test() { + super("Test", category.other); + this.registerSetting(spawnDummy = new ButtonSetting("Spawn dummy", true)); + } + + public void onEnable() { + if (spawnDummy.isToggled()) { + fakeEntity = new EntityOtherPlayerMP(mc.theWorld, new GameProfile(mc.thePlayer.getUniqueID(), "Dummy")); + fakeEntity.copyLocationAndAnglesFrom(mc.thePlayer); + mc.theWorld.addEntityToWorld(-8008, fakeEntity); + fakeEntity.inventory.armorInventory[0] = new ItemStack(Items.golden_helmet); + fakeEntity.setCurrentItemOrArmor(0, new ItemStack(Blocks.wool)); + } + } + + public void onDisable() { + if (fakeEntity != null) { + mc.theWorld.removeEntity(fakeEntity); + fakeEntity = null; + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/other/ViewPackets.java b/src/main/java/keystrokesmod/module/impl/other/ViewPackets.java new file mode 100644 index 0000000..3a8f3e0 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/other/ViewPackets.java @@ -0,0 +1,171 @@ +package keystrokesmod.module.impl.other; + +import keystrokesmod.event.ReceivePacketEvent; +import keystrokesmod.event.SendPacketEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.utility.Utils; +import net.minecraft.entity.Entity; +import net.minecraft.event.HoverEvent; +import net.minecraft.network.Packet; +import net.minecraft.network.play.client.*; +import net.minecraft.util.*; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +public class ViewPackets extends Module { + private ButtonSetting includeCancelled; + private ButtonSetting singlePlayer; + private ButtonSetting sent; + private ButtonSetting ignoreC00; + private ButtonSetting ignoreC03; + private ButtonSetting compactC03; + private ButtonSetting ignoreC0F; + private ButtonSetting received; + private Packet packet; + public static long tick; + + public ViewPackets() { + super("View Packets", category.other); + this.registerSetting(includeCancelled = new ButtonSetting("Include cancelled", true)); + this.registerSetting(singlePlayer = new ButtonSetting("Singleplayer", false)); + this.registerSetting(sent = new ButtonSetting("Sent", false)); + this.registerSetting(ignoreC00 = new ButtonSetting("Ignore C00", false)); + this.registerSetting(ignoreC03 = new ButtonSetting("Ignore C03", false)); + this.registerSetting(compactC03 = new ButtonSetting("Compact C03", false)); + this.registerSetting(ignoreC0F = new ButtonSetting("Ignore C0F", false)); + this.registerSetting(received = new ButtonSetting("Received", false)); + } + + public void onDisable() { + packet = null; + tick = 0; + } + + private static String formatBoolean(final boolean b) { + return b ? "&atrue" : "&cfalse"; + } + + private void sendMessage(final Packet packet, final boolean b) { + if (!Utils.nullCheck()) { + return; + } + final String s = b ? ("&a" + packet.getClass().getSimpleName()) : applyInfo(packet); + final String string = ((compactC03.isToggled() && packet instanceof C03PacketPlayer) ? "&6" : "&d") + packet.getClass().getSimpleName(); + final ChatComponentText chatComponentText = new ChatComponentText(Utils.formatColor("&7[&dR&7]&r &7" + (b ? "Received" : "Sent") + " packet (t:&b" + tick + "&7): ")); + final ChatStyle chatStyle = new ChatStyle(); + chatStyle.setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(Utils.formatColor(s)))); + ((IChatComponent)chatComponentText).appendSibling(new ChatComponentText(Utils.formatColor(string)).setChatStyle(chatStyle)); + mc.thePlayer.addChatMessage(chatComponentText); + } + + @SubscribeEvent + public void onSendPacket(SendPacketEvent e) { + if (!sent.isToggled()) { + return; + } + if (singlePlayer.isToggled() && mc.isSingleplayer() && e.getPacket().getClass().getSimpleName().charAt(0) == 'S') { + return; + } + if (e.isCanceled() && !includeCancelled.isToggled()) { + return; + } + if (ignoreC00.isToggled() && e.getPacket() instanceof C00PacketKeepAlive) { + return; + } + if (ignoreC0F.isToggled() && e.getPacket() instanceof C0FPacketConfirmTransaction) { + return; + } + if (e.getPacket() instanceof C03PacketPlayer && (ignoreC03.isToggled() || (compactC03.isToggled() && (packet == null || packet instanceof C03PacketPlayer)))) { + return; + } + sendMessage(packet = e.getPacket(), false); + } + + @SubscribeEvent + public void onReceivePacket(ReceivePacketEvent e) { + if (!received.isToggled()) { + return; + } + if (singlePlayer.isToggled() && mc.isSingleplayer() && e.getPacket().getClass().getSimpleName().charAt(0) == 'C') { + return; + } + sendMessage(e.getPacket(), true); + } + + private String applyInfo(final Packet packet) { + String s = "&a" + packet.getClass().getSimpleName(); + if (packet instanceof C07PacketPlayerDigging) { + final C07PacketPlayerDigging c07PacketPlayerDigging = (C07PacketPlayerDigging)packet; + final String string = s + "\n&7Status: &b" + c07PacketPlayerDigging.getStatus().name() + "\n&7Facing: &b" + c07PacketPlayerDigging.getFacing().name(); + final BlockPos getPosition = c07PacketPlayerDigging.getPosition(); + s = string + "\n&7Position: &b" + getPosition.getX() + "&7, &b" + getPosition.getY() + "&7, &b" + getPosition.getZ(); + } + else if (packet instanceof C09PacketHeldItemChange) { + s = s + "\n&7Swap to slot: &b" + ((C09PacketHeldItemChange)packet).getSlotId(); + } + else if (packet instanceof C0BPacketEntityAction) { + s = s + "\n&7Action: &b" + ((C0BPacketEntityAction)packet).getAction().name() + "\n&7Aux data: &b" + ((C0BPacketEntityAction)packet).getAuxData(); + } + else if (packet instanceof C08PacketPlayerBlockPlacement) { + final C08PacketPlayerBlockPlacement c08PacketPlayerBlockPlacement = (C08PacketPlayerBlockPlacement)packet; + final String string2 = s + "\n&7Item: &b" + ((c08PacketPlayerBlockPlacement.getStack() == null) ? "null" : c08PacketPlayerBlockPlacement.getStack().getItem().getRegistryName().replace("minecraft:", "")) + "\n&7Direction: &b" + c08PacketPlayerBlockPlacement.getPlacedBlockDirection(); + final BlockPos getPosition = c08PacketPlayerBlockPlacement.getPosition(); + s = string2 + "\n&7Position: &b" + getPosition.getX() + "&7, &b" + getPosition.getY() + "&7, &b" + getPosition.getZ() + "\n&7Offset: &b" + round((double)c08PacketPlayerBlockPlacement.getPlacedBlockOffsetX()) + "&7, &b" + round((double)c08PacketPlayerBlockPlacement.getPlacedBlockOffsetY()) + "&7, &b" + round(c08PacketPlayerBlockPlacement.getPlacedBlockOffsetZ()); + } + else if (packet instanceof C02PacketUseEntity) { + final C02PacketUseEntity c02PacketUseEntity = (C02PacketUseEntity)packet; + final String string3 = s + "\n&7Action: &b" + c02PacketUseEntity.getAction().name(); + final Entity getEntityFromWorld = c02PacketUseEntity.getEntityFromWorld(mc.theWorld); + final String string4 = string3 + "\n&7Target: &b" + ((getEntityFromWorld == null) ? "null" : getEntityFromWorld.getName()); + final Vec3 getHitVec = c02PacketUseEntity.getHitVec(); + if (getHitVec == null) { + s = string4 + "\n&7Hit vec: &bnull"; + } + else { + s = string4 + "\n&7Hit vec: &b" + round(getHitVec.xCoord) + "&7, &b" + round(getHitVec.yCoord) + "&7, &b" + round(getHitVec.zCoord); + } + } + else if (packet instanceof C01PacketChatMessage) { + s = s + "\n&7Length: &b" + ((C01PacketChatMessage)packet).getMessage().length(); + } + else if (packet instanceof C17PacketCustomPayload) { + s = s + "\n&7Channel: &b" + ((C17PacketCustomPayload)packet).getChannelName(); + } + else if (packet instanceof C15PacketClientSettings) { + s = s + "\n&7Language: &b" + ((C15PacketClientSettings)packet).getLang() + "\n&7Chat visibility: &b" + ((C15PacketClientSettings)packet).getChatVisibility().name(); + } + else if (packet instanceof C00PacketKeepAlive) { + s = s + "\n&7Key: &b" + ((C00PacketKeepAlive)packet).getKey(); + } + else if (packet instanceof C16PacketClientStatus) { + s = s + "\n&7Status: &b" + ((C16PacketClientStatus)packet).getStatus().name(); + } + else if (packet instanceof C10PacketCreativeInventoryAction) { + s = s + "\n&7Slot: &b" + ((C10PacketCreativeInventoryAction)packet).getSlotId() + "\n&7Item: &b" + ((((C10PacketCreativeInventoryAction)packet).getStack() == null) ? "null" : ((C10PacketCreativeInventoryAction)packet).getStack().getItem().getRegistryName().replace("minecraft:", "")); + } + else if (packet instanceof C0EPacketClickWindow) { + final C0EPacketClickWindow c0EPacketClickWindow = (C0EPacketClickWindow)packet; + s = s + "\n&7Window: &b" + c0EPacketClickWindow.getWindowId() + "\n&7Slot: &b" + c0EPacketClickWindow.getSlotId() + "\n&7Button: &b" + c0EPacketClickWindow.getUsedButton() + "\n&7Action: &b" + c0EPacketClickWindow.getActionNumber() + "\n&7Mode: &b" + c0EPacketClickWindow.getMode() + "\n&7Item: &b" + ((c0EPacketClickWindow.getClickedItem() == null) ? "null" : c0EPacketClickWindow.getClickedItem().getItem().getRegistryName().replace("minecraft:", "")); + } + else if (packet instanceof C0FPacketConfirmTransaction) { + s = s + "\n&7Window: &b" + ((C0FPacketConfirmTransaction)packet).getWindowId() + "\n&7Uid: &b" + ((C0FPacketConfirmTransaction)packet).getUid(); + } + else if (packet instanceof C03PacketPlayer) { + final C03PacketPlayer c03PacketPlayer = (C03PacketPlayer)packet; + s = s + "\n&7Position: &b" + round(c03PacketPlayer.getPositionX()) + "&7, &b" + round(c03PacketPlayer.getPositionY()) + "&7, &b" + round(c03PacketPlayer.getPositionZ()) + "\n&7Rotations: &b" + round((double)c03PacketPlayer.getYaw()) + "&7, &b" + round((double)c03PacketPlayer.getPitch()) + "\n&7Ground: " + formatBoolean(c03PacketPlayer.isOnGround()) + "\n&7Moving: " + formatBoolean(c03PacketPlayer.isMoving()) + "\n&7Rotating: " + formatBoolean(c03PacketPlayer.getRotating()); + } + return s + "\n&7Client tick: &e" + tick; + } + + private static double round(final double n) { + return Utils.round(n, 3); + } + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent e) { + if (e.phase == TickEvent.Phase.START) { + ++tick; + } + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/player/AntiAFK.java b/src/main/java/keystrokesmod/module/impl/player/AntiAFK.java new file mode 100644 index 0000000..f7b77b3 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/player/AntiAFK.java @@ -0,0 +1,197 @@ +package keystrokesmod.module.impl.player; + +import keystrokesmod.event.PreUpdateEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Reflection; +import keystrokesmod.utility.RotationUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.client.settings.KeyBinding; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class AntiAFK extends Module { + private SliderSetting afk; + private ButtonSetting jump; + private ButtonSetting jumpWhenCollided; + private ButtonSetting randomClicks; + private ButtonSetting swapItem; + private SliderSetting spin; + private ButtonSetting randomizeDelta; + private ButtonSetting randomizePitch; + private SliderSetting minDelay; + private SliderSetting maxDelay; + private String[] afkModes = new String[]{"None", "Wander", "Lateral shuffle", "Forward", "Backward", "Lobby"}; + private String[] spinModes = new String[]{"None", "Random", "Right", "Left"}; + private int ticks, afkTicks; + private boolean c; + public boolean stop = false; + public AntiAFK() { + super("AntiAFK", category.player); + this.registerSetting(afk = new SliderSetting("AFK", 0, afkModes)); + this.registerSetting(jump = new ButtonSetting("Jump", false)); + this.registerSetting(jumpWhenCollided = new ButtonSetting("Jump only when collided", false)); + this.registerSetting(randomClicks = new ButtonSetting("Random clicks", false)); + this.registerSetting(swapItem = new ButtonSetting("Swap item", false)); + this.registerSetting(spin = new SliderSetting("Spin", 0, spinModes)); + this.registerSetting(randomizeDelta = new ButtonSetting("Randomize delta", true)); + this.registerSetting(randomizePitch = new ButtonSetting("Randomize pitch", true)); + this.registerSetting(minDelay = new SliderSetting("Minimum delay ticks", 10.0, 4.0, 160.0, 2.0)); + this.registerSetting(maxDelay = new SliderSetting("Maximum delay ticks", 80.0, 4.0, 160.0, 2.0)); + } + + public void onEnable() { + this.ticks = this.h(); + this.c = Utils.getRandom().nextBoolean(); + } + + @SubscribeEvent + public void onPreUpdate(PreUpdateEvent e) { + if (!Utils.isMoving()) { + ++this.afkTicks; + } + else { + afkTicks = 0; + } + } + + public void onUpdate() { + if (stop) { + return; + } + --this.ticks; + switch ((int) afk.getInput()) { + case 1: { + if (this.c) { + KeyBinding.setKeyBindState(mc.gameSettings.keyBindForward.getKeyCode(), Utils.getRandom().nextBoolean()); + KeyBinding.setKeyBindState(mc.gameSettings.keyBindRight.getKeyCode(), Utils.getRandom().nextBoolean()); + break; + } + KeyBinding.setKeyBindState(mc.gameSettings.keyBindBack.getKeyCode(), Utils.getRandom().nextBoolean()); + KeyBinding.setKeyBindState(mc.gameSettings.keyBindLeft.getKeyCode(), Utils.getRandom().nextBoolean()); + break; + } + case 2: { + KeyBinding.setKeyBindState(mc.gameSettings.keyBindRight.getKeyCode(), this.c); + KeyBinding.setKeyBindState(mc.gameSettings.keyBindLeft.getKeyCode(), !this.c); + break; + } + case 3: { + KeyBinding.setKeyBindState(mc.gameSettings.keyBindForward.getKeyCode(), true); + break; + } + case 4: { + KeyBinding.setKeyBindState(mc.gameSettings.keyBindBack.getKeyCode(), true); + break; + } + case 5: { + if (afkTicks >= 1000) { + mc.thePlayer.capabilities.isFlying = false; + if (mc.thePlayer.onGround) { + mc.thePlayer.jump(); + } + afkTicks = 0; + } + break; + } + } + switch ((int) spin.getInput()) { + case 1: { + mc.thePlayer.rotationYaw += this.c(this.c); + this.d(); + break; + } + case 2: { + mc.thePlayer.rotationYaw += this.c(true); + this.d(); + break; + } + case 3: { + mc.thePlayer.rotationYaw += this.c(false); + this.d(); + break; + } + } + if (jump.isToggled() && mc.thePlayer.onGround && (!jumpWhenCollided.isToggled() || mc.thePlayer.isCollidedHorizontally)) { + mc.thePlayer.jump(); + } + if (this.ticks == 0) { + if (swapItem.isToggled()) { + mc.thePlayer.inventory.currentItem = Utils.randomizeInt(0, 8); + } + if (randomClicks.isToggled()) { + Reflection.clickMouse(); + } + this.ticks = this.h(); + this.c = !this.c; + } + } + + private double a() { + final int n = Utils.getRandom().nextBoolean() ? 1 : -1; + if (!randomizeDelta.isToggled()) { + return 2 * n; + } + double n2 = Utils.randomizeInt(100, 500) / 100.0; + if (n2 % 1.0 == 0.0) { + n2 += Utils.randomizeInt(1, 10) / 10.0 * n; + } + return n2 * n; + } + + public void onDisable() { + this.b(0); + stop = false; + } + + private void b(final int n) { + switch (n) { + case 1: { + KeyBinding.setKeyBindState(mc.gameSettings.keyBindForward.getKeyCode(), false); + KeyBinding.setKeyBindState(mc.gameSettings.keyBindBack.getKeyCode(), false); + KeyBinding.setKeyBindState(mc.gameSettings.keyBindRight.getKeyCode(), false); + KeyBinding.setKeyBindState(mc.gameSettings.keyBindLeft.getKeyCode(), false); + break; + } + case 2: { + KeyBinding.setKeyBindState(mc.gameSettings.keyBindRight.getKeyCode(), false); + KeyBinding.setKeyBindState(mc.gameSettings.keyBindLeft.getKeyCode(), false); + break; + } + case 3: { + KeyBinding.setKeyBindState(mc.gameSettings.keyBindForward.getKeyCode(), false); + break; + } + case 4: { + KeyBinding.setKeyBindState(mc.gameSettings.keyBindBack.getKeyCode(), false); + break; + } + } + } + + private int h() { + if (minDelay.getInput() == maxDelay.getInput()) { + return (int)minDelay.getInput(); + } + return Utils.randomizeInt((int)minDelay.getInput(), (int) maxDelay.getInput()); + } + + private void d() { + if (randomizePitch.isToggled()) { + mc.thePlayer.rotationPitch = RotationUtils.clampTo90((float)(mc.thePlayer.rotationPitch + this.a())); + } + } + + private double c(final boolean b) { + final int n = b ? 1 : -1; + if (!randomizeDelta.isToggled()) { + return 3 * n; + } + double n2 = Utils.randomizeInt(100, 1000) / 100.0; + if (n2 % 1.0 == 0.0) { + n2 += Utils.randomizeInt(1, 10) / 10.0 * n; + } + return n2 * n; + } +} diff --git a/src/main/java/keystrokesmod/module/impl/player/AntiFireball.java b/src/main/java/keystrokesmod/module/impl/player/AntiFireball.java new file mode 100644 index 0000000..98c13de --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/player/AntiFireball.java @@ -0,0 +1,152 @@ +package keystrokesmod.module.impl.player; + +import keystrokesmod.event.PreMotionEvent; +import keystrokesmod.event.PreUpdateEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.combat.KillAura; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.RotationUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.entity.Entity; +import net.minecraft.entity.projectile.EntityFireball; +import net.minecraft.item.*; +import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.input.Mouse; + +import java.util.HashSet; + +public class AntiFireball extends Module { + private SliderSetting fov; + private SliderSetting range; + private ButtonSetting disableWhileFlying; + private ButtonSetting disableWhileScaffold; + private ButtonSetting blocksRotate; + private ButtonSetting projectileRotate; + public ButtonSetting silentSwing; + public EntityFireball fireball; + private HashSet fireballs = new HashSet<>(); + public boolean attack; + + public AntiFireball() { + super("AntiFireball", category.player); + this.registerSetting(fov = new SliderSetting("FOV", 360.0, 30.0, 360.0, 4.0)); + this.registerSetting(range = new SliderSetting("Range", 8.0, 3.0, 15.0, 0.5)); + this.registerSetting(disableWhileFlying = new ButtonSetting("Disable while flying", false)); + this.registerSetting(disableWhileScaffold = new ButtonSetting("Disable while scaffold", false)); + this.registerSetting(blocksRotate = new ButtonSetting("Rotate with blocks", false)); + this.registerSetting(projectileRotate = new ButtonSetting("Rotate with projectiles", false)); + this.registerSetting(silentSwing = new ButtonSetting("Silent swing", false)); + } + + @SubscribeEvent(priority = EventPriority.LOW) + public void onPreMotion(PreMotionEvent e) { + if (!condition() || stopAttack()) { + return; + } + if (fireball != null) { + final ItemStack getHeldItem = mc.thePlayer.getHeldItem(); + if (getHeldItem != null && getHeldItem.getItem() instanceof ItemBlock && !blocksRotate.isToggled() && Mouse.isButtonDown(1)) { + return; + } + if (getHeldItem != null && (getHeldItem.getItem() instanceof ItemBow || getHeldItem.getItem() instanceof ItemSnowball || getHeldItem.getItem() instanceof ItemEgg || getHeldItem.getItem() instanceof ItemFishingRod) && !projectileRotate.isToggled()) { + return; + } + if (ModuleManager.scaffold != null && ModuleManager.scaffold.stopRotation()) { + return; + } + float[] rotations = RotationUtils.getRotations(fireball, e.getYaw(), e.getPitch()); + e.setYaw(rotations[0]); + e.setPitch(rotations[1]); + } + } + + @SubscribeEvent + public void onPreUpdate(PreUpdateEvent e) { + if (!condition() || stopAttack()) { + return; + } + if (fireball != null) { + if (ModuleManager.killAura != null && ModuleManager.killAura.isEnabled() && ModuleManager.killAura.blockingServer && (ModuleManager.killAura.autoBlockMode.getInput() == 4 || ModuleManager.killAura.autoBlockMode.getInput() == 5)) { + if (KillAura.target != null) { + attack = false; + return; + } + attack = true; + } + else { + Utils.attackEntity(fireball, !silentSwing.isToggled(), silentSwing.isToggled()); + } + } + } + + private EntityFireball getFireball() { + for (final Entity entity : mc.theWorld.loadedEntityList) { + if (!(entity instanceof EntityFireball)) { + continue; + } + if (!this.fireballs.contains(entity)) { + continue; + } + if (mc.thePlayer.getDistanceSqToEntity(entity) > range.getInput() * range.getInput()) { + continue; + } + final float n = (float) fov.getInput(); + if (n != 360.0f && !Utils.inFov(n, entity)) { + continue; + } + return (EntityFireball) entity; + } + return null; + } + + @SubscribeEvent + public void onEntityJoin(EntityJoinWorldEvent e) { + if (!Utils.nullCheck()) { + return; + } + if (e.entity == mc.thePlayer) { + this.fireballs.clear(); + } else if (e.entity instanceof EntityFireball && mc.thePlayer.getDistanceSqToEntity(e.entity) > 16.0) { + this.fireballs.add(e.entity); + } + } + + public void onDisable() { + this.fireballs.clear(); + this.fireball = null; + this.attack = false; + } + + public void onUpdate() { + if (!condition()) { + return; + } + if (mc.currentScreen != null) { + attack = false; + fireball = null; + return; + } + fireball = this.getFireball(); + } + + private boolean stopAttack() { + return (ModuleManager.bedAura != null && ModuleManager.bedAura.isEnabled() && ModuleManager.bedAura.currentBlock != null) || (ModuleManager.killAura != null && ModuleManager.killAura.isEnabled() && KillAura.attackingEntity != null); + } + + private boolean condition() { + if (!Utils.nullCheck()) { + return false; + } + if (mc.thePlayer.capabilities.isFlying && disableWhileFlying.isToggled()) { + return false; + } + if (ModuleManager.scaffold != null && ModuleManager.scaffold.isEnabled && disableWhileScaffold.isToggled()) { + return false; + } + return true; + } +} diff --git a/src/main/java/keystrokesmod/module/impl/player/AutoJump.java b/src/main/java/keystrokesmod/module/impl/player/AutoJump.java new file mode 100644 index 0000000..66e9c77 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/player/AutoJump.java @@ -0,0 +1,42 @@ +package keystrokesmod.module.impl.player; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.utility.Utils; +import net.minecraft.client.settings.KeyBinding; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.PlayerTickEvent; + +public class AutoJump extends Module { + public static ButtonSetting b; + private boolean c = false; + + public AutoJump() { + super("AutoJump", Module.category.player, 0); + this.registerSetting(b = new ButtonSetting("Cancel when shifting", true)); + } + + public void onDisable() { + this.ju(this.c = false); + } + + @SubscribeEvent + public void p(PlayerTickEvent e) { + if (Utils.nullCheck()) { + if (mc.thePlayer.onGround && (!b.isToggled() || !mc.thePlayer.isSneaking())) { + if (Utils.onEdge()) { + this.ju(this.c = true); + } else if (this.c) { + this.ju(this.c = false); + } + } else if (this.c) { + this.ju(this.c = false); + } + + } + } + + private void ju(boolean ju) { + KeyBinding.setKeyBindState(mc.gameSettings.keyBindJump.getKeyCode(), ju); + } +} diff --git a/src/main/java/keystrokesmod/module/impl/player/AutoPlace.java b/src/main/java/keystrokesmod/module/impl/player/AutoPlace.java new file mode 100644 index 0000000..0db09d1 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/player/AutoPlace.java @@ -0,0 +1,139 @@ +package keystrokesmod.module.impl.player; + +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Reflection; +import keystrokesmod.utility.Utils; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.MovingObjectPosition.MovingObjectType; +import net.minecraftforge.client.event.DrawBlockHighlightEvent; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.input.Mouse; + +public class AutoPlace extends Module { + private SliderSetting frameDelay; + private SliderSetting minPlaceDelay; + private ButtonSetting disableLeft; + private ButtonSetting holdRight; + private ButtonSetting fastPlaceJump; + private ButtonSetting pitchCheck; + private double fDelay = 0.0D; + private long l = 0L; + private int f = 0; + private MovingObjectPosition lm = null; + private BlockPos lp = null; + + public AutoPlace() { + super("AutoPlace", Module.category.player, 0); + this.registerSetting(new DescriptionSetting("Best with safewalk.")); + this.registerSetting(frameDelay = new SliderSetting("Frame delay", 8.0D, 0.0D, 30.0D, 1.0D)); + this.registerSetting(minPlaceDelay = new SliderSetting("Min place delay", 60.0, 25.0, 500.0, 5.0)); + this.registerSetting(disableLeft = new ButtonSetting("Disable left", false)); + this.registerSetting(holdRight = new ButtonSetting("Hold right", true)); + this.registerSetting(fastPlaceJump = new ButtonSetting("Fast place on jump", true)); + this.registerSetting(pitchCheck = new ButtonSetting("Pitch check", false)); + } + + public void guiUpdate() { + if (this.fDelay != frameDelay.getInput()) { + this.resetVariables(); + } + + this.fDelay = frameDelay.getInput(); + } + + public void onDisable() { + if (holdRight.isToggled()) { + this.rd(4); + } + + this.resetVariables(); + } + + public void onUpdate() { + if (mc.currentScreen != null || mc.thePlayer.capabilities.isFlying) { + return; + } + final ItemStack getHeldItem = mc.thePlayer.getHeldItem(); + if (getHeldItem == null || !(getHeldItem.getItem() instanceof ItemBlock)) { + return; + } + if (fastPlaceJump.isToggled() && holdRight.isToggled() && !ModuleManager.fastPlace.isEnabled() && Mouse.isButtonDown(1)) { + if (mc.thePlayer.motionY > 0.0) { + this.rd(1); + } + else if (!pitchCheck.isToggled() || mc.thePlayer.rotationPitch >= 70.0f) { + this.rd(1000); + } + } + } + + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void bh(DrawBlockHighlightEvent ev) { + if (Utils.nullCheck()) { + if (mc.currentScreen == null && !mc.thePlayer.capabilities.isFlying) { + ItemStack i = mc.thePlayer.getHeldItem(); + if (i != null && i.getItem() instanceof ItemBlock) { + MovingObjectPosition m = mc.objectMouseOver; + if (disableLeft.isToggled() && Mouse.isButtonDown(0)) { + return; + } + if (m != null && m.typeOfHit == MovingObjectType.BLOCK && m.sideHit != EnumFacing.UP && m.sideHit != EnumFacing.DOWN) { + if (this.lm != null && (double) this.f < frameDelay.getInput()) { + ++this.f; + } else { + this.lm = m; + BlockPos pos = m.getBlockPos(); + if (this.lp == null || pos.getX() != this.lp.getX() || pos.getY() != this.lp.getY() || pos.getZ() != this.lp.getZ()) { + Block b = mc.theWorld.getBlockState(pos).getBlock(); + if (b != null && b != Blocks.air && !(b instanceof BlockLiquid)) { + if (!holdRight.isToggled() || Mouse.isButtonDown(1)) { + long n = System.currentTimeMillis(); + if (n - this.l >= minPlaceDelay.getInput()) { + this.l = n; + if (mc.playerController.onPlayerRightClick(mc.thePlayer, mc.theWorld, i, pos, m.sideHit, m.hitVec)) { + Reflection.setButton(1, true); + mc.thePlayer.swingItem(); + mc.getItemRenderer().resetEquippedProgress(); + Reflection.setButton(1, false); + this.lp = pos; + this.f = 0; + } + + } + } + } + } + } + } + } + } + } + } + + private void rd(int i) { + try { + if (Reflection.rightClickDelayTimerField != null) { + Reflection.rightClickDelayTimerField.set(mc, i); + } + } catch (IllegalAccessException | IndexOutOfBoundsException var3) { + } + } + + private void resetVariables() { + this.lp = null; + this.lm = null; + this.f = 0; + } +} diff --git a/src/main/java/keystrokesmod/module/impl/player/AutoSwap.java b/src/main/java/keystrokesmod/module/impl/player/AutoSwap.java new file mode 100644 index 0000000..cbf7ca5 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/player/AutoSwap.java @@ -0,0 +1,19 @@ +package keystrokesmod.module.impl.player; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; + +public class AutoSwap extends Module { + public ButtonSetting sameType; + public ButtonSetting spoofItem; + public ButtonSetting swapToGreaterStack; + public AutoSwap() { + super("AutoSwap", category.player); + this.registerSetting(new DescriptionSetting("Automatically swaps blocks.")); + this.registerSetting(sameType = new ButtonSetting("Only same type", false)); + this.registerSetting(spoofItem = new ButtonSetting("Spoof item", false)); + this.registerSetting(swapToGreaterStack = new ButtonSetting("Swap to greater stack", true)); + this.canBeEnabled = false; + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/player/AutoTool.java b/src/main/java/keystrokesmod/module/impl/player/AutoTool.java new file mode 100644 index 0000000..e05c357 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/player/AutoTool.java @@ -0,0 +1,93 @@ +package keystrokesmod.module.impl.player; + +import keystrokesmod.mixins.interfaces.IMixinItemRenderer; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.BlockUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.util.MovingObjectPosition; +import org.lwjgl.input.Mouse; + +public class AutoTool extends Module { + private SliderSetting hoverDelay; + private ButtonSetting rightDisable; + private ButtonSetting requireCrouch; + private ButtonSetting requireMouse; + public ButtonSetting spoofItem; + private ButtonSetting swap; + public int previousSlot = -1; + private long ticksHovered; + + public AutoTool() { + super("AutoTool", category.player); + this.registerSetting(hoverDelay = new SliderSetting("Hover delay", 0.0, 0.0, 20.0, 1.0)); + this.registerSetting(rightDisable = new ButtonSetting("Disable while right click", true)); + this.registerSetting(requireCrouch = new ButtonSetting("Only while crouching", false)); + this.registerSetting(requireMouse = new ButtonSetting("Require mouse down", true)); + this.registerSetting(spoofItem = new ButtonSetting("Spoof item", false)); + this.registerSetting(swap = new ButtonSetting("Swap to previous slot", true)); + this.closetModule = true; + } + + public void onDisable() { + resetVariables(); + } + + public void setSlot(final int currentItem) { + if (currentItem == -1) { + return; + } + mc.thePlayer.inventory.currentItem = currentItem; + } + + public void onUpdate() { + if (spoofItem.isToggled() && previousSlot != mc.thePlayer.inventory.currentItem && previousSlot != -1) { + ((IMixinItemRenderer) mc.getItemRenderer()).setCancelUpdate(true); + ((IMixinItemRenderer) mc.getItemRenderer()).setCancelReset(true); + } + if (!mc.inGameHasFocus || mc.currentScreen != null || (rightDisable.isToggled() && Mouse.isButtonDown(1)) || !mc.thePlayer.capabilities.allowEdit || (requireCrouch.isToggled() && !mc.thePlayer.isSneaking())) { + resetVariables(); + return; + } + if (!Mouse.isButtonDown(0) && requireMouse.isToggled()) { + resetSlot(); + return; + } + MovingObjectPosition over = mc.objectMouseOver; + if (over == null || over.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK) { + resetSlot(); + resetVariables(); + return; + } + if (hoverDelay.getInput() != 0) { + long ticks = this.ticksHovered + 1L; + this.ticksHovered = ticks; + if (ticks < hoverDelay.getInput()) { + return; + } + } + int slot = Utils.getTool(BlockUtils.getBlock(over.getBlockPos())); + if (slot == -1) { + return; + } + if (previousSlot == -1) { + previousSlot = mc.thePlayer.inventory.currentItem; + } + setSlot(slot); + } + + private void resetVariables() { + ticksHovered = 0; + resetSlot(); + previousSlot = -1; + } + + private void resetSlot() { + if (previousSlot == -1 || !swap.isToggled()) { + return; + } + setSlot(previousSlot); + previousSlot = -1; + } +} diff --git a/src/main/java/keystrokesmod/module/impl/player/BedAura.java b/src/main/java/keystrokesmod/module/impl/player/BedAura.java new file mode 100644 index 0000000..e045048 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/player/BedAura.java @@ -0,0 +1,460 @@ +package keystrokesmod.module.impl.player; + +import keystrokesmod.Raven; +import keystrokesmod.event.*; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.combat.KillAura; +import keystrokesmod.module.impl.minigames.BedWars; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.*; +import net.minecraft.block.Block; +import net.minecraft.block.BlockBed; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.network.play.server.S27PacketExplosion; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MovingObjectPosition; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.awt.*; +import java.util.*; +import java.util.List; + +public class BedAura extends Module { + public SliderSetting mode; + private SliderSetting breakSpeed; + private SliderSetting fov; + public SliderSetting range; + private SliderSetting rate; + public ButtonSetting allowAura; + private ButtonSetting breakNearBlock; + private ButtonSetting cancelKnockback; + public ButtonSetting disableBHop; + private ButtonSetting disableBreakEffects; + public ButtonSetting groundSpoof; + public ButtonSetting ignoreSlow; + private ButtonSetting onlyWhileVisible; + private ButtonSetting renderOutline; + private ButtonSetting sendAnimations; + private ButtonSetting silentSwing; + private String[] modes = new String[] { "Legit", "Instant", "Swap" }; + private BlockPos[] bedPos; + public float breakProgress; + private int lastSlot = -1; + public boolean rotate; + public BlockPos currentBlock; + private long lastCheck = 0; + public boolean stopAutoblock; + private int outlineColor = new Color(226, 65, 65).getRGB(); + private BlockPos nearestBlock; + private Map breakProgressMap = new HashMap<>(); + public double lastProgress; + public float vanillaProgress; + private int defaultOutlineColor = new Color(226, 65, 65).getRGB(); + private boolean aiming; + private int noAutoBlockTicks; + + public BedAura() { + super("BedAura", category.player, 0); + this.registerSetting(mode = new SliderSetting("Break mode", 0, modes)); + this.registerSetting(breakSpeed = new SliderSetting("Break speed", "x", 1, 0.8, 2, 0.01)); + this.registerSetting(fov = new SliderSetting("FOV", 360.0, 30.0, 360.0, 4.0)); + this.registerSetting(range = new SliderSetting("Range", 4.5, 1.0, 8.0, 0.5)); + this.registerSetting(rate = new SliderSetting("Rate", " second", 0.2, 0.05, 3.0, 0.05)); + this.registerSetting(allowAura = new ButtonSetting("Allow aura", true)); + this.registerSetting(breakNearBlock = new ButtonSetting("Break near block", false)); + this.registerSetting(cancelKnockback = new ButtonSetting("Cancel knockback", false)); + this.registerSetting(disableBHop = new ButtonSetting("Disable bhop", false)); + this.registerSetting(disableBreakEffects = new ButtonSetting("Disable break effects", false)); + this.registerSetting(groundSpoof = new ButtonSetting("Ground spoof", false)); + this.registerSetting(ignoreSlow = new ButtonSetting("Ignore slow", false)); + this.registerSetting(onlyWhileVisible = new ButtonSetting("Only while visible", false)); + this.registerSetting(renderOutline = new ButtonSetting("Render block outline", true)); + this.registerSetting(sendAnimations = new ButtonSetting("Send animations", false)); + this.registerSetting(silentSwing = new ButtonSetting("Silent swing", false)); + } + + @Override + public String getInfo() { + return modes[(int) mode.getInput()]; + } + + @Override + public void onDisable() { + reset(true); + } + + @SubscribeEvent(priority = EventPriority.HIGHEST) // takes priority over ka & antifireball + public void onPreUpdate(PreUpdateEvent e) { + if (!Utils.nullCheck()) { + return; + } + if (ModuleManager.bedwars != null && ModuleManager.bedwars.isEnabled() && BedWars.whitelistOwnBed.isToggled() && !BedWars.outsideSpawn) { + reset(true); + return; + } + if (Utils.isBedwarsPractice()) { + return; + } + if (ModuleManager.scaffold.isEnabled) { + return; + } + if (!mc.thePlayer.capabilities.allowEdit || mc.thePlayer.isSpectator()) { + reset(true); + return; + } + if (bedPos == null) { + if (System.currentTimeMillis() - lastCheck >= rate.getInput() * 1000) { + lastCheck = System.currentTimeMillis(); + bedPos = getBedPos(); + } + if (bedPos == null) { + reset(true); + return; + } + } + else { + if (!(BlockUtils.getBlock(bedPos[0]) instanceof BlockBed) || (currentBlock != null && BlockUtils.replaceable(currentBlock))) { + reset(true); + return; + } + } + switch (noAutoBlockTicks) { + case -1: + noAutoBlockTicks = -2; + break; + case -2: + resetSlot(); + noAutoBlockTicks = -3; + break; + case -3: + noAutoBlockTicks = -4; + break; + case -4: + stopAutoblock = false; + noAutoBlockTicks = 0; + break; + } + if (breakNearBlock.isToggled() && isCovered(bedPos[0]) && isCovered(bedPos[1])) { + if (nearestBlock == null) { + nearestBlock = getBestBlock(bedPos, true); + } + breakBlock(nearestBlock); + } + else { + nearestBlock = null; + breakBlock(getBestBlock(bedPos, false) != null ? getBestBlock(bedPos, false) : bedPos[0]); + } + } + + @SubscribeEvent + public void onReceivePacket(ReceivePacketEvent e) { + if (!Utils.nullCheck() || !cancelKnockback.isToggled() || currentBlock == null) { + return; + } + if (e.getPacket() instanceof S12PacketEntityVelocity) { + if (((S12PacketEntityVelocity) e.getPacket()).getEntityID() == mc.thePlayer.getEntityId()) { + e.setCanceled(true); + } + } + else if (e.getPacket() instanceof S27PacketExplosion) { + e.setCanceled(true); + } + } + + @SubscribeEvent(priority = EventPriority.LOWEST) + public void onPreMotion(PreMotionEvent e) { + if ((rotate || breakProgress >= 1 || breakProgress == 0) && currentBlock != null) { + float[] rotations = RotationUtils.getRotations(currentBlock, e.getYaw(), e.getPitch()); + if (!RotationUtils.inRange(currentBlock, range.getInput())) { + return; + } + e.setYaw(RotationUtils.applyVanilla(rotations[0])); + e.setPitch(rotations[1]); + rotate = false; + if (groundSpoof.isToggled() && !mc.thePlayer.isInWater()) { + e.setOnGround(true); + } + aiming = true; + } + } + + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onRenderWorld(RenderWorldLastEvent renderWorldLastEvent) { + if (!renderOutline.isToggled() || currentBlock == null || !Utils.nullCheck()) { + return; + } + if (ModuleManager.bedESP != null && ModuleManager.bedESP.isEnabled()) { + outlineColor = Theme.getGradient((int) ModuleManager.bedESP.theme.getInput(), 0); + } + else if (ModuleManager.hud != null && ModuleManager.hud.isEnabled()) { + outlineColor = Theme.getGradient((int) ModuleManager.hud.theme.getInput(), 0); + } + else { + outlineColor = defaultOutlineColor; + } + RenderUtils.renderBlock(currentBlock, outlineColor, (Arrays.asList(bedPos).contains(currentBlock) ? 0.5625 : 1),true, false); + } + + private void resetSlot() { + if (Raven.packetsHandler.playerSlot.get() != mc.thePlayer.inventory.currentItem && mode.getInput() == 2) { + setPacketSlot(mc.thePlayer.inventory.currentItem); + } + else if (lastSlot != -1) { + lastSlot = mc.thePlayer.inventory.currentItem = lastSlot; + } + } + + public boolean cancelKnockback() { + return cancelKnockback.isToggled() && Utils.usingBedAura(); + } + + private BlockPos[] getBedPos() { + int range; + priority: + for (int n = range = (int) this.range.getInput(); range >= -n; --range) { + for (int j = -n; j <= n; ++j) { + for (int k = -n; k <= n; ++k) { + final BlockPos blockPos = new BlockPos(mc.thePlayer.posX + j, mc.thePlayer.posY + range, mc.thePlayer.posZ + k); + final IBlockState getBlockState = mc.theWorld.getBlockState(blockPos); + if (getBlockState.getBlock() == Blocks.bed && getBlockState.getValue((IProperty) BlockBed.PART) == BlockBed.EnumPartType.FOOT) { + float fov = (float) this.fov.getInput(); + if (fov != 360 && !Utils.inFov(fov, blockPos)) { + continue priority; + } + return new BlockPos[]{blockPos, blockPos.offset((EnumFacing) getBlockState.getValue((IProperty) BlockBed.FACING))}; + } + } + } + } + return null; + } + + public BlockPos getBestBlock(BlockPos[] positions, boolean getSurrounding) { + if (positions == null || positions.length == 0) { + return null; + } + HashMap blockMap = new HashMap<>(); + for (BlockPos pos : positions) { + if (pos == null) { + continue; + } + if (getSurrounding) { + for (EnumFacing enumFacing : EnumFacing.values()) { + if (enumFacing == EnumFacing.DOWN) { + continue; + } + BlockPos offset = pos.offset(enumFacing); + if (Arrays.asList(positions).contains(offset)) { + continue; + } + if (!RotationUtils.inRange(offset, range.getInput())) { + continue; + } + double efficiency = getEfficiency(offset); + double distance = mc.thePlayer.getDistanceSqToCenter(offset); + blockMap.put(offset, new double[]{distance, efficiency}); + } + } + else { + if (!RotationUtils.inRange(pos, range.getInput())) { + continue; + } + double efficiency = getEfficiency(pos); + double distance = mc.thePlayer.getDistanceSqToCenter(pos); + blockMap.put(pos, new double[]{distance, efficiency}); + } + } + List> sortedByDistance = sortByDistance(blockMap); + List> sortedByEfficiency = sortByEfficiency(sortedByDistance); + return sortedByEfficiency.isEmpty() ? null : sortedByEfficiency.get(0).getKey(); + } + + private List> sortByDistance(HashMap blockMap) { + List> list = new ArrayList<>(blockMap.entrySet()); + list.sort(Comparator.comparingDouble(entry -> entry.getValue()[0])); + return list; + } + + private List> sortByEfficiency(List> blockList) { + blockList.sort((entry1, entry2) -> Double.compare(entry2.getValue()[1], entry1.getValue()[1])); + return blockList; + } + + private double getEfficiency(BlockPos pos) { + Block block = BlockUtils.getBlock(pos); + ItemStack tool = (mode.getInput() == 2 && Utils.getTool(block) != -1) ? mc.thePlayer.inventory.getStackInSlot(Utils.getTool(block)) : mc.thePlayer.getHeldItem(); + double efficiency = BlockUtils.getBlockHardness(block, tool, false, ignoreSlow.isToggled() || groundSpoof.isToggled()); + + if (breakProgressMap.get(pos) != null) { + efficiency = breakProgressMap.get(pos); + } + + return efficiency; + } + + private void reset(boolean resetSlot) { + if (resetSlot) { + resetSlot(); + } + bedPos = null; + breakProgress = 0; + rotate = false; + nearestBlock = null; + aiming = false; + currentBlock = null; + breakProgressMap.clear(); + lastSlot = -1; + vanillaProgress = 0; + lastProgress = 0; + stopAutoblock = false; + noAutoBlockTicks = 0; + } + + public void setPacketSlot(int slot) { + if (slot == -1) { + return; + } + Raven.packetsHandler.updateSlot(slot); + } + + private void startBreak(BlockPos blockPos) { + mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.START_DESTROY_BLOCK, blockPos, EnumFacing.UP)); + } + + private void stopBreak(BlockPos blockPos) { + mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.STOP_DESTROY_BLOCK, blockPos, EnumFacing.UP)); + } + + private void swing() { + mc.thePlayer.swingItem(); + } + + private void breakBlock(BlockPos blockPos) { + if (blockPos == null) { + return; + } + float fov = (float) this.fov.getInput(); + if (fov != 360 && !Utils.inFov(fov, blockPos)) { + return; + } + if (!RotationUtils.inRange(blockPos, range.getInput())) { + return; + } + if (onlyWhileVisible.isToggled() && (mc.objectMouseOver == null || mc.objectMouseOver.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK || !mc.objectMouseOver.getBlockPos().equals(blockPos))) { + return; + } + if (BlockUtils.replaceable(currentBlock == null ? blockPos : currentBlock)) { + reset(true); + return; + } + currentBlock = blockPos; + Block block = BlockUtils.getBlock(blockPos); + if (!silentSwing.isToggled()) { + swing(); + } + if (breakProgress == 0 && !aiming) { + return; + } + if (!stopAutoblock && breakProgress <= 0 && mode.getInput() == 2 && ModuleManager.killAura.autoBlockOverride()) { + stopAutoblock = true; // if blocking then return and stop autoblocking + return; + } + if (mode.getInput() == 2 || mode.getInput() == 0) { + if (breakProgress == 0 && aiming) { + resetSlot(); + rotate = true; + if (mode.getInput() == 0) { + setSlot(Utils.getTool(block)); + } + startBreak(blockPos); + if (mode.getInput() == 2) { + noAutoBlockTicks = 1; // increment by 1 + } + } + else if (breakProgress >= 1 && aiming) { + if (mode.getInput() == 2) { + noAutoBlockTicks = -1; // set to -1 to indicate it was on stop rather than +1 + setPacketSlot(Utils.getTool(block)); + } + stopBreak(blockPos); + reset(false); + Iterator> iterator = breakProgressMap.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry entry = iterator.next(); + if (entry.getKey().equals(blockPos)) { + iterator.remove(); + } + } + if (!disableBreakEffects.isToggled()) { + mc.playerController.onPlayerDestroyBlock(blockPos, EnumFacing.UP); + } + return; + } + else { + if (mode.getInput() == 0) { + rotate = true; + } + if (noAutoBlockTicks == 1) { + stopAutoblock = false; + noAutoBlockTicks = 0; + } + } + double progress = vanillaProgress = (float) (BlockUtils.getBlockHardness(block, (mode.getInput() == 2 && Utils.getTool(block) != -1) ? mc.thePlayer.inventory.getStackInSlot(Utils.getTool(block)) : mc.thePlayer.getHeldItem(), false, ignoreSlow.isToggled() || groundSpoof.isToggled()) * breakSpeed.getInput()); + if (lastProgress != 0 && breakProgress >= lastProgress) { + // tick before we break so here we've gotta stop autoblocking + if (mode.getInput() == 2 && ModuleManager.killAura.autoBlockOverride()) { + stopAutoblock = true; // if blocking then return and stop autoblocking + } + } + breakProgress += progress; + breakProgressMap.put(blockPos, breakProgress); + if (sendAnimations.isToggled()) { + mc.theWorld.sendBlockBreakProgress(mc.thePlayer.getEntityId(), blockPos, (int) ((breakProgress * 10) - 1)); + } + lastProgress = 0; + while (lastProgress + progress < 1) { + lastProgress += progress; + } + } + else if (mode.getInput() == 1 && aiming) { + rotate = true; + if (!silentSwing.isToggled()) { + swing(); + } + startBreak(blockPos); + setSlot(Utils.getTool(block)); + stopBreak(blockPos); + } + aiming = false; + } + + private void setSlot(int slot) { + if (slot == -1 || slot == mc.thePlayer.inventory.currentItem) { + return; + } + if (lastSlot == -1) { + lastSlot = mc.thePlayer.inventory.currentItem; + } + mc.thePlayer.inventory.currentItem = slot; + } + + private boolean isCovered(BlockPos blockPos) { + for (EnumFacing enumFacing : EnumFacing.values()) { + BlockPos offset = blockPos.offset(enumFacing); + if (BlockUtils.replaceable(offset) || BlockUtils.notFull(BlockUtils.getBlock(offset)) ) { + return false; + } + } + return true; + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/player/Blink.java b/src/main/java/keystrokesmod/module/impl/player/Blink.java new file mode 100644 index 0000000..f097247 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/player/Blink.java @@ -0,0 +1,171 @@ +package keystrokesmod.module.impl.player; + +import keystrokesmod.Raven; +import keystrokesmod.event.PreUpdateEvent; +import keystrokesmod.event.SendPacketEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.PacketUtils; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Theme; +import keystrokesmod.utility.Utils; +import keystrokesmod.utility.ModuleUtils; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.network.Packet; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.network.login.client.C01PacketEncryptionResponse; +import net.minecraft.network.play.client.C00PacketKeepAlive; +import net.minecraft.network.play.client.C0FPacketConfirmTransaction; +import net.minecraft.network.status.client.C00PacketServerQuery; +import net.minecraft.network.status.client.C01PacketPing; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Vec3; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.util.concurrent.ConcurrentLinkedQueue; + +import static keystrokesmod.module.impl.render.HUD.theme; + +public class Blink extends Module { + private static SliderSetting maximumBlinkTicks; + private ButtonSetting initialPosition; + private ButtonSetting renderTimer; + private ButtonSetting disableOnBreak; + private ConcurrentLinkedQueue blinkedPackets = new ConcurrentLinkedQueue<>(); + private Vec3 pos; + //final private int color = Theme.getGradient((int) theme.getInput(), 255); + final private int color = new Color(0, 187, 255, 255).getRGB(); + private int blinkTicks; + private boolean started; + public Blink() { + super("Blink", category.player); + this.registerSetting(maximumBlinkTicks = new SliderSetting("Max Blink Ticks", "", 0, 0, 40, 1)); + this.registerSetting(new DescriptionSetting("0 = no max")); + this.registerSetting(initialPosition = new ButtonSetting("Show initial position", true)); + this.registerSetting(renderTimer = new ButtonSetting("Render Timer", false)); + this.registerSetting(disableOnBreak = new ButtonSetting("Disable on Break", false)); + } + + @Override + public void onEnable() { + blinkedPackets.clear(); + pos = new Vec3(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ); + } + + public void onDisable() { + synchronized (blinkedPackets) { + for (Packet packet : blinkedPackets) { + Raven.packetsHandler.handlePacket(packet); + PacketUtils.sendPacketNoEvent(packet); + } + } + blinkedPackets.clear(); + pos = null; + blinkTicks = 0; + started = false; + } + + @SubscribeEvent + public void onSendPacket(SendPacketEvent e) { + if (!Utils.nullCheck()) { + this.disable(); + return; + } + if (ModuleManager.killAura.lag || ModuleManager.killAura.justUnTargeted) { + return; + } + if (disableOnBreak.isToggled() && (Utils.usingBedAura() || ModuleUtils.isBreaking)) { + disable(); + return; + } + Packet packet = e.getPacket(); + if (packet.getClass().getSimpleName().startsWith("S")) { + return; + } + if (packet instanceof C00PacketLoginStart || packet instanceof C00Handshake) { + return; + } + started = true; + blinkedPackets.add(packet); + e.setCanceled(true); + } + + @Override + public String getInfo() { + return blinkTicks + ""; + } + + @SubscribeEvent + public void onPreUpdate(PreUpdateEvent e) { + if (started) ++blinkTicks; + + if (maximumBlinkTicks.getInput() != 0) { + if (blinkTicks >= maximumBlinkTicks.getInput()) { + disable(); + } + } + } + + @SubscribeEvent + public void onRenderTick(TickEvent.RenderTickEvent ev) { + if (!Utils.nullCheck() || !renderTimer.isToggled()) { + return; + } + if (ev.phase == TickEvent.Phase.END) { + if (mc.currentScreen != null) { + return; + } + } + int widthOffset = (blinkTicks < 10) ? 4 : (blinkTicks >= 10 && blinkTicks < 100) ? 7 : (blinkTicks >= 100 && blinkTicks < 1000) ? 10 : (blinkTicks >= 1000) ? 13 : 16; + String text = ("" + blinkTicks); + int width = mc.fontRendererObj.getStringWidth(text) + Utils.getBoldWidth(text) / 2; + final ScaledResolution scaledResolution = new ScaledResolution(mc); + int[] display = {scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight(), scaledResolution.getScaleFactor()}; + mc.fontRendererObj.drawString(text, display[0] / 2 - width + widthOffset, display[1] / 2 + 8, color, true); + //render.text(text, disp[0] / 2 - wid, disp[1] / 2 + 8, 1, -1, true); + } + + @SubscribeEvent + public void onRenderWorld(RenderWorldLastEvent e) { + if (!Utils.nullCheck() || pos == null || !initialPosition.isToggled()) { + return; + } + drawBox(pos); + } + + private void drawBox(Vec3 pos) { + GlStateManager.pushMatrix(); + double x = pos.xCoord - mc.getRenderManager().viewerPosX; + double y = pos.yCoord - mc.getRenderManager().viewerPosY; + double z = pos.zCoord - mc.getRenderManager().viewerPosZ; + AxisAlignedBB bbox = mc.thePlayer.getEntityBoundingBox().expand(0.1D, 0.1, 0.1); + AxisAlignedBB axis = new AxisAlignedBB(bbox.minX - mc.thePlayer.posX + x, bbox.minY - mc.thePlayer.posY + y, bbox.minZ - mc.thePlayer.posZ + z, bbox.maxX - mc.thePlayer.posX + x, bbox.maxY - mc.thePlayer.posY + y, bbox.maxZ - mc.thePlayer.posZ + z); + float a = (float) (color >> 24 & 255) / 255.0F; + float r = (float) (color >> 16 & 255) / 255.0F; + float g = (float) (color >> 8 & 255) / 255.0F; + float b = (float) (color & 255) / 255.0F; + GL11.glBlendFunc(770, 771); + GL11.glEnable(3042); + GL11.glDisable(3553); + GL11.glDisable(2929); + GL11.glDepthMask(false); + GL11.glLineWidth(2.0F); + GL11.glColor4f(r, g, b, a); + RenderUtils.drawBoundingBox(axis, r, g, b); + GL11.glEnable(3553); + GL11.glEnable(2929); + GL11.glDepthMask(true); + GL11.glDisable(3042); + GlStateManager.popMatrix(); + } +} + diff --git a/src/main/java/keystrokesmod/module/impl/player/DelayRemover.java b/src/main/java/keystrokesmod/module/impl/player/DelayRemover.java new file mode 100644 index 0000000..8ef744e --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/player/DelayRemover.java @@ -0,0 +1,40 @@ +package keystrokesmod.module.impl.player; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.utility.Reflection; +import keystrokesmod.utility.Utils; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +public class DelayRemover extends Module { + public static ButtonSetting oldReg, removeJumpTicks; + + public DelayRemover() { + super("Delay Remover", category.player, 0); + this.registerSetting(oldReg = new ButtonSetting("1.7 hitreg", true)); + this.registerSetting(removeJumpTicks = new ButtonSetting("Remove jump ticks", false)); + this.closetModule = true; + } + + @SubscribeEvent + public void onTick(final TickEvent.PlayerTickEvent event) { + if (event.phase != TickEvent.Phase.END || !mc.inGameHasFocus || !Utils.nullCheck()) { + return; + } + if (oldReg.isToggled()) { + try { + Reflection.leftClickCounter.set(mc, 0); + } catch (IllegalAccessException ex) { + } catch (IndexOutOfBoundsException ex2) { + } + } + if (removeJumpTicks.isToggled()) { + try { + Reflection.jumpTicks.set(mc.thePlayer, 0); + } catch (IllegalAccessException ex3) { + } catch (IndexOutOfBoundsException ex4) { + } + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/player/Disabler.java b/src/main/java/keystrokesmod/module/impl/player/Disabler.java new file mode 100644 index 0000000..8c7e6e1 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/player/Disabler.java @@ -0,0 +1,184 @@ +package keystrokesmod.module.impl.player; + +import keystrokesmod.event.PreMotionEvent; +import keystrokesmod.event.PrePlayerInputEvent; +import keystrokesmod.event.ReceivePacketEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.movement.LongJump; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.script.classes.Block; +import keystrokesmod.utility.BlockUtils; +import keystrokesmod.utility.PacketUtils; +import keystrokesmod.utility.Reflection; +import keystrokesmod.utility.Utils; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.network.play.server.S27PacketExplosion; +import net.minecraft.util.BlockPos; +import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.Objects; + +public class Disabler extends Module { + + private final int defaultSetbacks = 20; + private final long joinDelay = 200, delay = 0, checkDisabledTime = 4000, timeout = 12000; + private final double min_offset = 0.2; + + private long joinTime, lobbyTime, finished; + private boolean awaitJoin, joinTick, awaitSetback, hideProgress, awaitJump, awaitGround; + private int setbackCount, airTicks, disablerAirTicks; + private double minSetbacks, zOffset; + private float savedYaw, savedPitch; + private boolean noRotateWasEnabled; + private Class noRotate; + + //private String text; + private int[] disp; + private int width; + + public Disabler() { + super("Disabler", Module.category.player); + } + + private void resetVars() { + if (noRotateWasEnabled) { + Objects.requireNonNull(getModule(noRotate)).enable(); + } + awaitJoin = joinTick = awaitSetback = noRotateWasEnabled = awaitJump = false; + minSetbacks = zOffset = lobbyTime = finished = setbackCount = 0; + } + + @SubscribeEvent(priority = EventPriority.LOWEST) + public void onPreMotion(PreMotionEvent e) { + long now = System.currentTimeMillis(); + + if (!awaitGround && !mc.thePlayer.onGround) { + disablerAirTicks++; + } else { + awaitGround = false; + disablerAirTicks = 0; + } + + if (awaitJoin && now >= joinTime + joinDelay) { + ItemStack item = mc.thePlayer.inventory.getStackInSlot(8); + if (Utils.getBedwarsStatus() == 1 || Utils.isBedwarsPractice() || Utils.skywarsQueue()) { + if (ModuleManager.noRotate.isEnabled() && Utils.skywarsQueue()) { + Objects.requireNonNull(getModule(noRotate)).disable(); + noRotateWasEnabled = true; + } + awaitJoin = false; + joinTick = true; + } + } + + if (finished != 0 && mc.thePlayer.onGround && now - finished > checkDisabledTime) { + Utils.print("&7[&dR&7] &adisabler enabled"); + finished = 0; + } + + if (awaitJump && disablerAirTicks == 5) { + KeyBinding.setKeyBindState(mc.gameSettings.keyBindJump.getKeyCode(), false); + awaitJump = false; + + minSetbacks = defaultSetbacks; + savedYaw = e.getYaw(); // pitch will be 0 + lobbyTime = now; + awaitSetback = true; + } + + if (joinTick) { + Utils.print("&7[&dR&7] running disabler..."); + if (mc.thePlayer.onGround || (mc.thePlayer.fallDistance < 0.3 && !Utils.isBedwarsPractice())) { + awaitJump = true; + mc.thePlayer.jump(); + //client.print("Jump"); + joinTick = false; + } else { + minSetbacks = defaultSetbacks; + savedYaw = e.getYaw(); // pitch will be 0 + lobbyTime = now; + awaitSetback = true; + } + return; + } + + if (awaitSetback) { + if (setbackCount >= minSetbacks) { + Utils.print("&7[&dR&7] &afinished in &b" + Utils.round((now - lobbyTime) / 1000d, 1) + "&as, wait a few seconds..."); + resetVars(); + finished = now; + return; + } else if (lobbyTime != 0 && now - lobbyTime > timeout) { + Utils.print("&7[&dR&7] &cdisabler failed"); + resetVars(); + return; + } + if (now - lobbyTime > delay) { + e.setYaw(savedYaw); + e.setPitch(savedPitch); + mc.thePlayer.motionX = 0; + mc.thePlayer.motionY = 0; + mc.thePlayer.motionZ = 0; + //client.print("2"); + if (Utils.skywarsQueue()) { + zOffset = min_offset * 0.7; + if (mc.thePlayer.ticksExisted % 2 == 0) { + zOffset *= -1; + } + e.setPosZ(e.getPosZ() + zOffset); + } else { + e.setPosZ(zOffset + min_offset); + } + } + } + + + + } + + @SubscribeEvent + public void onReceivePacket(ReceivePacketEvent e) { + if (e.getPacket() instanceof S08PacketPlayerPosLook) { + setbackCount++; + zOffset = 0; + } + } + + @SubscribeEvent(priority = EventPriority.LOWEST) // called last in order to apply fix + public void onMoveInput(PrePlayerInputEvent e) { + if (awaitSetback) { + e.setForward(0); + e.setStrafe(0); + } + } + + /*void onRenderTick(float partialTicks) { + if (awaitSetback) { + if (hideProgress || text == null) { + return; + } + render.text(text, disp[0] / 2 - width, disp[1] / 2 + 13, 1, -1, true); + } + }*/ + + @SubscribeEvent + public void onWorldJoin(EntityJoinWorldEvent e) { + if (e.entity == mc.thePlayer) { + long joinTime = System.currentTimeMillis(); + if (awaitSetback) { + Utils.print("&7[&dR&7] &cdisabing disabler"); + resetVars(); + } + awaitJoin = awaitGround = true; + } + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/player/FakeLag.java b/src/main/java/keystrokesmod/module/impl/player/FakeLag.java new file mode 100644 index 0000000..7e94332 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/player/FakeLag.java @@ -0,0 +1,91 @@ +package keystrokesmod.module.impl.player; + +import keystrokesmod.Raven; +import keystrokesmod.event.SendPacketEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.PacketUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.network.Packet; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.network.login.client.C01PacketEncryptionResponse; +import net.minecraft.network.status.client.C00PacketServerQuery; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +import java.util.Iterator; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +public class FakeLag extends Module { + private SliderSetting packetDelay; + private ConcurrentHashMap delayedPackets = new ConcurrentHashMap<>(); + + public FakeLag() { + super("Fake Lag", category.player); + this.registerSetting(packetDelay = new SliderSetting("Packet delay", "ms", 200, 25, 1000, 5)); + } + + public String getInfo() { + return (int) packetDelay.getInput() + "ms"; + } + + public void onEnable() { + delayedPackets.clear(); + } + + public void onDisable() { + sendPacket(true); + } + + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onRenderTick(TickEvent.RenderTickEvent ev) { + if (!Utils.nullCheck()) { + sendPacket(false); + return; + } + sendPacket(true); + } + + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onSendPacket(SendPacketEvent e) { + long receiveTime = System.currentTimeMillis(); + if (!Utils.nullCheck()) { + sendPacket(false); + return; + } + if (e.isCanceled()) { + return; + } + Packet packet = e.getPacket(); + if (packet instanceof C00Handshake || packet instanceof C00PacketLoginStart || packet instanceof C00PacketServerQuery || packet instanceof C01PacketEncryptionResponse) { + return; + } + delayedPackets.put(e.getPacket(), receiveTime); + e.setCanceled(true); + } + + private void sendPacket(boolean delay) { + try { + Iterator> packets = delayedPackets.entrySet().iterator(); + while (packets.hasNext()) { + Map.Entry entry = packets.next(); + Packet packet = entry.getKey(); + if (packet == null) { + continue; + } + long receiveTime = entry.getValue(); + long ms = System.currentTimeMillis(); + if (Utils.timeBetween(ms, receiveTime) > packetDelay.getInput() || !delay) { + Raven.packetsHandler.handlePacket(packet); + PacketUtils.sendPacketNoEvent(packet); + packets.remove(); + } + } + } + catch (Exception e) { + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/player/FastMine.java b/src/main/java/keystrokesmod/module/impl/player/FastMine.java new file mode 100644 index 0000000..a8ed790 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/player/FastMine.java @@ -0,0 +1,105 @@ +package keystrokesmod.module.impl.player; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.BlockUtils; +import keystrokesmod.utility.Reflection; +import keystrokesmod.utility.Utils; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import org.lwjgl.input.Mouse; + +public class FastMine extends Module { // from b4 src + private SliderSetting delay; + public SliderSetting multiplier; + private SliderSetting mode; + private ButtonSetting creativeDisable; + private float lastCurBlockDamageMP; + private String[] modes = new String[]{"Pre", "Post", "Increment"}; + + public FastMine() { + super("FastMine", category.player); + this.registerSetting(new DescriptionSetting("Vanilla is 5 delay & 1x speed.")); + this.registerSetting(delay = new SliderSetting("Break delay", " tick", 5.0, 0.0, 5.0, 1.0)); + this.registerSetting(multiplier = new SliderSetting("Break speed", "x", 1.0, 1.0, 2.0, 0.02)); + this.registerSetting(mode = new SliderSetting("Mode", 0, modes)); + this.registerSetting(creativeDisable = new ButtonSetting("Disable in creative", true)); + this.closetModule = true; + } + + @Override + public String getInfo() { + return ((int) multiplier.getInput() == multiplier.getInput() ? (int) multiplier.getInput() + "" : multiplier.getInput()) + multiplier.getSuffix(); + } + + @Override + public int getInfoType() { + return 1; + } + + @SubscribeEvent + public void a(TickEvent.PlayerTickEvent e) { + if (e.phase != TickEvent.Phase.END || !mc.inGameHasFocus || !Utils.nullCheck()) { + return; + } + if (creativeDisable.isToggled() && mc.thePlayer.capabilities.isCreativeMode) { + return; + } + final int delay = (int) this.delay.getInput(); + if (delay < 5.0) { + try { + if (delay == 0.0) { + Reflection.blockHitDelay.set(mc.playerController, 0); + } else if (Reflection.blockHitDelay.getInt(mc.playerController) > delay) { + Reflection.blockHitDelay.set(mc.playerController, delay); + } + } catch (IllegalAccessException ex) { + } catch (IndexOutOfBoundsException ex2) { + } + } + final double c = multiplier.getInput(); + if (c > 1.0) { + if (!mc.thePlayer.capabilities.isCreativeMode && Mouse.isButtonDown(0)) { + try { + final float float1 = Reflection.curBlockDamageMP.getFloat(mc.playerController); + switch ((int) mode.getInput()) { + case 0: { + float n = (float) (1.0 - 1.0 / c); + if (float1 > 0.0f && float1 < n) { + Reflection.curBlockDamageMP.set(mc.playerController, n); + break; + } + break; + } + case 1: { + final double n2 = 1.0 / c; + if (float1 < 1.0f && float1 >= n2) { + Reflection.curBlockDamageMP.set(mc.playerController, 1); + break; + } + break; + } + case 2: { + float n3 = -1.0f; + if (float1 < 1.0f) { + if (mc.objectMouseOver != null && float1 > this.lastCurBlockDamageMP) { + n3 = (float) (this.lastCurBlockDamageMP + BlockUtils.getBlockHardness(mc.theWorld.getBlockState(mc.objectMouseOver.getBlockPos()).getBlock(), mc.thePlayer.inventory.getStackInSlot(mc.thePlayer.inventory.currentItem), false, false) * (c - 0.2152857 * (c - 1.0))); + } + if (n3 != -1.0f && float1 > 0.0f) { + Reflection.curBlockDamageMP.set(mc.playerController, n3); + } + } + this.lastCurBlockDamageMP = float1; + break; + } + } + } catch (IllegalAccessException | IndexOutOfBoundsException ex3) { + } + } else if (mode.getInput() == 2) { + this.lastCurBlockDamageMP = 0.0f; + } + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/player/FastPlace.java b/src/main/java/keystrokesmod/module/impl/player/FastPlace.java new file mode 100644 index 0000000..5752edb --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/player/FastPlace.java @@ -0,0 +1,85 @@ +package keystrokesmod.module.impl.player; + +import keystrokesmod.event.SendPacketEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Reflection; +import keystrokesmod.utility.Utils; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; +import net.minecraftforge.fml.common.gameevent.TickEvent.PlayerTickEvent; + +public class FastPlace extends Module { + public SliderSetting tickDelay; + public ButtonSetting blocksOnly, pitchCheck; + + public FastPlace() { + super("FastPlace", Module.category.player, 0); + this.registerSetting(tickDelay = new SliderSetting("Tick delay", 1.0, 1.0, 3.0, 1.0)); + this.registerSetting(blocksOnly = new ButtonSetting("Blocks only", true)); + this.registerSetting(pitchCheck = new ButtonSetting("Pitch check", false)); + this.closetModule = true; + } + + @SubscribeEvent + public void onPlayerTick(PlayerTickEvent e) { + if (e.phase == Phase.END) { + if (ModuleManager.scaffold.stopFastPlace()) { + return; + } + if (Utils.nullCheck() && mc.inGameHasFocus && Reflection.rightClickDelayTimerField != null) { + if (blocksOnly.isToggled()) { + ItemStack item = mc.thePlayer.getHeldItem(); + if (item == null || !(item.getItem() instanceof ItemBlock)) { + return; + } + } + if (pitchCheck.isToggled() && mc.thePlayer.rotationPitch < 70.0f) { + return; + } + + try { + int c = (int) tickDelay.getInput(); + if (c == 0) { + Reflection.rightClickDelayTimerField.set(mc, 0); + } else { + if (c == 4) { + return; + } + + int d = Reflection.rightClickDelayTimerField.getInt(mc); + if (d == 4) { + Reflection.rightClickDelayTimerField.set(mc, c); + } + } + } catch (IllegalAccessException var4) { + } catch (IndexOutOfBoundsException var5) { + } + } + } + } + + @SubscribeEvent + public void onSendPacket(SendPacketEvent e) { + if (!Utils.nullCheck() || ModuleManager.scaffold.stopFastPlace()) { + return; + } + if (pitchCheck.isToggled() && mc.thePlayer.rotationPitch < 70.0f) { + return; + } + if (e.getPacket() instanceof C08PacketPlayerBlockPlacement) { + C08PacketPlayerBlockPlacement p = (C08PacketPlayerBlockPlacement) e.getPacket(); + if (p.getPlacedBlockDirection() != 255 || p.getStack() == null || !(p.getStack().getItem() instanceof ItemBlock)) { + return; + } + if (Math.random() < 0.7) { + e.setCanceled(true); + } + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/player/Freecam.java b/src/main/java/keystrokesmod/module/impl/player/Freecam.java new file mode 100644 index 0000000..26cd077 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/player/Freecam.java @@ -0,0 +1,193 @@ +package keystrokesmod.module.impl.player; + +import keystrokesmod.event.SendPacketEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.client.entity.EntityOtherPlayerMP; +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.util.MovingObjectPosition; +import net.minecraftforge.client.event.MouseEvent; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.input.Keyboard; + +import java.awt.*; + +public class Freecam extends Module { + public SliderSetting speed; + private ButtonSetting disableOnDamage; + private ButtonSetting showArm; + private ButtonSetting allowDigging; + private ButtonSetting allowInteracting; + private ButtonSetting allowPlacing; + public static EntityOtherPlayerMP freeEntity = null; + private int[] lcc = new int[]{Integer.MAX_VALUE, 0}; + private float[] sAng = new float[]{0.0F, 0.0F}; + + public Freecam() { + super("Freecam", category.player, 0); + this.registerSetting(speed = new SliderSetting("Speed", 2.5D, 0.5D, 10.0D, 0.5D)); + this.registerSetting(disableOnDamage = new ButtonSetting("Disable on damage", true)); + this.registerSetting(allowDigging = new ButtonSetting("Allow digging", false)); + this.registerSetting(allowInteracting = new ButtonSetting("Allow interacting", false)); + this.registerSetting(allowPlacing = new ButtonSetting("Allow placing", false)); + this.registerSetting(showArm = new ButtonSetting("Show arm", false)); + } + + public void onEnable() { + if (!mc.thePlayer.onGround) { + this.disable(); + } else { + freeEntity = new EntityOtherPlayerMP(mc.theWorld, mc.thePlayer.getGameProfile()); + freeEntity.copyLocationAndAnglesFrom(mc.thePlayer); + this.sAng[0] = freeEntity.rotationYawHead = mc.thePlayer.rotationYawHead; + this.sAng[1] = mc.thePlayer.rotationPitch; + freeEntity.setVelocity(0.0D, 0.0D, 0.0D); + freeEntity.setInvisible(true); + mc.theWorld.addEntityToWorld(-8008, freeEntity); + mc.setRenderViewEntity(freeEntity); + } + } + + public void onDisable() { + if (freeEntity != null) { + mc.setRenderViewEntity(mc.thePlayer); + mc.thePlayer.rotationYaw = mc.thePlayer.rotationYawHead = this.sAng[0]; + mc.thePlayer.rotationPitch = this.sAng[1]; + mc.theWorld.removeEntity(freeEntity); + freeEntity = null; + } + + this.lcc = new int[]{Integer.MAX_VALUE, 0}; + int x = mc.thePlayer.chunkCoordX; + int z = mc.thePlayer.chunkCoordZ; + + for (int x2 = -1; x2 <= 1; ++x2) { + for (int z2 = -1; z2 <= 1; ++z2) { + int a = x + x2; + int b = z + z2; + mc.theWorld.markBlockRangeForRenderUpdate(a * 16, 0, b * 16, a * 16 + 15, 256, b * 16 + 15); + } + } + + } + + public void onUpdate() { + if (disableOnDamage.isToggled() && mc.thePlayer.hurtTime != 0) { + this.disable(); + } else { + mc.thePlayer.setSprinting(false); + mc.thePlayer.moveForward = 0.0F; + mc.thePlayer.moveStrafing = 0.0F; + freeEntity.rotationYaw = freeEntity.rotationYawHead = mc.thePlayer.rotationYaw; + freeEntity.rotationPitch = mc.thePlayer.rotationPitch; + double s = 0.215D * speed.getInput(); + double rad; + double dx; + double dz; + if (Keyboard.isKeyDown(mc.gameSettings.keyBindForward.getKeyCode())) { + rad = (double) freeEntity.rotationYawHead * 0.017453292519943295D; + dx = -1.0D * Math.sin(rad) * s; + dz = Math.cos(rad) * s; + freeEntity.posX += dx; + freeEntity.posZ += dz; + } + + if (Keyboard.isKeyDown(mc.gameSettings.keyBindBack.getKeyCode())) { + rad = (double) freeEntity.rotationYawHead * 0.017453292519943295D; + dx = -1.0D * Math.sin(rad) * s; + dz = Math.cos(rad) * s; + freeEntity.posX -= dx; + freeEntity.posZ -= dz; + } + + if (Keyboard.isKeyDown(mc.gameSettings.keyBindLeft.getKeyCode())) { + rad = (double) (freeEntity.rotationYawHead - 90.0F) * 0.017453292519943295D; + dx = -1.0D * Math.sin(rad) * s; + dz = Math.cos(rad) * s; + freeEntity.posX += dx; + freeEntity.posZ += dz; + } + + if (Keyboard.isKeyDown(mc.gameSettings.keyBindRight.getKeyCode())) { + rad = (double) (freeEntity.rotationYawHead + 90.0F) * 0.017453292519943295D; + dx = -1.0D * Math.sin(rad) * s; + dz = Math.cos(rad) * s; + freeEntity.posX += dx; + freeEntity.posZ += dz; + } + + if (Utils.jumpDown()) { + freeEntity.posY += 0.93D * s; + } + + if (Keyboard.isKeyDown(mc.gameSettings.keyBindSneak.getKeyCode())) { + freeEntity.posY -= 0.93D * s; + } + + mc.thePlayer.setSneaking(false); + if (this.lcc[0] != Integer.MAX_VALUE && (this.lcc[0] != freeEntity.chunkCoordX || this.lcc[1] != freeEntity.chunkCoordZ)) { + int x = freeEntity.chunkCoordX; + int z = freeEntity.chunkCoordZ; + mc.theWorld.markBlockRangeForRenderUpdate(x * 16, 0, z * 16, x * 16 + 15, 256, z * 16 + 15); + } + + this.lcc[0] = freeEntity.chunkCoordX; + this.lcc[1] = freeEntity.chunkCoordZ; + } + } + + @SubscribeEvent + public void re(RenderWorldLastEvent e) { + if (Utils.nullCheck()) { + if (!showArm.isToggled()) { + mc.thePlayer.renderArmPitch = mc.thePlayer.prevRenderArmPitch = 700.0F; + } + RenderUtils.renderEntity(mc.thePlayer, 1, 0.0D, 0.0D, Color.green.getRGB(), false); + RenderUtils.renderEntity(mc.thePlayer, 2, 0.0D, 0.0D, Color.green.getRGB(), false); + } + + } + + @SubscribeEvent + public void m(MouseEvent e) { + if (!Utils.nullCheck()) { + return; + } + if ((e.button == 0 && !allowDigging.isToggled() || e.button == 1 && !allowPlacing.isToggled()) && mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + e.setCanceled(true); + } + if (!allowInteracting.isToggled()) { + if ((e.button == 1 || e.button == 0) && mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY) { + e.setCanceled(true); + } + } + } + + @SubscribeEvent + public void onSendPacket(SendPacketEvent e) { + if (!Utils.nullCheck()) { + return; + } + if (!allowDigging.isToggled()) { + if (e.getPacket() instanceof C07PacketPlayerDigging) { + e.setCanceled(true); + } + } + if (!allowPlacing.isToggled()) { + if (e.getPacket() instanceof C08PacketPlayerBlockPlacement) { + e.setCanceled(true); + } + } + if (!allowInteracting.isToggled()) { + if (e.getPacket() instanceof C02PacketUseEntity) { + e.setCanceled(true); + } + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/player/InvManager.java b/src/main/java/keystrokesmod/module/impl/player/InvManager.java new file mode 100644 index 0000000..21eba3f --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/player/InvManager.java @@ -0,0 +1,746 @@ +package keystrokesmod.module.impl.player; + +import keystrokesmod.Raven; +import keystrokesmod.event.ReceivePacketEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Utils; +import net.minecraft.block.*; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.ContainerChest; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.*; +import net.minecraft.network.play.server.S30PacketWindowItems; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.input.Mouse; + +import java.util.Arrays; +import java.util.List; + +public class InvManager extends Module { + private ButtonSetting closeChest; + private ButtonSetting closeInventory; + private ButtonSetting disableInLobby; + private SliderSetting autoArmor; + private SliderSetting autoSort; + private ButtonSetting customChest; + private SliderSetting chestStealer; + private ButtonSetting middleClickToClean; + private SliderSetting inventoryCleaner; + private SliderSetting swordSlot; + private SliderSetting blocksSlot; + private SliderSetting goldenAppleSlot; + private SliderSetting projectileSlot; + private SliderSetting speedPotionSlot; + private SliderSetting pearlSlot; + private String[] trashItems = { "stick", "bed", "sapling", "pressureplate", "weightedplate", "book", "glassbottle", "reeds", "sugar", "expbottle", "flesh", "string", "cake", "mushroom", "flint", "compass", "dyePowder", "feather", "shears", "anvil", "torch", "seeds", "leather", "skull", "record", "flower", "minecart", "waterlily", "wheat", "sulphur", "boat", "dyepowder", "frame", "writingbook", "comparator", "banner", "diode", "item.redstone", "ghasttear", "goldnugget", "netherstalkseeds" }; + private int lastStole; + private int lastSort; + private int lastArmor; + private int lastClean; + private boolean receivedInventoryData; + + public InvManager() { + super("InvManager", category.player); + this.registerSetting(closeChest = new ButtonSetting("Close chest", true)); + this.registerSetting(closeInventory = new ButtonSetting("Close inventory", false)); + this.registerSetting(disableInLobby = new ButtonSetting("Disable in lobby", true)); + this.registerSetting(autoArmor = new SliderSetting("Auto armor", true, 3, 0, 20, 1)); + this.registerSetting(autoSort = new SliderSetting("Auto sort", true,3, 0, 20, 1)); + this.registerSetting(chestStealer = new SliderSetting("Chest stealer", true, 2, 0, 20, 1)); + this.registerSetting(customChest = new ButtonSetting("Steal from custom chests", false)); + this.registerSetting(inventoryCleaner = new SliderSetting("Inventory cleaner", true, 3, 0, 20, 1)); + this.registerSetting(middleClickToClean = new ButtonSetting("Middle click to clean", false)); + this.registerSetting(swordSlot = new SliderSetting("Sword slot", true, -1, 1, 9, 1)); + this.registerSetting(blocksSlot = new SliderSetting("Blocks slot", true, -1, 1, 9, 1)); + this.registerSetting(goldenAppleSlot = new SliderSetting("Golden apple slot", true, -1, 1, 9, 1)); + this.registerSetting(projectileSlot = new SliderSetting("Projectile slot", true,-1, 1, 9, 1)); + this.registerSetting(speedPotionSlot = new SliderSetting("Speed potion slot", true,-1, 1, 9, 1)); + this.registerSetting(pearlSlot = new SliderSetting("Pearl slot", true,-1, 1, 9, 1)); + } + + public void onEnable() { + resetDelay(); + receivedInventoryData = false; + } + + public void onUpdate() { + if ((disableInLobby.isToggled() && Utils.isLobby())) { + resetDelay(); + return; + } + if (Utils.inInventory()) { + if (autoArmor.getInput() != -1 && lastArmor++ >= autoArmor.getInput()) { + for (int i = 0; i < 4; i++) { + int bestSlot = getBestArmor(i, null); + if (bestSlot == i + 5) { + continue; + } + if (bestSlot != -1) { + if (getItemStack(i + 5) != null) { + drop(i + 5); + } else { + click(bestSlot, 0, true); + lastArmor = 0; + } + return; + } + } + } + if (autoSort.getInput() != -1 && ++lastSort >= autoSort.getInput()) { + if (swordSlot.getInput() != -1) { + if (sort(getBestSword(null, (int) swordSlot.getInput()), (int) swordSlot.getInput())) { + lastSort = 0; + return; + } + } + if (goldenAppleSlot.getInput() != -1) { + if (sort(getBiggestStack(Items.golden_apple, (int) goldenAppleSlot.getInput()), (int) goldenAppleSlot.getInput())) { + lastSort = 0; + return; + } + } + if (blocksSlot.getInput() != -1) { + if (sort(getMostBlocks(), (int) blocksSlot.getInput())) { + lastSort = 0; + return; + } + } + if (projectileSlot.getInput() != -1) { + if (sort(getMostProjectiles((int) projectileSlot.getInput()), (int) projectileSlot.getInput())) { + lastSort = 0; + return; + } + } + if (pearlSlot.getInput() != -1) { + if (sort(getBiggestStack(Items.ender_pearl, (int) pearlSlot.getInput()), (int) pearlSlot.getInput())) { + lastSort = 0; + return; + } + } + if (speedPotionSlot.getInput() != -1) { + if (sort(getBestPotion((int) speedPotionSlot.getInput(), null), (int) speedPotionSlot.getInput())) { + lastSort = 0; + return; + } + } + } + if (inventoryCleaner.getInput() != -1) { + if (middleClickToClean.isToggled() && !Mouse.isButtonDown(2)) { + return; + } + if (++lastClean >= inventoryCleaner.getInput()) { + for (int i = 5; i < 45; i++) { + ItemStack stack = getItemStack(i); + if (stack == null) { + continue; + } + if (!canDrop(stack, i)) { + continue; + } + drop(i); + lastClean = 0; + return; + } + } + } + if ((lastClean > inventoryCleaner.getInput() || lastClean == 0) && (lastArmor > autoArmor.getInput() || lastArmor == 0) && (lastSort > autoSort.getInput() || lastSort == 0)) { + if (closeInventory.isToggled()) { + mc.thePlayer.closeScreen(); + } + } + } + else if (chestStealer.getInput() != -1 && mc.thePlayer.openContainer instanceof ContainerChest) { + ContainerChest chest = (ContainerChest) mc.thePlayer.openContainer; + if (chest == null || inventoryFull()) { + autoClose(); + return; + } + String name = chest.getLowerChestInventory().getName(); + if (!customChest.isToggled() && !name.equals("Chest") && !name.equals("Ender Chest") && !name.equals("Large Chest")) { + return; + } + boolean notEmpty = false; + boolean stolen = false; + int size = chest.getLowerChestInventory().getSizeInventory(); + for (int i = 0; i < size; i++) { + ItemStack item = chest.getLowerChestInventory().getStackInSlot(i); + if (item == null) { + continue; + } + if (Arrays.stream(trashItems).anyMatch(item.getUnlocalizedName().toLowerCase()::contains)) { + continue; + } + IInventory inventory = chest.getLowerChestInventory(); + notEmpty = true; + if (item.getItem() instanceof ItemSword) { + if (getBestSword(inventory, (int) swordSlot.getInput()) != i) { + continue; + } + if (++lastStole >= chestStealer.getInput()) { + if (swordSlot.getInput() != -1) { + mc.playerController.windowClick(chest.windowId, i, (int) swordSlot.getInput() - 1, 2, mc.thePlayer); + } + else { + mc.playerController.windowClick(chest.windowId, i, 0, 1, mc.thePlayer); + } + lastStole = 0; + } + stolen = true; + } + else if (item.getItem() instanceof ItemBlock) { + if (!Utils.canBePlaced((ItemBlock) item.getItem())) { + continue; + } + if (++lastStole >= chestStealer.getInput()) { + mc.playerController.windowClick(chest.windowId, i, 0, 1, mc.thePlayer); + lastStole = 0; + } + stolen = true; + } + else if (item.getItem() instanceof ItemAppleGold) { + if (++lastStole >= chestStealer.getInput()) { + if (goldenAppleSlot.getInput() == -1) { + mc.playerController.windowClick(chest.windowId, i, 0, 1, mc.thePlayer); + } + else { + mc.playerController.windowClick(chest.windowId, i, (int) (goldenAppleSlot.getInput() - 1), 2, mc.thePlayer); + } + lastStole = 0; + } + stolen = true; + } + else if (item.getItem() instanceof ItemSnowball || item.getItem() instanceof ItemEgg) { + if (++lastStole >= chestStealer.getInput()) { + if (projectileSlot.getInput() == -1) { + mc.playerController.windowClick(chest.windowId, i, 0, 1, mc.thePlayer); + } + else { + mc.playerController.windowClick(chest.windowId, i, (int) (projectileSlot.getInput() - 1), 2, mc.thePlayer); + } + lastStole = 0; + } + stolen = true; + } + else if (item.getItem() instanceof ItemEnderPearl) { + if (++lastStole >= chestStealer.getInput()) { + if (pearlSlot.getInput() == -1) { + mc.playerController.windowClick(chest.windowId, i, 0, 1, mc.thePlayer); + } + else { + mc.playerController.windowClick(chest.windowId, i, (int) (pearlSlot.getInput() - 1), 2, mc.thePlayer); + } + lastStole = 0; + } + stolen = true; + } + else if (item.getItem() instanceof ItemArmor) { + if (getBestArmor(((ItemArmor) item.getItem()).armorType, inventory) != i) { + continue; + } + if (++lastStole >= chestStealer.getInput()) { + mc.playerController.windowClick(chest.windowId, i, 0, 1, mc.thePlayer); + lastStole = 0; + } + stolen = true; + } + else if (item.getItem() instanceof ItemPotion) { + if (++lastStole >= chestStealer.getInput()) { + if (!isSpeedPot(item)) { + mc.playerController.windowClick(chest.windowId, i, 0, 1, mc.thePlayer); + } else { + if (getBestPotion((int) speedPotionSlot.getInput(), inventory) != i || speedPotionSlot.getInput() == -1) { + mc.playerController.windowClick(chest.windowId, i, 0, 1, mc.thePlayer); + } + else { + mc.playerController.windowClick(chest.windowId, i, (int) (speedPotionSlot.getInput() - 1), 2, mc.thePlayer); + } + } + lastStole = 0; + } + stolen = true; + } + else if (item.getItem() instanceof ItemTool) { + if (++lastStole >= chestStealer.getInput()) { + if (getBestTool(item, inventory) != i) { + continue; + } + if (++lastStole >= chestStealer.getInput()) { + mc.playerController.windowClick(chest.windowId, i, 0, 1, mc.thePlayer); + lastStole = 0; + } + } + stolen = true; + } + else if (item.getItem() instanceof ItemBow) { + if (++lastStole >= chestStealer.getInput()) { + if (getBestBow(inventory) != i) { + continue; + } + if (++lastStole >= chestStealer.getInput()) { + mc.playerController.windowClick(chest.windowId, i, 0, 1, mc.thePlayer); + lastStole = 0; + } + } + stolen = true; + } + else if (item.getItem() instanceof ItemFishingRod) { + if (++lastStole >= chestStealer.getInput()) { + if (getBestRod(inventory) != i) { + continue; + } + if (++lastStole >= chestStealer.getInput()) { + mc.playerController.windowClick(chest.windowId, i, 0, 1, mc.thePlayer); + lastStole = 0; + } + } + stolen = true; + } + else { + if (++lastStole >= chestStealer.getInput()) { + mc.playerController.windowClick(chest.windowId, i, 0, 1, mc.thePlayer); + lastStole = 0; + } + stolen = true; + } + } + + if (inventoryFull() || !notEmpty || !stolen) { + autoClose(); + } + } + else { + resetDelay(); + receivedInventoryData = false; + } + } + + @SubscribeEvent + public void onReceivePacket(ReceivePacketEvent e) { + if (e.getPacket() instanceof S30PacketWindowItems) { + receivedInventoryData = true; + } + } + + private int getProtection(final ItemStack itemStack) { + return ((ItemArmor)itemStack.getItem()).damageReduceAmount + EnchantmentHelper.getEnchantmentModifierDamage(new ItemStack[] { itemStack }, DamageSource.generic); + } + + private void click(int slot, int mouseButton, boolean shiftClick) { + mc.playerController.windowClick(mc.thePlayer.inventoryContainer.windowId, slot, mouseButton, shiftClick ? 1 : 0, mc.thePlayer); + } + + private boolean sort(int bestSlot, int desiredSlot) { + if (bestSlot != -1 && bestSlot != desiredSlot + 35) { + swap(bestSlot, desiredSlot - 1); + return true; + } + return false; + } + + private void drop(int slot) { + mc.playerController.windowClick(0, slot, 1, 4, mc.thePlayer); + } + + private void swap(int slot, int hSlot) { + mc.playerController.windowClick(mc.thePlayer.inventoryContainer.windowId, slot, hSlot, 2, mc.thePlayer); + } + + private boolean isSpeedPot(ItemStack item) { + List list = ((ItemPotion) item.getItem()).getEffects(item); + if (list == null) { + return false; + } + for (PotionEffect effect : list) { + if (effect.getEffectName().equals("potion.moveSpeed")) { + return true; + } + } + return false; + } + + private boolean inventoryFull() { + for (int i = 9; i < 45; i++) { + if (mc.thePlayer.inventoryContainer.getSlot(i).getStack() == null) { + return false; + } + } + return true; + } + + private void resetDelay() { + lastStole = lastArmor = lastClean = lastSort = 0; + } + + private void autoClose() { + if (closeChest.isToggled() && receivedInventoryData) { + mc.thePlayer.closeScreen(); + receivedInventoryData = false; + } + } + + private int getBestSword(IInventory inventory, int desiredSlot) { + int bestSword = -1; + double lastDamage = -1; + double damageInSlot = -1; + if (desiredSlot != -1) { + ItemStack itemStackInSlot = getItemStack(desiredSlot + 35); + if (itemStackInSlot != null && itemStackInSlot.getItem() instanceof ItemSword) { + damageInSlot = Utils.getDamage(itemStackInSlot); + } + } + for (int i = 9; i < 45; i++) { + ItemStack item = getItemStack(i); + if (item == null || !(item.getItem() instanceof ItemSword)) { + continue; + } + double damage = Utils.getDamage(item); + if (damage > lastDamage && damage > damageInSlot) { + lastDamage = damage; + bestSword = i; + } + } + if (inventory != null) { + for (int i = 0; i < inventory.getSizeInventory(); i++) { + ItemStack item = inventory.getStackInSlot(i); + if (item == null || !(item.getItem() instanceof ItemSword)) { + continue; + } + double damage = Utils.getDamage(item); + if (damage > lastDamage && damage > damageInSlot) { + lastDamage = damage; + bestSword = i; + } + } + } + if (bestSword == -1) { + bestSword = desiredSlot + 35; + } + return bestSword; + } + + private int getBestArmor(int armorType, IInventory inventory) { + int bestArmor = -1; + double lastProtection = -1; + for (int i = 5; i < 45; i++) { + ItemStack item = getItemStack(i); + if (item == null || !(item.getItem() instanceof ItemArmor) || !(((ItemArmor) item.getItem()).armorType == armorType)) { + continue; + } + double protection = getProtection(item); + if (protection > lastProtection) { + lastProtection = protection; + bestArmor = i; + } + } + if (inventory != null) { + for (int i = 0; i < inventory.getSizeInventory(); i++) { + ItemStack item = inventory.getStackInSlot(i); + if (item == null || !(item.getItem() instanceof ItemArmor) || !(((ItemArmor) item.getItem()).armorType == armorType)) { + continue; + } + double protection = getProtection(item); + if (protection > lastProtection) { + lastProtection = protection; + bestArmor = i; + } + } + } + return bestArmor; + } + + private boolean dropPotion(ItemStack stack) { + if (stack != null && stack.getItem() instanceof ItemPotion) { + ItemPotion potion = (ItemPotion) stack.getItem(); + if (potion.getEffects(stack) == null) { + return true; + } + for (PotionEffect effect : potion.getEffects(stack)) { + if (effect.getPotionID() == Potion.moveSlowdown.getId() || effect.getPotionID() == Potion.weakness.getId() || effect.getPotionID() == Potion.poison.getId() || effect.getPotionID() == Potion.harm.getId()) { + return true; + } + } + } + return false; + } + + private int getBestBow(IInventory inventory) { + int bestBow = -1; + double lastPower = -1; + for (int i = 5; i < 45; i++) { + ItemStack item = getItemStack(i); + if (item == null || !(item.getItem() instanceof ItemBow)) { + continue; + } + double protection = getPower(item); + if (protection > lastPower) { + lastPower = protection; + bestBow = i; + } + } + if (inventory != null) { + for (int i = 0; i < inventory.getSizeInventory(); i++) { + ItemStack item = inventory.getStackInSlot(i); + if (item == null || !(item.getItem() instanceof ItemBow)) { + continue; + } + double power = getPower(item); + if (power > lastPower) { + lastPower = power; + bestBow = i; + } + } + } + return bestBow; + } + + private float getPower(ItemStack stack) { + float score = 0; + Item item = stack.getItem(); + if (item instanceof ItemBow) { + score += EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, stack); + score += EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, stack) * 0.5; + score += EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, stack) * 0.1; + } + return score; + } + + private int getBestRod(IInventory inventory) { + int bestRod = -1; + double lastKnocback = -1; + for (int i = 5; i < 45; i++) { + ItemStack item = getItemStack(i); + if (item == null || !(item.getItem() instanceof ItemFishingRod)) { + continue; + } + double knockback = EnchantmentHelper.getEnchantmentLevel(Enchantment.knockback.effectId, item); + if (knockback > lastKnocback) { + lastKnocback = knockback; + bestRod = i; + } + } + if (inventory != null) { + for (int i = 0; i < inventory.getSizeInventory(); i++) { + ItemStack item = inventory.getStackInSlot(i); + if (item == null || !(item.getItem() instanceof ItemFishingRod)) { + continue; + } + double knockback = EnchantmentHelper.getEnchantmentLevel(Enchantment.knockback.effectId, item); + if (knockback > lastKnocback) { + lastKnocback = knockback; + bestRod = i; + } + } + } + return bestRod; + } + + private int getBestTool(ItemStack itemStack, IInventory inventory) { + int bestTool = -1; + double lastEfficiency = -1; + Block blockType = Blocks.dirt; + if (itemStack.getItem() instanceof ItemAxe) { + blockType = Blocks.log; + } + else if (itemStack.getItem() instanceof ItemPickaxe) { + blockType = Blocks.stone; + } + for (int i = 5; i < 45; i++) { + ItemStack item = getItemStack(i); + if (item == null || !(item.getItem() instanceof ItemTool) || item.getItem() != itemStack.getItem()) { + continue; + } + double efficiency = Utils.getEfficiency(item, blockType); + if (efficiency > lastEfficiency) { + lastEfficiency = efficiency; + bestTool = i; + } + } + if (inventory != null) { + for (int i = 0; i < inventory.getSizeInventory(); i++) { + ItemStack item = inventory.getStackInSlot(i); + if (item == null || !(item.getItem() instanceof ItemTool) || item.getItem() != itemStack.getItem()) { + continue; + } + double efficiency = Utils.getEfficiency(item, blockType);; + if (efficiency > lastEfficiency) { + lastEfficiency = efficiency; + bestTool = i; + } + } + } + return bestTool; + } + + private int getBestPotion(int desiredSlot, IInventory inventory) { + int amplifier = -1; + int bestPotion = -1; + double amplifierInSlot = -1; + int biggestStack = 0; + if (amplifierInSlot != -1) { + ItemStack itemStackInSlot = getItemStack( desiredSlot + 35); + if (itemStackInSlot != null && itemStackInSlot.getItem() instanceof ItemPotion) { + amplifierInSlot = getPotionLevel(itemStackInSlot); + } + } + for (int i = 9; i < 45; i++) { + ItemStack item = getItemStack(i); + if (item != null && item.getItem() instanceof ItemPotion) { + List list = ((ItemPotion) item.getItem()).getEffects(item); + if (list == null) { + continue; + } + int size = item.stackSize; + for (PotionEffect effect : list) { + int score = effect.getAmplifier() + effect.getDuration(); + if (effect.getEffectName().equals("potion.moveSpeed") && score > amplifier && score > amplifierInSlot && size > biggestStack) { + bestPotion = i; + amplifier = score; + biggestStack = size; + } + } + } + } + if (inventory != null) { + for (int i = 0; i < inventory.getSizeInventory(); i++) { + ItemStack item = inventory.getStackInSlot(i); + if (item != null && item.getItem() instanceof ItemPotion) { + List list = ((ItemPotion) item.getItem()).getEffects(item); + if (list == null) { + continue; + } + for (PotionEffect effect : list) { + if (effect.getEffectName().equals("potion.moveSpeed") && effect.getAmplifier() > amplifier && effect.getAmplifier() > amplifierInSlot) { + bestPotion = i; + amplifier = effect.getAmplifier(); + } + } + } + } + } + return bestPotion; + } + + private int getPotionLevel(ItemStack item) { + List list = ((ItemPotion) item.getItem()).getEffects(item); + if (list == null) { + return -1; + } + for (PotionEffect effect : list) { + if (effect.getEffectName().equals("potion.moveSpeed")) { + return effect.getAmplifier() + effect.getDuration(); + } + } + return -1; + } + + private int getBiggestStack(Item targetItem, int desiredSlot) { + int stack = 0; + int biggestSlot = -1; + int stackInSlot = -1; + if (desiredSlot != -1) { + ItemStack itemStackInSlot = getItemStack(desiredSlot + 35); + if (itemStackInSlot != null) { + stackInSlot = itemStackInSlot.stackSize; + } + } + for (int i = 9; i < 45; i++) { + ItemStack item = getItemStack(i); + if (item != null && item.getItem() == targetItem && item.stackSize > stack && item.stackSize > stackInSlot) { + stack = item.stackSize; + biggestSlot = i; + } + } + return biggestSlot; + } + + private boolean canDrop(ItemStack itemStack, int slot) { + if (Arrays.stream(trashItems).anyMatch(itemStack.getUnlocalizedName().toLowerCase()::contains)) { + return true; + } + if (dropPotion(itemStack)) { + return true; + } + if (itemStack.getItem() instanceof ItemSword && getBestSword(null, (int) swordSlot.getInput()) != slot) { + return true; + } + if (itemStack.getItem() instanceof ItemArmor && getBestArmor(((ItemArmor) itemStack.getItem()).armorType, null) != slot) { + return true; + } + if (itemStack.getItem() instanceof ItemTool && getBestTool(itemStack, null) != slot) { + return true; + } + if (itemStack.getItem() instanceof ItemBow && getBestBow(null) != slot) { + return true; + } + if (itemStack.getItem() instanceof ItemFishingRod && getBestRod(null) != slot) { + return true; + } + return false; + } + + private int getMostProjectiles(int desiredSlot) { + int biggestSnowballSlot = getBiggestStack(Items.snowball, (int) projectileSlot.getInput()); + int biggestEggSlot = getBiggestStack(Items.egg, (int) projectileSlot.getInput()); + int biggestSlot = -1; + int stackInSlot = 0; + if (desiredSlot != -1) { + ItemStack itemStackInSlot = getItemStack(desiredSlot + 35); + if (itemStackInSlot != null && (itemStackInSlot.getItem() instanceof ItemEgg || itemStackInSlot.getItem() instanceof ItemSnowball)) { + stackInSlot = itemStackInSlot.stackSize; + } + } + if (stackInSlot >= biggestEggSlot && stackInSlot >= biggestSnowballSlot) { + return -1; + } + if (biggestEggSlot > biggestSnowballSlot) { + biggestSlot = biggestEggSlot; + } + else if (biggestSnowballSlot > biggestEggSlot) { + biggestSlot = biggestSnowballSlot; + } + else if (biggestSnowballSlot != -1 && biggestEggSlot != -1 && biggestEggSlot == biggestSnowballSlot) { + biggestSlot = biggestSnowballSlot; + } + return biggestSlot; + } + + private int getMostBlocks() { + int stack = 0; + int biggestSlot = -1; + ItemStack itemStackInSlot = getItemStack((int) (blocksSlot.getInput() + 35)); + int stackInSlot = 0; + if (itemStackInSlot != null) { + stackInSlot = itemStackInSlot.stackSize; + } + for (int i = 9; i < 45; i++) { + ItemStack item = getItemStack(i); + if (item != null && item.getItem() instanceof ItemBlock && item.stackSize > stack && Utils.canBePlaced((ItemBlock) item.getItem()) && item.stackSize > stackInSlot) { + stack = item.stackSize; + biggestSlot = i; + } + } + return biggestSlot; + } + + private ItemStack getItemStack(int i) { + Slot slot = mc.thePlayer.inventoryContainer.getSlot(i); + if (slot == null) { + return null; + } + ItemStack item = slot.getStack(); + if (item == null) { + return null; + } + return item; + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/player/NoFall.java b/src/main/java/keystrokesmod/module/impl/player/NoFall.java new file mode 100644 index 0000000..525d7d3 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/player/NoFall.java @@ -0,0 +1,130 @@ +package keystrokesmod.module.impl.player; + +import keystrokesmod.event.PreMotionEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.script.classes.Block; +import keystrokesmod.utility.BlockUtils; +import keystrokesmod.utility.PacketUtils; +import keystrokesmod.utility.Reflection; +import keystrokesmod.utility.Utils; +import net.minecraft.client.gui.GuiIngame; +import net.minecraft.init.Blocks; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.util.BlockPos; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class NoFall extends Module { + public SliderSetting mode; + private SliderSetting minFallDistance; + private ButtonSetting disableAdventure; + private ButtonSetting ignoreVoid; + private String[] modes = new String[]{"Spoof", "Packet", "NoGround"}; + + private double initialY; + private double dynamic; + private String edging = new String(""); + + public NoFall() { + super("NoFall", category.player); + this.registerSetting(mode = new SliderSetting("Mode", 0, modes)); + this.registerSetting(disableAdventure = new ButtonSetting("Disable adventure", false)); + this.registerSetting(minFallDistance = new SliderSetting("Minimum fall distance", 3, 0, 10, 0.1)); + this.registerSetting(ignoreVoid = new ButtonSetting("Ignore void", true)); + } + + public void onDisable() { + Utils.resetTimer(); + } + + @SubscribeEvent(priority = EventPriority.LOWEST) + public void onPreMotion(PreMotionEvent e) { + if (reset()) { + Utils.resetTimer(); + initialY = mc.thePlayer.posY; + return; + } + double predictedY = mc.thePlayer.posY + mc.thePlayer.motionY; + double distanceFallen = initialY - predictedY; + edging = ""; + if (mc.thePlayer.motionY >= -0.9) { + dynamic = 3; + } + if (mc.thePlayer.motionY < -0.9) { + dynamic = 3.5; + } + if (mc.thePlayer.motionY < -1.7) { + dynamic = 4; + } + if (mc.thePlayer.motionY < -2.4) { + dynamic = 4.5; + } + if (((double) mc.thePlayer.fallDistance >= 0.5) || mode.getInput() == 2) { + switch ((int) mode.getInput()) { + case 0: + e.setOnGround(true); + break; + case 1: + if (distanceFallen >= dynamic) { + Utils.getTimer().timerSpeed = (float) 0.72; + PacketUtils.sendPacketNoEvent(new C03PacketPlayer(true)); + initialY = mc.thePlayer.posY; + edging = "nofall packet"; + } + break; + case 2: + e.setOnGround(false); + break; + } + } + edging += " " + dynamic; + //Utils.print("" + mc.thePlayer.ticksExisted + " " + mc.thePlayer.motionY + " " + edging); + } + + @Override + public String getInfo() { + return modes[(int) mode.getInput()]; + } + + private boolean isVoid() { + return Utils.overVoid(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ); + } + + private boolean reset() { + if (disableAdventure.isToggled() && mc.playerController.getCurrentGameType().isAdventure()) { + return true; + } + if (ignoreVoid.isToggled() && isVoid()) { + return true; + } + if (Utils.isBedwarsPractice()) { + return true; + } + if (mc.thePlayer.onGround) { + return true; + } + if (BlockUtils.getBlock(new BlockPos(mc.thePlayer.posX, mc.thePlayer.posY- 1, mc.thePlayer.posZ)) != Blocks.air) { + return true; + } + if (mc.thePlayer.motionY > -0.0784) { + return true; + } + if (mc.thePlayer.capabilities.isCreativeMode) { + return true; + } + if (isVoid() && mc.thePlayer.posY <= 40) { + return true; + } + if (mc.thePlayer.capabilities.isFlying) { + return true; + } + if (Utils.spectatorCheck()) { + return true; + } + return false; + } + +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/player/NoRotate.java b/src/main/java/keystrokesmod/module/impl/player/NoRotate.java new file mode 100644 index 0000000..9fed74f --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/player/NoRotate.java @@ -0,0 +1,107 @@ +package keystrokesmod.module.impl.player; + +import keystrokesmod.Raven; +import keystrokesmod.event.ReceivePacketEvent; +import keystrokesmod.event.SendPacketEvent; +import keystrokesmod.module.Module; +import keystrokesmod.utility.PacketUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.util.Vec3; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class NoRotate extends Module { + private S08Info s08PacketData; + private int receivedTick; + + private Packet sentPacket; + private Packet recievedPacket; + + public NoRotate() { + super("NoRotate", category.player); + } + + @SubscribeEvent + public void onReceivePacket(ReceivePacketEvent e) { + if (e.getPacket() instanceof S08PacketPlayerPosLook && mc.thePlayer != null && ((S08PacketPlayerPosLook) e.getPacket()).getPitch() != 0) { + if (e.getPacket() == recievedPacket) { + return; + } + e.setCanceled(true); + S08PacketPlayerPosLook p = (S08PacketPlayerPosLook) e.getPacket(); + recievedPacket = (new S08PacketPlayerPosLook(p.getX(), p.getY(), p.getZ(), mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch, p.func_179834_f())); + //((S08PacketPlayerPosLook) recievedPacket).processPacket(mc.getNetHandler()); + checkThreadAndEnqueue(recievedPacket); + s08PacketData = getPosAndRotation(p); + receivedTick = mc.thePlayer.ticksExisted; + } + } + + @SubscribeEvent + public void onSendPacket(SendPacketEvent e) { + if (s08PacketData != null && mc.thePlayer != null && e.getPacket() instanceof C03PacketPlayer.C06PacketPlayerPosLook) { + if (Utils.timeBetween(mc.thePlayer.ticksExisted, receivedTick) >= 2) { + s08PacketData = null; + return; + } + if (e.getPacket() == sentPacket) { + return; + } + C03PacketPlayer.C06PacketPlayerPosLook p = (C03PacketPlayer.C06PacketPlayerPosLook) e.getPacket(); + e.setCanceled(true); + sentPacket = (new C03PacketPlayer.C06PacketPlayerPosLook(p.getPositionX(), p.getPositionY(), p.getPositionZ(), s08PacketData.yaw, s08PacketData.pitch, p.isOnGround())); + mc.getNetHandler().addToSendQueue(sentPacket); + if (Raven.debug) { + Utils.sendModuleMessage(this, "&7spoofing c06 immediately."); + } + } + } + + public S08Info getPosAndRotation(final S08PacketPlayerPosLook packet) { + double x = packet.getX(); + double y = packet.getY(); + double z = packet.getZ(); + float yaw = packet.getYaw(); + float pitch = packet.getPitch(); + if (packet.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.X)) { + x += mc.thePlayer.posX; + } + if (packet.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.Y)) { + y += mc.thePlayer.posY; + } + if (packet.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.Z)) { + z += mc.thePlayer.posZ; + } + if (packet.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.X_ROT)) { + pitch += mc.thePlayer.rotationPitch; + } + if (packet.func_179834_f().contains(S08PacketPlayerPosLook.EnumFlags.Y_ROT)) { + yaw += mc.thePlayer.rotationYaw; + } + return new S08Info(new Vec3(x, y, z), yaw, pitch); + } + + public void checkThreadAndEnqueue(Packet packet) { + if (!mc.isCallingFromMinecraftThread()) { + mc.addScheduledTask(() -> packet.processPacket((T) mc.getNetHandler())); + } + } + + class S08Info { + Vec3 position; + float yaw, pitch; + + public S08Info(Vec3 position, float yaw, float pitch) { + this.position = position; + this.yaw = yaw; + this.pitch = pitch; + } + + public boolean samePos(Vec3 position) { + return this.position.xCoord == position.xCoord && this.position.yCoord == position.yCoord && this.position.zCoord == position.zCoord; + } + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/player/Safewalk.java b/src/main/java/keystrokesmod/module/impl/player/Safewalk.java new file mode 100644 index 0000000..e979fc4 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/player/Safewalk.java @@ -0,0 +1,133 @@ +package keystrokesmod.module.impl.player; + +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Utils; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraftforge.client.event.GuiOpenEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import org.lwjgl.input.Keyboard; + +public class Safewalk extends Module { + private SliderSetting shiftDelay; + private SliderSetting motion; + public static ButtonSetting shift, blocksOnly, pitchCheck, disableOnForward; + private boolean isSneaking; + private long lastShift = 0L; + + public Safewalk() { + super("Safewalk", Module.category.player, 0); + this.registerSetting(shift = new ButtonSetting("Shift", false)); + this.registerSetting(shiftDelay = new SliderSetting("Delay until next shift", 0.0, 0.0, 800.0, 10.0)); + this.registerSetting(motion = new SliderSetting("Motion", 1.0, 0.5, 1.2, 0.01)); + this.registerSetting(blocksOnly = new ButtonSetting("Blocks only", true)); + this.registerSetting(disableOnForward = new ButtonSetting("Disable on forward", false)); + this.registerSetting(pitchCheck = new ButtonSetting("Pitch check", false)); + } + + public void onDisable() { + if (shift.isToggled() && Utils.isEdgeOfBlock()) { + this.setSneakState(false); + } + isSneaking = false; + lastShift = 0L; + } + + public void onUpdate() { + if (motion.getInput() != 1.0 && mc.thePlayer.onGround && Utils.isMoving() && (!pitchCheck.isToggled() || mc.thePlayer.rotationPitch >= 70.0f)) { + mc.thePlayer.motionX *= motion.getInput(); + mc.thePlayer.motionZ *= motion.getInput(); + } + } + + @SubscribeEvent + public void onTick(TickEvent.PlayerTickEvent e) { + if (e.phase != TickEvent.Phase.END) { + return; + } + if (!shift.isToggled() || !Utils.nullCheck()) { + return; + } + if (mc.thePlayer.onGround && Utils.isEdgeOfBlock()) { + if (blocksOnly.isToggled()) { + final ItemStack getHeldItem = mc.thePlayer.getHeldItem(); + if (getHeldItem == null || !(getHeldItem.getItem() instanceof ItemBlock)) { + this.setSneakState(false); + return; + } + } + if (disableOnForward.isToggled() && Keyboard.isKeyDown(mc.gameSettings.keyBindForward.getKeyCode())) { + this.setSneakState(false); + return; + } + if (pitchCheck.isToggled() && mc.thePlayer.rotationPitch < 70.0f) { + this.setSneakState(false); + return; + } + this.setSneakState(true); + } else if (this.isSneaking) { + this.setSneakState(false); + } + if (this.isSneaking && mc.thePlayer.capabilities.isFlying) { + this.setSneakState(false); + } + } + + @SubscribeEvent + public void onGuiOpen(final GuiOpenEvent guiOpenEvent) { + if (shift.isToggled() && guiOpenEvent.gui == null) { + this.isSneaking = mc.thePlayer.isSneaking(); + } + } + + private void setSneakState(boolean shift) { + if (this.isSneaking) { + if (shift) { + return; + } + } + else if (!shift) { + return; + } + if (shift) { + final long targetShiftDelay = (long)shiftDelay.getInput(); + if (targetShiftDelay > 0L) { + if (Utils.timeBetween(this.lastShift, System.currentTimeMillis()) < targetShiftDelay) { + return; + } + this.lastShift = System.currentTimeMillis(); + } + } + else { + if (Keyboard.isKeyDown(mc.gameSettings.keyBindSneak.getKeyCode())) { + return; + } + this.lastShift = System.currentTimeMillis(); + } + KeyBinding.setKeyBindState(mc.gameSettings.keyBindSneak.getKeyCode(), this.isSneaking = shift); + } + + public static boolean canSafeWalk() { + if (ModuleManager.safeWalk != null && ModuleManager.safeWalk.isEnabled()) { + if (disableOnForward.isToggled() && Keyboard.isKeyDown(mc.gameSettings.keyBindForward.getKeyCode())) { + return false; + } + if (pitchCheck.isToggled() && mc.thePlayer.rotationPitch < 70) { + return false; + } + if (blocksOnly.isToggled() && (mc.thePlayer.getHeldItem() == null || !(mc.thePlayer.getHeldItem().getItem() instanceof ItemBlock))) { + return false; + } + if (ModuleManager.scaffold.moduleEnabled) { + return false; + } + return true; + } + return false; + } +} diff --git a/src/main/java/keystrokesmod/module/impl/player/Scaffold.java b/src/main/java/keystrokesmod/module/impl/player/Scaffold.java new file mode 100644 index 0000000..bc97dee --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/player/Scaffold.java @@ -0,0 +1,894 @@ +package keystrokesmod.module.impl.player; + +import keystrokesmod.Raven; +import keystrokesmod.event.PreMotionEvent; +import keystrokesmod.event.PreUpdateEvent; +import keystrokesmod.event.ReceivePacketEvent; +import keystrokesmod.event.SendPacketEvent; +import keystrokesmod.mixins.interfaces.IMixinItemRenderer; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.movement.LongJump; +import keystrokesmod.module.impl.other.ViewPackets; +import keystrokesmod.module.impl.render.HUD; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.*; +import keystrokesmod.utility.Timer; +import net.minecraft.block.BlockAir; +import net.minecraft.block.BlockTNT; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.client.C0APacketAnimation; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.network.play.server.S27PacketExplosion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.*; +import net.minecraftforge.client.event.MouseEvent; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.input.Mouse; + +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; + +public class Scaffold extends Module { + private static SliderSetting motion; + public static SliderSetting rotation; + private static SliderSetting sprint; + private static SliderSetting fastScaffold; + private static SliderSetting multiPlace; + public static ButtonSetting autoSwap; + private static ButtonSetting cancelKnockBack; + private static ButtonSetting fastOnRMB; + public static ButtonSetting highlightBlocks; + private static ButtonSetting jumpFacingForward; + public static ButtonSetting safeWalk; + public static ButtonSetting showBlockCount; + private static ButtonSetting silentSwing; + public static ButtonSetting tower; + + private static String[] rotationModes = new String[] { "None", "Simple", "Offset", "Precise" }; + private static String[] sprintModes = new String[] { "None", "Vanilla", "Float" }; + private static String[] fastScaffoldModes = new String[] { "None", "Jump B", "Jump B Low", "Jump E", "Keep-Y", "Keep-Y Low" }; + private String[] multiPlaceModes = new String[] { "Disabled", "1 extra", "2 extra" }; + + public Map highlight = new HashMap<>(); + + private ScaffoldBlockCount scaffoldBlockCount; + + public AtomicInteger lastSlot = new AtomicInteger(-1); + + public boolean hasSwapped; + + private boolean rotateForward; + private int keepYDelay; + private int onGroundTicks; + private int keepYPlaceTicks; + private double startYPos = -1; + public boolean fastScaffoldKeepY; + private boolean firstKeepYPlace; + private boolean rotatingForward; + private int keepYTicks; + private boolean lowhop; + private int rotationDelay; + private int blockSlot = -1; + private int inAirTicks; + private boolean modifyPitch; + + private boolean floatJumped; + private boolean floatStarted; + private boolean floatWasEnabled; + private boolean floatKeepY; + + private Vec3 targetBlock; + private PlaceData blockInfo; + private Vec3 blockPos, hitVec, lookVec; + private float[] blockRotations; + private long lastPlaceTime, rotationTimeout = 250L; + private float getPitch; + private float lastYaw = 0.0f; + private float lastPitch = 0.0f; + private float lastBlockYaw; + + public boolean moduleEnabled; + public boolean isEnabled; + private boolean disabledModule; + private boolean dontDisable; + private int disableTicks; + + public Scaffold() { + super("Scaffold", category.player); + this.registerSetting(motion = new SliderSetting("Motion", "x", 1.0, 0.5, 1.2, 0.01)); + this.registerSetting(rotation = new SliderSetting("Rotation", 1, rotationModes)); + this.registerSetting(sprint = new SliderSetting("Sprint mode", 0, sprintModes)); + this.registerSetting(fastScaffold = new SliderSetting("Fast scaffold", 0, fastScaffoldModes)); + this.registerSetting(multiPlace = new SliderSetting("Multi-place", 0, multiPlaceModes)); + this.registerSetting(autoSwap = new ButtonSetting("Auto swap", true)); + this.registerSetting(cancelKnockBack = new ButtonSetting("Cancel knockback", false)); + this.registerSetting(fastOnRMB = new ButtonSetting("Fast on RMB", true)); + this.registerSetting(highlightBlocks = new ButtonSetting("Highlight blocks", true)); + this.registerSetting(jumpFacingForward = new ButtonSetting("Jump facing forward", false)); + this.registerSetting(safeWalk = new ButtonSetting("Safewalk", true)); + this.registerSetting(showBlockCount = new ButtonSetting("Show block count", true)); + this.registerSetting(silentSwing = new ButtonSetting("Silent swing", false)); + this.registerSetting(tower = new ButtonSetting("Tower", false)); + this.alwaysOn = true; + } + + public void onDisable() { + disabledModule = true; + moduleEnabled = false; + } + + public void onEnable() { + isEnabled = true; + moduleEnabled = true; + + FMLCommonHandler.instance().bus().register(scaffoldBlockCount = new ScaffoldBlockCount(mc)); + lastSlot.set(-1); + } + + @SubscribeEvent + public void onMouse(MouseEvent e) { + if (!isEnabled) { + return; + } + KeyBinding.setKeyBindState(mc.gameSettings.keyBindAttack.getKeyCode(), false); + KeyBinding.setKeyBindState(mc.gameSettings.keyBindUseItem.getKeyCode(), false); + if (e.button >= 0) { + e.setCanceled(true); + } + } + + @SubscribeEvent + public void onPreMotion(PreMotionEvent e) { + inAirTicks = mc.thePlayer.onGround ? 0 : ++inAirTicks; + onGroundTicks = !mc.thePlayer.onGround ? 0 : ++onGroundTicks; + if (!isEnabled || !holdingBlocks()) { + return; + } + int simpleY = (int) Math.round((e.posY % 1) * 10000); + if (Utils.keysDown() && usingFastScaffold() && fastScaffold.getInput() >= 1 && !ModuleManager.tower.canTower() && !ModuleManager.LongJump.isEnabled()) { // jump mode + if (mc.thePlayer.onGround && Utils.isMoving()) { + rotateForward = true; + if (++keepYDelay >= 2 || keepYPlaceTicks > 0 || onGroundTicks > 1) { + mc.thePlayer.jump(); + Utils.setSpeed(getSpeed(getSpeedLevel()) - Utils.randomizeDouble(0.001, 0.0001)); + if (fastScaffold.getInput() == 5 || fastScaffold.getInput() == 2 && firstKeepYPlace) { + lowhop = true; + } + //Utils.print("Keepy"); + if (startYPos == -1 || Math.abs(startYPos - e.posY) > 5) { + startYPos = e.posY; + fastScaffoldKeepY = true; + } + } + } + } + else if (fastScaffoldKeepY) { + fastScaffoldKeepY = firstKeepYPlace = false; + startYPos = -1; + keepYDelay = keepYTicks = keepYPlaceTicks = 0; + } + if (lowhop) { + switch (simpleY) { + case 4200: + mc.thePlayer.motionY = 0.39; + break; + case 1138: + mc.thePlayer.motionY = mc.thePlayer.motionY - 0.13; + break; + case 2031: + mc.thePlayer.motionY = mc.thePlayer.motionY - 0.2; + lowhop = false; + break; + } + } + + //Float + if (sprint.getInput() == 2 && !usingFastScaffold() && !ModuleManager.tower.canTower() && !ModuleManager.LongJump.isEnabled()) { + floatWasEnabled = true; + if (!floatStarted) { + if (onGroundTicks > 8 && mc.thePlayer.onGround) { + floatKeepY = true; + startYPos = e.posY; + mc.thePlayer.jump(); + floatJumped = true; + } else if (onGroundTicks <= 8 && mc.thePlayer.onGround) { + floatStarted = true; + } + if (floatJumped && !mc.thePlayer.onGround) { + floatStarted = true; + } + } + + if (floatStarted && mc.thePlayer.onGround) { + floatKeepY = false; + startYPos = -1; + if (moduleEnabled) e.setPosY(e.getPosY() + 1E-10); + if (Utils.isMoving()) Utils.setSpeed(getFloatSpeed(getSpeedLevel())); + } + } else if (floatWasEnabled) { + if (floatKeepY) { + startYPos = -1; + } + floatStarted = floatJumped = floatKeepY = floatWasEnabled = false; + } + + + if (targetBlock != null) { + Vec3 lookAt = new Vec3(targetBlock.xCoord - lookVec.xCoord, targetBlock.yCoord - lookVec.yCoord, targetBlock.zCoord - lookVec.zCoord); + blockRotations = RotationUtils.getRotations(lookAt); + targetBlock = null; + } + + getPitch = 82; + if (inAirTicks >= 2) { + rotateForward = false; + } + if (rotation.getInput() > 0 && (!rotateForward || !jumpFacingForward.isToggled())) { + rotatingForward = false; + if (rotation.getInput() > 0) { + if (blockRotations != null) { + e.setYaw(blockRotations[0]); + e.setPitch(blockRotations[1]); + + if (rotation.getInput() == 2) { + e.setYaw(offsetRotation()); + if (modifyPitch) { + //e.setPitch(e.getPitch() + 5); + //Utils.print("Modifying pitch"); + } + if (e.getPitch() >= 60 && !ModuleManager.tower.canTower() && mc.thePlayer.motionY <= 0.42F) { + e.setPitch(e.getPitch() + 9); + } + } + + if (rotation.getInput() == 1) { + e.setYaw(MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw()); + } + + if (e.getPitch() > 89) { + e.setPitch(89); + } + lastYaw = e.getYaw(); + lastPitch = e.getPitch(); + if (lastPlaceTime > 0 && (System.currentTimeMillis() - lastPlaceTime) > rotationTimeout) blockRotations = null; + } + else { + if (rotation.getInput() == 2) { + e.setYaw(offsetRotation()); + } + else { + e.setYaw(MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw()); + } + e.setPitch(getPitch); + } + } + } + else { + if (rotation.getInput() > 0) { + e.setYaw(MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw() - 180 - (float) Utils.randomizeDouble(-5, 5)); + e.setPitch(10 - (float) Utils.randomizeDouble(1, 5)); + } + if (!rotatingForward) { + rotationDelay = 2; + rotatingForward = true; + } + } + if (rotationDelay > 0) --rotationDelay; + } + + private float yaw; + float newYaw; + float mainOffset; + + float lastNigger = 0; + int difference = 0; + + private float offsetRotation() { + float yawBackwards = MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw(); + float motionYaw = getMotionYaw(); + float main = MathHelper.wrapAngleTo180_float(motionYaw - yaw); + if (blockRotations != null) { + mainOffset = MathHelper.wrapAngleTo180_float(yawBackwards - lastBlockYaw); + lastBlockYaw = MathHelper.wrapAngleTo180_float(blockRotations[0]); + + if (main >= 0) { + if (mainOffset >= 10) { + modifyPitch = true; + } + else modifyPitch = false; + //Utils.print("Main1"); + if (mainOffset >= 0) mainOffset = 0; + if (mainOffset <= -30) mainOffset = -30; + } + if (main <= -0) { + if (mainOffset <= -10) { + modifyPitch = true; + } + else modifyPitch = false; + //Utils.print("Main2"); + if (mainOffset <= -0) mainOffset = -0; + if (mainOffset >= 30) mainOffset = 30; + } + + //Utils.print("" + mainOffset); + + //Utils.print("" + difference); + } + else { + lastBlockYaw = yaw; + if (main >= 0) { + if (mainOffset >= 0) mainOffset = -10; + } + if (main <= -0) { + if (mainOffset <= -0) mainOffset = 10; + } + //Utils.print("No offset"); + difference = 0; + } + newYaw = motionYaw - (!Utils.scaffoldDiagonal(false) ? 122.625F : 142.625F) * Math.signum( + main + ); + yaw = applyGcd(MathHelper.wrapAngleTo180_float(newYaw) - mainOffset); + + //yaw += 180 = opposite yaw + + /*double min = 25; + if (lastNigger > min) { + yaw += 180; + Utils.print("(Positive) Yaw switched " + lastNigger); + } + else if (lastNigger < -min) { + yaw -= 180; + Utils.print("(Negative) Yaw switched " + lastNigger); + }*/ + + lastNigger = MathHelper.wrapAngleTo180_float(lastBlockYaw - yawBackwards); + return yaw; + } + + @SubscribeEvent + public void onPreUpdate(PreUpdateEvent e) { + if (!isEnabled) { + return; + } + if (LongJump.stopScaffold) { + //Utils.print("Stopped scaffold due to longjump swapping"); + return; + } + if (ModuleManager.killAura.isTargeting || ModuleManager.killAura.justUnTargeted) { + //Utils.print("Stopped scaffold due to ka untargeting"); + return; + } + if (holdingBlocks() && setSlot()) { + hasSwapped = true; + int mode = (int) fastScaffold.getInput(); + if (rotation.getInput() == 0 || rotation.getInput() == 2 || (rotation.getInput() > 0 && (rotationDelay == 0 && !rotateForward || !jumpFacingForward.isToggled()))) { + placeBlock(0, 0); + } + if (ModuleManager.tower.placeExtraBlock) { + placeBlock(0, -1); + } + if (fastScaffoldKeepY && !ModuleManager.tower.canTower()) { + ++keepYTicks; + if ((int) mc.thePlayer.posY > (int) startYPos) { + switch (mode) { + case 1: + if (!firstKeepYPlace && keepYTicks == 8 || keepYTicks == 11) { + placeBlock(1, 0); + firstKeepYPlace = true; + } + break; + case 2: + if (!firstKeepYPlace && keepYTicks == 8 || firstKeepYPlace && keepYTicks == 7) { + placeBlock(1, 0); + firstKeepYPlace = true; + } + break; + case 3: + if (!firstKeepYPlace && keepYTicks == 8 || Utils.scaffoldDiagonal(false) && keepYTicks == 11) { + placeBlock(1, 0); + firstKeepYPlace = true; + } + break; + } + } + if (mc.thePlayer.onGround) keepYTicks = 0; + if ((int) mc.thePlayer.posY == (int) startYPos) firstKeepYPlace = false; + } + handleMotion(); + } + + if (disabledModule) { + if (ModuleManager.tower.canTower() && ModuleManager.tower.dCount == 0 || floatStarted) { + dontDisable = true; + } + + if (dontDisable && ++disableTicks >= 2) { + isEnabled = false; + //Utils.print("Extra tick"); + } + if (!dontDisable) { + isEnabled = false; + } + + + if (!isEnabled) { + disabledModule = dontDisable = false; + disableTicks = 0; + //Utils.print("Disabled"); + + if (ModuleManager.tower.speed) { + Utils.setSpeed(Utils.getHorizontalSpeed(mc.thePlayer) / 2); + } + + if (lastSlot.get() != -1) { + mc.thePlayer.inventory.currentItem = lastSlot.get(); + lastSlot.set(-1); + } + blockSlot = -1; + if (autoSwap.isToggled() && ModuleManager.autoSwap.spoofItem.isToggled()) { + ((IMixinItemRenderer) mc.getItemRenderer()).setCancelUpdate(false); + ((IMixinItemRenderer) mc.getItemRenderer()).setCancelReset(false); + } + scaffoldBlockCount.beginFade(); + hasSwapped = false; + targetBlock = null; + blockInfo = null; + blockRotations = null; + startYPos = -1; + fastScaffoldKeepY = firstKeepYPlace = rotateForward = rotatingForward = lowhop = floatStarted = floatJumped = floatWasEnabled = false; + inAirTicks = keepYDelay = rotationDelay = keepYTicks = keepYPlaceTicks = 0; + startYPos = -1; + lookVec = null; + } + } + } + + @SubscribeEvent + public void onReceivePacket(ReceivePacketEvent e) { + if (!isEnabled) { + return; + } + if (!Utils.nullCheck() || !cancelKnockBack.isToggled()) { + return; + } + if (e.getPacket() instanceof S12PacketEntityVelocity) { + if (((S12PacketEntityVelocity) e.getPacket()).getEntityID() == mc.thePlayer.getEntityId()) { + e.setCanceled(true); + } + } + else if (e.getPacket() instanceof S27PacketExplosion) { + e.setCanceled(true); + } + } + + @Override + public String getInfo() { + return fastScaffoldModes[handleFastScaffolds()]; + } + + public boolean stopFastPlace() { + return this.isEnabled(); + } + + public boolean blockAbove() { + return !(BlockUtils.getBlock(new BlockPos(mc.thePlayer.posX, mc.thePlayer.posY + 2, mc.thePlayer.posZ)) instanceof BlockAir); + } + + public boolean sprint() { + if (isEnabled) { + return handleFastScaffolds() > 0 || !holdingBlocks(); + } + return false; + } + + private int handleFastScaffolds() { + if (fastOnRMB.isToggled()) { + return Mouse.isButtonDown(1) && Utils.tabbedIn() ? (int) fastScaffold.getInput() : (int) sprint.getInput(); + } + else { + return (int) fastScaffold.getInput(); + } + } + + private boolean usingFastScaffold() { + return fastScaffold.getInput() > 0 && (!fastOnRMB.isToggled() || Mouse.isButtonDown(1) && Utils.tabbedIn()); + } + + public boolean safewalk() { + return this.isEnabled() && safeWalk.isToggled(); + } + + public boolean stopRotation() { + return this.isEnabled() && rotation.getInput() > 0; + } + + private void place(PlaceData block) { + ItemStack heldItem = mc.thePlayer.getHeldItem(); + if (heldItem == null || !(heldItem.getItem() instanceof ItemBlock) || !Utils.canBePlaced((ItemBlock) heldItem.getItem())) { + return; + } + if (mc.playerController.onPlayerRightClick(mc.thePlayer, mc.theWorld, heldItem, block.blockPos, block.enumFacing, block.hitVec)) { + if (silentSwing.isToggled()) { + mc.thePlayer.sendQueue.addToSendQueue(new C0APacketAnimation()); + } + else { + mc.thePlayer.swingItem(); + if (!(autoSwap.isToggled() && ModuleManager.autoSwap.spoofItem.isToggled())) { + mc.getItemRenderer().resetEquippedProgress(); + } + } + highlight.put(block.blockPos.offset(block.enumFacing), null); + } + } + + public boolean canSafewalk() { + if (usingFastScaffold()) { + return false; + } + if (ModuleManager.tower.canTower()) { + return false; + } + if (!isEnabled) { + return false; + } + return true; + } + + private boolean canGetBlock() { + int slot = -1; + int highestStack = -1; + ItemStack heldItem = mc.thePlayer.getHeldItem(); + for (int i = 0; i < 9; ++i) { + final ItemStack itemStack = mc.thePlayer.inventory.mainInventory[i]; + if (itemStack != null && itemStack.getItem() instanceof ItemBlock && Utils.canBePlaced((ItemBlock) itemStack.getItem()) && itemStack.stackSize > 0) { + if (Utils.getBedwarsStatus() == 2 && ((ItemBlock) itemStack.getItem()).getBlock() instanceof BlockTNT) { + continue; + } + if (itemStack != null && heldItem != null && (heldItem.getItem() instanceof ItemBlock) && Utils.canBePlaced((ItemBlock) heldItem.getItem()) && ModuleManager.autoSwap.sameType.isToggled() && !(itemStack.getItem().getClass().equals(heldItem.getItem().getClass()))) { + //Utils.print("Got block"); + return true; + } + } + } + return false; + } + + public int totalBlocks() { + int totalBlocks = 0; + for (int i = 0; i < 9; ++i) { + final ItemStack stack = mc.thePlayer.inventory.mainInventory[i]; + if (stack != null && stack.getItem() instanceof ItemBlock && Utils.canBePlaced((ItemBlock) stack.getItem()) && stack.stackSize > 0) { + totalBlocks += stack.stackSize; + } + } + return totalBlocks; + } + + private void placeBlock(int yOffset, int xOffset) { + locateAndPlaceBlock(yOffset, xOffset); + int input = (int) multiPlace.getInput(); + if (input >= 1) { + locateAndPlaceBlock(yOffset, xOffset); + if (input >= 2) { + locateAndPlaceBlock(yOffset, xOffset); + } + } + } + + private void locateAndPlaceBlock(int yOffset, int xOffset) { + locateBlocks(yOffset, xOffset); + if (blockInfo == null) { + return; + } + place(blockInfo); + blockInfo = null; + } + + private void locateBlocks(int yOffset, int xOffset) { + List blocksInfo = findBlocks(yOffset, xOffset); + + if (blocksInfo == null) { + return; + } + + double sumX = 0, sumY = !mc.thePlayer.onGround ? 0 : blocksInfo.get(0).blockPos.getY(), sumZ = 0; + int index = 0; + for (PlaceData blockssInfo : blocksInfo) { + if (index > 1 || (!Utils.isDiagonal(false) && index > 0 && mc.thePlayer.onGround)) { + break; + } + sumX += blockssInfo.blockPos.getX(); + if (!mc.thePlayer.onGround) { + sumY += blockssInfo.blockPos.getY(); + } + sumZ += blockssInfo.blockPos.getZ(); + index++; + } + + double avgX = sumX / index; + double avgY = !mc.thePlayer.onGround ? sumY / index : blocksInfo.get(0).blockPos.getY(); + double avgZ = sumZ / index; + + targetBlock = new Vec3(avgX, avgY, avgZ); + + PlaceData blockInfo2 = blocksInfo.get(0); + int blockX = blockInfo2.blockPos.getX(); + int blockY = blockInfo2.blockPos.getY(); + int blockZ = blockInfo2.blockPos.getZ(); + EnumFacing blockFacing = blockInfo2.enumFacing; + blockInfo = blockInfo2; + + double hitX = (blockX + 0.5D) + getCoord(blockFacing.getOpposite(), "x") * 0.5D; + double hitY = (blockY + 0.5D) + getCoord(blockFacing.getOpposite(), "y") * 0.5D; + double hitZ = (blockZ + 0.5D) + getCoord(blockFacing.getOpposite(), "z") * 0.5D; + lookVec = new Vec3(0.5D + getCoord(blockFacing.getOpposite(), "x") * 0.5D, 0.5D + getCoord(blockFacing.getOpposite(), "y") * 0.5D, 0.5D + getCoord(blockFacing.getOpposite(), "z") * 0.5D); + hitVec = new Vec3(hitX, hitY, hitZ); + blockInfo.hitVec = hitVec; + } + + private double getCoord(EnumFacing facing, String axis) { + switch (axis) { + case "x": return (facing == EnumFacing.WEST) ? -0.5 : (facing == EnumFacing.EAST) ? 0.5 : 0; + case "y": return (facing == EnumFacing.DOWN) ? -0.5 : (facing == EnumFacing.UP) ? 0.5 : 0; + case "z": return (facing == EnumFacing.NORTH) ? -0.5 : (facing == EnumFacing.SOUTH) ? 0.5 : 0; + } + return 0; + } + + private List findBlocks(int yOffset, int xOffset) { + List possibleBlocks = new ArrayList<>(); + int x = (int) Math.floor(mc.thePlayer.posX + xOffset); + int y = (int) Math.floor(((startYPos != -1) ? startYPos : (mc.thePlayer.posY)) + yOffset); + int z = (int) Math.floor(mc.thePlayer.posZ); + + if (BlockUtils.replaceable(new BlockPos(x, y - 1, z))) { + for (EnumFacing enumFacing : EnumFacing.values()) { + if (enumFacing != EnumFacing.UP && placeConditions(enumFacing, yOffset, xOffset)) { + BlockPos offsetPos = new BlockPos(x, y - 1, z).offset(enumFacing); + if (!BlockUtils.replaceable(offsetPos)) { + possibleBlocks.add(new PlaceData(offsetPos, enumFacing.getOpposite())); + } + } + } + for (EnumFacing enumFacing2 : EnumFacing.values()) { + if (enumFacing2 != EnumFacing.UP && placeConditions(enumFacing2, yOffset, xOffset)) { + BlockPos offsetPos2 = new BlockPos(x, y - 1, z).offset(enumFacing2); + if (BlockUtils.replaceable(offsetPos2)) { + for (EnumFacing enumFacing3 : EnumFacing.values()) { + if (enumFacing3 != EnumFacing.UP && placeConditions(enumFacing3, yOffset, xOffset)) { + BlockPos offsetPos3 = offsetPos2.offset(enumFacing3); + if (!BlockUtils.replaceable(offsetPos3)) { + possibleBlocks.add(new PlaceData(offsetPos3, enumFacing3.getOpposite())); + } + } + } + } + } + } + if (mc.thePlayer.motionY > -0.0784) { + for (EnumFacing enumFacing5 : EnumFacing.values()) { + if (enumFacing5 != EnumFacing.UP && placeConditions(enumFacing5, yOffset, xOffset)) { + BlockPos offsetPos5 = new BlockPos(x, y - 2, z).offset(enumFacing5); + if (BlockUtils.replaceable(offsetPos5)) { + for (EnumFacing enumFacing6 : EnumFacing.values()) { + if (enumFacing6 != EnumFacing.UP && placeConditions(enumFacing6, yOffset, xOffset)) { + BlockPos offsetPos6 = offsetPos5.offset(enumFacing6); + if (!BlockUtils.replaceable(offsetPos6)) { + possibleBlocks.add(new PlaceData(offsetPos6, enumFacing6.getOpposite())); + } + } + } + } + } + } + for (EnumFacing enumFacing7 : EnumFacing.values()) { + if (enumFacing7 != EnumFacing.UP && placeConditions(enumFacing7, yOffset, xOffset)) { + BlockPos offsetPos7 = new BlockPos(x, y - 3, z).offset(enumFacing7); + if (BlockUtils.replaceable(offsetPos7)) { + for (EnumFacing enumFacing8 : EnumFacing.values()) { + if (enumFacing8 != EnumFacing.UP && placeConditions(enumFacing8, yOffset, xOffset)) { + BlockPos offsetPos8 = offsetPos7.offset(enumFacing8); + if (!BlockUtils.replaceable(offsetPos8)) { + possibleBlocks.add(new PlaceData(offsetPos8, enumFacing8.getOpposite())); + } + } + } + } + } + } + } + } + else { + return null; + } + return possibleBlocks.isEmpty() ? null : possibleBlocks; + } + + private boolean placeConditions(EnumFacing enumFacing, int yCondition, int xCondition) { + if (xCondition == -1) { + return enumFacing == EnumFacing.EAST; + } + if (yCondition == 1) { + return enumFacing == EnumFacing.DOWN; + } + + return true; + } + + /*private boolean allowedFaces(EnumFacing enumFacing) { + if (yaw >= 0 && yaw < 90) { + Utils.print("1"); + //west south + return enumFacing == EnumFacing.DOWN || enumFacing == EnumFacing.WEST || enumFacing == EnumFacing.SOUTH; + } + else if (yaw >= 90 && yaw < 180) { + Utils.print("2"); + //north west + return enumFacing == EnumFacing.DOWN || enumFacing == EnumFacing.NORTH || enumFacing == EnumFacing.WEST; + } + else if (yaw == 180 || yaw >= -180 && yaw < -90) { + Utils.print("3"); + //north east + return enumFacing == EnumFacing.DOWN || enumFacing == EnumFacing.NORTH || enumFacing == EnumFacing.EAST; + } + else if (yaw >= -90 && yaw <= 0) { + Utils.print("4"); + //east south + return enumFacing == EnumFacing.DOWN || enumFacing == EnumFacing.EAST || enumFacing == EnumFacing.SOUTH; + } + + return false; + }*/ + + float applyGcd(float value) { + float gcd = 0.2F * 0.2F * 0.2F * 8.0F; + return (float) ((double) value - (double) value % ((double) gcd * 0.15D)); + } + + float getMotionYaw() { + return MathHelper.wrapAngleTo180_float((float) Math.toDegrees(Math.atan2(mc.thePlayer.motionZ, mc.thePlayer.motionX)) - 90.0F); + } + + private int getSpeedLevel() { + for (PotionEffect potionEffect : mc.thePlayer.getActivePotionEffects()) { + if (potionEffect.getEffectName().equals("potion.moveSpeed")) { + return potionEffect.getAmplifier() + 1; + } + return 0; + } + return 0; + } + + double[] speedLevels = {0.48, 0.5, 0.52, 0.58, 0.68}; + + double getSpeed(int speedLevel) { + if (speedLevel >= 0) { + return speedLevels[speedLevel]; + } + return speedLevels[0]; + } + + double[] floatSpeedLevels = {0.2, 0.22, 0.28, 0.29, 0.3}; + + double getFloatSpeed(int speedLevel) { + if (speedLevel >= 0) { + return floatSpeedLevels[speedLevel]; + } + return floatSpeedLevels[0]; + } + + private void handleMotion() { + if (usingFastScaffold()) { + return; + } + mc.thePlayer.motionX *= motion.getInput(); + mc.thePlayer.motionZ *= motion.getInput(); + } + + public float hardcodedYaw() { + float simpleYaw = 0F; + float f = 0.8F; + + if (mc.thePlayer.moveForward >= f) { + simpleYaw -= 180; + if (mc.thePlayer.moveStrafing >= f) simpleYaw += 45; + if (mc.thePlayer.moveStrafing <= -f) simpleYaw -= 45; + } + else if (mc.thePlayer.moveForward == 0) { + simpleYaw -= 180; + if (mc.thePlayer.moveStrafing >= f) simpleYaw += 90; + if (mc.thePlayer.moveStrafing <= -f) simpleYaw -= 90; + } + else if (mc.thePlayer.moveForward <= -f) { + if (mc.thePlayer.moveStrafing >= f) simpleYaw -= 45; + if (mc.thePlayer.moveStrafing <= -f) simpleYaw += 45; + } + return simpleYaw; + } + + public boolean holdingBlocks() { + if (autoSwap.isToggled() && ModuleManager.autoSwap.spoofItem.isToggled() && lastSlot.get() != mc.thePlayer.inventory.currentItem && totalBlocks() > 0) { + ((IMixinItemRenderer) mc.getItemRenderer()).setCancelUpdate(true); + ((IMixinItemRenderer) mc.getItemRenderer()).setCancelReset(true); + } + ItemStack heldItem = mc.thePlayer.getHeldItem(); + if (!autoSwap.isToggled() || getSlot() == -1) { + if (heldItem == null || !(heldItem.getItem() instanceof ItemBlock) || !Utils.canBePlaced((ItemBlock) heldItem.getItem())) { + return false; + } + } + return true; + } + + private int getSlot() { + int slot = -1; + int highestStack = -1; + ItemStack heldItem = mc.thePlayer.getHeldItem(); + for (int i = 0; i < 9; ++i) { + final ItemStack itemStack = mc.thePlayer.inventory.mainInventory[i]; + if (itemStack != null && itemStack.getItem() instanceof ItemBlock && Utils.canBePlaced((ItemBlock) itemStack.getItem()) && itemStack.stackSize > 0) { + if (Utils.getBedwarsStatus() == 2 && ((ItemBlock) itemStack.getItem()).getBlock() instanceof BlockTNT) { + continue; + } + if (itemStack != null && heldItem != null && (heldItem.getItem() instanceof ItemBlock) && Utils.canBePlaced((ItemBlock) heldItem.getItem()) && ModuleManager.autoSwap.sameType.isToggled() && !(itemStack.getItem().getClass().equals(heldItem.getItem().getClass()))) { + continue; + } + if (itemStack.stackSize > highestStack) { + highestStack = itemStack.stackSize; + slot = i; + } + } + } + return slot; + } + + public boolean setSlot() { + int slot = getSlot(); + if (slot == -1) { + return false; + } + if (blockSlot == -1) { + blockSlot = slot; + } + if (lastSlot.get() == -1) { + lastSlot.set(mc.thePlayer.inventory.currentItem); + } + if (autoSwap.isToggled() && blockSlot != -1) { + if (ModuleManager.autoSwap.swapToGreaterStack.isToggled()) { + mc.thePlayer.inventory.currentItem = slot; + } + else { + mc.thePlayer.inventory.currentItem = blockSlot; + } + //Utils.print("set slot?"); + } + + ItemStack heldItem = mc.thePlayer.getHeldItem(); + if (heldItem == null || !(heldItem.getItem() instanceof ItemBlock) || !Utils.canBePlaced((ItemBlock) heldItem.getItem())) { + blockSlot = -1; + return false; + } + return true; + } + + + static class PlaceData { + EnumFacing enumFacing; + BlockPos blockPos; + Vec3 hitVec; + + PlaceData(BlockPos blockPos, EnumFacing enumFacing) { + this.enumFacing = enumFacing; + this.blockPos = blockPos; + } + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/player/Tower.java b/src/main/java/keystrokesmod/module/impl/player/Tower.java new file mode 100644 index 0000000..c0828ff --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/player/Tower.java @@ -0,0 +1,325 @@ +package keystrokesmod.module.impl.player; + +import keystrokesmod.event.PostPlayerInputEvent; +import keystrokesmod.event.PreMotionEvent; +import keystrokesmod.event.SendPacketEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.movement.LongJump; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Utils; +import net.minecraft.network.Packet; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.network.play.client.*; +import net.minecraft.potion.PotionEffect; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.input.Keyboard; + +public class Tower extends Module { + final private SliderSetting towerMove; + final private SliderSetting verticalTower; + final private SliderSetting slowedSpeed; + final private SliderSetting slowedTicks; + final private ButtonSetting disableWhileHurt; + final private String[] towerMoveModes = new String[]{"None", "Vanilla", "Low", "Watchdog"}; + final private String[] verticalTowerModes = new String[]{"None", "Vanilla", "Extra block"}; + private int slowTicks; + private boolean wasTowering; + private int offGroundTicks; + private boolean tower; + private boolean hasTowered, startedTowerInAir, setLowMotion, firstJump; + private int cMotionTicks, placeTicks; + public int dCount; + + //vertical tower + private boolean aligning, aligned, placed; + private int firstX; + public boolean placeExtraBlock; + + public boolean speed; + + public Tower() { + super("Tower", category.player); + this.registerSetting(towerMove = new SliderSetting("Tower Move", 0, towerMoveModes)); + this.registerSetting(verticalTower = new SliderSetting("Vertical Tower", 0, verticalTowerModes)); + this.registerSetting(slowedSpeed = new SliderSetting("Slowed speed", 2, 0, 9, 0.1)); + this.registerSetting(slowedTicks = new SliderSetting("Slowed ticks", 1, 0, 20, 1)); + this.registerSetting(disableWhileHurt = new ButtonSetting("Disable while hurt", false)); + this.canBeEnabled = false; + } + + @SubscribeEvent(priority = EventPriority.LOWEST) + public void onPreMotion(PreMotionEvent e) { + int valY = (int) Math.round((e.posY % 1) * 10000); + offGroundTicks++; + if (mc.thePlayer.onGround) { + offGroundTicks = 0; + } + if (canTower()) { + wasTowering = true; + switch ((int) towerMove.getInput()) { + case 1: + mc.thePlayer.motionY = 0.41965; + switch (offGroundTicks) { + case 1: + mc.thePlayer.motionY = 0.33; + break; + case 2: + mc.thePlayer.motionY = 1 - mc.thePlayer.posY % 1; + break; + } + if (offGroundTicks >= 3) { + offGroundTicks = 0; + } + case 2: + if (mc.thePlayer.onGround) { + mc.thePlayer.motionY = 0.4196; + } + else { + switch (offGroundTicks) { + case 3: + case 4: + mc.thePlayer.motionY = 0; + break; + case 5: + mc.thePlayer.motionY = 0.4191; + break; + case 6: + mc.thePlayer.motionY = 0.3275; + break; + case 11: + mc.thePlayer.motionY = - 0.5; + + } + } + break; + case 3: + if (!Utils.keysDown()) { + break; + } + if (e.getPosY() % 1 == 0 && !setLowMotion) { + tower = true; + } + if (tower) { + if (valY == 0) { + mc.thePlayer.motionY = 0.42f; + Utils.setSpeed(getTowerGroundSpeed(getSpeedLevel())); + startedTowerInAir = false; + } + else if (valY > 4000 && valY < 4300) { + mc.thePlayer.motionY = 0.33f; + Utils.setSpeed(getTowerSpeed(getSpeedLevel())); + speed = true; + hasTowered = true; + } + else if (valY > 7000) { + if (setLowMotion) { + tower = false; + } + speed = false; + mc.thePlayer.motionY = 1 - mc.thePlayer.posY % 1f; + } + } + else if (setLowMotion) { + ++cMotionTicks; + if (cMotionTicks == 1) { + mc.thePlayer.motionY = 0.04f; + } + else if (cMotionTicks == 3) { + cMotionTicks = 0; + setLowMotion = false; + tower = true; + Utils.setSpeed(getTowerGroundSpeed(getSpeedLevel()) - 0.02); + } + } + break; + } + } + else { + if (wasTowering && slowedTicks.getInput() > 0 && modulesEnabled()) { + if (slowTicks++ < slowedTicks.getInput()) { + Utils.setSpeed(Math.max(slowedSpeed.getInput() * 0.1 - 0.25, 0)); + } + else { + slowTicks = 0; + wasTowering = false; + } + } + else { + if (wasTowering) { + wasTowering = false; + } + slowTicks = 0; + } + if (towerMove.getInput() == 2) { + hasTowered = tower = firstJump = startedTowerInAir = setLowMotion = speed = false; + cMotionTicks = placeTicks = 0; + } + reset(); + } + if (canTower() && !Utils.keysDown()) { + wasTowering = true; + switch ((int) verticalTower.getInput()) { + case 1: + //lazy + break; + case 2: + if (!aligned) { + if (mc.thePlayer.onGround) { + if (!aligning) firstX = (int) mc.thePlayer.posX; + mc.thePlayer.motionX = 0.22; + aligning = true; + } + if (aligning && (int) mc.thePlayer.posX > firstX) { + aligned = true; + } + e.setYaw(90F); + e.setPitch(85F); + } + if (aligned) { + if (placed) { + e.setYaw(270F); + e.setPitch(89.9F); + } + else { + e.setYaw(90F); + e.setPitch(85F); + } + placeExtraBlock = true; + mc.thePlayer.motionX = 0; + mc.thePlayer.motionY = verticalTowerValue(); + mc.thePlayer.motionZ = 0; + } + break; + } + } else { + aligning = aligned = placed = false; + firstX = 0; + placeExtraBlock = false; + } + } + + @SubscribeEvent + public void onPostPlayerInput(PostPlayerInputEvent e) { + if (canTower() && Utils.keysDown() && towerMove.getInput() > 0) { + mc.thePlayer.movementInput.jump = false; + if (!firstJump) { + if (!mc.thePlayer.onGround) { + if (!startedTowerInAir) { + Utils.setSpeed(getTowerGroundSpeed(getSpeedLevel()) - 0.04); + } + startedTowerInAir = true; + } + else if (mc.thePlayer.onGround) { + Utils.setSpeed(getTowerGroundSpeed(getSpeedLevel())); + firstJump = true; + } + } + } + if (canTower() && !Utils.keysDown() && verticalTower.getInput() > 0) { + mc.thePlayer.movementInput.jump = false; + } + } + + @SubscribeEvent + public void onSendPacket(SendPacketEvent e) { + if (e.getPacket() instanceof C08PacketPlayerBlockPlacement) { + if (canTower() && Utils.isMoving()) { + ++placeTicks; + if (((C08PacketPlayerBlockPlacement) e.getPacket()).getPlacedBlockDirection() == 1 && placeTicks > 5 && hasTowered) { + dCount++; + if (dCount >= 2) { + //Utils.sendMessage("Hey"); + setLowMotion = true; + } + } + else { + dCount = 0; + } + } + else { + placeTicks = 0; + } + + if (aligned) { + placed = true; + } + //Utils.print("" + ((C08PacketPlayerBlockPlacement) e.getPacket()).getPlacedBlockDirection()); + } + } + + private void reset() { + offGroundTicks = 0; + tower = false; + placeTicks = 0; + setLowMotion = false; + } + + public boolean canTower() { + if (!Utils.nullCheck() || !Utils.jumpDown()) { + return false; + } + else if (disableWhileHurt.isToggled() && mc.thePlayer.hurtTime > 0) { + return false; + } + else if (mc.thePlayer.isCollidedHorizontally) { + return false; + } + else if ((mc.thePlayer.isInWater() || mc.thePlayer.isInLava())) { + return false; + } + else if (modulesEnabled()) { + return true; + } + return false; + } + + private boolean modulesEnabled() { + return (ModuleManager.scaffold.moduleEnabled && ModuleManager.scaffold.holdingBlocks() && ModuleManager.scaffold.tower.isToggled() && ModuleManager.scaffold.hasSwapped && !ModuleManager.LongJump.isEnabled()); + } + + private int getSpeedLevel() { + for (PotionEffect potionEffect : mc.thePlayer.getActivePotionEffects()) { + if (potionEffect.getEffectName().equals("potion.moveSpeed")) { + return potionEffect.getAmplifier() + 1; + } + return 0; + } + return 0; + } + + private double verticalTowerValue() { + int valY = (int) Math.round((mc.thePlayer.posY % 1) * 10000); + double value = 0; + if (valY == 0) { + value = 0.42f; + } else if (valY > 4000 && valY < 4300) { + value = 0.33f; + } else if (valY > 7000) { + value = 1 - mc.thePlayer.posY % 1f; + } + return value; + } + + private double[] towerSpeedLevels = {0.3, 0.34, 0.38, 0.42, 0.42}; + + private double getTowerSpeed(int speedLevel) { + if (speedLevel >= 0) { + return towerSpeedLevels[speedLevel]; + } + return towerSpeedLevels[0]; + } + + private double[] towerGroundSpeedLevels = {0.22, 0.25, 0.3, 0.35, 0.4}; + + private double getTowerGroundSpeed(int speedLevel) { + if (speedLevel >= 0) { + return towerGroundSpeedLevels[speedLevel]; + } + return towerGroundSpeedLevels[0]; + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/player/WaterBucket.java b/src/main/java/keystrokesmod/module/impl/player/WaterBucket.java new file mode 100644 index 0000000..d33e8e0 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/player/WaterBucket.java @@ -0,0 +1,72 @@ +package keystrokesmod.module.impl.player; + +import keystrokesmod.event.PreMotionEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.utility.RotationUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.util.MovingObjectPosition; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class WaterBucket extends Module { + //private ButtonSetting pickup; + private ButtonSetting silentAim; + private ButtonSetting switchToItem; + + public WaterBucket() { + super("Water bucket", category.player, 0); + //this.registerSetting(pickup = new ButtonSetting("Pickup water", true)); + this.registerSetting(silentAim = new ButtonSetting("Silent aim", true)); + this.registerSetting(switchToItem = new ButtonSetting("Switch to item", true)); + } + + @SubscribeEvent + public void onPreMotion(PreMotionEvent e) { + MovingObjectPosition rayCast = RotationUtils.rayCast(mc.playerController.getBlockReachDistance(), e.getYaw(), 90, true); + if (inPosition() && rayCast != null && rayCast.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && holdWaterBucket(switchToItem.isToggled())) { + if (silentAim.isToggled()) { + e.setPitch(90); + } + else { + mc.thePlayer.rotationPitch = 90; + } + sendPlace(); + } + } + + private boolean inPosition() { + return !mc.thePlayer.capabilities.isFlying && !mc.thePlayer.capabilities.isCreativeMode && !mc.thePlayer.onGround && mc.thePlayer.motionY < -0.6D && !mc.thePlayer.isInWater() && fallDistance() <= 2; + } + + private boolean holdWaterBucket(boolean setSlot) { + if (this.containsItem(mc.thePlayer.getHeldItem(), Items.water_bucket)) { + return true; + } else { + for (int i = 0; i < InventoryPlayer.getHotbarSize(); ++i) { + if (this.containsItem(mc.thePlayer.inventory.mainInventory[i], Items.water_bucket) && setSlot) { + mc.thePlayer.inventory.currentItem = i; + return true; + } + } + + return false; + } + } + + private boolean containsItem(ItemStack itemStack, Item item) { + return itemStack != null && itemStack.getItem() == item; + } + + private void sendPlace() { + mc.getNetHandler().addToSendQueue(new C08PacketPlayerBlockPlacement(mc.thePlayer.getHeldItem())); + } + + private double fallDistance() { + return (int) Utils.distanceToGround(mc.thePlayer); + } +} diff --git a/src/main/java/keystrokesmod/module/impl/render/AntiShuffle.java b/src/main/java/keystrokesmod/module/impl/render/AntiShuffle.java new file mode 100644 index 0000000..c2ae258 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/render/AntiShuffle.java @@ -0,0 +1,17 @@ +package keystrokesmod.module.impl.render; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.DescriptionSetting; + +public class AntiShuffle extends Module { + private static String shuffleStr = "§k"; + + public AntiShuffle() { + super("AntiShuffle", Module.category.render, 0); + this.registerSetting(new DescriptionSetting("Removes obfuscation (" + shuffleStr + "hey" + "§" + "r).")); + } + + public static String removeObfuscation(String s) { + return s.replace(shuffleStr, ""); + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/render/BedESP.java b/src/main/java/keystrokesmod/module/impl/render/BedESP.java new file mode 100644 index 0000000..1bf4e3f --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/render/BedESP.java @@ -0,0 +1,160 @@ +package keystrokesmod.module.impl.render; + +import keystrokesmod.Raven; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.BlockUtils; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Theme; +import keystrokesmod.utility.Utils; +import net.minecraft.block.BlockBed; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.opengl.GL11; + +import java.util.Iterator; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +public class BedESP extends Module { + public SliderSetting theme; + private SliderSetting range; + private SliderSetting rate; + private ButtonSetting firstBed; + private ButtonSetting renderFullBlock; + private BlockPos[] bed = null; + private Set beds = ConcurrentHashMap.newKeySet(); + private long lastCheck = 0; + + public BedESP() { + super("BedESP", category.render); + this.registerSetting(theme = new SliderSetting("Theme", 0, Theme.themes)); + this.registerSetting(range = new SliderSetting("Range", 10.0, 2.0, 200.0, 2.0)); + this.registerSetting(rate = new SliderSetting("Rate", " second", 0.4, 0.1, 3.0, 0.1)); + this.registerSetting(firstBed = new ButtonSetting("Only render first bed", false)); + this.registerSetting(renderFullBlock = new ButtonSetting("Render full block", false)); + } + + public void onUpdate() { + if (System.currentTimeMillis() - lastCheck < rate.getInput() * 1000) { + return; + } + lastCheck = System.currentTimeMillis(); + Raven.getExecutor().execute(() -> { + int i; + priorityLoop: + for (int n = i = (int) range.getInput(); i >= -n; --i) { + for (int j = -n; j <= n; ++j) { + for (int k = -n; k <= n; ++k) { + final BlockPos blockPos = new BlockPos(mc.thePlayer.posX + j, mc.thePlayer.posY + i, mc.thePlayer.posZ + k); + final IBlockState getBlockState = mc.theWorld.getBlockState(blockPos); + if (getBlockState.getBlock() == Blocks.bed && getBlockState.getValue((IProperty) BlockBed.PART) == BlockBed.EnumPartType.FOOT) { + if (firstBed.isToggled()) { + if (this.bed != null && BlockUtils.isSamePos(blockPos, this.bed[0])) { + return; + } + this.bed = new BlockPos[]{blockPos, blockPos.offset((EnumFacing) getBlockState.getValue((IProperty) BlockBed.FACING))}; + return; + } + else { + for (BlockPos[] pos : beds) { + if (BlockUtils.isSamePos(blockPos, pos[0])) { + continue priorityLoop; + } + } + this.beds.add(new BlockPos[]{blockPos, blockPos.offset((EnumFacing) getBlockState.getValue((IProperty) BlockBed.FACING))}); + } + } + } + } + } + }); + } + + @SubscribeEvent + public void onEntityJoin(EntityJoinWorldEvent e) { + if (e.entity == mc.thePlayer) { + this.beds.clear(); + this.bed = null; + } + } + + @SubscribeEvent + public void onRenderWorld(RenderWorldLastEvent e) { + if (Utils.nullCheck()) { + float blockHeight = getBlockHeight(); + if (firstBed.isToggled() && this.bed != null) { + if (!(mc.theWorld.getBlockState(bed[0]).getBlock() instanceof BlockBed)) { + this.bed = null; + return; + } + renderBed(this.bed, blockHeight); + return; + } + if (this.beds.isEmpty()) { + return; + } + Iterator iterator = this.beds.iterator(); + while (iterator.hasNext()) { + BlockPos[] blockPos = iterator.next(); + if (!(mc.theWorld.getBlockState(blockPos[0]).getBlock() instanceof BlockBed)) { + iterator.remove(); + continue; + } + renderBed(blockPos, blockHeight); + } + } + } + + public void onDisable() { + this.bed = null; + this.beds.clear(); + } + + private void renderBed(final BlockPos[] array, float height) { + final double n = array[0].getX() - mc.getRenderManager().viewerPosX; + final double n2 = array[0].getY() - mc.getRenderManager().viewerPosY; + final double n3 = array[0].getZ() - mc.getRenderManager().viewerPosZ; + GL11.glBlendFunc(770, 771); + GL11.glEnable(3042); + GL11.glLineWidth(2.0f); + GL11.glDisable(3553); + GL11.glDisable(2929); + GL11.glDepthMask(false); + final int e = Theme.getGradient((int) theme.getInput(), 0); + final float n4 = (e >> 24 & 0xFF) / 255.0f; + final float n5 = (e >> 16 & 0xFF) / 255.0f; + final float n6 = (e >> 8 & 0xFF) / 255.0f; + final float n7 = (e & 0xFF) / 255.0f; + GL11.glColor4d(n5, n6, n7, n4); + AxisAlignedBB axisAlignedBB; + if (array[0].getX() != array[1].getX()) { + if (array[0].getX() > array[1].getX()) { + axisAlignedBB = new AxisAlignedBB(n - 1.0, n2, n3, n + 1.0, n2 + height, n3 + 1.0); + } else { + axisAlignedBB = new AxisAlignedBB(n, n2, n3, n + 2.0, n2 + height, n3 + 1.0); + } + } else if (array[0].getZ() > array[1].getZ()) { + axisAlignedBB = new AxisAlignedBB(n, n2, n3 - 1.0, n + 1.0, n2 + height, n3 + 1.0); + } else { + axisAlignedBB = new AxisAlignedBB(n, n2, n3, n + 1.0, n2 + height, n3 + 2.0); + } + RenderUtils.drawBoundingBox(axisAlignedBB, n5, n6, n7); + GL11.glEnable(3553); + GL11.glEnable(2929); + GL11.glDepthMask(true); + GL11.glDisable(3042); + } + + private float getBlockHeight() { + return (renderFullBlock.isToggled() ? 1 : 0.5625F); + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/render/BreakProgress.java b/src/main/java/keystrokesmod/module/impl/render/BreakProgress.java new file mode 100644 index 0000000..1d92791 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/render/BreakProgress.java @@ -0,0 +1,119 @@ +package keystrokesmod.module.impl.render; + +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.BlockUtils; +import keystrokesmod.utility.Reflection; +import keystrokesmod.utility.Utils; +import net.minecraft.block.BlockBed; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MovingObjectPosition; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.opengl.GL11; + +public class BreakProgress extends Module { + private SliderSetting mode; + private ButtonSetting manual; + private ButtonSetting bedAura; + private ButtonSetting fadeIn; + private String[] modes = new String[]{"Percentage", "Second", "Decimal"}; + private float progress; + private BlockPos block; + private String progressStr; + + public BreakProgress() { + super("BreakProgress", category.render); + this.registerSetting(mode = new SliderSetting("Mode", 0, modes)); + this.registerSetting(manual = new ButtonSetting("Show manual", true)); + this.registerSetting(bedAura = new ButtonSetting("Show BedAura", true)); + this.registerSetting(fadeIn = new ButtonSetting("Fade in", false)); + } + + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onRenderWorld(RenderWorldLastEvent e) { + if (this.progress == 0.0f || this.block == null || !Utils.nullCheck()) { + return; + } + final double n = this.block.getX() + 0.5 - mc.getRenderManager().viewerPosX; + final double n2 = this.block.getY() + 0.5 - mc.getRenderManager().viewerPosY; + final double n3 = this.block.getZ() + 0.5 - mc.getRenderManager().viewerPosZ; + GlStateManager.pushMatrix(); + GlStateManager.translate((float) n, (float) n2, (float) n3); + GlStateManager.rotate(-mc.getRenderManager().playerViewY, 0.0f, 1.0f, 0.0f); + GlStateManager.rotate((mc.gameSettings.thirdPersonView == 2 ? -1 : 1) * mc.getRenderManager().playerViewX, 1.0f, 0.0f, 0.0f); + GlStateManager.scale(-0.02266667f, -0.02266667f, -0.02266667f); + GlStateManager.depthMask(false); + GlStateManager.disableDepth(); + GL11.glEnable(GL11.GL_BLEND); + int colorAlpha = Utils.mergeAlpha(-1, Math.max(10, (int) (255 * progress))); + mc.fontRendererObj.drawString(this.progressStr, (float) (-mc.fontRendererObj.getStringWidth(this.progressStr) / 2), -3.0f, fadeIn.isToggled() ? colorAlpha : -1, true); + GL11.glDisable(GL11.GL_BLEND); + GlStateManager.enableDepth(); + GlStateManager.depthMask(true); + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); + GlStateManager.popMatrix(); + } + + private void setProgress() { + switch ((int) mode.getInput()) { + case 0: { + this.progressStr = (int) (100.0 * (this.progress / 1.0)) + "%"; + break; + } + case 1: { + double timeLeft = Utils.round((double) ((1.0f - this.progress) / BlockUtils.getBlockHardness(BlockUtils.getBlock(this.block), mc.thePlayer.getHeldItem(), false, false)) / 20.0, 1); + this.progressStr = timeLeft == 0 ? "0" : timeLeft + "s"; + break; + } + case 2: { + this.progressStr = String.valueOf(Utils.round(this.progress, 2)); + break; + } + } + } + + public void onUpdate() { + if (mc.thePlayer.capabilities.isCreativeMode || !mc.thePlayer.capabilities.allowEdit) { + this.resetVariables(); + return; + } + if (bedAura.isToggled() && ModuleManager.bedAura != null && ModuleManager.bedAura.isEnabled() && ModuleManager.bedAura.breakProgress != 0.0f && ModuleManager.bedAura.currentBlock != null && !(BlockUtils.getBlock(ModuleManager.bedAura.currentBlock) instanceof BlockBed)) { + this.progress = Math.min(1.0f, ModuleManager.bedAura.breakProgress); + this.block = ModuleManager.bedAura.currentBlock; + if (this.block == null) { + return; + } + this.setProgress(); + return; + } + if (!manual.isToggled() || mc.objectMouseOver == null || mc.objectMouseOver.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK) { + this.resetVariables(); + return; + } + try { + this.progress = Reflection.curBlockDamageMP.getFloat(mc.playerController); + if (this.progress == 0.0f) { + this.resetVariables(); + return; + } + this.block = mc.objectMouseOver.getBlockPos(); + this.setProgress(); + } catch (IllegalAccessException ex) { + } + } + + public void onDisable() { + this.resetVariables(); + } + + private void resetVariables() { + this.progress = 0.0f; + this.block = null; + this.progressStr = ""; + } +} diff --git a/src/main/java/keystrokesmod/module/impl/render/Chams.java b/src/main/java/keystrokesmod/module/impl/render/Chams.java new file mode 100644 index 0000000..0776212 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/render/Chams.java @@ -0,0 +1,70 @@ +package keystrokesmod.module.impl.render; + +import keystrokesmod.module.Module; +import keystrokesmod.module.impl.world.AntiBot; +import keystrokesmod.module.setting.impl.ButtonSetting; +import net.minecraft.entity.Entity; +import net.minecraftforge.client.event.RenderPlayerEvent.Post; +import net.minecraftforge.client.event.RenderPlayerEvent.Pre; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.opengl.GL11; + +import java.util.HashSet; + +public class Chams extends Module { + private ButtonSetting ignoreBots; + private ButtonSetting renderSelf; + private ButtonSetting hidePlayers; + private HashSet bots = new HashSet<>(); + + public Chams() { + super("Chams", Module.category.render, 0); + this.registerSetting(ignoreBots = new ButtonSetting("Ignore bots", false)); + this.registerSetting(hidePlayers = new ButtonSetting("Hide players", false)); + this.registerSetting(renderSelf = new ButtonSetting("Render self", false)); + } + + @SubscribeEvent + public void onPreRender(Pre e) { + Entity entity = e.entity; + if (entity == mc.thePlayer && !renderSelf.isToggled()) { + return; + } + if (hidePlayers.isToggled() && !(entity == mc.thePlayer && renderSelf.isToggled())) { + e.setCanceled(true); + return; + } + if (ignoreBots.isToggled()) { + if (AntiBot.isBot(entity)) { + return; + } + bots.add(entity); + } + GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL); + GL11.glPolygonOffset(1.0f, -2500000.0f); + } + + @SubscribeEvent + public void onPostRender(Post e) { + Entity entity = e.entity; + if (entity == mc.thePlayer && !renderSelf.isToggled()) { + return; + } + if (hidePlayers.isToggled() && !(entity == mc.thePlayer && renderSelf.isToggled())) { + return; + } + if (ignoreBots.isToggled()) { + if (!bots.contains(entity)) { + return; + } + bots.remove(entity); + } + GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL); + GL11.glPolygonOffset(1.0f, 2500000.0f); + } + + @Override + public void onDisable() { + bots.clear(); + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/render/ChestESP.java b/src/main/java/keystrokesmod/module/impl/render/ChestESP.java new file mode 100644 index 0000000..c62f27b --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/render/ChestESP.java @@ -0,0 +1,54 @@ +package keystrokesmod.module.impl.render; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityEnderChest; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.awt.*; + +public class ChestESP extends Module { + private SliderSetting red, green, blue; + private ButtonSetting rainbow, outline, shade, disableIfOpened; + + public ChestESP() { + super("ChestESP", Module.category.render, 0); + this.registerSetting(red = new SliderSetting("Red", 0.0D, 0.0D, 255.0D, 1.0D)); + this.registerSetting(green = new SliderSetting("Green", 0.0D, 0.0D, 255.0D, 1.0D)); + this.registerSetting(blue = new SliderSetting("Blue", 255.0D, 0.0D, 255.0D, 1.0D)); + this.registerSetting(rainbow = new ButtonSetting("Rainbow", false)); + this.registerSetting(outline = new ButtonSetting("Outline", false)); + this.registerSetting(shade = new ButtonSetting("Shade", false)); + this.registerSetting(disableIfOpened = new ButtonSetting("Disable if opened", false)); + } + + @SubscribeEvent + public void o(RenderWorldLastEvent ev) { + if (!Utils.nullCheck()) { + return; + } + int rgb = rainbow.isToggled() ? Utils.getChroma(2L, 0L) : (new Color((int) red.getInput(), (int) green.getInput(), (int) blue.getInput())).getRGB(); + for (TileEntity tileEntity : mc.theWorld.loadedTileEntityList) { + if (tileEntity instanceof TileEntityChest) { + if (disableIfOpened.isToggled() && ((TileEntityChest) tileEntity).lidAngle > 0.0f) { + continue; + } + RenderUtils.renderChest(tileEntity.getPos(), rgb, outline.isToggled(), shade.isToggled()); + } else { + if (!(tileEntity instanceof TileEntityEnderChest)) { + continue; + } + if (disableIfOpened.isToggled() && ((TileEntityEnderChest) tileEntity).lidAngle > 0.0f) { + continue; + } + RenderUtils.renderChest(tileEntity.getPos(), rgb, outline.isToggled(), shade.isToggled()); + } + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/render/ExtendCamera.java b/src/main/java/keystrokesmod/module/impl/render/ExtendCamera.java new file mode 100644 index 0000000..dd87ccf --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/render/ExtendCamera.java @@ -0,0 +1,49 @@ +package keystrokesmod.module.impl.render; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Reflection; +import keystrokesmod.utility.Utils; + +public class ExtendCamera extends Module { + public SliderSetting distance; + private float lastDistance; + public ExtendCamera() { + super("ExtendCamera", category.render); + this.registerSetting(new DescriptionSetting("Extends camera in third person.")); + this.registerSetting(new DescriptionSetting("Default is 4 blocks.")); + this.registerSetting(distance = new SliderSetting("Distance", " block", 4, 1, 40, 0.5)); + } + + public void onEnable() { + setThirdPersonDistance((float) distance.getInput()); + } + + public void onUpdate() { + try { + float input = (float) distance.getInput(); + if (lastDistance != input) { + setThirdPersonDistance(lastDistance = input); + } + } + catch (Exception e) { + e.printStackTrace(); + Utils.sendMessage("&cThere was an issue setting third person distance."); + } + } + + public void onDisable() { + setThirdPersonDistance(4.0f); + } + + private void setThirdPersonDistance(float distance) { + try { + Reflection.thirdPersonDistance.set(mc.entityRenderer, distance); + } + catch (Exception e) { + e.printStackTrace(); + Utils.sendMessage("&cThere was an issue setting third person distance."); + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/render/HUD.java b/src/main/java/keystrokesmod/module/impl/render/HUD.java new file mode 100644 index 0000000..f5f753c --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/render/HUD.java @@ -0,0 +1,415 @@ +package keystrokesmod.module.impl.render; + +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Theme; +import keystrokesmod.utility.Utils; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraftforge.fml.client.config.GuiButtonExt; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; + +import java.awt.*; +import java.io.IOException; + +public class HUD extends Module { + public static SliderSetting theme; + private static SliderSetting outline; + public static ButtonSetting alphabeticalSort; + private static ButtonSetting drawBackground; + private static ButtonSetting alignRight; + private static ButtonSetting lowercase; + private static ButtonSetting removeCloset; + private static ButtonSetting removeRender; + private static ButtonSetting removeScripts; + public static ButtonSetting showInfo; + public static int posX = 5; + public static int posY = 70; + private boolean isAlphabeticalSort; + private boolean canShowInfo; + private String[] outlineModes = new String[] { "None", "Full", "Side" }; + private static int backGroundColor = new Color(0, 0, 0, 110).getRGB(); + + public HUD() { + super("HUD", Module.category.render); + this.registerSetting(new DescriptionSetting("Right click bind to hide modules.")); + this.registerSetting(theme = new SliderSetting("Theme", 0, Theme.themes)); + this.registerSetting(outline = new SliderSetting("Outline", 0, outlineModes)); + this.registerSetting(new ButtonSetting("Edit position", () -> { + mc.displayGuiScreen(new EditScreen()); + })); + this.registerSetting(alignRight = new ButtonSetting("Align right", false)); + this.registerSetting(alphabeticalSort = new ButtonSetting("Alphabetical sort", false)); + this.registerSetting(drawBackground = new ButtonSetting("Draw background", false)); + this.registerSetting(lowercase = new ButtonSetting("Lowercase", false)); + this.registerSetting(removeCloset = new ButtonSetting("Remove closet modules", false)); + this.registerSetting(removeRender = new ButtonSetting("Remove render modules", false)); + this.registerSetting(removeScripts = new ButtonSetting("Remove scripts", false)); + this.registerSetting(showInfo = new ButtonSetting("Show module info", true)); + } + + public void onEnable() { + ModuleManager.sort(); + } + + public void guiButtonToggled(ButtonSetting b) { + if (b == alphabeticalSort || b == showInfo) { + ModuleManager.sort(); + } + } + + @SubscribeEvent + public void onRenderTick(RenderTickEvent ev) { + if (ev.phase != TickEvent.Phase.END || !Utils.nullCheck()) { + return; + } + if (isAlphabeticalSort != alphabeticalSort.isToggled()) { + isAlphabeticalSort = alphabeticalSort.isToggled(); + ModuleManager.sort(); + } + if (canShowInfo != showInfo.isToggled()) { + canShowInfo = showInfo.isToggled(); + ModuleManager.sort(); + } + if (mc.currentScreen != null || mc.gameSettings.showDebugInfo) { + return; + } + int yPos = posY; + double n2 = 0.0; + String previousModule = ""; + int lastXPos = 0; + try { + for (Module module : ModuleManager.organizedModules) { + if (module.isEnabled() && module != this) { + if (module.isHidden()) { + continue; + } + if (module == ModuleManager.commandLine) { + continue; + } + if (removeRender.isToggled() && module.moduleCategory() == category.render) { + continue; + } + if (removeScripts.isToggled() && module.moduleCategory() == category.scripts) { + continue; + } + if (removeCloset.isToggled() && module.closetModule) { + continue; + } + String moduleName = module.getName(); + if (showInfo.isToggled() && !module.getInfo().isEmpty()) { + moduleName += " §7" + module.getInfo(); + } + if (lowercase.isToggled()) { + moduleName = moduleName.toLowerCase(); + } + int color = Theme.getGradient((int) theme.getInput(), n2); + int xPos = posX; + if (alignRight.isToggled()) { + xPos -= mc.fontRendererObj.getStringWidth(moduleName); + } + if (drawBackground.isToggled()) { + RenderUtils.drawRect(xPos - 1, yPos - 1, xPos + mc.fontRendererObj.getStringWidth(moduleName) + 0.5, yPos + mc.fontRendererObj.FONT_HEIGHT + 1, backGroundColor); + } + if (outline.getInput() == 1 && n2 == 0.0) { // top + RenderUtils.drawRect(xPos - 2, yPos - 2, xPos + mc.fontRendererObj.getStringWidth(moduleName) + 1.5, yPos - 1, color); + } + if (theme.getInput() == 0) { + n2 -= 120; + } else { + n2 -= 12; + } + if (n2 != 0 && outline.getInput() == 1) { // between + double difference = mc.fontRendererObj.getStringWidth(previousModule) - mc.fontRendererObj.getStringWidth(moduleName); + if (alphabeticalSort.isToggled() && difference < 0) { + RenderUtils.drawRect(xPos - 2, yPos - 2, xPos - difference - 2, yPos - 1, color); + } + else if (alignRight.isToggled()) { + RenderUtils.drawRect(xPos - difference - 2, yPos - 2, xPos - 1, yPos - 1, color); + } + else { + RenderUtils.drawRect(xPos + mc.fontRendererObj.getStringWidth(moduleName) + 0.5, yPos - 2, xPos + difference + mc.fontRendererObj.getStringWidth(moduleName) + 1.5, yPos - 1, color); + } + } + if (outline.getInput() > 0) { // sides + if (alignRight.isToggled()) { + RenderUtils.drawRect(xPos + mc.fontRendererObj.getStringWidth(moduleName) + 0.5, yPos - 1, xPos + mc.fontRendererObj.getStringWidth(moduleName) + 1.5, yPos + mc.fontRendererObj.FONT_HEIGHT + 1, color); + } + else { + RenderUtils.drawRect(xPos - 2, yPos - 1, xPos - 1, yPos + mc.fontRendererObj.FONT_HEIGHT + 1, color); + } + } + if (outline.getInput() == 1) { + if (alignRight.isToggled()) { + RenderUtils.drawRect(xPos - 2, yPos - 1, xPos - 1, yPos + mc.fontRendererObj.FONT_HEIGHT + 1, color); + } + else { + RenderUtils.drawRect(xPos + mc.fontRendererObj.getStringWidth(moduleName) + 0.5, yPos - 1, xPos + mc.fontRendererObj.getStringWidth(moduleName) + 1.5, yPos + mc.fontRendererObj.FONT_HEIGHT + 1, color); + } + } + mc.fontRendererObj.drawString(moduleName, xPos, (float) yPos, color, true); + previousModule = moduleName; + lastXPos = xPos; + yPos += mc.fontRendererObj.FONT_HEIGHT + 2; + } + } + } + catch (Exception e) { + Utils.sendMessage("&cAn error occurred rendering HUD. check your logs"); + e.printStackTrace(); + } + if (outline.getInput() == 1) { // bottom + RenderUtils.drawRect(lastXPos - 2, yPos - 1, lastXPos + mc.fontRendererObj.getStringWidth(previousModule) + 1.5, yPos, Theme.getGradient((int) theme.getInput(), n2)); + } + } + + public static int getLongestModule(FontRenderer fr) { + int length = 0; + + for (Module module : ModuleManager.organizedModules) { + if (module.isEnabled()) { + String moduleName = module.getName(); + if (showInfo.isToggled() && !module.getInfo().isEmpty()) { + moduleName += " §7" + module.getInfo(); + } + if (lowercase.isToggled()) { + moduleName = moduleName.toLowerCase(); + } + if (fr.getStringWidth(moduleName) > length) { + length = fr.getStringWidth(moduleName); + } + } + } + return length; + } + + static class EditScreen extends GuiScreen { + final String example = "This is an-Example-HUD"; + GuiButtonExt resetPosition; + boolean d = false; + int miX = 0; + int miY = 0; + int maX = 0; + int maY = 0; + int aX = 5; + int aY = 70; + int laX = 0; + int laY = 0; + int lmX = 0; + int lmY = 0; + int clickMinX = 0; + + public void initGui() { + super.initGui(); + this.buttonList.add(this.resetPosition = new GuiButtonExt(1, this.width - 90, this.height - 25, 85, 20, "Reset position")); + this.aX = HUD.posX; + this.aY = HUD.posY; + } + + public void drawScreen(int mX, int mY, float pt) { + drawRect(0, 0, this.width, this.height, -1308622848); + int miX = this.aX; + int miY = this.aY; + int maX = miX + 50; + int maY = miY + 32; + int[] clickPos = this.d(this.mc.fontRendererObj, this.example); + this.miX = miX; + this.miY = miY; + if (clickPos == null) { + this.maX = maX; + this.maY = maY; + this.clickMinX = miX; + } + else { + this.maX = clickPos[0]; + this.maY = clickPos[1]; + this.clickMinX = clickPos[2]; + } + HUD.posX = miX; + HUD.posY = miY; + ScaledResolution res = new ScaledResolution(this.mc); + int x = res.getScaledWidth() / 2 - 84; + int y = res.getScaledHeight() / 2 - 20; + RenderUtils.drawColoredString("Edit the HUD position by dragging.", '-', x, y, 2L, 0L, true, this.mc.fontRendererObj); + + try { + this.handleInput(); + } catch (IOException var12) { + } + + super.drawScreen(mX, mY, pt); + } + + private int[] d(FontRenderer fr, String t) { + if (empty()) { + int x = this.miX; + int y = this.miY; + String[] var5 = t.split("-"); + + for (String s : var5) { + if (HUD.alignRight.isToggled()) { + x += mc.fontRendererObj.getStringWidth(var5[0]) - mc.fontRendererObj.getStringWidth(s); + } + fr.drawString(s, (float) x, (float) y, Color.white.getRGB(), true); + y += fr.FONT_HEIGHT + 2; + } + } + else { + int longestModule = getLongestModule(mc.fontRendererObj); + int n = this.miY; + double n2 = 0.0; + String previousModule = ""; + int lastXPos = 0; + try { + for (Module module : ModuleManager.organizedModules) { + if (module.isEnabled() && !(module instanceof HUD)) { + if (module.isHidden()) { + continue; + } + if (module == ModuleManager.commandLine) { + continue; + } + if (removeRender.isToggled() && module.moduleCategory() == category.render) { + continue; + } + if (removeScripts.isToggled() && module.moduleCategory() == category.scripts) { + continue; + } + if (removeCloset.isToggled() && module.closetModule) { + continue; + } + String moduleName = module.getName(); + if (showInfo.isToggled() && !module.getInfo().isEmpty()) { + moduleName += " §7" + module.getInfo(); + } + if (lowercase.isToggled()) { + moduleName = moduleName.toLowerCase(); + } + int color = Theme.getGradient((int) theme.getInput(), n2); + int xPos = posX; + if (alignRight.isToggled()) { + xPos -= mc.fontRendererObj.getStringWidth(moduleName); + } + if (outline.getInput() == 1 && n2 == 0.0) { // top + RenderUtils.drawRect(xPos - 2, n - 2, xPos + mc.fontRendererObj.getStringWidth(moduleName) + 1.5, n - 1, color); + } + if (n2 != 0 && outline.getInput() == 1) { // between + double difference = mc.fontRendererObj.getStringWidth(previousModule) - mc.fontRendererObj.getStringWidth(moduleName); + RenderUtils.drawRect(xPos - difference - 2, n - 2, xPos - 1, n - 1, color); + } + if (theme.getInput() == 0) { + n2 -= 120; + } else { + n2 -= 12; + } + if (drawBackground.isToggled()) { + RenderUtils.drawRect(xPos - 1, n - 1, xPos + mc.fontRendererObj.getStringWidth(moduleName) + 0.5, n + mc.fontRendererObj.FONT_HEIGHT + 1, backGroundColor); + } + if (n2 != 0 && outline.getInput() == 1) { // between + double difference = mc.fontRendererObj.getStringWidth(previousModule) - mc.fontRendererObj.getStringWidth(moduleName); + if (alphabeticalSort.isToggled() && difference < 0) { + RenderUtils.drawRect(xPos - 2, n - 2, xPos - difference - 2, n - 1, color); + } + else if (alignRight.isToggled()) { + RenderUtils.drawRect(xPos - difference - 2, n - 2, xPos - 1, n - 1, color); + } + else { + RenderUtils.drawRect(xPos + mc.fontRendererObj.getStringWidth(moduleName), n - 2, xPos - 1 + difference + mc.fontRendererObj.getStringWidth(moduleName), n - 1, color); + } + } + if (outline.getInput() > 0) { // sides + if (alignRight.isToggled()) { + RenderUtils.drawRect(xPos + mc.fontRendererObj.getStringWidth(moduleName) + 0.5, n - 1, xPos + mc.fontRendererObj.getStringWidth(moduleName) + 1.5, n + mc.fontRendererObj.FONT_HEIGHT + 1, color); + } + else { + RenderUtils.drawRect(xPos - 2, n - 1, xPos - 1, n + mc.fontRendererObj.FONT_HEIGHT + 1, color); + } + } + if (outline.getInput() == 1) { + if (alignRight.isToggled()) { + RenderUtils.drawRect(xPos - 2, n - 1, xPos - 1, n + mc.fontRendererObj.FONT_HEIGHT + 1, color); + } + else { + RenderUtils.drawRect(xPos + mc.fontRendererObj.getStringWidth(moduleName) + 0.5, n - 1, xPos + mc.fontRendererObj.getStringWidth(moduleName) + 1.5, n + mc.fontRendererObj.FONT_HEIGHT + 1, color); + } + } + mc.fontRendererObj.drawString(moduleName, xPos, (float) n, color, true); + previousModule = moduleName; + lastXPos = xPos; + n += mc.fontRendererObj.FONT_HEIGHT + 2; + } + } + } + catch (Exception e) { + Utils.sendMessage("&cAn error occurred rendering HUD. check your logs"); + e.printStackTrace(); + } + if (outline.getInput() == 1) { // bottom + RenderUtils.drawRect(lastXPos - 2, n - 1, lastXPos + mc.fontRendererObj.getStringWidth(previousModule) + 1.5, n, Theme.getGradient((int) theme.getInput(), n2)); + } + return new int[]{this.miX + longestModule, n, this.miX - longestModule}; + } + return null; + } + + protected void mouseClickMove(int mX, int mY, int b, long t) { + super.mouseClickMove(mX, mY, b, t); + if (b == 0) { + if (this.d) { + this.aX = this.laX + (mX - this.lmX); + this.aY = this.laY + (mY - this.lmY); + } else if (mX > this.clickMinX && mX < this.maX && mY > this.miY && mY < this.maY) { + this.d = true; + this.lmX = mX; + this.lmY = mY; + this.laX = this.aX; + this.laY = this.aY; + } + + } + } + + protected void mouseReleased(int mX, int mY, int s) { + super.mouseReleased(mX, mY, s); + if (s == 0) { + this.d = false; + } + + } + + public void actionPerformed(GuiButton b) { + if (b == this.resetPosition) { + this.aX = HUD.posX = 5; + this.aY = HUD.posY = 70; + } + + } + + public boolean doesGuiPauseGame() { + return false; + } + + private boolean empty() { + for (Module module : ModuleManager.organizedModules) { + if (module.isEnabled() && !module.getName().equals("HUD")) { + if (module.isHidden()) { + continue; + } + if (module == ModuleManager.commandLine) { + continue; + } + return false; + } + } + return true; + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/render/Indicators.java b/src/main/java/keystrokesmod/module/impl/render/Indicators.java new file mode 100644 index 0000000..c8c3084 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/render/Indicators.java @@ -0,0 +1,311 @@ +package keystrokesmod.module.impl.render; + +import keystrokesmod.module.Module; +import keystrokesmod.module.impl.world.AntiBot; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.BlockUtils; +import keystrokesmod.utility.Reflection; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.block.BlockFire; +import net.minecraft.block.BlockLiquid; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityEnderPearl; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityFireball; +import net.minecraft.entity.projectile.EntityLargeFireball; +import net.minecraft.entity.projectile.EntityWitherSkull; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.Vec3; +import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +public class Indicators extends Module { + private ButtonSetting renderArrows; + private ButtonSetting renderPearls; + private ButtonSetting renderFireballs; + private ButtonSetting renderPlayers; + private SliderSetting arrow; + private SliderSetting radius; + private ButtonSetting itemColors; + private ButtonSetting renderItem; + private ButtonSetting threatsOnly; + private HashSet threats = new HashSet<>(); + private Map lastHeldItems = new ConcurrentHashMap<>(); + private String[] arrowTypes = new String[] { "Caret", "Greater than", "Triangle" }; + + public Indicators() { + super("Indicators", category.render); + this.registerSetting(renderArrows = new ButtonSetting("Render arrows", true)); + this.registerSetting(renderPearls = new ButtonSetting("Render ender pearls", true)); + this.registerSetting(renderFireballs = new ButtonSetting("Render fireballs", true)); + this.registerSetting(renderPlayers = new ButtonSetting("Render players", true)); + this.registerSetting(arrow = new SliderSetting("Arrow", 0, arrowTypes)); + this.registerSetting(radius = new SliderSetting("Circle radius", 50, 30, 200, 5)); + this.registerSetting(itemColors = new ButtonSetting("Item colors", true)); + this.registerSetting(renderItem = new ButtonSetting("Render item", true)); + this.registerSetting(threatsOnly = new ButtonSetting("Render only threats", true)); + } + + public void onDisable() { + this.threats.clear(); + this.lastHeldItems.clear(); + } + + @SubscribeEvent + public void onRenderTick(TickEvent.RenderTickEvent event) { + if (event.phase != TickEvent.Phase.END) { + return; + } + if (mc.currentScreen != null || !Utils.nullCheck()) { + return; + } + try { + Iterator iterator = threats.iterator(); + while (iterator.hasNext()) { + Entity en = iterator.next(); + if (en == null || !mc.theWorld.loadedEntityList.contains(en) || !canRender(en) || (en instanceof EntityArrow && Reflection.inGround.getBoolean(en))) { + iterator.remove(); + continue; + } + ItemStack itemStack = null; + if (en instanceof EntityArrow) { + itemStack = new ItemStack(Items.arrow); + } + else if (en instanceof EntityFireball) { + itemStack = new ItemStack(Items.fire_charge); + } + else if (en instanceof EntityEnderPearl) { + itemStack = new ItemStack(Items.ender_pearl); + } + if (!mc.theWorld.loadedEntityList.contains(en)) { + continue; + } + this.renderIndicatorFor(en, itemStack, event.renderTickTime); + } + } + catch (Exception e) {} + } + + @SubscribeEvent + public void onEntityJoin(EntityJoinWorldEvent e) { + if (!Utils.nullCheck()) { + return; + } + if (e.entity == mc.thePlayer) { + this.threats.clear(); + } + else if (canRender(e.entity) && (mc.thePlayer.getDistanceSqToEntity(e.entity) > 36 || !threatsOnly.isToggled() || e.entity instanceof EntityPlayer)) { + this.threats.add(e.entity); + } + } + + private boolean canRender(Entity entity) { + try { + if (entity instanceof EntityArrow && !Reflection.inGround.getBoolean(entity) && renderArrows.isToggled()) { + return true; + } + else if (entity instanceof EntityLargeFireball && renderFireballs.isToggled()) { + return true; + } + else if (entity instanceof EntityEnderPearl && renderPearls.isToggled()) { + return true; + } + else if (entity instanceof EntityPlayer && renderPlayers.isToggled() && AntiBot.isBot(entity)) { + return true; + } + } + catch (IllegalAccessException e) { + Utils.sendMessage("&cIssue checking entity."); + e.printStackTrace(); + return false; + } + return false; + } + + private void renderIndicatorFor(Entity en, ItemStack itemStack, float partialTicks) { + if (!this.canRender(en)) { + return; + } + if (!this.shouldRender(en, itemStack)) { + return; + } + Color colorForStack = getColorForItem(itemStack); + int color = itemColors.isToggled() ? colorForStack.getRGB() : -1; + + double x = en.lastTickPosX + (en.posX - en.lastTickPosX) * partialTicks - mc.getRenderManager().viewerPosX; + double y = en.lastTickPosY + (en.posY - en.lastTickPosY) * partialTicks - mc.getRenderManager().viewerPosY + en.height / 2; + double z = en.lastTickPosZ + (en.posZ - en.lastTickPosZ) * partialTicks - mc.getRenderManager().viewerPosZ; + + if (!Reflection.setupCameraTransform(mc.entityRenderer, partialTicks, 0)) { + return; + } + + ScaledResolution scaledResolution = new ScaledResolution(mc); + Vec3 vec = RenderUtils.convertTo2D(scaledResolution.getScaleFactor(), x, y, z); + + if (vec != null) { + mc.entityRenderer.setupOverlayRendering(); + ScaledResolution res = new ScaledResolution(mc); + + double dx = vec.xCoord - res.getScaledWidth() / 2.0; + double dy = vec.yCoord - res.getScaledHeight() / 2.0; + boolean inFrustum = vec.zCoord < 1.0003684; + + if (!inFrustum) { + dx *= -1.0; + dy *= -1.0; + } + + double angle1 = Math.atan2(dx, dy); + double angle2 = Math.atan2(dy, dx) * 57.295780181884766 + 90.0; + double hypotenuse = Math.hypot(dx, dy); + double radiusInput = radius.getInput(); + + if (renderItem.isToggled()) { + radiusInput += 20.0; + } + + if (inFrustum && hypotenuse < radiusInput + 15.0) { + return; + } + + double baseX = res.getScaledWidth() / 2.0; + double baseY = res.getScaledHeight() / 2.0; + double sinAng = Math.sin(angle1); + double cosAng = Math.cos(angle1); + double renderX = baseX + radiusInput * sinAng; + double renderY = baseY + radiusInput * cosAng; + + GlStateManager.pushMatrix(); + GlStateManager.translate(renderX, renderY, 0.0); + GlStateManager.rotate((float) angle2, 0.0f, 0.0f, 1.0f); + GlStateManager.scale(1.0f, 1.0f, 1.0f); + + if (arrow.getInput() == 0) { + if (color == -1) { + GL11.glColor3d(1.0, 1.0, 1.0); + } + else { + GL11.glColor3d(colorForStack.getRed(), colorForStack.getGreen(), colorForStack.getBlue()); + } + + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glEnable(GL11.GL_LINE_SMOOTH); + + double halfAngle = 0.6108652353286743; + double size = 9.0; + double offsetY = 5.0; + GL11.glLineWidth(3.0f); + GL11.glBegin(GL11.GL_LINE_STRIP); + GL11.glVertex2d(Math.sin(-halfAngle) * size, Math.cos(-halfAngle) * size - offsetY); + GL11.glVertex2d(0.0, -offsetY); + GL11.glVertex2d(Math.sin(halfAngle) * size, Math.cos(halfAngle) * size - offsetY); + GL11.glEnd(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_LINE_SMOOTH); + } + else if (arrow.getInput() == 1) { + GlStateManager.rotate(-90.0f, 0.0f, 0.0f, 1.0f); + GlStateManager.scale(1.5, 1.5, 1.5); + mc.fontRendererObj.drawString(">", -2.0f, -4.0f, color, false); + } + else if (arrow.getInput() == 2) { + RenderUtils.draw2DPolygon(0.0, 0.0, 5.0, 3, color); + } + + GlStateManager.popMatrix(); + + renderX = baseX + (radiusInput - 13.0) * sinAng; + renderY = baseY + (radiusInput - 13.0) * cosAng; + + GlStateManager.pushMatrix(); + GlStateManager.translate(renderX, renderY, 0.0); + GlStateManager.scale(0.8, 0.8, 0.8); + + String text = (int) mc.thePlayer.getDistanceToEntity(en) + "m"; + mc.fontRendererObj.drawString(text, (float) (-mc.fontRendererObj.getStringWidth(text) / 2), -4.0f, -1, true); + + GlStateManager.popMatrix(); + + if (renderItem.isToggled() && itemStack != null) { + GlStateManager.pushMatrix(); + if (itemStack.getItem() == Items.arrow) { + renderX = baseX + (radiusInput - 26.0) * sinAng; + renderY = baseY + (radiusInput - 26.0) * cosAng; + GlStateManager.translate(renderX, renderY, 0.0); + GlStateManager.scale(1.0f, 1.0f, 1.0f); + GlStateManager.rotate((float) angle2 - 45.0f, 0.0f, 0.0f, 1.0f); + mc.getRenderItem().renderItemIntoGUI(itemStack, -12, -4); + } + else { + renderX = baseX + (radiusInput - 29.0) * sinAng; + renderY = baseY + (radiusInput - 29.0) * cosAng; + GlStateManager.translate(renderX, renderY, 0.0); + GlStateManager.scale(1.0f, 1.0f, 1.0f); + mc.getRenderItem().renderItemIntoGUI(itemStack, -8, -9); + } + GlStateManager.popMatrix(); + } + } + } + + private Color getColorForItem(ItemStack itemStack) { + if (itemStack.getItem() == Items.ender_pearl) { + return new Color(210, 0, 255); + } + else if (itemStack.getItem() == Items.fire_charge) { + return new Color(255, 150, 0); + } + else { + return Color.WHITE; + } + } + + private boolean shouldRender(Entity en, ItemStack stack) { + if (threatsOnly.isToggled() && stack != null && stack.getItem() == Items.fire_charge) { + double x = en.posX; + double y = en.posY; + double z = en.posZ; + final double dx = x - en.lastTickPosX; + final double dy = y - en.lastTickPosY; + final double dz = z - en.lastTickPosZ; + if (dx != 0.0 || dy != 0.0 || dz != 0.0) { + for (int i = 0; i < 400.0; ++i) { + final double dist = mc.thePlayer.getDistanceSq(x, y, z); + if (dist <= 36) { + return true; + } + final Block block = BlockUtils.getBlock(new BlockPos(x, y, z)); + if (!(block instanceof BlockAir) && !(block instanceof BlockLiquid) && !(block instanceof BlockFire)) { + break; + } + x += dx * 0.5; + y += dy * 0.5; + z += dz * 0.5; + } + } + return false; + } + return true; + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/render/ItemESP.java b/src/main/java/keystrokesmod/module/impl/render/ItemESP.java new file mode 100644 index 0000000..32b2143 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/render/ItemESP.java @@ -0,0 +1,166 @@ +package keystrokesmod.module.impl.render; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +public class ItemESP extends Module { // entirely skidded from raven b4 source leak + private ButtonSetting renderIron, renderGold; + + public ItemESP() { + super("ItemESP", category.render); + this.registerSetting(renderIron = new ButtonSetting("Render iron", true)); + this.registerSetting(renderGold = new ButtonSetting("Render gold", true)); + } + + @SubscribeEvent + public void onRenderWorldLast(RenderWorldLastEvent e) { + HashMap> hashMap = new HashMap<>(); + HashMap hashMap2 = new HashMap<>(); + for (Entity entity : mc.theWorld.loadedEntityList) { + if (entity instanceof EntityItem) { + if (entity.ticksExisted < 3) { + continue; + } + EntityItem entityItem = (EntityItem) entity; + if (entityItem.getEntityItem().stackSize == 0) { + continue; + } + Item getItem = entityItem.getEntityItem().getItem(); + if (getItem == null) { + continue; + } + int stackSize = entityItem.getEntityItem().stackSize; + double a = getColorForItem(getItem, entity.posX, entity.posY, entity.posZ); + Integer n = hashMap2.get(a); + int n2; + if (n == null) { + n2 = stackSize; + ArrayList list = hashMap.get(getItem); + if (list == null) { + list = new ArrayList<>(); + } + list.add(entityItem); + hashMap.put(getItem, list); + } else { + n2 = n + stackSize; + } + hashMap2.put(a, n2); + } + } + if (!hashMap.isEmpty()) { + float renderPartialTicks = Utils.getTimer().renderPartialTicks; + for (Map.Entry> entry : hashMap.entrySet()) { + Item item = entry.getKey(); + int n4; + int n3; + if (item == Items.iron_ingot && renderIron.isToggled()) { + n3 = (n4 = -1); + } else if (item == Items.gold_ingot && renderGold.isToggled()) { + n4 = -331703; + n3 = -152; + } else if (item == Items.diamond) { + n4 = -10362113; + n3 = -7667713; + } else { + if (item != Items.emerald) { + continue; + } + n4 = -15216030; + n3 = -14614644; + } + for (EntityItem entityItem2 : entry.getValue()) { + double a2 = getColorForItem(item, entityItem2.posX, entityItem2.posY, entityItem2.posZ); + double n5 = entityItem2.lastTickPosX + (entityItem2.posX - entityItem2.lastTickPosX) * renderPartialTicks; + double n6 = entityItem2.lastTickPosY + (entityItem2.posY - entityItem2.lastTickPosY) * renderPartialTicks; + double n7 = entityItem2.lastTickPosZ + (entityItem2.posZ - entityItem2.lastTickPosZ) * renderPartialTicks; + double n8 = mc.thePlayer.lastTickPosX + (mc.thePlayer.posX - mc.thePlayer.lastTickPosX) * renderPartialTicks - n5; + double n9 = mc.thePlayer.lastTickPosY + (mc.thePlayer.posY - mc.thePlayer.lastTickPosY) * renderPartialTicks - n6; + double n10 = mc.thePlayer.lastTickPosZ + (mc.thePlayer.posZ - mc.thePlayer.lastTickPosZ) * renderPartialTicks - n7; + GlStateManager.pushMatrix(); + drawBox(n4, n3, hashMap2.get(a2), n5, n6, n7, MathHelper.sqrt_double(n8 * n8 + n9 * n9 + n10 * n10)); + GlStateManager.popMatrix(); + } + } + } + } + + public double getColor(double n, double n2, double n3) { + if (n == 0.0) { + n = 1.0; + } + if (n2 == 0.0) { + n2 = 1.0; + } + if (n3 == 0.0) { + n3 = 1.0; + } + return Math.round((n + 1.0) * Math.floor(n2) * (n3 + 2.0)); + } + + private double getColorForItem(Item item, double n, double n2, double n3) { + double c = getColor(n, n2, n3); + if (item == Items.iron_ingot) { + c += 0.155; + } else if (item == Items.gold_ingot) { + c += 0.255; + } else if (item == Items.diamond) { + c += 0.355; + } else if (item == Items.emerald) { + c += 0.455; + } + return c; + } + + public void drawBox(int n, int n2, int n3, double n4, double n5, double n6, double n7) { + n4 -= mc.getRenderManager().viewerPosX; + n5 -= mc.getRenderManager().viewerPosY; + n6 -= mc.getRenderManager().viewerPosZ; + GL11.glPushMatrix(); + GL11.glBlendFunc(770, 771); + GL11.glEnable(3042); + GL11.glLineWidth(2.0f); + GL11.glDisable(3553); + GL11.glDisable(2929); + GL11.glDepthMask(false); + float n8 = (n >> 16 & 0xFF) / 255.0f; + float n9 = (n >> 8 & 0xFF) / 255.0f; + float n10 = (n & 0xFF) / 255.0f; + float min = Math.min(Math.max(0.2f, (float) (0.009999999776482582 * n7)), 0.4f); + RenderUtils.drawBoundingBox(new AxisAlignedBB(n4 - min, n5, n6 - min, n4 + min, n5 + min * 2.0f, n6 + min), n8, n9, n10, 0.35f); + GL11.glEnable(3553); + GL11.glEnable(2929); + GL11.glDepthMask(true); + GL11.glDisable(3042); + GL11.glPopMatrix(); + GlStateManager.pushMatrix(); + GlStateManager.translate((float) n4, (float) n5 + 0.3, (float) n6); + GlStateManager.rotate(-mc.getRenderManager().playerViewY, 0.0f, 1.0f, 0.0f); + GlStateManager.rotate(mc.getRenderManager().playerViewX, 1.0f, 0.0f, 0.0f); + float min2 = Math.min(Math.max(0.02266667f, (float) (0.001500000013038516 * n7)), 0.07f); + GlStateManager.scale(-min2, -min2, -min2); + GlStateManager.depthMask(false); + GlStateManager.disableDepth(); + String value = String.valueOf(n3); + mc.fontRendererObj.drawString(value, -(mc.fontRendererObj.getStringWidth(value) / 2) + min2 * 3.5f, -(123.805f * min2 - 2.47494f), n2, true); + GlStateManager.enableDepth(); + GlStateManager.depthMask(true); + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); + GlStateManager.popMatrix(); + } +} diff --git a/src/main/java/keystrokesmod/module/impl/render/MobESP.java b/src/main/java/keystrokesmod/module/impl/render/MobESP.java new file mode 100644 index 0000000..d137628 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/render/MobESP.java @@ -0,0 +1,109 @@ +package keystrokesmod.module.impl.render; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.*; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.awt.*; + +public class MobESP extends Module { + private ButtonSetting healthBar; + private ButtonSetting blaze, creeper, enderman, ghast, silverfish, skeleton, slime, spider, zombie, zombiePigman; + + public MobESP() { + super("MobESP", category.render); + this.registerSetting(healthBar = new ButtonSetting("Health bar", false)); + this.registerSetting(blaze = new ButtonSetting("Blaze §6Orange", true)); + this.registerSetting(creeper = new ButtonSetting("Creeper §aGreen", true)); + this.registerSetting(enderman = new ButtonSetting("Enderman §7Black", true)); + this.registerSetting(ghast = new ButtonSetting("Ghast §fWhite", true)); + this.registerSetting(silverfish = new ButtonSetting("Silverfish §7Gray", true)); + this.registerSetting(skeleton = new ButtonSetting("Skeleton §fWhite", true)); + this.registerSetting(slime = new ButtonSetting("Slime §aGreen", true)); + this.registerSetting(spider = new ButtonSetting("Spider §7Black", true)); + this.registerSetting(zombie = new ButtonSetting("Zombie §1Blue", true)); + this.registerSetting(zombiePigman = new ButtonSetting("Zombie Pigman §dPink", true)); + } + + private void renderMob(Entity entity, int n) { + RenderUtils.renderEntity(entity, 2, 0.0, 0.0, n, false); + if (healthBar.isToggled()) { + RenderUtils.renderEntity(entity, 4, 0.0, 0.0, n, false); + } + } + + private void renderer(final Entity entity) { + if (entity instanceof EntityBlaze) { + if (!blaze.isToggled()) { + return; + } + this.renderMob(entity, Color.orange.getRGB()); + } else if (entity instanceof EntityCreeper) { + if (!creeper.isToggled()) { + return; + } + this.renderMob(entity, Color.green.getRGB()); + } else if (entity instanceof EntityEnderman) { + if (!enderman.isToggled()) { + return; + } + this.renderMob(entity, Color.black.getRGB()); + } else if (entity instanceof EntityGhast) { + if (!ghast.isToggled()) { + return; + } + this.renderMob(entity, -1); + } else if (entity instanceof EntitySilverfish) { + if (!silverfish.isToggled()) { + return; + } + this.renderMob(entity, Color.gray.getRGB()); + } else if (entity instanceof EntitySkeleton) { + if (!skeleton.isToggled()) { + return; + } + this.renderMob(entity, -1); + } else if (entity instanceof EntitySlime) { + if (!slime.isToggled()) { + return; + } + this.renderMob(entity, Color.green.getRGB()); + } else if (entity instanceof EntitySpider || entity instanceof EntityCaveSpider) { + if (!spider.isToggled()) { + return; + } + this.renderMob(entity, Color.black.getRGB()); + } else if (entity instanceof EntityPigZombie) { + if (!zombiePigman.isToggled()) { + return; + } + this.renderMob(entity, Color.pink.getRGB()); + } else if (entity instanceof EntityZombie) { + if (!zombie.isToggled()) { + return; + } + this.renderMob(entity, Color.blue.getRGB()); + } + } + + @SubscribeEvent + public void onRenderWorldLast(RenderWorldLastEvent e) { + if (!Utils.nullCheck()) { + return; + } + for (Entity entity : mc.theWorld.loadedEntityList) { + if (entity instanceof EntityLivingBase && entity != mc.thePlayer) { + if (((EntityLivingBase) entity).deathTime != 0) { + continue; + } + this.renderer(entity); + } + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/render/Nametags.java b/src/main/java/keystrokesmod/module/impl/render/Nametags.java new file mode 100644 index 0000000..65badf3 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/render/Nametags.java @@ -0,0 +1,355 @@ +package keystrokesmod.module.impl.render; + +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.world.AntiBot; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Reflection; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.*; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.*; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.Vec3; +import net.minecraftforge.client.event.RenderLivingEvent; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.awt.*; +import java.util.Locale; + +public class Nametags extends Module { + private SliderSetting scale; + private ButtonSetting autoScale; + private ButtonSetting drawBackground; + private ButtonSetting onlyRenderName; + private ButtonSetting dropShadow; + private ButtonSetting showDistance; + private ButtonSetting showHealth; + private ButtonSetting showHitsToKill; + private ButtonSetting showInvis; + private ButtonSetting removeTags; + private ButtonSetting renderSelf; + private ButtonSetting showArmor; + private ButtonSetting showEnchants; + private ButtonSetting showDurability; + private ButtonSetting showStackSize; + private int backGroundColor = new Color(0, 0, 0, 100).getRGB(); + private int friendColor = new Color(0, 255, 0, 255).getRGB(); + private int enemyColor = new Color(255, 0, 0, 255).getRGB(); + private double normalizedThreshold = 8; + + public Nametags() { + super("Nametags", category.render, 0); + this.registerSetting(scale = new SliderSetting("Scale", 1.0, 0.5, 5.0, 0.1)); + this.registerSetting(autoScale = new ButtonSetting("Auto-scale", true)); + this.registerSetting(drawBackground = new ButtonSetting("Draw background", true)); + this.registerSetting(onlyRenderName = new ButtonSetting("Only render name", false)); + this.registerSetting(renderSelf = new ButtonSetting("Render self", false)); + this.registerSetting(dropShadow = new ButtonSetting("Drop shadow", true)); + this.registerSetting(showDistance = new ButtonSetting("Show distance", false)); + this.registerSetting(showHealth = new ButtonSetting("Show health", true)); + this.registerSetting(showHitsToKill = new ButtonSetting("Show hits to kill", false)); + this.registerSetting(showInvis = new ButtonSetting("Show invis", true)); + this.registerSetting(removeTags = new ButtonSetting("Remove tags", false)); + this.registerSetting(new DescriptionSetting("Armor settings")); + this.registerSetting(showArmor = new ButtonSetting("Show armor", false)); + this.registerSetting(showEnchants = new ButtonSetting("Show enchants", true)); + this.registerSetting(showDurability = new ButtonSetting("Show durability", true)); + this.registerSetting(showStackSize = new ButtonSetting("Show stack size", true)); + } + + @SubscribeEvent(priority = EventPriority.LOWEST) + public void onRenderWorldLast(RenderWorldLastEvent ev) { + if (!Utils.nullCheck()) { + return; + } + if (removeTags.isToggled()) { + return; + } + double interpolatedX; + double interpolatedY; + double interpolatedZ; + if (mc.gameSettings.thirdPersonView > 0) { + Vec3 thirdPersonPos = Utils.getCameraPos(ev.partialTicks); + interpolatedX = thirdPersonPos.xCoord; + interpolatedY = thirdPersonPos.yCoord; + interpolatedZ = thirdPersonPos.zCoord; + } + else { + interpolatedX = mc.thePlayer.lastTickPosX + (mc.thePlayer.posX - mc.thePlayer.lastTickPosX) * ev.partialTicks; + interpolatedY = mc.thePlayer.lastTickPosY + (mc.thePlayer.posY - mc.thePlayer.lastTickPosY) * ev.partialTicks + mc.thePlayer.getEyeHeight(); + interpolatedZ = mc.thePlayer.lastTickPosZ + (mc.thePlayer.posZ - mc.thePlayer.lastTickPosZ) * ev.partialTicks; + } + + ScaledResolution scaledResolution = new ScaledResolution(mc); + + for (EntityPlayer en : mc.theWorld.playerEntities) { + if (!showInvis.isToggled() && en.isInvisible()) { + continue; + } + if (en == mc.thePlayer && (!renderSelf.isToggled() || mc.gameSettings.thirdPersonView == 0)) { + continue; + } + if (en.getDisplayNameString().isEmpty() || (en != mc.thePlayer && AntiBot.isBot(en))) { + continue; + } + if (!RenderUtils.isInViewFrustum(en)) { + continue; + } + double playerX = en.lastTickPosX + (en.posX - en.lastTickPosX) * ev.partialTicks; + double playerY = en.lastTickPosY + (en.posY - en.lastTickPosY) * ev.partialTicks; + double playerZ = en.lastTickPosZ + (en.posZ - en.lastTickPosZ) * ev.partialTicks; + + double renderHeightOffset = (playerY - mc.getRenderManager().viewerPosY) + (!en.isSneaking() ? en.height : en.height - 0.3) + 0.294; + double heightOffset = playerY + (!en.isSneaking() ? en.height : en.height - 0.3) + 0.294; + + if (!Reflection.setupCameraTransform(mc.entityRenderer, ev.partialTicks, 0)) { + continue; + } + + Vec3 screenCords = RenderUtils.convertTo2D(scaledResolution.getScaleFactor(), playerX - mc.getRenderManager().viewerPosX, renderHeightOffset, playerZ - mc.getRenderManager().viewerPosZ); + boolean inFrustum = screenCords.zCoord < 1.0003684; + if (!inFrustum) { + continue; + } + mc.entityRenderer.setupOverlayRendering(); + + if (screenCords == null) { + continue; + } + + float scaleSetting = (float) scale.getInput(); + float newScale = scaleSetting; + if (autoScale.isToggled()) { + double deltaX = Math.abs(interpolatedX - playerX); + if (deltaX < normalizedThreshold + 1) { + double deltaZ = Math.abs(interpolatedZ - playerZ); + if (deltaZ < normalizedThreshold + 1) { + double deltaY = Math.abs(interpolatedY - heightOffset); + if (deltaY < normalizedThreshold + 1) { + double distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ); + if (distance < normalizedThreshold) { + newScale = Math.max((float) (scaleSetting * (normalizedThreshold / distance)), scaleSetting); + } + } + } + } + } + else { + double deltaX = Math.abs(interpolatedX - playerX); + double deltaZ = Math.abs(interpolatedZ - playerZ); + double deltaY = Math.abs(interpolatedY - heightOffset); + double distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ); + newScale = (float) ((scale.getInput() + 4) / distance); + } + String name; + if (onlyRenderName.isToggled()) { + String formattedName = Utils.getFirstColorCode(en.getDisplayName().getFormattedText()); + String colorSuffix = ""; + if (formattedName.length() >= 2 && formattedName.startsWith("§")) { + colorSuffix = formattedName; + } + name = colorSuffix + en.getName(); + } + else { + name = en.getDisplayName().getFormattedText(); + } + if (showHealth.isToggled()) { + name = name + " " + Utils.getHealthStr(en, false); + } + if (showHitsToKill.isToggled()) { + name = name + " " + Utils.getHitsToKill(en, mc.thePlayer.getCurrentEquippedItem()); + } + if (showDistance.isToggled()) { + int distance = Math.round(mc.thePlayer.getDistanceToEntity(en)); + String color = "§"; + if (distance < 8) { + color += "c"; + } + else if (distance < 30) { + color += "6"; + } + else if (distance < 60) { + color += "e"; + } + else if (distance < 90) { + color += "a"; + } + else { + color += "2"; + } + name = color + distance + "m§r " + name; + } + if (ModuleManager.skyWars.isEnabled() && ModuleManager.skyWars.strengthIndicator.isToggled() && !ModuleManager.skyWars.strengthPlayers.isEmpty() && ModuleManager.skyWars.strengthPlayers.get(en) != null) { + double startTime = ModuleManager.skyWars.strengthPlayers.get(en); + double timePassed = (System.currentTimeMillis() - startTime) / 1000; + double strengthRemaining = Math.max(0, Utils.round(5.0 - timePassed, 1)); + String strengthInfo = "§4" + (Utils.isWholeNumber(strengthRemaining) ? (int) strengthRemaining + "" : strengthRemaining) + "s§r "; + name = strengthInfo + name; + } + + int strWidth = (mc.fontRendererObj.getStringWidth(name)) / 2; + int x1 = -strWidth - 1; + int y1 = -10; + int x2 = strWidth + 1; + int y2 = 8 - 9; + GlStateManager.pushMatrix(); + GlStateManager.scale(newScale, newScale, newScale); + GlStateManager.translate(screenCords.xCoord / newScale, screenCords.yCoord / newScale, 0); + if (drawBackground.isToggled()) { + RenderUtils.drawRect(x1, y1, x2, y2, backGroundColor); + } + if (Utils.isFriended(en)) { + RenderUtils.drawOutline(x1, y1, x2, y2, 2, friendColor); + } + else if (Utils.isEnemy(en)) { + RenderUtils.drawOutline(x1, y1, x2, y2, 2, enemyColor); + } + mc.fontRendererObj.drawString(name, -strWidth, -9, -1, dropShadow.isToggled()); + if (showArmor.isToggled()) { + renderArmor(en); + } + GlStateManager.scale(1.0f, 1.0f, 1.0f); + GlStateManager.popMatrix(); + } + } + + @SubscribeEvent + public void onRenderLiving(RenderLivingEvent.Specials.Pre e) { + if (e.entity instanceof EntityPlayer && (e.entity != mc.thePlayer || renderSelf.isToggled()) && e.entity.deathTime == 0) { + EntityPlayer entityPlayer = (EntityPlayer) e.entity; + if (!showInvis.isToggled() && entityPlayer.isInvisible()) { + return; + } + if (entityPlayer.getDisplayNameString().isEmpty() || (entityPlayer != mc.thePlayer && AntiBot.isBot(entityPlayer))) { + return; + } + e.setCanceled(true); + } + } + + private void renderArmor(EntityPlayer e) { + int pos = 0; + for (ItemStack is : e.inventory.armorInventory) { + if (is != null) { + pos -= 8; + } + } + if (e.getHeldItem() != null) { + pos -= 8; + ItemStack item = e.getHeldItem().copy(); + if (item.hasEffect() && (item.getItem() instanceof ItemTool || item.getItem() instanceof ItemArmor)) { + item.stackSize = 1; + } + renderItemStack(item, pos, -20); + pos += 16; + } + for (int i = 3; i >= 0; --i) { + ItemStack stack = e.inventory.armorInventory[i]; + if (stack != null) { + renderItemStack(stack, pos, -20); + pos += 16; + } + } + } + + private void renderItemStack(ItemStack stack, int xPos, int yPos) { + GlStateManager.pushMatrix(); + GlStateManager.disableAlpha(); + mc.getRenderItem().zLevel = -150.0F; + GlStateManager.enableDepth(); + RenderHelper.enableGUIStandardItemLighting(); + mc.getRenderItem().renderItemAndEffectIntoGUI(stack, xPos, yPos - 8); + mc.getRenderItem().zLevel = 0.0F; + GlStateManager.disableDepth(); + GlStateManager.scale(0.5, 0.5, 0.5); + GlStateManager.translate(0, -10, 0); + renderText(stack, xPos, yPos); + GlStateManager.enableDepth(); + GlStateManager.scale(2, 2, 2); + GlStateManager.enableAlpha(); + GlStateManager.popMatrix(); + } + + private void renderText(ItemStack stack, int xPos, int yPos) { + int newYPos = yPos - 24; + if (showDurability.isToggled() && stack.getItem() instanceof ItemArmor) { + int remainingDurability = stack.getMaxDamage() - stack.getItemDamage(); + mc.fontRendererObj.drawString(String.valueOf(remainingDurability), (float) (xPos * 2), (float) yPos, 16777215, dropShadow.isToggled()); + } + if (showEnchants.isToggled() && stack.getEnchantmentTagList() != null && stack.getEnchantmentTagList().tagCount() < 6) { + if (stack.getItem() instanceof ItemTool || stack.getItem() instanceof ItemSword || stack.getItem() instanceof ItemBow || stack.getItem() instanceof ItemArmor) { + NBTTagList nbttaglist = stack.getEnchantmentTagList(); + for(int i = 0; i < nbttaglist.tagCount(); ++i) { + int id = nbttaglist.getCompoundTagAt(i).getShort("id"); + int lvl = nbttaglist.getCompoundTagAt(i).getShort("lvl"); + if (lvl > 0) { + String abbreviated = getEnchantmentAbbreviated(id); + mc.fontRendererObj.drawString(abbreviated + lvl, (float) (xPos * 2), (float) newYPos, -1, dropShadow.isToggled()); + newYPos += 8; + } + } + } + } + if (showStackSize.isToggled() && !(stack.getItem() instanceof ItemSword) && !(stack.getItem() instanceof ItemBow) && !(stack.getItem() instanceof ItemTool) && !(stack.getItem() instanceof ItemArmor)) { + mc.fontRendererObj.drawString(stack.stackSize + "x", (float) (xPos * 2), (float) yPos, -1, dropShadow.isToggled()); + } + } + + private String getEnchantmentAbbreviated(int id) { + switch (id) { + case 0: + return "pt"; // Protection + case 1: + return "frp"; // Fire Protection + case 2: + return "ff"; // Feather Falling + case 3: + return "blp"; // Blast Protection + case 4: + return "prp"; // Projectile Protection + case 5: + return "thr"; // Thorns + case 6: + return "res"; // Respiration + case 7: + return "aa"; // Aqua Affinity + case 16: + return "sh"; // Sharpness + case 17: + return "smt"; // Smite + case 18: + return "ban"; // Bane of Arthropods + case 19: + return "kb"; // Knockback + case 20: + return "fa"; // Fire Aspect + case 21: + return "lot"; // Looting + case 32: + return "eff"; // Efficiency + case 33: + return "sil"; // Silk Touch + case 34: + return "ub"; // Unbreaking + case 35: + return "for"; // Fortune + case 48: + return "pow"; // Power + case 49: + return "pun"; // Punch + case 50: + return "flm"; // Flame + case 51: + return "inf"; // Infinity + default: + return null; + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/render/NoCameraClip.java b/src/main/java/keystrokesmod/module/impl/render/NoCameraClip.java new file mode 100644 index 0000000..f2130b0 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/render/NoCameraClip.java @@ -0,0 +1,9 @@ +package keystrokesmod.module.impl.render; + +import keystrokesmod.module.Module; + +public class NoCameraClip extends Module { + public NoCameraClip() { + super("NoCameraClip", category.render); + } +} diff --git a/src/main/java/keystrokesmod/module/impl/render/NoHurtCam.java b/src/main/java/keystrokesmod/module/impl/render/NoHurtCam.java new file mode 100644 index 0000000..76419e1 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/render/NoHurtCam.java @@ -0,0 +1,14 @@ +package keystrokesmod.module.impl.render; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; + +public class NoHurtCam extends Module { + public SliderSetting multiplier; + public NoHurtCam() { + super("NoHurtCam", category.render); + this.registerSetting(new DescriptionSetting("Default is 14x multiplier.")); + this.registerSetting(multiplier = new SliderSetting("Multiplier", 14, -40, 40, 1)); + } +} diff --git a/src/main/java/keystrokesmod/module/impl/render/PlayerESP.java b/src/main/java/keystrokesmod/module/impl/render/PlayerESP.java new file mode 100644 index 0000000..1c30de3 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/render/PlayerESP.java @@ -0,0 +1,315 @@ +package keystrokesmod.module.impl.render; + +import keystrokesmod.Raven; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.world.AntiBot; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Reflection; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Vec3; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.util.HashMap; +import java.util.Map; + +public class PlayerESP extends Module { + public SliderSetting red; + public SliderSetting green; + public SliderSetting blue; + public ButtonSetting teamColor; + public ButtonSetting rainbow; + private ButtonSetting twoD; + private ButtonSetting box; + private ButtonSetting healthBar; + public ButtonSetting outline; + private ButtonSetting shaded; + private ButtonSetting ring; + public ButtonSetting redOnDamage; + public ButtonSetting renderSelf; + public ButtonSetting showInvis; + private int rgb_c = 0; + private Map renderAsTwoD = new HashMap<>(); // entity with its rgb + // none, outline, box, shaded, 2d, ring + + public PlayerESP() { + super("PlayerESP", category.render, 0); + this.registerSetting(red = new SliderSetting("Red", 0.0D, 0.0D, 255.0D, 1.0D)); + this.registerSetting(green = new SliderSetting("Green", 255.0D, 0.0D, 255.0D, 1.0D)); + this.registerSetting(blue = new SliderSetting("Blue", 0.0D, 0.0D, 255.0D, 1.0D)); + this.registerSetting(rainbow = new ButtonSetting("Rainbow", false)); + this.registerSetting(teamColor = new ButtonSetting("Team color", false)); + this.registerSetting(new DescriptionSetting("ESP Types")); + this.registerSetting(twoD = new ButtonSetting("2D", false)); + this.registerSetting(box = new ButtonSetting("Box", false)); + this.registerSetting(healthBar = new ButtonSetting("Health bar", true)); + this.registerSetting(outline = new ButtonSetting("Outline", false)); + this.registerSetting(ring = new ButtonSetting("Ring", false)); + this.registerSetting(shaded = new ButtonSetting("Shaded", false)); + this.registerSetting(redOnDamage = new ButtonSetting("Red on damage", true)); + this.registerSetting(renderSelf = new ButtonSetting("Render self", false)); + this.registerSetting(showInvis = new ButtonSetting("Show invis", true)); + } + + public void onDisable() { + RenderUtils.ring_c = false; + } + + public void guiUpdate() { + this.rgb_c = (new Color((int) red.getInput(), (int) green.getInput(), (int) blue.getInput())).getRGB(); + } + + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onRenderWorld(RenderWorldLastEvent e) { + this.renderAsTwoD.clear(); + if (Utils.nullCheck()) { + int rgb = rainbow.isToggled() ? Utils.getChroma(2L, 0L) : this.rgb_c; + if (Raven.debug) { + for (final Entity entity : mc.theWorld.loadedEntityList) { + if (entity instanceof EntityLivingBase && entity != mc.thePlayer) { + if (teamColor.isToggled()) { + rgb = getColorFromTags(entity); + } + this.render(entity, rgb); + this.renderAsTwoD.put((EntityLivingBase) entity, rgb); + } + } + return; + } + for (EntityPlayer player : mc.theWorld.playerEntities) { + if (player != mc.thePlayer || (renderSelf.isToggled() && mc.gameSettings.thirdPersonView > 0)) { + if (player.deathTime != 0) { + continue; + } + if (!showInvis.isToggled() && player.isInvisible()) { + continue; + } + if (mc.thePlayer != player && AntiBot.isBot(player)) { + continue; + } + if (teamColor.isToggled()) { + rgb = getColorFromTags(player); + } + this.render(player, rgb); + this.renderAsTwoD.put(player, rgb); + } + } + } + } + + @SubscribeEvent(priority = EventPriority.LOWEST) + public void onRenderTwo2D(RenderWorldLastEvent e) { + if (!Utils.nullCheck() || !twoD.isToggled()) { + return; + } + for (Map.Entry entry : renderAsTwoD.entrySet()) { + this.renderTwoD(entry.getKey(), entry.getValue(), 0, e.partialTicks); + } + } + + private void render(Entity en, int rgb) { + if (box.isToggled()) { + RenderUtils.renderEntity(en, 1, 0, 0, rgb, redOnDamage.isToggled()); + } + + if (shaded.isToggled()) { + if (ModuleManager.murderMystery == null || !ModuleManager.murderMystery.isEnabled() || ModuleManager.murderMystery.isEmpty()) { + RenderUtils.renderEntity(en, 2, 0, 0, rgb, redOnDamage.isToggled()); + } + } + + if (healthBar.isToggled()) { + RenderUtils.renderEntity(en, 4, 0, 0, rgb, redOnDamage.isToggled()); + } + + if (ring.isToggled()) { + RenderUtils.renderEntity(en, 6, 0, 0, rgb, redOnDamage.isToggled()); + } + } + + public int getColorFromTags(Entity entity) { + if (entity instanceof EntityPlayer) { + ScorePlayerTeam scoreplayerteam = (ScorePlayerTeam)((EntityLivingBase) entity).getTeam(); + if (scoreplayerteam != null) { + String s = FontRenderer.getFormatFromString(scoreplayerteam.getColorPrefix()); + if (s.length() >= 2) { + return mc.getRenderManager().getFontRenderer().getColorCode(s.charAt(1)); + } + } + } + String displayName = entity.getDisplayName().getFormattedText(); + displayName = Utils.removeFormatCodes(displayName); + if (displayName.isEmpty() || !displayName.startsWith("§") || displayName.charAt(1) == 'f') { + return -1; + } + switch (displayName.charAt(1)) { + case '0': + return -16777216; + case '1': + return -16777046; + case '2': + return -16733696; + case '3': + return -16733526; + case '4': + return -5636096; + case '5': + return -5635926; + case '6': + return -22016; + case '7': + return -5592406; + case '8': + return -11184811; + case '9': + return -11184641; + case 'a': + return -11141291; + case 'b': + return -11141121; + case 'c': + return -43691; + case 'd': + return -43521; + case 'e': + return -171; + } + return -1; + } + + public void renderTwoD(EntityLivingBase en, int rgb, double expand, float partialTicks) { + if (!RenderUtils.isInViewFrustum(en)) { + return; + } + if (!Reflection.setupCameraTransform(mc.entityRenderer, partialTicks, 0)) { + return; + } + ScaledResolution scaledResolution = new ScaledResolution(mc); + + double playerX = en.lastTickPosX + (en.posX - en.lastTickPosX) * partialTicks - mc.getRenderManager().viewerPosX; + double playerY = en.lastTickPosY + (en.posY - en.lastTickPosY) * partialTicks - mc.getRenderManager().viewerPosY; + double playerZ = en.lastTickPosZ + (en.posZ - en.lastTickPosZ) * partialTicks - mc.getRenderManager().viewerPosZ; + + AxisAlignedBB bbox = en.getEntityBoundingBox().expand(0.1D + expand, 0.1D + expand, 0.1D + expand); + AxisAlignedBB axis = new AxisAlignedBB( + bbox.minX - en.posX + playerX, + bbox.minY - en.posY + playerY, + bbox.minZ - en.posZ + playerZ, + bbox.maxX - en.posX + playerX, + bbox.maxY - en.posY + playerY, + bbox.maxZ - en.posZ + playerZ + ); + + Vec3[] corners = new Vec3[8]; + corners[0] = new Vec3(axis.minX, axis.minY, axis.minZ); + corners[1] = new Vec3(axis.minX, axis.minY, axis.maxZ); + corners[2] = new Vec3(axis.minX, axis.maxY, axis.minZ); + corners[3] = new Vec3(axis.minX, axis.maxY, axis.maxZ); + corners[4] = new Vec3(axis.maxX, axis.minY, axis.minZ); + corners[5] = new Vec3(axis.maxX, axis.minY, axis.maxZ); + corners[6] = new Vec3(axis.maxX, axis.maxY, axis.minZ); + corners[7] = new Vec3(axis.maxX, axis.maxY, axis.maxZ); + + double minX = Double.MAX_VALUE; + double minY = Double.MAX_VALUE; + double maxX = Double.MIN_VALUE; + double maxY = Double.MIN_VALUE; + + boolean isInView = false; + + for (Vec3 corner : corners) { + double x = corner.xCoord; + double y = corner.yCoord; + double z = corner.zCoord; + + Vec3 screenVec = RenderUtils.convertTo2D(scaledResolution.getScaleFactor(), x, y, z); + if (screenVec != null) { + if (screenVec.zCoord >= 1.0003684 || screenVec.zCoord <= 0) { + continue; + } + + isInView = true; + + double screenX = screenVec.xCoord; + double screenY = screenVec.yCoord; + + if (screenX < minX) minX = screenX; + if (screenY < minY) minY = screenY; + if (screenX > maxX) maxX = screenX; + if (screenY > maxY) maxY = screenY; + } + } + + if (!isInView) { + return; + } + + mc.entityRenderer.setupOverlayRendering(); + + ScaledResolution res = new ScaledResolution(mc); + int screenWidth = res.getScaledWidth(); + int screenHeight = res.getScaledHeight(); + + minX = Math.max(0, minX); + minY = Math.max(0, minY); + maxX = Math.min(screenWidth, maxX); + maxY = Math.min(screenHeight, maxY); + + float red = ((rgb >> 16) & 0xFF) / 255.0F; + float green = ((rgb >> 8) & 0xFF) / 255.0F; + float blue = ( rgb & 0xFF) / 255.0F; + + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_LINE_SMOOTH); + GL11.glLineWidth(1.0F); + + // background outline + GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.4F); + GL11.glBegin(GL11.GL_LINE_LOOP); + GL11.glVertex2d(minX, minY); + GL11.glVertex2d(maxX, minY); + GL11.glVertex2d(maxX, maxY); + GL11.glVertex2d(minX, maxY); + GL11.glEnd(); + + // second background + GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.4F); + GL11.glBegin(GL11.GL_LINE_LOOP); + GL11.glVertex2d(minX + 1.0, minY + 1.0); + GL11.glVertex2d(maxX - 1.0, minY + 1.0); + GL11.glVertex2d(maxX - 1.0, maxY - 1.0); + GL11.glVertex2d(minX + 1.0, maxY - 1.0); + GL11.glEnd(); + + // main outline + GL11.glColor4f(red, green, blue, 1.0f); + GL11.glBegin(GL11.GL_LINE_LOOP); + GL11.glVertex2d(minX + 0.5, minY + 0.5); + GL11.glVertex2d(maxX - 0.5, minY + 0.5); + GL11.glVertex2d(maxX - 0.5, maxY - 0.5); + GL11.glVertex2d(minX + 0.5, maxY - 0.5); + GL11.glEnd(); + + GL11.glColor4f(1, 1, 1, 1); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_LINE_SMOOTH); + GL11.glPopMatrix(); + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/module/impl/render/Potions.java b/src/main/java/keystrokesmod/module/impl/render/Potions.java new file mode 100644 index 0000000..edb6132 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/render/Potions.java @@ -0,0 +1,16 @@ +package keystrokesmod.module.impl.render; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; + +public class Potions extends Module { + public ButtonSetting removeBlindness; + public ButtonSetting removeNausea; + + public Potions() { + super("Potions", category.render); + this.registerSetting(removeBlindness = new ButtonSetting("Remove blindness", true)); + this.registerSetting(removeNausea = new ButtonSetting("Remove nausea", true)); + } + +} diff --git a/src/main/java/keystrokesmod/module/impl/render/Radar.java b/src/main/java/keystrokesmod/module/impl/render/Radar.java new file mode 100644 index 0000000..999b226 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/render/Radar.java @@ -0,0 +1,96 @@ +package keystrokesmod.module.impl.render; + +import keystrokesmod.clickgui.ClickGui; +import keystrokesmod.module.Module; +import keystrokesmod.module.impl.world.AntiBot; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import org.lwjgl.opengl.GL11; + +import java.awt.*; + +public class Radar extends Module { + private ButtonSetting tracerLines; + private int scale = 2; + private int rectColor = new Color(0, 0, 0, 125).getRGB(); + public Radar() { + super("Radar", category.render); + this.registerSetting(tracerLines = new ButtonSetting("Show tracer lines", false)); + } + + public void onUpdate() { + this.scale = new ScaledResolution(mc).getScaleFactor(); + } + + @SubscribeEvent + public void onRenderTick(TickEvent.RenderTickEvent e) { + if (e.phase != TickEvent.Phase.END || !Utils.nullCheck()) { + return; + } + if (mc.currentScreen instanceof ClickGui) { + return; + } + if (mc.currentScreen != null || mc.gameSettings.showDebugInfo) { + return; + } + final int n = 5; + final int n2 = 70; + final int n3 = n + 100; + final int n4 = n2 + 100; + Gui.drawRect(n, n2, n3, n4, rectColor); + Gui.drawRect(n - 1, n2 - 1, n3 + 1, n2, -1); + Gui.drawRect(n - 1, n4, n3 + 1, n4 + 1, -1); + Gui.drawRect(n - 1, n2, n, n4, -1); + Gui.drawRect(n3, n2, n3 + 1, n4, -1); + RenderUtils.drawPolygon((double)(n3 / 2 + 3), (double)(n2 + 52), 5.0, 3, -1); + GL11.glPushMatrix(); + GL11.glEnable(3089); + GL11.glScissor(n * this.scale, mc.displayHeight - this.scale * 170, n3 * this.scale - this.scale * 5, this.scale * 100); + for (final EntityPlayer entityPlayer : mc.theWorld.playerEntities) { + if (entityPlayer != mc.thePlayer && entityPlayer.deathTime == 0) { + if (AntiBot.isBot(entityPlayer)) { + continue; + } + final double getDistanceSqToEntity = entityPlayer.getDistanceSqToEntity(mc.thePlayer); + if (getDistanceSqToEntity > 360.0) { + continue; + } + final double n5 = (mc.thePlayer.rotationYaw + Math.atan2(entityPlayer.posX - mc.thePlayer.posX, entityPlayer.posZ - mc.thePlayer.posZ) * 57.295780181884766) % 360.0; + final double n6 = getDistanceSqToEntity / 5.0; + final double n7 = n6 * Math.sin(Math.toRadians(n5)); + final double n8 = n6 * Math.cos(Math.toRadians(n5)); + if (tracerLines.isToggled()) { + GL11.glPushMatrix(); + GL11.glEnable(3042); + GL11.glEnable(2848); + GL11.glDisable(2929); + GL11.glDisable(3553); + GL11.glBlendFunc(770, 771); + GL11.glEnable(3042); + GL11.glLineWidth(0.5f); + GL11.glColor3d(1.0, 1.0, 1.0); + GL11.glBegin(2); + GL11.glVertex2d((double)(n3 / 2 + 3), (double)(n2 + 52)); + GL11.glVertex2d((double)(n3 / 2 + 3) - n7, (double)(n2 + 52) - n8); + GL11.glEnd(); + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glDisable(3042); + GL11.glEnable(3553); + GL11.glEnable(2929); + GL11.glDisable(2848); + GL11.glDisable(3042); + GL11.glPopMatrix(); + } + RenderUtils.drawPolygon((double)(n3 / 2 + 3) - n7, (double)(n2 + 52) - n8, 3.0, 4, Color.red.getRGB()); + } + } + GL11.glDisable(3089); + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/keystrokesmod/module/impl/render/Shaders.java b/src/main/java/keystrokesmod/module/impl/render/Shaders.java new file mode 100644 index 0000000..d884f32 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/render/Shaders.java @@ -0,0 +1,77 @@ +package keystrokesmod.module.impl.render; + +import keystrokesmod.event.ReceivePacketEvent; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Reflection; +import keystrokesmod.utility.Utils; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class Shaders extends Module { + private SliderSetting shader; + private String[] shaderNames; + private ResourceLocation[] shaderLocations; + private boolean resetShader; + + public Shaders() { + super("Shaders", category.render); + try { + shaderLocations = (ResourceLocation[]) Reflection.shaderResourceLocations.get(mc.entityRenderer); + shaderNames = new String[shaderLocations.length]; + for (int i = 0; i < shaderLocations.length; ++i) { + shaderNames[i] = ((String[]) shaderLocations[i].getResourcePath().replaceFirst("shaders/post/", "").split("\\.json"))[0].toUpperCase(); + } + } + catch (Exception ex) { + ex.printStackTrace(); + return; + } + this.registerSetting(shader = new SliderSetting("Shader", 0, shaderNames)); + } + + public void onUpdate() { + if (resetShader) { + mc.entityRenderer.stopUseShader(); + //Utils.print("Reset shader"); + resetShader = false; + } + if (!Utils.nullCheck() || mc.entityRenderer == null || shaderLocations == null) { + return; + } + try { + if (Reflection.shaderIndex.getInt(mc.entityRenderer) != (int) shader.getInput()) { + Reflection.shaderIndex.setInt(mc.entityRenderer, (int) shader.getInput()); + Reflection.loadShader.invoke(mc.entityRenderer, shaderLocations[(int) shader.getInput()]); + } + else if (!Reflection.useShader.getBoolean(mc.entityRenderer)) { + Reflection.useShader.setBoolean(mc.entityRenderer, true); + } + } + catch (Exception ex) { + ex.printStackTrace(); + Utils.sendMessage("&cError loading shader."); + this.disable(); + } + } + + @SubscribeEvent + public void onReceivePacket(ReceivePacketEvent e) { + if (e.getPacket() instanceof S08PacketPlayerPosLook && mc.thePlayer != null) { + resetShader = true; + } + } + + public void onDisable() { + mc.entityRenderer.stopUseShader(); + } + + public void onEnable() { + if (!OpenGlHelper.shadersSupported) { + Utils.sendMessage("&cShaders not supported."); + this.disable(); + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/render/TargetHUD.java b/src/main/java/keystrokesmod/module/impl/render/TargetHUD.java new file mode 100644 index 0000000..54f6bf5 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/render/TargetHUD.java @@ -0,0 +1,302 @@ +package keystrokesmod.module.impl.render; + +import keystrokesmod.module.Module; +import keystrokesmod.module.impl.combat.KillAura; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Theme; +import keystrokesmod.utility.Timer; +import keystrokesmod.utility.Utils; +import keystrokesmod.utility.shader.BlurUtils; +import keystrokesmod.utility.shader.RoundedUtils; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.entity.EntityLivingBase; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.client.config.GuiButtonExt; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.io.IOException; + +public class TargetHUD extends Module { + private SliderSetting mode; + private SliderSetting theme; + private ButtonSetting renderEsp; + private ButtonSetting showStatus; + private ButtonSetting healthColor; + private Timer fadeTimer; + private Timer healthBarTimer = null; + private EntityLivingBase target; + private long lastAliveMS; + private double lastHealth; + private float lastHealthBar; + public EntityLivingBase renderEntity; + public int posX = 70; + public int posY = 30; + private String[] modes = new String[]{ "Modern", "Legacy" }; + + public TargetHUD() { + super("TargetHUD", category.render); + this.registerSetting(new DescriptionSetting("Only works with KillAura.")); + this.registerSetting(mode = new SliderSetting("Mode", 1, modes)); + this.registerSetting(theme = new SliderSetting("Theme", 0, Theme.themes)); + this.registerSetting(new ButtonSetting("Edit position", () -> { + mc.displayGuiScreen(new EditScreen()); + })); + this.registerSetting(renderEsp = new ButtonSetting("Render ESP", true)); + this.registerSetting(showStatus = new ButtonSetting("Show win or loss", true)); + this.registerSetting(healthColor = new ButtonSetting("Traditional health color", false)); + } + + public void onDisable() { + reset(); + } + + @SubscribeEvent + public void onRenderTick(TickEvent.RenderTickEvent ev) { + if (!Utils.nullCheck()) { + reset(); + return; + } + if (ev.phase == TickEvent.Phase.END) { + if (mc.currentScreen != null) { + reset(); + return; + } + if (KillAura.attackingEntity != null) { + target = KillAura.attackingEntity; + lastAliveMS = System.currentTimeMillis(); + fadeTimer = null; + } else if (target != null) { + if (System.currentTimeMillis() - lastAliveMS >= 400 && fadeTimer == null) { + (fadeTimer = new Timer(400)).start(); + } + } + else { + return; + } + String playerInfo = target.getDisplayName().getFormattedText(); + double health = target.getHealth() / target.getMaxHealth(); + if (target.isDead) { + health = 0; + } + if (health != lastHealth) { + (healthBarTimer = new Timer(mode.getInput() == 0 ? 500 : 350)).start(); + } + lastHealth = health; + playerInfo += " " + Utils.getHealthStr(target, true); + drawTargetHUD(fadeTimer, playerInfo, health); + } + } + + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onRenderWorld(RenderWorldLastEvent renderWorldLastEvent) { + if (!renderEsp.isToggled() || !Utils.nullCheck()) { + return; + } + if (KillAura.target != null) { + RenderUtils.renderEntity(KillAura.target, 2, 0.0, 0.0, Theme.getGradient((int) theme.getInput(), 0), false); + } + else if (renderEntity != null) { + RenderUtils.renderEntity(renderEntity, 2, 0.0, 0.0, Theme.getGradient((int) theme.getInput(), 0), false); + } + } + + private void drawTargetHUD(Timer cd, String string, double health) { + if (showStatus.isToggled()) { + string = string + " " + ((health <= Utils.getCompleteHealth(mc.thePlayer) / mc.thePlayer.getMaxHealth()) ? "§aW" : "§cL"); + } + final ScaledResolution scaledResolution = new ScaledResolution(mc); + final int padding = 8; + final int targetStrWithPadding = mc.fontRendererObj.getStringWidth(string) + padding; + final int x = (scaledResolution.getScaledWidth() / 2 - targetStrWithPadding / 2) + posX; + final int y = (scaledResolution.getScaledHeight() / 2 + 15) + posY; + final int n6 = x - padding; + final int n7 = y - padding; + final int n8 = x + targetStrWithPadding; + final int n9 = y + (mc.fontRendererObj.FONT_HEIGHT + 5) - 6 + padding; + final int n10 = (cd == null) ? 255 : (255 - cd.getValueInt(0, 255, 1)); + if (n10 > 0) { + final int maxAlphaOutline = (n10 > 110) ? 110 : n10; + final int maxAlphaBackground = (n10 > 210) ? 210 : n10; + final int[] gradientColors = Theme.getGradients((int) theme.getInput()); + switch ((int) mode.getInput()) { + case 0: + BlurUtils.prepareBloom(); + RoundedUtils.drawRound((float) n6, (float) n7, Math.abs((float) n6 - n8), Math.abs((float) n7 - (n9 + 13)), 8.0f, true, new Color(0, 0, 0, maxAlphaBackground)); + BlurUtils.bloomEnd(2, 3); + BlurUtils.prepareBlur(); + RoundedUtils.drawRound((float) n6, (float) n7, Math.abs((float) n6 - n8), Math.abs((float) n7 - (n9 + 13)), 8.0f, true, Color.black); + BlurUtils.blurEnd(1, 2.5f); + break; + case 1: + RenderUtils.drawRoundedGradientOutlinedRectangle((float) n6, (float) n7, (float) n8, (float) (n9 + 13), 10.0f, Utils.mergeAlpha(Color.black.getRGB(), maxAlphaOutline), Utils.mergeAlpha(gradientColors[0], n10), Utils.mergeAlpha(gradientColors[1], n10)); + break; + } + final int n13 = n6 + 6; + final int n14 = n8 - 6; + final int n15 = n9; + + // Bar background + RenderUtils.drawRoundedRectangle((float) n13, (float) n15, (float) n14, (float) (n15 + 5), 4.0f, Utils.mergeAlpha(Color.black.getRGB(), maxAlphaOutline)); + int mergedGradientLeft = Utils.mergeAlpha(gradientColors[0], maxAlphaBackground); + int mergedGradientRight = Utils.mergeAlpha(gradientColors[1], maxAlphaBackground); + float healthBar = (float) (int) (n14 + (n13 - n14) * (1 - health)); + boolean smoothBack = false; + if (healthBar != lastHealthBar && lastHealthBar - n13 >= 3 && healthBarTimer != null ) { + int type = mode.getInput() == 0 ? 4 : 1; + float diff = lastHealthBar - healthBar; + if (diff > 0) { + lastHealthBar = lastHealthBar - healthBarTimer.getValueFloat(0, diff, type); + } + else { + smoothBack = true; + lastHealthBar = healthBarTimer.getValueFloat(lastHealthBar, healthBar, type); + } + } + else { + lastHealthBar = healthBar; + } + if (healthColor.isToggled()) { + mergedGradientLeft = mergedGradientRight = Utils.mergeAlpha(Utils.getColorForHealth(health), maxAlphaBackground); + } + if (lastHealthBar > n14) { // exceeds total width then clamp + lastHealthBar = n14; + } + + switch ((int) mode.getInput()) { // health bar + case 0: + RenderUtils.drawRoundedRectangle((float) n13, (float) n15, lastHealthBar, (float) (n15 + 5), 4.0f, Utils.darkenColor(mergedGradientRight, 25)); + RenderUtils.drawRoundedGradientRect((float) n13, (float) n15, smoothBack ? lastHealthBar : healthBar, (float) (n15 + 5), 4.0f, mergedGradientLeft, mergedGradientLeft, mergedGradientRight, mergedGradientRight); + break; + case 1: + RenderUtils.drawRoundedGradientRect((float) n13, (float) n15, lastHealthBar, (float) (n15 + 5), 4.0f, mergedGradientLeft, mergedGradientLeft, mergedGradientRight, mergedGradientRight); + break; + } + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_BLEND); + mc.fontRendererObj.drawString(string, (float) x, (float) y, (new Color(220, 220, 220, 255).getRGB() & 0xFFFFFF) | Utils.clamp(n10 + 15) << 24, true); + GL11.glDisable(GL11.GL_BLEND); + GL11.glPopMatrix(); + } + else { + target = null; + healthBarTimer = null; + } + } + + private void reset() { + fadeTimer = null; + target = null; + healthBarTimer = null; + renderEntity = null; + } + + class EditScreen extends GuiScreen { + GuiButtonExt resetPosition; + boolean d = false; + int miX = 0; + int miY = 0; + int maX = 0; + int maY = 0; + int aX = 70; + int aY = 30; + int laX = 0; + int laY = 0; + int lmX = 0; + int lmY = 0; + int clickMinX = 0; + + public void initGui() { + super.initGui(); + this.buttonList.add(this.resetPosition = new GuiButtonExt(1, this.width - 90, this.height - 25, 85, 20, "Reset position")); + this.aX = posX; + this.aY = posY; + } + + public void drawScreen(int mX, int mY, float pt) { + ScaledResolution res = new ScaledResolution(this.mc); + drawRect(0, 0, this.width, this.height, -1308622848); + int miX = this.aX; + int miY = this.aY; + String playerInfo = mc.thePlayer.getDisplayName().getFormattedText(); + double health = mc.thePlayer.getHealth() / mc.thePlayer.getMaxHealth(); + if (mc.thePlayer.isDead) { + health = 0; + } + lastHealth = health; + playerInfo += " " + Utils.getHealthStr(mc.thePlayer, true); + drawTargetHUD(null, playerInfo, health); + if (showStatus.isToggled()) { + playerInfo = playerInfo + " " + ((health <= Utils.getCompleteHealth(mc.thePlayer) / mc.thePlayer.getMaxHealth()) ? "§aW" : "§cL"); + } + int stringWidth = mc.fontRendererObj.getStringWidth(playerInfo) + 8; + int maX = (res.getScaledWidth() / 2 - stringWidth / 2) + miX + mc.fontRendererObj.getStringWidth(playerInfo) + 8; + int maY = (res.getScaledHeight() / 2 + 15) + miY + (mc.fontRendererObj.FONT_HEIGHT + 5) - 6 + 8; + this.miX = miX; + this.miY = miY; + this.maX = maX; + this.maY = maY; + this.clickMinX = miX; + posX = miX; + posY = miY; + String edit = "Edit the HUD position by dragging."; + int x = res.getScaledWidth() / 2 - fontRendererObj.getStringWidth(edit) / 2; + int y = res.getScaledHeight() / 2 - 20; + RenderUtils.drawColoredString(edit, '-', x, y, 2L, 0L, true, this.mc.fontRendererObj); + + try { + this.handleInput(); + } + catch (IOException var12) { + } + + super.drawScreen(mX, mY, pt); + } + + protected void mouseClickMove(int mX, int mY, int b, long t) { + super.mouseClickMove(mX, mY, b, t); + if (b == 0) { + if (this.d) { + this.aX = this.laX + (mX - this.lmX); + this.aY = this.laY + (mY - this.lmY); + } + else if (mX > this.clickMinX && mX < this.maX && mY > this.miY && mY < this.maY) { + this.d = true; + this.lmX = mX; + this.lmY = mY; + this.laX = this.aX; + this.laY = this.aY; + } + + } + } + + protected void mouseReleased(int mX, int mY, int s) { + super.mouseReleased(mX, mY, s); + if (s == 0) { + this.d = false; + } + + } + + public void actionPerformed(GuiButton b) { + if (b == this.resetPosition) { + this.aX = posX = 70; + this.aY = posY = 30; + } + + } + + public boolean doesGuiPauseGame() { + return false; + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/render/Tracers.java b/src/main/java/keystrokesmod/module/impl/render/Tracers.java new file mode 100644 index 0000000..79ba674 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/render/Tracers.java @@ -0,0 +1,99 @@ +package keystrokesmod.module.impl.render; + +import keystrokesmod.Raven; +import keystrokesmod.module.Module; +import keystrokesmod.module.impl.world.AntiBot; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.awt.*; +import java.util.Iterator; + +public class Tracers extends Module { + public ButtonSetting a; + public SliderSetting b; + public SliderSetting c; + public SliderSetting d; + public ButtonSetting e; + public SliderSetting f; + private boolean g; + private int rgb_c = 0; + + public Tracers() { + super("Tracers", category.render, 0); + this.registerSetting(a = new ButtonSetting("Show invis", true)); + this.registerSetting(f = new SliderSetting("Line Width", 1.0D, 1.0D, 5.0D, 1.0D)); + this.registerSetting(b = new SliderSetting("Red", 0.0D, 0.0D, 255.0D, 1.0D)); + this.registerSetting(c = new SliderSetting("Green", 255.0D, 0.0D, 255.0D, 1.0D)); + this.registerSetting(d = new SliderSetting("Blue", 0.0D, 0.0D, 255.0D, 1.0D)); + this.registerSetting(e = new ButtonSetting("Rainbow", false)); + } + + public void onEnable() { + this.g = mc.gameSettings.viewBobbing; + if (this.g) { + mc.gameSettings.viewBobbing = false; + } + } + + public void onDisable() { + mc.gameSettings.viewBobbing = this.g; + } + + public void onUpdate() { + if (mc.gameSettings.viewBobbing) { + mc.gameSettings.viewBobbing = false; + } + } + + public void guiUpdate() { + this.rgb_c = (new Color((int) b.getInput(), (int) c.getInput(), (int) d.getInput())).getRGB(); + } + + @SubscribeEvent + public void o(RenderWorldLastEvent ev) { + if (Utils.nullCheck()) { + int rgb = e.isToggled() ? Utils.getChroma(2L, 0L) : this.rgb_c; + Iterator var3; + if (Raven.debug) { + var3 = mc.theWorld.loadedEntityList.iterator(); + + while (var3.hasNext()) { + Entity en = (Entity) var3.next(); + if (en instanceof EntityLivingBase && en != mc.thePlayer) { + RenderUtils.drawTracerLine(en, rgb, (float) f.getInput(), Utils.getTimer().renderPartialTicks); + } + } + + } else { + var3 = mc.theWorld.playerEntities.iterator(); + + while (true) { + EntityPlayer en; + do { + do { + do { + if (!var3.hasNext()) { + return; + } + + en = (EntityPlayer) var3.next(); + } while (en == mc.thePlayer); + } while (en.deathTime != 0); + } while (!a.isToggled() && en.isInvisible()); + + if (!AntiBot.isBot(en)) { + RenderUtils.drawTracerLine(en, rgb, (float) f.getInput(), Utils.getTimer().renderPartialTicks); + } + } + } + } + } +} diff --git a/src/main/java/keystrokesmod/module/impl/render/Trajectories.java b/src/main/java/keystrokesmod/module/impl/render/Trajectories.java new file mode 100644 index 0000000..e6beef4 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/render/Trajectories.java @@ -0,0 +1,220 @@ +package keystrokesmod.module.impl.render; + +import keystrokesmod.module.Module; +import keystrokesmod.module.impl.world.AntiBot; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.*; +import net.minecraft.util.*; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.opengl.GL11; + +import java.awt.*; + +public class Trajectories extends Module { + private ButtonSetting autoScale; + private ButtonSetting disableUncharged; + private ButtonSetting highlightOnEntity; + private int highlightColor = new Color(234, 38, 38).getRGB(); + private int topColor = new Color(46, 255, 22).getRGB(); + public Trajectories() { + super("Trajectories", category.render); + this.registerSetting(autoScale = new ButtonSetting("Auto-scale", true)); + this.registerSetting(disableUncharged = new ButtonSetting("Disable uncharged bow", true)); + this.registerSetting(highlightOnEntity = new ButtonSetting("Highlight on entity", true)); + } + + @SubscribeEvent + public void onRenderWorldLast(RenderWorldLastEvent e) { + if (!Utils.nullCheck() || mc.thePlayer.getHeldItem() == null) { + return; + } + ItemStack heldItem = mc.thePlayer.getHeldItem(); + if (!(heldItem.getItem() instanceof ItemBow) && !(heldItem.getItem() instanceof ItemSnowball) && !(heldItem.getItem() instanceof ItemEgg) && !(heldItem.getItem() instanceof ItemEnderPearl)) { + return; + } + if (heldItem.getItem() instanceof ItemBow && !mc.thePlayer.isUsingItem() && disableUncharged.isToggled()) { + return; + } + boolean bow = heldItem.getItem() instanceof ItemBow; + + float playerYaw = mc.thePlayer.rotationYaw; + float playerPitch = mc.thePlayer.rotationPitch; + + double posX = mc.getRenderManager().viewerPosX - (double)(MathHelper.cos(playerYaw / 180.0f * (float)Math.PI) * 0.16f); + double posY = mc.getRenderManager().viewerPosY + (double)mc.thePlayer.getEyeHeight() - (double)0.1f; + double posZ = mc.getRenderManager().viewerPosZ - (double)(MathHelper.sin(playerYaw / 180.0f * (float)Math.PI) * 0.16f); + + double motionX = (double)(-MathHelper.sin(playerYaw / 180.0f * (float)Math.PI) * MathHelper.cos(playerPitch / 180.0f * (float)Math.PI)) * (bow ? 1.0 : 0.4); + double motionY = (double)(-MathHelper.sin(playerPitch / 180.0f * (float)Math.PI)) * (bow ? 1.0 : 0.4); + double motionZ = (double)(MathHelper.cos(playerYaw / 180.0f * (float)Math.PI) * MathHelper.cos(playerPitch / 180.0f * (float)Math.PI)) * (bow ? 1.0 : 0.4); + + int itemInUse = 40; + if (mc.thePlayer.getItemInUseCount() > 0 && bow) { + itemInUse = mc.thePlayer.getItemInUseCount(); + } + int timeInUse = 72000 - itemInUse; + float strength = (float)timeInUse / 20.0f; + if ((double)(strength = (strength * strength + strength * 2.0f) / 3.0f) < 0.1) { + return; + } + if (strength > 1.0f) { + strength = 1.0f; + } + + RenderUtils.glColor(-1); + GL11.glPushMatrix(); + + boolean depthTest = GL11.glIsEnabled(GL11.GL_DEPTH_TEST); + boolean textureTwoD = GL11.glIsEnabled(GL11.GL_TEXTURE_2D); + boolean blend = GL11.glIsEnabled(GL11.GL_BLEND); + + if (depthTest) { + GL11.glDisable(GL11.GL_DEPTH_TEST); + } + if (textureTwoD) { + GL11.glDisable(GL11.GL_TEXTURE_2D); + } + if (!blend) { + GL11.glEnable(GL11.GL_BLEND); + } + GL11.glEnable(GL11.GL_LINE_SMOOTH); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + + float velocity = MathHelper.sqrt_double(motionX * motionX + motionY * motionY + motionZ * motionZ); + motionX /= velocity; + motionY /= velocity; + motionZ /= velocity; + motionX *= (double)(bow ? strength * 2.0f : 1.0f) * 1.5; + motionY *= (double)(bow ? strength * 2.0f : 1.0f) * 1.5; + motionZ *= (double)(bow ? strength * 2.0f : 1.0f) * 1.5; + + GL11.glLineWidth(1.5f); + GL11.glBegin(GL11.GL_LINE_STRIP); + + boolean ground = false; + MovingObjectPosition target = null; + boolean highlight = false; + boolean isTop = false; + double[] transform = new double[]{posX, posY, posZ, motionX, motionY, motionZ}; + + for (int k = 0; k <= 100 && !ground; ++k) { + Vec3 start = new Vec3(transform[0], transform[1], transform[2]); + Vec3 predicted = new Vec3(transform[0] + transform[3], transform[1] + transform[4], transform[2] + transform[5]); + MovingObjectPosition rayTraced = mc.theWorld.rayTraceBlocks(start, predicted, false, true, false); + if (rayTraced == null) { + rayTraced = getEntityHit(start, predicted); + if (rayTraced != null) { + highlight = true; + break; + } + + float f14 = 0.99f; + transform[4] *= f14; + transform[0] += (transform[3] *= f14); + transform[1] += (transform[4] -= bow ? 0.05 : 0.03); + transform[2] += (transform[5] *= f14); + } + else if (rayTraced.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && rayTraced.sideHit == EnumFacing.UP) { + isTop = true; + } + } + + for (int k = 0; k <= 100 && !ground; ++k) { + Vec3 start = new Vec3(posX, posY, posZ); + Vec3 predicted = new Vec3(posX + motionX, posY + motionY, posZ + motionZ); + MovingObjectPosition rayTraced = mc.theWorld.rayTraceBlocks(start, predicted, false, true, false); + if (rayTraced != null) { + ground = true; + target = rayTraced; + } + else { + MovingObjectPosition entityHit = getEntityHit(start, predicted); + if (entityHit != null) { + target = entityHit; + ground = true; + } + } + + if (highlight && highlightOnEntity.isToggled()) { + RenderUtils.glColor(highlightColor); + } + else if (isTop) { + RenderUtils.glColor(topColor); + } + + float airResistance = 0.99f; + motionY *= airResistance; + GL11.glVertex3d((posX += (motionX *= airResistance)) - mc.getRenderManager().viewerPosX, (posY += (motionY -= bow ? 0.05 : 0.03)) - mc.getRenderManager().viewerPosY, (posZ += (motionZ *= airResistance)) - mc.getRenderManager().viewerPosZ); + } + GL11.glEnd(); + + GL11.glTranslated(posX - mc.getRenderManager().viewerPosX, posY - mc.getRenderManager().viewerPosY, posZ - mc.getRenderManager().viewerPosZ); + if (target != null && target.sideHit != null) { + switch (target.sideHit.getIndex()) { + case 2: + case 3: + GL11.glRotatef(90.0f, 1.0f, 0.0f, 0.0f); + break; + case 4: + case 5: + GL11.glRotatef(90.0f, 0.0f, 0.0f, 1.0f); + break; + } + } + if (autoScale.isToggled()) { + double distance = Math.max(mc.thePlayer.getDistance(posX + motionX, posY + motionY, posZ + motionZ) * 0.042830285, 1); + GL11.glScaled(distance, distance, distance); + } + this.drawX(); + + GL11.glDisable(GL11.GL_LINE_SMOOTH); + if (depthTest) { + GL11.glEnable(GL11.GL_DEPTH_TEST); + } + if (textureTwoD) { + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + if (!blend) { + GL11.glDisable(GL11.GL_BLEND); + } + GL11.glPopMatrix(); + } + + public MovingObjectPosition getEntityHit(Vec3 origin, Vec3 destination) { + for (Entity e : mc.theWorld.loadedEntityList) { + if (!(e instanceof EntityLivingBase)) { + continue; + } + if (e instanceof EntityPlayer && AntiBot.isBot(e)) { + continue; + } + if (e != mc.thePlayer) { + float expand = 0.3f; + AxisAlignedBB boundingBox = e.getEntityBoundingBox().expand(expand, expand, expand); + MovingObjectPosition possibleHit = boundingBox.calculateIntercept(origin, destination); + if (possibleHit != null) { + return possibleHit; + } + } + } + return null; + } + + public void drawX() { + GL11.glPushMatrix(); + GL11.glScalef(0.95f, 0.95f, 0.95f); + GL11.glBegin(GL11.GL_LINES); + GL11.glVertex3d(-0.25, 0.0, 0.25); + GL11.glVertex3d(0.25, 0.0, -0.25); + GL11.glVertex3d(-0.25, 0.0, -0.25); + GL11.glVertex3d(0.25, 0.0, 0.25); + GL11.glEnd(); + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/keystrokesmod/module/impl/render/Xray.java b/src/main/java/keystrokesmod/module/impl/render/Xray.java new file mode 100644 index 0000000..dd46c2d --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/render/Xray.java @@ -0,0 +1,167 @@ +package keystrokesmod.module.impl.render; + +import keystrokesmod.Raven; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.BlockUtils; +import keystrokesmod.utility.RenderUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.awt.*; +import java.util.Iterator; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +public class Xray extends Module { + private SliderSetting range; + private SliderSetting rate; + private ButtonSetting iron; + private ButtonSetting gold; + private ButtonSetting diamond; + private ButtonSetting emerald; + private ButtonSetting lapis; + private ButtonSetting redstone; + private ButtonSetting coal; + private ButtonSetting spawner; + private ButtonSetting obsidian; + private Set blocks = ConcurrentHashMap.newKeySet(); + private long lastCheck = 0; + + public Xray() { + super("Xray", category.render); + this.registerSetting(range = new SliderSetting("Range", 20, 5, 50, 1)); + this.registerSetting(rate = new SliderSetting("Rate", " second", 0.5, 0.1, 3.0, 0.1)); + this.registerSetting(coal = new ButtonSetting("Coal", true)); + this.registerSetting(diamond = new ButtonSetting("Diamond", true)); + this.registerSetting(emerald = new ButtonSetting("Emerald", true)); + this.registerSetting(gold = new ButtonSetting("Gold", true)); + this.registerSetting(iron = new ButtonSetting("Iron", true)); + this.registerSetting(lapis = new ButtonSetting("Lapis", true)); + this.registerSetting(obsidian = new ButtonSetting("Obsidian", true)); + this.registerSetting(redstone = new ButtonSetting("Redstone", true)); + this.registerSetting(spawner = new ButtonSetting("Spawner", true)); + } + + public void onDisable() { + this.blocks.clear(); + } + + public void onUpdate() { + if (System.currentTimeMillis() - lastCheck < rate.getInput() * 1000) { + return; + } + lastCheck = System.currentTimeMillis(); + Raven.getExecutor().execute(() -> { + synchronized (blocks) { + int i; + for (int n = i = (int) range.getInput(); i >= -n; --i) { + for (int j = -n; j <= n; ++j) { + for (int k = -n; k <= n; ++k) { + BlockPos blockPos = new BlockPos(mc.thePlayer.posX + j, mc.thePlayer.posY + i, mc.thePlayer.posZ + k); + if (blocks.contains(blockPos)) { + continue; + } + Block blockState = BlockUtils.getBlock(blockPos); + if (blockState != null && canBreak(blockState)) { + blocks.add(blockPos); + } + } + } + } + } + }); + } + + @SubscribeEvent + public void onEntityJoin(EntityJoinWorldEvent e) { + if (e.entity == mc.thePlayer) { + this.blocks.clear(); + } + } + + @SubscribeEvent + public void onRenderWorld(RenderWorldLastEvent ev) { + if (!Utils.nullCheck()) { + return; + } + synchronized (blocks) { + if (!this.blocks.isEmpty()) { + Iterator iterator = blocks.iterator(); + while (iterator.hasNext()) { + BlockPos blockPos = iterator.next(); + Block block = BlockUtils.getBlock(blockPos); + if (block == null || !canBreak(block)) { + iterator.remove(); + continue; + } + this.drawBox(blockPos); + } + } + } + } + + private void drawBox(BlockPos p) { + if (p == null) { + return; + } + int[] rgb = this.getColor(BlockUtils.getBlock(p)); + if (rgb[0] + rgb[1] + rgb[2] != 0) { + RenderUtils.renderBlock(p, (new Color(rgb[0], rgb[1], rgb[2])).getRGB(), false, true); + } + } + + private int[] getColor(Block b) { + int red = 0; + int green = 0; + int blue = 0; + if (b.equals(Blocks.iron_ore)) { + red = 255; + green = 255; + blue = 255; + } + else if (b.equals(Blocks.gold_ore)) { + red = 255; + green = 255; + } + else if (b.equals(Blocks.diamond_ore)) { + green = 220; + blue = 255; + } + else if (b.equals(Blocks.emerald_ore)) { + red = 35; + green = 255; + } + else if (b.equals(Blocks.lapis_ore)) { + green = 50; + blue = 255; + } + else if (b.equals(Blocks.redstone_ore)) { + red = 255; + } + else if (b.equals(Blocks.mob_spawner)) { + red = 30; + blue = 135; + } + + return new int[]{red, green, blue}; + } + + public boolean canBreak(Block block) { + return (iron.isToggled() && block.equals(Blocks.iron_ore)) || + (gold.isToggled() && block.equals(Blocks.gold_ore)) || + (diamond.isToggled() && block.equals(Blocks.diamond_ore)) || + (emerald.isToggled() && block.equals(Blocks.emerald_ore)) || + (lapis.isToggled() && block.equals(Blocks.lapis_ore)) || + (redstone.isToggled() && block.equals(Blocks.redstone_ore)) || + (coal.isToggled() && block.equals(Blocks.coal_ore)) || + (spawner.isToggled() && block.equals(Blocks.mob_spawner)) || + (obsidian.isToggled() && block.equals(Blocks.obsidian)); + } +} diff --git a/src/main/java/keystrokesmod/module/impl/world/AntiBot.java b/src/main/java/keystrokesmod/module/impl/world/AntiBot.java new file mode 100644 index 0000000..8dad699 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/world/AntiBot.java @@ -0,0 +1,126 @@ +package keystrokesmod.module.impl.world; + +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.player.Freecam; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.utility.Utils; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +public class AntiBot extends Module { + private static final HashMap entities = new HashMap(); + private static SliderSetting delay; + private static SliderSetting pitSpawn; + private static ButtonSetting tablist; + private ButtonSetting printWorldJoin; + + public AntiBot() { + super("AntiBot", Module.category.world, 0); + this.registerSetting(delay = new SliderSetting("Delay", " second", true, -1, 0.5, 15.0, 0.5)); + this.registerSetting(pitSpawn = new SliderSetting("Pit spawn", true, -1, 70, 120, 1)); + this.registerSetting(tablist = new ButtonSetting("Tab list", false)); + this.registerSetting(printWorldJoin = new ButtonSetting("Print world join", false)); + this.closetModule = true; + } + + @SubscribeEvent + public void c(final EntityJoinWorldEvent e) { + if (e.entity instanceof EntityPlayer && e.entity != mc.thePlayer) { + if (delay.getInput() != -1) { + entities.put((EntityPlayer) e.entity, System.currentTimeMillis()); + } + if (printWorldJoin.isToggled()) { + Utils.sendMessage("&7Entity &b" + e.entity.getEntityId() + " &7joined: &r" + e.entity.getDisplayName().getFormattedText()); + } + } + } + + public void onUpdate() { + if (delay.getInput() != -1 && !entities.isEmpty()) { + entities.values().removeIf(n -> n < System.currentTimeMillis() - delay.getInput()); + } + } + + public void onDisable() { + entities.clear(); + } + + public static boolean isBot(Entity entity) { + if (!ModuleManager.antiBot.isEnabled()) { + return false; + } + if (Freecam.freeEntity != null && Freecam.freeEntity == entity) { + return true; + } + if (entity == null || !(entity instanceof EntityPlayer)) { + return true; + } + final EntityPlayer entityPlayer = (EntityPlayer) entity; + if (delay.getInput() != -1 && !entities.isEmpty() && entities.containsKey(entityPlayer)) { + return true; + } + if (entityPlayer.isDead) { + return true; + } + if (entityPlayer.getName().isEmpty()) { + return true; + } + if (tablist.isToggled() && !getTablist().contains(entityPlayer.getName())) { + return true; + } + if (entityPlayer.getHealth() != 20.0f && entityPlayer.getName().startsWith("§c")) { + return true; + } + if (pitSpawn.getInput() != -1 && entityPlayer.posY >= pitSpawn.getInput() && entityPlayer.posY <= 130 && entityPlayer.getDistance(0, 114, 0) <= 25) { + if (Utils.isHypixel()) { + List sidebarLines = Utils.getSidebarLines(); + if (!sidebarLines.isEmpty() && Utils.stripColor(sidebarLines.get(0)).contains("THE HYPIXEL PIT")) { + return true; + } + } + } + if (entityPlayer.maxHurtTime == 0) { + if (entityPlayer.getHealth() == 20.0f) { + String unformattedText = entityPlayer.getDisplayName().getUnformattedText(); + if (unformattedText.length() == 10 && unformattedText.charAt(0) != '§') { + return true; + } + if (unformattedText.length() == 12 && entityPlayer.isPlayerSleeping() && unformattedText.charAt(0) == '§') { + return true; + } + if (unformattedText.length() >= 7 && unformattedText.charAt(2) == '[' && unformattedText.charAt(3) == 'N' && unformattedText.charAt(6) == ']') { + return true; + } + if (entityPlayer.getName().contains(" ")) { + return true; + } + } else if (entityPlayer.isInvisible()) { + String unformattedText = entityPlayer.getDisplayName().getUnformattedText(); + if (unformattedText.length() >= 3 && unformattedText.charAt(0) == '§' && unformattedText.charAt(1) == 'c') { + return true; + } + } + } + return false; + } + + private static List getTablist() { + List tab = new ArrayList<>(); + for (NetworkPlayerInfo networkPlayerInfo : Utils.getTablist(true)) { + if (networkPlayerInfo == null) { + continue; + } + tab.add(networkPlayerInfo.getGameProfile().getName()); + } + return tab; + } +} diff --git a/src/main/java/keystrokesmod/module/impl/world/Weather.java b/src/main/java/keystrokesmod/module/impl/world/Weather.java new file mode 100644 index 0000000..a76c154 --- /dev/null +++ b/src/main/java/keystrokesmod/module/impl/world/Weather.java @@ -0,0 +1,18 @@ +package keystrokesmod.module.impl.world; + +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; + +public class Weather extends Module { + public SliderSetting time; + public SliderSetting lightning; + public ButtonSetting rain; + + public Weather() { + super("Weather", category.world); + this.registerSetting(time = new SliderSetting("Time", 0, 0, 24, 0.1)); + this.registerSetting(lightning = new SliderSetting("Lightning", 0, 0, 1, 0.01)); + this.registerSetting(rain = new ButtonSetting("Rain", false)); + } +} diff --git a/src/main/java/keystrokesmod/module/setting/Setting.java b/src/main/java/keystrokesmod/module/setting/Setting.java new file mode 100644 index 0000000..0213cca --- /dev/null +++ b/src/main/java/keystrokesmod/module/setting/Setting.java @@ -0,0 +1,17 @@ +package keystrokesmod.module.setting; + +import com.google.gson.JsonObject; + +public abstract class Setting { + public String n; + + public Setting(String n) { + this.n = n; + } + + public String getName() { + return this.n; + } + + public abstract void loadProfile(JsonObject data); +} diff --git a/src/main/java/keystrokesmod/module/setting/impl/ButtonSetting.java b/src/main/java/keystrokesmod/module/setting/impl/ButtonSetting.java new file mode 100644 index 0000000..773e278 --- /dev/null +++ b/src/main/java/keystrokesmod/module/setting/impl/ButtonSetting.java @@ -0,0 +1,70 @@ +package keystrokesmod.module.setting.impl; + +import com.google.gson.JsonObject; +import keystrokesmod.module.setting.Setting; + +public class ButtonSetting extends Setting { + private String name; + private boolean isEnabled; + public boolean isMethodButton; + private Runnable method; + + public ButtonSetting(String name, boolean isEnabled) { + super(name); + this.name = name; + this.isEnabled = isEnabled; + this.isMethodButton = false; + } + + public ButtonSetting(String name, Runnable method) { + super(name); + this.name = name; + this.isEnabled = false; + this.isMethodButton = true; + this.method = method; + } + + public void runMethod() { + if (method != null) { + method.run(); + } + } + + public String getName() { + return this.name; + } + + public boolean isToggled() { + return this.isEnabled; + } + + public void toggle() { + this.isEnabled = !this.isEnabled; + } + + public void enable() { + this.isEnabled = true; + } + + public void disable() { + this.isEnabled = false; + } + + public void setEnabled(boolean b) { + this.isEnabled = b; + } + + @Override + public void loadProfile(JsonObject data) { + if (data.has(getName()) && data.get(getName()).isJsonPrimitive() && !this.isMethodButton) { + boolean booleanValue = isEnabled; + try { + booleanValue = data.getAsJsonPrimitive(getName()).getAsBoolean(); + } + catch (Exception e) { + + } + setEnabled(booleanValue); + } + } +} diff --git a/src/main/java/keystrokesmod/module/setting/impl/DescriptionSetting.java b/src/main/java/keystrokesmod/module/setting/impl/DescriptionSetting.java new file mode 100644 index 0000000..8933d70 --- /dev/null +++ b/src/main/java/keystrokesmod/module/setting/impl/DescriptionSetting.java @@ -0,0 +1,21 @@ +package keystrokesmod.module.setting.impl; + +import com.google.gson.JsonObject; +import keystrokesmod.module.setting.Setting; + +public class DescriptionSetting extends Setting { + private String desc; + + public DescriptionSetting(String t) { + super(t); + this.desc = t; + } + + public String getDesc() { + return this.desc; + } + + @Override + public void loadProfile(JsonObject data) { + } +} diff --git a/src/main/java/keystrokesmod/module/setting/impl/SliderSetting.java b/src/main/java/keystrokesmod/module/setting/impl/SliderSetting.java new file mode 100644 index 0000000..1fea244 --- /dev/null +++ b/src/main/java/keystrokesmod/module/setting/impl/SliderSetting.java @@ -0,0 +1,129 @@ +package keystrokesmod.module.setting.impl; + +import com.google.gson.JsonObject; +import keystrokesmod.module.setting.Setting; + +import java.math.BigDecimal; +import java.math.RoundingMode; + +public class SliderSetting extends Setting { + private String settingName; + private String[] options = null; + private double defaultValue; + private double max; + private double min; + private double intervals; + public boolean isString; + private String suffix = ""; + public boolean canBeDisabled; + + public SliderSetting(String settingName, double defaultValue, double min, double max, double intervals) { + super(settingName); + this.settingName = settingName; + this.defaultValue = defaultValue; + this.min = min; + this.max = max; + this.intervals = intervals; + this.isString = false; + } + + public SliderSetting(String settingName, String suffix, double defaultValue, double min, double max, double intervals) { + this(settingName, defaultValue, min, max, intervals); + this.suffix = suffix; + } + + public SliderSetting(String settingName, boolean canBeDisabled, double defaultValue, double min, double max, double intervals) { + this(settingName, defaultValue, min, max, intervals); + this.canBeDisabled = canBeDisabled; + } + + public SliderSetting(String settingName, String suffix, boolean canBeDisabled, double defaultValue, double min, double max, double intervals) { + this(settingName, defaultValue, min, max, intervals); + this.suffix = suffix; + this.canBeDisabled = canBeDisabled; + } + + public SliderSetting(String settingName, int defaultValue, String[] options) { + super(settingName); + this.settingName = settingName; + this.options = options; + this.defaultValue = defaultValue; + this.min = 0; + this.max = options.length - 1; + this.intervals = 1; + this.isString = true; + } + + public SliderSetting(String settingName, String suffix, int defaultValue, String[] options) { + this(settingName, defaultValue, options); + this.suffix = suffix; + } + + public String getSuffix() { + return this.suffix; + } + + public String[] getOptions() { + return options; + } + + public String getName() { + return this.settingName; + } + + public double getInput() { + return roundToInterval(this.defaultValue, 4); + } + + public double getMin() { + return this.min; + } + + public double getMax() { + return this.max; + } + + public void setValue(double n) { + n = correctValue(n, this.min, this.max); + n = (double) Math.round(n * (1.0D / this.intervals)) / (1.0D / this.intervals); + this.defaultValue = n; + } + + public void setValueRaw(double n) { + this.defaultValue = n; + } + + public static double correctValue(double v, double i, double a) { + v = Math.max(i, v); + v = Math.min(a, v); + return v; + } + + public static double roundToInterval(double v, int p) { + if (p < 0) { + return 0.0D; + } else { + BigDecimal bd = new BigDecimal(v); + bd = bd.setScale(p, RoundingMode.HALF_UP); + return bd.doubleValue(); + } + } + + @Override + public void loadProfile(JsonObject data) { + if (data.has(getName()) && data.get(getName()).isJsonPrimitive()) { + double newValue = defaultValue; + try { + newValue = data.getAsJsonPrimitive(getName()).getAsDouble(); + } + catch (Exception e) { + + } + if (newValue == -1) { + setValueRaw(newValue); + return; + } + setValue(newValue); + } + } +} diff --git a/src/main/java/keystrokesmod/script/ClassObject.java b/src/main/java/keystrokesmod/script/ClassObject.java new file mode 100644 index 0000000..89dd935 --- /dev/null +++ b/src/main/java/keystrokesmod/script/ClassObject.java @@ -0,0 +1,22 @@ +package keystrokesmod.script; + +import javax.tools.SimpleJavaFileObject; +import java.net.URI; + +public class ClassObject extends SimpleJavaFileObject +{ + private final String code; + public final String name; + public int extraLines; + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return this.code; + } + + public ClassObject(final String name, final String code, int extraLines) { + super(URI.create("string:///" + name + ".java"), Kind.SOURCE); + this.code = code; + this.name = name; + this.extraLines = extraLines; + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/script/Diagnostic.java b/src/main/java/keystrokesmod/script/Diagnostic.java new file mode 100644 index 0000000..0a6bcd5 --- /dev/null +++ b/src/main/java/keystrokesmod/script/Diagnostic.java @@ -0,0 +1,38 @@ +package keystrokesmod.script; + +import keystrokesmod.utility.Utils; + +import javax.tools.DiagnosticListener; +import javax.tools.JavaFileObject; +import java.util.Locale; + +public class Diagnostic implements DiagnosticListener { + + @Override + public void report(final javax.tools.Diagnostic diagnostic) { + final String message = diagnostic.getMessage(null); + if (message.contains("SpongePowered")) { + return; + } + if (diagnostic.getSource() != null) { + Utils.sendDebugMessage("§cError loading script §b" + Utils.extractFileName(((ClassObject) diagnostic.getSource()).name)); + } + final JavaFileObject javaFileObject = diagnostic.getSource(); + if (javaFileObject != null) { + int indentIndex = message.indexOf("\n"); + String error = diagnostic.getMessage(Locale.getDefault()); + Utils.sendDebugMessage(" §7err: §c" + (indentIndex == -1 ? error : error.substring(0, indentIndex))); + Utils.sendDebugMessage(" §7line: §c" + (diagnostic.getLineNumber() - ((ClassObject) diagnostic.getSource()).extraLines)); + String sourceContent = ((ClassObject) diagnostic.getSource()).getCharContent(true).toString(); + int startPos = (int) diagnostic.getStartPosition(); + int endPos = (int) diagnostic.getEndPosition(); + int srcIndentIndex = sourceContent.indexOf("\n", startPos); + if (srcIndentIndex != -1) { + Utils.sendDebugMessage(" §7src: §c" + sourceContent.substring(startPos, srcIndentIndex)); + } + else { + Utils.sendDebugMessage(" §7src: §c" + sourceContent.substring(startPos, endPos)); + } + } + } +} diff --git a/src/main/java/keystrokesmod/script/Manager.java b/src/main/java/keystrokesmod/script/Manager.java new file mode 100644 index 0000000..5a8c64e --- /dev/null +++ b/src/main/java/keystrokesmod/script/Manager.java @@ -0,0 +1,66 @@ +package keystrokesmod.script; + +import keystrokesmod.Raven; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.script.classes.Entity; +import keystrokesmod.utility.Utils; +import keystrokesmod.utility.profile.ProfileModule; +import org.lwjgl.Sys; + +import java.awt.*; +import java.io.IOException; +import java.net.URI; + +public class Manager extends Module { + private long lastLoad; + public final String documentationURL = "https://blowsy.gitbook.io/raven"; + + public Manager() { + super("Manager", category.scripts); + this.registerSetting(new ButtonSetting("Load scripts", () -> { + if (Raven.scriptManager.compiler == null) { + Utils.sendMessage("&cCompiler error, JDK not found"); + } + else { + final long currentTimeMillis = System.currentTimeMillis(); + if (Utils.timeBetween(this.lastLoad, currentTimeMillis) > 1500) { + this.lastLoad = currentTimeMillis; + Raven.scriptManager.loadScripts(); + if (Raven.scriptManager.scripts.isEmpty()) { + Utils.sendMessage("&7No scripts found."); + } + else { + double timeTaken = Utils.round((System.currentTimeMillis() - currentTimeMillis) / 1000.0, 1); + Utils.sendMessage("&7Loaded &b" + Raven.scriptManager.scripts.size() + " &7script" + ((Raven.scriptManager.scripts.size() == 1) ? "" : "s") + " in &b" + (Utils.isWholeNumber(timeTaken) ? (int) timeTaken + "" : timeTaken) + "&7s."); + } + Entity.clearCache(); + if (Raven.currentProfile != null && Raven.currentProfile.getModule() != null) { + ((ProfileModule) Raven.currentProfile.getModule()).saved = false; + } + } + else { + Utils.sendMessage("&cYou are on cooldown."); + } + } + })); + this.registerSetting(new ButtonSetting("Open folder", () -> { + try { + Desktop.getDesktop().open(Raven.scriptManager.directory); + } + catch (IOException ex) { + Raven.scriptManager.directory.mkdirs(); + Utils.sendMessage("&cError locating folder, recreated."); + } + })); + this.registerSetting(new ButtonSetting("View documentation", () -> { + try { + Desktop.getDesktop().browse(new URI(documentationURL)); + } catch (Throwable t) { + Sys.openURL(documentationURL); + } + })); + this.canBeEnabled = false; + this.ignoreOnSave = true; + } +} diff --git a/src/main/java/keystrokesmod/script/Script.java b/src/main/java/keystrokesmod/script/Script.java new file mode 100644 index 0000000..d2fde2d --- /dev/null +++ b/src/main/java/keystrokesmod/script/Script.java @@ -0,0 +1,199 @@ +package keystrokesmod.script; + +import keystrokesmod.Raven; +import keystrokesmod.utility.Utils; +import net.minecraft.launchwrapper.Launch; + +import javax.tools.StandardJavaFileManager; +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; +import java.net.URLDecoder; +import java.util.*; + +public class Script { + public String name; + public Class asClass; + public Object classObject; + public String scriptName; + public String codeStr; + public boolean error = false; + public int extraLines; + public ScriptEvents event; + public File file; + + public Script(String name) { + this.name = name; + this.scriptName = "sc_" + name.replace(" ", "").replace(")", "_").replace("(", "_") + "_" + Utils.generateRandomString(5); + } + + public float[] getFloat(final String s, final Object... array) { + if (this.asClass == null || this.classObject == null) { + return null; + } + Method method = null; + for (final Method method2 : this.asClass.getDeclaredMethods()) { + if (method2.getName().equalsIgnoreCase(s) && method2.getParameterCount() == array.length && method2.getReturnType().equals(float[].class)) { + method = method2; + break; + } + } + if (method != null) { + try { + method.setAccessible(true); + final Object invoke = method.invoke(this.classObject, array); + if (invoke instanceof float[]) { + return (float[])invoke; + } + } + catch (IllegalAccessException ex) {} + catch (InvocationTargetException ex2) {} + } + return null; + } + + public boolean run() { + try { + if (this.scriptName == null || this.codeStr == null) { + return false; + } + final File file = new File(Raven.scriptManager.tempDir); + if (!file.exists() || !file.isDirectory()) { + file.mkdir(); + } + if (Raven.scriptManager.compiler == null) { + return false; + } + final Diagnostic bp = new Diagnostic(); + final StandardJavaFileManager standardFileManager = Raven.scriptManager.compiler.getStandardFileManager(bp, null, null); + final ArrayList compilationOptions = new ArrayList<>(); + compilationOptions.add("-d"); + compilationOptions.add(Raven.scriptManager.tempDir); + compilationOptions.add("-XDuseUnsharedTable"); + if (!(boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment")) { + compilationOptions.add("-classpath"); + String s = Raven.scriptManager.b; + try { + s = URLDecoder.decode(s, "UTF-8"); + } + catch (UnsupportedOperationException ex2) {} + compilationOptions.add(s); + } + boolean success = Raven.scriptManager.compiler.getTask(null, standardFileManager, bp, compilationOptions, null, Arrays.asList(new ClassObject(this.scriptName, this.codeStr, this.extraLines))).call(); + if (!success) { + this.error = true; + return false; + } + try { + final SecureClassLoader secureClassLoader = new SecureClassLoader(new URL[]{file.toURI().toURL()}, Launch.classLoader); + this.asClass = secureClassLoader.loadClass(this.scriptName); + this.classObject = this.asClass.newInstance(); + secureClassLoader.close(); + } + catch (Throwable e) { + e.printStackTrace(); + Utils.sendMessage("&7Script &b" + Utils.extractFileName(this.name) + " &7blocked, &cunsafe code&7 detected!"); + this.error = true; + return false; + } + return true; + } + catch (Exception ex) { + this.error = true; + return !error; + } + } + + public int getBoolean(final String s, final Object... array) { + if (this.asClass == null || this.classObject == null) { + return -1; + } + Method method = null; + for (final Method method2 : this.asClass.getDeclaredMethods()) { + if (method2.getName().equalsIgnoreCase(s) && method2.getParameterCount() == array.length && method2.getReturnType().equals(Boolean.TYPE)) { + method = method2; + break; + } + } + if (method != null) { + try { + method.setAccessible(true); + final Object invoke = method.invoke(this.classObject, array); + if (invoke instanceof Boolean) { + return ((boolean)invoke) ? 1 : 0; + } + } + catch (Exception e) { + printRunTimeError(e, s); + } + } + return -1; + } + + public void delete() { + this.asClass = null; + this.classObject = null; + final File file = new File(Raven.scriptManager.tempDir + File.separator + this.scriptName + ".class"); + if (file.exists()) { + file.delete(); + } + } + + public void createScript(final String s) { + extraLines = 0; + final StringBuilder sb = new StringBuilder(); + final Iterator iterator = Raven.scriptManager.imports.iterator(); + while (iterator.hasNext()) { + extraLines++; + sb.append("import ").append(iterator.next()).append(";\n"); + } + sb.append("import keystrokesmod.script.classes.*;\n"); + sb.append("import keystrokesmod.script.packets.clientbound.*;\n"); + sb.append("import keystrokesmod.script.packets.serverbound.*;\n"); + String name = Utils.extractFileName(this.name); + this.codeStr = sb + "public class " + this.scriptName + " extends " + ScriptDefaults.class.getName() + " {public static final " + ScriptDefaults.modules.class.getName().replace("$", ".") + " modules = new " + ScriptDefaults.modules.class.getName().replace("$", ".") + "(\"" + name + "\");public static final String scriptName = \"" + name + "\";\n" + s + "\n}"; + extraLines += 4; + } + + public boolean invokeMethod(final String s, final Object... array) { + if (this.asClass == null || this.classObject == null) { + return false; + } + Method method = null; + for (final Method method2 : this.asClass.getDeclaredMethods()) { + if (method2.getName().equalsIgnoreCase(s) && method2.getParameterCount() == array.length && method2.getReturnType().equals(Void.TYPE)) { + method = method2; + break; + } + } + if (method != null) { + try { + method.setAccessible(true); + method.invoke(this.classObject, array); + return true; + } + catch (Exception e) { + printRunTimeError(e, s); + } + } + return false; + } + + private int getLine(Throwable e, String name) { + for (StackTraceElement element : e.getStackTrace()) { + if (element.getClassName().equals(name)) { + return element.getLineNumber() - extraLines; + } + } + return 0; + } + + private void printRunTimeError(Exception e, String methodName) { + Utils.sendDebugMessage("§cRuntime error during script §b" + Utils.extractFileName(this.name)); + Utils.sendDebugMessage(" §7err: §c" + e.getCause().getClass().getSimpleName()); + Utils.sendDebugMessage(" §7line: §c" + getLine(e.getCause(), this.scriptName)); + Utils.sendDebugMessage(" §7src: §c" + methodName); + } +} diff --git a/src/main/java/keystrokesmod/script/ScriptDefaults.java b/src/main/java/keystrokesmod/script/ScriptDefaults.java new file mode 100644 index 0000000..6d0e6dd --- /dev/null +++ b/src/main/java/keystrokesmod/script/ScriptDefaults.java @@ -0,0 +1,1286 @@ +package keystrokesmod.script; + +import keystrokesmod.Raven; +import keystrokesmod.clickgui.ClickGui; +import keystrokesmod.clickgui.components.impl.CategoryComponent; +import keystrokesmod.clickgui.components.impl.ModuleComponent; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.combat.KillAura; +import keystrokesmod.module.setting.Setting; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.DescriptionSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.script.classes.*; +import keystrokesmod.script.classes.Vec3; +import keystrokesmod.script.packets.clientbound.SPacket; +import keystrokesmod.script.packets.serverbound.CPacket; +import keystrokesmod.script.packets.serverbound.PacketHandler; +import keystrokesmod.utility.*; +import keystrokesmod.utility.shader.BlurUtils; +import keystrokesmod.utility.shader.RoundedUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreenBook; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.gui.inventory.*; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.IResourcePack; +import net.minecraft.client.resources.ResourcePackRepository; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.ContainerChest; +import net.minecraft.inventory.IInventory; +import net.minecraft.network.Packet; +import net.minecraft.scoreboard.Team; +import net.minecraft.util.*; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GL11; +import org.lwjgl.util.glu.GLU; + +import java.io.IOException; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.util.*; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; + +public class ScriptDefaults { + private static final Minecraft mc = Minecraft.getMinecraft(); + public static final Bridge bridge = new Bridge(); + private static final ScheduledExecutorService executor = Executors.newScheduledThreadPool(2); + + public static class client { + public static boolean allowFlying() { + return mc.thePlayer.capabilities.allowFlying; + } + + public static void removePotionEffect(int id) { + if (mc.thePlayer == null) { + return; + } + mc.thePlayer.removePotionEffectClient(id); + } + + public static int getUID() { + return 4; + } + + public static String getUser() { + return "mic"; + } + + public static void addEnemy(String username) { + Utils.addEnemy(username); + } + + public static void addFriend(String username) { + Utils.addFriend(username); + } + + public static void async(Runnable method) { + executor.execute(method); + } + + public static int getFPS() { + return Minecraft.getDebugFPS(); + } + + public static void chat(String message) { + mc.thePlayer.sendChatMessage(message); + } + + public static void print(String string) { + Utils.sendRawMessage(string); + } + + public static void print(Object object) { + String s = String.valueOf(object); + Utils.sendRawMessage(s); + } + + public static boolean isDiagonal() { + return Utils.isDiagonal(false); + } + + public static boolean isHoldingWeapon() { + return Utils.holdingWeapon(); + } + + public static void setTimer(float timer) { + Utils.getTimer().timerSpeed = timer; + } + + public static boolean isCreative() { + return mc.thePlayer.capabilities.isCreativeMode; + } + + public static void processPacket(SPacket packet) { + packet.packet.processPacket(mc.getNetHandler()); + } + + public static void processPacketNoEvent(SPacket packet) { + PacketUtils.receivePacketNoEvent(packet.packet); + } + + public static boolean isFlying() { + return mc.thePlayer.capabilities.isFlying; + } + + public static void attack(Entity entity) { + Utils.attackEntity(entity.entity, true, true); + } + + public static boolean isSinglePlayer() { + return mc.isSingleplayer(); + } + + public static boolean isSpectator() { + return mc.thePlayer.isSpectator(); + } + + public static void setFlying(boolean flying) { + mc.thePlayer.capabilities.isFlying = flying; + } + + public static void setJump(boolean jump) { + mc.thePlayer.movementInput.jump = jump; + } + + public static void setJumping(boolean jump) { + mc.thePlayer.setJumping(jump); + } + + public static void setRenderArmPitch(float pitch) { + mc.thePlayer.prevRenderArmPitch = pitch; + mc.thePlayer.renderArmPitch = pitch; + } + + public static float getRenderArmPitch() { + return mc.thePlayer.renderArmPitch; + } + + public static void setRenderArmYaw(float yaw) { + mc.thePlayer.renderArmYaw = yaw; + } + + public static float getRenderArmYaw() { + return mc.thePlayer.renderArmYaw; + } + + public static long getTotalMemory() { + return Runtime.getRuntime().totalMemory(); + } + + public static long getFreeMemory() { + return Runtime.getRuntime().freeMemory(); + } + + public static long getMaxMemory() { + return Runtime.getRuntime().maxMemory(); + } + + public static List getResourcePacks() { + List packs = new ArrayList<>(); + if (mc.getResourcePackRepository().getRepositoryEntries() == null || mc.getResourcePackRepository().getRepositoryEntries().isEmpty()) { + packs.add(new String[] { mc.mcDefaultResourcePack.getPackName(), "" } ); + } + else { + for (ResourcePackRepository.Entry entry : mc.getResourcePackRepository().getRepositoryEntries()) { + packs.add(new String[] { entry.getResourcePackName(), entry.getTexturePackDescription() } ); + } + } + Collections.reverse(packs); // reverse it to match the correct order + return packs; + } + + public static void jump() { + mc.thePlayer.jump(); + } + + public static boolean allowEditing() { + if (mc.thePlayer == null || mc.thePlayer.capabilities == null) { + return false; + } + return mc.thePlayer.capabilities.allowEdit; + } + + public static void log(String message) { + System.out.println(message); + } + + public static boolean isMouseDown(int button) { + return Mouse.isButtonDown(button); + } + + public static boolean isKeyDown(int key) { + return Keyboard.isKeyDown(key); + } + + public static void setSneaking(boolean sneak) { + mc.thePlayer.setSneaking(sneak); + } + + public static void setSneak(boolean sneak) { + mc.thePlayer.movementInput.sneak = sneak; + } + + public static boolean isSneak() { + return mc.thePlayer.movementInput.sneak; + } + + public static Entity getPlayer() { + if (mc == null || mc.thePlayer == null) { + return null; + } + return Entity.convert(mc.thePlayer); + } + + public static void removeEnemy(String username) { + Utils.removeEnemy(username); + } + + public static void removeFriend(String username) { + Utils.removeFriend(username); + } + + public static boolean isRiding() { + return mc.thePlayer.isRiding(); + } + + public static Vec3 getMotion() { + return new Vec3(mc.thePlayer.motionX, mc.thePlayer.motionY, mc.thePlayer.motionZ); + } + + public static void sleep(long ms) { + try { + Thread.sleep(ms); + } + catch (InterruptedException e) { + } + } + + public static void ping() { + mc.thePlayer.playSound("note.pling", 1.0f, 1.0f); + } + + public static void playSound(String name, float volume, float pitch) { + mc.thePlayer.playSound(name, volume, pitch); + } + + public static boolean isMoving() { + return Utils.isMoving(); + } + + public static boolean isJump() { + return mc.thePlayer.movementInput.jump; + } + + public static float getStrafe() { + return mc.thePlayer.movementInput.moveStrafe; + } + + public static void sleep(int ms) { + try { + Thread.sleep(ms); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public static float getForward() { + return mc.thePlayer.movementInput.moveForward; + } + + public static void closeScreen() { + if (mc.currentScreen instanceof ClickGui) { + mc.displayGuiScreen(null); + return; + } + mc.thePlayer.closeScreen(); + } + + public static String getScreen() { + return mc.currentScreen == null ? "" : mc.currentScreen.getClass().getSimpleName(); + } + + public static float[] getRotationsToEntity(Entity entity) { + return RotationUtils.getRotations(entity.entity); + } + + public static void sendPacket(CPacket packet) { + Packet packet1 = PacketHandler.convertCPacket(packet); + if (packet1 == null) { + return; + } + mc.thePlayer.sendQueue.addToSendQueue(packet1); + } + + public static void sendPacketNoEvent(CPacket packet) { + Packet packet1 = PacketHandler.convertCPacket(packet); + if (packet1 == null) { + return; + } + PacketUtils.sendPacketNoEvent(packet1); + } + + public static void dropItem(boolean dropStack) { + mc.thePlayer.dropOneItem(dropStack); + } + + public static void setMotion(double x, double y, double z) { + mc.thePlayer.motionX = x; + mc.thePlayer.motionY = y; + mc.thePlayer.motionZ = z; + } + + public static void setSpeed(double speed) { + Utils.setSpeed(speed); + } + + public static void setForward(float forward) { + mc.thePlayer.movementInput.moveForward = forward; + } + + public static void setStrafe(float strafe) { + mc.thePlayer.movementInput.moveStrafe = strafe; + } + + public static String getServerIP() { + if (mc.getCurrentServerData() == null || mc.isSingleplayer()) { + return ""; + } + return mc.getCurrentServerData().serverIP; + } + + public static int[] getDisplaySize() { + final ScaledResolution scaledResolution = new ScaledResolution(mc); + return new int[]{scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight(), scaledResolution.getScaleFactor()}; + } + + public float getServerDirection(PlayerState state) { + return state.yaw; + } + + public static Object[] raycastBlock(double distance) { + return raycastBlock(distance, mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch, true); + } + + public static Object[] raycastBlock(double distance, float yaw, float pitch, boolean collisionCheck) { + MovingObjectPosition hit = RotationUtils.rayCast(distance, yaw, pitch, collisionCheck); + if (hit == null || hit.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK) { + return null; + } + return new Object[]{Vec3.convert(hit.getBlockPos()), new Vec3(hit.hitVec.xCoord, hit.hitVec.yCoord, hit.hitVec.zCoord), hit.sideHit.name()}; + } + + public static Object[] raycastEntity(double distance) { + return raycastEntity(distance, mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch); + } + + public static Object[] raycastEntity(double distance, float yaw, float pitch) { + MovingObjectPosition hit = RotationUtils.rayCast(distance, yaw, pitch, true); + if (hit == null || hit.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY) { + return null; + } + return new Object[]{Entity.convert(hit.entityHit), new Vec3(hit.hitVec.xCoord, hit.hitVec.yCoord, hit.hitVec.zCoord), mc.thePlayer.getDistanceSqToEntity(hit.entityHit)}; + } + + public static boolean placeBlock(Vec3 targetPos, String side, Vec3 hitVec) { + return mc.playerController.onPlayerRightClick(mc.thePlayer, mc.theWorld, mc.thePlayer.getHeldItem(), Vec3.getBlockPos(targetPos), Utils.getEnum(EnumFacing.class, side), Vec3.getVec3(hitVec)); + } + + public static float[] getRotationsToBlock(Vec3 position) { + return RotationUtils.getRotations(new BlockPos(position.x, position.y, position.z)); + } + + public static void setSprinting(boolean sprinting) { + mc.thePlayer.setSprinting(sprinting); + } + + public static void swing() { + mc.thePlayer.swingItem(); + } + + public static long time() { + return System.currentTimeMillis(); + } + + public static boolean isFriend(String username) { + return Utils.isFriended(username); + } + + public static boolean isEnemy(String username) { + return Utils.isEnemy(username); + } + } + + public static class world { + + public static Block getBlockAt(int x, int y, int z) { + net.minecraft.block.Block block = BlockUtils.getBlock(new BlockPos(x, y, z)); + if (block == null) { + return new Block(Blocks.air, new BlockPos(x, y, z)); + } + return new Block(block, new BlockPos(x, y, z)); + } + + public static Block getBlockAt(Vec3 pos) { + net.minecraft.block.Block block = BlockUtils.getBlock(new BlockPos(pos.x, pos.y, pos.z)); + if (block == null) { + return new Block(Blocks.air, new BlockPos(pos.x, pos.y, pos.z)); + } + return new Block(block, new BlockPos(pos.x, pos.y, pos.z)); + } + + public static String getDimension() { + if (mc.theWorld == null) { + return ""; + } + return mc.theWorld.provider.getDimensionName(); + } + + public static List getEntities() { + List entities = new ArrayList<>(); + if (mc.theWorld == null) { + return entities; + } + for (net.minecraft.entity.Entity entity : mc.theWorld.loadedEntityList) { + entities.add(Entity.convert(entity)); + } + return entities; + } + + public static Entity getEntityById(int entityId) { + if (mc.theWorld == null) { + return null; + } + return Entity.convert(mc.theWorld.getEntityByID(entityId)); + } + + public static List getNetworkPlayers() { + List entities = new ArrayList<>(); + for (NetworkPlayerInfo networkPlayerInfo : Utils.getTablist(false)) { + entities.add(new NetworkPlayer(networkPlayerInfo)); + } + return entities; + } + + public static List getPlayerEntities() { + List entities = new ArrayList<>(); + for (net.minecraft.entity.Entity entity : mc.theWorld.playerEntities) { + entities.add(Entity.convert(entity)); + } + return entities; + } + + public static List getScoreboard() { + List sidebarLines = Utils.getSidebarLines(); + if (sidebarLines.isEmpty()) { + return null; + } + return sidebarLines; + } + + public static Map> getTeams() { + Map> teams = new HashMap<>(); + for (Team team : mc.theWorld.getScoreboard().getTeams()) { + List members = new ArrayList<>(); + for (String member : team.getMembershipCollection()) { + members.add(member); + } + teams.put(team.getRegisteredName(), members); + } + return teams; + } + + public static List getTileEntities() { + List tileEntities = new ArrayList<>(); + for (net.minecraft.tileentity.TileEntity entity : mc.theWorld.loadedTileEntityList) { + tileEntities.add(new TileEntity(entity)); + } + return tileEntities; + } + } + + public static class modules { + private String superName; + + public modules(String superName) { + this.superName = superName; + } + private Module getModule(String moduleName) { + boolean found = false; + for (Module module : Raven.getModuleManager().getModules()) { + if (module.getName().equals(moduleName)) { + return module; + } + } + if (!found) { + for (Module module : Raven.scriptManager.scripts.values()) { + if (module.getName().equals(moduleName)) { + return module; + } + } + } + return null; + } + + private Module getScript(String name) { + for (Module module : Raven.scriptManager.scripts.values()) { + if (module.getName().equals(name)) { + return module; + } + } + return null; + } + + private Setting getSetting(Module module, String settingName) { + if (module == null) { + return null; + } + for (Setting setting : module.getSettings()) { + if (setting.getName().equals(settingName)) { + return setting; + } + } + return null; + } + + public void enable(String moduleName) { + if (getModule(moduleName) == null) { + return; + } + getModule(moduleName).enable(); + } + + public void disable(String moduleName) { + if (getModule(moduleName) == null) { + return; + } + getModule(moduleName).disable(); + } + + public boolean isEnabled(String moduleName) { + if (getModule(moduleName) == null) { + return false; + } + return getModule(moduleName).isEnabled(); + } + + public Entity getKillAuraTarget() { + if (KillAura.target == null) { + return null; + } + return Entity.convert(KillAura.target); + } + + public Map getSettings(String name) { + Map settings = new HashMap<>(); + Module module = getModule(name); + if (module == null) { + return settings; + } + for (Setting setting : module.getSettings()) { + if (setting instanceof SliderSetting) { + settings.put(setting.getName(), ((SliderSetting) setting).getInput()); + } + else if (setting instanceof ButtonSetting) { + settings.put(setting.getName(), ((ButtonSetting) setting).isToggled()); + } + } + return settings; + } + + public Map> getCategories() { + Map> categories = new HashMap<>(); + for (CategoryComponent categoryComponent : ClickGui.categories) { + List modules = new ArrayList<>(); + for (ModuleComponent module : categoryComponent.modules) { + modules.add(module.mod.getName()); + } + categories.put(categoryComponent.categoryName.name(), modules); + } + return categories; + } + + public Vec3 getBedAuraPosition() { + BlockPos blockPos = ModuleManager.bedAura.currentBlock; + if (ModuleManager.bedAura == null || !ModuleManager.bedAura.isEnabled() || ModuleManager.bedAura.currentBlock == null) { + return null; + } + return new Vec3(blockPos.getX(), blockPos.getY(), blockPos.getZ()); + } + + public boolean isScaffolding() { + return ModuleManager.scaffold.isEnabled && ModuleManager.scaffold.tower.isToggled(); + } + + public boolean isTowering() { + return ModuleManager.tower.canTower(); + } + + public boolean isHidden(String moduleName) { + Module module = getModule(moduleName); + if (module != null) { + return module.isHidden(); + } + return false; + } + + public float[] getBedAuraProgress() { + if (ModuleManager.bedAura != null && ModuleManager.bedAura.isEnabled()) { + return new float[]{ModuleManager.bedAura.breakProgress, ModuleManager.bedAura.vanillaProgress}; + } + return new float[]{0, 0}; + } + + public void registerButton(String name, boolean defaultValue) { + getScript(this.superName).registerSetting(new ButtonSetting(name, defaultValue)); + } + + public void registerSlider(String name, double defaultValue, double minimum, double maximum, double interval) { + this.registerSlider(name, "", defaultValue, minimum, maximum, interval); + } + + public void registerSlider(String name, int defaultValue, String[] stringArray) { + this.registerSlider(name, "", defaultValue, stringArray); + } + + public void registerSlider(String name, String suffix, double defaultValue, double minimum, double maximum, double interval) { + getScript(this.superName).registerSetting(new SliderSetting(name, defaultValue, minimum, maximum, interval)); + } + + public void registerSlider(String name, String suffix, int defaultValue, String[] stringArray) { + getScript(this.superName).registerSetting(new SliderSetting(name, defaultValue, stringArray)); + } + + public void registerDescription(String description) { + getScript(this.superName).registerSetting(new DescriptionSetting(description)); + } + + public boolean getButton(String moduleName, String name) { + ButtonSetting setting = (ButtonSetting) getSetting(getModule(moduleName), name); + if (setting == null) { + return false; + } + boolean buttonState = setting.isToggled(); + return buttonState; + } + + public double getSlider(String moduleName, String name) { + SliderSetting setting = ((SliderSetting) getSetting(getModule(moduleName), name)); + if (setting == null) { + return 0; + } + double sliderValue = setting.getInput(); + return sliderValue; + } + + public void setButton(String moduleName, String name, boolean value) { + ButtonSetting setting = (ButtonSetting) getSetting(getModule(moduleName), name); + if (setting == null) { + return; + } + setting.setEnabled(value); + } + + public void setSlider(String moduleName, String name, double value) { + SliderSetting setting = ((SliderSetting) getSetting(getModule(moduleName), name)); + if (setting == null) { + return; + } + setting.setValue(value); + } + } + + public static class gl { + public static void alpha(boolean alpha) { + if (alpha) { + GlStateManager.enableAlpha(); + } + else { + GlStateManager.disableAlpha(); + } + } + + public static void begin(int mode) { + GL11.glBegin(mode); + } + + public static void blend(boolean blend) { + if (blend) { + GlStateManager.enableBlend(); + } + else { + GlStateManager.disableBlend(); + } + } + + public static void color(float r, float g, float b, float a) { + GlStateManager.color(r, g, b, a); + } + + public static void cull(boolean cull) { + if (cull) { + GlStateManager.enableCull(); + } + else { + GlStateManager.disableCull(); + } + } + + public static void depth(boolean depth) { + if (depth) { + GlStateManager.enableDepth(); + } + else { + GlStateManager.disableDepth(); + } + } + + public static void depthMask(boolean depthMask) { + GlStateManager.depthMask(depthMask); + } + + public static void disable(int cap) { + GL11.glDisable(cap); + } + + public static void disableItemLighting() { + RenderHelper.disableStandardItemLighting(); + } + + public static void enable(int cap) { + GL11.glEnable(cap); + } + + public static void enableItemLighting(boolean gui) { + if (gui) { + RenderHelper.enableGUIStandardItemLighting(); + } + else { + RenderHelper.enableStandardItemLighting(); + } + } + + public static void end() { + GL11.glEnd(); + } + + public static void lighting(boolean lighting) { + if (lighting) { + GlStateManager.enableLighting(); + } + else { + GlStateManager.disableLighting(); + } + } + + public static void lineSmooth(boolean lineSmooth) { + setGLEnable(GL11.GL_LINE_SMOOTH, lineSmooth); + } + + public static void lineWidth(float width) { + GL11.glLineWidth(width); + } + + public static void normal(float x, float y, float z) { + GL11.glNormal3f(x, y, z); + } + + public static void pop() { + GL11.glPopMatrix(); + } + + public static void push() { + GL11.glPushMatrix(); + } + + public static void rotate(float angle, float x, float y, float z) { + GL11.glRotatef(angle, x, y, z); + } + + public static void scale(float x, float y, float z) { + GL11.glScalef(x, y, z); + } + + public static void scissor(int x, int y, int width, int height) { + GL11.glScissor(x, y, width, height); + } + + public static void scissor(boolean scissor) { + setGLEnable(GL11.GL_SCISSOR_TEST, scissor); + } + + public static void texture2d(boolean texture2d) { + if (texture2d) { + GlStateManager.enableTexture2D(); + } + else { + GlStateManager.disableTexture2D(); + } + } + + public static void translate(float x, float y, float z) { + GL11.glTranslatef(x, y, z); + } + + public static void vertex2(float x, float y) { + GL11.glVertex2f(x, y); + } + + public static void vertex3(float x, float y, float z) { + GL11.glVertex3f(x, y, z); + } + + private static void setGLEnable(int cap, boolean enable) { + if (enable) { + GL11.glEnable(cap); + } + else { + GL11.glDisable(cap); + } + } + } + + public static class render { + private static final IntBuffer VIEWPORT = GLAllocation.createDirectIntBuffer(16); + private static final FloatBuffer MODELVIEW = GLAllocation.createDirectFloatBuffer(16); + private static final FloatBuffer PROJECTION = GLAllocation.createDirectFloatBuffer(16); + private static final FloatBuffer SCREEN_COORDS = GLAllocation.createDirectFloatBuffer(3); + + + public static void block(Vec3 position, int color, boolean outline, boolean shade) { + RenderUtils.renderBlock(new BlockPos(position.x, position.y, position.z), color, outline, shade); + } + + public static void block(int x, int y, int z, int color, boolean outline, boolean shade) { + RenderUtils.renderBlock(new BlockPos(x, y, z), color, outline, shade); + } + + public static void entity(Entity en, int color, float partialTicks, boolean outline, boolean shade) { + net.minecraft.entity.Entity e = en.entity; + double x = e.lastTickPosX + (e.posX - e.lastTickPosX) * partialTicks - mc.getRenderManager().viewerPosX; + double y = e.lastTickPosY + (e.posY - e.lastTickPosY) * partialTicks - mc.getRenderManager().viewerPosY; + double z = e.lastTickPosZ + (e.posZ - e.lastTickPosZ) * partialTicks - mc.getRenderManager().viewerPosZ; + AxisAlignedBB bbox = e.getEntityBoundingBox().expand(0.1, 0.1, 0.1); + AxisAlignedBB axis = new AxisAlignedBB(bbox.minX - e.posX + x, bbox.minY - e.posY + y, bbox.minZ - e.posZ + z, bbox.maxX - e.posX + x, bbox.maxY - e.posY + y, bbox.maxZ - e.posZ + z); + GL11.glPushMatrix(); + GL11.glBlendFunc(770, 771); + GL11.glEnable(3042); + GL11.glDisable(3553); + GL11.glDisable(2929); + GL11.glDepthMask(false); + GL11.glLineWidth(2.0f); + float a = (color >> 24 & 0xFF) / 255.0f; + float r = (color >> 16 & 0xFF) / 255.0f; + float g = (color >> 8 & 0xFF) / 255.0f; + float b = (color & 0xFF) / 255.0f; + GL11.glColor4f(r, g, b, a); + if (outline) { + RenderGlobal.drawSelectionBoundingBox(axis); + } + if (shade) { + RenderUtils.drawBoundingBox(axis, r, g, b); + } + GL11.glEnable(3553); + GL11.glEnable(2929); + GL11.glDepthMask(true); + GL11.glDisable(3042); + GL11.glPopMatrix(); + } + + public static void entityGui(Entity en, int x, int y, float mouseX, float mouseY, int scale) { + if (!en.isLiving) { + return; + } + GL11.glPushMatrix(); + GuiInventory.drawEntityOnScreen(x, y, scale, mouseX, mouseY, (EntityLivingBase) en.entity); + GL11.glPopMatrix(); + } + + public static void text(String text, float x, float y, int color, boolean shadow) { + mc.fontRendererObj.drawString(text, x, y, color, shadow); + } + + public static void resetEquippedProgress() { + mc.getItemRenderer().resetEquippedProgress(); + } + + public static void tracer(Entity entity, float lineWidth, int color, float partialTicks) { + RenderUtils.drawTracerLine(entity.entity, color, lineWidth, partialTicks); + } + + public static void item(ItemStack item, float x, float y, float scale) { + GlStateManager.pushMatrix(); + Reflection.setupCameraTransform(mc.entityRenderer, Utils.getTimer().renderPartialTicks, 0); + mc.entityRenderer.setupOverlayRendering(); + if (scale != 1.0f) { + GlStateManager.scale(scale, scale, scale); + } + RenderHelper.enableGUIStandardItemLighting(); + GlStateManager.disableBlend(); + GlStateManager.translate(x / scale, y / scale, 0); + mc.getRenderItem().renderItemIntoGUI(item.itemStack, 0, 0); + GlStateManager.enableBlend(); + RenderHelper.disableStandardItemLighting(); + if (scale != 1.0f) { + GlStateManager.scale(scale, scale, scale); + } + GlStateManager.popMatrix(); + } + + public static void image(Image image, float x, float y, float width, float height) { + if (image == null || !image.isLoaded()) { + return; + } + if (image.textureId == -1) { + final DynamicTexture dynamicTexture = new DynamicTexture(image.bufferedImage); + GL11.glTexParameteri(3553, 10240, 9728); + dynamicTexture.updateDynamicTexture(); + image.textureId = dynamicTexture.getGlTextureId(); + } + GlStateManager.pushMatrix(); + GlStateManager.enableTexture2D(); + GlStateManager.bindTexture(image.textureId); + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glTexParameteri(3553, 10240, 9728); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); + worldrenderer.pos(x, (y + height), 0.0).tex(0.0, 1.0).color(255, 255, 255, 255).endVertex(); + worldrenderer.pos((x + width), (y + height), 0.0).tex(1.0, 1.0).color(255, 255, 255, 255).endVertex(); + worldrenderer.pos((x + width), y, 0.0).tex(1.0, 0.0).color(255, 255, 255, 255).endVertex(); + worldrenderer.pos(x, y, 0.0).tex(0.0, 0.0).color(255, 255, 255, 255).endVertex(); + tessellator.draw(); + GlStateManager.popMatrix(); + } + + public static Vec3 worldToScreen(double x, double y, double z, int scaleFactor, float partialTicks) { + x -= mc.getRenderManager().viewerPosX; + y -= mc.getRenderManager().viewerPosY; + z -= mc.getRenderManager().viewerPosZ; + Reflection.setupCameraTransform(mc.entityRenderer, partialTicks, 0); + GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, MODELVIEW); + GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, PROJECTION); + GL11.glGetInteger(GL11.GL_VIEWPORT, VIEWPORT); + if (GLU.gluProject((float)x, (float)y, (float)z, render.MODELVIEW, render.PROJECTION, render.VIEWPORT, render.SCREEN_COORDS)) { + Vec3 vec = new Vec3(render.SCREEN_COORDS.get(0) / scaleFactor, (Display.getHeight() - render.SCREEN_COORDS.get(1)) / scaleFactor, render.SCREEN_COORDS.get(2)); + mc.entityRenderer.setupOverlayRendering(); + return vec; + } + return null; + } + + public static void roundedRect(float startX, float startY, float endX, float endY, float radius, int color) { + RoundedUtils.drawRoundedRectRise(startX, startY, Math.abs(startX - endX), Math.abs(startY - endY), radius, color); + } + + public static double[] getRotations() { + return new double[] { mc.getRenderManager().playerViewY, mc.getRenderManager().playerViewX }; + } + + public static double[] getCameraRotations() { + return new double[] { Utils.getCameraYaw(), Utils.getCameraPitch() }; + } + + public static int getFontWidth(String text) { + return mc.fontRendererObj.getStringWidth(text) + Utils.getBoldWidth(text); + } + + public static int getFontHeight() { + return mc.fontRendererObj.FONT_HEIGHT; + } + + public static Vec3 getPosition() { + net.minecraft.util.Vec3 position = Utils.getCameraPos(Utils.getTimer().renderPartialTicks); + return new Vec3(position); + } + + public static void text(String text, float x, float y, float scale, int color, boolean shadow) { + if (scale != 1.0f) { + GlStateManager.pushMatrix(); + GlStateManager.scale(scale, scale, scale); + } + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + mc.fontRendererObj.drawString(text, x / scale, y / scale, color, shadow); + GlStateManager.disableBlend(); + if (scale != 1.0f) { + GlStateManager.scale(1.0f, 1.0f, 1.0f); + GlStateManager.popMatrix(); + } + } + + public static void rect(float startX, float startY, float endX, float endY, int color) { + RenderUtils.drawRectangleGL(startX, startY, endX, endY, color); + } + + public static void line2D(double startX, double startY, double endX, double endY, float lineWidth, int color) { + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_LINE_SMOOTH); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_BLEND); + RenderUtils.glColor(color); + GL11.glLineWidth(lineWidth); + GL11.glBegin(GL11.GL_LINES); + GL11.glVertex2d(startX, startY); + GL11.glVertex2d(endX, endY); + GL11.glEnd(); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LINE_SMOOTH); + GL11.glPopMatrix(); + } + + public static void line3D(Vec3 pos1, Vec3 pos2, float lineWidth, int color) { + line3D(pos1.x, pos1.y, pos1.z, pos2.x, pos2.y, pos2.z, lineWidth, color); + } + + public static void line3D(final double startX, final double startY, final double startZ, double endX, double endY, double endZ, final float lineWidth, final int color) { + endX -= mc.getRenderManager().viewerPosX; + endY -= mc.getRenderManager().viewerPosY; + endZ -= mc.getRenderManager().viewerPosZ; + final float a = (color >> 24 & 0xFF) / 255.0f; + final float r = (color >> 16 & 0xFF) / 255.0f; + final float g = (color >> 8 & 0xFF) / 255.0f; + final float b = (color & 0xFF) / 255.0f; + GL11.glPushMatrix(); + GL11.glEnable(3042); + GL11.glEnable(2848); + GL11.glDisable(2929); + GL11.glDisable(3553); + GL11.glBlendFunc(770, 771); + GL11.glLineWidth(lineWidth); + GlStateManager.color(r, g, b, a); + GL11.glBegin(2); + GL11.glVertex3d(startX - mc.thePlayer.posX, startY - mc.thePlayer.posY, startZ - mc.thePlayer.posZ); + GL11.glVertex3d(endX, endY, endZ); + GL11.glEnd(); + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); + GL11.glEnable(3553); + GL11.glEnable(2929); + GL11.glDisable(2848); + GL11.glDisable(3042); + GL11.glPopMatrix(); + } + + public static boolean isInView(Entity en) { + return RenderUtils.isInViewFrustum(en.entity); + } + + public static class blur { + public static void prepare() { + BlurUtils.prepareBlur(); + } + + public static void apply(final int passes, final float radius) { + BlurUtils.blurEnd(passes, radius); + } + } + + public static class bloom { + public static void prepare() { + BlurUtils.prepareBloom(); + } + + public static void apply(final int passes, final float radius) { + BlurUtils.bloomEnd(passes, radius); + } + } + } + + public static class inventory { + + public static int getSlot() { + return mc.thePlayer.inventory.currentItem; + } + + public static void setSlot(int slot) { + mc.thePlayer.inventory.currentItem = slot; + } + + public static void click(int slot, int button, int mode) { + mc.playerController.windowClick(mc.thePlayer.openContainer.windowId, slot, button, mode, mc.thePlayer); + } + + public static List getBookContents() { + if (mc.currentScreen instanceof GuiScreenBook) { + try { + List contents = new ArrayList<>(); + int max = Math.min(128 / mc.fontRendererObj.FONT_HEIGHT, ((List) Reflection.bookContents.get(mc.currentScreen)).size()); + for (int line = 0; line < max; ++line) { + IChatComponent lineStr = ((List) Reflection.bookContents.get(mc.currentScreen)).get(line); + contents.add(lineStr.getUnformattedText()); + Utils.sendMessage(lineStr.getUnformattedText()); + } + if (!contents.isEmpty()) { + return contents; + } + } + catch (Exception e) { + e.printStackTrace(); + } + } + return null; + } + + public static String getChest() { + if (mc.thePlayer.openContainer instanceof ContainerChest) { + ContainerChest chest = (ContainerChest) mc.thePlayer.openContainer; + if (chest == null) { + return ""; + } + return chest.getLowerChestInventory().getDisplayName().getUnformattedText(); + } + return ""; + } + + public static String getContainer() { + if (mc.currentScreen instanceof GuiContainerCreative) { + CreativeTabs creativetabs = CreativeTabs.creativeTabArray[((GuiContainerCreative) mc.currentScreen).getSelectedTabIndex()]; + if (creativetabs != null) { + return I18n.format(creativetabs.getTranslatedTabLabel()); + } + } + else if (mc.currentScreen != null) { + try { + return ((IInventory) Reflection.containerInventoryPlayer.get(mc.currentScreen.getClass()).get(mc.currentScreen)).getDisplayName().getUnformattedText(); + } catch (Exception e) { + } + } + return ""; + } + + public static int getSize() { + return mc.thePlayer.inventory.getSizeInventory(); + } + + public static int getChestSize() { + if (mc.thePlayer.openContainer instanceof ContainerChest) { + ContainerChest chest = (ContainerChest) mc.thePlayer.openContainer; + if (chest == null) { + return -1; + } + return chest.getLowerChestInventory().getSizeInventory(); + } + return -1; + } + + public static ItemStack getStackInSlot(int slot) { + if (mc.thePlayer.inventory.getStackInSlot(slot) == null) { + return null; + } + return new ItemStack(mc.thePlayer.inventory.getStackInSlot(slot), (byte) 0); + } + + public static ItemStack getStackInChestSlot(int slot) { + if (mc.thePlayer.openContainer instanceof ContainerChest) { + ContainerChest chest = (ContainerChest) mc.thePlayer.openContainer; + if (chest.getLowerChestInventory().getStackInSlot(slot) == null) { + return null; + } + return new ItemStack(chest.getLowerChestInventory().getStackInSlot(slot), (byte) 0); + } + return null; + } + + public static void open() { + KeyBinding inventoryKey = mc.gameSettings.keyBindInventory; + int originalKeyCode = inventoryKey.getKeyCode(); + + if (originalKeyCode == 0) { + inventoryKey.setKeyCode(13); + KeyBinding.resetKeyBindingArrayAndHash(); + } + + KeyBinding.setKeyBindState(inventoryKey.getKeyCode(), true); + KeyBinding.onTick(inventoryKey.getKeyCode()); + KeyBinding.setKeyBindState(inventoryKey.getKeyCode(), false); + + if (originalKeyCode == 0) { + inventoryKey.setKeyCode(0); + KeyBinding.resetKeyBindingArrayAndHash(); + } + } + } + + public static class keybinds { + public static int[] getMousePosition() { + return new int[] { Mouse.getX(), Mouse.getY() }; + } + + public static boolean isPressed(String key) { + for (Map.Entry map : Reflection.keyBindings.entrySet()) { + if (map.getValue().equals(key)) { + return map.getKey().isKeyDown(); + } + } + return false; + } + + public static void setPressed(String key, boolean pressed) { + for (Map.Entry map : Reflection.keyBindings.entrySet()) { + if (map.getValue().equals(key)) { + KeyBinding.setKeyBindState(map.getKey().getKeyCode(), pressed); + if (pressed) { + KeyBinding.onTick(map.getKey().getKeyCode()); + } + } + } + } + + public static int getKeyCode(String key) { + return Keyboard.getKeyIndex(key); + } + + public static boolean isMouseDown(int mouseButton) { + return Mouse.isButtonDown(mouseButton); + } + + public static boolean isKeyDown(int key) { + return Keyboard.isKeyDown(key); + } + + public static void rightClick() { + Reflection.rightClick(); + } + + public static void leftClick() { + Reflection.clickMouse(); + } + } + + public static class util { + public static final String colorSymbol = "§"; + + public static String color(String message) { + return Utils.formatColor(message); + } + + public static String strip(String string) { + return Utils.stripColor(string); + } + + public static double round(double value, int decimals) { + return Utils.round(value, decimals); + } + + public static int randomInt(int min, int max) { + return Utils.randomizeInt(min, max); + } + + public static double randomDouble(double min, double max) { + return Utils.randomizeDouble(min, max); + } + } +} diff --git a/src/main/java/keystrokesmod/script/ScriptEvents.java b/src/main/java/keystrokesmod/script/ScriptEvents.java new file mode 100644 index 0000000..a181ba5 --- /dev/null +++ b/src/main/java/keystrokesmod/script/ScriptEvents.java @@ -0,0 +1,142 @@ +package keystrokesmod.script; + +import keystrokesmod.Raven; +import keystrokesmod.event.*; +import keystrokesmod.module.Module; +import keystrokesmod.script.classes.Entity; +import keystrokesmod.script.classes.PlayerState; +import keystrokesmod.script.packets.clientbound.SPacket; +import keystrokesmod.script.packets.serverbound.CPacket; +import keystrokesmod.script.packets.serverbound.PacketHandler; +import keystrokesmod.utility.Utils; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.client.event.MouseEvent; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; + +public class ScriptEvents { + public Module module; + + public ScriptEvents(Module module) { + this.module = module; + } + + @SubscribeEvent + public void onChat(ClientChatReceivedEvent e) { + if (e.type == 2 || !Utils.nullCheck()) { + return; + } + final String r = Utils.stripColor(e.message.getUnformattedText()); + if (r.isEmpty()) { + return; + } + if (Raven.scriptManager.invokeBoolean("onChat", module, e.message.getUnformattedText()) == 0) { + e.setCanceled(true); + } + } + + @SubscribeEvent + public void onSendPacket(SendPacketEvent e) { + if (e.isCanceled() || e.getPacket() == null) { + return; + } + if (e.getPacket().getClass().getSimpleName().startsWith("S")) { + return; + } + CPacket a = PacketHandler.convertServerBound(e.getPacket()); + if (a != null && Raven.scriptManager.invokeBoolean("onPacketSent", module, a) == 0) { + e.setCanceled(true); + } + } + + @SubscribeEvent + public void onReceivePacket(ReceivePacketEvent e) { + if (e.isCanceled() || e.getPacket() == null) { + return; + } + SPacket a = PacketHandler.convertClientBound(e.getPacket()); + if (a != null && Raven.scriptManager.invokeBoolean("onPacketReceived", module, a) == 0) { + e.setCanceled(true); + } + } + + @SubscribeEvent + public void onRenderWorldLast(RenderWorldLastEvent e) { + if (!Utils.nullCheck()) { + return; + } + Raven.scriptManager.invoke("onRenderWorld", module, e.partialTicks); + } + + @SubscribeEvent + public void onPreUpdate(PreUpdateEvent e) { + Raven.scriptManager.invoke("onPreUpdate", module); + } + + @SubscribeEvent + public void onPostUpdate(PostUpdateEvent e) { + Raven.scriptManager.invoke("onPostUpdate", module); + } + + @SubscribeEvent + public void onRenderTick(TickEvent.RenderTickEvent e) { + if (e.phase != TickEvent.Phase.END || !Utils.nullCheck()) { + return; + } + Raven.scriptManager.invoke("onRenderTick", module, e.renderTickTime); + } + + @SubscribeEvent + public void onGuiUpdate(GuiUpdateEvent e) { + if (e.guiScreen == null) { + return; + } + Raven.scriptManager.invoke("onGuiUpdate", module, e.guiScreen.getClass().getSimpleName(), e.opened); + } + + @SubscribeEvent + public void onPreMotion(PreMotionEvent e) { + PlayerState playerState = new PlayerState(e, (byte) 0); + Raven.scriptManager.invoke("onPreMotion", module, playerState); + if (e.isEquals(playerState)) { + return; + } + if (e.getYaw() != playerState.yaw) { + e.setYaw(playerState.yaw); + } + e.setPitch(playerState.pitch); + e.setPosX(playerState.x); + e.setPosY(playerState.y); + e.setPosZ(playerState.z); + e.setOnGround(playerState.onGround); + e.setSprinting(playerState.isSprinting); + e.setSneaking(playerState.isSneaking); + } + + @SubscribeEvent + public void onWorldJoin(EntityJoinWorldEvent e) { + if (e.entity == null) { + return; + } + Raven.scriptManager.invoke("onWorldJoin", module, Entity.convert(e.entity)); + } + + @SubscribeEvent + public void onPostInput(PostPlayerInputEvent e) { + Raven.scriptManager.invoke("onPostPlayerInput", module); + } + + @SubscribeEvent + public void onPostMotion(PostMotionEvent e) { + Raven.scriptManager.invoke("onPostMotion", module); + } + + @SubscribeEvent + public void onMouse(MouseEvent e) { + if (Raven.scriptManager.invokeBoolean("onMouse", module, e.button, e.buttonstate) == 0) { + e.setCanceled(true); + } + } +} diff --git a/src/main/java/keystrokesmod/script/ScriptManager.java b/src/main/java/keystrokesmod/script/ScriptManager.java new file mode 100644 index 0000000..30f0ded --- /dev/null +++ b/src/main/java/keystrokesmod/script/ScriptManager.java @@ -0,0 +1,224 @@ +package keystrokesmod.script; + +import keystrokesmod.Raven; +import keystrokesmod.clickgui.components.impl.CategoryComponent; +import keystrokesmod.module.Module; +import keystrokesmod.utility.NetworkUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.client.Minecraft; +import net.minecraftforge.fml.common.FMLCommonHandler; + +import javax.tools.JavaCompiler; +import javax.tools.ToolProvider; +import java.awt.*; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.MessageDigest; +import java.util.*; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; +import java.util.regex.Matcher; + +public class ScriptManager { + private Minecraft mc = Minecraft.getMinecraft(); + public LinkedHashMap scripts = new LinkedHashMap<>(); + public JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); + public boolean deleteTempFiles = true; + public File directory; + public List imports = Arrays.asList(Color.class.getName(), Collections.class.getName(), List.class.getName(), ArrayList.class.getName(), Arrays.class.getName(), Map.class.getName(), HashMap.class.getName(), HashSet.class.getName(), ConcurrentHashMap.class.getName(), LinkedHashMap.class.getName(), Iterator.class.getName(), Comparator.class.getName(), AtomicInteger.class.getName(), AtomicLong.class.getName(), AtomicBoolean.class.getName(), Random.class.getName(), Matcher.class.getName()); + public String tempDir = System.getProperty("java.io.tmpdir") + "cmF2ZW5fc2NyaXB0cw"; + public String b = ((String[])ScriptManager.class.getProtectionDomain().getCodeSource().getLocation().getPath().split("\\.jar!"))[0].substring(5) + ".jar"; + private Map loadedHashes = new HashMap<>(); + + public ScriptManager() { + directory = new File(mc.mcDataDir + File.separator + "keystrokes", "scripts"); + } + + public void onEnable(Script dv) { + if (dv.event == null) { + dv.event = new ScriptEvents(getModule(dv)); + FMLCommonHandler.instance().bus().register(dv.event); + } + dv.invokeMethod("onEnable"); + } + + public Module getModule(Script dv) { + for (Map.Entry entry : this.scripts.entrySet()) { + if (entry.getKey().equals(dv)) { + return entry.getValue(); + } + } + return null; + } + + public void loadScripts() { + for (Module module : this.scripts.values()) { + module.disable(); + } + + if (deleteTempFiles) { + deleteTempFiles = false; + final File tempDirectory = new File(tempDir); + if (tempDirectory.exists() && tempDirectory.isDirectory()) { + final File[] tempFiles = tempDirectory.listFiles(); + if (tempFiles != null) { + for (File tempFile : tempFiles) { + if (!tempFile.delete()) { + System.err.println("Failed to delete temp file: " + tempFile.getAbsolutePath()); + } + } + } + } + } + else { + Iterator> iterator = scripts.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry entry = iterator.next(); + String fileName = entry.getKey().file.getName(); + String hash = calculateHash(entry.getKey().file); + + String cachedHash = loadedHashes.get(fileName); + if (cachedHash != null && cachedHash.equals(hash) && !entry.getKey().error) { + continue; // No changes detected, skip reloading + } + entry.getKey().delete(); + iterator.remove(); + loadedHashes.remove(fileName, hash); + } + } + + final File scriptDirectory = directory; + if (scriptDirectory.exists() && scriptDirectory.isDirectory()) { + final File[] scriptFiles = scriptDirectory.listFiles(); + if (scriptFiles != null) { + for (final File scriptFile : scriptFiles) { + if (scriptFile.isFile() && scriptFile.getName().endsWith(".java")) { + String fileName = scriptFile.getName(); + String hash = calculateHash(scriptFile); + + String cachedHash = loadedHashes.get(fileName); + if (cachedHash != null && cachedHash.equals(hash)) { + continue; // No changes detected, skip parsing + } + parseFile(scriptFile); + loadedHashes.put(scriptFile.getName(), hash); + } + } + } + } + else { + if (scriptDirectory.mkdirs()) { + System.out.println("Created script directory: " + scriptDirectory.getAbsolutePath()); + } + else { + System.err.println("Failed to create script directory: " + scriptDirectory.getAbsolutePath()); + } + } + + for (Module module : this.scripts.values()) { + module.disable(); + } + + for (CategoryComponent categoryComponent : Raven.clickGui.categories) { + if (categoryComponent.categoryName == Module.category.scripts) { + categoryComponent.reloadModules(false); + } + } + } + + private boolean parseFile(final File file) { + if (file.getName().startsWith("_") || !file.getName().endsWith(".java")) { + return false; + } + String scriptName = file.getName().replace(".java", ""); + if (scriptName.isEmpty()) { + return false; + } + StringBuilder scriptContents = new StringBuilder(); + try (BufferedReader bufferedReader = new BufferedReader(new FileReader(file))) { + String line; + while ((line = bufferedReader.readLine()) != null) { + scriptContents.append(line).append("\n"); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + if (scriptContents.length() == 0) { + return false; + } + List topLevelLines = Utils.getTopLevelLines(scriptContents.toString()); + for (String line : topLevelLines) { + if (line.startsWith("load - \"") && line.endsWith("\"")) { + String url = line.substring("load - \"".length(), line.length() - 1); + String externalContents = NetworkUtils.getTextFromURL(url, true); + if (externalContents.isEmpty()) { + break; + } + int loadIndex = scriptContents.indexOf(line); + if (loadIndex != -1) { + scriptContents.replace(loadIndex, loadIndex + line.length(), externalContents); + } + } + } + Script script = new Script(scriptName); + script.file = file; + script.createScript(scriptContents.toString()); + script.run(); + Module module = new Module(script); + Raven.scriptManager.scripts.put(script, module); + Raven.scriptManager.invoke("onLoad", module); + return !script.error; + } + + + public void onDisable(Script script) { + if (script.event != null) { + FMLCommonHandler.instance().bus().unregister(script.event); + script.event = null; + } + script.invokeMethod("onDisable"); + } + + public void invoke(String methodName, Module module, final Object... args) { + for (Map.Entry entry : this.scripts.entrySet()) { + if (((entry.getValue().canBeEnabled() && entry.getValue().isEnabled()) || methodName.equals("onLoad")) && entry.getValue().equals(module)) { + entry.getKey().invokeMethod(methodName, args); + } + } + } + + public int invokeBoolean(String methodName, Module module, final Object... args) { + for (Map.Entry entry : this.scripts.entrySet()) { + if (entry.getValue().canBeEnabled() && entry.getValue().isEnabled() && entry.getValue().equals(module)) { + final int c = entry.getKey().getBoolean(methodName, args); + if (c != -1) { + return c; + } + } + } + return -1; + } + + private String calculateHash(File file) { + try { + MessageDigest digest = MessageDigest.getInstance("SHA-256"); + byte[] fileBytes = Files.readAllBytes(Paths.get(file.getPath())); + byte[] hashBytes = digest.digest(fileBytes); + + StringBuilder hexString = new StringBuilder(); + for (byte b : hashBytes) { + hexString.append(String.format("%02x", b)); + } + return hexString.toString(); + } + catch (Exception e) { + return ""; + } + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/script/SecureClassLoader.java b/src/main/java/keystrokesmod/script/SecureClassLoader.java new file mode 100644 index 0000000..df832db --- /dev/null +++ b/src/main/java/keystrokesmod/script/SecureClassLoader.java @@ -0,0 +1,24 @@ +package keystrokesmod.script; + +import java.net.URL; +import java.net.URLClassLoader; +import java.util.Arrays; +import java.util.List; + +public class SecureClassLoader extends URLClassLoader { + private List restrictedClasses = Arrays.asList("java.nio", "java.net", "java.util.zip", "java.applet", "java.rmi", "java.security", "java.io.file", "java.lang.reflect", "java.lang.ref", "java.lang.thread", "java.io.buffer", "java.io.input", "java.io.read", "java.io.writer"); + public SecureClassLoader(URL[] urls, ClassLoader parent) { + super(urls, parent); + } + + @Override + protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException { + boolean isRestricted = restrictedClasses.stream().anyMatch(name.toLowerCase()::startsWith); + boolean isExceptionClass = name.endsWith("Exception"); + + if (isRestricted && !isExceptionClass) { + throw new ClassNotFoundException("Unsafe class detected: " + name); + } + return super.loadClass(name, resolve); + } +} diff --git a/src/main/java/keystrokesmod/script/classes/Block.java b/src/main/java/keystrokesmod/script/classes/Block.java new file mode 100644 index 0000000..ec1e7ee --- /dev/null +++ b/src/main/java/keystrokesmod/script/classes/Block.java @@ -0,0 +1,38 @@ +package keystrokesmod.script.classes; + +import keystrokesmod.utility.BlockUtils; +import net.minecraft.util.BlockPos; + +public class Block { + public String type; + public String name; + public boolean interactable; + public int variant; + public double height; + public double width; + public double length; + public double x; + public double y; + public double z; + + public Block(net.minecraft.block.Block block, BlockPos blockPos) { + this.type = block.getClass().getSimpleName(); + this.name = block.getRegistryName().replace("minecraft:", ""); + this.interactable = BlockUtils.isInteractable(block); + this.variant = block.getMetaFromState(BlockUtils.getBlockState(blockPos)); + this.height = block.getBlockBoundsMaxY() - block.getBlockBoundsMinY(); + this.width = block.getBlockBoundsMaxX() - block.getBlockBoundsMinX(); + this.length = block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ(); + this.x = blockPos.getX(); + this.y = blockPos.getY(); + this.z = blockPos.getZ(); + } + + public Block(int x, int y, int z) { + this(BlockUtils.getBlock(x, y, z), new BlockPos(x, y, z)); + } + + public Block(Vec3 position) { + this(BlockUtils.getBlock(position.x, position.y, position.z), new BlockPos(position.x, position.y, position.z)); + } +} diff --git a/src/main/java/keystrokesmod/script/classes/Bridge.java b/src/main/java/keystrokesmod/script/classes/Bridge.java new file mode 100644 index 0000000..f02cfe7 --- /dev/null +++ b/src/main/java/keystrokesmod/script/classes/Bridge.java @@ -0,0 +1,35 @@ +package keystrokesmod.script.classes; + +import java.util.HashMap; +import java.util.Map; + +public class Bridge { + private static final Map map = new HashMap<>();; + + public void add(String key, Object value) { + map.put(key, value); + } + + public void add(String key) { + map.put(key, null); + } + + public void remove(String key) { + map.remove(key); + } + + public boolean has(String key) { + return map.containsKey(key); + } + + public Object get(String key) { + if (!map.containsKey(key)) { + return null; + } + return map.getOrDefault(key, null); + } + + public void clear() { + map.clear(); + } +} diff --git a/src/main/java/keystrokesmod/script/classes/Entity.java b/src/main/java/keystrokesmod/script/classes/Entity.java new file mode 100644 index 0000000..7827390 --- /dev/null +++ b/src/main/java/keystrokesmod/script/classes/Entity.java @@ -0,0 +1,390 @@ +package keystrokesmod.script.classes; + +import keystrokesmod.utility.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.potion.PotionEffect; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +public class Entity { + public net.minecraft.entity.Entity entity; + public String type; + public int entityId; + public boolean isLiving; + public boolean isPlayer; + public boolean isUser; + private static HashMap cache = new HashMap<>(); + + public Entity(net.minecraft.entity.Entity entity) { + this.entity = entity; + if (entity == null) { + return; + } + this.type = entity.getClass().getSimpleName(); + this.entityId = entity.getEntityId(); + this.isLiving = entity instanceof EntityLivingBase; + this.isPlayer = entity instanceof EntityPlayer; + if (this.isPlayer && Minecraft.getMinecraft().thePlayer != null && entity.getUniqueID().equals(Minecraft.getMinecraft().thePlayer.getUniqueID())) { + this.isUser = true; + } + } + + public static Entity convert(net.minecraft.entity.Entity entity) { + if (entity == null) { + return null; + } + int id = entity.getEntityId() + System.identityHashCode(entity); + Entity cachedEntity = cache.get(id); + + if (cachedEntity == null) { + cachedEntity = new Entity(entity); + cache.put(id, cachedEntity); + } + + return cachedEntity; + } + + public static void clearCache() { + cache.clear(); + } + + public boolean allowEditing() { + if (!(entity instanceof EntityPlayer)) { + return false; + } + return (((EntityPlayer) entity).capabilities.allowEdit); + } + + public double distanceTo(Vec3 position) { + return entity.getDistance(position.x, position.y, position.z); + } + + public double distanceToSq(Vec3 position) { + return entity.getDistanceSq(position.x, position.y, position.z); + } + + public double distanceToGround() { + return Utils.distanceToGround(entity); + } + + public boolean isHoldingBlock() { + if (this.isLiving) { + return ((EntityLivingBase) this.entity).getHeldItem() != null && ((EntityLivingBase) this.entity).getHeldItem().getItem() instanceof ItemBlock; + } + return false; + } + + public float getAbsorption() { + if (!(entity instanceof EntityLivingBase)) { + return -1; + } + return (((EntityLivingBase) entity).getAbsorptionAmount()); + } + + public Vec3 getBlockPosition() { + return new Vec3(entity.getPosition().getX(), entity.getPosition().getY(), entity.getPosition().getZ()); + } + + public String getDisplayName() { + if (this.entity instanceof EntityItem) { + return ((EntityItem)this.entity).getEntityItem().getDisplayName(); + } + return this.entity.getDisplayName().getUnformattedText(); + } + + public Entity getRidingEntity() { + return Entity.convert(this.entity.ridingEntity); + } + + public Entity getRiddenByEntity() { + return Entity.convert(this.entity.riddenByEntity); + } + + public Vec3 getServerPosition() { + return new Vec3(entity.serverPosX, entity.serverPosY, entity.serverPosZ); + } + + public int getExperienceLevel() { + if (!(entity instanceof EntityPlayer)) { + return 0; + } + return ((EntityPlayer) entity).experienceLevel; + } + + public float getExperience() { + if (!(entity instanceof EntityPlayer)) { + return 0; + } + return ((EntityPlayer) entity).experience; + } + + public float getFallDistance() { + return entity.fallDistance; + } + + public String getUUID() { + return this.entity.getUniqueID().toString(); + } + + public double getBPS() { + if (!this.isLiving) { + return 0.0; + } + double x = this.entity.posX - this.entity.prevPosX; + double z = this.entity.posZ - this.entity.prevPosZ; + return Math.sqrt(x * x + z * z) * 20.0; + } + + public String getFacing() { + return this.entity.getHorizontalFacing().name(); + } + + public float getHealth() { + if (!(entity instanceof EntityLivingBase)) { + return -1; + } + return ((EntityLivingBase) entity).getHealth(); + } + + public boolean isSleeping() { + if (this.isPlayer) { + return ((EntityPlayer) this.entity).isPlayerSleeping(); + } + return false; + } + + public float getEyeHeight() { + return entity.getEyeHeight(); + } + + public float getHeight() { + return entity.height; + } + + public float getWidth() { + return entity.width; + } + + public boolean isBurning() { + return entity.isBurning(); + } + + public ItemStack getHeldItem() { + if (entity instanceof EntityItem) { + net.minecraft.item.ItemStack item = ((EntityItem) entity).getEntityItem(); + if (item == null) { + return null; + } + return new ItemStack(item, (byte) 0); + } + else if (!(entity instanceof EntityLivingBase)) { + return null; + } + net.minecraft.item.ItemStack stack = ((EntityLivingBase) entity).getHeldItem(); + if (stack == null) { + return null; + } + return new ItemStack(stack, (byte) 0); + } + + public int getHurtTime() { + if (!(entity instanceof EntityLivingBase)) { + return -1; + } + return ((EntityLivingBase) entity).hurtTime; + } + + public boolean isConsuming() { + return this.entity.isEating(); + } + + public Vec3 getLastPosition() { + return new Vec3(entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ); + } + + public float getMaxHealth() { + if (!(entity instanceof EntityLivingBase)) { + return -1; + } + return ((EntityLivingBase) entity).getMaxHealth(); + } + + public int getMaxHurtTime() { + if (!(entity instanceof EntityLivingBase)) { + return -1; + } + return ((EntityLivingBase) entity).maxHurtTime; + } + + public String getName() { + if (entity instanceof EntityItem) { + return ((EntityItem) entity).getEntityItem().getItem().getRegistryName().substring(10); + } + return entity.getName(); + } + + public NetworkPlayer getNetworkPlayer() { + return new NetworkPlayer(Minecraft.getMinecraft().getNetHandler().getPlayerInfo(this.entity.getUniqueID())); + } + + public float getPitch() { + return entity.rotationPitch; + } + + public Vec3 getPosition() { + if (entity == null) { + return null; + } + return new Vec3(entity.posX, entity.posY, entity.posZ); + } + + public List getPotionEffects() { + List potionEffects = new ArrayList<>(); + if (!(entity instanceof EntityLivingBase)) { + return potionEffects; + } + for (PotionEffect potionEffect : ((EntityLivingBase) entity).getActivePotionEffects()) { + Object[] potionData = new Object[]{potionEffect.getPotionID(), potionEffect.getEffectName(), potionEffect.getAmplifier(), potionEffect.getDuration()}; + potionEffects.add(potionData); + } + return potionEffects; + } + + public ItemStack getArmorInSlot(final int slot) { + return (this.isPlayer && slot >= 0 && slot <= 3) ? ItemStack.convert(((EntityPlayer)this.entity).inventory.armorInventory[slot]) : null; + } + + public double getSpeed() { + return Utils.getHorizontalSpeed(entity); + } + + public double getSwingProgress() { + if (!(entity instanceof EntityLivingBase)) { + return -1; + } + return ((EntityLivingBase) entity).swingProgress; + } + + public int getTicksExisted() { + return entity.ticksExisted; + } + + public float getYaw() { + return entity.rotationYaw; + } + + public int getFireResistance() { + return this.entity.fireResistance; + } + + public float getPrevYaw() { + return entity.prevRotationYaw; + } + + public float getPrevPitch() { + return entity.prevRotationPitch; + } + + public boolean isCreative() { + if (!(entity instanceof EntityPlayer)) { + return false; + } + return (((EntityPlayer) entity).capabilities.isCreativeMode); + } + + public boolean isCollided() { + return entity.isCollided; + } + + public boolean isCollidedHorizontally() { + return entity.isCollidedHorizontally; + } + + public boolean isCollidedVertically() { + return entity.isCollidedVertically; + } + + public boolean isDead() { + return this.entity.isDead || (this.isLiving && ((EntityLivingBase)this.entity).deathTime > 0); + } + + public boolean isInvisible() { + return entity.isInvisible(); + } + + public boolean isInWater() { + return entity.isInWater(); + } + + public boolean isInLava() { + return entity.isInLava(); + } + + public boolean isInLiquid() { + return !this.entity.isOffsetPositionInLiquid(0, 0, 0); + } + + public boolean isOnLadder() { + if (this.isLiving) { + if (((EntityLivingBase) this.entity).isOnLadder()) { + return true; + } + } + return false; + } + + public boolean isOnEdge() { + return Utils.onEdge(this.entity); + } + + public boolean isSprinting() { + return entity.isSprinting(); + } + + public boolean isSneaking() { + return entity.isSneaking(); + } + + public boolean isUsingItem() { + if (!(entity instanceof EntityPlayer)) { + return false; + } + return (((EntityPlayer) entity).isUsingItem()); + } + + public boolean onGround() { + return entity.onGround; + } + + public void setMotion(double x, double y, double z) { + entity.motionX = x; + entity.motionY = y; + entity.motionZ = z; + } + + public Vec3 getMotion() { + return new Vec3(entity.motionX, entity.motionY, entity.motionZ); + } + + public void setPitch(float pitch) { + entity.rotationPitch = pitch; + } + + public void setYaw(float yaw) { + entity.rotationYaw = yaw; + } + + public void setPosition(Vec3 position) { + entity.setPosition(position.x, position.y, position.z); + } + + public void setPosition(double x, double y, double z) { + entity.setPosition(x, y, z); + } +} diff --git a/src/main/java/keystrokesmod/script/classes/Image.java b/src/main/java/keystrokesmod/script/classes/Image.java new file mode 100644 index 0000000..71c2203 --- /dev/null +++ b/src/main/java/keystrokesmod/script/classes/Image.java @@ -0,0 +1,58 @@ +package keystrokesmod.script.classes; + +import keystrokesmod.script.ScriptDefaults; +import keystrokesmod.utility.NetworkUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; + +import java.awt.image.BufferedImage; +import java.util.HashMap; + +public class Image { + private static HashMap imageCache = new HashMap<>(); + public String url; + public BufferedImage bufferedImage; + public int height; + public int width; + public int textureId; + public boolean cached; + + public Image(String url, boolean cached) { + this.textureId = -1; + this.url = url; + this.cached = cached; + final BufferedImage cachedImage = cached ? imageCache.get(url) : null; + if (cachedImage == null) { + ScriptDefaults.client.async(() -> { + BufferedImage newImage = NetworkUtils.getImageFromURL(url); + if (newImage != null) { + this.bufferedImage = newImage; + this.height = newImage.getHeight(); + this.width = newImage.getWidth(); + if (cached) { + imageCache.put(url, newImage); + } + } + }); + } + else { + this.bufferedImage = cachedImage; + this.height = cachedImage.getHeight(); + this.width = cachedImage.getWidth(); + } + } + + public float[] getDimensions() { + final int scaleFactor = new ScaledResolution(Minecraft.getMinecraft()).getScaleFactor(); + return new float[] { this.width / scaleFactor, this.height / scaleFactor }; + } + + public boolean isLoaded() { + return this.bufferedImage != null; + } + + @Override + public String toString() { + return "Image(" + this.height + "," + this.width + "," + this.url + ")"; + } +} diff --git a/src/main/java/keystrokesmod/script/classes/ItemStack.java b/src/main/java/keystrokesmod/script/classes/ItemStack.java new file mode 100644 index 0000000..50ab8be --- /dev/null +++ b/src/main/java/keystrokesmod/script/classes/ItemStack.java @@ -0,0 +1,99 @@ +package keystrokesmod.script.classes; + +import net.minecraft.client.Minecraft; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class ItemStack { + public String type; + public String name; + public String displayName; + public int stackSize; + public int maxStackSize; + public int durability; + public int maxDurability; + public boolean isBlock; + public net.minecraft.item.ItemStack itemStack; + public int meta; + + public ItemStack(net.minecraft.item.ItemStack itemStack, byte f1) { + if (itemStack == null) { + return; + } + this.itemStack = itemStack; + this.isBlock = itemStack.getItem() instanceof ItemBlock; + this.type = isBlock ? ((ItemBlock) itemStack.getItem()).getBlock().getClass().getSimpleName() : itemStack.getItem().getClass().getSimpleName(); + this.name = itemStack.getItem().getRegistryName().substring(10); // substring 10 to remove "minecraft:" + this.displayName = itemStack.getDisplayName(); + this.stackSize = itemStack.stackSize; + this.maxStackSize = itemStack.getMaxStackSize(); + this.durability = itemStack.getMaxDamage() - itemStack.getItemDamage(); + this.maxDurability = itemStack.getMaxDamage(); + this.meta = itemStack.getMetadata(); + } + + public ItemStack(String name) { + this(withMeta(name), (byte) 0); + } + + private static net.minecraft.item.ItemStack withMeta(String name) { + String[] parts = name.split(":"); + String itemName = parts[0]; + int meta = 0; + + if (parts.length > 1) { + meta = parseMeta(parts[1]); + } + + net.minecraft.item.Item item = Item.itemRegistry.getObject(new ResourceLocation("minecraft:" + itemName)); + return new net.minecraft.item.ItemStack(item, 1, meta); + } + + private static int parseMeta(String metaStr) { + try { + return Integer.parseInt(metaStr); + } + catch (NumberFormatException e) { + return 0; + } + } + + public List getTooltip() { + return this.itemStack.getTooltip(Minecraft.getMinecraft().thePlayer, true); + } + + public List getEnchantments() { + Map enchants = EnchantmentHelper.getEnchantments(this.itemStack); + if (enchants.isEmpty()) { + return null; + } + List enchantments = new ArrayList<>(); + for (Map.Entry entry : enchants.entrySet()) { + Enchantment enchant = Enchantment.getEnchantmentById((int)entry.getKey()); + String name = StatCollector.translateToFallback(enchant.getName()).toLowerCase().replace(" ", "_"); + enchantments.add(new Object[] { name, entry.getValue() }); + } + return enchantments; + } + + public static ItemStack convert(net.minecraft.item.ItemStack itemStack) { + if (itemStack == null) { + return null; + } + return new ItemStack(itemStack, (byte) 0); + } + + @Override + public String toString() { + return "ItemStack(" + this.type + "," + this.name + ")"; + } +} diff --git a/src/main/java/keystrokesmod/script/classes/Json.java b/src/main/java/keystrokesmod/script/classes/Json.java new file mode 100644 index 0000000..533c45a --- /dev/null +++ b/src/main/java/keystrokesmod/script/classes/Json.java @@ -0,0 +1,86 @@ +package keystrokesmod.script.classes; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import keystrokesmod.utility.Utils; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class Json { + private JsonElement json; + + public Json(String jsonString) { + this.json = (new JsonParser()).parse(jsonString); + } + + protected Json(JsonElement json, byte s) { + this.json = json; + } + + public boolean equals(final Json json) { + return json != null && (this.json == json.json || (this.exists() && json.exists() && this.string().equals(json.string()))); + } + + public boolean exists() { + return json != null; + } + + public String string() { + if (this.exists()) { + if (!this.json.isJsonArray()) { + try { + return this.json.getAsString(); + } + catch (UnsupportedOperationException ex) {} + } + return this.json.toString(); + } + return ""; + } + + public String get(final String member) { + return Utils.getString((JsonObject)this.json, member); + } + + public String get(final String member, final String defaultValue) { + final String value = this.get(member); + return value.isEmpty() ? defaultValue : value; + } + + public Json object() { + return this.object(null); + } + + public Json object(final String member) { + return new Json((member == null) ? this.json.getAsJsonObject() : ((JsonObject)this.json).getAsJsonObject(member), (byte) 0); + } + + public List array() { + return this.array(null); + } + + public List array(final String member) { + final List jsonList = new ArrayList<>(); + for (final JsonElement element : (member == null) ? this.json.getAsJsonArray() : ((JsonObject)this.json).getAsJsonArray(member)) { + jsonList.add(new Json(element, (byte) 0)); + } + return jsonList; + } + + public Map map() { + final HashMap map = new HashMap<>(); + for (final Map.Entry entry : ((JsonObject)this.json).entrySet()) { + map.put(entry.getKey(), new Json(entry.getValue(), (byte) 0)); + } + return map; + } + + @Override + public String toString() { + return this.json.toString(); + } +} diff --git a/src/main/java/keystrokesmod/script/classes/NetworkPlayer.java b/src/main/java/keystrokesmod/script/classes/NetworkPlayer.java new file mode 100644 index 0000000..bfbb535 --- /dev/null +++ b/src/main/java/keystrokesmod/script/classes/NetworkPlayer.java @@ -0,0 +1,56 @@ +package keystrokesmod.script.classes; + +import com.google.common.collect.Iterables; +import com.mojang.authlib.properties.Property; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.scoreboard.ScorePlayerTeam; + +import java.nio.charset.StandardCharsets; +import java.util.Base64; + +public class NetworkPlayer { + private NetworkPlayerInfo networkPlayerInfo; + public NetworkPlayer(NetworkPlayerInfo networkPlayerInfo) { + this.networkPlayerInfo = networkPlayerInfo; + } + + public String getCape() { + return networkPlayerInfo.getLocationCape().getResourcePath(); + } + + public String getDisplayName() { + if (networkPlayerInfo == null) { + return ""; + } + return networkPlayerInfo.getDisplayName() != null ? networkPlayerInfo.getDisplayName().getFormattedText() : ScorePlayerTeam.formatPlayerName(networkPlayerInfo.getPlayerTeam(), networkPlayerInfo.getGameProfile().getName()); + } + + public String getName() { + if (networkPlayerInfo == null) { + return ""; + } + return networkPlayerInfo.getGameProfile().getName(); + } + + public int getPing() { + if (networkPlayerInfo == null) { + return 0; + } + return networkPlayerInfo.getResponseTime(); + } + + public String getSkinData() { + final Property texture = (Property) Iterables.getFirst(networkPlayerInfo.getGameProfile().getProperties().get("textures"), (Object)null); + if (texture == null) { + return null; + } + return new String(Base64.getDecoder().decode(texture.getValue().getBytes(StandardCharsets.UTF_8))); + } + + public String getUUID() { + if (networkPlayerInfo == null) { + return ""; + } + return networkPlayerInfo.getGameProfile().getId().toString(); + } +} diff --git a/src/main/java/keystrokesmod/script/classes/PlayerState.java b/src/main/java/keystrokesmod/script/classes/PlayerState.java new file mode 100644 index 0000000..0790ec5 --- /dev/null +++ b/src/main/java/keystrokesmod/script/classes/PlayerState.java @@ -0,0 +1,40 @@ +package keystrokesmod.script.classes; + +import keystrokesmod.event.PreMotionEvent; + +public class PlayerState { + public double x; + public double y; + public double z; + public float yaw; + public float pitch; + public boolean onGround; + public boolean isSprinting; + public boolean isSneaking; + + public PlayerState(PreMotionEvent e, byte f1) { + this.x = e.getPosX(); + this.y = e.getPosY(); + this.z = e.getPosZ(); + this.yaw = e.getYaw(); + this.pitch = e.getPitch(); + this.onGround = e.isOnGround(); + this.isSprinting = e.isSprinting(); + this.isSneaking = e.isSneaking(); + } + + public PlayerState(Object[] state) { + this.x = (double) state[0]; + this.y = (double) state[1]; + this.z = (double) state[2]; + this.yaw = (float) state[3]; + this.pitch = (float) state[4]; + this.onGround = (boolean) state[5]; + this.isSprinting = (boolean) state[6]; + this.isSneaking = (boolean) state[7]; + } + + public Object[] asArray() { + return new Object[] { this.x, this.y, this.z, this.yaw, this.pitch, this.onGround, this.isSprinting, this.isSneaking }; + } +} diff --git a/src/main/java/keystrokesmod/script/classes/Request.java b/src/main/java/keystrokesmod/script/classes/Request.java new file mode 100644 index 0000000..b54030a --- /dev/null +++ b/src/main/java/keystrokesmod/script/classes/Request.java @@ -0,0 +1,98 @@ +package keystrokesmod.script.classes; + +import java.io.IOException; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; + +public class Request { + public String method; + public String url; + public List headers = new ArrayList<>(); + public String userAgent; + public int connectionTimeout; + public int readTimeout; + public String content = ""; + + public Request(String method, String URL) { + if (!method.equals("POST") && !method.equals("GET")) { + this.method = "GET"; + } + else { + this.method = method; + } + this.url = URL; + this.userAgent = ""; + this.readTimeout = 5000; + this.connectionTimeout = 5000; + + } + + public void addHeader(String header, String value) { + this.headers.add(new String[]{header, value}); + } + + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } + + public void setConnectTimeout(int timeout) { + this.connectionTimeout = timeout; + } + + public void setReadTimeout(int timeout) { + this.readTimeout = timeout; + } + + public void setContent(String content) { + this.content = content; + } + + public Response fetch() { + HttpURLConnection con = null; + try { + URL url = new URL(this.url); + con = (HttpURLConnection) url.openConnection(); + con.setRequestMethod(this.method); + if (!userAgent.isEmpty()) { + con.setRequestProperty("User-Agent", this.userAgent); + } + if (headers != null && !headers.isEmpty()) { + for (String[] header : headers) { + con.setRequestProperty(header[0], header[1]); + } + } + if (connectionTimeout > 0) { + con.setConnectTimeout(connectionTimeout); + } + if (readTimeout > 0) { + con.setReadTimeout(readTimeout); + } + if (!content.isEmpty() && method.equals("POST")) { + con.setDoOutput(true); + OutputStream stream = con.getOutputStream(); + stream.write(content.getBytes()); + stream.close(); + con.getInputStream().close(); + } + } catch (IOException iOException) { + iOException.printStackTrace(); + } + finally { + if (con != null) { + con.disconnect(); + } + } + if (con == null) { + return null; + } + return new Response(con); + } + + @Override + public String toString() { + return "Request(" + this.method + "," + this.url + ")"; + } +} diff --git a/src/main/java/keystrokesmod/script/classes/Response.java b/src/main/java/keystrokesmod/script/classes/Response.java new file mode 100644 index 0000000..305415b --- /dev/null +++ b/src/main/java/keystrokesmod/script/classes/Response.java @@ -0,0 +1,37 @@ +package keystrokesmod.script.classes; + +import com.google.gson.JsonParser; +import keystrokesmod.utility.NetworkUtils; + +import java.io.IOException; +import java.net.HttpURLConnection; + +public class Response { + private HttpURLConnection connection; + + protected Response(HttpURLConnection connection) { + this.connection = connection; + } + + public int code() { + try { + return this.connection.getResponseCode(); + } + catch (IOException e) { + return 0; + } + } + + public String string() { + return NetworkUtils.getTextFromConnection(this.connection, false); + } + + public Json json() { + return new Json((new JsonParser()).parse(NetworkUtils.getTextFromConnection(this.connection, false)).getAsJsonObject(), (byte) 0); + } + + @Override + public String toString() { + return "Response(" + this.code() + ")"; + } +} diff --git a/src/main/java/keystrokesmod/script/classes/TileEntity.java b/src/main/java/keystrokesmod/script/classes/TileEntity.java new file mode 100644 index 0000000..10f6841 --- /dev/null +++ b/src/main/java/keystrokesmod/script/classes/TileEntity.java @@ -0,0 +1,36 @@ +package keystrokesmod.script.classes; + +import net.minecraft.tileentity.TileEntitySkull; + +public class TileEntity { + private net.minecraft.tileentity.TileEntity tileEntity; + private Vec3 position; + + public String type; + public String name; + + public TileEntity(net.minecraft.tileentity.TileEntity tileEntity) { + this.tileEntity = tileEntity; + this.position = new Vec3(tileEntity.getPos().getX(), tileEntity.getPos().getY(), tileEntity.getPos().getZ()); + this.type = tileEntity.getBlockType().getClass().getSimpleName(); + this.name = tileEntity.getBlockType().getRegistryName().replace("minecraft:", ""); + } + + public Vec3 getPosition() { + return position; + } + + public Object[] getSkullData() { + if (!(this.tileEntity instanceof TileEntitySkull)) { + return null; + } + TileEntitySkull skull = (TileEntitySkull) this.tileEntity; + String name = ""; + String uuid = ""; + if (skull.getPlayerProfile() != null) { + name = skull.getPlayerProfile().getName(); + uuid = skull.getPlayerProfile().getId().toString(); + } + return new Object[] { skull.getSkullType(), skull.getSkullRotation(), name, uuid }; + } +} diff --git a/src/main/java/keystrokesmod/script/classes/Vec3.java b/src/main/java/keystrokesmod/script/classes/Vec3.java new file mode 100644 index 0000000..544653d --- /dev/null +++ b/src/main/java/keystrokesmod/script/classes/Vec3.java @@ -0,0 +1,92 @@ +package keystrokesmod.script.classes; + +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; + +public class Vec3 { + public double x, y, z; + + public Vec3(double x, double y, double z) { + this.x = x; + this.y = y; + this.z = z; + } + + public Vec3(net.minecraft.util.Vec3 minecraftVec3) { + this.x = minecraftVec3.xCoord; + this.y = minecraftVec3.yCoord; + this.z = minecraftVec3.zCoord; + } + + public boolean equals(Vec3 vector2) { + if (this == vector2) { + return true; + } + else if (this.x == vector2.x && this.y == vector2.y && this.z == vector2.z) { + return true; + } + return false; + } + + public Vec3 offset(Vec3 position) { + return new Vec3(this.x + position.x, this.y + position.y, this.z + position.z); + } + + public Vec3 offset(double x, double y, double z) { + return new Vec3(this.x + x, this.y + y, this.z + z); + } + + public Vec3 ceil() { + return new Vec3(Math.ceil(this.x), Math.ceil(this.y), Math.ceil(this.z)); + } + + public Vec3 floor() { + return new Vec3(Math.floor(this.x), Math.floor(this.y), Math.floor(this.z)); + } + + public Vec3 inverse() { + return new Vec3(-this.x, -this.y, -this.z); + } + + public Vec3 translate(Vec3 position) { + return this.offset(position.x, position.y, position.z); + } + + public Vec3 translate(double x, double y, double z) { + return this.offset(x, y, z); + } + + public static Vec3 convert(BlockPos blockPos) { + if (blockPos == null) { + return null; + } + return new Vec3(blockPos.getX(), blockPos.getY(), blockPos.getZ()); + } + + public double distanceTo(Vec3 vec3) { + double deltaX = this.x - vec3.x; + double deltaY = this.y - vec3.y; + double deltaZ = this.z - vec3.z; + return MathHelper.sqrt_double(deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ); + } + + public double distanceToSq(Vec3 vec3) { + double deltaX = this.x - vec3.x; + double deltaY = this.y - vec3.y; + double deltaZ = this.z - vec3.z; + return deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ; + } + + public static BlockPos getBlockPos(Vec3 blockPos) { + return new BlockPos(blockPos.x, blockPos.y, blockPos.z); + } + + public static net.minecraft.util.Vec3 getVec3(Vec3 vec3) { + return new net.minecraft.util.Vec3(vec3.x, vec3.y, vec3.z); + } + + @Override + public String toString() { + return "Vec3(" + this.x + "," + this.y + "," + this.z + ")"; + } +} diff --git a/src/main/java/keystrokesmod/script/classes/World.java b/src/main/java/keystrokesmod/script/classes/World.java new file mode 100644 index 0000000..ef3eee5 --- /dev/null +++ b/src/main/java/keystrokesmod/script/classes/World.java @@ -0,0 +1,100 @@ +package keystrokesmod.script.classes; + +import keystrokesmod.utility.BlockUtils; +import keystrokesmod.utility.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.init.Blocks; +import net.minecraft.scoreboard.Team; +import net.minecraft.util.BlockPos; + +import java.util.*; + +public class World { + private Minecraft mc = Minecraft.getMinecraft(); + + public Block getBlockAt(int x, int y, int z) { + net.minecraft.block.Block block = BlockUtils.getBlock(new BlockPos(x, y, z)); + if (block == null) { + return new Block(Blocks.air, new BlockPos(x, y, z)); + } + return new Block(block, new BlockPos(x, y, z)); + + } + + public Block getBlockAt(Vec3 pos) { + net.minecraft.block.Block block = BlockUtils.getBlock(new BlockPos(pos.x, pos.y, pos.z)); + if (block == null) { + return new Block(Blocks.air, new BlockPos(pos.x, pos.y, pos.z)); + } + return new Block(block, new BlockPos(pos.x, pos.y, pos.z)); + } + + public String getDimension() { + if (mc.theWorld == null) { + return ""; + } + return mc.theWorld.provider.getDimensionName(); + } + + public List getEntities() { + List entities = new ArrayList<>(); + for (net.minecraft.entity.Entity entity : mc.theWorld.loadedEntityList) { + entities.add(Entity.convert(entity)); + } + return entities; + } + + public Entity getEntityById(int entityId) { + for (net.minecraft.entity.Entity entity : mc.theWorld.loadedEntityList) { + if (entity.getEntityId() == entityId) { + return Entity.convert(entity); + } + } + return null; + } + + public List getNetworkPlayers() { + List entities = new ArrayList<>(); + for (NetworkPlayerInfo networkPlayerInfo : Utils.getTablist(false)) { + entities.add(new NetworkPlayer(networkPlayerInfo)); + } + return entities; + } + + public List getPlayerEntities() { + List entities = new ArrayList<>(); + for (net.minecraft.entity.Entity entity : mc.theWorld.playerEntities) { + entities.add(Entity.convert(entity)); + } + return entities; + } + + public List getScoreboard() { + List sidebarLines = Utils.getSidebarLines(); + if (sidebarLines.isEmpty()) { + return null; + } + return sidebarLines; + } + + public Map> getTeams() { + Map> teams = new HashMap<>(); + for (Team team : mc.theWorld.getScoreboard().getTeams()) { + List members = new ArrayList<>(); + for (String member : team.getMembershipCollection()) { + members.add(member); + } + teams.put(team.getRegisteredName(), members); + } + return teams; + } + + public List getTileEntities() { + List tileEntities = new ArrayList<>(); + for (net.minecraft.tileentity.TileEntity entity : mc.theWorld.loadedTileEntityList) { + tileEntities.add(new TileEntity(entity)); + } + return tileEntities; + } +} diff --git a/src/main/java/keystrokesmod/script/packets/clientbound/S06.java b/src/main/java/keystrokesmod/script/packets/clientbound/S06.java new file mode 100644 index 0000000..1da45e5 --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/clientbound/S06.java @@ -0,0 +1,24 @@ +package keystrokesmod.script.packets.clientbound; + +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S06PacketUpdateHealth; + +public class S06 extends SPacket { + public float health; + public float saturation; + public int food; + + public S06(S06PacketUpdateHealth packet) { + super(packet); + this.health = packet.getHealth(); + this.saturation = packet.getSaturationLevel(); + this.food = packet.getFoodLevel(); + } + + public S06(float health, float saturation, int food) { + super(new S06PacketUpdateHealth(health, food, saturation)); + this.health = health; + this.saturation = saturation; + this.food = food; + } +} diff --git a/src/main/java/keystrokesmod/script/packets/clientbound/S08.java b/src/main/java/keystrokesmod/script/packets/clientbound/S08.java new file mode 100644 index 0000000..cc9addf --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/clientbound/S08.java @@ -0,0 +1,17 @@ +package keystrokesmod.script.packets.clientbound; + +import keystrokesmod.script.classes.Vec3; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; + +public class S08 extends SPacket { + public Vec3 position; + public float yaw; + public float pitch; + + public S08(S08PacketPlayerPosLook packet) { + super(packet); + this.position = new Vec3(packet.getX(), packet.getY(), packet.getZ()); + this.yaw = packet.getYaw(); + this.pitch = packet.getPitch(); + } +} diff --git a/src/main/java/keystrokesmod/script/packets/clientbound/S12.java b/src/main/java/keystrokesmod/script/packets/clientbound/S12.java new file mode 100644 index 0000000..a10d01f --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/clientbound/S12.java @@ -0,0 +1,22 @@ +package keystrokesmod.script.packets.clientbound; + +import keystrokesmod.script.classes.Vec3; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S12PacketEntityVelocity; + +public class S12 extends SPacket { + public int entityId; + public Vec3 motion; + + public S12(S12PacketEntityVelocity packet) { + super(packet); + this.entityId = packet.getEntityID(); + this.motion = new Vec3(packet.getMotionX(), packet.getMotionY(), packet.getMotionZ()); + } + + public S12(int entityId, Vec3 motion) { + super(new S12PacketEntityVelocity(entityId, motion.x, motion.y, motion.z)); + this.entityId = entityId; + this.motion = motion; + } +} diff --git a/src/main/java/keystrokesmod/script/packets/clientbound/S23.java b/src/main/java/keystrokesmod/script/packets/clientbound/S23.java new file mode 100644 index 0000000..af0582b --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/clientbound/S23.java @@ -0,0 +1,25 @@ +package keystrokesmod.script.packets.clientbound; + +import keystrokesmod.script.classes.Block; +import keystrokesmod.script.classes.Vec3; +import net.minecraft.client.Minecraft; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.util.BlockPos; + +public class S23 extends SPacket { + public Vec3 position; + public Block block; + + public S23(S23PacketBlockChange packet) { + super(packet); + this.position = Vec3.convert(packet.getBlockPosition()); + this.block = new Block(packet.getBlockState().getBlock(), new BlockPos(position.x, position.y, position.z)); + } + + public S23(Vec3 position) { + super(new S23PacketBlockChange(Minecraft.getMinecraft().theWorld, Vec3.getBlockPos(position))); + this.position = position; + this.block = new Block(position); + } +} diff --git a/src/main/java/keystrokesmod/script/packets/clientbound/S27.java b/src/main/java/keystrokesmod/script/packets/clientbound/S27.java new file mode 100644 index 0000000..c90a535 --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/clientbound/S27.java @@ -0,0 +1,17 @@ +package keystrokesmod.script.packets.clientbound; + +import keystrokesmod.script.classes.Vec3; +import net.minecraft.network.play.server.S27PacketExplosion; + +public class S27 extends SPacket { + public float strength; + public Vec3 position; + public Vec3 motion; + + public S27(S27PacketExplosion packet) { + super(packet); + this.strength = packet.getStrength(); + this.position = new Vec3(packet.getX(), packet.getY(), packet.getZ()); + this.motion = new Vec3(packet.func_149149_c(), packet.func_149144_d(), packet.func_149147_e()); + } +} diff --git a/src/main/java/keystrokesmod/script/packets/clientbound/S29.java b/src/main/java/keystrokesmod/script/packets/clientbound/S29.java new file mode 100644 index 0000000..ac216dd --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/clientbound/S29.java @@ -0,0 +1,27 @@ +package keystrokesmod.script.packets.clientbound; + +import keystrokesmod.script.classes.Vec3; +import net.minecraft.network.play.server.S29PacketSoundEffect; + +public class S29 extends SPacket { + public String sound; + public Vec3 position; + public float volume; + public float pitch; + + public S29(S29PacketSoundEffect packet) { + super(packet); + this.sound = packet.getSoundName(); + this.position = new Vec3(packet.getX(), packet.getY(), packet.getZ()); + this.volume = packet.getVolume(); + this.pitch = packet.getPitch(); + } + + public S29(String sound, Vec3 position, float volume, float pitch) { + super(new S29PacketSoundEffect(sound, position.x, position.y, position.z, volume, pitch)); + this.sound = sound; + this.position = position; + this.volume = volume; + this.pitch = pitch; + } +} diff --git a/src/main/java/keystrokesmod/script/packets/clientbound/S2A.java b/src/main/java/keystrokesmod/script/packets/clientbound/S2A.java new file mode 100644 index 0000000..b27ee60 --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/clientbound/S2A.java @@ -0,0 +1,23 @@ +package keystrokesmod.script.packets.clientbound; + +import keystrokesmod.script.classes.Vec3; +import net.minecraft.network.play.server.S2APacketParticles; + +public class S2A extends SPacket { + public String type; + public Vec3 position; + public Vec3 offset; + public float speed; + public int count; + public int[] args; + + public S2A(S2APacketParticles packet) { + super(packet); + this.type = packet.getParticleType().name(); + this.position = new Vec3(packet.getXCoordinate(), packet.getYCoordinate(), packet.getZCoordinate()); + this.offset = new Vec3(packet.getXOffset(), packet.getYOffset(), packet.getZOffset()); + this.speed = packet.getParticleSpeed(); + this.count = packet.getParticleCount(); + this.args = packet.getParticleArgs(); + } +} diff --git a/src/main/java/keystrokesmod/script/packets/clientbound/S2F.java b/src/main/java/keystrokesmod/script/packets/clientbound/S2F.java new file mode 100644 index 0000000..9492da2 --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/clientbound/S2F.java @@ -0,0 +1,24 @@ +package keystrokesmod.script.packets.clientbound; + +import keystrokesmod.script.classes.ItemStack; +import net.minecraft.network.play.server.S2FPacketSetSlot; + +public class S2F extends SPacket { + public int windowId; + public int slot; + public ItemStack itemStack; + + public S2F(S2FPacketSetSlot packet) { + super(packet); + this.windowId = packet.func_149175_c(); + this.slot = packet.func_149173_d(); + this.itemStack = ItemStack.convert(packet.func_149174_e()); + } + + public S2F(int windowId, int slot, ItemStack itemStack) { + super(new S2FPacketSetSlot(windowId, slot, itemStack.itemStack)); + this.windowId = windowId; + this.slot = slot; + this.itemStack = itemStack; + } +} diff --git a/src/main/java/keystrokesmod/script/packets/clientbound/S3A.java b/src/main/java/keystrokesmod/script/packets/clientbound/S3A.java new file mode 100644 index 0000000..97278b6 --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/clientbound/S3A.java @@ -0,0 +1,17 @@ +package keystrokesmod.script.packets.clientbound; + +import net.minecraft.network.play.server.S3APacketTabComplete; + +public class S3A extends SPacket { + public String[] matches; + + public S3A(S3APacketTabComplete packet, byte f) { + super(packet); + this.matches = packet.func_149630_c(); + } + + public S3A(String[] matches) { + super(new S3APacketTabComplete(matches)); + this.matches = matches; + } +} diff --git a/src/main/java/keystrokesmod/script/packets/clientbound/S3E.java b/src/main/java/keystrokesmod/script/packets/clientbound/S3E.java new file mode 100644 index 0000000..7f4dd9e --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/clientbound/S3E.java @@ -0,0 +1,44 @@ +package keystrokesmod.script.packets.clientbound; + +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S3EPacketTeams; + +import java.util.Collection; + +public class S3E extends SPacket { + public String name; + public String displayName; + public String prefix; + public String suffix; + public String nametagVisibility; + public Collection playerList; + public int action; + public int friendlyFlags; + public int color; + + public S3E(S3EPacketTeams packet) { + super(packet); + this.name = packet.func_149312_c(); + this.displayName = packet.func_149306_d(); + this.prefix = packet.func_149311_e(); + this.suffix = packet.func_149309_f(); + this.nametagVisibility = packet.func_179814_i(); + this.playerList = packet.func_149310_g(); + this.action = packet.func_149307_h(); + this.friendlyFlags = packet.func_149308_i(); + this.color = packet.func_179813_h(); + } + + public S3E(Packet packet, String name, String displayName, String prefix, String suffix, String nametagVisibility, Collection playerList, int action, int friendlyFlags, int color) { + super(packet); + this.name = name; + this.displayName = displayName; + this.prefix = prefix; + this.suffix = suffix; + this.nametagVisibility = nametagVisibility; + this.playerList = playerList; + this.action = action; + this.friendlyFlags = friendlyFlags; + this.color = color; + } +} diff --git a/src/main/java/keystrokesmod/script/packets/clientbound/S48.java b/src/main/java/keystrokesmod/script/packets/clientbound/S48.java new file mode 100644 index 0000000..82a3182 --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/clientbound/S48.java @@ -0,0 +1,20 @@ +package keystrokesmod.script.packets.clientbound; + +import net.minecraft.network.play.server.S48PacketResourcePackSend; + +public class S48 extends SPacket { + public String url; + public String hash; + + public S48(S48PacketResourcePackSend packet) { + super(packet); + this.url = packet.getURL(); + this.hash = packet.getHash(); + } + + public S48(String url, String hash) { + super(new S48PacketResourcePackSend(url, hash)); + this.url = url; + this.hash = hash; + } +} diff --git a/src/main/java/keystrokesmod/script/packets/clientbound/SPacket.java b/src/main/java/keystrokesmod/script/packets/clientbound/SPacket.java new file mode 100644 index 0000000..b3679b4 --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/clientbound/SPacket.java @@ -0,0 +1,11 @@ +package keystrokesmod.script.packets.clientbound; + +public class SPacket { + public String name; + public net.minecraft.network.Packet packet; + + public SPacket(net.minecraft.network.Packet packet) { + this.packet = packet; + this.name = packet.getClass().getSimpleName(); + } +} diff --git a/src/main/java/keystrokesmod/script/packets/serverbound/C01.java b/src/main/java/keystrokesmod/script/packets/serverbound/C01.java new file mode 100644 index 0000000..a5a8749 --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/serverbound/C01.java @@ -0,0 +1,22 @@ +package keystrokesmod.script.packets.serverbound; + +import net.minecraft.network.play.client.C01PacketChatMessage; + +public class C01 extends CPacket { + public String message; + + public C01(String message) { + super(null); + this.message = message; + } + + public C01(C01PacketChatMessage packet, byte f) { + super(packet); + this.message = packet.getMessage(); + } + + @Override + public C01PacketChatMessage convert() { + return new C01PacketChatMessage(this.message); + } +} diff --git a/src/main/java/keystrokesmod/script/packets/serverbound/C02.java b/src/main/java/keystrokesmod/script/packets/serverbound/C02.java new file mode 100644 index 0000000..81067aa --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/serverbound/C02.java @@ -0,0 +1,43 @@ +package keystrokesmod.script.packets.serverbound; + +import keystrokesmod.script.classes.Entity; +import keystrokesmod.script.classes.Vec3; +import keystrokesmod.utility.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.network.play.client.C02PacketUseEntity; + +public class C02 extends CPacket { + public Entity entity; + public String action; + public Vec3 hitVec; + + public C02(Entity entity, String action, Vec3 hitVec) { + super(null); + this.entity = entity; + this.action = action; + this.hitVec = hitVec; + } + + public C02(C02PacketUseEntity packet) { + super(packet); + if (packet.getEntityFromWorld(Minecraft.getMinecraft().theWorld) == null) { + this.entity = null; + } + else { + this.entity = Entity.convert(packet.getEntityFromWorld(Minecraft.getMinecraft().theWorld)); + } + this.action = packet.getAction().name(); + if (packet.getHitVec() != null) { + this.hitVec = new Vec3(packet.getHitVec().xCoord, packet.getHitVec().yCoord, packet.getHitVec().zCoord); + } + } + + @Override + public C02PacketUseEntity convert() { + C02PacketUseEntity.Action action = Utils.getEnum(C02PacketUseEntity.Action.class, this.action); + if (this.hitVec != null && action == C02PacketUseEntity.Action.INTERACT_AT) { + return new C02PacketUseEntity(this.entity.entity, new net.minecraft.util.Vec3(this.hitVec.x, this.hitVec.y, this.hitVec.z)); + } + return new C02PacketUseEntity(this.entity.entity, action); + } +} diff --git a/src/main/java/keystrokesmod/script/packets/serverbound/C03.java b/src/main/java/keystrokesmod/script/packets/serverbound/C03.java new file mode 100644 index 0000000..49dcd8c --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/serverbound/C03.java @@ -0,0 +1,49 @@ +package keystrokesmod.script.packets.serverbound; + +import keystrokesmod.script.classes.Vec3; +import net.minecraft.network.play.client.C03PacketPlayer; + +public class C03 extends CPacket { + public Vec3 position; + public float yaw; + public float pitch; + public boolean ground; + + public C03(boolean ground) { + super(new C03PacketPlayer(ground)); + this.ground = ground; + } + + public C03(Vec3 position, boolean ground) { + super(new C03PacketPlayer.C04PacketPlayerPosition(position.x, position.y, position.z, ground)); + this.position = position; + this.ground = ground; + } + + public C03(float yaw, float pitch, boolean ground) { + super(new C03PacketPlayer.C05PacketPlayerLook(yaw, pitch, ground)); + this.yaw = yaw; + this.pitch = pitch; + this.ground = ground; + } + + public C03(Vec3 position, float yaw, float pitch, boolean ground) { + super(new C03PacketPlayer.C06PacketPlayerPosLook(position.x, position.y, position.z, yaw, pitch, ground)); + this.position = position; + this.yaw = yaw; + this.pitch = pitch; + this.ground = ground; + } + + protected C03(C03PacketPlayer packet, byte f1, byte f2, byte f3, byte f4, byte f5, byte f6) { // goofy asf but cba to + super(packet); + if (packet instanceof C03PacketPlayer.C04PacketPlayerPosition || packet instanceof C03PacketPlayer.C06PacketPlayerPosLook) { + this.position = new Vec3(packet.getPositionX(), packet.getPositionY(), packet.getPositionZ()); + } + if (packet instanceof C03PacketPlayer.C05PacketPlayerLook || packet instanceof C03PacketPlayer.C06PacketPlayerPosLook) { + this.yaw = packet.getYaw(); + this.pitch = packet.getPitch(); + } + this.ground = packet.isOnGround(); + } +} diff --git a/src/main/java/keystrokesmod/script/packets/serverbound/C07.java b/src/main/java/keystrokesmod/script/packets/serverbound/C07.java new file mode 100644 index 0000000..2d838c4 --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/serverbound/C07.java @@ -0,0 +1,32 @@ +package keystrokesmod.script.packets.serverbound; + +import keystrokesmod.script.classes.Vec3; +import keystrokesmod.utility.Utils; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; + +public class C07 extends CPacket { + public Vec3 position; + public String status; + public String facing; + + public C07(Vec3 position, String status, String facing) { + super(null); + this.position = position; + this.status = status; + this.facing = facing; + } + + protected C07(C07PacketPlayerDigging packet) { + super(packet); + this.position = Vec3.convert(packet.getPosition()); + this.status = packet.getStatus().name(); + this.facing = packet.getFacing().name(); + } + + @Override + public C07PacketPlayerDigging convert() { + return new C07PacketPlayerDigging(Utils.getEnum(C07PacketPlayerDigging.Action.class, this.status), new BlockPos(this.position.x, this.position.y, this.position.z), Utils.getEnum(EnumFacing.class, this.facing)); + } +} diff --git a/src/main/java/keystrokesmod/script/packets/serverbound/C08.java b/src/main/java/keystrokesmod/script/packets/serverbound/C08.java new file mode 100644 index 0000000..df885a9 --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/serverbound/C08.java @@ -0,0 +1,33 @@ +package keystrokesmod.script.packets.serverbound; + +import keystrokesmod.script.classes.ItemStack; +import keystrokesmod.script.classes.Vec3; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; + +public class C08 extends CPacket { + public ItemStack itemStack; + public Vec3 position; + public int direction; + public Vec3 offset; + + public C08(ItemStack itemStack, Vec3 position, int direction, Vec3 offset) { + super(null); + this.itemStack = itemStack; + this.position = position; + this.direction = direction; + this.offset = offset; + } + + public C08(C08PacketPlayerBlockPlacement packet) { + super(packet); + this.itemStack = ItemStack.convert(packet.getStack()); + this.position = Vec3.convert(packet.getPosition()); + this.direction = packet.getPlacedBlockDirection(); + this.offset = new Vec3(packet.getPlacedBlockOffsetX(), packet.getPlacedBlockOffsetY(), packet.getPlacedBlockOffsetZ()); + } + + @Override + public C08PacketPlayerBlockPlacement convert() { + return new C08PacketPlayerBlockPlacement(Vec3.getBlockPos(this.position), this.direction, this.itemStack != null ? this.itemStack.itemStack : null, (float) this.offset.x, (float) this.offset.y, (float) this.offset.z); + } +} diff --git a/src/main/java/keystrokesmod/script/packets/serverbound/C09.java b/src/main/java/keystrokesmod/script/packets/serverbound/C09.java new file mode 100644 index 0000000..b209e56 --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/serverbound/C09.java @@ -0,0 +1,22 @@ +package keystrokesmod.script.packets.serverbound; + +import net.minecraft.network.play.client.C09PacketHeldItemChange; + +public class C09 extends CPacket { + public int slot; + + public C09(int slot) { + super(null); + this.slot = slot; + } + + protected C09(C09PacketHeldItemChange packet, boolean identifier) { + super(packet); + this.slot = packet.getSlotId(); + } + + @Override + public C09PacketHeldItemChange convert() { + return new C09PacketHeldItemChange(this.slot); + } +} diff --git a/src/main/java/keystrokesmod/script/packets/serverbound/C0A.java b/src/main/java/keystrokesmod/script/packets/serverbound/C0A.java new file mode 100644 index 0000000..ecea93f --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/serverbound/C0A.java @@ -0,0 +1,13 @@ +package keystrokesmod.script.packets.serverbound; + +import net.minecraft.network.play.client.C0APacketAnimation; + +public class C0A extends CPacket { + protected C0A(C0APacketAnimation packet) { + super(packet); + } + + public C0A() { + super(new C0APacketAnimation()); + } +} diff --git a/src/main/java/keystrokesmod/script/packets/serverbound/C0B.java b/src/main/java/keystrokesmod/script/packets/serverbound/C0B.java new file mode 100644 index 0000000..ff99c53 --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/serverbound/C0B.java @@ -0,0 +1,27 @@ +package keystrokesmod.script.packets.serverbound; + +import keystrokesmod.utility.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.network.Packet; +import net.minecraft.network.play.client.C0BPacketEntityAction; + +public class C0B extends CPacket { + public String action; + public int horsePower; + + public C0B(String action, int horsePower) { + super(null); + this.action = action; + this.horsePower = horsePower; + } + public C0B(C0BPacketEntityAction packet) { + super(packet); + this.action = packet.getAction().name(); + this.horsePower = packet.getAuxData(); + } + + @Override + public C0BPacketEntityAction convert() { + return new C0BPacketEntityAction(Minecraft.getMinecraft().thePlayer, Utils.getEnum(C0BPacketEntityAction.Action.class, this.action), horsePower); + } +} diff --git a/src/main/java/keystrokesmod/script/packets/serverbound/C0D.java b/src/main/java/keystrokesmod/script/packets/serverbound/C0D.java new file mode 100644 index 0000000..fd6c6b1 --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/serverbound/C0D.java @@ -0,0 +1,20 @@ +package keystrokesmod.script.packets.serverbound; + +import net.minecraft.network.play.client.C0DPacketCloseWindow; + +public class C0D extends CPacket { + public int windowId; + public C0D(int windowId) { + super(null); + this.windowId = windowId; + } + + protected C0D(C0DPacketCloseWindow packet) { + super(packet); + } + + @Override + public C0DPacketCloseWindow convert() { + return new C0DPacketCloseWindow(this.windowId); + } +} diff --git a/src/main/java/keystrokesmod/script/packets/serverbound/C0E.java b/src/main/java/keystrokesmod/script/packets/serverbound/C0E.java new file mode 100644 index 0000000..371bb3f --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/serverbound/C0E.java @@ -0,0 +1,37 @@ +package keystrokesmod.script.packets.serverbound; + +import keystrokesmod.script.classes.ItemStack; +import net.minecraft.network.play.client.C0EPacketClickWindow; + +public class C0E extends CPacket { + public int windowId; + public int slot; + public int button; + public int mode; + public short action; + public ItemStack itemStack; + + public C0E(int windowId, int slot, int button, int mode, ItemStack itemStack) { + super(null); + this.windowId = windowId; + this.slot = slot; + this.button = button; + this.mode = mode; + this.itemStack = itemStack; + } + + public C0E(C0EPacketClickWindow packet) { + super(packet); + this.windowId = packet.getWindowId(); + this.slot = packet.getSlotId(); + this.button = packet.getUsedButton(); + this.mode = packet.getMode(); + this.action = packet.getActionNumber(); + this.itemStack = new ItemStack(packet.getClickedItem(), (byte) 0); + } + + @Override + public C0EPacketClickWindow convert() { + return new C0EPacketClickWindow(this.windowId, this.slot, this.button, this.mode, this.itemStack.itemStack, this.action); + } +} diff --git a/src/main/java/keystrokesmod/script/packets/serverbound/C0F.java b/src/main/java/keystrokesmod/script/packets/serverbound/C0F.java new file mode 100644 index 0000000..18c1302 --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/serverbound/C0F.java @@ -0,0 +1,25 @@ +package keystrokesmod.script.packets.serverbound; + +import net.minecraft.network.play.client.C0FPacketConfirmTransaction; + +public class C0F extends CPacket { + public int windowId; + public short uid; + + public C0F(int windowId, short uid) { + super(null); + this.windowId = windowId; + this.uid = uid; + } + + public C0F(C0FPacketConfirmTransaction packet) { + super(packet); + this.windowId = packet.getWindowId(); + this.uid = packet.getUid(); + } + + @Override + public C0FPacketConfirmTransaction convert() { + return new C0FPacketConfirmTransaction(this.windowId, this.uid, true); + } +} diff --git a/src/main/java/keystrokesmod/script/packets/serverbound/C10.java b/src/main/java/keystrokesmod/script/packets/serverbound/C10.java new file mode 100644 index 0000000..1e8cf87 --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/serverbound/C10.java @@ -0,0 +1,26 @@ +package keystrokesmod.script.packets.serverbound; + +import keystrokesmod.script.classes.ItemStack; +import net.minecraft.network.play.client.C10PacketCreativeInventoryAction; + +public class C10 extends CPacket { + public int slot; + public ItemStack itemStack; + + public C10(int slot, ItemStack itemStack) { + super(null); + this.slot = slot; + this.itemStack = itemStack; + } + + protected C10(C10PacketCreativeInventoryAction packet) { + super(packet); + this.slot = packet.getSlotId(); + this.itemStack = ItemStack.convert(packet.getStack()); + } + + @Override + public C10PacketCreativeInventoryAction convert() { + return new C10PacketCreativeInventoryAction(slot, itemStack.itemStack); + } +} diff --git a/src/main/java/keystrokesmod/script/packets/serverbound/C13.java b/src/main/java/keystrokesmod/script/packets/serverbound/C13.java new file mode 100644 index 0000000..d39126a --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/serverbound/C13.java @@ -0,0 +1,39 @@ +package keystrokesmod.script.packets.serverbound; + +import net.minecraft.entity.player.PlayerCapabilities; +import net.minecraft.network.play.client.C13PacketPlayerAbilities; + +public class C13 extends CPacket { + public boolean invulnerable; + public boolean flying; + public boolean allowFlying; + public boolean creativeMode; + public float flySpeed; + public float walkSpeed; + + public C13(boolean invulnerable, boolean flying, boolean allowFlying, boolean creativeMode, float flySpeed, float walkSpeed) { + super(null); + this.invulnerable = invulnerable; + this.flying = flying; + this.allowFlying = allowFlying; + this.creativeMode = creativeMode; + this.flySpeed = flySpeed; + this.walkSpeed = walkSpeed; + } + + protected C13(C13PacketPlayerAbilities packet) { + super(packet); + } + + @Override + public C13PacketPlayerAbilities convert() { + PlayerCapabilities capabilities = new PlayerCapabilities(); + capabilities.disableDamage = this.invulnerable; + capabilities.isFlying = this.flying; + capabilities.allowFlying = this.allowFlying; + capabilities.isCreativeMode = this.creativeMode; + capabilities.setFlySpeed(this.flySpeed); + capabilities.setPlayerWalkSpeed(this.walkSpeed); + return new C13PacketPlayerAbilities(capabilities); + } +} diff --git a/src/main/java/keystrokesmod/script/packets/serverbound/C16.java b/src/main/java/keystrokesmod/script/packets/serverbound/C16.java new file mode 100644 index 0000000..b0b7b0d --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/serverbound/C16.java @@ -0,0 +1,23 @@ +package keystrokesmod.script.packets.serverbound; + +import keystrokesmod.utility.Utils; +import net.minecraft.network.play.client.C16PacketClientStatus; + +public class C16 extends CPacket { + public String status; + + public C16(String status) { + super(null); + this.status = status; + } + + protected C16(C16PacketClientStatus packet) { + super(packet); + this.status = packet.getStatus().name(); + } + + @Override + public C16PacketClientStatus convert() { + return new C16PacketClientStatus(Utils.getEnum(C16PacketClientStatus.EnumState.class, this.status)); + } +} diff --git a/src/main/java/keystrokesmod/script/packets/serverbound/CPacket.java b/src/main/java/keystrokesmod/script/packets/serverbound/CPacket.java new file mode 100644 index 0000000..1a93287 --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/serverbound/CPacket.java @@ -0,0 +1,20 @@ +package keystrokesmod.script.packets.serverbound; + +import net.minecraft.network.Packet; + +public class CPacket { + public String name; + public net.minecraft.network.Packet packet; + + public CPacket(net.minecraft.network.Packet packet) { + if (packet == null) { + return; + } + this.packet = packet; + this.name = packet.getClass().getSimpleName(); + } + + public Packet convert() { + return packet; + } +} diff --git a/src/main/java/keystrokesmod/script/packets/serverbound/PacketHandler.java b/src/main/java/keystrokesmod/script/packets/serverbound/PacketHandler.java new file mode 100644 index 0000000..a5cbf2e --- /dev/null +++ b/src/main/java/keystrokesmod/script/packets/serverbound/PacketHandler.java @@ -0,0 +1,172 @@ +package keystrokesmod.script.packets.serverbound; + +import keystrokesmod.script.packets.clientbound.*; +import net.minecraft.network.Packet; +import net.minecraft.network.play.client.*; +import net.minecraft.network.play.server.*; + +public class PacketHandler { + public static CPacket convertServerBound(net.minecraft.network.Packet packet) { + if (packet == null || packet.getClass().getSimpleName().startsWith("S")) { + return null; + } + CPacket newPacket; + try { + if (packet instanceof C0APacketAnimation) { + newPacket = new C0A((C0APacketAnimation) packet); + } + else if (packet instanceof C0BPacketEntityAction) { + newPacket = new C0B((C0BPacketEntityAction) packet); + } + else if (packet instanceof C01PacketChatMessage) { + newPacket = new C01((C01PacketChatMessage)packet, (byte) 0); + } + else if (packet instanceof C02PacketUseEntity) { + newPacket = new C02((C02PacketUseEntity)packet); + } + else if (packet instanceof C0FPacketConfirmTransaction) { + newPacket = new C0F((C0FPacketConfirmTransaction) packet); + } + else if (packet instanceof C0EPacketClickWindow) { + newPacket = new C0E((C0EPacketClickWindow) packet); + } + else if (packet instanceof C03PacketPlayer) { + newPacket = new C03((C03PacketPlayer)packet, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0); + } + else if (packet instanceof C07PacketPlayerDigging) { + newPacket = new C07((C07PacketPlayerDigging)packet); + } + else if (packet instanceof C08PacketPlayerBlockPlacement) { + newPacket = new C08((C08PacketPlayerBlockPlacement)packet); + } + else if (packet instanceof C09PacketHeldItemChange) { + newPacket = new C09(((C09PacketHeldItemChange)packet), true); + } + else if (packet instanceof C10PacketCreativeInventoryAction) { + newPacket = new C10((C10PacketCreativeInventoryAction) packet); + } + else if (packet instanceof C13PacketPlayerAbilities) { + newPacket = new C13((C13PacketPlayerAbilities) packet); + } + else if (packet instanceof C16PacketClientStatus) { + newPacket = new C16((C16PacketClientStatus) packet); + } + else if (packet instanceof C0DPacketCloseWindow) { + newPacket = new C0D((C0DPacketCloseWindow) packet); + } + else { + newPacket = new CPacket(packet); + } + } + catch (Exception ex) { + ex.printStackTrace(); + newPacket = null; + } + return newPacket; + } + + public static SPacket convertClientBound(Packet packet) { + SPacket sPacket; + try { + if (packet instanceof S12PacketEntityVelocity) { + sPacket = new S12((S12PacketEntityVelocity)packet); + } + else if (packet instanceof S27PacketExplosion) { + sPacket = new S27((S27PacketExplosion)packet); + } + else if (packet instanceof S3EPacketTeams) { + sPacket = new S3E((S3EPacketTeams) packet); + } + else if (packet instanceof S08PacketPlayerPosLook) { + sPacket = new S08((S08PacketPlayerPosLook) packet); + } + else if (packet instanceof S2APacketParticles) { + sPacket = new S2A((S2APacketParticles) packet); + } + else if (packet instanceof S06PacketUpdateHealth) { + sPacket = new S06((S06PacketUpdateHealth) packet); + } + else if (packet instanceof S23PacketBlockChange) { + sPacket = new S23((S23PacketBlockChange) packet); + } + else if (packet instanceof S29PacketSoundEffect) { + sPacket = new S29((S29PacketSoundEffect) packet); + } + else if (packet instanceof S2FPacketSetSlot) { + sPacket = new S2F((S2FPacketSetSlot) packet); + } + else if (packet instanceof S48PacketResourcePackSend) { + sPacket = new S48((S48PacketResourcePackSend) packet); + } + else if (packet instanceof S3APacketTabComplete) { + sPacket = new S3A((S3APacketTabComplete) packet, (byte) 0); + } + else { + sPacket = new SPacket(packet); + } + } + catch (Exception ex) { + sPacket = null; + } + return sPacket; + } + + public static Packet convertCPacket(CPacket cPacket) { + try { + if (cPacket instanceof C0A) { + return new C0APacketAnimation(); + } + else if (cPacket instanceof C0B) { + return ((C0B) cPacket).convert(); + } + else if (cPacket instanceof C0D) { + return ((C0D) cPacket).convert(); + } + else if (cPacket instanceof C09) { + return ((C09) cPacket).convert(); + } + else if (cPacket instanceof C0E) { + return ((C0E) cPacket).convert(); + } + else if (cPacket instanceof C0F) { + return ((C0F) cPacket).convert(); + } + else if (cPacket instanceof C08) { + return ((C08) cPacket).convert(); + } + else if (cPacket instanceof C07) { + return ((C07) cPacket).convert(); + } + else if (cPacket instanceof C01) { + return ((C01) cPacket).convert(); + } + else if (cPacket instanceof C02) { + return ((C02) cPacket).convert(); + } + else if (cPacket instanceof C03) { + return cPacket.packet; + } + else if (cPacket instanceof C10) { + return ((C10) cPacket).convert(); + } + else if (cPacket instanceof C13) { + return ((C13) cPacket).convert(); + } + else if (cPacket instanceof C16) { + return ((C16) cPacket).convert(); + } + } + catch (Exception e) { + if (cPacket != null && cPacket.packet != null && !cPacket.name.startsWith("S")) { + return cPacket.packet; + } + else { + return null; + } + } + if (cPacket == null && cPacket.packet == null) { + return null; + } + return cPacket.packet; + } +} diff --git a/src/main/java/keystrokesmod/utility/BlockUtils.java b/src/main/java/keystrokesmod/utility/BlockUtils.java new file mode 100644 index 0000000..1359d4f --- /dev/null +++ b/src/main/java/keystrokesmod/utility/BlockUtils.java @@ -0,0 +1,128 @@ +package keystrokesmod.utility; + +import net.minecraft.block.*; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; + +public class BlockUtils { + public static final Minecraft mc = Minecraft.getMinecraft(); + + public static boolean isSamePos(BlockPos blockPos, BlockPos blockPos2) { + return blockPos == blockPos2 || (blockPos.getX() == blockPos2.getX() && blockPos.getY() == blockPos2.getY() && blockPos.getZ() == blockPos2.getZ()); + } + + public static boolean notFull(Block block) { + return block instanceof BlockFenceGate || block instanceof BlockLadder || block instanceof BlockFlowerPot || block instanceof BlockBasePressurePlate || isFluid(block) || block instanceof BlockFence || block instanceof BlockAnvil || block instanceof BlockEnchantmentTable || block instanceof BlockChest || block instanceof BlockWeb || block instanceof BlockTallGrass; + } + + public static boolean isFluid(Block block) { + return block.getMaterial() == Material.lava || block.getMaterial() == Material.water; + } + + public static boolean isInteractable(Block block) { + return block instanceof BlockFurnace || block instanceof BlockTrapDoor || block instanceof BlockDoor || block instanceof BlockContainer || block instanceof BlockJukebox || block instanceof BlockFenceGate || block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockEnchantmentTable || block instanceof BlockBrewingStand || block instanceof BlockBed || block instanceof BlockDropper || block instanceof BlockDispenser || block instanceof BlockHopper || block instanceof BlockAnvil || block instanceof BlockNote || block instanceof BlockWorkbench; + } + + public static boolean isInteractable(MovingObjectPosition mv) { + if (mv == null || mv.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK || mv.getBlockPos() == null) { + return false; + } + IBlockState iblockstate = mc.theWorld.getBlockState(mv.getBlockPos()); + if (!mc.thePlayer.isSneaking() || mc.thePlayer.getHeldItem() == null || mc.thePlayer.getHeldItem().getItem().doesSneakBypassUse(mc.theWorld, mv.getBlockPos(), mc.thePlayer)) { + Vec3 hitVec = getHitVec(mv.hitVec, mv.getBlockPos()); + return iblockstate.getBlock().onBlockActivated(mc.theWorld, mv.getBlockPos(), iblockstate, mc.thePlayer, mv.sideHit, (float) hitVec.xCoord, (float) hitVec.yCoord, (float) hitVec.zCoord); + } + return false; + } + + public static Vec3 getHitVec(Vec3 hitVec, BlockPos blockPos) { + float x = (float)(hitVec.xCoord - blockPos.getX()); + float y = (float)(hitVec.yCoord - blockPos.getY()); + float z = (float)(hitVec.zCoord - blockPos.getZ()); + return new Vec3(x, y, z); + } + + public static float getBlockHardness(final Block block, final ItemStack itemStack, boolean ignoreSlow, boolean ignoreGround) { + final float getBlockHardness = block.getBlockHardness(mc.theWorld, null); + if (getBlockHardness < 0.0f) { + return 0.0f; + } + return (block.getMaterial().isToolNotRequired() || (itemStack != null && itemStack.canHarvestBlock(block))) ? (getToolDigEfficiency(itemStack, block, ignoreSlow, ignoreGround) / getBlockHardness / 30.0f) : (getToolDigEfficiency(itemStack, block, ignoreSlow, ignoreGround) / getBlockHardness / 100.0f); + } + + public static float getToolDigEfficiency(ItemStack itemStack, Block block, boolean ignoreSlow, boolean ignoreGround) { + float n = (itemStack == null) ? 1.0f : itemStack.getItem().getStrVsBlock(itemStack, block); + if (n > 1.0f) { + final int getEnchantmentLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.efficiency.effectId, itemStack); + if (getEnchantmentLevel > 0 && itemStack != null) { + n += getEnchantmentLevel * getEnchantmentLevel + 1; + } + } + if (mc.thePlayer.isPotionActive(Potion.digSpeed)) { + n *= 1.0f + (mc.thePlayer.getActivePotionEffect(Potion.digSpeed).getAmplifier() + 1) * 0.2f; + } + if (!ignoreSlow) { + if (mc.thePlayer.isPotionActive(Potion.digSlowdown)) { + float n2; + switch (mc.thePlayer.getActivePotionEffect(Potion.digSlowdown).getAmplifier()) { + case 0: { + n2 = 0.3f; + break; + } + case 1: { + n2 = 0.09f; + break; + } + case 2: { + n2 = 0.0027f; + break; + } + default: { + n2 = 8.1E-4f; + break; + } + } + n *= n2; + } + if (mc.thePlayer.isInsideOfMaterial(Material.water) && !EnchantmentHelper.getAquaAffinityModifier(mc.thePlayer)) { + n /= 5.0f; + } + if (!mc.thePlayer.onGround && !ignoreGround) { + n /= 5.0f; + } + } + return n; + } + + public static Block getBlock(BlockPos blockPos) { + return getBlockState(blockPos).getBlock(); + } + + public static Block getBlock(double x, double y, double z) { + return getBlockState(new BlockPos(x, y, z)).getBlock(); + } + + public static IBlockState getBlockState(BlockPos blockPos) { + return mc.theWorld.getBlockState(blockPos); + } + + public static boolean check(final BlockPos blockPos, final Block block) { + return getBlock(blockPos) == block; + } + + public static boolean replaceable(BlockPos blockPos) { + if (!Utils.nullCheck()) { + return true; + } + return getBlock(blockPos).isReplaceable(mc.theWorld, blockPos); + } +} diff --git a/src/main/java/keystrokesmod/utility/CPSCalculator.java b/src/main/java/keystrokesmod/utility/CPSCalculator.java new file mode 100644 index 0000000..1ec3cb2 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/CPSCalculator.java @@ -0,0 +1,69 @@ +package keystrokesmod.utility; + +import keystrokesmod.Raven; +import keystrokesmod.module.impl.client.Settings; +import keystrokesmod.module.impl.world.AntiBot; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraftforge.client.event.MouseEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.ArrayList; +import java.util.List; + +public class CPSCalculator { + private static Minecraft mc = Minecraft.getMinecraft(); + private static List a = new ArrayList(); + private static List b = new ArrayList(); + public static long LL = 0L; + public static long LR = 0L; + + @SubscribeEvent + public void onMouseUpdate(MouseEvent d) { + if (d.buttonstate) { + if (d.button == 0) { + aL(); + if (Raven.debug && mc.objectMouseOver != null) { + Entity en = mc.objectMouseOver.entityHit; + if (en == null) { + return; + } + + Utils.sendMessage("&7&m-------------------------"); + Utils.sendMessage("n: " + en.getName()); + Utils.sendMessage("rn: " + en.getName().replace("§", "%")); + Utils.sendMessage("d: " + en.getDisplayName().getUnformattedText()); + Utils.sendMessage("rd: " + en.getDisplayName().getUnformattedText().replace("§", "%")); + Utils.sendMessage("b?: " + AntiBot.isBot(en)); + } + } else if (d.button == 1) { + aR(); + } + else if (d.button == 2 && Settings.middleClickFriends.isToggled()) { + EntityLivingBase g = Utils.raytrace(200); + if (g != null && !AntiBot.isBot(g) && !Utils.addFriend(g.getName())) { + Utils.removeFriend(g.getName()); + } + } + } + } + + public static void aL() { + a.add(LL = System.currentTimeMillis()); + } + + public static void aR() { + b.add(LR = System.currentTimeMillis()); + } + + public static int f() { + a.removeIf(o -> (Long) o < System.currentTimeMillis() - 1000L); + return a.size(); + } + + public static int i() { + b.removeIf(o -> (Long) o < System.currentTimeMillis() - 1000L); + return b.size(); + } +} diff --git a/src/main/java/keystrokesmod/utility/Commands.java b/src/main/java/keystrokesmod/utility/Commands.java new file mode 100644 index 0000000..431c10f --- /dev/null +++ b/src/main/java/keystrokesmod/utility/Commands.java @@ -0,0 +1,503 @@ +package keystrokesmod.utility; + +import keystrokesmod.Raven; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.client.Settings; +import keystrokesmod.module.impl.minigames.DuelsStats; +import keystrokesmod.module.impl.movement.Bhop; +import keystrokesmod.module.impl.movement.Fly; +import keystrokesmod.module.impl.movement.Speed; +import keystrokesmod.module.impl.other.FakeChat; +import keystrokesmod.module.impl.other.NameHider; +import keystrokesmod.utility.profile.Profile; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class Commands { + private static final Minecraft mc = Minecraft.getMinecraft(); + private static boolean f = true; + private static final List cs = Arrays.asList((new Color(170, 107, 148, 50)).getRGB(), (new Color(122, 158, 134, 50)).getRGB(), (new Color(16, 16, 16, 50)).getRGB(), (new Color(64, 114, 148, 50)).getRGB()); + private static int ccs = 0; + private static int lccs = -1; + public static List rs = new ArrayList(); + private static final String invSyn = "&cInvalid syntax."; + private static final String invCom = "&cInvalid command."; + + public static void rCMD(String c) { + if (!c.isEmpty()) { + String cm = c.toLowerCase(); + boolean hasArgs = c.contains(" "); + String[] args = hasArgs ? c.split(" ") : null; + String n; + if (cm.startsWith("setkey".toLowerCase())) { + if (!hasArgs) { + print(invSyn, 1); + return; + } + + if (args.length != 2) { + print(invSyn, 1); + return; + } + + print("Setting...", 1); + n = args[1]; + Raven.getExecutor().execute(() -> { + if (NetworkUtils.isHypixelKeyValid(n)) { + NetworkUtils.API_KEY = n; + print("&a" + "success!", 0); + } else { + print("&c" + "Invalid key.", 0); + } + + }); + } else if (cm.startsWith("nick")) { + if (!hasArgs) { + print(invSyn, 1); + return; + } + + if (args.length != 2) { + print(invSyn, 1); + return; + } + + if (args[1].equals("reset")) { + print("&aNick reset.", 1); + return; + } + + DuelsStats.nick = args[1]; + print("&aNick has been set to:", 1); + print("\"" + DuelsStats.nick + "\"", 0); + } + else if (cm.startsWith("cname")) { + if (!hasArgs) { + print(invSyn, 1); + return; + } + + if (args.length != 2) { + print(invSyn, 1); + return; + } + + NameHider.fakeName = args[1]; + print("&a" + Utils.uf("name") + "Nick has been set to:".substring(4), 1); + print("\"" + NameHider.fakeName + "\"", 0); + } + else if (cm.startsWith(FakeChat.command)) { + if (!hasArgs) { + print(invSyn, 1); + return; + } + + n = c.replaceFirst(FakeChat.command, "").substring(1); + if (n.isEmpty() || n.equals("\\n")) { + print(FakeChat.c4, 1); + return; + } + + FakeChat.msg = n; + print("&aMessage set!", 1); + } + else if (cm.startsWith("Duels".toLowerCase())) { + if (!hasArgs) { + print(invSyn, 1); + return; + } + + if (args.length != 2) { + print(invSyn, 1); + return; + } + + if (NetworkUtils.API_KEY.isEmpty()) { + print("&cAPI Key is empty!", 1); + print("Use \"setkey [api_key]\".", 0); + return; + } + + n = args[1]; + print("Retrieving data...", 1); + Raven.getExecutor().execute(() -> { + int[] s = ProfileUtils.getHypixelStats(n, ProfileUtils.DM.OVERALL); + if (s != null) { + if (s[0] == -1) { + print("&c" + (n.length() > 16 ? n.substring(0, 16) + "..." : n) + " does not exist!", 0); + } else { + double wlr = s[1] != 0 ? Utils.round((double) s[0] / (double) s[1], 2) : (double) s[0]; + print("&e" + n + " stats:", 1); + print("Wins: " + s[0], 0); + print("Losses: " + s[1], 0); + print("WLR: " + wlr, 0); + print("Winstreak: " + s[2], 0); + print("Threat: " + DuelsStats.gtl(s[0], s[1], wlr, s[2]).substring(2), 0); + } + } else { + print("&cThere was an error.", 0); + } + + }); + } + else if (cm.startsWith("setspeed")) { + if (!hasArgs) { + print(invSyn, 1); + return; + } + + if (args.length != 3) { + print(invSyn, 1); + return; + } + + double value; + + try { + value = Double.parseDouble(args[2]); + } catch (Exception e) { + print("&cInvalid value. [0 - 100]", 1); + return; + } + + if (value > 100 || value < 0) { + print("&cInvalid value. [0 - 100]", 1); + return; + } + + switch (args[1]) { + case "fly": + Fly.horizontalSpeed.setValueRaw(value); + break; + case "bhop": + Bhop.speedSetting.setValueRaw(value); + break; + case "speed": + Speed.speed.setValueRaw(value); + break; + default: + print(invSyn, 1); + return; + } + print("&aSet speed to ", 1); + print(args[2], 0); + } + else if (cm.startsWith("setvelocity")) { + if (!hasArgs) { + print(invSyn, 1); + return; + } + + if (args.length != 3) { + print(invSyn, 1); + return; + } + + double value; + + try { + value = Double.parseDouble(args[2]); + } catch (Exception e) { + print("&cInvalid value. [-100 - 300]", 1); + return; + } + + if (value > 300 || value < -100) { + print("&cInvalid value. [-100 - 300]", 1); + return; + } + + switch (args[1]) { + case "horizontal": + case "h": + //Velocity.horizontal.setValueRaw(value); + break; + case "vertical": + case "v": + //Velocity.vertical.setValueRaw(value); + break; + default: + print(invSyn, 1); + return; + } + + print("&aSet " + args[1] + " velocity to ", 1); + print(args[2], 0); + } + else if (cm.startsWith("ping")) { + Ping.checkPing(); + } + else if (cm.startsWith("sprint")) { + if (!hasArgs || args.length != 2) { + print(invSyn, 1); + return; + } + String text = args[1]; + if (text.trim().isEmpty()) { + print("&cInvalid message.", 1); + return; + } + ModuleManager.sprint.text = text; + print("&aSprint text updated!", 1); + } + else if (cm.startsWith("clear")) { + rs.clear(); + } + else if (cm.startsWith("hide")) { + if (!hasArgs || args.length != 2) { + print(invSyn, 1); + return; + } + + for (Module module : Raven.getModuleManager().getModules()) { + String name = module.getName().toLowerCase().replace(" ", ""); + if (name.equals(args[1].toLowerCase())) { + module.setHidden(true); + print("&a" + module.getName() + " is now hidden in HUD", 1); + } + } + } + else if (cm.startsWith("show")) { + if (!hasArgs) { + print(invSyn, 1); + return; + } + + if (args.length != 2) { + print(invSyn, 1); + return; + } + + for (Module module : Raven.getModuleManager().getModules()) { + String name = module.getName().toLowerCase().replace(" ", ""); + if (name.equals(args[1].toLowerCase())) { + module.setHidden(false); + print("&a" + module.getName() + " is now visible in HUD", 1); + } + } + } + else if (cm.startsWith("friend") || cm.startsWith("f")) { + if (!hasArgs) { + print(invSyn, 1); + return; + } + + if (args.length != 2) { + print(invSyn, 1); + return; + } + + if (args[1].equals("clear")) { + Utils.friends.clear(); + print("&aFriends cleared.", 1); + return; + } + + boolean added = Utils.addFriend(args[1]); + if (added) { + print("&aAdded friend: " + args[1], 1); + } else { + print("&aRemoved friend: " + args[1], 1); + Utils.removeFriend(args[1]); + } + } + else if (cm.startsWith("enemy") || cm.startsWith("e")) { + if (!hasArgs) { + print(invSyn, 1); + return; + } + + if (args.length != 2) { + print(invSyn, 1); + return; + } + + if (args[1].equals("clear")) { + Utils.enemies.clear(); + print("&aEnemies cleared.", 1); + return; + } + + boolean added = Utils.addEnemy(args[1]); + if (!added) { + print("&aRemoved enemy: " + args[1], 1); + Utils.removeEnemy(args[1]); + } + else { + print("&aAdded enemy: " + args[1], 1); + } + } + else if (cm.startsWith("Debug".toLowerCase())) { + Raven.debug = !Raven.debug; + print("Debug " + (Raven.debug ? "enabled" : "disabled") + ".", 1); + } + else if (cm.startsWith("profiles") || cm.startsWith("p")) { + if (!hasArgs) { + print("&aAvailable profiles:", 1); + if (Raven.profileManager.profiles.isEmpty()) { + print("None", 0); + return; + } + for (int i = 0; i < Raven.profileManager.profiles.size(); ++i) { + print(i + 1 + ". " + Raven.profileManager.profiles.get(i).getName(), 0); + } + } + else if (args.length > 1) { + if (args[1].equals("save") || args[1].equals("s")) { + if (args.length != 3) { + print(invSyn, 1); + return; + } + String name = args[2]; + if (name.length() < 2 || name.length() > 10) { + print("&cInvalid name.", 1); + return; + } + Raven.profileManager.saveProfile(new Profile(name, 0)); + print("&aSaved profile:", 1); + print(name, 0); + Raven.profileManager.loadProfiles(); + } else if (args[1].equals("load") || args[1].equals("l")) { + if (args.length != 3) { + print(invSyn, 1); + return; + } + String name = args[2]; + for (Profile profile : Raven.profileManager.profiles) { + if (profile.getName().equals(name)) { + Raven.profileManager.loadProfile(profile.getName()); + print("&aLoaded profile:", 1); + print(name, 0); + if (Settings.sendMessage.isToggled()) { + Utils.sendMessage("&7Enabled profile: &b" + name); + } + return; + } + } + print("&cInvalid profile.", 1); + } else if (args[1].equals("remove") || args[1].equals("r")) { + if (args.length != 3) { + print(invSyn, 1); + return; + } + String name = args[2]; + for (Profile profile : Raven.profileManager.profiles) { + if (profile.getName().equals(name)) { + Raven.profileManager.deleteProfile(profile.getName()); + print("&aRemoved profile:", 1); + print(name, 0); + Raven.profileManager.loadProfiles(); + return; + } + } + print("&cInvalid profile.", 1); + } + } + } else if (!cm.startsWith("help") && !cm.startsWith("?")) { + if (cm.startsWith("shoutout")) { + print("&eCelebrities:", 1); + print("- hevex", 0); + print("- jc", 0); + print("- mood", 0); + print("- charlotte", 0); + } else { + print(invCom + " (" + (cm.length() > 5 ? cm.substring(0, 5) + "..." : cm) + ")", 1); + } + } else { + print("&eAvailable commands:", 1); + print("1 setkey [key]", 0); + print("2 friend/enemy [name/clear]", 0); + print("3 duels [player]", 0); + print("4 nick [name/reset]", 0); + print("5 ping", 0); + print("6 hide/show [module]", 0); + print("&eProfiles:", 0); + print("1 profiles", 0); + print("2 profiles save [profile]", 0); + print("3 profiles load [profile]", 0); + print("4 profiles remove [profile]", 0); + print("&eModule-specific:", 0); + print("1 cname [name]", 0); + print("2 " + FakeChat.command + " [msg]", 0); + print("3 setspeed [fly/bhop/speed] [value]", 0); + print("4 setvelocity [h/v] [value]", 0); + print("5 sprint [text]", 0); + } + + } + } + + public static void print(String m, int t) { + if (t == 1 || t == 2) { + rs.add(""); + } + + rs.add(m); + if (t == 2 || t == 3) { + rs.add(""); + } + } + + public static void rc(FontRenderer fr, int h, int w, double s) { + int x = w - 195; + int y = h - 130; + int sY = h - 345; + int sH = 230; + GL11.glEnable(3089); + double mw = w * s; + GL11.glScissor(0, (int) (mc.displayHeight - (sY + sH) * s), (int) (mw - (mw < 2 ? 0 : 2)), (int) (sH * s - 2)); + RenderUtils.db(1000, 1000, ccs); + rss(fr, rs, x, y); + GL11.glDisable(3089); + } + + private static void rss(FontRenderer fr, List rs, int x, int y) { + if (f) { + f = false; + print("Welcome,", 0); + print("Use \"help\" for help.", 0); + } + + if (!rs.isEmpty()) { + for (int i = rs.size() - 1; i >= 0; --i) { + String s = rs.get(i); + int c = -1; + if (s.contains("&a")) { + s = s.replace("&a", ""); + c = Color.green.getRGB(); + } else if (s.contains("&c")) { + s = s.replace("&c", ""); + c = Color.red.getRGB(); + } else if (s.contains("&e")) { + s = s.replace("&e", ""); + c = Color.yellow.getRGB(); + } + + fr.drawString(s, x, y, c); + y -= fr.FONT_HEIGHT + 5; + } + + } + } + + public static void setccs() { + int val = Utils.getRandom().nextInt(cs.size()); + if (val == lccs) { + val += val == 3 ? -3 : 1; + } + + lccs = val; + ccs = cs.get(val); + } + + public static void od() { + Ping.rs(); + } +} diff --git a/src/main/java/keystrokesmod/utility/DebugInfoRenderer.java b/src/main/java/keystrokesmod/utility/DebugInfoRenderer.java new file mode 100644 index 0000000..24a8619 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/DebugInfoRenderer.java @@ -0,0 +1,21 @@ +package keystrokesmod.utility; + +import keystrokesmod.Raven; +import net.minecraft.client.Minecraft; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent; + +public class DebugInfoRenderer extends net.minecraft.client.gui.Gui { + private static Minecraft mc = Minecraft.getMinecraft(); + + @SubscribeEvent + public void onRenderTick(RenderTickEvent ev) { + if (!Raven.debug || ev.phase != TickEvent.Phase.END || !Utils.nullCheck()) { + return; + } + if (mc.currentScreen == null) { + RenderUtils.renderBPS(true, true); + } + } +} diff --git a/src/main/java/keystrokesmod/utility/ModuleUtils.java b/src/main/java/keystrokesmod/utility/ModuleUtils.java new file mode 100644 index 0000000..64376ee --- /dev/null +++ b/src/main/java/keystrokesmod/utility/ModuleUtils.java @@ -0,0 +1,179 @@ +package keystrokesmod.utility; + +import keystrokesmod.Raven; +import keystrokesmod.event.PostPlayerInputEvent; +import keystrokesmod.event.PreMotionEvent; +import keystrokesmod.event.PreUpdateEvent; +import keystrokesmod.event.SendPacketEvent; +import keystrokesmod.module.impl.movement.LongJump; +import keystrokesmod.module.impl.render.HUD; +import keystrokesmod.utility.*; +import keystrokesmod.utility.Timer; +import net.minecraft.client.Minecraft; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.client.Settings; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import net.minecraft.client.Minecraft; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.minecraft.util.BlockPos; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.input.Keyboard; + +import java.util.Iterator; +import java.util.Map; + +import static net.minecraft.util.EnumFacing.DOWN; + +public class ModuleUtils { + private final Minecraft mc; + + public ModuleUtils(Minecraft mc) { + this.mc = mc; + } + + public static boolean isBreaking; + public static boolean threwFireball; + private int isBreakingTick; + public static long MAX_EXPLOSION_DIST_SQ = 9; + private long FIREBALL_TIMEOUT = 750L, fireballTime = 0; + + @SubscribeEvent + public void onSendPacket(SendPacketEvent e) { + if (e.getPacket() instanceof C07PacketPlayerDigging) { + isBreaking = true; + } + + if (e.getPacket() instanceof C08PacketPlayerBlockPlacement && Utils.holdingFireball()) { + if (Utils.keybinds.isMouseDown(1)) { + fireballTime = System.currentTimeMillis(); + threwFireball = true; + } + } + } + + @SubscribeEvent + public void onPreUpdate(PreUpdateEvent e) { + + if (LongJump.slotReset && ++LongJump.slotResetTicks >= 2) { + LongJump.stopKillAura = false; + LongJump.stopScaffold = false; + LongJump.slotResetTicks = 0; + LongJump.slotReset = false; + } + + if (fireballTime > 0 && (System.currentTimeMillis() - fireballTime) > FIREBALL_TIMEOUT) { + threwFireball = false; + fireballTime = 0; + ModuleManager.velocity.disableVelo = false; + } + + if (isBreaking && ++isBreakingTick >= 1) { + isBreaking = false; + isBreakingTick = 0; + } + + if (ModuleManager.killAura.fixStates) { + if (!ModuleManager.killAura.isTargeting && ModuleManager.killAura.lag && !ModuleManager.scaffold.isEnabled) { + if (!Utils.holdingSword() && ModuleManager.killAura.swapped) { + PacketUtils.sendPacketNoEvent(new C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem)); + ModuleManager.killAura.swapped = false; + } else { + if (Utils.holdingSword()) { + PacketUtils.sendPacketNoEvent(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, DOWN)); + ModuleManager.killAura.swapped = false; + } + } + } + else { + ModuleManager.killAura.swapped = false; + } + ModuleManager.killAura.fixStates = false; + ModuleManager.killAura.lag = false; + } + + if (ModuleManager.killAura.justUnTargeted) { + if (++ModuleManager.killAura.unTargetTicks >= 2) { + ModuleManager.killAura.unTargetTicks = 0; + ModuleManager.killAura.justUnTargeted = false; + } + } + + + } + + @SubscribeEvent + public void onPreMotion(PreMotionEvent e) { + + // 7 tick needs to always finish the motion or itll lag back + if (!ModuleManager.bhop.isEnabled() && ModuleManager.bhop.mode.getInput() == 3 && ModuleManager.bhop.didMove) { + int simpleY = (int) Math.round((e.posY % 1) * 10000); + + if (mc.thePlayer.hurtTime == 0) { + switch (simpleY) { + case 4200: + mc.thePlayer.motionY = 0.39; + break; + case 1138: + mc.thePlayer.motionY = mc.thePlayer.motionY - 0.13; + ModuleManager.bhop.lowhop = false; + ModuleManager.bhop.didMove = false; + Utils.print("7 tick"); + break; + /*case 2031: + mc.thePlayer.motionY = mc.thePlayer.motionY - 0.2; + didMove = false; + break;*/ + } + } + } + + //Bhop rotate yaw handling + if (mc.thePlayer.onGround) { + if (mc.thePlayer.moveStrafing == 0 && mc.thePlayer.moveForward <= 0 && Utils.isMoving() && ModuleManager.bhop.isEnabled()) { + ModuleManager.bhop.setRotation = true; + } else { + ModuleManager.bhop.setRotation = false; + } + } + if (ModuleManager.bhop.rotateYawOption.isToggled()) { + if (ModuleManager.bhop.setRotation) { + if (!ModuleManager.killAura.isTargeting && !Utils.noSlowingBackWithBow()) { + float playerYaw = mc.thePlayer.rotationYaw; + e.setYaw(playerYaw -= 55); + } + } + } + + + + } + + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onRenderWorld(RenderWorldLastEvent e) { + if (!Utils.nullCheck() || !ModuleManager.scaffold.highlightBlocks.isToggled() || ModuleManager.scaffold.highlight.isEmpty()) { + return; + } + Iterator> iterator = ModuleManager.scaffold.highlight.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry entry = iterator.next(); + if (entry.getValue() == null) { + entry.setValue(new Timer(750)); + entry.getValue().start(); + } + int alpha = entry.getValue() == null ? 210 : 210 - entry.getValue().getValueInt(0, 210, 1); + if (alpha == 0) { + iterator.remove(); + continue; + } + RenderUtils.renderBlock(entry.getKey(), Utils.mergeAlpha(Theme.getGradient((int) HUD.theme.getInput(), 0), alpha), true, false); + } + } + + +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/utility/MovementFix.java b/src/main/java/keystrokesmod/utility/MovementFix.java new file mode 100644 index 0000000..56dc5bb --- /dev/null +++ b/src/main/java/keystrokesmod/utility/MovementFix.java @@ -0,0 +1,96 @@ +package keystrokesmod.utility; + +import keystrokesmod.event.JumpEvent; +import keystrokesmod.event.PreMotionEvent; +import keystrokesmod.event.PrePlayerInputEvent; +import keystrokesmod.event.StrafeEvent; +import keystrokesmod.module.impl.client.Settings; +import net.minecraft.client.Minecraft; +import net.minecraft.util.MathHelper; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class MovementFix { + private Minecraft mc; + private float yaw; + + public MovementFix(Minecraft mc) { + this.mc = mc; + } + + @SubscribeEvent(priority = EventPriority.LOWEST) // called last in order to apply fix + public void onMoveInput(PrePlayerInputEvent event) { + if (fixMovement()) { + final float forward = event.getForward(); + final float strafe = event.getStrafe(); + + final double angle = MathHelper.wrapAngleTo180_double(Math.toDegrees(direction(mc.thePlayer.rotationYaw, forward, strafe))); + + if (forward == 0 && strafe == 0) { + return; + } + + float closestForward = 0, closestStrafe = 0, closestDifference = Float.MAX_VALUE; + + for (float predictedForward = -1F; predictedForward <= 1F; predictedForward += 1F) { + for (float predictedStrafe = -1F; predictedStrafe <= 1F; predictedStrafe += 1F) { + if (predictedStrafe == 0 && predictedForward == 0) continue; + + final double predictedAngle = MathHelper.wrapAngleTo180_double(Math.toDegrees(direction(yaw, predictedForward, predictedStrafe))); + final double difference = wrappedDifference(angle, predictedAngle); + + if (difference < closestDifference) { + closestDifference = (float) difference; + closestForward = predictedForward; + closestStrafe = predictedStrafe; + } + } + } + event.setForward(closestForward); + event.setStrafe(closestStrafe); + } + } + + @SubscribeEvent(priority = EventPriority.LOWEST) + public void onJump(JumpEvent e) { + if (fixMovement()) { + Utils.sendMessage("&7Fix movement: &bJump"); + e.setYaw(yaw); + } + } + + @SubscribeEvent(priority = EventPriority.LOWEST) // called last in order to apply fix + public void onStrafe(StrafeEvent event) { + if (fixMovement()) { + Utils.sendMessage("&7Fix movement: &bStrafe"); + event.setYaw(yaw); + } + } + + @SubscribeEvent(priority = EventPriority.LOWEST) + public void onPreMotion(PreMotionEvent e) { + this.yaw = e.getYaw(); + } + + private boolean fixMovement() { + return Settings.movementFix != null && Settings.movementFix.isToggled() && this.yaw != mc.thePlayer.prevRotationYaw; + } + + public double wrappedDifference(double number1, double number2) { + return Math.min(Math.abs(number1 - number2), Math.min(Math.abs(number1 - 360) - Math.abs(number2 - 0), Math.abs(number2 - 360) - Math.abs(number1 - 0))); + } + + public double direction(float rotationYaw, final double moveForward, final double moveStrafing) { + if (moveForward < 0F) rotationYaw += 180F; + + float forward = 1F; + + if (moveForward < 0F) forward = -0.5F; + else if (moveForward > 0F) forward = 0.5F; + + if (moveStrafing > 0F) rotationYaw -= 90F * forward; + if (moveStrafing < 0F) rotationYaw += 90F * forward; + + return Math.toRadians(rotationYaw); + } +} diff --git a/src/main/java/keystrokesmod/utility/NetworkUtils.java b/src/main/java/keystrokesmod/utility/NetworkUtils.java new file mode 100644 index 0000000..216cee5 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/NetworkUtils.java @@ -0,0 +1,142 @@ +package keystrokesmod.utility; + +import net.minecraft.client.renderer.texture.TextureUtil; +import org.apache.commons.io.IOUtils; + +import java.awt.image.BufferedImage; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class NetworkUtils { + public static String API_KEY = ""; + private static final Pattern OGP_IMAGE_REGEX = Pattern.compile(".+?)\".*?/?>"); + private static final Pattern IMG_TAG_REGEX = Pattern.compile(".+?)\".*?>"); + private static final String CHROME_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"; + + public static boolean isHypixelKeyValid(String ak) { + String c = getTextFromURL("https://api.hypixel.net/key?key=" + ak, false); + return !c.isEmpty() && !c.contains("Invalid"); + } + + public static String getTextFromURL(String _url, boolean appendNewline) { + String r = ""; + HttpURLConnection con = null; + + try { + URL url = new URL(_url); + con = (HttpURLConnection) url.openConnection(); + r = getTextFromConnection(con, appendNewline); + } catch (IOException ignored) { + } finally { + if (con != null) { + con.disconnect(); + } + + } + return r; + } + + public static String getTextFromConnection(HttpURLConnection connection, boolean appendIndent) { + if (connection != null) { + try { + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream())); + + String result; + try { + StringBuilder stringBuilder = new StringBuilder(); + + String input; + while ((input = bufferedReader.readLine()) != null) { + stringBuilder.append(input + (appendIndent ? "\n" : "")); + } + + String res = stringBuilder.toString(); + connection.disconnect(); + + result = res; + } finally { + bufferedReader.close(); + } + + return result; + } catch (Exception ignored) { + } + } + + return ""; + } + + public static BufferedImage getImageFromURL(String urlString) { + try { + URL url = new URL(urlString); + HttpURLConnection connection; + + while (true) { + connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("GET"); + connection.setUseCaches(true); + connection.setInstanceFollowRedirects(true); + connection.setRequestProperty("User-Agent", CHROME_USER_AGENT); + connection.setRequestProperty("Accept", "text/html, image/*"); + + if (url.getHost().contains("imgur")) { + connection.setRequestProperty("Referer", "https://imgur.com/"); + } + + int responseCode = connection.getResponseCode(); + + if (responseCode >= 300 && responseCode < 400) { + String newLocation = connection.getHeaderField("Location"); + if (newLocation == null || newLocation.isEmpty()) { + return null; + } + url = new URL(url, newLocation); + connection.disconnect(); + continue; + } + + String contentType = connection.getContentType(); + if (contentType != null && contentType.startsWith("image")) { + try (InputStream inputStream = connection.getInputStream()) { + BufferedImage image = TextureUtil.readBufferedImage(inputStream); + connection.disconnect(); + return image; + } + } + + try (InputStream inputStream = connection.getInputStream()) { + String body = IOUtils.toString(inputStream, "UTF-8"); + String imageURL = ""; + + Matcher matcher = OGP_IMAGE_REGEX.matcher(body); + if (matcher.find()) { + imageURL = matcher.group("url"); + } + else { + matcher = IMG_TAG_REGEX.matcher(body); + if (matcher.find()) { + imageURL = matcher.group("url"); + } + } + + if (imageURL.isEmpty()) { + return null; + } + + url = new URL(url, imageURL); + connection.disconnect(); + } + } + } + catch (Exception e) { + e.printStackTrace(); + } + return null; + } +} diff --git a/src/main/java/keystrokesmod/utility/PacketUtils.java b/src/main/java/keystrokesmod/utility/PacketUtils.java new file mode 100644 index 0000000..4ec2413 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/PacketUtils.java @@ -0,0 +1,30 @@ +package keystrokesmod.utility; + +import keystrokesmod.Raven; +import net.minecraft.network.Packet; + +import java.util.ArrayList; +import java.util.List; + +public class PacketUtils { + public static List skipSendEvent = new ArrayList<>(); + public static List skipReceiveEvent = new ArrayList<>(); + + public static void sendPacketNoEvent(Packet packet) { + if (packet == null || packet.getClass().getSimpleName().startsWith("S")) { + return; + } + skipSendEvent.add(packet); + Raven.mc.thePlayer.sendQueue.addToSendQueue(packet); + } + + public static void receivePacketNoEvent(Packet packet) { + try { + skipReceiveEvent.add(packet); + packet.processPacket(Raven.mc.getNetHandler()); + } + catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/src/main/java/keystrokesmod/utility/PacketsHandler.java b/src/main/java/keystrokesmod/utility/PacketsHandler.java new file mode 100644 index 0000000..e8aad19 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/PacketsHandler.java @@ -0,0 +1,134 @@ +package keystrokesmod.utility; + + +import keystrokesmod.event.PostUpdateEvent; +import keystrokesmod.event.ReceivePacketEvent; +import keystrokesmod.event.SendPacketEvent; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.network.Packet; +import net.minecraft.network.play.client.*; +import net.minecraft.network.play.server.S09PacketHeldItemChange; +import net.minecraft.network.play.server.S0CPacketSpawnPlayer; +import net.minecraftforge.fml.common.eventhandler.EventPriority; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; + +public class PacketsHandler { + public Minecraft mc = Minecraft.getMinecraft(); + public AtomicBoolean C0A = new AtomicBoolean(false); + public AtomicBoolean C08 = new AtomicBoolean(false); + public AtomicBoolean C07 = new AtomicBoolean(false); + public AtomicBoolean C02 = new AtomicBoolean(false); + public AtomicBoolean C09 = new AtomicBoolean(false); + public AtomicBoolean delayAttack = new AtomicBoolean(false); + public AtomicBoolean delay = new AtomicBoolean(false); + public AtomicInteger playerSlot = new AtomicInteger(-1); + public AtomicInteger serverSlot = new AtomicInteger(-1); + + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onSendPacket(SendPacketEvent e) { + if (e.isCanceled()) { + return; + } + if (e.getPacket() instanceof C02PacketUseEntity) { // sending a C07 on the same tick as C02 can ban, this usually happens when you unblock and attack on the same tick + if (C07.get()) { + e.setCanceled(true); + return; + } + C02.set(true); + } + else if (e.getPacket() instanceof C08PacketPlayerBlockPlacement) { + C08.set(true); + } + else if (e.getPacket() instanceof C07PacketPlayerDigging) { + C07.set(true); + } + else if (e.getPacket() instanceof C0APacketAnimation) { + if (C07.get()) { + e.setCanceled(true); + return; + } + C0A.set(true); + } + else if (e.getPacket() instanceof C09PacketHeldItemChange) { + if (((C09PacketHeldItemChange) e.getPacket()).getSlotId() == playerSlot.get() && ((C09PacketHeldItemChange) e.getPacket()).getSlotId() == serverSlot.get()) { + e.setCanceled(true); + return; + } + C09.set(true); + playerSlot.set(((C09PacketHeldItemChange) e.getPacket()).getSlotId()); + serverSlot.set(((C09PacketHeldItemChange) e.getPacket()).getSlotId()); + } + } + + @SubscribeEvent + public void onReceivePacket(ReceivePacketEvent e) { + if (e.getPacket() instanceof S09PacketHeldItemChange) { + S09PacketHeldItemChange packet = (S09PacketHeldItemChange) e.getPacket(); + if (packet.getHeldItemHotbarIndex() >= 0 && packet.getHeldItemHotbarIndex() < InventoryPlayer.getHotbarSize()) { + serverSlot.set(packet.getHeldItemHotbarIndex()); + } + } + else if (e.getPacket() instanceof S0CPacketSpawnPlayer && Minecraft.getMinecraft().thePlayer != null) { + if (((S0CPacketSpawnPlayer) e.getPacket()).getEntityID() != Minecraft.getMinecraft().thePlayer.getEntityId()) { + return; + } + this.playerSlot.set(-1); + } + } + + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onPostUpdate(PostUpdateEvent e) { + if (delay.get()) { + delayAttack.set(false); + delay.set(false); + } + if (C08.get() || C09.get()) { + delay.set(true); + delayAttack.set(true); + } + C08.set(false); + C07.set(false); + C02.set(false); + C0A.set(false); + C09.set(false); + } + + public void handlePacket(Packet packet) { + if (packet instanceof C09PacketHeldItemChange) { + this.playerSlot.set(((C09PacketHeldItemChange) packet).getSlotId()); + C09.set(true); + } + else if (packet instanceof C02PacketUseEntity) { + C02.set(true); + } + else if (packet instanceof C07PacketPlayerDigging) { + C07.set(true); + } + else if (packet instanceof C08PacketPlayerBlockPlacement) { + C08.set(true); + } + else if (packet instanceof C0APacketAnimation) { + C0A.set(true); + } + } + + public boolean sent() { + if (C02.get() || C08.get() || C09.get() || C07.get() || C0A.get()) { + return true; + } + return false; + } + + public boolean updateSlot(int slot) { + if (playerSlot.get() == slot || slot == -1) { + return false; + } + mc.thePlayer.sendQueue.addToSendQueue(new C09PacketHeldItemChange(slot)); + playerSlot.set(slot); + return true; + } +} diff --git a/src/main/java/keystrokesmod/utility/Ping.java b/src/main/java/keystrokesmod/utility/Ping.java new file mode 100644 index 0000000..f882762 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/Ping.java @@ -0,0 +1,47 @@ +package keystrokesmod.utility; + +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class Ping { + private static boolean e = false; + private static long s = 0L; + + @SubscribeEvent + public void onChatMessageRecieved(ClientChatReceivedEvent event) { + if (e && Utils.nullCheck()) { + if (Utils.stripColor(event.message.getUnformattedText()).startsWith("Unknown")) { + event.setCanceled(true); + e = false; + this.getPing(); + } + } + } + + public static void checkPing() { + Commands.print("§3Checking...", 1); + if (e) { + Commands.print("§cPlease wait.", 0); + } + else { + Utils.mc.thePlayer.sendChatMessage("/..."); + e = true; + s = System.currentTimeMillis(); + } + } + + private void getPing() { + int ping = (int) (System.currentTimeMillis() - s) - 20; + if (ping < 0) { + ping = 0; + } + + Commands.print("Your ping: " + ping + "ms", 0); + rs(); + } + + public static void rs() { + e = false; + s = 0L; + } +} diff --git a/src/main/java/keystrokesmod/utility/PlayerData.java b/src/main/java/keystrokesmod/utility/PlayerData.java new file mode 100644 index 0000000..87579fe --- /dev/null +++ b/src/main/java/keystrokesmod/utility/PlayerData.java @@ -0,0 +1,78 @@ +package keystrokesmod.utility; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; + +public class PlayerData { + public double speed; + public int aboveVoidTicks; + public int fastTick; + public int autoBlockTicks; + public int ticksExisted; + public int lastSneakTick; + public double posZ; + public int sneakTicks; + public int noSlowTicks; + public double posY; + public boolean sneaking; + public double posX; + public double serverPosX; + public double serverPosY; + public double serverPosZ; + + public void update(EntityPlayer entityPlayer) { + final int ticksExisted = entityPlayer.ticksExisted; + this.posX = entityPlayer.posX - entityPlayer.lastTickPosX; + this.posY = entityPlayer.posY - entityPlayer.lastTickPosY; + this.posZ = entityPlayer.posZ - entityPlayer.lastTickPosZ; + this.speed = Math.max(Math.abs(this.posX), Math.abs(this.posZ)); + if (this.speed >= 0.07) { + ++this.fastTick; + this.ticksExisted = ticksExisted; + } + else { + this.fastTick = 0; + } + if (Math.abs(this.posY) >= 0.1) { + this.aboveVoidTicks = ticksExisted; + } + if (entityPlayer.isSneaking()) { + this.lastSneakTick = ticksExisted; + } + if (entityPlayer.isSwingInProgress && entityPlayer.isBlocking()) { + ++this.autoBlockTicks; + } + else { + this.autoBlockTicks = 0; + } + if (entityPlayer.isSprinting() && entityPlayer.isUsingItem()) { + ++this.noSlowTicks; + } + else { + this.noSlowTicks = 0; + } + if (entityPlayer.rotationPitch >= 70.0f && entityPlayer.getHeldItem() != null && entityPlayer.getHeldItem().getItem() instanceof ItemBlock) { + if (entityPlayer.swingProgressInt == 1) { + if (!this.sneaking && entityPlayer.isSneaking()) { + ++this.sneakTicks; + } + else { + this.sneakTicks = 0; + } + } + } + else { + this.sneakTicks = 0; + } + } + + public void updateSneak(final EntityPlayer entityPlayer) { + this.sneaking = entityPlayer.isSneaking(); + } + + public void updateServerPos(EntityPlayer entityPlayer) { + this.serverPosX = entityPlayer.serverPosX / 32; + this.serverPosY = entityPlayer.serverPosY / 32; + this.serverPosZ = entityPlayer.serverPosZ / 32; + } +} diff --git a/src/main/java/keystrokesmod/utility/ProfileUtils.java b/src/main/java/keystrokesmod/utility/ProfileUtils.java new file mode 100644 index 0000000..012486b --- /dev/null +++ b/src/main/java/keystrokesmod/utility/ProfileUtils.java @@ -0,0 +1,106 @@ +package keystrokesmod.utility; + +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; + +public class ProfileUtils { + public static String getMojangProfile(String n) { + String result = ""; + String response = NetworkUtils.getTextFromURL("https://api.mojang.com/users/profiles/minecraft/" + n, false); + if (!response.isEmpty()) { + try { + result = response.split("d\":\"")[1].split("\"")[0]; + } catch (ArrayIndexOutOfBoundsException var4) { + } + } + + return result; + } + + public static int[] getHypixelStats(String playerName, ProfileUtils.DM dm) { + int[] s = new int[]{0, 0, 0}; + String u = getMojangProfile(playerName); + if (u.isEmpty()) { + s[0] = -1; + return s; + } else { + String c = NetworkUtils.getTextFromURL("https://api.hypixel.net/player?key=" + NetworkUtils.API_KEY + "&uuid=" + u, false); + if (c.isEmpty()) { + return null; + } else if (c.equals("{\"success\":true,\"player\":null}")) { + s[0] = -1; + return s; + } else { + JsonObject d; + try { + JsonObject pr = parseJson(c).getAsJsonObject("player"); + d = pr.getAsJsonObject("stats").getAsJsonObject("Duels"); + } catch (NullPointerException var8) { + return s; + } + + switch (dm) { + case OVERALL: + s[0] = getValueAsInt(d, "wins"); + s[1] = getValueAsInt(d, "losses"); + s[2] = getValueAsInt(d, "current_winstreak"); + break; + case BRIDGE: + s[0] = getValueAsInt(d, "bridge_duel_wins"); + s[1] = getValueAsInt(d, "bridge_duel_losses"); + s[2] = getValueAsInt(d, "current_winstreak_mode_bridge_duel"); + break; + case UHC: + s[0] = getValueAsInt(d, "uhc_duel_wins"); + s[1] = getValueAsInt(d, "uhc_duel_losses"); + s[2] = getValueAsInt(d, "current_winstreak_mode_uhc_duel"); + break; + case SKYWARS: + s[0] = getValueAsInt(d, "sw_duel_wins"); + s[1] = getValueAsInt(d, "sw_duel_losses"); + s[2] = getValueAsInt(d, "current_winstreak_mode_sw_duel"); + break; + case CLASSIC: + s[0] = getValueAsInt(d, "classic_duel_wins"); + s[1] = getValueAsInt(d, "classic_duel_losses"); + s[2] = getValueAsInt(d, "current_winstreak_mode_classic_duel"); + break; + case SUMO: + s[0] = getValueAsInt(d, "sumo_duel_wins"); + s[1] = getValueAsInt(d, "sumo_duel_losses"); + s[2] = getValueAsInt(d, "current_winstreak_mode_sumo_duel"); + break; + case OP: + s[0] = getValueAsInt(d, "op_duel_wins"); + s[1] = getValueAsInt(d, "op_duel_losses"); + s[2] = getValueAsInt(d, "current_winstreak_mode_op_duel"); + } + + return s; + } + } + } + + public static JsonObject parseJson(String json) { + return (new JsonParser()).parse(json).getAsJsonObject(); + } + + private static int getValueAsInt(JsonObject jsonObject, String key) { + try { + return jsonObject.get(key).getAsInt(); + } + catch (NullPointerException var3) { + return 0; + } + } + + public enum DM { + OVERALL, + BRIDGE, + UHC, + SKYWARS, + CLASSIC, + SUMO, + OP; + } +} diff --git a/src/main/java/keystrokesmod/utility/RandomUtils.java b/src/main/java/keystrokesmod/utility/RandomUtils.java new file mode 100644 index 0000000..db29427 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/RandomUtils.java @@ -0,0 +1,29 @@ +package keystrokesmod.utility; + +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; + +public class RandomUtils { + private static SecureRandom secureRandom; + + static { + try { + secureRandom = SecureRandom.getInstance("SHA1PRNG"); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } + } + + public static double getRandom(double multiplier) { + if (multiplier == 0) { + return 0; + } + byte[] bytes = new byte[512]; + secureRandom.nextBytes(bytes); + double firstRandom = secureRandom.nextDouble(); + int seedByteCount = 10; + byte[] seed = secureRandom.generateSeed(seedByteCount); + secureRandom.setSeed(seed); + return (secureRandom.nextDouble() - firstRandom) * multiplier; + } +} diff --git a/src/main/java/keystrokesmod/utility/Reflection.java b/src/main/java/keystrokesmod/utility/Reflection.java new file mode 100644 index 0000000..4c44195 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/Reflection.java @@ -0,0 +1,367 @@ +package keystrokesmod.utility; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiEnchantment; +import net.minecraft.client.gui.GuiIngame; +import net.minecraft.client.gui.GuiScreenBook; +import net.minecraft.client.gui.inventory.GuiBrewingStand; +import net.minecraft.client.gui.inventory.GuiDispenser; +import net.minecraft.client.gui.inventory.GuiFurnace; +import net.minecraft.client.multiplayer.PlayerControllerMP; +import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAITasks; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.inventory.*; +import net.minecraft.item.ItemFood; +import net.minecraft.network.Packet; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.event.MouseEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.relauncher.ReflectionHelper; +import org.lwjgl.input.Mouse; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.nio.ByteBuffer; +import java.util.*; + +public class Reflection { + public static Field title; + public static Field button; + public static Field buttonstate; + public static Field buttons; + public static Field leftClickCounter; + public static Field jumpTicks; + public static Field rightClickDelayTimerField; + public static Field curBlockDamageMP; + public static Field blockHitDelay; + public static Method clickMouse; + public static Method setupCameraTransform; + public static Method rightClickMouse; + public static Field shaderResourceLocations; + public static Field useShader; + public static Field shaderIndex; + public static Method loadShader; + public static Field inGround; + public static Method getFOVModifier; + public static Field itemInUseCount; + public static Field S08PacketPlayerPosLookYaw; + public static Field S08PacketPlayerPosLookPitch; + public static Field C02PacketUseEntityEntityId; + public static Field bookContents; + public static Field classTarget; + public static Field fallDistance; + public static Field thirdPersonDistance; + public static Field alwaysEdible; + public static Field mcGuiInGame; + public static Field targetEntity; + public static Field targetTasks; + public static Field executingTaskEntries; + public static Field C01PacketChatMessageMessage; + public static HashMap containerInventoryPlayer = new HashMap<>(); + private static List containerClasses = Arrays.asList(GuiFurnace.class, GuiBrewingStand.class, GuiEnchantment.class, ContainerHopper.class, GuiDispenser.class, ContainerWorkbench.class, ContainerMerchant.class, ContainerHorseInventory.class); + public static boolean sendMessage = false; + public static Map keyBindings = new HashMap<>(); + + public static void getFields() { + try { + button = MouseEvent.class.getDeclaredField("button"); + buttonstate = MouseEvent.class.getDeclaredField("buttonstate"); + buttons = Mouse.class.getDeclaredField("buttons"); + + leftClickCounter = ReflectionHelper.findField(Minecraft.class, "field_71429_W", "leftClickCounter"); + + if (leftClickCounter != null) { + leftClickCounter.setAccessible(true); + } + + title = ReflectionHelper.findField(GuiIngame.class, "field_175201_x", "screenTitle"); + + if (title != null) { + title.setAccessible(true); + } + + jumpTicks = ReflectionHelper.findField(EntityLivingBase.class, "field_70773_bE", "jumpTicks"); + + if (jumpTicks != null) { + jumpTicks.setAccessible(true); + } + + rightClickDelayTimerField = ReflectionHelper.findField(Minecraft.class, "field_71467_ac", "rightClickDelayTimer"); + + if (rightClickDelayTimerField != null) { + rightClickDelayTimerField.setAccessible(true); + } + + C01PacketChatMessageMessage = ReflectionHelper.findField(C01PacketChatMessage.class, "field_149440_a", "message"); + + if (C01PacketChatMessageMessage != null) { + C01PacketChatMessageMessage.setAccessible(true); + } + + curBlockDamageMP = ReflectionHelper.findField(PlayerControllerMP.class, "field_78770_f", "curBlockDamageMP"); // fastmine and mining related stuff + if (curBlockDamageMP != null) { + curBlockDamageMP.setAccessible(true); + } + + classTarget = ReflectionHelper.findField(EntityAIAttackOnCollide.class, "field_75444_h", "classTarget"); + if (classTarget != null) { + classTarget.setAccessible(true); + } + + blockHitDelay = ReflectionHelper.findField(PlayerControllerMP.class, "field_78781_i", "blockHitDelay"); + if (blockHitDelay != null) { + blockHitDelay.setAccessible(true); + } + + targetEntity = ReflectionHelper.findField(EntityAINearestAttackableTarget.class, "targetEntity", "field_75309_a"); + if (targetEntity != null) { + targetEntity.setAccessible(true); + } + + targetTasks = ReflectionHelper.findField(EntityLiving.class, "targetTasks", "field_70715_bh"); + if (targetTasks != null) { + targetTasks.setAccessible(true); + } + + fallDistance = ReflectionHelper.findField(Entity.class, "fallDistance", "field_70143_R"); + if (fallDistance != null) { + fallDistance.setAccessible(true); + } + + mcGuiInGame = ReflectionHelper.findField(GuiIngame.class, "mc", "field_73839_d"); + if (mcGuiInGame != null) { + mcGuiInGame.setAccessible(true); + } + + executingTaskEntries = ReflectionHelper.findField(EntityAITasks.class, "executingTaskEntries", "field_75780_b"); + if (executingTaskEntries != null) { + executingTaskEntries.setAccessible(true); + } + + shaderResourceLocations = ReflectionHelper.findField(EntityRenderer.class, "shaderResourceLocations", "field_147712_ad"); + if (shaderResourceLocations != null) { + shaderResourceLocations.setAccessible(true); + } + + thirdPersonDistance = ReflectionHelper.findField(EntityRenderer.class, "thirdPersonDistance", "field_78490_B"); + if (thirdPersonDistance != null) { + thirdPersonDistance.setAccessible(true); + } + + alwaysEdible = ReflectionHelper.findField(ItemFood.class, "alwaysEdible", "field_77852_bZ"); + if (alwaysEdible != null) { + alwaysEdible.setAccessible(true); + } + + useShader = ReflectionHelper.findField(EntityRenderer.class, "useShader", "field_175083_ad"); + if (useShader != null) { + useShader.setAccessible(true); + } + + shaderIndex = ReflectionHelper.findField(EntityRenderer.class, "field_147713_ae", "shaderIndex"); // for shaders + if (shaderIndex != null) { + shaderIndex.setAccessible(true); + } + + inGround = ReflectionHelper.findField(EntityArrow.class, "field_70254_i", "inGround"); // for indicators + if (inGround != null) { + inGround.setAccessible(true); + } + + itemInUseCount = ReflectionHelper.findField(EntityPlayer.class, "field_71072_f", "itemInUseCount"); // for fake block + if (itemInUseCount != null) { + itemInUseCount.setAccessible(true); + } + + S08PacketPlayerPosLookYaw = ReflectionHelper.findField(S08PacketPlayerPosLook.class, "field_148936_d", "yaw"); + if (S08PacketPlayerPosLookYaw != null) { + S08PacketPlayerPosLookYaw.setAccessible(true); + } + + S08PacketPlayerPosLookPitch = ReflectionHelper.findField(S08PacketPlayerPosLook.class, "field_148937_e", "pitch"); + if (S08PacketPlayerPosLookPitch != null) { + S08PacketPlayerPosLookPitch.setAccessible(true); + } + + C02PacketUseEntityEntityId = ReflectionHelper.findField(C02PacketUseEntity.class, "entityId", "field_149567_a"); + if (C02PacketUseEntityEntityId != null) { + C02PacketUseEntityEntityId.setAccessible(true); + } + + bookContents = ReflectionHelper.findField(GuiScreenBook.class, "field_175386_A"); + if (bookContents != null) { + bookContents.setAccessible(true); + } + + for (Class clazz : containerClasses) { + for (Field field : clazz.getDeclaredFields()) { + addToMap(clazz, field); + } + } + + } catch (Exception var2) { + System.out.println("There was an error, relaunch the game."); + var2.printStackTrace(); + sendMessage = true; + } + } + + public static void setKeyBindings() { + for (KeyBinding keyBinding : Minecraft.getMinecraft().gameSettings.keyBindings) { + keyBindings.put(keyBinding, keyBinding.getKeyDescription().substring(4)); + } + } + + public static void getMethods() { + try { + try { + rightClickMouse = Minecraft.getMinecraft().getClass().getDeclaredMethod("func_147121_ag"); + } catch (NoSuchMethodException var4) { + try { + rightClickMouse = Minecraft.getMinecraft().getClass().getDeclaredMethod("rightClickMouse"); + } catch (NoSuchMethodException var3) { + } + } + + if (rightClickMouse != null) { + rightClickMouse.setAccessible(true); + } + + getFOVModifier = ReflectionHelper.findMethod(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, new String[]{"func_78481_a", "getFOVModifier"}, float.class, boolean.class); + + if (getFOVModifier != null) { + getFOVModifier.setAccessible(true); + } + + loadShader = ReflectionHelper.findMethod(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, new String[]{"func_175069_a", "loadShader"}, ResourceLocation.class); + + if (loadShader != null) { + loadShader.setAccessible(true); + } + + try { + clickMouse = Minecraft.getMinecraft().getClass().getDeclaredMethod("clickMouse"); + } catch (NoSuchMethodException var4) { + try { + clickMouse = Minecraft.getMinecraft().getClass().getDeclaredMethod("func_147116_af"); + } catch (NoSuchMethodException var3) { + } + } + + if (clickMouse != null) { + clickMouse.setAccessible(true); + } + + setupCameraTransform = ReflectionHelper.findMethod(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, new String[]{"func_78479_a", "setupCameraTransform"}, float.class, int.class); + + if (setupCameraTransform != null) { + setupCameraTransform.setAccessible(true); + } + } + catch (Exception e) { + System.out.println("There was an error, relaunch the game."); + e.printStackTrace(); + sendMessage = true; + } + } + + public static void setButton(int button, boolean state) { + if (Reflection.button != null && buttonstate != null && buttons != null) { + MouseEvent m = new MouseEvent(); + try { + Reflection.button.setAccessible(true); + Reflection.button.set(m, button); + buttonstate.setAccessible(true); + buttonstate.set(m, state); + MinecraftForge.EVENT_BUS.post(m); + buttons.setAccessible(true); + ByteBuffer bf = (ByteBuffer) buttons.get(null); + buttons.setAccessible(false); + bf.put(button, (byte) (state ? 1 : 0)); + } + catch (IllegalAccessException var4) { + } + } + } + + private static void addToMap(Class clazz, Field field) { + if (field == null || field.getType() != IInventory.class) { + return; + } + field = ReflectionHelper.findField(clazz, field.getName()); + if (field == null) { + return; + } + field.setAccessible(true); + containerInventoryPlayer.put(clazz, field); + } + + public static void rightClick() { + try { + Reflection.rightClickMouse.invoke(Minecraft.getMinecraft()); + } + catch (InvocationTargetException ex) {} + catch (IllegalAccessException ex2) {} + } + + public static void clickMouse() { + if (clickMouse != null) { + try { + clickMouse.invoke(Minecraft.getMinecraft()); + } + catch (InvocationTargetException ex) {} + catch (IllegalAccessException ex2) {} + } + } + + public static boolean setItemInUse(boolean blocking) { + try { + itemInUseCount.set(Minecraft.getMinecraft().thePlayer, blocking ? 1 : 0); + } + catch (Exception e) { + e.printStackTrace(); + Utils.sendMessage("§cFailed to set block state client-side."); + return false; + } + return blocking; + } + + public static boolean setupCameraTransform(EntityRenderer entityRenderer, float partialTicks, int eyeIndex) { + try { + if (setupCameraTransform == null) { + return false; + } + setupCameraTransform.invoke(entityRenderer, partialTicks, eyeIndex); + return true; + } + catch (IllegalAccessException | InvocationTargetException e) { + e.printStackTrace(); + } + return false; + } + + public static Entity getClassTarget(EntityAIAttackOnCollide task) { + try { + if (classTarget != null) { + Entity targetEntity = (Entity) classTarget.get(task); + return targetEntity; + } + } + catch (Exception e) { + e.printStackTrace(); + } + return null; + } +} diff --git a/src/main/java/keystrokesmod/utility/RenderUtils.java b/src/main/java/keystrokesmod/utility/RenderUtils.java new file mode 100644 index 0000000..98ed6d2 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/RenderUtils.java @@ -0,0 +1,956 @@ +package keystrokesmod.utility; + +import keystrokesmod.module.impl.player.Freecam; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.*; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.culling.Frustum; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.client.resources.model.IBakedModel; +import net.minecraft.client.shader.Framebuffer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.Vec3; +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GL11; +import org.lwjgl.util.glu.GLU; + +import java.awt.*; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; + +import static org.lwjgl.opengl.GL11.*; + +public class RenderUtils { + private static Minecraft mc = Minecraft.getMinecraft(); + public static boolean ring_c = false; + private static Frustum frustum = new Frustum(); + private static final FloatBuffer MODELVIEW = BufferUtils.createFloatBuffer(16); + private static final FloatBuffer PROJECTION = BufferUtils.createFloatBuffer(16); + private static final IntBuffer VIEWPORT = BufferUtils.createIntBuffer(16); + private static final FloatBuffer SCREEN_COORDS = BufferUtils.createFloatBuffer(3); + + public static void renderBlock(BlockPos blockPos, int color, boolean outline, boolean shade) { + renderBox(blockPos.getX(), blockPos.getY(), blockPos.getZ(), 1, 1, 1, color, outline, shade); + } + + public static void renderChest(BlockPos blockPos, int color, boolean outline, boolean shade) { + renderBox(blockPos.getX() + 0.0625F, blockPos.getY(), blockPos.getZ() + 0.0625F, 0.875f, 0.875f, 0.875f, color, outline, shade); + } + + public static void renderBlock(BlockPos blockPos, int color, double y2, boolean outline, boolean shade) { + renderBox(blockPos.getX(), blockPos.getY(), blockPos.getZ(), 1, y2, 1, color, outline, shade); + } + + public static void scissor(double x, double y, double width, double height) { + ScaledResolution sr = new ScaledResolution(mc); + double scale = sr.getScaleFactor(); + + int scaledX = (int) (x * scale); + int scaledY = (int) ((sr.getScaledHeight() - y) * scale); + int scaledWidth = (int) (width * scale); + int scaledHeight = (int) (height * scale); + + GL11.glScissor(scaledX, scaledY - scaledHeight, scaledWidth, scaledHeight); + } + + public static boolean isInViewFrustum(final Entity entity) { + return isInViewFrustum(entity.getEntityBoundingBox()) || entity.ignoreFrustumCheck; + } + + private static boolean isInViewFrustum(final AxisAlignedBB bb) { + frustum.setPosition(mc.getRenderViewEntity().posX, mc.getRenderViewEntity().posY, mc.getRenderViewEntity().posZ); + return frustum.isBoundingBoxInFrustum(bb); + } + + public static void drawRect(double left, double top, double right, double bottom, int color) { + float f3 = (color >> 24 & 255) / 255.0F; + float f = (color >> 16 & 255) / 255.0F; + float f1 = (color >> 8 & 255) / 255.0F; + float f2 = (color & 255) / 255.0F; + GlStateManager.pushMatrix(); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + GlStateManager.enableBlend(); + GlStateManager.disableTexture2D(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.color(f, f1, f2, f3); + worldrenderer.begin(7, DefaultVertexFormats.POSITION); + worldrenderer.pos(left, bottom, 0.0D).endVertex(); + worldrenderer.pos(right, bottom, 0.0D).endVertex(); + worldrenderer.pos(right, top, 0.0D).endVertex(); + worldrenderer.pos(left, top, 0.0D).endVertex(); + tessellator.draw(); + GlStateManager.enableTexture2D(); + GlStateManager.disableBlend(); + GlStateManager.popMatrix(); + } + + public static void drawOutline(float x, float y, float x2, float y2, float lineWidth, int color) { + float f5 = (float) ((color >> 24) & 255) / 255.0F; + float f6 = (float) ((color >> 16) & 255) / 255.0F; + float f7 = (float) ((color >> 8) & 255) / 255.0F; + float f8 = (float) (color & 255) / 255.0F; + + glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL11.GL_LINE_SMOOTH); + GL11.glPushMatrix(); + GL11.glColor4f(f6, f7, f8, f5); + GL11.glLineWidth(lineWidth); + GL11.glBegin(1); + GL11.glVertex2d(x, y); + GL11.glVertex2d(x, y2); + GL11.glVertex2d(x2, y2); + GL11.glVertex2d(x2, y); + GL11.glVertex2d(x, y); + GL11.glVertex2d(x2, y); + GL11.glVertex2d(x, y2); + GL11.glVertex2d(x2, y2); + GL11.glEnd(); + GL11.glColor4f(1f, 1f, 1f, 1f); + glPopMatrix(); + glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_LINE_SMOOTH); + } + + public static void renderBox(double x, double y, double z, double x2, double y2, double z2, int color, boolean outline, boolean shade) { + double xPos = x - mc.getRenderManager().viewerPosX; + double yPos = y - mc.getRenderManager().viewerPosY; + double zPos = z - mc.getRenderManager().viewerPosZ; + GL11.glPushMatrix(); + GL11.glBlendFunc(770, 771); + glEnable(3042); + GL11.glLineWidth(2.0f); + GL11.glDisable(3553); + GL11.glDisable(2929); + GL11.glDepthMask(false); + float n8 = (color >> 24 & 0xFF) / 255.0f; + float n9 = (color >> 16 & 0xFF) / 255.0f; + float n10 = (color >> 8 & 0xFF) / 255.0f; + float n11 = (color & 0xFF) / 255.0f; + GL11.glColor4f(n9, n10, n11, n8); + AxisAlignedBB axisAlignedBB = new AxisAlignedBB(xPos, yPos, zPos, xPos + x2, yPos + y2, zPos + z2); + if (outline) { + RenderGlobal.drawSelectionBoundingBox(axisAlignedBB); + } + if (shade) { + drawBoundingBox(axisAlignedBB, n9, n10, n11); + } + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + glEnable(3553); + glEnable(2929); + GL11.glDepthMask(true); + GL11.glDisable(3042); + glPopMatrix(); + } + + public static void renderBPS(final boolean b, final boolean b2) { + final ScaledResolution scaledResolution = new ScaledResolution(mc); + String s = ""; + int n = -1; + if (b) { + final double t = Utils.gbps((Freecam.freeEntity == null) ? mc.thePlayer : Freecam.freeEntity, 2); + if (t < 10.0) { + n = Color.green.getRGB(); + } + else if (t < 30.0) { + n = Color.yellow.getRGB(); + } + else if (t < 60.0) { + n = Color.orange.getRGB(); + } + else if (t < 160.0) { + n = Color.red.getRGB(); + } + else { + n = Color.black.getRGB(); + } + s = s + t + "bps"; + } + if (b2) { + final double h = Utils.getHorizontalSpeed(); + if (!s.isEmpty()) { + s += " "; + } + s += Utils.round(h, 3); + } + mc.fontRendererObj.drawString(s, (float)(scaledResolution.getScaledWidth() / 2 - mc.fontRendererObj.getStringWidth(s) / 2), (float)(scaledResolution.getScaledHeight() / 2 + 15), n, false); + } + + public static void renderEntity(Entity e, int type, double expand, double shift, int color, boolean damage) { + if (e instanceof EntityLivingBase) { + double x = e.lastTickPosX + (e.posX - e.lastTickPosX) * (double) Utils.getTimer().renderPartialTicks - mc.getRenderManager().viewerPosX; + double y = e.lastTickPosY + (e.posY - e.lastTickPosY) * (double) Utils.getTimer().renderPartialTicks - mc.getRenderManager().viewerPosY; + double z = e.lastTickPosZ + (e.posZ - e.lastTickPosZ) * (double) Utils.getTimer().renderPartialTicks - mc.getRenderManager().viewerPosZ; + float d = (float) expand / 40.0F; + if (e instanceof EntityPlayer && damage && ((EntityPlayer) e).hurtTime != 0) { + color = Color.RED.getRGB(); + } + + GlStateManager.pushMatrix(); + if (type == 3) { + GL11.glTranslated(x, y - 0.2D, z); + GL11.glRotated((double) (-mc.getRenderManager().playerViewY), 0.0D, 1.0D, 0.0D); + GlStateManager.disableDepth(); + GL11.glScalef(0.03F + d, 0.03F + d, 0.03F + d); + int outline = Color.black.getRGB(); + net.minecraft.client.gui.Gui.drawRect(-20, -1, -26, 75, outline); + net.minecraft.client.gui.Gui.drawRect(20, -1, 26, 75, outline); + net.minecraft.client.gui.Gui.drawRect(-20, -1, 21, 5, outline); + net.minecraft.client.gui.Gui.drawRect(-20, 70, 21, 75, outline); + if (color != 0) { + net.minecraft.client.gui.Gui.drawRect(-21, 0, -25, 74, color); + net.minecraft.client.gui.Gui.drawRect(21, 0, 25, 74, color); + net.minecraft.client.gui.Gui.drawRect(-21, 0, 24, 4, color); + net.minecraft.client.gui.Gui.drawRect(-21, 71, 25, 74, color); + } else { + int st = Utils.getChroma(2L, 0L); + int en = Utils.getChroma(2L, 1000L); + dGR(-21, 0, -25, 74, st, en); + dGR(21, 0, 25, 74, st, en); + net.minecraft.client.gui.Gui.drawRect(-21, 0, 21, 4, en); + net.minecraft.client.gui.Gui.drawRect(-21, 71, 21, 74, st); + } + + GlStateManager.enableDepth(); + } else { + int i; + if (type == 4) { //Healthnigger + EntityLivingBase en = (EntityLivingBase) e; + double r = en.getHealth() / en.getMaxHealth(); + int b = (int) (74.0D * r); + int hc = r < 0.3D ? Color.red.getRGB() : (r < 0.5D ? Color.orange.getRGB() : (r < 0.7D ? Color.yellow.getRGB() : Color.green.getRGB())); + GL11.glTranslated(x, y - 0.2D, z); + GL11.glRotated(-mc.getRenderManager().playerViewY, 0.0D, 1.0D, 0.0D); + GlStateManager.disableDepth(); + GL11.glScalef(0.03F + d, 0.03F + d, 0.03F + d); + i = (int) (21 + shift * 2); + net.minecraft.client.gui.Gui.drawRect(i, -1, i + 4, 75, Color.black.getRGB()); + net.minecraft.client.gui.Gui.drawRect(i + 1, b, i + 3, 74, Color.darkGray.getRGB()); + net.minecraft.client.gui.Gui.drawRect(i + 1, 0, i + 3, b, hc); + GlStateManager.enableDepth(); + } else if (type == 6) { + d3p(x, y, z, 0.699999988079071D, 45, 1.5F, color, color == 0); + } else { + if (color == 0) { + color = Utils.getChroma(2L, 0L); + } + + float a = (float) (color >> 24 & 255) / 255.0F; + float r = (float) (color >> 16 & 255) / 255.0F; + float g = (float) (color >> 8 & 255) / 255.0F; + float b = (float) (color & 255) / 255.0F; + AxisAlignedBB bbox = e.getEntityBoundingBox().expand(0.1D + expand, 0.1D + expand, 0.1D + expand); + AxisAlignedBB axis = new AxisAlignedBB(bbox.minX - e.posX + x, bbox.minY - e.posY + y, bbox.minZ - e.posZ + z, bbox.maxX - e.posX + x, bbox.maxY - e.posY + y, bbox.maxZ - e.posZ + z); + GL11.glBlendFunc(770, 771); + glEnable(3042); + GL11.glDisable(3553); + GL11.glDisable(2929); + GL11.glDepthMask(false); + GL11.glLineWidth(2.0F); + GL11.glColor4f(r, g, b, a); + if (type == 1) { + RenderGlobal.drawSelectionBoundingBox(axis); + } else if (type == 2) { + drawBoundingBox(axis, r, g, b); + } + glEnable(3553); + glEnable(2929); + GL11.glDepthMask(true); + GL11.glDisable(3042); + } + } + GlStateManager.popMatrix(); + } + } + + public static void drawPolygon(final double n, final double n2, final double n3, final int n4, final int n5) { + if (n4 < 3) { + return; + } + final float n6 = (n5 >> 24 & 0xFF) / 255.0f; + final float n7 = (n5 >> 16 & 0xFF) / 255.0f; + final float n8 = (n5 >> 8 & 0xFF) / 255.0f; + final float n9 = (n5 & 0xFF) / 255.0f; + final Tessellator getInstance = Tessellator.getInstance(); + final WorldRenderer getWorldRenderer = getInstance.getWorldRenderer(); + GlStateManager.enableBlend(); + GlStateManager.disableTexture2D(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GL11.glColor4f(n7, n8, n9, n6); + getWorldRenderer.begin(6, DefaultVertexFormats.POSITION); + for (int i = 0; i < n4; ++i) { + final double n10 = 6.283185307179586 * i / n4 + Math.toRadians(180.0); + getWorldRenderer.pos(n + Math.sin(n10) * n3, n2 + Math.cos(n10) * n3, 0.0).endVertex(); + } + getInstance.draw(); + GlStateManager.enableTexture2D(); + GlStateManager.disableBlend(); + } + + public static void drawBoundingBox(AxisAlignedBB abb, float r, float g, float b) { + drawBoundingBox(abb, r, g, b, 0.25f); + } + + public static void drawBoundingBox(AxisAlignedBB abb, float r, float g, float b, float a) { + Tessellator ts = Tessellator.getInstance(); + WorldRenderer vb = ts.getWorldRenderer(); + vb.begin(7, DefaultVertexFormats.POSITION_COLOR); + vb.pos(abb.minX, abb.minY, abb.minZ).color(r, g, b, a).endVertex(); + vb.pos(abb.minX, abb.maxY, abb.minZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.minY, abb.minZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.maxY, abb.minZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.minY, abb.maxZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.maxY, abb.maxZ).color(r, g, b, a).endVertex(); + vb.pos(abb.minX, abb.minY, abb.maxZ).color(r, g, b, a).endVertex(); + vb.pos(abb.minX, abb.maxY, abb.maxZ).color(r, g, b, a).endVertex(); + ts.draw(); + vb.begin(7, DefaultVertexFormats.POSITION_COLOR); + vb.pos(abb.maxX, abb.maxY, abb.minZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.minY, abb.minZ).color(r, g, b, a).endVertex(); + vb.pos(abb.minX, abb.maxY, abb.minZ).color(r, g, b, a).endVertex(); + vb.pos(abb.minX, abb.minY, abb.minZ).color(r, g, b, a).endVertex(); + vb.pos(abb.minX, abb.maxY, abb.maxZ).color(r, g, b, a).endVertex(); + vb.pos(abb.minX, abb.minY, abb.maxZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.maxY, abb.maxZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.minY, abb.maxZ).color(r, g, b, a).endVertex(); + ts.draw(); + vb.begin(7, DefaultVertexFormats.POSITION_COLOR); + vb.pos(abb.minX, abb.maxY, abb.minZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.maxY, abb.minZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.maxY, abb.maxZ).color(r, g, b, a).endVertex(); + vb.pos(abb.minX, abb.maxY, abb.maxZ).color(r, g, b, a).endVertex(); + vb.pos(abb.minX, abb.maxY, abb.minZ).color(r, g, b, a).endVertex(); + vb.pos(abb.minX, abb.maxY, abb.maxZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.maxY, abb.maxZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.maxY, abb.minZ).color(r, g, b, a).endVertex(); + ts.draw(); + vb.begin(7, DefaultVertexFormats.POSITION_COLOR); + vb.pos(abb.minX, abb.minY, abb.minZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.minY, abb.minZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.minY, abb.maxZ).color(r, g, b, a).endVertex(); + vb.pos(abb.minX, abb.minY, abb.maxZ).color(r, g, b, a).endVertex(); + vb.pos(abb.minX, abb.minY, abb.minZ).color(r, g, b, a).endVertex(); + vb.pos(abb.minX, abb.minY, abb.maxZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.minY, abb.maxZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.minY, abb.minZ).color(r, g, b, a).endVertex(); + ts.draw(); + vb.begin(7, DefaultVertexFormats.POSITION_COLOR); + vb.pos(abb.minX, abb.minY, abb.minZ).color(r, g, b, a).endVertex(); + vb.pos(abb.minX, abb.maxY, abb.minZ).color(r, g, b, a).endVertex(); + vb.pos(abb.minX, abb.minY, abb.maxZ).color(r, g, b, a).endVertex(); + vb.pos(abb.minX, abb.maxY, abb.maxZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.minY, abb.maxZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.maxY, abb.maxZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.minY, abb.minZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.maxY, abb.minZ).color(r, g, b, a).endVertex(); + ts.draw(); + vb.begin(7, DefaultVertexFormats.POSITION_COLOR); + vb.pos(abb.minX, abb.maxY, abb.maxZ).color(r, g, b, a).endVertex(); + vb.pos(abb.minX, abb.minY, abb.maxZ).color(r, g, b, a).endVertex(); + vb.pos(abb.minX, abb.maxY, abb.minZ).color(r, g, b, a).endVertex(); + vb.pos(abb.minX, abb.minY, abb.minZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.maxY, abb.minZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.minY, abb.minZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.maxY, abb.maxZ).color(r, g, b, a).endVertex(); + vb.pos(abb.maxX, abb.minY, abb.maxZ).color(r, g, b, a).endVertex(); + ts.draw(); + } + + public static void renderBlockModel(IBlockState blockState, double x, double y, double z, int color) { + Minecraft mc = Minecraft.getMinecraft(); + BlockRendererDispatcher dispatcher = mc.getBlockRendererDispatcher(); + IBakedModel model = dispatcher.getModelFromBlockState(blockState, mc.theWorld, new BlockPos(x, y, z)); + + + double xPos = x - mc.getRenderManager().viewerPosX; + double yPos = y - mc.getRenderManager().viewerPosY; + double zPos = z - mc.getRenderManager().viewerPosZ; + + float a = ((color >> 24) & 0xFF) / 255.0f; + float r = ((color >> 16) & 0xFF) / 255.0f; + float g = ((color >> 8) & 0xFF) / 255.0f; + float b = (color & 0xFF) / 255.0f; + + GlStateManager.pushMatrix(); + GlStateManager.translate(xPos, yPos, zPos); + + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GlStateManager.disableTexture2D(); + GlStateManager.disableCull(); + GlStateManager.disableDepth(); + GlStateManager.depthMask(false); + GlStateManager.color(r, g, b, a); + + renderModelColoredQuads(model, r, g, b, a); + + GlStateManager.depthMask(true); + GlStateManager.enableDepth(); + GlStateManager.enableTexture2D(); + GlStateManager.enableCull(); + GlStateManager.disableBlend(); + GlStateManager.popMatrix(); + } + + private static void renderModelColoredQuads(IBakedModel model, float r, float g, float b, float a) { + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer wr = tessellator.getWorldRenderer(); + for (EnumFacing face : EnumFacing.values()) { + for (BakedQuad quad : model.getFaceQuads(face)) { + drawColoredQuad(wr, quad, r, g, b, a, tessellator); + } + } + for (BakedQuad quad : model.getGeneralQuads()) { + drawColoredQuad(wr, quad, r, g, b, a, tessellator); + } + } + + private static void drawColoredQuad(WorldRenderer wr, BakedQuad quad, float r, float g, float b, float a, Tessellator tessellator) { + int[] vertexData = quad.getVertexData(); + final int vertexCount = 4; + final int intsPerVertex = vertexData.length / vertexCount; + + wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR); + for (int i = 0; i < vertexCount; i++) { + int baseIndex = i * intsPerVertex; + float vx = Float.intBitsToFloat(vertexData[baseIndex]); + float vy = Float.intBitsToFloat(vertexData[baseIndex + 1]); + float vz = Float.intBitsToFloat(vertexData[baseIndex + 2]); + + wr.pos(vx, vy, vz).color(r, g, b, a).endVertex(); + } + tessellator.draw(); + } + + public static void drawTracerLine(Entity e, int color, float lineWidth, float partialTicks) { + if (e != null) { + double x = e.lastTickPosX + (e.posX - e.lastTickPosX) * (double) partialTicks - mc.getRenderManager().viewerPosX; + double y = (double) e.getEyeHeight() + e.lastTickPosY + (e.posY - e.lastTickPosY) * (double) partialTicks - mc.getRenderManager().viewerPosY; + double z = e.lastTickPosZ + (e.posZ - e.lastTickPosZ) * (double) partialTicks - mc.getRenderManager().viewerPosZ; + float a = (float) (color >> 24 & 255) / 255.0F; + float r = (float) (color >> 16 & 255) / 255.0F; + float g = (float) (color >> 8 & 255) / 255.0F; + float b = (float) (color & 255) / 255.0F; + GL11.glPushMatrix(); + glEnable(3042); + glEnable(2848); + GL11.glDisable(2929); + GL11.glDisable(3553); + GL11.glBlendFunc(770, 771); + glEnable(3042); + GL11.glLineWidth(lineWidth); + GL11.glColor4f(r, g, b, a); + GL11.glBegin(2); + GL11.glVertex3d(0.0D, (double) mc.thePlayer.getEyeHeight(), 0.0D); + GL11.glVertex3d(x, y, z); + GL11.glEnd(); + GL11.glDisable(3042); + glEnable(3553); + glEnable(2929); + GL11.glDisable(2848); + GL11.glDisable(3042); + glPopMatrix(); + } + } + + public static void dGR(int left, int top, int right, int bottom, int startColor, int endColor) { + int j; + if (left < right) { + j = left; + left = right; + right = j; + } + + if (top < bottom) { + j = top; + top = bottom; + bottom = j; + } + + float f = (float) (startColor >> 24 & 255) / 255.0F; + float f1 = (float) (startColor >> 16 & 255) / 255.0F; + float f2 = (float) (startColor >> 8 & 255) / 255.0F; + float f3 = (float) (startColor & 255) / 255.0F; + float f4 = (float) (endColor >> 24 & 255) / 255.0F; + float f5 = (float) (endColor >> 16 & 255) / 255.0F; + float f6 = (float) (endColor >> 8 & 255) / 255.0F; + float f7 = (float) (endColor & 255) / 255.0F; + GlStateManager.disableTexture2D(); + GlStateManager.enableBlend(); + GlStateManager.disableAlpha(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.shadeModel(7425); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + worldrenderer.pos((double) right, (double) top, 0.0D).color(f1, f2, f3, f).endVertex(); + worldrenderer.pos((double) left, (double) top, 0.0D).color(f1, f2, f3, f).endVertex(); + worldrenderer.pos((double) left, (double) bottom, 0.0D).color(f5, f6, f7, f4).endVertex(); + worldrenderer.pos((double) right, (double) bottom, 0.0D).color(f5, f6, f7, f4).endVertex(); + tessellator.draw(); + GlStateManager.shadeModel(7424); + GlStateManager.disableBlend(); + GlStateManager.enableAlpha(); + GlStateManager.enableTexture2D(); + } + + public static void db(int w, int h, int r) { + int c = r == -1 ? -1089466352 : r; + net.minecraft.client.gui.Gui.drawRect(0, 0, w, h, c); + } + + public static void drawColoredString(String text, char lineSplit, int x, int y, long s, long shift, boolean rect, FontRenderer fontRenderer) { + int bX = x; + int l = 0; + long r = 0L; + + for (int i = 0; i < text.length(); ++i) { + char c = text.charAt(i); + if (c == lineSplit) { + ++l; + x = bX; + y += fontRenderer.FONT_HEIGHT + 5; + r = shift * (long) l; + } + else { + fontRenderer.drawString(String.valueOf(c), (float) x, (float) y, Utils.getChroma(s, r), rect); + x += fontRenderer.getCharWidth(c); + if (c != ' ') { + r -= 90L; + } + } + } + + } + + public static void d3p(double x, double y, double z, double radius, int sides, float lineWidth, int color, boolean chroma) { + float a = (float) (color >> 24 & 255) / 255.0F; + float r = (float) (color >> 16 & 255) / 255.0F; + float g = (float) (color >> 8 & 255) / 255.0F; + float b = (float) (color & 255) / 255.0F; + mc.entityRenderer.disableLightmap(); + GL11.glDisable(3553); + glEnable(3042); + GL11.glBlendFunc(770, 771); + GL11.glDisable(2929); + glEnable(2848); + GL11.glDepthMask(false); + GL11.glLineWidth(lineWidth); + if (!chroma) { + GL11.glColor4f(r, g, b, a); + } + + GL11.glBegin(1); + long d = 0L; + long ed = 15000L / (long) sides; + long hed = ed / 2L; + + for (int i = 0; i < sides * 2; ++i) { + if (chroma) { + if (i % 2 != 0) { + if (i == 47) { + d = hed; + } + + d += ed; + } + + int c = Utils.getChroma(2L, d); + float r2 = (float) (c >> 16 & 255) / 255.0F; + float g2 = (float) (c >> 8 & 255) / 255.0F; + float b2 = (float) (c & 255) / 255.0F; + GL11.glColor3f(r2, g2, b2); + } + + double angle = 6.283185307179586D * (double) i / (double) sides + Math.toRadians(180.0D); + GL11.glVertex3d(x + Math.cos(angle) * radius, y, z + Math.sin(angle) * radius); + } + + GL11.glEnd(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDepthMask(true); + GL11.glDisable(2848); + glEnable(2929); + GL11.glDisable(3042); + glEnable(3553); + mc.entityRenderer.enableLightmap(); + } + + public static void drawCaret(float x, float y, int color, double width, double length) { + GL11.glPushMatrix(); + glEnable(GL11.GL_LINE_SMOOTH); + GL11.glDisable(GL11.GL_TEXTURE_2D); + RenderUtils.glColor(color); + GL11.glLineWidth((float) width); + float halfWidth = (float) (width / 2.0); + float xOffset = halfWidth / 2.0f; + float yOffset = halfWidth / 2.0f; + GL11.glBegin(GL11.GL_LINES); + GL11.glVertex2d(x - xOffset, y + yOffset); + GL11.glVertex2d(x + length - xOffset, y - length + yOffset); + GL11.glVertex2d(x + length - xOffset, y - length + yOffset); + GL11.glVertex2d(x + 2 * length - xOffset, y + yOffset); + GL11.glEnd(); + glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LINE_SMOOTH); + glPopMatrix(); + } + + public static void drawTriangle(double x, double y, double size, double widthDiv, double heightDiv, int color) { + boolean blend = GL11.glIsEnabled(3042); + glEnable(3042); + GL11.glDisable(3553); + GL11.glBlendFunc(770, 771); + glEnable(2848); + GL11.glPushMatrix(); + glColor(color); + GL11.glBegin(7); + GL11.glVertex2d(x, y); + GL11.glVertex2d((x - size / widthDiv), (y + size)); + GL11.glVertex2d(x, (y + size / heightDiv)); + GL11.glVertex2d((x + size / widthDiv), (y + size)); + GL11.glVertex2d(x, y); + GL11.glEnd(); + GL11.glColor4f(0.0f, 0.0f, 0.0f, 0.8f); + GL11.glBegin(2); + GL11.glVertex2d(x, y); + GL11.glVertex2d((x - size / widthDiv), (y + size)); + GL11.glVertex2d(x, (y + size / heightDiv)); + GL11.glVertex2d((x + size / widthDiv), (y + size)); + GL11.glVertex2d(x, y); + GL11.glEnd(); + glPopMatrix(); + glEnable(3553); + if (!blend) { + GL11.glDisable(3042); + } + GL11.glDisable(2848); + } + + public static void glColor(final int n) { // credit to the creator of raven b4 + GL11.glColor4f((float) (n >> 16 & 0xFF) / 255.0f, (float) (n >> 8 & 0xFF) / 255.0f, (float) (n & 0xFF) / 255.0f, (float) (n >> 24 & 0xFF) / 255.0f); + } + + public static void drawRoundedGradientOutlinedRectangle(float n, float n2, float n3, float n4, final float n5, final int n6, final int n7, final int n8) { // credit to the creator of raven b4 + n *= 2.0f; + n2 *= 2.0f; + n3 *= 2.0f; + n4 *= 2.0f; + GL11.glPushAttrib(1); + GL11.glScaled(0.5, 0.5, 0.5); + glEnable(3042); + GL11.glDisable(3553); + glEnable(2848); + GL11.glBegin(9); + glColor(n6); + for (int i = 0; i <= 90; i += 3) { + final double n9 = (double) (i * 0.017453292f); + GL11.glVertex2d((double) (n + n5) + Math.sin(n9) * n5 * -1.0, (double) (n2 + n5) + Math.cos(n9) * n5 * -1.0); + } + for (int j = 90; j <= 180; j += 3) { + final double n10 = (double) (j * 0.017453292f); + GL11.glVertex2d((double) (n + n5) + Math.sin(n10) * n5 * -1.0, (double) (n4 - n5) + Math.cos(n10) * n5 * -1.0); + } + for (int k = 0; k <= 90; k += 3) { + final double n11 = (double) (k * 0.017453292f); + GL11.glVertex2d((double) (n3 - n5) + Math.sin(n11) * n5, (double) (n4 - n5) + Math.cos(n11) * n5); + } + for (int l = 90; l <= 180; l += 3) { + final double n12 = (double) (l * 0.017453292f); + GL11.glVertex2d((double) (n3 - n5) + Math.sin(n12) * n5, (double) (n2 + n5) + Math.cos(n12) * n5); + } + GL11.glEnd(); + GL11.glPushMatrix(); + GL11.glShadeModel(7425); + GL11.glLineWidth(2.0f); + GL11.glBegin(2); + if (n7 != 0L) { + glColor(n7); + } + for (int n13 = 0; n13 <= 90; n13 += 3) { + final double n14 = (double) (n13 * 0.017453292f); + GL11.glVertex2d((double) (n + n5) + Math.sin(n14) * n5 * -1.0, (double) (n2 + n5) + Math.cos(n14) * n5 * -1.0); + } + for (int n15 = 90; n15 <= 180; n15 += 3) { + final double n16 = (double) (n15 * 0.017453292f); + GL11.glVertex2d((double) (n + n5) + Math.sin(n16) * n5 * -1.0, (double) (n4 - n5) + Math.cos(n16) * n5 * -1.0); + } + if (n8 != 0) { + glColor(n8); + } + for (int n17 = 0; n17 <= 90; n17 += 3) { + final double n18 = (double) (n17 * 0.017453292f); + GL11.glVertex2d((double) (n3 - n5) + Math.sin(n18) * n5, (double) (n4 - n5) + Math.cos(n18) * n5); + } + for (int n19 = 90; n19 <= 180; n19 += 3) { + final double n20 = (double) (n19 * 0.017453292f); + GL11.glVertex2d((double) (n3 - n5) + Math.sin(n20) * n5, (double) (n2 + n5) + Math.cos(n20) * n5); + } + GL11.glEnd(); + glPopMatrix(); + glEnable(3553); + GL11.glDisable(3042); + GL11.glDisable(2848); + glEnable(3553); + GL11.glScaled(2.0, 2.0, 2.0); + GL11.glPopAttrib(); + GL11.glLineWidth(1.0f); + GL11.glShadeModel(7424); + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); + } + + public static void draw2DPolygon(final double x, final double y, final double radius, final int sides, final int color) { + if (sides < 3) { + return; + } + final float a = (color >> 24 & 0xFF) / 255.0f; + final float r = (color >> 16 & 0xFF) / 255.0f; + final float g = (color >> 8 & 0xFF) / 255.0f; + final float b = (color & 0xFF) / 255.0f; + final Tessellator tessellator = Tessellator.getInstance(); + final WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + GlStateManager.enableBlend(); + GlStateManager.disableTexture2D(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GL11.glColor4f(r, g, b, a); + final double rad180 = Math.toRadians(180.0); + worldrenderer.begin(6, DefaultVertexFormats.POSITION); + for (int i = 0; i < sides; ++i) { + final double angle = 6.283185307179586 * i / sides + rad180; + worldrenderer.pos(x + Math.sin(angle) * radius, y + Math.cos(angle) * radius, 0.0).endVertex(); + } + tessellator.draw(); + GlStateManager.enableTexture2D(); + GlStateManager.disableBlend(); + } + + public static Framebuffer createFrameBuffer(Framebuffer framebuffer) { + return createFrameBuffer(framebuffer, false); + } + + public static Framebuffer createFrameBuffer(Framebuffer framebuffer, boolean depth) { + if (needsNewFramebuffer(framebuffer)) { + if (framebuffer != null) { + framebuffer.deleteFramebuffer(); + } + return new Framebuffer(mc.displayWidth, mc.displayHeight, depth); + } + return framebuffer; + } + + public static boolean needsNewFramebuffer(Framebuffer framebuffer) { + return framebuffer == null || framebuffer.framebufferWidth != mc.displayWidth || framebuffer.framebufferHeight != mc.displayHeight; + } + + public static void bindTexture(int texture) { + glBindTexture(GL_TEXTURE_2D, texture); + } + + public static void setAlphaLimit(float limit) { + GlStateManager.enableAlpha(); + GlStateManager.alphaFunc(GL_GREATER, (float) (limit * .01)); + } + + public static Color interpolateColorC(Color color1, Color color2, float amount) { + amount = Math.min(1, Math.max(0, amount)); + return new Color(interpolateInt(color1.getRed(), color2.getRed(), amount), + interpolateInt(color1.getGreen(), color2.getGreen(), amount), + interpolateInt(color1.getBlue(), color2.getBlue(), amount), + interpolateInt(color1.getAlpha(), color2.getAlpha(), amount)); + } + + public static int interpolateInt(int oldValue, int newValue, double interpolationValue) { + return interpolate(oldValue, newValue, (float) interpolationValue).intValue(); + } + + public static Double interpolate(double oldValue, double newValue, double interpolationValue) { + return (oldValue + (newValue - oldValue) * interpolationValue); + } + + public static void resetColor() { + GlStateManager.color(1, 1, 1, 1); + } + + + public static Vec3 convertTo2D(int scaleFactor, double x, double y, double z) { + GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, MODELVIEW); + GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, PROJECTION); + GL11.glGetInteger(GL11.GL_VIEWPORT, VIEWPORT); + + boolean result = GLU.gluProject( + (float) x, + (float) y, + (float) z, + MODELVIEW, + PROJECTION, + VIEWPORT, + SCREEN_COORDS + ); + + if (result) { + return new Vec3(SCREEN_COORDS.get(0) / scaleFactor, (Display.getHeight() - SCREEN_COORDS.get(1)) / scaleFactor, SCREEN_COORDS.get(2)); + } + + return null; + } + + public static void drawRoundedRectangle(float x, float y, float x2, float y2, float radius, final int color) { + if (x2 <= x) { + return; + } + + float width = x2 - x; + + if (width < 3) { + radius = Math.min(radius, width / 2.0f); + } + + x *= 2.0; + y *= 2.0; + x2 *= 2.0; + y2 *= 2.0; + GL11.glPushAttrib(0); + GL11.glScaled(0.5, 0.5, 0.5); + glEnable(3042); + GL11.glDisable(3553); + glEnable(2848); + GL11.glBegin(9); + glColor(color); + for (int i = 0; i <= 90; i += 3) { + final double n7 = (double) (i * 0.017453292f); + GL11.glVertex2d((double) (x + radius) + Math.sin(n7) * radius * -1.0, (double) (y + radius) + Math.cos(n7) * radius * -1.0); + } + for (int j = 90; j <= 180; j += 3) { + final double n8 = (double) (j * 0.017453292f); + GL11.glVertex2d((double) (x + radius) + Math.sin(n8) * radius * -1.0, (double) (y2 - radius) + Math.cos(n8) * radius * -1.0); + } + if (x2 - x >= 4.5) { + for (int k = 0; k <= 90; k += 1) { + final double n9 = (double) (k * 0.017453292f); + GL11.glVertex2d((double) (x2 - radius) + Math.sin(n9) * radius, (double) (y2 - radius) + Math.cos(n9) * radius); + } + for (int l = 90; l <= 180; l += 1) { + final double n10 = (double) (l * 0.017453292f); + GL11.glVertex2d((double) (x2 - radius) + Math.sin(n10) * radius, (double) (y + radius) + Math.cos(n10) * radius); + } + } + GL11.glEnd(); + glEnable(3553); + GL11.glDisable(3042); + GL11.glDisable(2848); + glEnable(3553); + GL11.glScaled(2.0, 2.0, 2.0); + GL11.glPopAttrib(); + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); + } + + public static void drawRectangleGL(float x, float y, float x2, float y2, final int color) { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glDisable(GL11.GL_TEXTURE_2D); + + glColor(color); + + GL11.glBegin(GL11.GL_QUADS); + GL11.glVertex2f(x, y); + GL11.glVertex2f(x, y2); + GL11.glVertex2f(x2, y2); + GL11.glVertex2f(x2, y); + GL11.glEnd(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_BLEND); + + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); + } + + public static void drawRoundedGradientRect(float x, float y, float x2, float y2, float radius, final int n6, final int n7, final int n8, final int n9) { + if (x2 <= x) { + return; + } + + float width = x2 - x; + + if (width < 3) { + radius = Math.min(radius, width / 2.0f); + } + + glEnable(3042); + GL11.glDisable(3553); + GL11.glBlendFunc(770, 771); + glEnable(2848); + GL11.glShadeModel(7425); + GL11.glPushAttrib(0); + GL11.glScaled(0.5, 0.5, 0.5); + x *= 2.0; + y *= 2.0; + x2 *= 2.0; + y2 *= 2.0; + glEnable(3042); + GL11.glDisable(3553); + glColor(n6); + glEnable(2848); + GL11.glShadeModel(7425); + GL11.glBegin(9); + for (int i = 0; i <= 90; i += 3) { + final double n10 = i * 0.017453292f; + GL11.glVertex2d((double) (x + radius) + Math.sin(n10) * radius * -1.0, (double) (y + radius) + Math.cos(n10) * radius * -1.0); + } + glColor(n7); + for (int j = 90; j <= 180; j += 3) { + final double n11 = j * 0.017453292f; + GL11.glVertex2d((double) (x + radius) + Math.sin(n11) * radius * -1.0, (double) (y2 - radius) + Math.cos(n11) * radius * -1.0); + } + if (x2 - x >= 4.5) { + glColor(n8); + for (int k = 0; k <= 90; k += 3) { + final double n12 = k * 0.017453292f; + GL11.glVertex2d((double) (x2 - radius) + Math.sin(n12) * radius, (double) (y2 - radius) + Math.cos(n12) * radius); + } + glColor(n9); + for (int l = 90; l <= 180; l += 3) { + final double n13 = l * 0.017453292f; + GL11.glVertex2d((double) (x2 - radius) + Math.sin(n13) * radius, (double) (y + radius) + Math.cos(n13) * radius); + } + } + GL11.glEnd(); + glEnable(3553); + GL11.glDisable(3042); + GL11.glDisable(2848); + GL11.glDisable(3042); + glEnable(3553); + GL11.glScaled(2.0, 2.0, 2.0); + GL11.glPopAttrib(); + glEnable(3553); + GL11.glDisable(3042); + GL11.glDisable(2848); + GL11.glShadeModel(7424); + } + + public static int setAlpha(int rgb, double alpha) { + if (alpha < 0 || alpha > 1) { + alpha = 0.5; + } + + int red = (rgb >> 16) & 0xFF; + int green = (rgb >> 8) & 0xFF; + int blue = rgb & 0xFF; + + int alphaInt = (int) (alpha * 255); + + int rgba = (alphaInt << 24) | (red << 16) | (green << 8) | blue; + + return rgba; + } +} diff --git a/src/main/java/keystrokesmod/utility/RotationUtils.java b/src/main/java/keystrokesmod/utility/RotationUtils.java new file mode 100644 index 0000000..39abb87 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/RotationUtils.java @@ -0,0 +1,485 @@ +package keystrokesmod.utility; + +import com.google.common.base.Predicates; +import keystrokesmod.event.PreMotionEvent; +import keystrokesmod.module.impl.client.Settings; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.*; + +import java.util.List; + +public class RotationUtils { + public static final Minecraft mc = Minecraft.getMinecraft(); + public static float renderPitch; + public static float prevRenderPitch; + public static float renderYaw; + public static float prevRenderYaw; + public static float[] serverRotations = new float[] { 0, 0 } ; + public static final float PI = (float) Math.PI; + public static final float TO_DEGREES = 180.0F / PI; + + public static void setRenderYaw(float yaw) { + mc.thePlayer.rotationYawHead = yaw; + if (Settings.rotateBody.isToggled() && Settings.fullBody.isToggled()) { + mc.thePlayer.prevRenderYawOffset = prevRenderYaw; + mc.thePlayer.renderYawOffset = yaw; + } + } + + public static float[] getRotations(BlockPos blockPos, final float n, final float n2) { + final float[] array = getRotations(blockPos); + return fixRotation(array[0], array[1], n, n2); + } + + public static float[] getRotations(BlockPos blockPos) { + double x = blockPos.getX() + 0.45 - mc.thePlayer.posX; + double y = blockPos.getY() + 0.45 - (mc.thePlayer.posY + mc.thePlayer.getEyeHeight()); + double z = blockPos.getZ() + 0.45 - mc.thePlayer.posZ; + + float angleToBlock = (float) (Math.atan2(z, x) * (180 / Math.PI)) - 90.0f; + float deltaYaw = MathHelper.wrapAngleTo180_float(angleToBlock - mc.thePlayer.rotationYaw); + float yaw = mc.thePlayer.rotationYaw + deltaYaw; + + double distance = MathHelper.sqrt_double(x * x + z * z); + float angleToBlockPitch = (float) (-(Math.atan2(y, distance) * (180 / Math.PI))); + float deltaPitch = MathHelper.wrapAngleTo180_float(angleToBlockPitch - mc.thePlayer.rotationPitch); + float pitch = mc.thePlayer.rotationPitch + deltaPitch; + + pitch = clampTo90(pitch); + + return new float[] { yaw, pitch }; + } + + public static float[] getRotations(Vec3 vec3) { + double x = vec3.xCoord + 1.0 - mc.thePlayer.posX; + double y = vec3.yCoord + 1.0 - (mc.thePlayer.posY + mc.thePlayer.getEyeHeight()); + double z = vec3.zCoord + 1.0 - mc.thePlayer.posZ; + + float angleToBlock = (float) (Math.atan2(z, x) * (180 / Math.PI)) - 90.0f; + float deltaYaw = MathHelper.wrapAngleTo180_float(angleToBlock - mc.thePlayer.rotationYaw); + float yaw = mc.thePlayer.rotationYaw + deltaYaw; + + double distance = MathHelper.sqrt_double(x * x + z * z); + float angleToBlockPitch = (float) (-(Math.atan2(y, distance) * (180 / Math.PI))); + float deltaPitch = MathHelper.wrapAngleTo180_float(angleToBlockPitch - mc.thePlayer.rotationPitch); + float pitch = mc.thePlayer.rotationPitch + deltaPitch; + + pitch = clampTo90(pitch); + + return new float[] { yaw, pitch }; + } + + public static float[] getRotations(BlockPos blockPos, EnumFacing enumFacing) { + double x = blockPos.getX() + 0.5D; + double y = blockPos.getY() + 0.5D; + double z = blockPos.getZ() + 0.5D; + + x += (double) enumFacing.getDirectionVec().getX() * 0.5D; + y += (double) enumFacing.getDirectionVec().getY() * 0.5D; + z += (double) enumFacing.getDirectionVec().getZ() * 0.5D; + Vec3 vec = new Vec3(x, y, z); + + Vec3 playerVec = new Vec3(mc.thePlayer.posX, mc.thePlayer.posY + mc.thePlayer.height, mc.thePlayer.posZ); + Vec3 diff = vec.subtract(playerVec); + double distance = Math.hypot(diff.xCoord, diff.zCoord); + float yaw = (float) (MathHelper.atan2(diff.zCoord, diff.xCoord) * TO_DEGREES) - 90.0F; + float pitch = (float) (-(MathHelper.atan2(diff.yCoord, distance) * TO_DEGREES)); + return new float[] { applyVanilla(yaw), clampTo90(pitch) }; + } + + public static float interpolateValue(float tickDelta, float old, float newFloat) { + return old + (newFloat - old) * tickDelta; + } + + public static float[] getRotations(Entity entity, final float yaw, final float pitch) { + final float[] array = getRotations(entity); + if (array == null) { + return null; + } + return fixRotation(array[0], array[1], yaw, pitch); + } + + public static double distanceFromYaw(final Entity entity, final boolean b) { + return Math.abs(MathHelper.wrapAngleTo180_double(i(entity.posX, entity.posZ) - ((b && PreMotionEvent.setRenderYaw()) ? RotationUtils.renderYaw : mc.thePlayer.rotationYaw))); + } + + public static float i(final double n, final double n2) { + return (float)(Math.atan2(n - mc.thePlayer.posX, n2 - mc.thePlayer.posZ) * 57.295780181884766 * -1.0); + } + + public static boolean isPossibleToHit(Entity target, double reach, float[] rotations) { + final Vec3 eyePosition = mc.thePlayer.getPositionEyes(1.0f); + + final float yaw = rotations[0]; + final float pitch = rotations[1]; + + final float radianYaw = -yaw * 0.017453292f - (float)Math.PI; + final float radianPitch = -pitch * 0.017453292f; + + final float cosYaw = MathHelper.cos(radianYaw); + final float sinYaw = MathHelper.sin(radianYaw); + final float cosPitch = -MathHelper.cos(radianPitch); + final float sinPitch = MathHelper.sin(radianPitch); + + final Vec3 lookVector = new Vec3( + sinYaw * cosPitch, // x + sinPitch, // y + cosYaw * cosPitch // z + ); + + final double lookVecX = lookVector.xCoord * reach; + final double lookVecY = lookVector.yCoord * reach; + final double lookVecZ = lookVector.zCoord * reach; + + final Vec3 endPosition = eyePosition.addVector(lookVecX, lookVecY, lookVecZ); + + final Entity renderViewEntity = mc.getRenderViewEntity(); + final AxisAlignedBB expandedBox = renderViewEntity + .getEntityBoundingBox() + .addCoord(lookVecX, lookVecY, lookVecZ) + .expand(1.0, 1.0, 1.0); + + final List entitiesInPath = mc.theWorld.getEntitiesWithinAABBExcludingEntity(renderViewEntity, expandedBox); + for (Entity entity : entitiesInPath) { + if (entity == target && entity.canBeCollidedWith()) { + final float borderSize = entity.getCollisionBorderSize(); + final AxisAlignedBB entityBox = entity.getEntityBoundingBox() + .expand(borderSize, borderSize, borderSize); + final MovingObjectPosition intercept = entityBox.calculateIntercept(eyePosition, endPosition); + return intercept != null; + } + } + + return false; + } + + public static boolean inRange(final BlockPos blockPos, final double n) { + final float[] array = RotationUtils.getRotations(blockPos); + final Vec3 getPositionEyes = mc.thePlayer.getPositionEyes(1.0f); + final float n2 = -array[0] * 0.017453292f; + final float n3 = -array[1] * 0.017453292f; + final float cos = MathHelper.cos(n2 - 3.1415927f); + final float sin = MathHelper.sin(n2 - 3.1415927f); + final float n4 = -MathHelper.cos(n3); + final Vec3 vec3 = new Vec3(sin * n4, MathHelper.sin(n3), cos * n4); + Block block = BlockUtils.getBlock(blockPos); + IBlockState blockState = BlockUtils.getBlockState(blockPos); + if (block != null && blockState != null) { + AxisAlignedBB boundingBox = block.getCollisionBoundingBox(mc.theWorld, blockPos, blockState); + if (boundingBox != null) { + Vec3 targetVec = getPositionEyes.addVector(vec3.xCoord * n, vec3.yCoord * n, vec3.zCoord * n); + MovingObjectPosition intercept = boundingBox.calculateIntercept(getPositionEyes, targetVec); + if (intercept != null) { + return true; + } + } + } + return false; + } + + public static float[] getRotations(final Entity entity) { + if (entity == null) { + return null; + } + final double n = entity.posX - mc.thePlayer.posX; + final double n2 = entity.posZ - mc.thePlayer.posZ; + double n3; + if (entity instanceof EntityLivingBase) { + final EntityLivingBase entityLivingBase = (EntityLivingBase) entity; + n3 = entityLivingBase.posY + entityLivingBase.getEyeHeight() * 0.9 - (mc.thePlayer.posY + mc.thePlayer.getEyeHeight()); + } else { + n3 = (entity.getEntityBoundingBox().minY + entity.getEntityBoundingBox().maxY) / 2.0 - (mc.thePlayer.posY + mc.thePlayer.getEyeHeight()); + } + return new float[] { mc.thePlayer.rotationYaw + MathHelper.wrapAngleTo180_float((float) (Math.atan2(n2, n) * 57.295780181884766) - 90.0f - mc.thePlayer.rotationYaw), clampTo90(mc.thePlayer.rotationPitch + MathHelper.wrapAngleTo180_float((float) (-(Math.atan2(n3, MathHelper.sqrt_double(n * n + n2 * n2)) * 57.295780181884766)) - mc.thePlayer.rotationPitch) + 3.0f)}; + } + + public static float[] getRotationsPredicated(final Entity entity, final int ticks) { + if (entity == null) { + return null; + } + if (ticks == 0) { + return getRotations(entity); + } + double posX = entity.posX; + final double posY = entity.posY; + double posZ = entity.posZ; + final double n2 = posX - entity.lastTickPosX; + final double n3 = posZ - entity.lastTickPosZ; + for (int i = 0; i < ticks; ++i) { + posX += n2; + posZ += n3; + } + final double n4 = posX - mc.thePlayer.posX; + double n5; + if (entity instanceof EntityLivingBase) { + n5 = posY + entity.getEyeHeight() * 0.9 - (mc.thePlayer.posY + mc.thePlayer.getEyeHeight()); + } + else { + n5 = (entity.getEntityBoundingBox().minY + entity.getEntityBoundingBox().maxY) / 2.0 - (mc.thePlayer.posY + mc.thePlayer.getEyeHeight()); + } + final double n6 = posZ - mc.thePlayer.posZ; + return new float[] { applyVanilla(mc.thePlayer.rotationYaw + MathHelper.wrapAngleTo180_float((float)(Math.atan2(n6, n4) * 57.295780181884766) - 90.0f - mc.thePlayer.rotationYaw)), clampTo90(mc.thePlayer.rotationPitch + MathHelper.wrapAngleTo180_float((float)(-(Math.atan2(n5, MathHelper.sqrt_double(n4 * n4 + n6 * n6)) * 57.295780181884766)) - mc.thePlayer.rotationPitch) + 3.0f) }; + } + + public static float clampTo90(final float n) { + return MathHelper.clamp_float(n, -90.0f, 90.0f); + } + + public static float[] fixRotation(float yaw, float n2, final float n3, final float n4) { + float n5 = yaw - n3; + final float abs = Math.abs(n5); + final float n7 = n2 - n4; + final float n8 = mc.gameSettings.mouseSensitivity * 0.6f + 0.2f; + final double n9 = n8 * n8 * n8 * 1.2; + final float n10 = (float) (Math.round((double) n5 / n9) * n9); + final float n11 = (float) (Math.round((double) n7 / n9) * n9); + yaw = n3 + n10; + n2 = n4 + n11; + if (abs >= 1.0f) { + final int n12 = (int) Settings.randomYawFactor.getInput(); + if (n12 != 0) { + final int n13 = n12 * 100 + Utils.randomizeInt(-30, 30); + yaw += Utils.randomizeInt(-n13, n13) / 100.0; + } + } else if (abs <= 0.04) { + yaw += ((abs > 0.0f) ? 0.01 : -0.01); + } + return new float[] { yaw, clampTo90(n2) }; + } + + public static float angle(final double n, final double n2) { + return (float) (Math.atan2(n - mc.thePlayer.posX, n2 - mc.thePlayer.posZ) * 57.295780181884766 * -1.0); + } + + public static MovingObjectPosition rayCast(double distance, float yaw, float pitch, boolean collisionCheck) { + final Vec3 getPositionEyes = mc.thePlayer.getPositionEyes(1.0f); + final float n4 = -yaw * 0.017453292f; + final float n5 = -pitch * 0.017453292f; + final float cos = MathHelper.cos(n4 - 3.1415927f); + final float sin = MathHelper.sin(n4 - 3.1415927f); + final float n6 = -MathHelper.cos(n5); + final Vec3 vec3 = new Vec3(sin * n6, MathHelper.sin(n5), cos * n6); + return mc.theWorld.rayTraceBlocks(getPositionEyes, getPositionEyes.addVector(vec3.xCoord * distance, vec3.yCoord * distance, vec3.zCoord * distance), true, collisionCheck, true); + } + + public static MovingObjectPosition rayTrace(double range, float partialTicks, float[] rotations, EntityLivingBase ignoreCollision) { + if (ignoreCollision != null) { + MovingObjectPosition target = rayTraceIgnore(range, partialTicks, rotations, ignoreCollision); + if (target != null) { + return target; + } + } + Entity targetEntity = null; + MovingObjectPosition hitObject; + double d0 = range; + if (rotations == null) { + rotations = new float[] { mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch }; + } + hitObject = rayTraceCustom(d0, rotations[0], rotations[1]); + double distanceTo = d0; + Vec3 vec3 = mc.thePlayer.getPositionEyes(partialTicks); + if (mc.playerController.extendedReach()) { + d0 = 6.0; + distanceTo = 6.0; + } + + if (hitObject != null) { + distanceTo = hitObject.hitVec.distanceTo(vec3); + } + + Vec3 vec31 = RotationUtils.getVectorForRotation(rotations[1], rotations[0]); + Vec3 vec32 = vec3.addVector(vec31.xCoord * d0, vec31.yCoord * d0, vec31.zCoord * d0); + Vec3 vec33 = null; + float f = 1.0F; + List list = mc.theWorld.getEntitiesInAABBexcluding(mc.thePlayer, mc.thePlayer.getEntityBoundingBox().addCoord(vec31.xCoord * d0, vec31.yCoord * d0, vec31.zCoord * d0).expand(f, f, f), Predicates.and(EntitySelectors.NOT_SPECTATING, Entity::canBeCollidedWith)); + double d2 = distanceTo; + + for(int j = 0; j < list.size(); ++j) { + Entity entity1 = list.get(j); + float f1 = entity1.getCollisionBorderSize(); + AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expand(f1, f1, f1); + MovingObjectPosition movingobjectposition = axisalignedbb.calculateIntercept(vec3, vec32); + if (axisalignedbb.isVecInside(vec3)) { + if (d2 >= 0.0) { + targetEntity = entity1; + vec33 = movingobjectposition == null ? vec3 : movingobjectposition.hitVec; + d2 = 0.0; + } + } + else if (movingobjectposition != null) { + double d3 = vec3.distanceTo(movingobjectposition.hitVec); + if (d3 < d2 || d2 == 0.0) { + if (entity1 == mc.thePlayer.ridingEntity && !mc.thePlayer.canRiderInteract()) { + if (d2 == 0.0) { + targetEntity = entity1; + vec33 = movingobjectposition.hitVec; + } + } + else { + targetEntity = entity1; + vec33 = movingobjectposition.hitVec; + d2 = d3; + } + } + } + } + + if (targetEntity != null && d2 < distanceTo) { + return new MovingObjectPosition(targetEntity, vec33); + } + return null; + } + + public static MovingObjectPosition rayTraceCustom(double blockReachDistance, float yaw, float pitch) { + final Vec3 vec3 = mc.thePlayer.getPositionEyes(1.0F); + final Vec3 vec31 = getVectorForRotation(pitch, yaw); + final Vec3 vec32 = vec3.addVector(vec31.xCoord * blockReachDistance, vec31.yCoord * blockReachDistance, vec31.zCoord * blockReachDistance); + return mc.theWorld.rayTraceBlocks(vec3, vec32, false, false, true); + } + + public static Vec3 getVectorForRotation(float pitch, float yaw) { + float f = MathHelper.cos(-yaw * ((float)Math.PI / 180F) - (float)Math.PI); + float f1 = MathHelper.sin(-yaw * ((float)Math.PI / 180F) - (float)Math.PI); + float f2 = -MathHelper.cos(-pitch * ((float)Math.PI / 180F)); + float f3 = MathHelper.sin(-pitch * ((float)Math.PI / 180F)); + return new Vec3(f1 * f2, f3, f * f2); + } + + public static float applyVanilla(float yaw, boolean stop) { + if (stop) { + return yaw; + } + int scaleFactor = (int) Math.floor(serverRotations[0] / 360); + float unwrappedYaw = yaw + 360 * scaleFactor; + if (unwrappedYaw < serverRotations[0] - 180) { + unwrappedYaw += 360; + } + else if (unwrappedYaw > serverRotations[0] + 180) { + unwrappedYaw -= 360; + } + + float deltaYaw = unwrappedYaw - serverRotations[0]; + return serverRotations[0] + deltaYaw; + } + + public static MovingObjectPosition rayTrace(double range, float p_getMouseOver_1_, float[] rotations) { + Entity targetEntity = null; + MovingObjectPosition hitObject; + double d0 = range; + if (rotations == null) { + rotations = new float[] { mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch }; + } + hitObject = rayTraceCustom(d0, rotations[0], rotations[1]); + double d1 = d0; + Vec3 vec3 = mc.thePlayer.getPositionEyes(p_getMouseOver_1_); + if (mc.playerController.extendedReach()) { + d0 = 6.0; + d1 = 6.0; + } + + if (hitObject != null) { + d1 = hitObject.hitVec.distanceTo(vec3); + } + + Vec3 vec31 = RotationUtils.getVectorForRotation(rotations[1], rotations[0]); + Vec3 vec32 = vec3.addVector(vec31.xCoord * d0, vec31.yCoord * d0, vec31.zCoord * d0); + Vec3 vec33 = null; + float f = 1.0F; + List list = mc.theWorld.getEntitiesInAABBexcluding(mc.thePlayer, mc.thePlayer.getEntityBoundingBox().addCoord(vec31.xCoord * d0, vec31.yCoord * d0, vec31.zCoord * d0).expand(f, f, f), Predicates.and(EntitySelectors.NOT_SPECTATING, Entity::canBeCollidedWith)); + double d2 = d1; + + for(int j = 0; j < list.size(); ++j) { + Entity entity1 = list.get(j); + float f1 = entity1.getCollisionBorderSize(); + AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expand(f1, f1, f1); + MovingObjectPosition movingobjectposition = axisalignedbb.calculateIntercept(vec3, vec32); + if (axisalignedbb.isVecInside(vec3)) { + if (d2 >= 0.0) { + targetEntity = entity1; + vec33 = movingobjectposition == null ? vec3 : movingobjectposition.hitVec; + d2 = 0.0; + } + } + else if (movingobjectposition != null) { + double d3 = vec3.distanceTo(movingobjectposition.hitVec); + if (d3 < d2 || d2 == 0.0) { + if (entity1 == mc.thePlayer.ridingEntity && !mc.thePlayer.canRiderInteract()) { + if (d2 == 0.0) { + targetEntity = entity1; + vec33 = movingobjectposition.hitVec; + } + } + else { + targetEntity = entity1; + vec33 = movingobjectposition.hitVec; + d2 = d3; + } + } + } + } + if (targetEntity != null && d2 < d1) { + return new MovingObjectPosition(targetEntity, vec33); + } + return null; + } + + public static MovingObjectPosition rayTraceIgnore(double range, float partialTicks, float[] rotations, EntityLivingBase ignoreCollision) { + MovingObjectPosition blockHit = rayTraceCustom(range, + rotations[0], + rotations[1]); + + Vec3 start = mc.thePlayer.getPositionEyes(partialTicks); + double blockDistance = range; + if (blockHit != null) { + blockDistance = blockHit.hitVec.distanceTo(start); + } + + if (ignoreCollision != null) { + if (rotations == null) { + rotations = new float[]{ + mc.thePlayer.rotationYaw, + mc.thePlayer.rotationPitch + }; + } + Vec3 lookVec = RotationUtils.getVectorForRotation( + rotations[1], // pitch + rotations[0] // yaw + ); + Vec3 end = start.addVector( + lookVec.xCoord * range, + lookVec.yCoord * range, + lookVec.zCoord * range + ); + + float f1 = ignoreCollision.getCollisionBorderSize(); + AxisAlignedBB aabb = ignoreCollision.getEntityBoundingBox() + .expand(f1, f1, f1); + MovingObjectPosition ignoreMOP = aabb.calculateIntercept(start, end); + + if (aabb.isVecInside(start)) { + return new MovingObjectPosition(ignoreCollision, start); + } + if (ignoreMOP != null) { + double ignoreDist = start.distanceTo(ignoreMOP.hitVec); + if (ignoreDist < blockDistance) { + return new MovingObjectPosition( + ignoreCollision, + ignoreMOP.hitVec + ); + } + } + } + if (blockHit != null) { + return blockHit; + } + return null; + } + + public static float applyVanilla(float yaw) { + return applyVanilla(yaw, false); + } +} diff --git a/src/main/java/keystrokesmod/utility/ScaffoldBlockCount.java b/src/main/java/keystrokesmod/utility/ScaffoldBlockCount.java new file mode 100644 index 0000000..618f144 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/ScaffoldBlockCount.java @@ -0,0 +1,79 @@ +package keystrokesmod.utility; + +import keystrokesmod.module.ModuleManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import org.lwjgl.opengl.GL11; + +public class ScaffoldBlockCount { + private final Minecraft mc; + private Timer fadeTimer; + private Timer fadeInTimer; + private float previousAlpha; + + public ScaffoldBlockCount(Minecraft mc) { + this.mc = mc; + this.fadeTimer = null; + (this.fadeInTimer = new Timer(150)).start(); + } + + @SubscribeEvent + public void onRenderTick(TickEvent.RenderTickEvent ev) { + if (previousAlpha <= 10 && fadeInTimer == null) { + onDisable(); + return; + } + if (!Utils.nullCheck() || !ModuleManager.scaffold.showBlockCount.isToggled()) { + return; + } + if (ev.phase == TickEvent.Phase.END) { + if (mc.currentScreen != null) { + return; + } + final ScaledResolution scaledResolution = new ScaledResolution(mc); + int blocks = ModuleManager.scaffold.totalBlocks(); + String color = "§"; + if (blocks <= 5) { + color += "c"; + } + else if (blocks <= 15) { + color += "6"; + } + else if (blocks <= 25) { + color += "e"; + } + else { + color = ""; + } + float alpha = fadeTimer == null ? 255 : (255 - fadeTimer.getValueInt(0, 255, 1)); + if (fadeInTimer != null) { + alpha = fadeInTimer.getValueFloat(10, 255, 1); + if (alpha == 255) { + fadeInTimer = null; + } + } + previousAlpha = alpha; + int colorAlpha = Utils.mergeAlpha(-1, (int) previousAlpha); + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + mc.fontRendererObj.drawStringWithShadow(color + blocks + " §rblock" + (blocks == 1 ? "" : "s"), scaledResolution.getScaledWidth()/2 + 8, scaledResolution.getScaledHeight()/2 + 4, colorAlpha); + GL11.glDisable(GL11.GL_BLEND); + GL11.glPopMatrix(); + } + } + + public void beginFade() { + (this.fadeTimer = new Timer(150)).start(); + this.fadeInTimer = null; + } + + public void onDisable() { + FMLCommonHandler.instance().bus().unregister(this); + fadeInTimer = null; + fadeTimer = null; + } +} diff --git a/src/main/java/keystrokesmod/utility/Theme.java b/src/main/java/keystrokesmod/utility/Theme.java new file mode 100644 index 0000000..094ef47 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/Theme.java @@ -0,0 +1,63 @@ +package keystrokesmod.utility; + +import keystrokesmod.module.impl.client.Settings; + +import java.awt.*; + +public enum Theme { + Rainbow(null, null), // 0 + Cherry(new Color(255, 200, 200), new Color(243, 58, 106)), // 1 + Cotton_candy(new Color(99, 249, 255), new Color(255, 104, 204)), // 2 + Flare(new Color(231, 39, 24), new Color(245, 173, 49)), // 3 + Flower(new Color(215, 166, 231), new Color(211, 90, 232)), // 4 + Gold(new Color(255, 215, 0), new Color(240, 159, 0)), // from croat, 5 + Grayscale(new Color(240, 240, 240), new Color(110, 110, 110)), // 6 + Royal(new Color(125, 204, 241), new Color(30, 71, 170)), // 7 + Sky(new Color(160, 230, 225), new Color(15, 190, 220)), // 8 + Vine(new Color(17, 192, 45), new Color(201, 234, 198)); // 9 + + private final Color firstGradient; + private final Color secondGradient; + public static Color[] descriptor = new Color[]{new Color(95, 235, 255), new Color(68, 102, 250)}; + public static Color[] hiddenBind = new Color[]{new Color(245, 33, 33), new Color(229, 21, 98)}; + + Theme(Color firstGradient, Color secondGradient) { + this.firstGradient = firstGradient; + this.secondGradient = secondGradient; + } + + public static int getGradient(int index, double delay) { + if (index > 0) { + return convert(values()[index].firstGradient, values()[index].secondGradient, (Math.sin(System.currentTimeMillis() / 1.0E8 * Settings.timeMultiplier.getInput() * 400000.0 + delay * Settings.offset.getInput()) + 1.0) * 0.5).getRGB(); + } + else if (index == 0) { + return Utils.getChroma(2, (long) delay); + } + return -1; + } + + public static int getGradient(Color firstGradient, Color secondGradient, double delay) { + return convert(firstGradient, secondGradient, (Math.sin(System.currentTimeMillis() / 1.0E8 * 0.5 * 400000.0 + delay * 0.550000011920929) + 1.0) * 0.5).getRGB(); + } + + public static Color convert(Color color, Color color2, double n) { + double n2 = 1.0 - n; + return new Color((int) (color.getRed() * n + color2.getRed() * n2), (int) (color.getGreen() * n + color2.getGreen() * n2), (int) (color.getBlue() * n + color2.getBlue() * n2)); + } + + public static int[] getGradients(int index) { + Theme[] values = values(); + if (values != null && index >= 0 && index < values.length && values[index] != null) { + Color firstGradient = values[index].firstGradient; + Color secondGradient = values[index].secondGradient; + if (firstGradient != null && secondGradient != null) { + return new int[]{firstGradient.getRGB(), secondGradient.getRGB()}; + } else { + return new int[]{Utils.getChroma(2, (long) 0), Utils.getChroma(2, (long) 0)}; + } + } + return new int[]{0, 0}; + } + + public static String[] themes = new String[]{"Rainbow", "Cherry", "Cotton candy", "Flare", "Flower", "Gold", "Grayscale", "Royal", "Sky", "Vine"}; +} diff --git a/src/main/java/keystrokesmod/utility/Timer.java b/src/main/java/keystrokesmod/utility/Timer.java new file mode 100644 index 0000000..7061e14 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/Timer.java @@ -0,0 +1,80 @@ +package keystrokesmod.utility; + +public class Timer { + public float updates; + public long last; + private float cached; + + public Timer(float updates) { + this.updates = updates; + } + + public float getValueFloat(float begin, float end, int type) { + if (this.cached == end) { + return this.cached; + } + else { + float t = (float) (System.currentTimeMillis() - this.last) / this.updates; + switch (type) { + case 1: + t = t < 0.5F ? 4.0F * t * t * t : (t - 1.0F) * (2.0F * t - 2.0F) * (2.0F * t - 2.0F) + 1.0F; + break; + case 2: + t = (float) (1.0D - Math.pow((double) (1.0F - t), 5.0D)); + break; + case 3: + t = this.bounce(t); + break; + case 4: + t = quadInOut(t); + break; + } + + float value = begin + t * (end - begin); + if ((end > begin && value > end) || (end < begin && value < end)) { + value = end; + } + + if (value == end) { + this.cached = value; + } + + return value; + } + } + + public int getValueInt(int begin, int end, int type) { + return Math.round(this.getValueFloat((float) begin, (float) end, type)); + } + + public void start() { + this.cached = 0.0F; + this.last = System.currentTimeMillis(); + } + + private float bounce(float t) { + float i; + double i2 = 7.5625D; + double i3 = 2.75D; + if ((double) t < 1.0D / i3) { + i = (float) (i2 * (double) t * (double) t); + } else if ((double) t < 2.0D / i3) { + i = (float) (i2 * (double) (t = (float) ((double) t - 1.5D / i3)) * (double) t + 0.75D); + } else if ((double) t < 2.5D / i3) { + i = (float) (i2 * (double) (t = (float) ((double) t - 2.25D / i3)) * (double) t + 0.9375D); + } else { + i = (float) (i2 * (double) (t = (float) ((double) t - 2.625D / i3)) * (double) t + 0.984375D); + } + + return i; + } + + float quadInOut(float t) { + if (t < 0.5f) { + return 2 * t * t; + } + else { + return -1 + (4 - 2 * t) * t; + } + } +} diff --git a/src/main/java/keystrokesmod/utility/Utils.java b/src/main/java/keystrokesmod/utility/Utils.java new file mode 100644 index 0000000..841527f --- /dev/null +++ b/src/main/java/keystrokesmod/utility/Utils.java @@ -0,0 +1,1398 @@ +package keystrokesmod.utility; + +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.gson.JsonObject; +import keystrokesmod.Raven; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.client.Settings; +import keystrokesmod.module.impl.combat.AutoClicker; +import keystrokesmod.module.impl.minigames.DuelsStats; +import keystrokesmod.module.setting.impl.SliderSetting; +import net.minecraft.block.*; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.client.renderer.ActiveRenderInfo; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.ContainerPlayer; +import net.minecraft.item.*; +import net.minecraft.network.play.client.C03PacketPlayer.C05PacketPlayerLook; +import net.minecraft.network.play.client.C0APacketAnimation; +import net.minecraft.potion.Potion; +import net.minecraft.scoreboard.*; +import net.minecraft.util.*; +import net.minecraftforge.fml.common.ObfuscationReflectionHelper; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; + +import java.awt.*; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.StringSelection; +import java.io.*; +import java.util.List; +import java.util.*; +import java.util.stream.IntStream; + +public class Utils { + private static final Random rand = new Random(); + public static final Minecraft mc = Minecraft.getMinecraft(); + public static HashSet friends = new HashSet<>(); + public static HashSet enemies = new HashSet<>(); + public static final Logger log = LogManager.getLogger(); + + public static boolean addEnemy(String name) { + if (enemies.add(name.toLowerCase())) { + Utils.sendMessage("&7Added &cenemy&7: &b" + name); + return true; + } + return false; + } + + public static boolean removeEnemy(String name) { + if (enemies.remove(name.toLowerCase())) { + Utils.sendMessage("&7Removed &cenemy&7: &b" + name); + return true; + } + return false; + } + + public static float getCameraYaw() { + return (float) Math.toDegrees(Math.atan2(ActiveRenderInfo.getRotationZ(), ActiveRenderInfo.getRotationX())); + } + + public static float getCameraPitch() { + return (float) Math.toDegrees(Math.acos(ActiveRenderInfo.getRotationXZ())); + } + + + public static Vec3 getCameraPos(double renderPartialTicks) { + if (mc.gameSettings.thirdPersonView == 0) { + Vec3 firstPersonPos = new Vec3(mc.thePlayer.posX, mc.thePlayer.posY + mc.thePlayer.getEyeHeight(), mc.thePlayer.posZ); + return firstPersonPos; + } + float cameraDistance = 4.0F; + if (ModuleManager.extendCamera != null && ModuleManager.extendCamera.isEnabled()) { + cameraDistance = (float) ModuleManager.extendCamera.distance.getInput(); + } + + Entity renderEntity = mc.getRenderViewEntity(); + float entityEyeHeight = renderEntity.getEyeHeight(); + + double interpolatedX = renderEntity.prevPosX + (renderEntity.posX - renderEntity.prevPosX) * renderPartialTicks; + double interpolatedY = renderEntity.prevPosY + (renderEntity.posY - renderEntity.prevPosY) * renderPartialTicks + entityEyeHeight; + double interpolatedZ = renderEntity.prevPosZ + (renderEntity.posZ - renderEntity.prevPosZ) * renderPartialTicks; + + double adjustedDistance = cameraDistance; + + float cameraYaw = Utils.getCameraYaw(); + float cameraPitch = Utils.getCameraPitch(); + + double offsetX = -MathHelper.sin(cameraYaw / 180.0F * (float) Math.PI) * MathHelper.cos(cameraPitch / 180.0F * (float) Math.PI) * adjustedDistance; + double offsetZ = MathHelper.cos(cameraYaw / 180.0F * (float) Math.PI) * MathHelper.cos(cameraPitch / 180.0F * (float) Math.PI) * adjustedDistance; + double offsetY = -MathHelper.sin(cameraPitch / 180.0F * (float) Math.PI) * adjustedDistance; + + if (ModuleManager.noCameraClip == null || !ModuleManager.noCameraClip.isEnabled()) { + for (int i = 0; i < 8; i++) { + float cornerOffsetX = (float) ((i & 1) * 2 - 1) * 0.1F; + float cornerOffsetY = (float) ((i >> 1 & 1) * 2 - 1) * 0.1F; + float cornerOffsetZ = (float) ((i >> 2 & 1) * 2 - 1) * 0.1F; + + MovingObjectPosition rayTraceResult = mc.theWorld.rayTraceBlocks(new Vec3(interpolatedX + cornerOffsetX, interpolatedY + cornerOffsetY, interpolatedZ + cornerOffsetZ), new Vec3((interpolatedX - offsetX + cornerOffsetX + cornerOffsetZ), (interpolatedY - offsetY + cornerOffsetY), (interpolatedZ - offsetZ + cornerOffsetZ))); + + if (rayTraceResult != null) { + double blockHitDistance = rayTraceResult.hitVec.distanceTo(new Vec3(interpolatedX, interpolatedY, interpolatedZ)); + if (blockHitDistance < adjustedDistance) { + adjustedDistance = blockHitDistance; + } + } + } + } + + double finalCameraX = interpolatedX - offsetX * (adjustedDistance / cameraDistance); + double finalCameraY = interpolatedY - offsetY * (adjustedDistance / cameraDistance); + double finalCameraZ = interpolatedZ - offsetZ * (adjustedDistance / cameraDistance); + + return new Vec3(finalCameraX, finalCameraY, finalCameraZ); + } + + public static String getServerName() { + return DuelsStats.nick.isEmpty() ? mc.thePlayer.getName() : DuelsStats.nick; + } + + public static boolean overVoid(double posX, double posY, double posZ) { + for (int i = (int) posY; i > -1; i--) { + if (!(mc.theWorld.getBlockState(new BlockPos(posX, i, posZ)).getBlock() instanceof BlockAir)) { + return false; + } + } + return true; + } + + public static boolean canPlayerBeSeen(EntityLivingBase player) { + double x = player.posX; + double y = player.posY; + double z = player.posZ; + Vec3 vecPlayer = mc.thePlayer.getPositionEyes(1.0f); + double shoulderHeight = player.getEyeHeight() - 0.2; + if (canSeeVec(vecPlayer, new Vec3(x + 0.3, shoulderHeight, z))) { + return true; + } + if (canSeeVec(vecPlayer, new Vec3(x - 0.3, shoulderHeight, z))) { + return true; + } + if (canSeeVec(vecPlayer, new Vec3(x, shoulderHeight, z + 0.3))) { + return true; + } + if (canSeeVec(vecPlayer, new Vec3(x, shoulderHeight, z - 0.3))) { + return true; + } + for (double d = player.getEyeHeight() + 0.2; d > 0.0; d -= 0.2) { + Vec3 vecPoint = new Vec3(x, y + d, z); + if (canSeeVec(vecPlayer, vecPoint)) { + return true; + } + } + return false; + } + + public static boolean canSeeVec(Vec3 vecPlayer, Vec3 vecTarget) { + MovingObjectPosition mop = mc.theWorld.rayTraceBlocks(vecPlayer, vecTarget, false, false, false); + return mop == null || mop.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK; + } + + public static List getTablist(boolean removeSelf) { + final ArrayList list = new ArrayList<>(mc.getNetHandler().getPlayerInfoMap()); + removeDuplicates(list); + if (removeSelf) { + list.remove(mc.getNetHandler().getPlayerInfo(mc.thePlayer.getUniqueID())); + } + return list; + } + + public static void removeDuplicates(final ArrayList list) { + final HashSet set = new HashSet(list); + list.clear(); + list.addAll(set); + } + + public static boolean removeFriend(String name) { + if (friends.remove(name.toLowerCase())) { + Utils.sendMessage("&7Removed &afriend&7: &b" + name); + return true; + } + return false; + } + + public static boolean onCursor(Entity entity) { + MovingObjectPosition movingObjectPosition = mc.objectMouseOver; + if (entity == null || movingObjectPosition == null || movingObjectPosition.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY || movingObjectPosition.entityHit == null ) { + return false; + } + return movingObjectPosition.entityHit == entity; + } + + public static boolean addFriend(String name) { + if (friends.add(name.toLowerCase())) { + Utils.sendMessage("&7Added &afriend&7: &b" + name); + if (enemies.contains(name.toLowerCase())) { + enemies.remove(name.toLowerCase()); + } + return true; + } + return false; + } + + public static boolean isWholeNumber(double num) { + return num == Math.floor(num); + } + + public static int randomizeInt(int min, int max) { + return rand.nextInt(max - min + 1) + min; + } + + public static double randomizeDouble(double min, double max) { + return min + (max - min) * rand.nextDouble(); + } + + public static boolean inFov(float fov, BlockPos blockPos) { + return inFov(fov, blockPos.getX(), blockPos.getZ()); + } + + public static boolean inFov(float fov, Entity entity) { + return inFov(fov, entity.posX, entity.posZ); + } + + public static boolean inFov(float fov, final double n2, final double n3) { + fov *= 0.5; + final double wrapAngleTo180_double = MathHelper.wrapAngleTo180_double((mc.thePlayer.rotationYaw - RotationUtils.angle(n2, n3)) % 360.0f); + if (wrapAngleTo180_double > 0.0) { + if (wrapAngleTo180_double < fov) { + return true; + } + } else if (wrapAngleTo180_double > -fov) { + return true; + } + return false; + } + + public static void sendMessage(String txt) { + if (nullCheck()) { + String m = formatColor("&7[&dR&7]&r " + txt); + mc.thePlayer.addChatMessage(new ChatComponentText(m)); + } + } + + public static void sendMessage(Object object) { + String toString = String.valueOf(object); + sendMessage(toString); + } + + public static void sendDebugMessage(String message) { + if (nullCheck()) { + mc.thePlayer.addChatMessage(new ChatComponentText("§7[§dR§7]§r " + message)); + } + } + + public static void attackEntity(Entity e, boolean clientSwing, boolean silentSwing) { + if (clientSwing) { + mc.thePlayer.swingItem(); + } + else if (silentSwing || (!silentSwing && !clientSwing)) { + mc.thePlayer.sendQueue.addToSendQueue(new C0APacketAnimation()); + } + mc.playerController.attackEntity(mc.thePlayer, e); + } + + public static void sendRawMessage(String txt) { + if (nullCheck()) { + mc.thePlayer.addChatMessage(new ChatComponentText(formatColor(txt))); + } + } + + public static float getCompleteHealth(EntityLivingBase entity) { + return entity.getHealth() + entity.getAbsorptionAmount(); + } + + public static String getHealthStr(EntityLivingBase entity, boolean accountDead) { + float completeHealth = getCompleteHealth(entity); + if (accountDead && entity.isDead) { + completeHealth = 0; + } + return getColorForHealth(entity.getHealth() / entity.getMaxHealth(), completeHealth); + } + + public static int getTool(Block block) { + float n = 1.0f; + int n2 = -1; + for (int i = 0; i < InventoryPlayer.getHotbarSize(); ++i) { + final ItemStack getStackInSlot = mc.thePlayer.inventory.getStackInSlot(i); + if (getStackInSlot != null) { + final float a = getEfficiency(getStackInSlot, block); + if (a > n) { + n = a; + n2 = i; + } + } + } + return n2; + } + + public static boolean onLadder(Entity entity) { + int posX = MathHelper.floor_double(entity.posX); + int posY = MathHelper.floor_double(entity.posY - 0.20000000298023224D); + int posZ = MathHelper.floor_double(entity.posZ); + BlockPos blockpos = new BlockPos(posX, posY, posZ); + Block block1 = Minecraft.getMinecraft().theWorld.getBlockState(blockpos).getBlock(); + return block1 instanceof BlockLadder && !entity.onGround; + } + + public static float getEfficiency(final ItemStack itemStack, final Block block) { + float getStrVsBlock = itemStack.getStrVsBlock(block); + if (getStrVsBlock > 1.0f) { + final int getEnchantmentLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.efficiency.effectId, itemStack); + if (getEnchantmentLevel > 0) { + getStrVsBlock += getEnchantmentLevel * getEnchantmentLevel + 1; + } + } + return getStrVsBlock; + } + + public static boolean isEnemy(EntityPlayer entityPlayer) { + return !enemies.isEmpty() && enemies.contains(entityPlayer.getName().toLowerCase()); + } + + public static boolean isEnemy(String name) { + return !enemies.isEmpty() && enemies.contains(name.toLowerCase()); + } + + public static String getColorForHealth(double n, double n2) { + double health = round(n2, 1); + return ((n < 0.3) ? "§c" : ((n < 0.5) ? "§6" : ((n < 0.7) ? "§e" : "§a"))) + (isWholeNumber(health) ? (int) health + "": health); + } + + public static int getColorForHealth(double health) { + return ((health < 0.3) ? -43691 : ((health < 0.5) ? -22016 : ((health < 0.7) ? -171 : -11141291))); + } + + public static String formatColor(String txt) { + return txt.replaceAll("&", "§"); + } + + public static String getFirstColorCode(String input) { + if (input == null || input.length() < 2) { + return ""; + } + for (int i = 0; i < input.length() - 1; i++) { + if (input.charAt(i) == '§') { + char c = input.charAt(i + 1); + if ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')) { + return "§" + c; + } + } + } + return ""; + } + + public static int getBoldWidth(String string) { + boolean bold = false; + int additionalWidth = 0; + for (int i = 0; i < string.length(); ++i) { + char c0 = string.charAt(i); + if (c0 == '§' && i + 1 < string.length()) { + int i2 = "0123456789abcdefklmnor".indexOf(string.toLowerCase(Locale.ENGLISH).charAt(i + 1)); + if (i2 == 17) { + bold = true; + } + ++i; + } + else { + if (bold) { + ++additionalWidth; + } + } + } + return additionalWidth; + } + + public static void correctValue(SliderSetting c, SliderSetting d) { + if (c.getInput() > d.getInput()) { + double p = c.getInput(); + c.setValue(d.getInput()); + d.setValue(p); + } + } + + public static String generateRandomString(final int n) { + final char[] array = "abcdefghijklmnopqrstuvwxyz0123456789".toCharArray(); + final StringBuilder sb = new StringBuilder(); + IntStream.range(0, n).forEach(p2 -> sb.append(array[rand.nextInt(array.length)])); + return sb.toString(); + } + + public static boolean isFriended(EntityPlayer entityPlayer) { + return !friends.isEmpty() && friends.contains(entityPlayer.getName().toLowerCase()); + } + + public static boolean isFriended(String name) { + return !friends.isEmpty() && friends.contains(name.toLowerCase()); + } + + public static double getRandomValue(SliderSetting a, SliderSetting b, Random r) { + return a.getInput() == b.getInput() ? a.getInput() : a.getInput() + r.nextDouble() * (b.getInput() - a.getInput()); + } + + public static double getRandomValue(double a, double b, Random r) { + return a == b ? a : a + r.nextDouble() * (b - a); + } + + public static boolean nullCheck() { + return mc.thePlayer != null && mc.theWorld != null; + } + + public static boolean isHypixel() { + return !mc.isSingleplayer() && mc.getCurrentServerData() != null && mc.getCurrentServerData().serverIP.contains("hypixel.net"); + } + + public static net.minecraft.util.Timer getTimer() { + return ObfuscationReflectionHelper.getPrivateValue(Minecraft.class, Minecraft.getMinecraft(), "timer", "field_71428_T"); + } + + public static String getHitsToKill(final EntityPlayer entityPlayer, final ItemStack itemStack) { + final int n = (int)Math.ceil(ap(entityPlayer, itemStack)); + return "§" + ((n <= 1) ? "c" : ((n <= 3) ? "6" : ((n <= 5) ? "e" : "a"))) + n; + } + + public static double ap(final EntityPlayer entityPlayer, final ItemStack itemStack) { + double n = 1.0; + if (itemStack != null && (itemStack.getItem() instanceof ItemSword || itemStack.getItem() instanceof ItemAxe)) { + n += getDamage(itemStack); + } + double n2 = 0.0; + double n3 = 0.0; + for (int i = 0; i < 4; ++i) { + final ItemStack armorItemInSlot = entityPlayer.inventory.armorItemInSlot(i); + if (armorItemInSlot != null) { + if (armorItemInSlot.getItem() instanceof ItemArmor) { + n2 += ((ItemArmor)armorItemInSlot.getItem()).damageReduceAmount * 0.04; + final int getEnchantmentLevel = EnchantmentHelper.getEnchantmentLevel(Enchantment.protection.effectId, armorItemInSlot); + if (getEnchantmentLevel != 0) { + n3 += Math.floor(0.75 * (6 + getEnchantmentLevel * getEnchantmentLevel) / 3.0); + } + } + } + } + return round((double)getCompleteHealth(entityPlayer) / (n * (1.0 - (n2 + 0.04 * Math.min(Math.ceil(Math.min(n3, 25.0) * 0.75), 20.0) * (1.0 - n2)))), 1); + } + + public static float n() { + return ae(mc.thePlayer.rotationYaw, mc.thePlayer.movementInput.moveForward, mc.thePlayer.movementInput.moveStrafe); + } + + public static String extractFileName(String name) { + int firstIndex = name.indexOf("_"); + int lastIndex = name.lastIndexOf("_"); + + if (firstIndex != -1 && lastIndex != -1 && lastIndex > firstIndex) { + return name.substring(firstIndex + 1, lastIndex); + } else { + return name; + } + } + + public static int mergeAlpha(int n, int n2) { + return (n & 0xFFFFFF) | n2 << 24; + } + + public static int clamp(int n) { + if (n > 255) { + return 255; + } + if (n < 4) { + return 4; + } + return n; + } + + public static int darkenColor(int color, double percent) { + int alpha = (color >> 24) & 0xFF; + int red = (color >> 16) & 0xFF; + int green = (color >> 8) & 0xFF; + int blue = color & 0xFF; + + percent = (100 - percent) / 100; + + red = (int)(red * percent); + green = (int)(green * percent); + blue = (int)(blue * percent); + + red = clamp(red); + green = clamp(green); + blue = clamp(blue); + + int darkenedColor = (alpha << 24) | (red << 16) | (green << 8) | blue; + return darkenedColor; + } + + public static boolean isTeamMate(Entity entity) { + try { + Entity teamMate = entity; + if (mc.thePlayer.isOnSameTeam((EntityLivingBase) entity) || mc.thePlayer.getDisplayName().getUnformattedText().startsWith(teamMate.getDisplayName().getUnformattedText().substring(0, 2))) { + return true; + } + } catch (Exception e) { + } + return false; + } + + public static void setSpeed(double n) { + if (n == 0.0) { + mc.thePlayer.motionZ = 0.0; + mc.thePlayer.motionX = 0.0; + return; + } + float n3 = n(); + mc.thePlayer.motionX = -Math.sin(n3) * n; + mc.thePlayer.motionZ = Math.cos(n3) * n; + } + + public static void resetTimer() { + try { + getTimer().timerSpeed = 1.0F; + } catch (NullPointerException var1) { + } + } + + public static boolean inInventory() { + if (!Utils.nullCheck()) { + return false; + } + return (mc.currentScreen != null) && (mc.thePlayer.inventoryContainer != null) && (mc.thePlayer.inventoryContainer instanceof ContainerPlayer) && (mc.currentScreen instanceof GuiInventory); + } + + public static int getSkyWarsStatus() { + List sidebar = Utils.getSidebarLines(); + if (sidebar == null || sidebar.isEmpty()) { + return -1; + } + if (Utils.stripColor(sidebar.get(0)).startsWith("SKYWARS")) { + for (String line : sidebar) { + line = Utils.stripColor(line); + if (line.equals("Waiting...") || line.startsWith("Starting in ")) { + return 1; + } + else if (line.startsWith("Players left: ")) { + return 2; + } + } + return 0; + } + return -1; + } + + public static String getString(final JsonObject type, final String member) { + try { + return type.get(member).getAsString(); + } + catch (Exception er) { + return ""; + } + } + + public static String getTitle() { + try { + return (String) Reflection.title.get(mc.ingameGUI); + } catch (IllegalAccessException ex) { + ex.printStackTrace(); + } + return ""; + } + + public static int getBedwarsStatus() { + if (!Utils.nullCheck()) { + return -1; + } + final Scoreboard scoreboard = mc.theWorld.getScoreboard(); + if (scoreboard == null) { + return -1; + } + final ScoreObjective objective = scoreboard.getObjectiveInDisplaySlot(1); + if (objective == null || !stripString(objective.getDisplayName()).contains("BED WARS")) { + return -1; + } + for (String line : getSidebarLines()) { + line = stripString(line); + String[] parts = line.split(" "); + if (parts.length > 1) { + if (parts[1].startsWith("L")) { + return 0; + } + } + else if (line.equals("Waiting...") || line.startsWith("Starting in")) { + return 1; + } + else if (line.startsWith("R Red:") || line.startsWith("B Blue:")) { + return 2; + } + } + return -1; + } + + public static boolean skywarsQueue() { + if (!Utils.nullCheck()) { + return false; + } + final Scoreboard scoreboard = mc.theWorld.getScoreboard(); + if (scoreboard == null) { + return false; + } + final ScoreObjective objective = scoreboard.getObjectiveInDisplaySlot(1); + if (objective != null || stripString(objective.getDisplayName()).contains("SKYWARS")) { + Utils.print("Skywars"); + return true; + } + return false; + } + + public static boolean usingBedAura() { + if (ModuleManager.bedAura != null && ModuleManager.bedAura.currentBlock != null && RotationUtils.inRange(ModuleManager.bedAura.currentBlock, ModuleManager.bedAura.range.getInput())) { + return true; + } + return false; + } + + public static String stripString(final String s) { + final char[] nonValidatedString = StringUtils.stripControlCodes(s).toCharArray(); + final StringBuilder validated = new StringBuilder(); + for (final char c : nonValidatedString) { + if (c < '' && c > '') { + validated.append(c); + } + } + return validated.toString(); + } + + public static List getSidebarLines() { + final List lines = new ArrayList<>(); + if (mc.theWorld == null) { + return lines; + } + final Scoreboard scoreboard = mc.theWorld.getScoreboard(); + if (scoreboard == null) { + return lines; + } + final ScoreObjective objective = scoreboard.getObjectiveInDisplaySlot(1); + if (objective == null) { + return lines; + } + Collection scores = scoreboard.getSortedScores(objective); + final List list = new ArrayList<>(); + for (final Score input : scores) { + if (input != null && input.getPlayerName() != null && !input.getPlayerName().startsWith("#")) { + list.add(input); + } + } + if (list.size() > 15) { + scores = new ArrayList<>(Lists.newArrayList(Iterables.skip(list, list.size() - 15))); + } else { + scores = list; + } + int index = 0; + for (final Score score : scores) { + ++index; + final ScorePlayerTeam team = scoreboard.getPlayersTeam(score.getPlayerName()); + lines.add(ScorePlayerTeam.formatPlayerName(team, score.getPlayerName())); + if (index == scores.size()) { + lines.add(objective.getDisplayName()); + } + } + Collections.reverse(lines); + return lines; + } + + public static Random getRandom() { + return rand; + } + + public static boolean isMoving() { + return mc.thePlayer.moveForward != 0.0F || mc.thePlayer.moveStrafing != 0.0F; + } + + public static void aim(Entity en, float ps, boolean pc) { + if (en != null) { + float[] t = getRotationsOld(en); + if (t != null) { + float y = t[0]; + float p = t[1] + 4.0F + ps; + if (pc) { + mc.getNetHandler().addToSendQueue(new C05PacketPlayerLook(y, p, mc.thePlayer.onGround)); + } + else { + mc.thePlayer.rotationYaw = y; + mc.thePlayer.rotationPitch = p; + } + } + + } + } + + public static float[] getRotationsOld(Entity q) { + if (q == null) { + return null; + } + else { + double diffX = q.posX - mc.thePlayer.posX; + double diffY; + if (q instanceof EntityLivingBase) { + EntityLivingBase en = (EntityLivingBase) q; + diffY = en.posY + (double) en.getEyeHeight() * 0.9D - (mc.thePlayer.posY + (double) mc.thePlayer.getEyeHeight()); + } else { + diffY = (q.getEntityBoundingBox().minY + q.getEntityBoundingBox().maxY) / 2.0D - (mc.thePlayer.posY + (double) mc.thePlayer.getEyeHeight()); + } + + double diffZ = q.posZ - mc.thePlayer.posZ; + double dist = MathHelper.sqrt_double(diffX * diffX + diffZ * diffZ); + float yaw = (float) (Math.atan2(diffZ, diffX) * 180.0D / 3.141592653589793D) - 90.0F; + float pitch = (float) (-(Math.atan2(diffY, dist) * 180.0D / 3.141592653589793D)); + return new float[] { mc.thePlayer.rotationYaw + MathHelper.wrapAngleTo180_float(yaw - mc.thePlayer.rotationYaw) , mc.thePlayer.rotationPitch + MathHelper.wrapAngleTo180_float(pitch - mc.thePlayer.rotationPitch)}; + } + } + + public static double n(Entity en) { + return ((double) (mc.thePlayer.rotationYaw - getYaw(en)) % 360.0D + 540.0D) % 360.0D - 180.0D; + } + + public static float getYaw(Entity ent) { + double x = ent.posX - mc.thePlayer.posX; + double z = ent.posZ - mc.thePlayer.posZ; + double yaw = Math.atan2(x, z) * 57.29577951308232; + return (float) (yaw * -1.0D); + } + + public static void ss(double s, boolean m) { + if (!m || isMoving()) { + mc.thePlayer.motionX = -Math.sin(gd()) * s; + mc.thePlayer.motionZ = Math.cos(gd()) * s; + } + } + + public static boolean keysDown() { + return Keyboard.isKeyDown(mc.gameSettings.keyBindForward.getKeyCode()) || Keyboard.isKeyDown(mc.gameSettings.keyBindBack.getKeyCode()) || Keyboard.isKeyDown(mc.gameSettings.keyBindLeft.getKeyCode()) || Keyboard.isKeyDown(mc.gameSettings.keyBindRight.getKeyCode()); + } + + public static boolean jumpDown() { + return Keyboard.isKeyDown(mc.gameSettings.keyBindJump.getKeyCode()); + } + + public static double distanceToGround(Entity entity) { + if (entity.onGround) { + return 0; + } + double fallDistance = -1; + double y = entity.posY; + if (entity.posY % 1 == 0) { + y--; + } + for (int i = (int) Math.floor(y); i > -1; i--) { + if (!isPlaceable(new BlockPos(entity.posX, i, entity.posZ))) { + fallDistance = y - i; + break; + } + } + return fallDistance - 1; + } + + public static double distanceToGroundPos(Entity entity, int groundPos) { + if (entity.onGround) { + return 0; + } + double fallDistance = -1; + double y = entity.posY; + if (entity.posY % 1 == 0) { + y--; + } + for (int i = (int) Math.floor(y); i > -1; i--) { + if (i == groundPos) { + fallDistance = y - i; + break; + } + } + return fallDistance - 1; + } + + public static float gd() { + float yw = mc.thePlayer.rotationYaw; + if (mc.thePlayer.moveForward < 0.0F) { + yw += 180.0F; + } + + float f; + if (mc.thePlayer.moveForward < 0.0F) { + f = -0.5F; + } else if (mc.thePlayer.moveForward > 0.0F) { + f = 0.5F; + } else { + f = 1.0F; + } + + if (mc.thePlayer.moveStrafing > 0.0F) { + yw -= 90.0F * f; + } + + if (mc.thePlayer.moveStrafing < 0.0F) { + yw += 90.0F * f; + } + + yw *= 0.017453292F; + return yw; + } + + public static float ae(float n, float n2, float n3) { + float n4 = 1.0f; + if (n2 < 0.0f) { + n += 180.0f; + n4 = -0.5f; + } else if (n2 > 0.0f) { + n4 = 0.5f; + } + if (n3 > 0.0f) { + n -= 90.0f * n4; + } else if (n3 < 0.0f) { + n += 90.0f * n4; + } + return n * 0.017453292f; + } + + public static double getHorizontalSpeed() { + return getHorizontalSpeed(mc.thePlayer); + } + + public static double getHorizontalSpeed(Entity entity) { + return Math.sqrt(entity.motionX * entity.motionX + entity.motionZ * entity.motionZ); + } + + public static List getTopLevelLines(String fileContents) { + List topLevelLines = new ArrayList<>(); + String[] lines = fileContents.split("\\r?\\n"); + int braceLevel = 0; + boolean inBlockComment = false; + + for (String line : lines) { + String originalLine = line; + String processedLine = line.trim(); + + if (inBlockComment) { + if (processedLine.contains("*/")) { + inBlockComment = false; + processedLine = processedLine.substring(processedLine.indexOf("*/") + 2).trim(); + } + else { + continue; + } + } + + if (processedLine.startsWith("//")) { + continue; + } + + if (processedLine.contains("/*")) { + inBlockComment = true; + processedLine = processedLine.substring(0, processedLine.indexOf("/*")).trim(); + if (processedLine.isEmpty()) { + continue; + } + } + + if (processedLine.contains("//")) { + processedLine = processedLine.substring(0, processedLine.indexOf("//")).trim(); + } + + if (processedLine.contains("/*") && processedLine.contains("*/")) { + processedLine = processedLine.substring(0, processedLine.indexOf("/*")) + processedLine.substring(processedLine.indexOf("*/") + 2); + processedLine = processedLine.trim(); + } + + if (processedLine.isEmpty()) { + continue; + } + + String lineWithoutStrings = removeStringLiterals(processedLine); + + int openBraces = 0; + int closeBraces = 0; + for (char ch : lineWithoutStrings.toCharArray()) { + if (ch == '{') { + openBraces++; + } + else if (ch == '}') { + closeBraces++; + } + } + braceLevel += openBraces - closeBraces; + + if (braceLevel == 0 && !processedLine.contains("{") && !processedLine.contains("}") && !processedLine.startsWith("@")) { + topLevelLines.add(originalLine.trim()); + } + } + + return topLevelLines; + } + + private static String removeStringLiterals(String line) { + StringBuilder sb = new StringBuilder(); + boolean inString = false; + + for (int i = 0; i < line.length(); i++) { + char ch = line.charAt(i); + if (ch == '\"' && (i == 0 || line.charAt(i - 1) != '\\')) { + inString = !inString; + continue; + } + if (!inString) { + sb.append(ch); + } + } + + return sb.toString(); + } + + public static boolean onEdge() { + return onEdge(mc.thePlayer); + } + + public static boolean onEdge(Entity entity) { + return mc.theWorld.getCollidingBoundingBoxes(entity, entity.getEntityBoundingBox().offset(entity.motionX / 3.0D, -1.0D, entity.motionZ / 3.0D)).isEmpty(); + } + + public static boolean lookingAtBlock() { + return mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && mc.objectMouseOver.getBlockPos() != null; + } + + public static boolean isDiagonal(boolean strict) { + float yaw = ((mc.thePlayer.rotationYaw % 360) + 360) % 360; + yaw = yaw > 180 ? yaw - 360 : yaw; + boolean isYawDiagonal = inBetween(-170, 170, yaw) && !inBetween(-10, 10, yaw) && !inBetween(80, 100, yaw) && !inBetween(-100, -80, yaw); + if (strict) { + isYawDiagonal = inBetween(-178.5, 178.5, yaw) && !inBetween(-1.5, 1.5, yaw) && !inBetween(88.5, 91.5, yaw) && !inBetween(-91.5, -88.5, yaw); + } + boolean isStrafing = Keyboard.isKeyDown(mc.gameSettings.keyBindLeft.getKeyCode()) || Keyboard.isKeyDown(mc.gameSettings.keyBindRight.getKeyCode()); + return isYawDiagonal || isStrafing; + } + + public static boolean scaffoldDiagonal(boolean strict) { + float back = MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - ModuleManager.scaffold.hardcodedYaw(); + float yaw = ((back % 360) + 360) % 360; + yaw = yaw > 180 ? yaw - 360 : yaw; + boolean isYawDiagonal = inBetween(-170, 170, yaw) && !inBetween(-10, 10, yaw) && !inBetween(80, 100, yaw) && !inBetween(-100, -80, yaw); + if (strict) { + isYawDiagonal = inBetween(-178.5, 178.5, yaw) && !inBetween(-1.5, 1.5, yaw) && !inBetween(88.5, 91.5, yaw) && !inBetween(-91.5, -88.5, yaw); + } + return isYawDiagonal; + } + + public static double gbps(Entity en, int d) { + double x = en.posX - en.prevPosX; + double z = en.posZ - en.prevPosZ; + double sp = Math.sqrt(x * x + z * z) * 20.0D; + if (d == 0) { + return sp; + } + return round(sp, d); + } + + public static boolean inBetween(double min, double max, double value) { + return value >= min && value <= max; + } + + public static String removeFormatCodes(String str) { + return str.replace("§k", "").replace("§l", "").replace("§m", "").replace("§n", "").replace("§o", "").replace("§r", ""); + } + + public static boolean isClicking() { + if (ModuleManager.autoClicker.isEnabled() && AutoClicker.leftClick.isToggled()) { + return Mouse.isButtonDown(0); + } + else { + return CPSCalculator.f() > 1 && System.currentTimeMillis() - CPSCalculator.LL < 300L; + } + } + + public static boolean isEdgeOfBlock(final double posX, final double posY, final double posZ) { + BlockPos pos = new BlockPos(posX, posY - ((posY % 1.0 == 0.0) ? 1 : 0), posZ); + return mc.theWorld.isAirBlock(pos); + } + + public static boolean isEdgeOfBlock() { + BlockPos pos = new BlockPos(mc.thePlayer.posX, mc.thePlayer.posY - ((mc.thePlayer.posY % 1.0 == 0.0) ? 1 : 0), mc.thePlayer.posZ); + return mc.theWorld.isAirBlock(pos); + } + + public static long timeBetween(long n, long n2) { + return Math.abs(n2 - n); + } + + public static void sendModuleMessage(Module module, String s) { + sendRawMessage("&3" + module.getName() + "&7: &r" + s); + } + + public static void print(String s) { + sendRawMessage(s); + } + + public static EntityLivingBase raytrace(final int n) { + Entity entity = null; + MovingObjectPosition rayTrace = mc.thePlayer.rayTrace((double)n, 1.0f); + final Vec3 getPositionEyes = mc.thePlayer.getPositionEyes(1.0f); + final float rotationYaw = mc.thePlayer.rotationYaw; + final float rotationPitch = mc.thePlayer.rotationPitch; + final float cos = MathHelper.cos(-rotationYaw * 0.017453292f - 3.1415927f); + final float sin = MathHelper.sin(-rotationYaw * 0.017453292f - 3.1415927f); + final float n2 = -MathHelper.cos(-rotationPitch * 0.017453292f); + final Vec3 vec3 = new Vec3((double)(sin * n2), (double)MathHelper.sin(-rotationPitch * 0.017453292f), (double)(cos * n2)); + final Vec3 addVector = getPositionEyes.addVector(vec3.xCoord * (double)n, vec3.yCoord * (double)n, vec3.zCoord * (double)n); + Vec3 vec4 = null; + final List getEntitiesWithinAABBExcludingEntity = mc.theWorld.getEntitiesWithinAABBExcludingEntity(mc.getRenderViewEntity(), mc.getRenderViewEntity().getEntityBoundingBox().addCoord(vec3.xCoord * (double)n, vec3.yCoord * (double)n, vec3.zCoord * (double)n).expand(1.0, 1.0, 1.0)); + double n3 = (double)n; + for (int i = 0; i < getEntitiesWithinAABBExcludingEntity.size(); ++i) { + final Entity entity2 = (Entity)getEntitiesWithinAABBExcludingEntity.get(i); + if (entity2.canBeCollidedWith()) { + final float getCollisionBorderSize = entity2.getCollisionBorderSize(); + final AxisAlignedBB expand = entity2.getEntityBoundingBox().expand((double)getCollisionBorderSize, (double)getCollisionBorderSize, (double)getCollisionBorderSize); + final MovingObjectPosition calculateIntercept = expand.calculateIntercept(getPositionEyes, addVector); + if (expand.isVecInside(getPositionEyes)) { + if (0.0 < n3 || n3 == 0.0) { + entity = entity2; + vec4 = ((calculateIntercept == null) ? getPositionEyes : calculateIntercept.hitVec); + n3 = 0.0; + } + } + else if (calculateIntercept != null) { + final double distanceTo = getPositionEyes.distanceTo(calculateIntercept.hitVec); + if (distanceTo < n3 || n3 == 0.0) { + if (entity2 == mc.getRenderViewEntity().ridingEntity && !entity2.canRiderInteract()) { + if (n3 == 0.0) { + entity = entity2; + vec4 = calculateIntercept.hitVec; + } + } + else { + entity = entity2; + vec4 = calculateIntercept.hitVec; + n3 = distanceTo; + } + } + } + } + } + if (entity != null && (n3 < n || rayTrace == null)) { + rayTrace = new MovingObjectPosition(entity, vec4); + } + if (rayTrace != null && rayTrace.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && rayTrace.entityHit instanceof EntityLivingBase) { + return (EntityLivingBase)rayTrace.entityHit; + } + return null; + } + + public static int getChroma(long speed, long... delay) { + long time = System.currentTimeMillis() + (delay.length > 0 ? delay[0] : 0L); + return Color.getHSBColor((float) (time % (15000L / speed)) / (15000.0F / (float) speed), 1.0F, 1.0F).getRGB(); + } + + public static double round(double n, int d) { + if (d == 0) { + return (double) Math.round(n); + } + else { + double p = Math.pow(10.0D, (double) d); + return (double) Math.round(n * p) / p; + } + } + + public static String stripColor(final String s) { + if (s.isEmpty()) { + return s; + } + final char[] array = StringUtils.stripControlCodes(s).toCharArray(); + final StringBuilder sb = new StringBuilder(); + for (final char c : array) { + if (c < '\u007f' && c > '\u0014') { + sb.append(c); + } + } + return sb.toString(); + } + + public static void addToClipboard(String string) { + try { + Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); + StringSelection stringSelection = new StringSelection(string); + clipboard.setContents(stringSelection, null); + } + catch (Exception e) { + Utils.sendMessage("&cFailed to copy &b" + string); + } + } + + public static List gsl() { + List lines = new ArrayList(); + if (mc.theWorld == null) { + return lines; + } else { + Scoreboard scoreboard = mc.theWorld.getScoreboard(); + if (scoreboard == null) { + return lines; + } else { + ScoreObjective objective = scoreboard.getObjectiveInDisplaySlot(1); + if (objective == null) { + return lines; + } else { + Collection scores = scoreboard.getSortedScores(objective); + List list = new ArrayList(); + Iterator var5 = scores.iterator(); + + Score score; + while (var5.hasNext()) { + score = (Score) var5.next(); + if (score != null && score.getPlayerName() != null && !score.getPlayerName().startsWith("#")) { + list.add(score); + } + } + + if (list.size() > 15) { + scores = Lists.newArrayList(Iterables.skip(list, scores.size() - 15)); + } else { + scores = list; + } + + var5 = scores.iterator(); + + while (var5.hasNext()) { + score = (Score) var5.next(); + ScorePlayerTeam team = scoreboard.getPlayersTeam(score.getPlayerName()); + lines.add(ScorePlayerTeam.formatPlayerName(team, score.getPlayerName())); + } + + return lines; + } + } + } + } + + public static void rsa() { + EntityPlayerSP p = mc.thePlayer; + int armSwingEnd = p.isPotionActive(Potion.digSpeed) ? 6 - (1 + p.getActivePotionEffect(Potion.digSpeed).getAmplifier()) : (p.isPotionActive(Potion.digSlowdown) ? 6 + (1 + p.getActivePotionEffect(Potion.digSlowdown).getAmplifier()) * 2 : 6); + if (!p.isSwingInProgress || p.swingProgressInt >= armSwingEnd / 2 || p.swingProgressInt < 0) { + p.swingProgressInt = -1; + p.isSwingInProgress = true; + } + + } + + public static String uf(String s) { + return s.substring(0, 1).toUpperCase() + s.substring(1); + } + + public static boolean overAir() { + return mc.theWorld.isAirBlock(new BlockPos(mc.thePlayer.posX, mc.thePlayer.posY - 1.0, mc.thePlayer.posZ)); + } + + public static boolean overPlaceable(double yOffset) { + BlockPos playerPos = new BlockPos(mc.thePlayer.posX, mc.thePlayer.posY + yOffset, mc.thePlayer.posZ); + return isPlaceable(playerPos); + } + + public static boolean isPlaceable(BlockPos blockPos) { + return BlockUtils.replaceable(blockPos) || BlockUtils.isFluid(BlockUtils.getBlock(blockPos)); + } + + public static boolean holdingWeapon() { + if (mc.thePlayer.getHeldItem() == null) { + return false; + } + Item getItem = mc.thePlayer.getHeldItem().getItem(); + return getItem instanceof ItemSword || (Settings.weaponAxe.isToggled() && getItem instanceof ItemAxe) || (Settings.weaponRod.isToggled() && getItem instanceof ItemFishingRod) || (Settings.weaponStick.isToggled() && getItem == Items.stick); + } + + public static boolean holdingSword() { + if (mc.thePlayer.getHeldItem() == null) { + return false; + } + return mc.thePlayer.getHeldItem().getItem() instanceof ItemSword; + } + + public static boolean holdingFireball() { + if (mc.thePlayer.getHeldItem() == null) { + return false; + } + return mc.thePlayer.getHeldItem().getItem() instanceof ItemFireball; + } + + public static boolean holdingSword(int slot) { + ItemStack stack = mc.thePlayer.inventory.getStackInSlot(slot); + if (stack == null || stack.getItem() == null) { + return false; + } + return stack.getItem() instanceof ItemSword; + } + + public static boolean holdingBow() { + if (mc.thePlayer.getHeldItem() == null) { + return false; + } + return mc.thePlayer.getHeldItem().getItem() instanceof ItemBow; + } + + /*public static boolean holdingBow(int slot) { + ItemStack stack = mc.thePlayer.inventory.getStackInSlot(slot); + if (stack == null || stack.getItem() == null) { + return false; + } + return stack.getItem() instanceof ItemBow; + }*/ + + public static boolean bowBackwards() { + if (holdingBow() && mc.thePlayer.moveStrafing == 0 && mc.thePlayer.moveForward <= 0 && isMoving()) { + //Utils.print("bow backwards"); + return true; + } + return false; + } + + public static boolean noSlowingBackWithBow() { + if (ModuleManager.noSlow.noSlowing && bowBackwards()) { + //Utils.print("noslow + bow backwards"); + return true; + } + return false; + } + + public static double getDamage(ItemStack itemStack) { + if (itemStack == null) { + return 0; + } + double getAmount = 0; + for (final Map.Entry entry : itemStack.getAttributeModifiers().entries()) { + if (entry.getKey().equals("generic.attackDamage")) { + getAmount = entry.getValue().getAmount(); + break; + } + } + return getAmount + EnchantmentHelper.getEnchantmentLevel(Enchantment.sharpness.effectId, itemStack) * 1.25; + } + + + public static boolean canBePlaced(ItemBlock itemBlock) { + Block block = itemBlock.getBlock(); + if (block == null) { + return false; + } + if (BlockUtils.isInteractable(block) || block instanceof BlockSapling || block instanceof BlockDaylightDetector || block instanceof BlockBeacon || block instanceof BlockBanner || block instanceof BlockEndPortalFrame || block instanceof BlockEndPortal || block instanceof BlockLever || block instanceof BlockButton || block instanceof BlockSkull || block instanceof BlockLiquid || block instanceof BlockCactus || block instanceof BlockDoublePlant || block instanceof BlockLilyPad || block instanceof BlockCarpet || block instanceof BlockTripWire || block instanceof BlockTripWireHook || block instanceof BlockTallGrass || block instanceof BlockFlower || block instanceof BlockFlowerPot || block instanceof BlockSign || block instanceof BlockLadder || block instanceof BlockTorch || block instanceof BlockRedstoneTorch || block instanceof BlockFence || block instanceof BlockPane || block instanceof BlockStainedGlassPane || block instanceof BlockGravel || block instanceof BlockClay || block instanceof BlockSand || block instanceof BlockSoulSand || block instanceof BlockRail) { + return false; + } + return true; + } + + public static > E getEnum(Class enumClass, String value) { + for (E enumConstant : enumClass.getEnumConstants()) { + if (enumConstant.name().equals(value)) { + return enumConstant; + } + } + return null; + } + + public static int getSpeedAmplifier() { + if (mc.thePlayer.isPotionActive(Potion.moveSpeed)) { + return 1 + mc.thePlayer.getActivePotionEffect(Potion.moveSpeed).getAmplifier(); + } + return 0; + } + + public static ItemStack getSpoofedItem(ItemStack original) { + if (ModuleManager.scaffold.isEnabled && ModuleManager.scaffold.autoSwap.isToggled() && ModuleManager.autoSwap.spoofItem.isToggled()) { + return mc.thePlayer.inventory.getStackInSlot(ModuleManager.scaffold.lastSlot.get() == -1 ? mc.thePlayer.inventory.currentItem : ModuleManager.scaffold.lastSlot.get()); + } + if (ModuleManager.autoTool.isEnabled() && ModuleManager.autoTool.spoofItem.isToggled()) { + return mc.thePlayer.inventory.getStackInSlot(ModuleManager.autoTool.previousSlot == -1 ? mc.thePlayer.inventory.currentItem : ModuleManager.autoTool.previousSlot); + } + return original; + } + + public static boolean tabbedIn() { + return mc.currentScreen == null && mc.inGameHasFocus; + } + + public static boolean spectatorCheck() { + return + mc.thePlayer.inventory.getStackInSlot(8) != null && mc.thePlayer.inventory.getStackInSlot(8).getDisplayName().contains("Return") + || Utils.stripString(getTitle()).contains("YOU DIED"); + } + + public static String readInputStream(InputStream inputStream) { + StringBuilder stringBuilder = new StringBuilder(); + + try { + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); + String line; + while ((line = bufferedReader.readLine()) != null) + stringBuilder.append(line).append('\n'); + + } catch (Exception e) { + e.printStackTrace(); + } + return stringBuilder.toString(); + } + + public static boolean safeWalkBackwards() { + return ModuleManager.safeWalk.canSafeWalk() && mc.thePlayer.moveForward <= -0.5 && mc.thePlayer.moveStrafing == 0; + } + + public static class keybinds { + public static int[] getMousePosition() { + return new int[] { Mouse.getX(), Mouse.getY() }; + } + + public static boolean isPressed(String key) { + for (Map.Entry map : Reflection.keyBindings.entrySet()) { + if (map.getValue().equals(key)) { + return map.getKey().isKeyDown(); + } + } + return false; + } + + public static void setPressed(String key, boolean pressed) { + for (Map.Entry map : Reflection.keyBindings.entrySet()) { + if (map.getValue().equals(key)) { + KeyBinding.setKeyBindState(map.getKey().getKeyCode(), pressed); + if (pressed) { + KeyBinding.onTick(map.getKey().getKeyCode()); + } + } + } + } + + public static int getKeyCode(String key) { + return Keyboard.getKeyIndex(key); + } + + public static boolean isMouseDown(int mouseButton) { + return Mouse.isButtonDown(mouseButton); + } + + public static boolean isKeyDown(int key) { + return Keyboard.isKeyDown(key); + } + + public static void rightClick() { + Reflection.rightClick(); + } + + public static void leftClick() { + Reflection.clickMouse(); + } + } + + public static boolean isLobby() { + if (Utils.isHypixel()) { + List sidebarLines = Utils.getSidebarLines(); + if (!sidebarLines.isEmpty()) { + String[] parts = Utils.stripColor(sidebarLines.get(1)).split(" "); + if (parts.length > 1 && parts[1].charAt(0) == 'L') { + return true; + } + } + } + return false; + } + + public static boolean isBedwarsPractice() { + if (Utils.isHypixel()) { + if (!Utils.nullCheck()) { + return false; + } + final Scoreboard scoreboard = mc.theWorld.getScoreboard(); + if (scoreboard == null) { + return false; + } + final ScoreObjective objective = scoreboard.getObjectiveInDisplaySlot(1); + if (objective == null || !stripString(objective.getDisplayName()).contains("BED WARS PRACTICE")) { + return false; + } + return true; + } + return false; + } +} diff --git a/src/main/java/keystrokesmod/utility/command/Command.java b/src/main/java/keystrokesmod/utility/command/Command.java new file mode 100644 index 0000000..60c222c --- /dev/null +++ b/src/main/java/keystrokesmod/utility/command/Command.java @@ -0,0 +1,38 @@ +package keystrokesmod.utility.command; + +import keystrokesmod.module.ModuleManager; +import keystrokesmod.utility.Utils; +import net.minecraft.client.Minecraft; + +import java.util.ArrayList; +import java.util.List; + +public abstract class Command { + protected String command; + protected String[] alias; + public Minecraft mc = Minecraft.getMinecraft(); + + public Command(String command, String[] alias) { + this.command = command; + this.alias = alias; + } + + public Command(String command) { + this.command = command; + this.alias = new String[]{command}; + } + + public abstract void onExecute(String[] args); + + public List tabComplete(String[] args) { + return new ArrayList<>(); + } + + protected void chat(String msg) { + Utils.sendMessage(ModuleManager.lowercaseChatCommands() ? msg.toLowerCase() : msg); + } + + protected void syntaxError() { + Utils.sendMessage("§csyntax error"); + } +} diff --git a/src/main/java/keystrokesmod/utility/command/CommandManager.java b/src/main/java/keystrokesmod/utility/command/CommandManager.java new file mode 100644 index 0000000..9c97d0f --- /dev/null +++ b/src/main/java/keystrokesmod/utility/command/CommandManager.java @@ -0,0 +1,92 @@ +package keystrokesmod.utility.command; + +import keystrokesmod.utility.Utils; +import keystrokesmod.utility.command.impl.*; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class CommandManager { + private List commands = new ArrayList<>(); + public String[] latestAutoComplete = new String[]{}; + + public CommandManager() { + registerCommand(new Help()); + registerCommand(new Ping()); + registerCommand(new Name()); + registerCommand(new Binds()); + registerCommand(new Cname()); + registerCommand(new Friend()); + registerCommand(new Enemy()); + registerCommand(new Q()); + registerCommand(new QList()); + } + + public void executeCommand(String input) { + String[] args = input.split(" "); + for (Command command : commands) { + if (args[0].equalsIgnoreCase("." + command.command)) { + command.onExecute(args); + return; + } + + if (command.alias == null || command.alias.length == 0) { + continue; + } + + for (String alias : command.alias) { + if (args[0].equalsIgnoreCase("." + alias)) { + command.onExecute(args); + return; + } + } + } + + Utils.sendMessage("§cunknown command. use .help for a list of commands."); + } + + public boolean autoComplete(String input) { + String[] completions = getCompletions(input); + this.latestAutoComplete = completions != null ? completions : new String[]{}; + return input.startsWith(".") && this.latestAutoComplete.length > 0; + } + + private String[] getCompletions(String input) { + if (!input.isEmpty() && input.charAt(0) == '.') { + String[] args = input.split(" "); + + if (args.length > 1) { + Command command = getCommand(args[0].substring(1)); + if (command != null) { + List tabCompletions = command.tabComplete(Arrays.copyOfRange(args, 1, args.length)); + return tabCompletions.toArray(new String[0]); + } + } else { + String rawInput = input.substring(1); + List completions = new ArrayList<>(); + for (Command command : commands) { + if (command.command.startsWith(rawInput) || Arrays.stream(command.alias).anyMatch(alias -> alias.startsWith(rawInput))) { + String alias = command.command.startsWith(rawInput) ? command.command : Arrays.stream(command.alias).filter(aliaz -> aliaz.startsWith(rawInput)).findFirst().orElse(""); + completions.add("." + alias); + } + } + return completions.toArray(new String[0]); + } + } + return null; + } + + private Command getCommand(String name) { + for (Command cmd : commands) { + if (cmd.command.equalsIgnoreCase(name) || Arrays.stream(cmd.alias).anyMatch(alias -> alias.equalsIgnoreCase(name))) { + return cmd; + } + } + return null; + } + + public void registerCommand(Command command) { + commands.add(command); + } +} diff --git a/src/main/java/keystrokesmod/utility/command/impl/Binds.java b/src/main/java/keystrokesmod/utility/command/impl/Binds.java new file mode 100644 index 0000000..211b193 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/command/impl/Binds.java @@ -0,0 +1,77 @@ +package keystrokesmod.utility.command.impl; + +import keystrokesmod.Raven; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.utility.command.Command; +import keystrokesmod.utility.profile.Profile; +import org.jetbrains.annotations.NotNull; +import org.lwjgl.input.Keyboard; + +import java.util.HashMap; +import java.util.Map; + +public class Binds extends Command { + public Binds() { + super("binds"); + } + + @Override + public void onExecute(String[] args) { + if (args.length <= 1) { + HashMap binds = getBindsModulesMap(0); + chat("&7[&fbinds&7] &b" + binds.size() + " &7module" + (binds.size() == 1 ? "" : "s") + " have keybinds."); + for (Map.Entry bindsMap : binds.entrySet()) { + chat(" &b" + bindsMap.getKey() + " &7" + bindsMap.getValue()); + } + } + else if (args.length == 2) { + int keycode = Keyboard.getKeyIndex(args[1].toUpperCase()); + if (keycode == 0) { + chat("&7[&fbinds&7] &7Invalid key."); + return; + } + HashMap binds = getBindsModulesMap(keycode); + chat("&7[&fbinds&7] &b" + binds.size() + " &7module" + (binds.size() == 1 ? "" : "s") + " has keybind &b" + args[1].toUpperCase() + "&7."); + for (Map.Entry bindsMap : binds.entrySet()) { + chat(" &b" + bindsMap.getKey() + " &7" + bindsMap.getValue()); + } + } + else { + syntaxError(); + } + } + + private HashMap getBindsModulesMap(int keycode) { + HashMap binds = new HashMap<>(); + for (Module module : ModuleManager.modules) { + if (module.getKeycode() == 0) { + continue; + } + if (keycode != 0 && module.getKeycode() != keycode) { + continue; + } + binds.put((module.getKeycode() >= 1000 ? "M" + (module.getKeycode() - 1000) : Keyboard.getKeyName(module.getKeycode())), module.getName()); + } + for (Profile profile : Raven.profileManager.profiles) { + Module module = profile.getModule(); + if (module.getKeycode() == 0) { + continue; + } + if (keycode != 0 && module.getKeycode() != keycode) { + continue; + } + binds.put((module.getKeycode() >= 1000 ? "M" + (module.getKeycode() - 1000) : Keyboard.getKeyName(module.getKeycode())), module.getName()); + } + for (Module module : Raven.scriptManager.scripts.values()) { + if (module.getKeycode() == 0) { + continue; + } + if (keycode != 0 && module.getKeycode() != keycode) { + continue; + } + binds.put((module.getKeycode() >= 1000 ? "M" + (module.getKeycode() - 1000) : Keyboard.getKeyName(module.getKeycode())), module.getName()); + } + return binds; + } +} diff --git a/src/main/java/keystrokesmod/utility/command/impl/Cname.java b/src/main/java/keystrokesmod/utility/command/impl/Cname.java new file mode 100644 index 0000000..9c744c9 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/command/impl/Cname.java @@ -0,0 +1,21 @@ +package keystrokesmod.utility.command.impl; + +import keystrokesmod.module.impl.other.NameHider; +import keystrokesmod.utility.command.Command; + +public class Cname extends Command { + public Cname() { + super("cname"); + } + + @Override + public void onExecute(String[] args) { + if (args.length == 2) { + NameHider.fakeName = args[1]; + chat("&7[&fcname&7] &7Name has been set to &b" + NameHider.fakeName + "&7."); + } + else { + syntaxError(); + } + } +} diff --git a/src/main/java/keystrokesmod/utility/command/impl/Enemy.java b/src/main/java/keystrokesmod/utility/command/impl/Enemy.java new file mode 100644 index 0000000..a5bc87a --- /dev/null +++ b/src/main/java/keystrokesmod/utility/command/impl/Enemy.java @@ -0,0 +1,26 @@ +package keystrokesmod.utility.command.impl; + +import keystrokesmod.utility.Utils; +import keystrokesmod.utility.command.Command; + +public class Enemy extends Command { + public Enemy() { + super("Enemy"); + } + + private String ign; + + @Override + public void onExecute(String[] args) { + if (args.length == 2) { + ign = args[1]; + if (Utils.isEnemy(ign)) { + Utils.removeEnemy(ign); + } + else Utils.addEnemy(ign); + } + else { + syntaxError(); + } + } +} diff --git a/src/main/java/keystrokesmod/utility/command/impl/Friend.java b/src/main/java/keystrokesmod/utility/command/impl/Friend.java new file mode 100644 index 0000000..d9942f2 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/command/impl/Friend.java @@ -0,0 +1,26 @@ +package keystrokesmod.utility.command.impl; + +import keystrokesmod.utility.Utils; +import keystrokesmod.utility.command.Command; + +public class Friend extends Command { + public Friend() { + super("Friend"); + } + + private String ign; + + @Override + public void onExecute(String[] args) { + if (args.length == 2) { + ign = args[1]; + if (Utils.isFriended(ign)) { + Utils.removeFriend(ign); + } + else Utils.addFriend(ign); + } + else { + syntaxError(); + } + } +} diff --git a/src/main/java/keystrokesmod/utility/command/impl/Help.java b/src/main/java/keystrokesmod/utility/command/impl/Help.java new file mode 100644 index 0000000..617db9a --- /dev/null +++ b/src/main/java/keystrokesmod/utility/command/impl/Help.java @@ -0,0 +1,24 @@ +package keystrokesmod.utility.command.impl; + +import keystrokesmod.utility.command.Command; + +public class Help extends Command { + public Help() { + super("help"); + } + + @Override + public void onExecute(String[] args) { + chat("&7[&fhelp&7] Chat commands - &dGeneral"); + chat(" &b/(ign/name) &7Copy your username."); + chat(" &b/ping &7Estimate your ping."); + chat(" &b/q [gamemode] &7Queue a mode"); + chat(" &b/qlist &7List queueable modes"); + chat("&7---------------------------"); + chat("&7[&fhelp&7] Chat commands - &dModules"); + chat(" &b/cname [name] &7Set name hider name."); + chat(" &b/binds (key) &7List module binds."); + chat(" &b/friend [name] &7Add/Remove somebody as a friend"); + chat(" &b/enemy [name] &7Add/Remove somebody as a enemy"); + } +} diff --git a/src/main/java/keystrokesmod/utility/command/impl/Name.java b/src/main/java/keystrokesmod/utility/command/impl/Name.java new file mode 100644 index 0000000..f99b531 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/command/impl/Name.java @@ -0,0 +1,19 @@ +package keystrokesmod.utility.command.impl; + +import keystrokesmod.utility.Utils; +import keystrokesmod.utility.command.Command; + +public class Name extends Command { + public Name() { + super("name", new String[] { "ign", "name" }); + } + + @Override + public void onExecute(String[] args) { + if (!Utils.nullCheck()) { + return; + } + Utils.addToClipboard(mc.thePlayer.getName()); + chat("&7[&fname&7] Copied &b" + mc.thePlayer.getName() + " &7to clipboard"); + } +} diff --git a/src/main/java/keystrokesmod/utility/command/impl/Ping.java b/src/main/java/keystrokesmod/utility/command/impl/Ping.java new file mode 100644 index 0000000..b60ab96 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/command/impl/Ping.java @@ -0,0 +1,16 @@ +package keystrokesmod.utility.command.impl; + +import keystrokesmod.utility.command.Command; + +public class Ping extends Command { + public Ping() { + super("ping"); + } + + @Override + public void onExecute(String[] args) { + keystrokesmod.utility.Ping.checkPing(); + } + + +} diff --git a/src/main/java/keystrokesmod/utility/command/impl/Q.java b/src/main/java/keystrokesmod/utility/command/impl/Q.java new file mode 100644 index 0000000..f012bf1 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/command/impl/Q.java @@ -0,0 +1,60 @@ +package keystrokesmod.utility.command.impl; + +import keystrokesmod.utility.Utils; +import keystrokesmod.utility.command.Command; + +import java.util.HashMap; +import java.util.Map; + +public class Q extends Command { + public Q() { + super("Q"); + } + + @Override + public void onExecute(String[] args) { + if (args.length > 1) { + playCommand = hypixelPlayCommands.get(args[1].trim()); + if (playCommand != null) { + mc.thePlayer.sendChatMessage("/play " + playCommand); + } else { + Utils.print("&cQueue failed. Invalid gamemode."); + } + } + } + + Map hypixelPlayCommands = new HashMap<>(); + {hypixelPlayCommands.put("p", "bedwars_practice"); + hypixelPlayCommands.put("1", "bedwars_eight_one"); + hypixelPlayCommands.put("2", "bedwars_eight_two"); + hypixelPlayCommands.put("3", "bedwars_four_three"); + hypixelPlayCommands.put("4", "bedwars_four_four"); + hypixelPlayCommands.put("4v4", "bedwars_two_four"); + hypixelPlayCommands.put("2t", "bedwars_eight_two_tourney"); + hypixelPlayCommands.put("2un", "bedwars_eight_two_towerUnderworld"); + hypixelPlayCommands.put("4un", "bedwars_four_four_towerUnderworld"); + hypixelPlayCommands.put("2r", "bedwars_eight_two_rush"); + hypixelPlayCommands.put("4r", "bedwars_four_four_rush"); + hypixelPlayCommands.put("pit", "pit"); + hypixelPlayCommands.put("swsn", "solo_normal"); + hypixelPlayCommands.put("swsi", "solo_insane"); + hypixelPlayCommands.put("swtn", "teams_normal"); + hypixelPlayCommands.put("swti", "teams_insane"); + hypixelPlayCommands.put("bowd", "duels_bow_duel"); + hypixelPlayCommands.put("classicduel", "duels_classic_duel"); + hypixelPlayCommands.put("opduel", "duels_op_duel"); + hypixelPlayCommands.put("uhcduel", "duels_uhc_duel"); + hypixelPlayCommands.put("bridgeduel", "duels_bridge_duel"); + hypixelPlayCommands.put("uhc", "uhc_solo"); + hypixelPlayCommands.put("uhcteams", "uhc_teams"); + hypixelPlayCommands.put("grinch", "arcade_grinch_simulator_v2"); + hypixelPlayCommands.put("grinchtourney", "arcade_grinch_simulator_v2_tourney"); + hypixelPlayCommands.put("mm", "murder_classic"); + hypixelPlayCommands.put("castle", "bedwars_castle"); + // wool games + hypixelPlayCommands.put("ww", "wool_wool_wars_two_four"); + hypixelPlayCommands.put("ctw", "wool_capture_the_wool_two_twenty"); + } + String playCommand = "", gameMode = ""; + +} diff --git a/src/main/java/keystrokesmod/utility/command/impl/QList.java b/src/main/java/keystrokesmod/utility/command/impl/QList.java new file mode 100644 index 0000000..a2f5836 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/command/impl/QList.java @@ -0,0 +1,53 @@ +package keystrokesmod.utility.command.impl; + +import keystrokesmod.utility.Utils; +import keystrokesmod.utility.command.Command; + +import java.util.HashMap; +import java.util.Map; + +public class QList extends Command { + public QList() { + super("QList"); + } + + @Override + public void onExecute(String[] args) { + Utils.print("Hi"); + } + + Map hypixelPlayCommands = new HashMap<>(); + {hypixelPlayCommands.put("p", "bedwars_practice"); + hypixelPlayCommands.put("1", "bedwars_eight_one"); + hypixelPlayCommands.put("2", "bedwars_eight_two"); + hypixelPlayCommands.put("3", "bedwars_four_three"); + hypixelPlayCommands.put("4", "bedwars_four_four"); + hypixelPlayCommands.put("4v4", "bedwars_two_four"); + hypixelPlayCommands.put("2t", "bedwars_eight_two_tourney"); + hypixelPlayCommands.put("2un", "bedwars_eight_two_towerUnderworld"); + hypixelPlayCommands.put("4un", "bedwars_four_four_towerUnderworld"); + hypixelPlayCommands.put("2r", "bedwars_eight_two_rush"); + hypixelPlayCommands.put("4r", "bedwars_four_four_rush"); + hypixelPlayCommands.put("pit", "pit"); + hypixelPlayCommands.put("swsn", "solo_normal"); + hypixelPlayCommands.put("swsi", "solo_insane"); + hypixelPlayCommands.put("swtn", "teams_normal"); + hypixelPlayCommands.put("swti", "teams_insane"); + hypixelPlayCommands.put("bowd", "duels_bow_duel"); + hypixelPlayCommands.put("classicduel", "duels_classic_duel"); + hypixelPlayCommands.put("opduel", "duels_op_duel"); + hypixelPlayCommands.put("uhcduel", "duels_uhc_duel"); + hypixelPlayCommands.put("bridgeduel", "duels_bridge_duel"); + hypixelPlayCommands.put("uhc", "uhc_solo"); + hypixelPlayCommands.put("uhcteams", "uhc_teams"); + hypixelPlayCommands.put("grinch", "arcade_grinch_simulator_v2"); + hypixelPlayCommands.put("grinchtourney", "arcade_grinch_simulator_v2_tourney"); + hypixelPlayCommands.put("mm", "murder_classic"); + hypixelPlayCommands.put("castle", "bedwars_castle"); + // wool games + hypixelPlayCommands.put("ww", "wool_wool_wars_two_four"); + hypixelPlayCommands.put("ctw", "wool_capture_the_wool_two_twenty"); + } + String playCommand = "", gameMode = ""; + +} diff --git a/src/main/java/keystrokesmod/utility/profile/Manager.java b/src/main/java/keystrokesmod/utility/profile/Manager.java new file mode 100644 index 0000000..6429faa --- /dev/null +++ b/src/main/java/keystrokesmod/utility/profile/Manager.java @@ -0,0 +1,48 @@ +package keystrokesmod.utility.profile; + +import keystrokesmod.Raven; +import keystrokesmod.module.Module; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.utility.Utils; + +import java.awt.*; +import java.io.IOException; + +public class Manager extends Module { + private ButtonSetting loadProfiles, openFolder, createProfile; + + public Manager() { + super("Manager", category.profiles); + this.registerSetting(createProfile = new ButtonSetting("Create profile", () -> { + if (Utils.nullCheck() && Raven.profileManager != null) { + String name = "profile-"; + for (int i = 1; i <= 100; i++) { + if (Raven.profileManager.getProfile(name + i) != null) { + continue; + } + name += i; + Raven.profileManager.saveProfile(new Profile(name, 0)); + Utils.sendMessage("&7Created profile: &b" + name); + Raven.profileManager.loadProfiles(); + break; + } + } + })); + this.registerSetting(loadProfiles = new ButtonSetting("Load profiles", () -> { + if (Utils.nullCheck() && Raven.profileManager != null) { + Raven.profileManager.loadProfiles(); + } + })); + this.registerSetting(openFolder = new ButtonSetting("Open folder", () -> { + try { + Desktop.getDesktop().open(Raven.profileManager.directory); + } + catch (IOException ex) { + Raven.profileManager.directory.mkdirs(); + Utils.sendMessage("&cError locating folder, recreated."); + } + })); + ignoreOnSave = true; + canBeEnabled = false; + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/utility/profile/Profile.java b/src/main/java/keystrokesmod/utility/profile/Profile.java new file mode 100644 index 0000000..83533cc --- /dev/null +++ b/src/main/java/keystrokesmod/utility/profile/Profile.java @@ -0,0 +1,28 @@ +package keystrokesmod.utility.profile; + +import keystrokesmod.module.Module; + +public class Profile { + private Module module; + private int bind = 0; + private String profileName; + + public Profile(String profileName, int bind) { + this.profileName = profileName; + this.bind = bind; + this.module = new ProfileModule(this, profileName, bind); + this.module.ignoreOnSave = true; + } + + public Module getModule() { + return module; + } + + public int getBind() { + return bind; + } + + public String getName() { + return profileName; + } +} diff --git a/src/main/java/keystrokesmod/utility/profile/ProfileManager.java b/src/main/java/keystrokesmod/utility/profile/ProfileManager.java new file mode 100644 index 0000000..84e79c7 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/profile/ProfileManager.java @@ -0,0 +1,311 @@ +package keystrokesmod.utility.profile; + +import com.google.gson.*; +import keystrokesmod.Raven; +import keystrokesmod.clickgui.components.impl.CategoryComponent; +import keystrokesmod.module.Module; +import keystrokesmod.module.ModuleManager; +import keystrokesmod.module.impl.movement.Sprint; +import keystrokesmod.module.impl.render.HUD; +import keystrokesmod.module.impl.render.TargetHUD; +import keystrokesmod.module.setting.Setting; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.module.setting.impl.SliderSetting; +import keystrokesmod.script.Manager; +import keystrokesmod.utility.Utils; +import net.minecraft.client.Minecraft; + +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +public class ProfileManager { + public static Minecraft mc = Minecraft.getMinecraft(); + public File directory; + public List profiles = new ArrayList<>(); + + public ProfileManager() { + directory = new File(mc.mcDataDir + File.separator + "keystrokes", "profiles"); + if (!directory.exists()) { + boolean success = directory.mkdirs(); + if (!success) { + System.out.println("There was an issue creating profiles directory."); + return; + } + } + if (directory.listFiles().length == 0) { // if theres no profile in the folder upon launch, create new default profile + saveProfile(new Profile("default", 0)); + } + } + + public void saveProfile(Profile profile) { + JsonObject jsonObject = new JsonObject(); + jsonObject.addProperty("keybind", profile.getModule().getKeycode()); + JsonArray jsonArray = new JsonArray(); + for (Module module : Raven.moduleManager.getModules()) { + if (module.ignoreOnSave) { + continue; + } + JsonObject moduleInformation = getJsonObject(module); + jsonArray.add(moduleInformation); + } + if (Raven.scriptManager != null && Raven.scriptManager.scripts != null) { + for (Module module : Raven.scriptManager.scripts.values()) { + if (module.ignoreOnSave) { + continue; + } + JsonObject moduleInformation = getJsonObject(module); + jsonArray.add(moduleInformation); + } + } + jsonObject.add("modules", jsonArray); + try (FileWriter fileWriter = new FileWriter(new File(directory, profile.getName() + ".json"))) { + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + gson.toJson(jsonObject, fileWriter); + } catch (Exception e) { + failedMessage("save", profile.getName()); + e.printStackTrace(); + } + } + + private static JsonObject getJsonObject(Module module) { + JsonObject moduleInformation = new JsonObject(); + moduleInformation.addProperty("name", (module.moduleCategory() == Module.category.scripts && !(module instanceof Manager)) ? "sc-" + module.getName() : module.getName()); + if (module.canBeEnabled) { + moduleInformation.addProperty("enabled", module.isEnabled()); + moduleInformation.addProperty("hidden", module.isHidden()); + moduleInformation.addProperty("keybind", module.getKeycode()); + } + if (module instanceof HUD) { + moduleInformation.addProperty("posX", HUD.posX); + moduleInformation.addProperty("posY", HUD.posY); + } + else if (module instanceof TargetHUD) { + moduleInformation.addProperty("posX", ModuleManager.targetHUD.posX); + moduleInformation.addProperty("posY", ModuleManager.targetHUD.posY); + } + else if (module instanceof Sprint) { + moduleInformation.addProperty("posX", ModuleManager.sprint.posX); + moduleInformation.addProperty("posY", ModuleManager.sprint.posY); + moduleInformation.addProperty("text", ModuleManager.sprint.text); + } + for (Setting setting : module.getSettings()) { + if (setting instanceof ButtonSetting && !((ButtonSetting) setting).isMethodButton) { + moduleInformation.addProperty(setting.getName(), ((ButtonSetting) setting).isToggled()); + } else if (setting instanceof SliderSetting) { + moduleInformation.addProperty(setting.getName(), ((SliderSetting) setting).getInput()); + } + } + return moduleInformation; + } + + public void loadProfile(String name) { + for (File file : getProfileFiles()) { + if (!file.exists()) { + failedMessage("load", name); + System.out.println("Failed to load " + name); + return; + } + if (!file.getName().equals(name + ".json")) { + continue; + } + if (Raven.scriptManager != null) { + for (Module module : Raven.scriptManager.scripts.values()) { + if (module.canBeEnabled()) { + module.disable(); + module.setBind(0); + } + } + } + for (Module module : Raven.getModuleManager().getModules()) { + if (module.canBeEnabled()) { + module.disable(); + module.setBind(0); + } + } + try (FileReader fileReader = new FileReader(file)) { + JsonParser jsonParser = new JsonParser(); + JsonObject profileJson = jsonParser.parse(fileReader).getAsJsonObject(); + if (profileJson == null) { + failedMessage("load", name); + return; + } + JsonArray modules = profileJson.getAsJsonArray("modules"); + if (modules == null) { + failedMessage("load", name); + return; + } + for (JsonElement moduleJson : modules) { + JsonObject moduleInformation = moduleJson.getAsJsonObject(); + String moduleName = moduleInformation.get("name").getAsString(); + + if (moduleName == null || moduleName.isEmpty()) { + continue; + } + + Module module = Raven.moduleManager.getModule(moduleName); + if (module == null && moduleName.startsWith("sc-") && Raven.scriptManager != null) { + for (Module module1 : Raven.scriptManager.scripts.values()) { + if (module1.getName().equals(moduleName.substring(3))) { + module = module1; + } + } + } + + if (module == null) { + continue; + } + + if (module.canBeEnabled()) { + if (moduleInformation.has("enabled")) { + boolean enabled = moduleInformation.get("enabled").getAsBoolean(); + if (enabled) { + module.enable(); + } else { + module.disable(); + } + } + if (moduleInformation.has("hidden")) { + boolean hidden = moduleInformation.get("hidden").getAsBoolean(); + module.setHidden(hidden); + } + if (moduleInformation.has("keybind")) { + int keybind = moduleInformation.get("keybind").getAsInt(); + module.setBind(keybind); + } + } + + if (module.getName().equals("HUD")) { + if (moduleInformation.has("posX")) { + int hudX = moduleInformation.get("posX").getAsInt(); + HUD.posX = hudX; + } + if (moduleInformation.has("posY")) { + int hudY = moduleInformation.get("posY").getAsInt(); + HUD.posY = hudY; + } + } + else if (module.getName().equals("TargetHUD")) { + if (moduleInformation.has("posX")) { + int posX = moduleInformation.get("posX").getAsInt(); + ModuleManager.targetHUD.posX = posX; + } + if (moduleInformation.has("posY")) { + int posY = moduleInformation.get("posY").getAsInt(); + ModuleManager.targetHUD.posY = posY; + } + } + else if (module.getName().equals("Sprint")) { + if (moduleInformation.has("posX")) { + float posX = moduleInformation.get("posX").getAsFloat(); + ModuleManager.sprint.posX = posX; + } + if (moduleInformation.has("posY")) { + float posY = moduleInformation.get("posY").getAsFloat(); + ModuleManager.sprint.posY = posY; + } + if (moduleInformation.has("text")) { + String text = moduleInformation.get("text").getAsString(); + ModuleManager.sprint.text = text; + } + } + + for (Setting setting : module.getSettings()) { + setting.loadProfile(moduleInformation); + } + + Raven.currentProfile = getProfile(name); + } + } catch (Exception e) { + failedMessage("load", name); + e.printStackTrace(); + } + } + } + + public void deleteProfile(String name) { + Iterator iterator = profiles.iterator(); + while (iterator.hasNext()) { + Profile profile = iterator.next(); + if (profile.getName().equals(name)) { + iterator.remove(); + } + } + if (directory.exists()) { + File[] files = directory.listFiles(); + for (File file : files) { + if (file.getName().equals(name + ".json")) { + file.delete(); + } + } + } + } + + public void loadProfiles() { + profiles.clear(); + if (directory.exists()) { + File[] files = directory.listFiles(); + for (File file : files) { + try (FileReader fileReader = new FileReader(file)) { + JsonParser jsonParser = new JsonParser(); + JsonObject profileJson = jsonParser.parse(fileReader).getAsJsonObject(); + String profileName = file.getName().replace(".json", ""); + + if (profileJson == null) { + failedMessage("load", profileName); + return; + } + + int keybind = 0; + + if (profileJson.has("keybind")) { + keybind = profileJson.get("keybind").getAsInt(); + } + + Profile profile = new Profile(profileName, keybind); + profiles.add(profile); + } catch (Exception e) { + Utils.sendMessage("&cFailed to load profiles."); + e.printStackTrace(); + } + } + + for (CategoryComponent categoryComponent : Raven.clickGui.categories) { + if (categoryComponent.categoryName == Module.category.profiles) { + categoryComponent.reloadModules(true); + } + } + Utils.sendMessage("&b" + Raven.profileManager.getProfileFiles().size() + " &7profiles loaded."); + } + } + + public List getProfileFiles() { + List profileFiles = new ArrayList<>(); + if (directory.exists()) { + File[] files = directory.listFiles(); + for (File file : files) { + if (!file.getName().endsWith(".json")) { + continue; + } + profileFiles.add(file); + } + } + return profileFiles; + } + + public Profile getProfile(String name) { + for (Profile profile : profiles) { + if (profile.getName().equals(name)) { + return profile; + } + } + return null; + } + + public void failedMessage(String reason, String name) { + Utils.sendMessage("&cFailed to " + reason + ": &b" + name); + } +} diff --git a/src/main/java/keystrokesmod/utility/profile/ProfileModule.java b/src/main/java/keystrokesmod/utility/profile/ProfileModule.java new file mode 100644 index 0000000..d812221 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/profile/ProfileModule.java @@ -0,0 +1,52 @@ +package keystrokesmod.utility.profile; + +import keystrokesmod.Raven; +import keystrokesmod.clickgui.ClickGui; +import keystrokesmod.module.Module; +import keystrokesmod.module.impl.client.Settings; +import keystrokesmod.module.setting.impl.ButtonSetting; +import keystrokesmod.utility.Utils; + +public class ProfileModule extends Module { + private Profile profile; + public boolean saved = true; + + public ProfileModule(Profile profile, String name, int bind) { + super(name, category.profiles, bind); + this.profile = profile; + this.registerSetting(new ButtonSetting("Save profile", () -> { + Utils.sendMessage("&7Saved profile: &b" + getName()); + Raven.profileManager.saveProfile(this.profile); + saved = true; + })); + this.registerSetting(new ButtonSetting("Remove profile", () -> { + Utils.sendMessage("&7Removed profile: &b" + getName()); + Raven.profileManager.deleteProfile(getName()); + })); + } + + @Override + public void toggle() { + if (mc.currentScreen instanceof ClickGui || mc.currentScreen == null) { + if (this.profile == Raven.currentProfile && saved) { + return; + } + Raven.profileManager.loadProfile(this.getName()); + + Raven.currentProfile = profile; + + if (Settings.sendMessage.isToggled()) { + Utils.sendMessage("&7Enabled profile: &b" + this.getName()); + } + saved = true; + } + } + + @Override + public boolean isEnabled() { + if (Raven.currentProfile == null) { + return false; + } + return Raven.currentProfile.getModule() == this; + } +} diff --git a/src/main/java/keystrokesmod/utility/shader/BlurUtils.java b/src/main/java/keystrokesmod/utility/shader/BlurUtils.java new file mode 100644 index 0000000..85a3d00 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/shader/BlurUtils.java @@ -0,0 +1,29 @@ +package keystrokesmod.utility.shader; + +import keystrokesmod.utility.RenderUtils; +import net.minecraft.client.shader.Framebuffer; + +public class BlurUtils { + private static Framebuffer stencilFrameBufferBlur = new Framebuffer(1, 1, false); + private static Framebuffer stencilFrameBufferBloom = new Framebuffer(1, 1, false); + public static void prepareBlur() { + stencilFrameBufferBlur = RenderUtils.createFrameBuffer(stencilFrameBufferBlur); + stencilFrameBufferBlur.framebufferClear(); + stencilFrameBufferBlur.bindFramebuffer(false); + } + public static void prepareBloom() { + stencilFrameBufferBloom = RenderUtils.createFrameBuffer(stencilFrameBufferBloom); + stencilFrameBufferBloom.framebufferClear(); + stencilFrameBufferBloom.bindFramebuffer(false); + } + + public static void blurEnd(int passes, float radius) { + stencilFrameBufferBlur.unbindFramebuffer(); + KawaseBlur.renderBlur(stencilFrameBufferBlur.framebufferTexture, passes, radius); + } + + public static void bloomEnd(int passes, float radius) { + stencilFrameBufferBloom.unbindFramebuffer(); + KawaseBloom.renderBlur(stencilFrameBufferBloom.framebufferTexture, passes, radius); + } +} \ No newline at end of file diff --git a/src/main/java/keystrokesmod/utility/shader/KawaseBloom.java b/src/main/java/keystrokesmod/utility/shader/KawaseBloom.java new file mode 100644 index 0000000..1751ddf --- /dev/null +++ b/src/main/java/keystrokesmod/utility/shader/KawaseBloom.java @@ -0,0 +1,118 @@ +package keystrokesmod.utility.shader; + +import keystrokesmod.utility.RenderUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.shader.Framebuffer; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL13; +import org.lwjgl.opengl.GL14; + +import java.util.ArrayList; +import java.util.List; + +import static org.lwjgl.opengl.GL11.*; + +public class KawaseBloom { + private static final Minecraft mc = Minecraft.getMinecraft(); + public static ShaderUtils kawaseDown = new ShaderUtils("kawaseDownBloom"); + public static ShaderUtils kawaseUp = new ShaderUtils("kawaseUpBloom"); + public static Framebuffer framebuffer = new Framebuffer(1, 1, false); + private static int currentIterations; + + private static final List framebufferList = new ArrayList<>(); + + private static void initFramebuffers(float iterations) { + for (Framebuffer framebuffer : framebufferList) { + framebuffer.deleteFramebuffer(); + } + framebufferList.clear(); + + framebufferList.add(framebuffer = RenderUtils.createFrameBuffer(null, false)); + + for (int i = 1; i <= iterations; i++) { + Framebuffer currentBuffer = new Framebuffer((int) (mc.displayWidth / Math.pow(2, i)), (int) (mc.displayHeight / Math.pow(2, i)), false); + currentBuffer.setFramebufferFilter(GL_LINEAR); + + GlStateManager.bindTexture(currentBuffer.framebufferTexture); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL14.GL_MIRRORED_REPEAT); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL14.GL_MIRRORED_REPEAT); + GlStateManager.bindTexture(0); + + framebufferList.add(currentBuffer); + } + } + + + public static void renderBlur(int framebufferTexture, int iterations, float offset) { + if (currentIterations != iterations || (framebuffer.framebufferWidth != mc.displayWidth || framebuffer.framebufferHeight != mc.displayHeight)) { + initFramebuffers(iterations); + currentIterations = iterations; + } + + RenderUtils.setAlphaLimit(0); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL_ONE, GL_ONE); + + GL11.glClearColor(0, 0, 0, 0); + + float currentOffset = offset; + renderFBO(framebufferList.get(1), framebufferTexture, kawaseDown, currentOffset); + + for (int i = 1; i < iterations; i++) { + currentOffset = offset / (float) Math.pow(1.5, i); + renderFBO(framebufferList.get(i + 1), framebufferList.get(i).framebufferTexture, kawaseDown, currentOffset); + } + + for (int i = iterations; i > 1; i--) { + currentOffset = offset / (float) Math.pow(1.5, i - 1); + renderFBO(framebufferList.get(i - 1), framebufferList.get(i).framebufferTexture, kawaseUp, currentOffset); + } + + Framebuffer lastBuffer = framebufferList.get(0); + lastBuffer.framebufferClear(); + lastBuffer.bindFramebuffer(false); + kawaseUp.init(); + kawaseUp.setUniformf("offset", offset, offset); + kawaseUp.setUniformi("inTexture", 0); + kawaseUp.setUniformi("check", 1); + kawaseUp.setUniformi("textureToCheck", 16); + kawaseUp.setUniformf("halfpixel", 1.0f / lastBuffer.framebufferWidth, 1.0f / lastBuffer.framebufferHeight); + kawaseUp.setUniformf("iResolution", lastBuffer.framebufferWidth, lastBuffer.framebufferHeight); + GlStateManager.setActiveTexture(GL13.GL_TEXTURE16); + RenderUtils.bindTexture(framebufferTexture); + GlStateManager.setActiveTexture(GL13.GL_TEXTURE0); + RenderUtils.bindTexture(framebufferList.get(1).framebufferTexture); + ShaderUtils.drawQuads(); + kawaseUp.unload(); + + + GlStateManager.clearColor(0, 0, 0, 0); + mc.getFramebuffer().bindFramebuffer(false); + RenderUtils.bindTexture(framebufferList.get(0).framebufferTexture); + RenderUtils.setAlphaLimit(0); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + ShaderUtils.drawQuads(); + GlStateManager.bindTexture(0); + RenderUtils.setAlphaLimit(0); + + // start blend + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } + + private static void renderFBO(Framebuffer framebuffer, int framebufferTexture, ShaderUtils shader, float offset) { + framebuffer.framebufferClear(); + framebuffer.bindFramebuffer(false); + shader.init(); + RenderUtils.bindTexture(framebufferTexture); + shader.setUniformf("offset", offset, offset); + shader.setUniformi("inTexture", 0); + shader.setUniformi("check", 0); + shader.setUniformf("halfpixel", 1.0f / framebuffer.framebufferWidth, 1.0f / framebuffer.framebufferHeight); + shader.setUniformf("iResolution", framebuffer.framebufferWidth, framebuffer.framebufferHeight); + ShaderUtils.drawQuads(); + shader.unload(); + } +} diff --git a/src/main/java/keystrokesmod/utility/shader/KawaseBlur.java b/src/main/java/keystrokesmod/utility/shader/KawaseBlur.java new file mode 100644 index 0000000..2823084 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/shader/KawaseBlur.java @@ -0,0 +1,103 @@ +package keystrokesmod.utility.shader; + +import keystrokesmod.utility.RenderUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.shader.Framebuffer; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL13; +import org.lwjgl.opengl.GL14; + +import java.util.ArrayList; +import java.util.List; + +import static org.lwjgl.opengl.GL11.*; + +public class KawaseBlur { + private static final Minecraft mc = Minecraft.getMinecraft(); + public static ShaderUtils kawaseDown = new ShaderUtils("kawaseDown"); + public static ShaderUtils kawaseUp = new ShaderUtils("kawaseUp"); + public static Framebuffer framebuffer = new Framebuffer(1, 1, false); + private static int currentIterations; + + private static final List framebufferList = new ArrayList<>(); + + private static void initFrameBuffers(float iterations) { + for (Framebuffer framebuffer : framebufferList) { + framebuffer.deleteFramebuffer(); + } + framebufferList.clear(); + + framebufferList.add(framebuffer = RenderUtils.createFrameBuffer(null)); + + for (int i = 1; i <= iterations; i++) { + Framebuffer currentBuffer = new Framebuffer((int) (mc.displayWidth / Math.pow(3, i)), (int) (mc.displayHeight / Math.pow(3, i)), false); + currentBuffer.setFramebufferFilter(GL_LINEAR); + GlStateManager.bindTexture(currentBuffer.framebufferTexture); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL14.GL_MIRRORED_REPEAT); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL14.GL_MIRRORED_REPEAT); + GlStateManager.bindTexture(0); + + framebufferList.add(currentBuffer); + } + } + + public static void renderBlur(int stencilFrameBufferTexture, int iterations, float offset) { + if (currentIterations != iterations || framebuffer.framebufferWidth != mc.displayWidth || framebuffer.framebufferHeight != mc.displayHeight) { + initFrameBuffers(iterations); + currentIterations = iterations; + } + + renderFBO(framebufferList.get(1), mc.getFramebuffer().framebufferTexture, kawaseDown, offset); + + for (int i = 1; i < iterations; i++) { + renderFBO(framebufferList.get(i + 1), framebufferList.get(i).framebufferTexture, kawaseDown, offset); + } + + for (int i = iterations; i > 1; i--) { + renderFBO(framebufferList.get(i - 1), framebufferList.get(i).framebufferTexture, kawaseUp, offset); + } + + + Framebuffer lastBuffer = framebufferList.get(0); + lastBuffer.framebufferClear(); + lastBuffer.bindFramebuffer(false); + + kawaseUp.init(); + kawaseUp.setUniformf("offset", offset, offset); + kawaseUp.setUniformi("inTexture", 0); + kawaseUp.setUniformi("check", 1); + kawaseUp.setUniformi("textureToCheck", 16); + kawaseUp.setUniformf("halfpixel", 1.0f / lastBuffer.framebufferWidth, 1.0f / lastBuffer.framebufferHeight); + kawaseUp.setUniformf("iResolution", lastBuffer.framebufferWidth, lastBuffer.framebufferHeight); + GL13.glActiveTexture(GL13.GL_TEXTURE16); + RenderUtils.bindTexture(stencilFrameBufferTexture); + GL13.glActiveTexture(GL13.GL_TEXTURE0); + RenderUtils.bindTexture(framebufferList.get(1).framebufferTexture); + ShaderUtils.drawQuads(); + kawaseUp.unload(); + + mc.getFramebuffer().bindFramebuffer(true); + RenderUtils.bindTexture(framebufferList.get(0).framebufferTexture); + RenderUtils.setAlphaLimit(0); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + ShaderUtils.drawQuads(); + GlStateManager.bindTexture(0); + GlStateManager.disableBlend(); + } + + private static void renderFBO(Framebuffer framebuffer, int framebufferTexture, ShaderUtils shader, float offset) { + framebuffer.framebufferClear(); + framebuffer.bindFramebuffer(false); + shader.init(); + RenderUtils.bindTexture(framebufferTexture); + shader.setUniformf("offset", offset, offset); + shader.setUniformi("inTexture", 0); + shader.setUniformi("check", 0); + shader.setUniformf("halfpixel", 1.0f / framebuffer.framebufferWidth, 1.0f / framebuffer.framebufferHeight); + shader.setUniformf("iResolution", framebuffer.framebufferWidth, framebuffer.framebufferHeight); + ShaderUtils.drawQuads(); + shader.unload(); + } +} diff --git a/src/main/java/keystrokesmod/utility/shader/RoundedUtils.java b/src/main/java/keystrokesmod/utility/shader/RoundedUtils.java new file mode 100644 index 0000000..0646be9 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/shader/RoundedUtils.java @@ -0,0 +1,192 @@ +package keystrokesmod.utility.shader; + +import keystrokesmod.utility.RenderUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; +import org.lwjgl.opengl.GL20; + +import java.awt.*; + +import static org.lwjgl.opengl.GL11.*; + +public class RoundedUtils { + public static ShaderUtils roundedShader = new ShaderUtils("roundedRect"); + public static ShaderUtils roundedOutlineShader = new ShaderUtils("roundRectOutline"); + private static final ShaderUtils roundedTexturedShader = new ShaderUtils("roundRectTexture"); + private static final ShaderUtils roundedGradientShader = new ShaderUtils("roundedRectGradient"); + private static final ShaderUtils roundedRectRiseShader = new ShaderUtils("roundedRectRise"); + + + public static void drawRound(float x, float y, float width, float height, float radius, Color color) { + drawRound(x, y, width, height, radius, false, color); + } + + public static void drawGradientHorizontal(float x, float y, float width, float height, float radius, Color left, Color right) { + drawGradientRound(x, y, width, height, radius, left, left, right, right); + } + + public static void drawGradientVertical(float x, float y, float width, float height, float radius, Color top, Color bottom) { + drawGradientRound(x, y, width, height, radius, bottom, top, bottom, top); + } + + public static void drawGradientCornerLR(float x, float y, float width, float height, float radius, Color topLeft, Color bottomRight) { + Color mixedColor = RenderUtils.interpolateColorC(topLeft, bottomRight, .5f); + drawGradientRound(x, y, width, height, radius, mixedColor, topLeft, bottomRight, mixedColor); + } + + public static void drawGradientCornerRL(float x, float y, float width, float height, float radius, Color bottomLeft, Color topRight) { + Color mixedColor = RenderUtils.interpolateColorC(topRight, bottomLeft, .5f); + drawGradientRound(x, y, width, height, radius, bottomLeft, mixedColor, mixedColor, topRight); + } + + public static void drawRound(float x, float y, float width, float height, float radius, int color) { + drawRound(x, y, width, height, radius, false, color); + } + + public static void drawRound(float x, float y, float width, float height, float radius, boolean blur, int color) { + RenderUtils.resetColor(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + RenderUtils.setAlphaLimit(0); + + roundedShader.init(); + setupRoundedRectUniforms(x, y, width, height, radius, roundedShader); + roundedShader.setUniformi("blur", blur ? 1 : 0); + roundedShader.setUniformf("color", getRed(color), getGreen(color), getBlue(color), getAlpha(color)); + + ShaderUtils.drawQuads(x - 1, y - 1, width + 2, height + 2); + roundedShader.unload(); + GlStateManager.disableBlend(); + } + + public static void drawGradientRound(float x, float y, float width, float height, float radius, Color bottomLeft, Color topLeft, Color bottomRight, Color topRight) { + RenderUtils.setAlphaLimit(0); + RenderUtils.resetColor(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + roundedGradientShader.init(); + setupRoundedRectUniforms(x, y, width, height, radius, roundedGradientShader); + roundedGradientShader.setUniformf("color1", topLeft.getRed() / 255f, topLeft.getGreen() / 255f, topLeft.getBlue() / 255f, topLeft.getAlpha() / 255f); + roundedGradientShader.setUniformf("color2", bottomLeft.getRed() / 255f, bottomLeft.getGreen() / 255f, bottomLeft.getBlue() / 255f, bottomLeft.getAlpha() / 255f); + roundedGradientShader.setUniformf("color3", topRight.getRed() / 255f, topRight.getGreen() / 255f, topRight.getBlue() / 255f, topRight.getAlpha() / 255f); + roundedGradientShader.setUniformf("color4", bottomRight.getRed() / 255f, bottomRight.getGreen() / 255f, bottomRight.getBlue() / 255f, bottomRight.getAlpha() / 255f); + ShaderUtils.drawQuads(x - 1, y - 1, width + 2, height + 2); + roundedGradientShader.unload(); + GlStateManager.disableBlend(); + } + + public static void drawGradientRound(float x, float y, float width, float height, float radius, int bottomLeft, int topLeft, int bottomRight, int topRight) { + RenderUtils.setAlphaLimit(0); + RenderUtils.resetColor(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + roundedGradientShader.init(); + setupRoundedRectUniforms(x, y, width, height, radius, roundedGradientShader); + + roundedGradientShader.setUniformf("color1", getRed(topLeft), getGreen(topLeft), getBlue(topLeft), getAlpha(topLeft)); + roundedGradientShader.setUniformf("color2", getRed(bottomLeft), getGreen(bottomLeft), getBlue(bottomLeft), getAlpha(bottomLeft)); + roundedGradientShader.setUniformf("color3", getRed(topRight), getGreen(topRight), getBlue(topRight), getAlpha(topRight)); + roundedGradientShader.setUniformf("color4", getRed(bottomRight), getGreen(bottomRight), getBlue(bottomRight), getAlpha(bottomRight)); + + ShaderUtils.drawQuads(x - 1, y - 1, width + 2, height + 2); + roundedGradientShader.unload(); + GlStateManager.disableBlend(); + } + + public static void drawRound(float x, float y, float width, float height, float radius, boolean blur, Color color) { + RenderUtils.resetColor(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + RenderUtils.setAlphaLimit(0); + roundedShader.init(); + + setupRoundedRectUniforms(x, y, width, height, radius, roundedShader); + roundedShader.setUniformi("blur", blur ? 1 : 0); + roundedShader.setUniformf("color", color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, color.getAlpha() / 255f); + + ShaderUtils.drawQuads(x - 1, y - 1, width + 2, height + 2); + roundedShader.unload(); + GlStateManager.disableBlend(); + } + + + public static void drawRoundOutline(float x, float y, float width, float height, float radius, float outlineThickness, Color color, Color outlineColor) { + RenderUtils.resetColor(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + RenderUtils.setAlphaLimit(0); + roundedOutlineShader.init(); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + setupRoundedRectUniforms(x, y, width, height, radius, roundedOutlineShader); + roundedOutlineShader.setUniformf("outlineThickness", outlineThickness * sr.getScaleFactor()); + roundedOutlineShader.setUniformf("color", color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, color.getAlpha() / 255f); + roundedOutlineShader.setUniformf("outlineColor", outlineColor.getRed() / 255f, outlineColor.getGreen() / 255f, outlineColor.getBlue() / 255f, outlineColor.getAlpha() / 255f); + + + ShaderUtils.drawQuads(x - (2 + outlineThickness), y - (2 + outlineThickness), width + (4 + outlineThickness * 2), height + (4 + outlineThickness * 2)); + roundedOutlineShader.unload(); + GlStateManager.disableBlend(); + } + + + public static void drawRoundTextured(float x, float y, float width, float height, float radius, float alpha) { + RenderUtils.resetColor(); + RenderUtils.setAlphaLimit(0); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + roundedTexturedShader.init(); + roundedTexturedShader.setUniformi("textureIn", 0); + setupRoundedRectUniforms(x, y, width, height, radius, roundedTexturedShader); + roundedTexturedShader.setUniformf("alpha", alpha); + ShaderUtils.drawQuads(x - 1, y - 1, width + 2, height + 2); + roundedTexturedShader.unload(); + GlStateManager.disableBlend(); + } + + private static void setupRoundedRectUniforms(float x, float y, float width, float height, float radius, ShaderUtils roundedTexturedShader) { + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + roundedTexturedShader.setUniformf("location", x * sr.getScaleFactor(), + (Minecraft.getMinecraft().displayHeight - (height * sr.getScaleFactor())) - (y * sr.getScaleFactor())); + roundedTexturedShader.setUniformf("rectSize", width * sr.getScaleFactor(), height * sr.getScaleFactor()); + roundedTexturedShader.setUniformf("radius", radius * sr.getScaleFactor()); + } + + public static void drawRoundedRectRise(final float x, final float y, final float width, final float height, final float radius, final int color, boolean leftTop, boolean rightTop, boolean rightBottom, boolean leftBottom) { + final int programId = roundedRectRiseShader.programID; + GL20.glUseProgram(programId); + roundedRectRiseShader.setUniformf("u_size", width, height); + roundedRectRiseShader.setUniformf("u_radius", radius); + roundedRectRiseShader.setUniformf("u_color", getRed(color), getGreen(color), getBlue(color), getAlpha(color)); + roundedRectRiseShader.setUniformf("u_edges", leftTop ? 1.0F : 0.0F, rightTop ? 1.0F : 0.0F, rightBottom ? 1.0F : 0.0F, leftBottom ? 1.0F : 0.0F); + GlStateManager.enableBlend(); + ShaderUtils.drawQuads(x, y, width, height); + GlStateManager.disableBlend(); + GL20.glUseProgram(0); + } + + public static void drawRoundedRectRise(final double x, final double y, final double width, final double height, final double radius, final int color) { + drawRoundedRectRise((float) x, (float) y, (float) width, (float) height, (float) radius, color, true, true, true, true); + } + + private static float getRed(int color) { + return (color >> 16 & 0xFF) / 255.0F; + } + + private static float getGreen(int color) { + return (color >> 8 & 0xFF) / 255.0F; + } + + private static float getBlue(int color) { + return (color & 0xFF) / 255.0F; + } + + private static float getAlpha(int color) { + return (color >> 24 & 0xFF) / 255.0F; + } +} diff --git a/src/main/java/keystrokesmod/utility/shader/ShaderUtils.java b/src/main/java/keystrokesmod/utility/shader/ShaderUtils.java new file mode 100644 index 0000000..acb0f75 --- /dev/null +++ b/src/main/java/keystrokesmod/utility/shader/ShaderUtils.java @@ -0,0 +1,495 @@ +package keystrokesmod.utility.shader; + +import keystrokesmod.utility.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL20; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; + +import static org.lwjgl.opengl.GL11.*; +import static org.lwjgl.opengl.GL20.*; + +public class ShaderUtils { + + private Minecraft mc = Minecraft.getMinecraft(); + public final int programID; + private final String kawaseUpGlow = "#version 120\n" + + "\n" + + "uniform sampler2D inTexture, textureToCheck;\n" + + "uniform vec2 halfpixel, offset, iResolution;\n" + + "uniform bool check;\n" + + "uniform float lastPass;\n" + + "uniform float exposure;\n" + + "\n" + + "void main() {\n" + + " if(check && texture2D(textureToCheck, gl_TexCoord[0].st).a != 0.0) discard;\n" + + " vec2 uv = vec2(gl_FragCoord.xy / iResolution);\n" + + "\n" + + " vec4 sum = texture2D(inTexture, uv + vec2(-halfpixel.x * 2.0, 0.0) * offset);\n" + + " sum.rgb *= sum.a;\n" + + " vec4 smpl1 = texture2D(inTexture, uv + vec2(-halfpixel.x, halfpixel.y) * offset);\n" + + " smpl1.rgb *= smpl1.a;\n" + + " sum += smpl1 * 2.0;\n" + + " vec4 smp2 = texture2D(inTexture, uv + vec2(0.0, halfpixel.y * 2.0) * offset);\n" + + " smp2.rgb *= smp2.a;\n" + + " sum += smp2;\n" + + " vec4 smp3 = texture2D(inTexture, uv + vec2(halfpixel.x, halfpixel.y) * offset);\n" + + " smp3.rgb *= smp3.a;\n" + + " sum += smp3 * 2.0;\n" + + " vec4 smp4 = texture2D(inTexture, uv + vec2(halfpixel.x * 2.0, 0.0) * offset);\n" + + " smp4.rgb *= smp4.a;\n" + + " sum += smp4;\n" + + " vec4 smp5 = texture2D(inTexture, uv + vec2(halfpixel.x, -halfpixel.y) * offset);\n" + + " smp5.rgb *= smp5.a;\n" + + " sum += smp5 * 2.0;\n" + + " vec4 smp6 = texture2D(inTexture, uv + vec2(0.0, -halfpixel.y * 2.0) * offset);\n" + + " smp6.rgb *= smp6.a;\n" + + " sum += smp6;\n" + + " vec4 smp7 = texture2D(inTexture, uv + vec2(-halfpixel.x, -halfpixel.y) * offset);\n" + + " smp7.rgb *= smp7.a;\n" + + " sum += smp7 * 2.0;\n" + + " vec4 result = sum / 12.0;\n" + + " gl_FragColor = vec4(result.rgb / result.a, mix(result.a, 1.0 - exp(-result.a * exposure), step(0.0, lastPass)));\n" + + "}"; + private final String glowShader = "#version 120\n" + + "\n" + + "uniform sampler2D textureIn, textureToCheck;\n" + + "uniform vec2 texelSize, direction;\n" + + "uniform vec3 color;\n" + + "uniform bool avoidTexture;\n" + + "uniform float exposure, radius;\n" + + "uniform float weights[256];\n" + + "\n" + + "#define offset direction * texelSize\n" + + "\n" + + "void main() {\n" + + " if (direction.y == 1 && avoidTexture) {\n" + + " if (texture2D(textureToCheck, gl_TexCoord[0].st).a != 0.0) discard;\n" + + " }\n" + + " vec4 innerColor = texture2D(textureIn, gl_TexCoord[0].st);\n" + + " innerColor.rgb *= innerColor.a;\n" + + " innerColor *= weights[0];\n" + + " for (float r = 1.0; r <= radius; r++) {\n" + + " vec4 colorCurrent1 = texture2D(textureIn, gl_TexCoord[0].st + offset * r);\n" + + " vec4 colorCurrent2 = texture2D(textureIn, gl_TexCoord[0].st - offset * r);\n" + + "\n" + + " colorCurrent1.rgb *= colorCurrent1.a;\n" + + " colorCurrent2.rgb *= colorCurrent2.a;\n" + + "\n" + + " innerColor += (colorCurrent1 + colorCurrent2) * weights[int(r)];\n" + + " }\n" + + "\n" + + " gl_FragColor = vec4(innerColor.rgb / innerColor.a, mix(innerColor.a, 1.0 - exp(-innerColor.a * exposure), step(0.0, direction.y)));\n" + + "}\n"; + private final String roundRectTexture = "#version 120\n" + + "\n" + + "uniform vec2 location, rectSize;\n" + + "uniform sampler2D textureIn;\n" + + "uniform float radius, alpha;\n" + + "\n" + + "float roundedBoxSDF(vec2 centerPos, vec2 size, float radius) {\n" + + " return length(max(abs(centerPos) -size, 0.)) - radius;\n" + + "}\n" + + "\n" + + "\n" + + "void main() {\n" + + " float distance = roundedBoxSDF((rectSize * .5) - (gl_TexCoord[0].st * rectSize), (rectSize * .5) - radius - 1., radius);\n" + + " float smoothedAlpha = (1.0-smoothstep(0.0, 2.0, distance)) * alpha;\n" + + " gl_FragColor = vec4(texture2D(textureIn, gl_TexCoord[0].st).rgb, smoothedAlpha);\n" + + "}"; + private final String roundRectOutline = "#version 120\n" + + "\n" + + "uniform vec2 location, rectSize;\n" + + "uniform vec4 color, outlineColor;\n" + + "uniform float radius, outlineThickness;\n" + + "\n" + + "float roundedSDF(vec2 centerPos, vec2 size, float radius) {\n" + + " return length(max(abs(centerPos) - size + radius, 0.0)) - radius;\n" + + "}\n" + + "\n" + + "void main() {\n" + + " float distance = roundedSDF(gl_FragCoord.xy - location - (rectSize * .5), (rectSize * .5) + (outlineThickness *.5) - 1.0, radius);\n" + + "\n" + + " float blendAmount = smoothstep(0., 2., abs(distance) - (outlineThickness * .5));\n" + + "\n" + + " vec4 insideColor = (distance < 0.) ? color : vec4(outlineColor.rgb, 0.0);\n" + + " gl_FragColor = mix(outlineColor, insideColor, blendAmount);\n" + + "\n" + + "}"; + private final String kawaseUpBloom = "#version 120\n" + + "\n" + + "uniform sampler2D inTexture, textureToCheck;\n" + + "uniform vec2 halfpixel, offset, iResolution;\n" + + "uniform int check;\n" + + "\n" + + "void main() {\n" + + " vec2 uv = gl_FragCoord.xy / iResolution;\n" + + "\n" + + " vec2 offset1 = vec2(-halfpixel.x, 0.0) * offset;\n" + + " vec2 offset2 = vec2(-halfpixel.x, halfpixel.y) * offset;\n" + + " vec2 offset3 = vec2(0.0, halfpixel.y * 2.0) * offset;\n" + + " vec2 offset4 = vec2(halfpixel.x, halfpixel.y) * offset;\n" + + " vec2 offset5 = vec2(halfpixel.x * 2.0, 0.0) * offset;\n" + + " vec2 offset6 = vec2(halfpixel.x, -halfpixel.y) * offset;\n" + + " vec2 offset7 = vec2(0.0, -halfpixel.y * 2.0) * offset;\n" + + " vec2 offset8 = vec2(-halfpixel.x, -halfpixel.y) * offset;\n" + + "\n" + + " vec4 sum = texture2D(inTexture, uv + offset1);\n" + + " sum.rgb *= sum.a;\n" + + " vec4 smpl1 = texture2D(inTexture, uv + offset2);\n" + + " smpl1.rgb *= smpl1.a;\n" + + " sum += smpl1 * 2.0;\n" + + " vec4 smp2 = texture2D(inTexture, uv + offset3);\n" + + " smp2.rgb *= smp2.a;\n" + + " sum += smp2;\n" + + " vec4 smp3 = texture2D(inTexture, uv + offset4);\n" + + " smp3.rgb *= smp3.a;\n" + + " sum += smp3 * 2.0;\n" + + " vec4 smp4 = texture2D(inTexture, uv + offset5);\n" + + " smp4.rgb *= smp4.a;\n" + + " sum += smp4;\n" + + " vec4 smp5 = texture2D(inTexture, uv + offset6);\n" + + " smp5.rgb *= smp5.a;\n" + + " sum += smp5 * 2.0;\n" + + " vec4 smp6 = texture2D(inTexture, uv + offset7);\n" + + " smp6.rgb *= smp6.a;\n" + + " sum += smp6;\n" + + " vec4 smp7 = texture2D(inTexture, uv + offset8);\n" + + " smp7.rgb *= smp7.a;\n" + + " sum += smp7 * 2.0;\n" + + "\n" + + " vec4 result = sum / 12.0;\n" + + " float checkAlpha = texture2D(textureToCheck, gl_TexCoord[0].st).a;\n" + + " gl_FragColor = vec4(result.rgb / result.a, mix(result.a, result.a * (1.0 - checkAlpha), float(check)));\n" + + "}\n"; + private final String kawaseDownBloom = "#version 120\n" + + "\n" + + "uniform sampler2D inTexture;\n" + + "uniform vec2 offset, halfpixel, iResolution;\n" + + "\n" + + "void main() {\n" + + " vec2 uv = gl_FragCoord.xy / iResolution;\n" + + "\n" + + " vec4 sum = texture2D(inTexture, uv);\n" + + " sum.rgb *= sum.a;\n" + + " sum *= 4.0;\n" + + " vec4 smp1 = texture2D(inTexture, uv - halfpixel.xy * offset);\n" + + " smp1.rgb *= smp1.a;\n" + + " sum += smp1;\n" + + " vec4 smp2 = texture2D(inTexture, uv + halfpixel.xy * offset);\n" + + " smp2.rgb *= smp2.a;\n" + + " sum += smp2;\n" + + " vec4 smp3 = texture2D(inTexture, uv + vec2(halfpixel.x, -halfpixel.y) * offset);\n" + + " smp3.rgb *= smp3.a;\n" + + " sum += smp3;\n" + + " vec4 smp4 = texture2D(inTexture, uv - vec2(halfpixel.x, -halfpixel.y) * offset);\n" + + " smp4.rgb *= smp4.a;\n" + + " sum += smp4;\n" + + " vec4 result = sum / 8.0;\n" + + " gl_FragColor = vec4(result.rgb / result.a, result.a);\n" + + "}\n"; + private final String kawaseUp = "#version 120\n" + + "\n" + + "uniform sampler2D inTexture, textureToCheck;\n" + + "uniform vec2 halfpixel, offset, iResolution;\n" + + "uniform int check;\n" + + "\n" + + "void main() {\n" + + " vec2 uv = gl_FragCoord.xy / iResolution;\n" + + "\n" + + " vec4 sum = texture2D(inTexture, uv + vec2(-halfpixel.x * 2.0, 0.0) * offset);\n" + + " sum += texture2D(inTexture, uv + vec2(-halfpixel.x, halfpixel.y) * offset) * 2.0;\n" + + " sum += texture2D(inTexture, uv + vec2(0.0, halfpixel.y * 2.0) * offset);\n" + + " sum += texture2D(inTexture, uv + vec2(halfpixel.x, halfpixel.y) * offset) * 2.0;\n" + + " sum += texture2D(inTexture, uv + vec2(halfpixel.x * 2.0, 0.0) * offset);\n" + + " sum += texture2D(inTexture, uv + vec2(halfpixel.x, -halfpixel.y) * offset) * 2.0;\n" + + " sum += texture2D(inTexture, uv + vec2(0.0, -halfpixel.y * 2.0) * offset);\n" + + " sum += texture2D(inTexture, uv + vec2(-halfpixel.x, -halfpixel.y) * offset) * 2.0;\n" + + "\n" + + " vec4 average = sum / 12.0;\n" + + " gl_FragColor = vec4(average.rgb, mix(1.0, texture2D(textureToCheck, gl_TexCoord[0].st).a, check));\n" + + "}"; + private final String kawaseDown = "#version 120\n" + + "\n" + + "uniform sampler2D inTexture;\n" + + "uniform vec2 offset, halfpixel, iResolution;\n" + + "\n" + + "void main() {\n" + + " vec2 uv = gl_FragCoord.xy / iResolution;\n" + + "\n" + + " vec4 sum = texture2D(inTexture, uv) * 4.0;\n" + + " sum += texture2D(inTexture, uv - halfpixel.xy * offset);\n" + + " sum += texture2D(inTexture, uv + halfpixel.xy * offset);\n" + + " sum += texture2D(inTexture, uv + vec2(halfpixel.x, -halfpixel.y) * offset);\n" + + " sum += texture2D(inTexture, uv - vec2(halfpixel.x, -halfpixel.y) * offset);\n" + + "\n" + + " gl_FragColor = vec4(sum.rgb * 0.125, 1.0);\n" + + "}"; + private final String gradientMask = "#version 120\n" + + "\n" + + "uniform vec2 location, rectSize;\n" + + "uniform sampler2D tex;\n" + + "uniform vec3 color1, color2, color3, color4;\n" + + "uniform float alpha;\n" + + "\n" + + "#define NOISE .5/255.0\n" + + "\n" + + "vec3 createGradient(vec2 coords, vec3 color1, vec3 color2, vec3 color3, vec3 color4){\n" + + " vec3 color = mix(mix(color1.rgb, color2.rgb, coords.y), mix(color3.rgb, color4.rgb, coords.y), coords.x);\n" + + " color += mix(NOISE, -NOISE, fract(sin(dot(coords.xy, vec2(12.9898,78.233))) * 43758.5453));\n" + + " return color;\n" + + "}\n" + + "\n" + + "void main() {\n" + + " vec2 coords = (gl_FragCoord.xy - location) / rectSize;\n" + + " float texColorAlpha = texture2D(tex, gl_TexCoord[0].st).a;\n" + + " gl_FragColor = vec4(createGradient(coords, color1, color2, color3, color4), texColorAlpha * alpha);\n" + + "}"; + private final String mask = "#version 120\n" + + "\n" + + "uniform vec2 location, rectSize;\n" + + "uniform sampler2D u_texture, u_texture2;\n" + + "void main() {\n" + + " vec2 coords = (gl_FragCoord.xy - location) / rectSize;\n" + + " float texColorAlpha = texture2D(u_texture, gl_TexCoord[0].st).a;\n" + + " vec3 tex2Color = texture2D(u_texture2, gl_TexCoord[0].st).rgb;\n" + + " gl_FragColor = vec4(tex2Color, texColorAlpha);\n" + + "}"; + private final String gradient = "#version 120\n" + + "\n" + + "uniform vec2 location, rectSize;\n" + + "uniform sampler2D tex;\n" + + "uniform vec4 color1, color2, color3, color4;\n" + + "#define NOISE .5/255.0\n" + + "\n" + + "vec4 createGradient(vec2 coords, vec4 color1, vec4 color2, vec4 color3, vec4 color4){\n" + + " vec4 color = mix(mix(color1, color2, coords.y), mix(color3, color4, coords.y), coords.x);\n" + + " //Dithering the color\n" + + " color += mix(NOISE, -NOISE, fract(sin(dot(coords.xy, vec2(12.9898, 78.233))) * 43758.5453));\n" + + " return color;\n" + + "}\n" + + "\n" + + "void main() {\n" + + " vec2 coords = (gl_FragCoord.xy - location) / rectSize;\n" + + " gl_FragColor = createGradient(coords, color1, color2, color3, color4);\n" + + "}"; + private final String roundedRectGradient = "#version 120\n" + + "\n" + + "uniform vec2 location, rectSize;\n" + + "uniform vec4 color1, color2, color3, color4;\n" + + "uniform float radius;\n" + + "\n" + + "#define NOISE .5/255.0\n" + + "\n" + + "float roundSDF(vec2 p, vec2 b, float r) {\n" + + " return length(max(abs(p) - b , 0.0)) - r;\n" + + "}\n" + + "\n" + + "vec4 createGradient(vec2 coords, vec4 color1, vec4 color2, vec4 color3, vec4 color4){\n" + + " vec4 color = mix(mix(color1, color2, coords.y), mix(color3, color4, coords.y), coords.x);\n" + + " //Dithering the color\n" + + " color += mix(NOISE, -NOISE, fract(sin(dot(coords.xy, vec2(12.9898, 78.233))) * 43758.5453));\n" + + " return color;\n" + + "}\n" + + "\n" + + "void main() {\n" + + " vec2 st = gl_TexCoord[0].st;\n" + + " vec2 halfSize = rectSize * .5;\n" + + " \n" + + " // use the bottom leftColor as the alpha\n" + + " float smoothedAlpha = (1.0-smoothstep(0.0, 2., roundSDF(halfSize - (gl_TexCoord[0].st * rectSize), halfSize - radius - 1., radius)));\n" + + " vec4 gradient = createGradient(st, color1, color2, color3, color4); gl_FragColor = vec4(gradient.rgb, gradient.a * smoothedAlpha);\n" + + "}"; + private final String roundedRect = "#version 120\n" + + "\n" + + "uniform vec2 location, rectSize;\n" + + "uniform vec4 color;\n" + + "uniform float radius;\n" + + "uniform bool blur;\n" + + "\n" + + "float roundSDF(vec2 p, vec2 b, float r) {\n" + + " return length(max(abs(p) - b, 0.0)) - r;\n" + + "}\n" + + "\n" + + "\n" + + "void main() {\n" + + " vec2 rectHalf = rectSize * .5;\n" + + " // Smooth the result (free antialiasing).\n" + + " float smoothedAlpha = (1.0-smoothstep(0.0, 1.0, roundSDF(rectHalf - (gl_TexCoord[0].st * rectSize), rectHalf - radius - 1., radius))) * color.a;\n" + + " gl_FragColor = vec4(color.rgb, smoothedAlpha);// mix(quadColor, shadowColor, 0.0);\n" + + "\n" + + "}"; + private final String roundedRectRise = "#version 120\n" + + "\n" + + "uniform vec2 u_size;\n" + + "uniform float u_radius;\n" + + "uniform vec4 u_color;\n" + + "uniform vec4 u_edges;\n" + + "\n" + + "void main(void)\n" + + "{\n" + + " vec2 tex_coord = gl_TexCoord[0].st;\n" + + "\n" + + " // fast implementation of custom corners\n" + + " // can probably be better, but this is good enough for now\n" + + " if (tex_coord.x < 0.5 && tex_coord.y > 0.5 && u_edges.x == 0.0 ||\n" + + " tex_coord.x > 0.5 && tex_coord.y > 0.5 && u_edges.y == 0.0 ||\n" + + " tex_coord.x > 0.5 && tex_coord.y < 0.5 && u_edges.z == 0.0 ||\n" + + " tex_coord.x < 0.5 && tex_coord.y < 0.5 && u_edges.w == 0.0) {\n" + + " gl_FragColor = u_color;\n" + + " } else {\n" + + " gl_FragColor = vec4(u_color.rgb, u_color.a * smoothstep(1.0, 0.0, length(max((abs(tex_coord - 0.5) + 0.5) * u_size - u_size + u_radius, 0.0)) - u_radius + 0.5));\n" + + " }\n" + + "}"; + + public ShaderUtils(String fragmentShaderLoc, String vertexShaderLoc) { + int program = glCreateProgram(); + try { + int fragmentShaderID; + switch (fragmentShaderLoc) { + case "kawaseUpGlow": + fragmentShaderID = createShader(new ByteArrayInputStream(kawaseUpGlow.getBytes()), GL_FRAGMENT_SHADER); + break; + case "glow": + fragmentShaderID = createShader(new ByteArrayInputStream(glowShader.getBytes()), GL_FRAGMENT_SHADER); + break; + case "roundRectTexture": + fragmentShaderID = createShader(new ByteArrayInputStream(roundRectTexture.getBytes()), GL_FRAGMENT_SHADER); + break; + case "roundRectOutline": + fragmentShaderID = createShader(new ByteArrayInputStream(roundRectOutline.getBytes()), GL_FRAGMENT_SHADER); + break; + case "kawaseUpBloom": + fragmentShaderID = createShader(new ByteArrayInputStream(kawaseUpBloom.getBytes()), GL_FRAGMENT_SHADER); + break; + case "kawaseDownBloom": + fragmentShaderID = createShader(new ByteArrayInputStream(kawaseDownBloom.getBytes()), GL_FRAGMENT_SHADER); + break; + case "kawaseUp": + fragmentShaderID = createShader(new ByteArrayInputStream(kawaseUp.getBytes()), GL_FRAGMENT_SHADER); + break; + case "kawaseDown": + fragmentShaderID = createShader(new ByteArrayInputStream(kawaseDown.getBytes()), GL_FRAGMENT_SHADER); + break; + case "gradientMask": + fragmentShaderID = createShader(new ByteArrayInputStream(gradientMask.getBytes()), GL_FRAGMENT_SHADER); + break; + case "mask": + fragmentShaderID = createShader(new ByteArrayInputStream(mask.getBytes()), GL_FRAGMENT_SHADER); + break; + case "gradient": + fragmentShaderID = createShader(new ByteArrayInputStream(gradient.getBytes()), GL_FRAGMENT_SHADER); + break; + case "roundedRect": + fragmentShaderID = createShader(new ByteArrayInputStream(roundedRect.getBytes()), GL_FRAGMENT_SHADER); + break; + case "roundedRectGradient": + fragmentShaderID = createShader(new ByteArrayInputStream(roundedRectGradient.getBytes()), GL_FRAGMENT_SHADER); + break; + case "roundedRectRise": + fragmentShaderID = createShader(new ByteArrayInputStream(roundedRectRise.getBytes()), GL_FRAGMENT_SHADER); + break; + default: + fragmentShaderID = createShader(mc.getResourceManager().getResource(new ResourceLocation(fragmentShaderLoc)).getInputStream(), GL_FRAGMENT_SHADER); + break; + } + glAttachShader(program, fragmentShaderID); + + int vertexShaderID = createShader(mc.getResourceManager().getResource(new ResourceLocation(vertexShaderLoc)).getInputStream(), GL_VERTEX_SHADER); + glAttachShader(program, vertexShaderID); + } + catch (IOException e) { + e.printStackTrace(); + } + + glLinkProgram(program); + int status = glGetProgrami(program, GL_LINK_STATUS); + + if (status == 0) { + throw new IllegalStateException("Shader failed to link!"); + } + this.programID = program; + } + + public ShaderUtils(String fragmentShaderLoc) { + this(fragmentShaderLoc, "minecraft:shaders/vertex.vsh"); + } + + public static void drawQuads() { + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + float width = (float) sr.getScaledWidth_double(); + float height = (float) sr.getScaledHeight_double(); + glBegin(GL_QUADS); + glTexCoord2f(0, 1); + glVertex2f(0, 0); + glTexCoord2f(0, 0); + glVertex2f(0, height); + glTexCoord2f(1, 0); + glVertex2f(width, height); + glTexCoord2f(1, 1); + glVertex2f(width, 0); + glEnd(); + } + + public static void drawQuads(float x, float y, float width, float height) { + glBegin(GL_QUADS); + glTexCoord2f(0, 0); + glVertex2f(x, y); + glTexCoord2f(0, 1); + glVertex2f(x, y + height); + glTexCoord2f(1, 1); + glVertex2f(x + width, y + height); + glTexCoord2f(1, 0); + glVertex2f(x + width, y); + glEnd(); + } + + public void init() { + glUseProgram(programID); + } + + public void unload() { + glUseProgram(0); + } + + public void setUniformf(String name, float... args) { + int loc = glGetUniformLocation(programID, name); + switch (args.length) { + case 1: + glUniform1f(loc, args[0]); + break; + case 2: + glUniform2f(loc, args[0], args[1]); + break; + case 3: + glUniform3f(loc, args[0], args[1], args[2]); + break; + case 4: + glUniform4f(loc, args[0], args[1], args[2], args[3]); + break; + } + } + + public void setUniformi(String name, int... args) { + int loc = glGetUniformLocation(programID, name); + if (args.length > 1) glUniform2i(loc, args[0], args[1]); + else glUniform1i(loc, args[0]); + } + + private int createShader(InputStream inputStream, int shaderType) { + int shader = glCreateShader(shaderType); + GL20.glShaderSource(shader, Utils.readInputStream(inputStream)); + glCompileShader(shader); + + if (glGetShaderi(shader, GL_COMPILE_STATUS) == 0) { + System.out.println(glGetShaderInfoLog(shader, 4096)); + throw new IllegalStateException(String.format("Shader (%s) failed to compile!", shaderType)); + } + + return shader; + } +} \ No newline at end of file diff --git a/src/main/resources/assets/keystrokesmod/textures/capes/anime.png b/src/main/resources/assets/keystrokesmod/textures/capes/anime.png new file mode 100644 index 0000000000000000000000000000000000000000..ab7086c2ab04c92059109a0e21daf857b5e5abe1 GIT binary patch literal 51473 zcmdqI1yft!`ZgTg-JJpj3KS_0!71+U+Tu{$-Cc@9u~NK63Ium86o=vvG`Kr~Je>bI zKlujl%saD_olJJtnsxiS?rX)UsmNlXlcNIw04#YqX$=4X@#P~t02TS=Mma{^@^XW7 z(~y+}RF6~czkETomQa=e0P2!3pyo&~-_e}q^xXge?C$@(;OzdypaB5G@$%9VTHYo{ zPblqH^V;hPFqI(RmWkt!zNepMrpx&aL2x9_MP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?ju-B@#LfwXy z>Px_cQ9jsRy??F+r54TY$Zr`I=bt6P_PiPkv{_QZrzi%n`E6?{=zVJF)bQo2rB7{^ zg3Rv+@8nOFl`Q2RwPxH;rQ~-NHGs|)ezfnC&&-t{s$ zhzZd|pnS@1*9(uDq{szz%?z|`qS#AL-dj8|4BWcjYDW>0dpQ{yt-i|XT>m9KK6iD; z1mAvya{7N*ZN@0(>(Bw$LD-3k(quUs1NauN;qr@eG)fDjP4{c_9OXq%Gv13PZw{;D zl96IqrYbh6k9FNoX!+@Ny*TM@kv3RT63pq}*7^Sbg#-uu-+A@z$0u&w{6BQO(BHuc z2(15aeER=?KP5;iS`d`Sym%2d+UvOm+aATaHU+@#|GrzWKMCaNm=m{EDUg@1kieS& zULFKxl|dqTno8RsEuY=ZV2KeC3{Am{U5$jg&8~Zyzt1%{$ACFjg8%>5Cis}{?uiG! zf1fJq8KmsmaWw7dG!68B9{AtS|3%<`5%^yO{uhD&KM+W^&Eks(Z`$(^b literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/keystrokesmod/textures/capes/rvn_aqua.png b/src/main/resources/assets/keystrokesmod/textures/capes/rvn_aqua.png new file mode 100644 index 0000000000000000000000000000000000000000..6e792ea0abf2fbfc31dc277047587641b1b4a53f GIT binary patch literal 10377 zcmeHtXH*kw*Y+fcCp1&#{nQ3R#QLoX84!$Cy|DpEv>QX&#Sq=cFTyV4XCkPw23 zM5HM#LV(0W6Ok?@w4ihXL9d30?>s!OAcmh_Om;m#CaZcer<{WH$LOX0kqWyX#q>-uH~ULZ z?9Vece;vR2o9w>bn?FeXXG84qZMJ6HJbIUd?;X4<(z;$-```on!D{PNV1;0Dwpu&z zN;Xs5KZ889b;Nn=1>J5oW@xrmgw}K67Nt~u-&vR{hQ8B*tDHi7a}*{?0HVSRfZNDx z$kgI&fL?D20{|~87(Olq^5{z%9N42N4gjgT;((qDV>NdR5B0|4B*cL2SihXH_| zcNlm#4+R46_`h0cAE$`1!a;x>+DZ&CZr}c1`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BaRO}zIRG<XdUAvCt$yhB*$zQX+f5-3tzGd+5n;HMUfbze5 z&!!NN8ynNa@hn~W9c`ejIFRSBDJG|61!{&hTAl!1A;S6h^KS(HKZw98Ze-T`OM~?H RqifEbHn;w(;Dp<){{zl|2Ydhk literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/keystrokesmod/textures/capes/rvn_green.png b/src/main/resources/assets/keystrokesmod/textures/capes/rvn_green.png new file mode 100644 index 0000000000000000000000000000000000000000..1a6e84dd0d8b650e0fb23f7ffdb805c7e7233195 GIT binary patch literal 9683 zcmeHtdpwg3`1ifdct})e3aLDWoDw-i=pZQ}lpLprOy!*OY3nE|&$G{GyYKCD-`9Oz-|Ku`OR%-J*eJGL3;=+Q zmM4$f0f3O;6bk$S6&%tk66OU5$Td5QqYy%;I$H2WH1MR;H2~Nkwf2SpkDtf_z@7-p z<3}7Kp3IG0e(>V*5yim7GS%h_2azge&!(F24NrzgYFOiaLPB@UPdGVv2;VU`Q%cx! zwn*h<`ld6sLEH8mzx@Zq{)Flgl}xCPrtdycifneO&zGdT>a7RFx1j_Cu5k{ZW;Goq zn&6`q(YPoR@up_hdADg0jh!oRp8j(Or$63g_M&71v{pz4j7UVkSLP^70$lr2pr!aU z1OTk9Aehsc0+F6%L4iz7H~<)E!vRexk_rMy$&FKz{IX>rM`monX!AH*B~xdfU+ z0K{;sb>SbIQX)Pm9sR#A8_z_#hhX|a1RQYnEzl9|x62TRm_0d)63;Id@O;;PG70iJ zT_9MHSgtlEL%{S->jE9&emj9=A5=ry0q0W?0Ap~wPuA?TK(tMz{o7zZssj0cN+0qB zGz7B!N9;e${)eVv?X$NY;`hsTlBC4)24w(#r|myDwr}3+HJ;t+xx8hY#bI>7Gojb_ zf0^g~KoWG5aX)fwZ$8j}=$C=|80?$3N&0l{rgn5f5+8=e$*90y-}rUM_Ptv%qlI9P z45KZp$?F88Gi3%41776+W3@?Livc_f(vrRs^Zl$6AmR!tE0xJ;MD5e$js> z&-jMR=C2ljf$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z_d%07m`7`@Iu%?qVT1A%eP{z~Aa{g81{nFK4p)b;&VRr^E3=PeYIy8MTT{Vw%2II|v?7M?eQ zWI`R{KTCEHgsIE4wqE>T{>gSrPqMoxO9AfADBo({li~Wo8N61b`@U&SjhTe~G6t)( z11jI>>*4*GrFf}yR}c5>)2bTCDSUJW@e`NCpQ5fJD9>hRU(>2=ahFYD`d|Er zP!Uuz_068WBu1b&4#Ngq5X#k_+u1Y=Ru1~XUk--@iv0KM-wgcU&j1=0Le7gMuivpf Q#R=w|;U$B@vo|0AKlU@dxc~qF literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/keystrokesmod/textures/capes/rvn_yellow.png b/src/main/resources/assets/keystrokesmod/textures/capes/rvn_yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..07a7a1b5553299eca72b0e78e5cd2f75177a59cc GIT binary patch literal 10255 zcmeHtXH-*Z)b0rgD5%T~B8WqAMu{khN|TzXV?n^6C_!3KMiD6iX$DAP9Q2AZIG}=b z1VN+(={?v`qy%9IQiFn_hCnK*=N=fn-|u^W-Zfc^m9SQ_-@W(y?Dp()$NBV$P0Cuz z003;VKl$5P09XfolmphwL2oJKJB!d8EbQ!wBe0-;ZS@ZZq-SaZ z0KD4%x5MXdWHQJ6?|WU&LM$1S7}6adVoQtDpNPwgj{dQGCu~T7*I55UBuv}W2f0N% zJZ;;#bIyv#;$iJSuG2n##{8J#F=X%ImHfaD`WY8DY^dL_w_XkmTWsiTsKZ7z?r5NP znB<_O-p*MgSt;k@MFc7?ds;Gp>2A*$=N8sAe>DmKO7gh6SP|-mD>wxsf%97cH@pD= zw3QkF6(Yzk(ghd5hxZgRp{fvQn{$8xz!fJLX&@D{v@2Z>C^1$5fHX4&z!d{|V}F1$ zP};f$0DNfwPlDbz`_+KtF_h1hmKuU)y zXB{9VLzd~C&NESTJ_~96#vr^MICTmJkPgN7Xd>+)`+q3v-6p@=0J81N7As$17vunB z<`KV*xdo7M{|WogXa9H5XkWOO_}1Ln{TtZQ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