diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c81ec864c..be96153e6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,9 +9,9 @@ jobs: steps: - name: Clone repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up JDK 17 - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: '17' @@ -19,8 +19,8 @@ jobs: run: chmod +x gradlew - name: Build with Gradle run: ./gradlew build - - name: Upload Artifact - uses: actions/upload-artifact@v2 + - name: Upload + uses: actions/upload-artifact@v3 with: - name: JexClient path: build/libs/ + diff --git a/JexChangelog.txt b/JexChangelog.txt index 2c096de10..f07b8368e 100644 --- a/JexChangelog.txt +++ b/JexChangelog.txt @@ -1,837 +1,4 @@ -0.8.6 -Fixed switching accounts not allowing connection to servers since 1.19.1 -Fixed VanillaSpoof not working - -0.8.5 -Added Opacity mode back to Xray -Fixed blur effect and shader ESP modes becoming broken by Sodium -Redesigned GUI to use rounded corners - -0.8.4 -Added "Line Width" options to Shader and Outline Box ESP as well as to Shader StorageESP -Added blur effect option to CustomBG -Added ability to register and login to Jex website from client, as well as being able to link your account. -Fixed error sometimes joining servers -Reworked shader ESP and StorageESP modes - -0.8.3 -Added more cosmetics available through the Jex website, including new Hats, customizable Ears, Peg-Legs, an Appendage, and the Dinnerbone upside-down effect -Added Swim mode to Jesus -Added ability to use Nuker in survival -Added translucency to capes -Fixed CustomMainMenu no longer displaying custom capes properly -Fixed EnchantColor not allowing customization after changing texture packs - -0.8.2 -Added Nuker mod -Fixed JexGUI sometimes opening the pause menu when closing the menu -Fixed NoWeather not blocking rain sounds/sky color -Fixed Friend command not allowing re-naming a friend without it being a name that would work on a Minecraft account -Fixed Hitboxes crashing when loading into singleplayer worlds - -0.8.1 -Fixed IRC giving random errors in the chat area -Added back ability to use non-ascii characters in IRC - -0.8.0 -Added TargetHud mod -Added support for animated capes in .gif format -Added support for loading capes from MinecraftCapes.net -Fixed "Reload Capes and Hats" showing a massive number for seconds left to press again -Fixed typo in Plugin Manager screen - -0.7.9 -Added ability to change mod keybinds from GUI -Added ability to go backward in gui with tab -Fixed BlockOverlay not rendering since 1.19 update -Fixed Safewalk not working since event manager recode -Removed chat notifications when you toggle mods with a keybind - -0.7.8 -Changed Auto-Save to be true by default -Fixed keybinds not being set properly on first launch -Fixed Messages mod blocking messages from being sent in chat -Fixed "dark_green" color for waypoints setting the color to white -Fixed "No Categories" GUI option making mod descriptions get blocked by the gui buttons -Fixed colors not being saved after setting them - -0.7.7 -Merged snapshot changes into main version (new gui, keybind list screen, etc) -Started working on ability to use lang files to change translations in portions of Jex (WIP) - -0.7.6 -Added new Jex Gui (1.19 onward) -Added Keybind list and edit screens (1.19 onward) -Added descriptions to options inside of mods -Fixed HotbarRefill sometimes swapping armor into your hotbar instead of your original item -Fixed some config files not being created properly - -0.7.5 -Fixed IRC throwing an error for messages that are too long -Reworking value system (1.19 onward) -Removed Dropdown menu which will soon be replaced by a new gui that combines functionality of Navigator and Dropdown into a single gui - -0.7.4 -Added ability for plugins to easily create new feature categories (1.19 and onward only) -Added end portal frames to unbreakable block list -Fixed Announcer, AutoCope, AutoEZ, and Spammer not actually sending a command packet if the message starts with "/" on snapshots -Fixed MassTPA sending as a chat message rather than a command on snapshots -Fixed server previews conflicting with Jex commands and the IRC on snapshots -Modified how features are set up to allow for plugins to more easily use custom categories (1.19 and onward only) - -0.7.3 -Added Plugin Manager Screen (Options -> Jex Options -> Plugin Manager) -Added icon support to plugins -Fixed anything dependent on the website (linked accounts, capes, hats, etc) - -0.7.2 -Added Boss options to ESP, KillAura, and Tracers -Added checks for plugins to ensure main class and mixins exist -Fixed commands not being properly caught before send on snapshots if previews are enabled -Fixed new binds sending a message in IRC if you have the IRC chat open - -0.7.1 -Added Mixin support to plugins -Added ability for plugins to have their resources loaded directly into Minecraft -Added ability for plugins to specify required mods that must be loaded to load the plugin -Fixed a Hat being set even if you don't have one enabled in the Personalization screen -Fixed command suggestions not working properly in some instances - -0.7.0 -Added support for plugins -Added more flexible keybinds, allowing for jex commands, server commands, or normal chat -Changed output of toggle command to look nicer - -0.6.9 -Added ECME mode to ElytraPlus -Fixed IRC not displaying color properly for some people -Fixed Storage entities not being outlined properly in Shader StorageESP if ESP isn't also on Shader -Fixed Jex not being able to load into SinglePlayer worlds until you join a server since last update - -0.6.8 -Massively improved performance of 2D rendering -Fixed IRC throwing errors on some long messages -Fixed snapshots not properly displaying Jex version -Fixed CreativeDrop not working since the event manager recode - -0.6.7 -Added Darkness to AntiEffect -Fixed FakeLag breaking Nametags on snapshots -Fixed random instances where KillAura might tank fps - -0.6.6 -Added custom IRC software to be used for the IRC mod -Added optional authentication for SOCKS5 proxies - -0.6.5 -Added HotbarFill mod -Reworked ElytraPlus with new modes - thanks to https://github.com/alex3236 -Fixed ServerScrubber and ServerPinger not properly resolving some servers - -0.6.4 -Added PingSpoof mod -Improved Jesus's ability to fully swim to the top of water and not bob -Fixed Jesus not working properly on some anticheats since the event manager overhaul - -0.6.3 -Added back NewChunks, which functions differently than it used to -Added .ping command -Added .serverscrub command -Added Brightness slider to Fullbright -Added Ping option to Nametags -Temporarily removed FOV support in KillAura while I work on fixing a bug with it -Fixed Skeletons still trying to crouch when sneaking while swimmming -Fixed Nametags only showing one player face at a time across all players -Improved performance of ArrayList -Improved CrystalAura targeting - -0.6.2 -Added WebSpam mod -Added .bot command which allows you to login an account to the server you are on -Added .botcmd command to control those bots -Fixed AntiLiquid crashing when you ran out of blocks -Fixed Tracers not having an option for neutrals - -0.6.1 -Added AntiVoid mod -Added Aris theme to the new Gui -Added Powder Snow and Spyglass options to AntiOverlay -Fixed NoPush Mobs not working since 0.5.7 -Fixed NoFog applying underwater without being enabled -Moved Category Color options to inside ArrayList option in the HUD - -0.6.0 -Added AntiHazard mod -Added Distance option to AntiLiquid -Added ability to use Freecam with Excavator -Added ability to use Freecam with Tunneller -Added Powdered Snow to NoSlow -Redeisigned Window mode of Gui to be resizable and allow for themes -Fixed Post mode not working in Killaura -Fixed Small inconsistency with Killaura while using Freecam -Fixed FOV option in KillAura not working correctly -Fixed BarrierView not working since 0.5.7 -Changed Changelog and In-Client Updating to be based on Github, to keep it working -Renamed Velocity to AntiKnockback - -0.5.9 -Added BowBomb mod - credit to https://github.com/Vonr -Added ToolTips mod and put ShulkerToolTip inside of it, along with MapToolTip, HiveToolTip, and NBTToolTip options -Added Inspect Key option to ShulkerToolTip, making it so you can hover over the items inside of the shulker to inspect them -Added Tight, Creative, and 3D modes to Fly -Added Furnace, Dispenser and Dropper modes to StorageESP -Added SpawnSphere Color option to SpawnHighlighter, to allow you to see which spawnable blocks are inside of the SpawnSphere mod -Added the ability for StorageESP to properly detect double chests and resized some boxes -Added the ability to search for multiple enchantments at once with AutoLibrarianRoll - credit to https://github.com/Vonr -Fixed crash using newer versions of Optifabric with Jex -Fixed AutoTool running on blocks you can't break -Fixed NoWeather not working since 0.5.7 -Fixed SpeedMine thinking it can break Bedrock with Instant mode -Fixed ItemSearcher not allowing use of backspace in the Window Gui mode -Redesigned ShulkerToolTip -ItemSearcher now searches inside ShulkerBoxes in the inventory you are searching - -0.5.8 -Added Triggerbot mod -Added ItemSearcher mod -Added SpawnProofing mod -Added Nametagged option to KillAura, enabled by default -Added Specific Filter option to KillAura -Added Import from TXT button to AccountManager -Added a visual sphere for non-spawning (24 blocks within the player) in SpawnSphere -Added Check Height option to SpawnHighlighter -Fixed Piglins always being viewed as hostile mobs even while not angry -Fixed block placing issues in Scaffold and Tunneller with blocks that would get you stuck -Fixed SlimeChunks command being inaccurate -Fixed AirPlace restricting your ability to eat and use normal items -Fixed Killaura activating Baritone while Excavator is paused -Improved consistency of SpawnHighlighter -MendingSaver now saves all of your hotbar without hovering over -Changed how SpawnSphere renders -Massively improved performance with Nametag mod - -0.5.7 -Added AutoFarm mod -Added BonemealAura mod -Added ElytraSwap mod -Added SlimeChunks command -Added Neutral options to Killaura and ESP -Added Deepslate ores to default Xray blocks -Added a Mine Path option to Excavator to allow Wurst pathfinding to mine for it's path -Added a "Press Enter to Confirm" to setting the positions with Excavator -Added the ability to pause in Excavator -Added Layer Depth option to Excavator -Added Hopper, Chest, And Furnace Minecarts to StorageESP -Added Smooth Mouse option to Zoom (enabled by default) to better fit optifine's zoom -Added Wander mode to AntiAFK -Improved performance while using Jex -Fixed AntiLiquid throwing items one by one to grab blocks if hotbar is full -Fixed Fly and Speed not working well with Wurst pathfinding -Fixed Fly moving slow through water -Fixed Fly interfering with Freecam -Fixed Fly bobbing up and down alot with Wurst pathfinding -Fixed CompatSwim still going in the swim pose -Fixed Freecam going in swim pose while in water -Fixed Nofall not negating fall damage from flying down with elytra -Fixed Navigator GUI not working with keybind or text field options -Fixed Lagometer saying server is lagging when paused in singleplayer -Fixed Excavator taking way too long to find a new path while using the Wurst AI -Fixed Excavator not allowing KillAura to run while excavating -Excavator will now use Baritone to path if Baritone is loaded -AutoTool will now prefer using a hoe on crops and prefer fortune -Renamed CropBuster to FarmAura, and it will now re-plant -Removed FastAnvilDupe mod since it is patched - -0.5.6 -Added BedrockBreaker mod -Added AutoDogFeeder mod -Added "Z Clipping" and "Check Delay" options to SpawnHighlighter -Added AutoTrade option to AutoLibrarianRoll, to instantly lock that villager in -Improved performance with Trajectories -Fixed Jesus not moving upwards in lava -Fixed AutoTotem swapping items that aren't a totem into your offhand if you don't have any -Massively improved performance of SpawnHighlighter -Changed .find and .findbiome commands to create a unique world for each seed and keep the world, allowing for faster searching on a seed already searched -Removed Discord mod -Removed the JexClient window title for now - -0.5.5 -Fixed Fly being way too fast -Fixed mixins still trying to load Sodium Mixin classes when Sodium isn't loaded in some cases -Fixed crash opening the Jex Options screen if it can't find the latest Jex version -Fixed 3rd person looking weird or stiff on client-side - -0.5.4 -Changed Fly to work more like other Fly mods -Fixed crash when using JexClient on a Raspberry Pi -Fixed crash when adding first account to AccountManager -Fixed crash with Disconnect mode in AutoDisconnect - -0.5.3 -Added Excavator mod -Added Tunneller mod -Added AutoDrop mod -Added AutoDrop command -Added AutoDrop selection screen found in Jex Options -Fixed View Bobbing affecting Box ESPs -Fixed BlockOverlay not showing destroy progress on the proper block with certain mods -Fixed crash while disabling Fakelag in specific conditions -Moved the Jex Options button in the Options screen -Running Jex with Optifine no longer requires running the jar as executable, you can now just use the default jar - -0.5.2 -Added ItemPhysics mod -Added UnfocusedFPS mod -Added AutoGapple mod -Added Ghost mod -Added Navigator mode to Gui, which will function almost exactly like Wurst's Navigator gui -Added a "collision" option the HUD to enable/disable the boxes colliding with eachother -Added a Color on Distance option to ESP, to match Tracers -Added Suffixes option to HUD -Added Distance option to Nametag -Added Offhand support to CrystalAura -Added Reset Gamma option to Fullbright, so you can choose what it sets to on disable -Added "When" mode to AutoTotem, allowing you to decide when to put the Totem in offhand -Added a way to convert Jex to support Optifabric by double-clicking the jar -Improved accuracy of sliders in guis -Fixed crash when tab-completing a Jex command afer manually typing it out -Fixed crash launching Jex with Meteor -Fixed crash while favoriting or privating TheAltening accounts -Fixed crash trying to open TheAltening alt manager with an expired license -Fixed crash when searching for alts that don't exist in the alt manager -Fixed AutoReconnect not having a server to attempt until after a successful connection -Fixed Nametag not setting your friend color based on ESP -Fixed Nametag no longer showing Item names -Fixed Criticals not applying crits while sprinting -Fixed Jesus assuming all water is a full block of water -Fixed Jesus not making waterlogged blocks solid -Fixed GUIs not rendering properly for Mac users -Modified opacity of Box ESPs -The Disconnect button in the Proxy Screen will now only be clickable when connected to a proxy -The Open ClickGui button in the Jex Options screen will now open your currently selected GUI -AutoTotem will now set your last item you were holding in your offhand when swapped back -Converted config files to YML instead of json - -0.5.1 -Added MCLeaks and the TheAltening support -Added a Pesonal Cosmetics screen found in the Jex Options screen -Added a spinning Cape renderer to the CustomMainMenu, to replace the original flat one -Added a way to customize the Category colors in ArrayList by linking it with the Window colors -Added "upload" option to SkinSteal command, which will upload the skin to Minecraft and set your current skin -Resized Windows in ClickGui to be slimmer -Renamed BedrockObfuscator to BedrockObf -Adding an Account or Direct login will now be default Mojang login, and clicking the button switches to Microsoft -Microsoft accounts now use Email and Password to initially log in, to avoid having to re-login after a few days -and to avoid opening a web browser to log in - -0.5.0 -Added XPBottleSpammer mod -Added a new Changelog screen -Added Visualize and "Catch When" options to Fakelag -Added Liquids option to AirPlace -Added .dungeonseedcrack command (for getting server seeds to use with .find or .findbiome) -Added .find Command (for finding structures with a seed, like /locate) -Added .findbiome command (same thing as above for biomes) -Fixed SpeedMine activating while in creative mode -Fixed some mods sending two slot packets to the same slot, flagging some anticheats -Fixed the Direct Login screen not properly logging you into cracked accounts -Fixed Nametags not showing your friend's set nickname rather than their username -Moved the AutoHop option in Vanilla Speed to be it's own Speed mode called Strafe with customizable hops -Renamed MiddleClickSort to InventorySort as it now uses a customizable key -Renamed Aura to KillAura -The scrollbar in the AccountManager can now be click and dragged - -0.4.9 -Added "Don't Reel" option to AutoFish -Greatly improved collision detection with the moveable HUD elements -Improved HUD element loading so the elements should no longer go off-screen at load -Fixed AutoFish "Show in Open Water" option not actually disabling -Fixed issue where sometimes options for mods wouldn't accept clicks in the Window ClickGui -Fixed crash when trying to edit a Mojang/Cracked account in the AccountManager -Fixed issue with logging into cracked accounts - -0.4.8 -Added ThrowPearl mod -Added CustomWidgets mod -Added ArmorDerp mod -Added moveable elements to the HUD -Added "Walk Animation" option to Fly -Added the ability to use middle click and extra mouse buttons for keybinds -Added the ability to have keybind options for mods now (e.g. ThrowPearl having a "Throw Key" option) -Added transparency to Window mode ClickGui -Added an indicator above the Chat bar to tell you whether you are typing in game chat or IRC chat -ClickGui windows now have a maximimum length, with an option in GUI to change the length -Zoom now has a customizable keybind to activate the zoom function -CustomMainMenu now uses default MC buttons now that they are customizable -The hover effect on TabGui is now smoother - -0.4.7 -Added HolidayEvents mod -Added Trail mod -Added Trail command -Added "Sprint in Inventory" option to Sprint -Added Return to Original Slot option to AutoTool -Added Auto Hop option to Vanilla Speed mode -Added "Check Health" and "Open inventory" options to AutoTotem -Added a function that adds Jex Anarchy server to the bottom of your server list if not there -Raised the Max Price in AutoLibrarianRoll to 75 from 50 emeralds -Changed minimum Percent in Velocity to -300 -Updated .dupe command to use the current shulker dupe -Fixed .friend command not working with player names containing underscores -Fixed NoFall causing issues with Fly, Elytra flying, etc -Fixed InventoryView conflicting with the player list if the location is Top -Fixed LawnBot not working in survival without an instant break tool -Fixed Freecam keeping velocity on disable - -0.4.6 -Added IRC mod - -0.4.5 -Added AutoEZ mod -Added AutoCope mod -Added MassTPA mod -Added Screenshot command, which takes a screenshot and automatically uploads to Imgur -Added CGive command -Added CopyNBT command -Added ItemExploit command, and also moved .firework and .holo over to this command -Changed NCP mode to Hover in ElytraPlus mod -Converted commands to use Brigadier, Minecraft's backend, allowing for suggestions and tab completion -Increased Max Length of the chat bar while running Jex commands -Improved Skeletons while flying and swimming (thanks to c10udburst on github - -0.4.4 -Added AutoLibrarianRoll mod -Added "Instant" mode to SpeedMine -Added "Break Cooldown" option to Speedmine to modify the block breaking cooldown. (5, the max, is default Minecraft) -Added support for logging in with Microsoft accounts in the AccountManager -Added a Direct Login screen to AccountManager, as well as fixing the Add Account screen on smaller resolutions -Redesigned AccountManager -If running the game from IDE like Intellij, it will now attempt to auto-login to your first Account in the AccountManager - -0.4.3 -Added Lawnbot mod -Added Trans Rights mode to EnchantColor mod -Added FancyChat mode to Messages mod -Added modes to Derp mod -Fixed the "Realms" button on CustomMainMenu doing nothing -Fixed AutoEat causing Baritone to get paused until disabled and re-enabled again -Fixed LogOutSpot messing with fake players -Redesigned BarrierView - -0.4.2 -Added MiddleClickSort mod -Added AntiLiquid mod -Added a Limit Range option to Search -Modified 2D ESP to have an outline box -Temporarily removed clickgui restriction for only moving one window at a time -Improved performance of Search with many blocks being shown at once -Removed Opacity mode from Xray for now as I figure out what is causing it's issues - -0.4.1 -Added BarrierView mod -Added LogOutSpot mod -Added .plugin command -Improved performance while using Box StorageESP -Vastly improved performance of 2D ESP -Fixed issue causing crash on startup with Macs -Fixed bug with HUD displaying potion effects - -0.4.0 -Fixed AntiOverlay not applying with water while using Sodium -Fixed issue causing SkinBlink to disable all skin-overlays while re-loading config -Fixed issue causing the Config window to not accept clicks in the Window GUI mode -Fixed issue causing the scrollbar to stay on screen while searching in the ClickGui - -0.3.9 -Added TestRender mod, to test out my new renderer (shouldn't notice any visual differences, but please report visual issues if you use it) -Added "Shader Rainbow" mode to EnchantColor, and you can change it to "Customize" to get old functionality -Updated Sodium calls to work with official 0.3.0 for 1.17.1 - -0.3.8 -Added CustomBackground mod -Added SuperheroFX mod -Added Buffer Packets mode to Blink -Changed rainbow background on the GUIs to be less intense -Changed ClickGUI so that you will only be able to click/drag one window at a time, and your most recent window will draw at the front of screen -Fixed AutoWither not placing some blocks correctly - -0.3.7 -Added a colorful background to JexGui and changed the background of the window ClickGui -Overhauled Opacity Xray to not require a world reload, and will update opacity without world reload as well as having a Fade option -Fixed Nametags rendering overtop of worn Dragon Heads -Fixed AutoArmor throwing errors in console while wearing something that isn't armor -Fixed Jex crashing with latest Sodium actions build -Fixed AutoTotem attempting to place totems in off-hand while a screen is open - -0.3.6 -Added EnchantColor mod -Added the ability to get original name in anvils with FastAnvilDupe (non-full inventory) by removing the item name completely -Added an option to make FastAnvilDupe automatic -Fixed ShulkerToolTip having issues with items behind it -Fixed Ctrl making you move downward with Fly while in a menu - -0.3.5 -Added FastAnvilDupe mod -Added "Build Info" option to HUD -Added Spin Speed option to Crosshair -Added more information to console when JexClient loads -Added scrollbars to Search and Xray selection screens -Fixed Delete button in waypoint screen not saving -Fixed AutoMend pulling items from main hand - -0.3.4 -Added Reach mod -Added SpeedCrafter mod and SpeedCrafter command -Added a constraint for windows in the ClickGui not allowing you to move them off-screen -Added "Spin" option to Crosshair -Added "Fade Boxes" option to HoleESP -Changed Blink to show a player in position rather than a line -Fixed issue causing ClickGui to crash while using search bar -Fixed Freecam not reloading chunks on enable -Fixed .peek crash - -0.3.3b -Added AutoMine mod -Added "Item Durability" option to HUD (again thanks to https://github.com/slcoolj) -Fixed crash when loading AccountManager with no accounts - -0.3.3 -Added "Write to file" option to SlimeSpawnMarker -Added "FOV Based Tag" option to Waypoints to clutter the screen less -Added a screen that lets you see/edit waypoints, keybind is INSERT -Added waypoints to the Radar -Added support for the K colorcode to custom font renderer -Added scrollbars to JexGui, ClickGui, and Alt Manager screen -Added a limited way to use personal capes (can't be seen by others) by putting the cape file in the JexClient folder and renaming it to "cape.png". A better method should be implemented soon. -Added an opacity Xray - thanks to https://github.com/slcoolj -Updated calls to Sodium to align with their current 1.17 build on github -Changed HUD and Waypoints to actually use the SP world name while on Singleplayer -Fixed Shader StorageESP throwing error in console at launch - -0.3.2 -Added VanillaSpoof mod -Added CustomFont mod, with ability to add font files in ".minecraft/JexClient/fonts" and load them in game -Added Custom Font option to Nametags -Added Shader mode to StorageESP -Added Box Outline mode back to ESP -Added mod descriptions to JexGui -Added Item% option to MendingSaver allowing you to change at what durability MendingSaver will put away items -Added the ability to connect to a Proxy server, with a button in the multiplayer menu -Fixed MendingSaver not working properly with a full inventory -Fixed Scaffold constantly trying to place blocks on range 0 even if you have a block below you already -Fixed SignReader not working properly -Changed color of disabled mods in JexGui - -0.3.1 -Added "Place mode" option and a Range slider to Scaffold mod -Fixed SpawnHighlighter not rendering properly -Fixed Item rendering (Nametags, InventoryView, etc) not displaying the damage bar -Fixed Conflict issue with AutoEat and Killaura when blocking -Fixed Fly not allowing you to fly upwards with Glide enabled -Moved "Fly Check Glide" out of the glide option and renamed to "Fly Check Bypass" also making it use packets so it's not noticeable - -0.3.0 -Added AutoMend mod -Added "Auto Turn Off" option to Surround, on by default -Fixed Surround and AutoTrap attempting to place above the build limit -Fixed issue causing the Account Manager to crash when it can't read the accounts from file -Fixed Freecam breaking Box ESP when turned off until manually removing the fake player with a command -Fixed "Show on Self" option in Nametags not functioning -Fixed Velocity spamming the logs with errors in 1.17 - -0.2.9 -Added FakePlayer command -Changed Freecam to show the player in place rather than a box -Fixed Radar crashing the game when opening the gui while not being in-game -Fixed Freecam teleporting you under the world in singleplayer -Fixed NoTurn, Freecam, Jesus, and NoFall filling logs with errors on the snapshots -Fixed Skeletons not rendering properly on the snapshots -Fixed Discord mod giving errors in the logs on game close -Skeletons will now work with swimming/flying players, although it is nowhere near perfect - -0.2.8 -Added new JexGui to go alongside the current ClickGUI. Currently you can switch between them by going to the Gui mod and changing the "mode" -Gui mod now defaults to opening JexGui -Fixed NoRender particles not working properly on snapshots -Fixed NoRender particles still rendering for a tick -Fixed Tracers "Color on Distance" turning blue far away -Improved AnchorAura, AutoTrap, and Surround working on servers with AntiCheats - -0.2.7 -Added a "Living Only" option to AutoWeapon to avoid swapping to a sword on entities that are not alive -Also Added a "Living Only" option to Criticals -Added "Rotate" option to Surround and AutoTrap -Added the ability to type "friend list" command for a list of your friends and their aliases -Added a new "Particles" mode to NoRender than includes Fireworks, Explosions, Smoke, and Block Breaking particles, all togglable -Fixed AchorAura attempting to charge an achor while sneaking -Improved Scaffold's ability to replace blocks -Reworked how commands give you syntaxes (ways to use) for commands - -0.2.6 -Added AutoTrap mod -Added Surround mod -Added AnchorAura mod -Added an option to toggle the watermark in the HUD -Fixed the Baritone command telling the player "Sending command to Baritone" twice -Fixed an issue causing the game to hang on load if you had a background with spaces or capital letters in the name -Fixed an issue caused by trying to use the scroll wheel while hovered over Radar in ClickGUI -Fixed Xray not working while using Sodium FPS improvement mod -Fixed ShaderESP throwing an error in logs every game launch -Modules.json config file is now named Features.json, the game will automatically rename this for you -Commands will now be sorted alphabetically -The progress bar for updating Jex will now actually function and show you the progress of the download - -0.2.5b -Fixed Trajectories' line not rendering where it properly should -Fixed Hud filling up logs with errors - -0.2.5 -Added AutoSoup mod -Added "Sneak on Place" option to Scaffold, allowing it to sneak while it places (avoiding inventories of blocks like Crafting Table) -Improved Botcheck in Killaura -ESP entity boxes will now rotate along with the entity -Fixed Skeletons setting all limb angles to those of the player closest to crosshair -Fixed Scaffold mod not replacing blocks like grass, snow, etc -Please note there has been another small render overhaul. Please report any issues you may find - -0.2.4 -Added ItemScale mod -Added OldBlocking mod -Added Skeletons mod -Added Radar mod -Added AutoWeapon mod, removing the "attack" option from AutoTool -Added a mode option to AutoWeapon, allowing you to switch between just sword, sword & axe, or all tools to be counted -Added the option to pin a ClickGui Window to the HUD -Added a button for opening the ClickGui Window on each window, as well as a button for the new Pin feature -Added Multiaura mode to Killaura -Added an AutoBlock distance option to Killaura -Fixed AutoBlock bug in KillAura that caused it to spam use even when it couldn't block -Fixed a bug that caused ESP and Killaura to not know you're the owner of a mob you tamed after relogging -Fixed a bug causing NoPush to not work with mobs, still getting pushed -Fixed Messages mod changing the messages of server commands -Made AutoArmor more reliable, and it now also no longer throws your previous armor if you have open inventory slots - -0.2.3 -Added NoFriendDMG mod -Added a search bar to the ClickGUI -Redesigned ClickGUI, with the ability to change the color of each category window, or set them all to client color -Moved ClientColor option from ClickGUI to HUD -Fixed an issue where if you clicked to drag a window in the gui while it was scrolled, it would toggle the mod behind it - -0.2.2 -Added SlimeSpawnMarker mod -Added Hat and Firework commands (Creative only) -Added Fireworks mode to NoRender -Added Bamboo to CropBuster -Added Boats to EntityRider -Added a border to the mod description in ClickGui -Fixed a crash involving addons when joining servers with npcs -Made Jex compatible with the official Fabric Baritone - -0.2.1 -Added a slider to Velocity for percentage - -0.2.0 -Added AirPlace mod -Added Blink mod -Added Safewalk mod -Added Breed command -Fixed Block rendering in the Search/Xray screen having wrong placement in the selection screens -Fixed SpawnSphere and Reach Sphere (in Killaura) crashing when enabled - -0.1.9 -Added Announcer mod, with fully customizable messages for leaving/joining -Added CropBuster mod -Added DepthStrider mod -Added Bind command -Added a face render to OwnerTags -Fixed face rendering not showing properly for certain size skin files -Fixed Spine not actually working on Tracers -Fixed TunnelFinder, Search, and BedrockObfuscator not working below y=0 on snapshots -Fixed Zoom not resetting FOV when disabled -Fixed conflict between AutoTool and AutoEat sometimes showing the wrong item in your hand -Reduced the size of the buttons in the Xray and Search selection screens, increasing the amount of visible blocks at one time -Alphabetized the mods, making them have consistent spots in the clickgui/tabgui - -0.1.8 -Added InventoryView mod -Added SkinSteal command -Added an image of the current player's face on the CustomMainMenu, as well as showing your cape if your account is linked -Added an image of the player's face in Nametags (optional, but enabled by default) -Added an image of the Account's face in the Account Manager -Added an image of the current player's face in the HUD as an option (enabled by default) -Added Watermark Mode to HUD to change the effect the watermark makes (static/non-moving by default) -Added Username, Ping, Biome, and a Player count to the Info on the HUD -Added an option to play the player level up sound when the game finishes loading (enabled by default) -Added buttons in the ClickGui to open the Xray and Search block selection screens -Improved the BlockOverlay outline to just override the Minecraft outline rather than using it's own -Changed the BlockOverlay progress-based color for Break Overlay to go from green -> red rather than red -> green -Changed AntiGhostBlock to not right-click the blocks to update, sometimes stripping logs, making paths, etc. -Fixed StorageESP rendering for blocks outside of render distance - -0.1.7 -Added BlockOverlay mod -Added a new mode to SpeedMine called "Progress" that instant breaks a block after a % progress breaking it, with a slider for the progress -Improved Step's ability to go up many steps in succession on anticheats -Fixed AutoEats "Eat to Regen" eating when you can still regen health -Fixed the issue that caused Fakelag to not allow you connecting to any server -Fixed the bug with the HUD overlaying the watermark on the snapshot version -Moved the FPS and TPS counters next to the watermark on the HUD - -0.1.6 -Added Sneak -Added BucketCatch -Added FastLadder with an option for SkipLadder as well -Added an option to HUD to have the ArrayList come from the top or bottom -Added "Press Key" option to AutoEat to press the right-click key so you visually eat -Removed "Silent" option from AutoEat as it doesn't work very well -Fixed the loading bar showing 0% after downloading update -Changed the watermark on the HUD to a spinning circle effect - -0.1.5.5 -Added InventoryPlus -Removed the need for Jex to have a profile to play, with it now just being the single Jar file redistributed - -0.1.5.1 -Fixed an issue causing Killaura to draw a box around the target when the option is disabled -Greatly improved performance while using Jex - -0.1.5 -Added Hitboxes mod -Added Zoom mod -Added AutoDisconnect mod -Added AutoWither mod -Added DiscordRPC mod to show when you are using Jex Client on Discord (enabled by default) -Added an option to disable Fly going downwards with CTRL -Changed it to show "Jex Client " as the window title - -0.1.4 -Added SpawnSphere mod -Added AutoFarm mod -Added AutoFarm command, to set the positions -Added a KillAura Reach sphere to show where you can reach with KillAura -Fixed the Rainbow Saturation slider in HUD only allowing 0 or 1 -Changed the back-end to not be code-dependent on Baritone (Allowing the game to be ran without it now) - -0.1.3 -Changed the "Download Jex Installer" button to a button that will automatically update when clicked (skipping needing the installer again) -Added Timer mod -Added a "Packet" mode to step, which works on some servers with AntiCheats, like 2b2t and Constantiam, and will step up 1.75 blocks -Added a Speed slider to Freecam -Added StorageESP as a standalone mod, removing it from ESP -Addded a 2D ESP mode -Added an option for auto-saving mods in the ClickGui -Added an option to play a click sound when you click a button in the ClickGui -Added the ability to toggle a mod's visibility in the clickgui by holding Shift and clicking the mod -Added a button to reload Capes and Hats in the Jex Options Screen (With a 30 second cooldown) -Improved Auto Elytra in ElytraPlus to activate the Elytra more reliably -Fixed the issue causing the TabGui to skip every other option -Fixed the underlying issue that caused the game getting stuck on load using a Modules.json from b0.1.1 to b0.1.2 -Replaced NCP mode in Speed with "Floaty" an experimental speed that kind-of works on anticheats - -0.1.2 -Added OwnerTags -Added SignReader -Added BedrockObfuscator -Added an option to show the instant TPS of the server as well on the HUD -Added an option to TPSSync to change the Sample Size (Amount of seconds to take an average from) -Added .damage command -Added .holo command -Added an effect that will outline the chat bar when you start typing a Jex command -Added a list of possible commands to type out when you start typing a command, sort of like Minecraft's command system -Made Command output more consistent across commands -Fixed the issue that required Search to be force disabled on launch, ignoring the save file -Fixed AutoEat having issues actually eating on laggy servers - -0.1.1 -Added NewChunks -Added AntiAFK -Added a WIP Waypoints mod, currently can only create/delete waypoints with commands but a GUI is coming soon -Added a .waypoint command -Added an option to use client color in the ArrayList on the HUD -Added multiple new options to NoSlow, "Use Item" (original use), "Soul Sand", "Cobweb", and "Berry Bush" -Modified Dolphin Jesus to work better on 2b2t, especially with CompatSwim enabled -Fixed an issue where the description of a module would show on the clickgui even when a window was closed -Fixed an issue where Zombie Piglins were being seen as hostile wihtout being angry -Fixed an issue where Killaura would "jitter" the screen as it attacked and slowed down -Fixed an issue where MendingSaver would try to save items that can't take damage (spawned in items) -Made AutoEat more reliable -Nametags: -Brought back 2D Nametags, finally removing the ugly temp 3D ones. -Added a new Health Mode called "Bar" that will just be a health bar below the nametags -Added an option to show the equipped items of the nametagged entity -Added an option to enable/disable Players/Hostiles/Passives/Items on the nametags - -0.1.0 -Added TunnelFinder -Added CompatSwim -Added a "Dolphin" mode to Jesus, that will let you jump on water, even on servers like Constantiam -Greatly improved Scaffold for servers with anticheats -Fixed Scaffold trying to place blocks like doors, torches, etc and will only place full blocks from now on. -Fixed conflict issue between the rainbow saturation option and the option to show player saturation in the HUD -Fixed AutoTool not allowing you to attack entities on some ViaFabric servers -Fixed KillAura speeding you up when sprint is turned off -Fixed the "Look" on the HUD not wrapping back to 180/-180 - -0.0.9: -Added SkinBlink -Added Trajectories -Added NoFog -Added ShulkerToolTip -Added Lava mode to AntiOverlay -Overhauled AutoEat, changing it so it doesn't send right-clicks, as well as having new options, "Eat Negative Foods", "Eat To Regen", and "Silent" -Fixed CrystalAura showing where it could place on friends -Fixed being able to see the Jex hats in the Xray and Search screen -Fixed NoSlow speeding you up while eating and sneaking at the same time -Fixed MiddleClickFriend not working if you changed your command prefix -Fixed an issue where if you disabled ESP and turned it on with "Shader" mode selected, it wouldn't load the cleaner glow outline -Fixed an issue where if you have viewbobbing off, client rendering would still bob slightly -Fixed AutoTool not letting you break blocks when it swapped too fast, and also made it swap to non-breakable if no tool is found --Also Changed the "Swords" option to "Attack" as it now supports axes too, and there is an option to allow all tools to be checked. -HUD: -Added a TabGui to the HUD -Added an option to see yaw and pitch on HUD -Added saturation slider for the Rainbow option in ArrayList -Added a rainbow speed slider for Rainbow option as well - -0.0.8: -Added FallSpeed mod -Added Messages mod -Added CustomMainMenu mod, with the ability to use custom backgrounds in mcdir/JexClient/backgrounds -Added Derp mod -Added an Xray and Search block selection screen to the Jex Options screen -Added a Rainbow option to the Client Color option in GUI -Added .panic command -Fixed Xray showing some sides of non-full blocks that were not selected -Fixed VClip not letting you actually clip through without relogging -Fixed Fullbright not being 100% reliable in turning on and off -Fixed Freecam not teleporting you back when disabled, and added an option to keep it. --Also added a new option to Freecam called "Stealth" that will disable all packets being sent -(Website and Client) Changed the website to show free capes, as well as making it so all linked accounts will have a seperate free cape after the beta cape is gone. - -0.0.7: -Added MiddleClickFriend -Added Criticals as a standalone mod, removing the option from killaura -Added NoHurtCam -Added HoleESP -Added NoRender -Added EndPortalFinder -Added .peek command -Fixed Velocity not affecting explosion velocity -Fixed an issue where when your camera was moving from taking damage, client rendering would not move with it -Fixed AutoPlace not working at all in CrystalAura -Fixed the command prefix not being saved when closed -Fixed the clickgui keybind showing empty when on a key like insert -NoPush now has 2 new options, Mobs and Water. Mobs functions like it did before, removing mob-pushing, and water will remove water velocity. - -0.0.6: -Added Tracers -Added Search -Added Scaffold -Added ColoredSigns -Added the option to add an alias for friends, and that will show on nametags -Added a Jex Client options screen (WIP) (found in top-left of options screen) -Added a useless bouncing particle effect to the gui as an option (disabled by default) -Fixed Nametags being wonky through walls -Changed Fly to be a more cheat-like fly rather than just creative mode, also with a speed slider -Modified the Armor HUD to draw next to the hotbar instead of above, as well as having a few new modes to it. +Jex 1.0.0 changelog +-Added Gravity +-Improved FPS, and settings +-Make KillAura, TriggerBot and HitBoxes more customizable and better diff --git a/README.md b/README.md index 5097e73f1..00c3c22ff 100644 --- a/README.md +++ b/README.md @@ -22,36 +22,5 @@ You can download Jex Client in the discord or in the releases tab ## Developers Please note If your JexClient path has any spaces or special characters in it's path, the Features, Commands, and Config Manager will not properly load. [Why?](https://github.com/google/guava/issues/2152) - -## Things needed: -1. [Java 17 JDK](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) -2. A Java IDE, like [Intellij](https://www.jetbrains.com/idea/download/) or [Eclipse](https://www.eclipse.org/downloads/) - -## Setup Intellij: -Manual -``` -1. Open build.gradle as an Intellij project. -2. If you don't see run profiles after it finishes loading, close and re-open the project -``` -Automatic -``` -Click the green "Code" button above and open an Intellij project from Git with the link it provides -``` -Using Intellij it is recommended to go to your Gradle settings and changing 'Build and Run' to use Intellij. - -## Setup Eclipse: -``` -1. Download the repo and run the command "gradlew eclipse" (use a ./ before command if using PowerShell) -2. Open Eclipse and go to File -> Import -> Import from existing project -3. Click the drop-down box next to the Run button in Eclipse -4. Select "Java Application" then select "jexclient-main_client" -5. Run -``` - -## How to build -``` -1. Run the gradle Build script -2. Drag & drop JexClient.jar into your mods folder -``` -## Want to test features before they're released? -Sometimes features will be pushed to github before the update is fully released. If you'd like to try them, you can find auto-builds [here](https://github.com/DustinRepo/JexClient-main/actions?query=event%3Apush) \ No newline at end of file +## Known bugs +Crash on linux - tessellate block mixin error diff --git a/build.gradle b/build.gradle index 6a50c5bb3..abda9ad25 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '0.11-SNAPSHOT' + id 'fabric-loom' version '1.1-SNAPSHOT' id "com.github.johnrengelman.shadow" version "7.1.2" } @@ -46,12 +46,7 @@ tasks.withType(JavaCompile).configureEach { it.options.release = 17 } -java { - // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task - // if it is present. - // If you remove this line, sources will not be generated. - withSourcesJar() -} +java {} jar { from("LICENSE") { diff --git a/gradle.properties b/gradle.properties index 3fda36882..6b50fba08 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,12 +3,12 @@ org.gradle.jvmargs=-Xmx1G minecraft_version=1.19.2 yarn_mappings=1.19.2+build.8 -loader_version=0.14.9 +loader_version=0.14.0 #Fabric api fabric_version=0.60.0+1.19.2 # Mod Properties -mod_version=0.8.6 +mod_version=0.8.8 maven_group=me.dustin -archives_base_name=jex-client \ No newline at end of file +archives_base_name=jex-client diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 41dfb8790..070cb702f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/lib/sodium.jar b/lib/sodium.jar index 9c835ff1e..c047316d6 100644 Binary files a/lib/sodium.jar and b/lib/sodium.jar differ diff --git a/src/main/java/bedrockminer/utils/BlockBreaker.java b/src/main/java/bedrockminer/utils/BlockBreaker.java index 8a15b1484..d92ad31ea 100644 --- a/src/main/java/bedrockminer/utils/BlockBreaker.java +++ b/src/main/java/bedrockminer/utils/BlockBreaker.java @@ -6,10 +6,6 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; -//import java.util.ArrayList; - -//import static net.minecraft.block.Block.sideCoversSmallSquare; - public class BlockBreaker { public static void breakBlock(ClientWorld world, BlockPos pos) { InventoryManager.switchToItem(Items.DIAMOND_PICKAXE); @@ -17,4 +13,4 @@ public static void breakBlock(ClientWorld world, BlockPos pos) { } -} \ No newline at end of file +} diff --git a/src/main/java/bedrockminer/utils/BreakingFlowController.java b/src/main/java/bedrockminer/utils/BreakingFlowController.java index 68cc23d66..ebeba00cc 100644 --- a/src/main/java/bedrockminer/utils/BreakingFlowController.java +++ b/src/main/java/bedrockminer/utils/BreakingFlowController.java @@ -7,7 +7,6 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.BlockPos; import java.util.ArrayList; -//import java.util.List; public class BreakingFlowController { private static ArrayList cachedTargetBlockList = new ArrayList<>(); @@ -32,6 +31,7 @@ public static void addBlockPosToList(BlockPos pos) { cachedTargetBlockList.add(targetBlock); } } else { + return; } } diff --git a/src/main/java/me/dustin/events/core/EventListener.java b/src/main/java/me/dustin/events/core/EventListener.java index c9dc81358..92997aac4 100644 --- a/src/main/java/me/dustin/events/core/EventListener.java +++ b/src/main/java/me/dustin/events/core/EventListener.java @@ -67,6 +67,7 @@ public void invoke(T event) { } this.hook.invoke(event); } catch (ClassCastException e) { + return; } } diff --git a/src/main/java/me/dustin/jex/event/packet/EventConnect.java b/src/main/java/me/dustin/jex/event/packet/EventConnect.java index 011cf2345..620970a8c 100644 --- a/src/main/java/me/dustin/jex/event/packet/EventConnect.java +++ b/src/main/java/me/dustin/jex/event/packet/EventConnect.java @@ -6,6 +6,7 @@ public class EventConnect extends Event { private final ServerAddress serverAddress; + public EventConnect(ServerAddress serverAddress) { this.serverAddress = serverAddress; diff --git a/src/main/java/me/dustin/jex/event/packet/EventPacketReceive.java b/src/main/java/me/dustin/jex/event/packet/EventPacketReceive.java index b1178b511..e528cf579 100644 --- a/src/main/java/me/dustin/jex/event/packet/EventPacketReceive.java +++ b/src/main/java/me/dustin/jex/event/packet/EventPacketReceive.java @@ -28,4 +28,5 @@ public void setPacket(Packet packet) { public enum Mode { PRE, POST } + } diff --git a/src/main/java/me/dustin/jex/event/packet/EventPacketSent.java b/src/main/java/me/dustin/jex/event/packet/EventPacketSent.java index 1fb74f862..ac384460d 100644 --- a/src/main/java/me/dustin/jex/event/packet/EventPacketSent.java +++ b/src/main/java/me/dustin/jex/event/packet/EventPacketSent.java @@ -38,7 +38,7 @@ public EventPacketSentDirect(Packet packet, EventPacketSent.Mode mode) { this.packet = packet; this.mode = mode; } - + public Packet getPacket() { return packet; } diff --git a/src/main/java/me/dustin/jex/event/render/EventRenderBoss.java b/src/main/java/me/dustin/jex/event/render/EventRenderBoss.java new file mode 100644 index 000000000..717291011 --- /dev/null +++ b/src/main/java/me/dustin/jex/event/render/EventRenderBoss.java @@ -0,0 +1,27 @@ +package me.dustin.jex.event.render; + +import me.dustin.events.core.Event; +import net.minecraft.entity.boss.BossBar; +import net.minecraft.text.Text; +import me.dustin.events.core.Event; +import net.minecraft.client.util.math.MatrixStack; + +public class EventRenderBoss extends Event { + + private final BossBar boss; + private final MatrixStack poseStack; + + public EventRenderBoss(BossBar boss, MatrixStack poseStack) { + this.poseStack = poseStack; + this.boss = boss; + } + +public BossBar getBoss() { + return boss; + } + + public MatrixStack getPoseStack() { + return poseStack; + } + +} diff --git a/src/main/java/me/dustin/jex/event/render/EventRenderHud.java b/src/main/java/me/dustin/jex/event/render/EventRenderHud.java new file mode 100644 index 000000000..9a1f20d96 --- /dev/null +++ b/src/main/java/me/dustin/jex/event/render/EventRenderHud.java @@ -0,0 +1,29 @@ +package me.dustin.jex.event.render; + +import me.dustin.events.core.Event; +import net.minecraft.client.gui.hud.InGameHud; +import net.minecraft.client.util.math.MatrixStack; + + public class EventRenderHud extends Event { + private final InGameHud ingamehud; + private final MatrixStack poseStack; + private final int tickDelta; + +public EventRenderHud(InGameHud ingamehud, MatrixStack poseStack, int tickDelta) { + this.ingamehud = ingamehud; + this.poseStack = poseStack; + this.tickDelta = tickDelta; + } + + public InGameHud getInGameHud() { + return ingamehud; + } + + public MatrixStack getPoseStack() { + return poseStack; + } + + public int getTickDelta() { + return tickDelta; + } +} diff --git a/src/main/java/me/dustin/jex/event/render/EventRenderOverlay.java b/src/main/java/me/dustin/jex/event/render/EventRenderOverlay.java index 9a76ccc0d..6b2be1bfb 100644 --- a/src/main/java/me/dustin/jex/event/render/EventRenderOverlay.java +++ b/src/main/java/me/dustin/jex/event/render/EventRenderOverlay.java @@ -15,6 +15,6 @@ public Overlay getOverlay() { } public enum Overlay { - UNDERWATER, LAVA, IN_WALL, FIRE, VIGNETTE, PUMPKIN, PORTAL, COLD, SPYGLASS + UNDERWATER, LAVA, IN_WALL, FIRE, VIGNETTE, PUMPKIN, PORTAL, COLD, SPYGLASS, } } diff --git a/src/main/java/me/dustin/jex/feature/command/impl/CommandCopyNBT.java b/src/main/java/me/dustin/jex/feature/command/impl/CommandCopyNBT.java index 63356600e..e62e86f9d 100644 --- a/src/main/java/me/dustin/jex/feature/command/impl/CommandCopyNBT.java +++ b/src/main/java/me/dustin/jex/feature/command/impl/CommandCopyNBT.java @@ -19,7 +19,8 @@ public class CommandCopyNBT extends Command { public void registerCommand(CommandDispatcher dispatcher, CommandRegistryAccess commandRegistryAccess) { dispatcher.register(literal(this.name).executes(this).then(literal("display").executes(context -> { ItemStack itemStack = context.getSource().getPlayer().getMainHandStack(); - assert itemStack.getNbt() != null; + if (itemStack.getNbt() == null) + return 0; Wrapper.INSTANCE.getMinecraft().keyboard.setClipboard(itemStack.getNbt().toString().replace("\247", "\\247")); PrettyPrintTextFormatter prettyPrintTextFormatter = new PrettyPrintTextFormatter(); @@ -38,7 +39,8 @@ public int run(CommandContext context) throws Command return 0; } ItemStack itemStack = context.getSource().getPlayer().getMainHandStack(); - assert itemStack.getNbt() != null; + if (itemStack.getNbt() == null) + return 0; String nbt = itemStack.getNbt().toString(); Wrapper.INSTANCE.getMinecraft().keyboard.setClipboard(nbt.replace("\247", "\\247")); ChatHelper.INSTANCE.addClientMessage("NBT Copied to clipboard"); diff --git a/src/main/java/me/dustin/jex/feature/command/impl/CommandDupe.java b/src/main/java/me/dustin/jex/feature/command/impl/CommandDupe.java index d9073f15a..5b93395cf 100644 --- a/src/main/java/me/dustin/jex/feature/command/impl/CommandDupe.java +++ b/src/main/java/me/dustin/jex/feature/command/impl/CommandDupe.java @@ -59,14 +59,15 @@ public void registerCommand(CommandDispatcher dispatc @Override public int run(CommandContext context) throws CommandSyntaxException { - assert Wrapper.INSTANCE.getMinecraft().crosshairTarget != null; + if (Wrapper.INSTANCE.getMinecraft().crosshairTarget == null) + return 0; if (Wrapper.INSTANCE.getMinecraft().crosshairTarget.getType() == HitResult.Type.BLOCK) { BlockHitResult blockHitResult = (BlockHitResult) Wrapper.INSTANCE.getMinecraft().crosshairTarget; if (WorldHelper.INSTANCE.getBlock(blockHitResult.getBlockPos()) instanceof ShulkerBoxBlock) { Wrapper.INSTANCE.getClientPlayerInteractionManager().interactBlock(Wrapper.INSTANCE.getLocalPlayer(), Hand.MAIN_HAND, blockHitResult); ChatHelper.INSTANCE.addClientMessage("Running dupe"); this.blockHitResult = blockHitResult; - this.speedmine = Feature.getState(SpeedMine.class) && Feature.get(SpeedMine.class).modeProperty.value() == SpeedMine.Mode.INSTANT; + this.speedmine = Feature.getState(SpeedMine.class) && Feature.get(SpeedMine.class).modeProperty.value() == SpeedMine.Mode.PACKET; if (speedmine) { Feature.get(SpeedMine.class).setState(false); } diff --git a/src/main/java/me/dustin/jex/feature/command/impl/CommandVClip.java b/src/main/java/me/dustin/jex/feature/command/impl/CommandVClip.java index 99d6f439f..395ca9fd2 100644 --- a/src/main/java/me/dustin/jex/feature/command/impl/CommandVClip.java +++ b/src/main/java/me/dustin/jex/feature/command/impl/CommandVClip.java @@ -27,8 +27,7 @@ public void registerCommand(CommandDispatcher dispatc @Override public int run(CommandContext context) throws CommandSyntaxException { float num = FloatArgumentType.getFloat(context, "amount"); - NetworkHelper.INSTANCE.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(Wrapper.INSTANCE.getLocalPlayer().getX(), Wrapper.INSTANCE.getLocalPlayer().getY() + num, Wrapper.INSTANCE.getLocalPlayer().getZ(), false)); - NetworkHelper.INSTANCE.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(Wrapper.INSTANCE.getLocalPlayer().getX(), -1337.0, Wrapper.INSTANCE.getLocalPlayer().getZ(), true)); + Wrapper.INSTANCE.getLocalPlayer().setPos(Wrapper.INSTANCE.getLocalPlayer().getX(), Wrapper.INSTANCE.getLocalPlayer().getY() + num, Wrapper.INSTANCE.getLocalPlayer().getZ()); if (Wrapper.INSTANCE.getLocalPlayer().isRiding()) { Wrapper.INSTANCE.getLocalPlayer().getVehicle().setPos(Wrapper.INSTANCE.getLocalPlayer().getVehicle().getX(), Wrapper.INSTANCE.getLocalPlayer().getVehicle().getY() + num, Wrapper.INSTANCE.getLocalPlayer().getVehicle().getZ()); NetworkHelper.INSTANCE.sendPacket(new VehicleMoveC2SPacket(Wrapper.INSTANCE.getLocalPlayer().getVehicle())); diff --git a/src/main/java/me/dustin/jex/feature/mod/core/Category.java b/src/main/java/me/dustin/jex/feature/mod/core/Category.java index 7d100bf11..b549b66a2 100644 --- a/src/main/java/me/dustin/jex/feature/mod/core/Category.java +++ b/src/main/java/me/dustin/jex/feature/mod/core/Category.java @@ -11,7 +11,7 @@ public record Category(String name, int color) { public static final Category WORLD = new Category("World", new Color(74, 84, 255).getRGB()); public static final Category VISUAL = new Category("Visual", new Color(255, 92, 252).getRGB()); public static final Category MISC = new Category("Misc", new Color(247, 255, 65).getRGB()); - + public Category(String name, int color) { this.name = name; this.color = color; diff --git a/src/main/java/me/dustin/jex/feature/mod/core/Feature.java b/src/main/java/me/dustin/jex/feature/mod/core/Feature.java index 2d0581db4..ddab1241f 100644 --- a/src/main/java/me/dustin/jex/feature/mod/core/Feature.java +++ b/src/main/java/me/dustin/jex/feature/mod/core/Feature.java @@ -18,7 +18,10 @@ public class Feature { private final boolean defaultState; private final Property visibleProperty; - + + public Feature(Category category) { + this("", category, "", false, true, 0); + } public Feature(Category category, String description) { this("", category, description, false, true, 0); } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AnchorAura.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AnchorAura.java index 3a7bab029..d55d3d38d 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AnchorAura.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AnchorAura.java @@ -40,13 +40,20 @@ public class AnchorAura extends Feature { .build(); public final Property attackModeProperty = new Property.PropertyBuilder(this.getClass()) .name("Explode") - .description("The targeting mode for anchors.") .value(AttackMode.ANY) .build(); + public final Property explodeDistanceProperty = new Property.PropertyBuilder(this.getClass()) + .name("Explode Distance") + .value(5) + .min(2) + .max(6) + .build(); public final Property attackDelayProperty = new Property.PropertyBuilder(this.getClass()) - .name("Attack Delay (MS)") + .name("Attack Delay (ms)") .value(200L) - .max(2000) + .min(0) + .max(1000) + .inc(10) .build(); public final Property autoPlaceProperty = new Property.PropertyBuilder(this.getClass()) .name("Auto Place") @@ -76,13 +83,15 @@ public class AnchorAura extends Feature { .parent(visualizeProperty) .depends(parent -> (boolean)parent.value()) .build(); - public final Property placeDelayProperty = new Property.PropertyBuilder(this.getClass()) - .name("Place Delay") - .value(200L) - .max(2000) - .parent(autoPlaceProperty) - .depends(parent -> (boolean) parent.value()) - .build(); + public final Property edtaProperty = new Property.PropertyBuilder(this.getClass()) + .name("Anchor Distance to Enemy") + .value(5f) + .min(2) + .max(6) + .inc(0.1f) + .parent(autoPlaceProperty) + .depends(parent -> (boolean) parent.value()) + .build(); public final Property placeDistanceProperty = new Property.PropertyBuilder(this.getClass()) .name("Place Distance") .value(3.5f) @@ -92,11 +101,18 @@ public class AnchorAura extends Feature { .parent(autoPlaceProperty) .depends(parent -> (boolean) parent.value()) .build(); - public final Property explodeDistanceProperty = new Property.PropertyBuilder(this.getClass()) - .name("Explode Distance") - .value(5) - .min(2) - .max(6) + public final Property placeDelayProperty = new Property.PropertyBuilder(this.getClass()) + .name("Place Delay") + .value(200L) + .min(0) + .max(1000) + .inc(10) + .parent(autoPlaceProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property swingProperty = new Property.PropertyBuilder(this.getClass()) + .name("Swing") + .value(true) .build(); private final StopWatch placeStopWatch = new StopWatch(); @@ -104,7 +120,7 @@ public class AnchorAura extends Feature { private BlockPos placePos; public AnchorAura() { - super(Category.COMBAT, "Automatically place/charge/explode respawn anchors near players"); + super(Category.COMBAT); } @EventPointer @@ -117,7 +133,9 @@ public AnchorAura() { BlockPos chargedAnchor = getChargedAnchor(Wrapper.INSTANCE.getLocalPlayer()); if (chargedAnchor != null && shouldExplode(chargedAnchor)) { Wrapper.INSTANCE.getClientPlayerInteractionManager().interactBlock(Wrapper.INSTANCE.getLocalPlayer(), Hand.MAIN_HAND, new BlockHitResult(new Vec3d(chargedAnchor.getX(), chargedAnchor.getY(), chargedAnchor.getZ()), Direction.UP, chargedAnchor, false)); + if (swingProperty.value()) { Wrapper.INSTANCE.getLocalPlayer().swingHand(Hand.MAIN_HAND); + } attackStopWatch.reset(); return; } @@ -128,7 +146,9 @@ public AnchorAura() { int savedSlot = InventoryHelper.INSTANCE.getInventory().selectedSlot; InventoryHelper.INSTANCE.setSlot(glowstone, true, true); Wrapper.INSTANCE.getClientPlayerInteractionManager().interactBlock(Wrapper.INSTANCE.getLocalPlayer(), Hand.MAIN_HAND, new BlockHitResult(new Vec3d(anchor.getX(), anchor.getY(), anchor.getZ()), Direction.UP, anchor, false)); + if (swingProperty.value()) { Wrapper.INSTANCE.getLocalPlayer().swingHand(Hand.MAIN_HAND); + } InventoryHelper.INSTANCE.setSlot(savedSlot, true, true); attackStopWatch.reset(); return; @@ -178,14 +198,13 @@ public AnchorAura() { }); public BlockPos getOpenBlockPos(PlayerEntity entityPlayer) { - double distance = 6; + double distance; BlockPos closest = null; - for (int x = -4; x < 4; x++) { - for (int y = 0; y < 4; y++) { - for (int z = -4; z < 4; z++) { + for (int x = -explodeDistanceProperty.value(); x < explodeDistanceProperty.value(); x++) { + for (int y = explodeDistanceProperty.value(); y < explodeDistanceProperty.value(); y++) { + for (int z = -explodeDistanceProperty.value(); z < explodeDistanceProperty.value(); z++) { BlockPos pos = new BlockPos(entityPlayer.getX() + x, (int) entityPlayer.getY() - y, entityPlayer.getZ() + z); EndCrystalEntity fakeCrystal = new EndCrystalEntity(Wrapper.INSTANCE.getWorld(), pos.getX(), pos.getY(), pos.getZ()); - if (Wrapper.INSTANCE.getWorld().getBlockState(pos).getMaterial().isReplaceable() && entityPlayer.canSee(fakeCrystal) && Wrapper.INSTANCE.getLocalPlayer().canSee(fakeCrystal)) { BlockPos below = pos.down(); if (!Wrapper.INSTANCE.getWorld().getBlockState(below).getMaterial().isReplaceable()) { @@ -194,7 +213,7 @@ public BlockPos getOpenBlockPos(PlayerEntity entityPlayer) { continue; double playerdist = entityPlayer.distanceTo(fakeCrystal); double distToMe = Wrapper.INSTANCE.getLocalPlayer().distanceTo(fakeCrystal); - if (playerdist < distance && distToMe < placeDistanceProperty.value()) { + if (playerdist < edtaProperty.value() && distToMe < placeDistanceProperty.value()) { closest = pos; distance = playerdist; } @@ -208,7 +227,7 @@ public BlockPos getOpenBlockPos(PlayerEntity entityPlayer) { } private BlockPos getChargedAnchor(PlayerEntity entityPlayer) { - double distance = 6; + double distance; BlockPos closest = null; for (int x = -explodeDistanceProperty.value(); x < explodeDistanceProperty.value(); x++) { for (int y = -explodeDistanceProperty.value(); y < explodeDistanceProperty.value(); y++) { @@ -220,7 +239,7 @@ private BlockPos getChargedAnchor(PlayerEntity entityPlayer) { continue; double playerdist = ClientMathHelper.INSTANCE.getDistance(entityPlayer.getPos(), new Vec3d(pos.getX(), pos.getY(), pos.getZ())); double distToMe = ClientMathHelper.INSTANCE.getDistance(Wrapper.INSTANCE.getLocalPlayer().getPos(), new Vec3d(pos.getX(), pos.getY(), pos.getZ())); - if (playerdist < distance && distToMe < explodeDistanceProperty.value()) { + if (playerdist < edtaProperty.value() && distToMe < explodeDistanceProperty.value()) { closest = pos; distance = playerdist; } @@ -232,7 +251,7 @@ private BlockPos getChargedAnchor(PlayerEntity entityPlayer) { } private BlockPos getAnchor(PlayerEntity entityPlayer) { - double distance = 6; + double distance; BlockPos closest = null; for (int x = -explodeDistanceProperty.value(); x < explodeDistanceProperty.value(); x++) { for (int y = -explodeDistanceProperty.value(); y < explodeDistanceProperty.value(); y++) { @@ -244,7 +263,7 @@ private BlockPos getAnchor(PlayerEntity entityPlayer) { continue; double playerdist = ClientMathHelper.INSTANCE.getDistance(entityPlayer.getPos(), new Vec3d(pos.getX(), pos.getY(), pos.getZ())); double distToMe = ClientMathHelper.INSTANCE.getDistance(Wrapper.INSTANCE.getLocalPlayer().getPos(), new Vec3d(pos.getX(), pos.getY(), pos.getZ())); - if (playerdist < distance && distToMe < explodeDistanceProperty.value()) { + if (playerdist < edtaProperty.value() && distToMe < explodeDistanceProperty.value()) { closest = pos; distance = playerdist; } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AntiFireball.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AntiFireball.java deleted file mode 100644 index a62dd0b87..000000000 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AntiFireball.java +++ /dev/null @@ -1,54 +0,0 @@ -package me.dustin.jex.feature.mod.impl.combat; - -import me.dustin.events.core.EventListener; -import me.dustin.jex.event.filters.PlayerPacketsFilter; -import me.dustin.jex.event.player.EventPlayerPackets; -import me.dustin.jex.feature.mod.core.Category; -import me.dustin.jex.feature.property.Property; -import me.dustin.jex.helper.math.vector.RotationVector; -import me.dustin.jex.helper.misc.Wrapper; -import me.dustin.jex.helper.player.PlayerHelper; -import net.minecraft.entity.projectile.FireballEntity; -import net.minecraft.util.Hand; -import me.dustin.jex.feature.mod.core.Feature; -import me.dustin.events.core.annotate.EventPointer; - -public class AntiFireball extends Feature { - - public final Property rangeProperty = new Property.PropertyBuilder(this.getClass()) - .name("Range") - .value(5f) - .min(1) - .max(6) - .inc(0.1f) - .build(); - public final Property rotateProperty = new Property.PropertyBuilder(this.getClass()) - .name("Rotate") - .value(true) - .build(); - public final Property swingProperty = new Property.PropertyBuilder(this.getClass()) - .name("Swing") - .description("Whether or not to swing your arm.") - .value(true) - .build(); - - public AntiFireball() { - super(Category.COMBAT, "Knock away fireballs from ghasts"); - } - - @EventPointer - private final EventListener eventPlayerPacketsEventListener = new EventListener<>(event -> Wrapper.INSTANCE.getWorld().getEntities().forEach(entity -> { - if (entity instanceof FireballEntity fireballEntity) { - if (fireballEntity.distanceTo(Wrapper.INSTANCE.getLocalPlayer()) <= rangeProperty.value()) { - if (rotateProperty.value()) { - RotationVector rotation = PlayerHelper.INSTANCE.rotateToEntity(fireballEntity); - event.setRotation(rotation); - } - if (swingProperty.value()) { - Wrapper.INSTANCE.getLocalPlayer().swingHand(Hand.MAIN_HAND); - } - Wrapper.INSTANCE.getClientPlayerInteractionManager().attackEntity(Wrapper.INSTANCE.getLocalPlayer(), fireballEntity); - } - } - }), new PlayerPacketsFilter(EventPlayerPackets.Mode.PRE)); -} diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AntiKnockback.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AntiKnockback.java index cffc1ad5d..4e053ce91 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AntiKnockback.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AntiKnockback.java @@ -9,47 +9,75 @@ import me.dustin.jex.feature.mod.core.Category; import me.dustin.jex.feature.mod.core.Feature; import me.dustin.jex.feature.property.Property; +import java.lang.Math; public class AntiKnockback extends Feature { - public final Property percentProperty = new Property.PropertyBuilder(this.getClass()) - .name("Percent") + public final Property pxProperty = new Property.PropertyBuilder(this.getClass()) + .name("PercentX") .value(0) - .min(-300) - .max(300) - .inc(10) + .min(-100) + .max(100) + .inc(2) .build(); - + public final Property pyProperty = new Property.PropertyBuilder(this.getClass()) + .name("PercentY") + .value(0) + .min(-100) + .max(100) + .inc(2) + .build(); + public final Property pzProperty = new Property.PropertyBuilder(this.getClass()) + .name("PercentZ") + .value(0) + .min(-100) + .max(100) + .inc(2) + .build(); + public final Property epxProperty = new Property.PropertyBuilder(this.getClass()) + .name("ExplosionX") + .value(0) + .min(-100) + .max(100) + .inc(2) + .build(); + public final Property epyProperty = new Property.PropertyBuilder(this.getClass()) + .name("ExplosionY") + .value(0) + .min(-100) + .max(100) + .inc(2) + .build(); + public final Property epzProperty = new Property.PropertyBuilder(this.getClass()) + .name("ExplosionZ") + .value(0) + .min(-100) + .max(100) + .inc(2) + .build(); + public AntiKnockback() { - super(Category.COMBAT, "Remove all knockback from the player."); + super(Category.COMBAT); } @EventPointer private final EventListener eventExplosionVelocityEventListener = new EventListener<>(event -> { - float perc = percentProperty.value() / 100.0f; - if (percentProperty.value() == 0) - event.cancel(); - else { - event.setMultX(perc); - event.setMultY(perc); - event.setMultZ(perc); - } + float epx = epxProperty.value() / 100.0f; + float epy = epyProperty.value() / 100.0f; + float epz = epzProperty.value() / 100.0f; + event.setMultX(epx); + event.setMultY(epy); + event.setMultZ(epz); + }); @EventPointer private final EventListener eventPlayerVelocityEventListener = new EventListener<>(event -> { - float perc = percentProperty.value() / 100.0f; - if (percentProperty.value() == 0) - event.cancel(); - else { - event.setVelocityX((int)(event.getVelocityX() * perc)); - event.setVelocityY((int)(event.getVelocityY() * perc)); - event.setVelocityZ((int)(event.getVelocityZ() * perc)); - } + float px = pxProperty.value() / 100.0f; + float py = pyProperty.value() / 100.0f; + float pz = pzProperty.value() / 100.0f; + event.setVelocityX((int)(event.getVelocityX() * px)); + event.setVelocityY((int)(event.getVelocityY() * py)); + event.setVelocityZ((int)(event.getVelocityZ() * pz)); }); - - @EventPointer - private final EventListener eventPlayerPacketsEventListener = new EventListener<>(event -> { - this.setSuffix(percentProperty.value() + "%"); - }, new PlayerPacketsFilter(EventPlayerPackets.Mode.PRE)); } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoArmor.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoArmor.java index b27f1b622..919a2b445 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoArmor.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoArmor.java @@ -32,7 +32,7 @@ public class AutoArmor extends Feature { private final StopWatch stopWatch = new StopWatch(); public AutoArmor() { - super(Category.COMBAT, "Puts on the best armor in your inventory automatically."); + super(Category.COMBAT); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoCope.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoCope.java index 6910f7098..fd6c98bd1 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoCope.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoCope.java @@ -26,7 +26,7 @@ public class AutoCope extends Feature { private final ArrayList messages = new ArrayList<>(); public AutoCope() { - super(Category.COMBAT, "Automatically send messages when you die to a player. Configurable messages in .minecraft/JexClient/CopeMessages.json"); + super(Category.COMBAT); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoEZ.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoEZ.java index 067ddfade..d8db3ef76 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoEZ.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoEZ.java @@ -29,7 +29,6 @@ public class AutoEZ extends Feature { public final Property killDetectDelayProperty = new Property.PropertyBuilder(this.getClass()) .name("Max Kill Detect Delay(MS)") - .description("The amount of time between attacking someone and them dying to consider it a kill.") .value(200L) .min(100) .max(500) @@ -41,7 +40,7 @@ public class AutoEZ extends Feature { private boolean isFighting; public AutoEZ() { - super(Category.COMBAT, "Automatically send messages when you kill players. Configurable messages in .minecraft/JexClient/KillMessages.json"); + super(Category.COMBAT); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoGapple.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoGapple.java index dc401af54..fbac6f6e2 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoGapple.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoGapple.java @@ -30,18 +30,16 @@ public class AutoGapple extends Feature { public final Property eatForPotionsProperty = new Property.PropertyBuilder(this.getClass()) .name("Eat for Potions") - .description("Eat Gapples for the potion effects") .value(true) .build(); public final Property healthProperty = new Property.PropertyBuilder(this.getClass()) .name("Health") .value(10) - .min(5) - .max(19) + .min(1) + .max(20) .build(); public final Property pressKeyProperty = new Property.PropertyBuilder(this.getClass()) .name("Press Key") - .description("Press the right-click key while eating to give animation") .value(true) .build(); public final Property takeFromInvProperty = new Property.PropertyBuilder(this.getClass()) @@ -56,7 +54,6 @@ public class AutoGapple extends Feature { .build(); public final Property putBackProperty = new Property.PropertyBuilder(this.getClass()) .name("Put Back") - .description("Whether or not to put the gapples back in the slot they came from.") .value(true) .parent(takeFromInvProperty) .depends(parent -> (boolean) parent.value()) @@ -74,7 +71,7 @@ public class AutoGapple extends Feature { private boolean isEating; public AutoGapple() { - super(Category.COMBAT, "Automatically eat God Apples as needed"); + super(Category.COMBAT); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoPot.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoPot.java index 6beb17fd5..ebe467da8 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoPot.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoPot.java @@ -22,25 +22,36 @@ public class AutoPot extends Feature { .value(17) .min(1) .max(20) + .inc(1) .build(); public final Property delayProperty = new Property.PropertyBuilder(this.getClass()) .name("Delay (MS)") .value(160L) + .min(0) .max(1000) .inc(10) .build(); public final Property throwdelayProperty = new Property.PropertyBuilder(this.getClass()) .name("Throw Delay (MS)") .value(20L) + .min(0) .max(1000) + .inc(10) .build(); + public final Property pitchProperty = new Property.PropertyBuilder(this.getClass()) + .name("VerticalRotation") + .value(0.1f) + .min(-90f) + .max(90f) + .inc(0.1f) + .build(); public boolean throwing = false; int savedSlot; private final StopWatch stopWatch = new StopWatch(); public AutoPot() { - super(Category.COMBAT, "Uses health potions when health goes below selected amount."); + super(Category.COMBAT); } @EventPointer @@ -48,7 +59,7 @@ public AutoPot() { this.setSuffix(getPotions() + ""); if (event.getMode() == EventPlayerPackets.Mode.PRE) { if (throwing) { - event.setPitch(90); + event.setPitch(pitchProperty.value()); } if (!stopWatch.hasPassed(delayProperty.value()) || throwing) return; @@ -56,14 +67,14 @@ public AutoPot() { if (getFirstPotion() < 9) { throwing = true; - event.setPitch(90); + event.setPitch(pitchProperty.value()); event.setYaw(PlayerHelper.INSTANCE.getYaw()); savedSlot = InventoryHelper.INSTANCE.getInventory().selectedSlot; InventoryHelper.INSTANCE.setSlot(getFirstPotion(), true, true); stopWatch.reset(); } else { InventoryHelper.INSTANCE.windowClick(Wrapper.INSTANCE.getLocalPlayer().currentScreenHandler, getFirstPotion() < 9 ? getFirstPotion() + 36 : getFirstPotion(), SlotActionType.SWAP, 8); - event.setPitch(90); + event.setPitch(pitchProperty.value()); event.setYaw(PlayerHelper.INSTANCE.getYaw()); savedSlot = InventoryHelper.INSTANCE.getInventory().selectedSlot; InventoryHelper.INSTANCE.setSlot(8, true, true); diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoSoup.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoSoup.java index 81b19cfae..67d449e8a 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoSoup.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoSoup.java @@ -25,20 +25,23 @@ public class AutoSoup extends Feature { public final Property delayProperty = new Property.PropertyBuilder(this.getClass()) .name("Delay (MS)") .value(160L) + .min(0) .max(1000) .inc(10) .build(); public final Property usedelayProperty = new Property.PropertyBuilder(this.getClass()) .name("Use Delay (MS)") .value(20L) + .min(0) .max(1000) + .inc(10) .build(); public boolean throwing = false; int savedSlot; private final StopWatch stopWatch = new StopWatch(); public AutoSoup() { - super(Category.COMBAT, "Eats soup when your health gets below a certain amount."); + super(Category.COMBAT); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoTotem.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoTotem.java index a193365dd..a09c390f2 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoTotem.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoTotem.java @@ -13,14 +13,20 @@ import me.dustin.jex.helper.player.InventoryHelper; import net.minecraft.client.gui.screen.ingame.InventoryScreen; import net.minecraft.item.Items; +import me.dustin.jex.helper.misc.StopWatch; import net.minecraft.network.packet.c2s.play.CloseHandledScreenC2SPacket; import me.dustin.events.core.annotate.EventPointer; public class AutoTotem extends Feature { + public final Property delayProperty = new Property.PropertyBuilder(this.getClass()) + .name("Delay") + .value(0) + .max(1000) + .inc(10) + .build(); public final Property activateWhenProperty = new Property.PropertyBuilder(this.getClass()) .name("When") - .description("When the totem should go into your offhand") .value(ActivateTime.ALWAYS) .build(); public final Property replaceOffhandProperty = new Property.PropertyBuilder(this.getClass()) @@ -32,21 +38,21 @@ public class AutoTotem extends Feature { public final Property healthProperty = new Property.PropertyBuilder(this.getClass()) .name("Health") .value(10) - .min(5) - .max(17) + .min(1) + .max(20) .parent(activateWhenProperty) .depends(parent -> parent.value() == ActivateTime.LOW_HEALTH) .build(); public final Property openInventoryProperty = new Property.PropertyBuilder(this.getClass()) .name("Open Inventory") - .description("Tells the server you opened your inventory before moving the totem.") .value(false) .build(); private int swappedSlot; + private final StopWatch stopWatch = new StopWatch(); public AutoTotem() { - super(Category.COMBAT, "Keep a Totem in your offhand at all times."); + super(Category.COMBAT); } @EventPointer @@ -83,13 +89,14 @@ public boolean needsOffhandTotem() { } public void moveTotem(int slot) { - if (openInventoryProperty.value()) - Wrapper.INSTANCE.getMinecraft().setScreen(new InventoryScreen(Wrapper.INSTANCE.getLocalPlayer())); + if (stopWatch.hasPassed(delayProperty.value())) { InventoryHelper.INSTANCE.moveToOffhand(slot); if (openInventoryProperty.value()) { + Wrapper.INSTANCE.getMinecraft().setScreen(new InventoryScreen(Wrapper.INSTANCE.getLocalPlayer())); NetworkHelper.INSTANCE.sendPacket(new CloseHandledScreenC2SPacket(Wrapper.INSTANCE.getLocalPlayer().currentScreenHandler.syncId)); Wrapper.INSTANCE.getMinecraft().setScreen(null); } + } } public enum ActivateTime { diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoTrap.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoTrap.java index df1dbd410..8a57a2d8f 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoTrap.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoTrap.java @@ -30,7 +30,6 @@ public class AutoTrap extends Feature { public final Property rotateProperty = new Property.PropertyBuilder(this.getClass()) .name("Rotate") - .description("Whether or not to rotate your head for the server when placing blocks.") .value(true) .build(); public final Property targetDistanceProperty = new Property.PropertyBuilder(this.getClass()) @@ -55,7 +54,7 @@ public class AutoTrap extends Feature { private BlockPos placingPos; public AutoTrap() { - super(Category.COMBAT, "Automatically trap people in boxes of obsidian"); + super(Category.COMBAT); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoWeapon.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoWeapon.java index 163ce8498..5b58066de 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoWeapon.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/AutoWeapon.java @@ -20,7 +20,6 @@ public class AutoWeapon extends Feature { public final Property livingOnlyProperty = new Property.PropertyBuilder(this.getClass()) .name("Living Only") - .description("Only pull your weapon out for living entities.") .value(true) .build(); public final Property mode = new Property.PropertyBuilder(this.getClass()) @@ -29,7 +28,7 @@ public class AutoWeapon extends Feature { .build(); public AutoWeapon() { - super(Category.COMBAT, "Automatically swap to the best weapon when attacking."); + super(Category.COMBAT); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/BowBomb.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/BowBomb.java index 1e7dddf24..981e22e66 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/BowBomb.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/BowBomb.java @@ -13,24 +13,33 @@ import me.dustin.events.core.annotate.EventPointer; public class BowBomb extends Feature { - + public final Property amountProperty = new Property.PropertyBuilder(this.getClass()) .name("Amount") - .description("The amount of \"hops\" to make before shooting the arrow") - .value(100) - .max(1000) - .inc(10) + .value(10) + .min(2) + .max(100) + .inc(1) + .build(); + public final Property exponentialProperty = new Property.PropertyBuilder(this.getClass()) + .name("Exponential") + .value(2) + .min(1) + .max(14) + .inc(1) .build(); + public BowBomb() { - super(Category.COMBAT, "Bow Exploit"); + super(Category.COMBAT); } @EventPointer private final EventListener eventStopUsingItem = new EventListener<>(event -> { ClientPlayerEntity player = Wrapper.INSTANCE.getLocalPlayer(); if (player.getMainHandStack().getItem().equals(Items.BOW)) { player.networkHandler.sendPacket(new ClientCommandC2SPacket(player, ClientCommandC2SPacket.Mode.START_SPRINTING)); - for (int i = 0; i < amountProperty.value(); ++i) { + long cycles = (long) Math.pow(amountProperty.value(), exponentialProperty.value()); + for (int i = 0; i < cycles; ++i) { player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(player.getX(), player.getY() - 1.0E-9, player.getZ(), true)); player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(player.getX(), player.getY() + 1.0E-9, player.getZ(), false)); } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/Criticals.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/Criticals.java index e82633a09..6f7e06d57 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/Criticals.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/Criticals.java @@ -5,6 +5,7 @@ import me.dustin.jex.event.player.EventAttackEntity; import me.dustin.jex.feature.mod.core.Category; import me.dustin.jex.feature.mod.core.Feature; +import me.dustin.jex.helper.misc.StopWatch; import me.dustin.jex.feature.property.Property; import me.dustin.jex.helper.misc.Wrapper; import me.dustin.jex.helper.network.NetworkHelper; @@ -13,51 +14,53 @@ import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; public class Criticals extends Feature { - + public final Property livingOnlyProperty = new Property.PropertyBuilder(this.getClass()) .name("Living Only") .description("Only use Criticals on living entities.") .value(true) .build(); - public final Property extraParticlesProperty = new Property.PropertyBuilder(this.getClass()) - .name("Extra Particles") - .description("Whether or not to add extra (fake) critical particles.") - .value(true) + public final Property delayProperty = new Property.PropertyBuilder(this.getClass()) + .name("Time Delay (ms)") + .value(0) + .min(0) + .max(2000) + .inc(20) .build(); public final Property amountProperty = new Property.PropertyBuilder(this.getClass()) - .name("Amount") + .name("Packet Amount") .value(5) .min(1) .max(20) .inc(1) - .parent(extraParticlesProperty) - .depends(parent -> (boolean) parent.value()) .build(); public Criticals() { - super(Category.COMBAT, "Automatically deal critical strikes when attacking."); + super(Category.COMBAT); } + + private final StopWatch stopWatch = new StopWatch(); @EventPointer private final EventListener eventAttackEntityEventListener = new EventListener<>(event -> { if (livingOnlyProperty.value() && !(event.getEntity() instanceof LivingEntity)) return; - if (extraParticlesProperty.value()) { - for (int i = 0; i < amountProperty.value(); i++) { - Wrapper.INSTANCE.getLocalPlayer().addCritParticles(event.getEntity()); - } - } - if (Wrapper.INSTANCE.getLocalPlayer().isSprinting()) //mc recently (1.15?) made it so you can't crit while sprinting + if (Wrapper.INSTANCE.getLocalPlayer().isSprinting()) NetworkHelper.INSTANCE.sendPacket(new ClientCommandC2SPacket(Wrapper.INSTANCE.getLocalPlayer(), ClientCommandC2SPacket.Mode.STOP_SPRINTING)); crit(); }); public void crit() { - if (Wrapper.INSTANCE.getLocalPlayer().isOnGround() && !(Wrapper.INSTANCE.getLocalPlayer().isInLava() || Wrapper.INSTANCE.getLocalPlayer().isTouchingWater())) { +if (stopWatch.hasPassed(delayProperty.value())) { + for (int i = 0; i < amountProperty.value(); i++) { + if (Wrapper.INSTANCE.getLocalPlayer().isOnGround()) { Wrapper.INSTANCE.getLocalPlayer().networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(Wrapper.INSTANCE.getLocalPlayer().getX(), Wrapper.INSTANCE.getLocalPlayer().getY() + 0.05F, Wrapper.INSTANCE.getLocalPlayer().getZ(), false)); Wrapper.INSTANCE.getLocalPlayer().networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(Wrapper.INSTANCE.getLocalPlayer().getX(), Wrapper.INSTANCE.getLocalPlayer().getY(), Wrapper.INSTANCE.getLocalPlayer().getZ(), false)); Wrapper.INSTANCE.getLocalPlayer().networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(Wrapper.INSTANCE.getLocalPlayer().getX(), Wrapper.INSTANCE.getLocalPlayer().getY() + 0.012511F, Wrapper.INSTANCE.getLocalPlayer().getZ(), false)); - Wrapper.INSTANCE.getLocalPlayer().networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(Wrapper.INSTANCE.getLocalPlayer().getX(), Wrapper.INSTANCE.getLocalPlayer().getY(), Wrapper.INSTANCE.getLocalPlayer().getZ(), false)); + Wrapper.INSTANCE.getLocalPlayer().networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(Wrapper.INSTANCE.getLocalPlayer().getX(), Wrapper.INSTANCE.getLocalPlayer().getY(), Wrapper.INSTANCE.getLocalPlayer().getZ(), false)); } + stopWatch.reset(); + } } + } } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/CrystalAura.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/CrystalAura.java index 0c6ba1125..e9f7f5ad2 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/CrystalAura.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/CrystalAura.java @@ -38,7 +38,6 @@ public class CrystalAura extends Feature { .build(); public final Property attackModeProperty = new Property.PropertyBuilder(this.getClass()) .name("Explode") - .description("The targeting mode for crystals.") .value(AttackMode.ANY) .build(); public final Property attackDistanceProperty = new Property.PropertyBuilder(this.getClass()) @@ -49,14 +48,47 @@ public class CrystalAura extends Feature { .inc(0.1f) .build(); public final Property attackDelayProperty = new Property.PropertyBuilder(this.getClass()) - .name("Attack Delay (MS)") + .name("Attack Delay") .value(200L) - .max(2000) + .min(0L) + .max(1000L) + .inc(10L) + .build(); + public final Property rotateProperty = new Property.PropertyBuilder(this.getClass()) + .name("Rotate to crystal") + .value(false) .build(); public final Property autoPlaceProperty = new Property.PropertyBuilder(this.getClass()) .name("Auto Place") .value(false) .build(); + public final Property placeDelayProperty = new Property.PropertyBuilder(this.getClass()) + .name("Place Delay") + .value(0L) + .min(0L) + .max(1000) + .inc(10L) + .parent(autoPlaceProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property placeDistanceProperty = new Property.PropertyBuilder(this.getClass()) + .name("Place Distance") + .value(3.5f) + .min(1) + .max(6) + .inc(0.1f) + .parent(autoPlaceProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property edtcProperty = new Property.PropertyBuilder(this.getClass()) + .name("Crystal Distance to Enemy") + .value(5f) + .min(1) + .max(6) + .inc(0.1f) + .parent(autoPlaceProperty) + .depends(parent -> (boolean) parent.value()) + .build(); public final Property visualizeProperty = new Property.PropertyBuilder(this.getClass()) .name("Visualize") .value(true) @@ -81,28 +113,16 @@ public class CrystalAura extends Feature { .parent(visualizeProperty) .depends(parent -> (boolean)parent.value()) .build(); - public final Property placeDelayProperty = new Property.PropertyBuilder(this.getClass()) - .name("Place Delay") - .value(200L) - .max(2000) - .parent(autoPlaceProperty) - .depends(parent -> (boolean) parent.value()) - .build(); - public final Property placeDistanceProperty = new Property.PropertyBuilder(this.getClass()) - .name("Place Distance") - .value(3.5f) - .min(1) - .max(6) - .inc(0.1f) - .parent(autoPlaceProperty) - .depends(parent -> (boolean) parent.value()) - .build(); + public final Property swingProperty = new Property.PropertyBuilder(this.getClass()) + .name("Swing") + .value(true) + .build(); private final StopWatch stopWatch = new StopWatch(); private BlockPos placePos; public CrystalAura() { - super(Category.COMBAT, "Auto place/destroy End Crystals"); + super(Category.COMBAT); } @EventPointer @@ -112,7 +132,7 @@ public CrystalAura() { boolean offhand = Wrapper.INSTANCE.getLocalPlayer() != null && Wrapper.INSTANCE.getLocalPlayer().getOffHandStack().getItem() == Items.END_CRYSTAL; if (event.getMode() == EventPlayerPackets.Mode.PRE) { this.setSuffix(modeProperty.value()); - if (placePos != null) { + if (placePos != null && rotateProperty.value()) { RotationVector rotation = PlayerHelper.INSTANCE.rotateToVec(Wrapper.INSTANCE.getLocalPlayer(), new Vec3d(placePos.getX(), placePos.getY(), placePos.getZ()).add(new Vec3d(0.5, 0.5, 0.5))); event.setRotation(rotation); } @@ -124,9 +144,11 @@ public CrystalAura() { BlockPos placingPos = getOpenBlockPos(entityPlayer); if (placingPos != null) { EndCrystalEntity crystal = new EndCrystalEntity(Wrapper.INSTANCE.getWorld(), placingPos.getX(), placingPos.getY(), placingPos.getZ()); - if (entityPlayer.distanceTo(crystal) <= 6 && Wrapper.INSTANCE.getLocalPlayer().distanceTo(crystal) <= 6 && !FriendHelper.INSTANCE.isFriend(entityPlayer.getName().getString()) && entityPlayer.getHealth() > 0 && shouldAttack(crystal)) { + if (entityPlayer.distanceTo(crystal) <= edtcProperty.value() && Wrapper.INSTANCE.getLocalPlayer().distanceTo(crystal) <= placeDistanceProperty.value() && !FriendHelper.INSTANCE.isFriend(entityPlayer.getName().getString()) && entityPlayer.getHealth() > 0 && shouldAttack(crystal)) { + if (rotateProperty.value()) { RotationVector rotation = PlayerHelper.INSTANCE.rotateToVec(Wrapper.INSTANCE.getLocalPlayer(), new Vec3d(getOpenBlockPos(entityPlayer).down().getX(), getOpenBlockPos(entityPlayer).down().getY(), getOpenBlockPos(entityPlayer).down().getZ()).add(new Vec3d(0.5, 0.5, 0.5))); event.setRotation(rotation); + } placePos = placingPos.down(); stopWatch.reset(); return; @@ -136,20 +158,24 @@ public CrystalAura() { }); } Wrapper.INSTANCE.getWorld().getEntities().forEach(entity -> { + if (stopWatch.hasPassed(attackDelayProperty.value())) if (entity instanceof EndCrystalEntity enderCrystalEntity) { if (shouldAttack(enderCrystalEntity)) { + if (rotateProperty.value()) { RotationVector rotation = PlayerHelper.INSTANCE.rotateToEntity(enderCrystalEntity); event.setRotation(rotation); + } Wrapper.INSTANCE.getClientPlayerInteractionManager().attackEntity(Wrapper.INSTANCE.getLocalPlayer(), enderCrystalEntity); - Wrapper.INSTANCE.getLocalPlayer().swingHand(Hand.MAIN_HAND); + if (swingProperty.value()) { + Wrapper.INSTANCE.getLocalPlayer().swingHand(Hand.MAIN_HAND); + } } - } + } }); } else { if (placePos != null) { BlockHitResult blockHitResult = new BlockHitResult(new Vec3d(placePos.getX(), placePos.getY(), placePos.getZ()), Direction.UP, placePos, false); Wrapper.INSTANCE.getClientPlayerInteractionManager().interactBlock(Wrapper.INSTANCE.getLocalPlayer(), offhand ? Hand.OFF_HAND : Hand.MAIN_HAND, blockHitResult); - Wrapper.INSTANCE.getLocalPlayer().swingHand(offhand ? Hand.OFF_HAND : Hand.MAIN_HAND); placePos = null; } } @@ -174,9 +200,9 @@ public CrystalAura() { public BlockPos getOpenBlockPos(PlayerEntity entityPlayer) { double d = 0; BlockPos closest = null; - for (int x = -4; x < 4; x++) { - for (int y = -1; y < 4; y++) { - for (int z = -4; z < 4; z++) { + for (float x = -attackDistanceProperty.value(); x < attackDistanceProperty.value(); x++) { + for (float y = -attackDistanceProperty.value(); y < attackDistanceProperty.value(); y++) { + for (float z = -attackDistanceProperty.value(); z < attackDistanceProperty.value(); z++) { BlockPos pos = new BlockPos(entityPlayer.getX() + x, (int) entityPlayer.getY() - y, entityPlayer.getZ() + z); EndCrystalEntity fakeCrystal = new EndCrystalEntity(Wrapper.INSTANCE.getWorld(), pos.getX(), pos.getY(), pos.getZ()); @@ -189,10 +215,9 @@ public BlockPos getOpenBlockPos(PlayerEntity entityPlayer) { if (belowBlock == Blocks.OBSIDIAN || belowBlock == Blocks.BEDROCK) { if (!shouldAttack(fakeCrystal)) continue; - double playerdist = entityPlayer.distanceTo(fakeCrystal) - (pos.getY() - entityPlayer.getY()); double damage = WorldHelper.INSTANCE.calcExplosionDamage(6, entityPlayer, pos); double damageToMe = WorldHelper.INSTANCE.calcExplosionDamage(6, Wrapper.INSTANCE.getLocalPlayer(), pos); - double eff = damage - playerdist - damageToMe; + double eff = damage - damageToMe; if (eff > d) { closest = pos; d = eff; @@ -228,12 +253,14 @@ public boolean shouldAttack(EndCrystalEntity enderCrystalEntity) { float damage = WorldHelper.INSTANCE.calcExplosionDamage(6, Wrapper.INSTANCE.getLocalPlayer(), enderCrystalEntity.getBlockPos()); if (modeProperty.value() == TargetMode.RISKY) return damage <= 65; + if (modeProperty.value() == TargetMode.SAFE) + return damage < 65; return true; } public boolean isTarget(LivingEntity livingEntity, EndCrystalEntity enderCrystalEntity) { if (livingEntity instanceof PlayerEntity && livingEntity != Wrapper.INSTANCE.getLocalPlayer()) { - return !FriendHelper.INSTANCE.isFriend(livingEntity.getName().getString()) && livingEntity.distanceTo(enderCrystalEntity) <= 6 && livingEntity.getHealth() > 0; + return !FriendHelper.INSTANCE.isFriend(livingEntity.getName().getString()) && livingEntity.distanceTo(enderCrystalEntity) <= edtcProperty.value() && livingEntity.getHealth() > 0; } return false; } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/Hitboxes.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/Hitboxes.java index 29fe8a0f3..6b3a9dd74 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/Hitboxes.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/Hitboxes.java @@ -3,29 +3,170 @@ import me.dustin.events.core.EventListener; import me.dustin.events.core.annotate.EventPointer; import me.dustin.jex.event.misc.EventEntityHitbox; +import me.dustin.jex.helper.entity.EntityHelper; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.mob.PiglinEntity; +import me.dustin.jex.feature.mod.core.Feature; +import net.minecraft.entity.mob.ZombifiedPiglinEntity; +import net.minecraft.entity.passive.IronGolemEntity; +import net.minecraft.entity.Entity; +import net.minecraft.entity.LivingEntity; +import me.dustin.jex.helper.player.FriendHelper; import me.dustin.jex.feature.mod.core.Category; import me.dustin.jex.feature.property.Property; import me.dustin.jex.helper.misc.Wrapper; -import me.dustin.jex.feature.mod.core.Feature; +import net.minecraft.util.math.Box; public class Hitboxes extends Feature { - public final Property expansionProperty = new Property.PropertyBuilder(this.getClass()) - .name("Expansion") - .value(0.5f) - .min(0.5f) - .max(2) - .inc(0.1f) + public final Property expandXProperty = new Property.PropertyBuilder(this.getClass()) + .name("ExpandX") + .value(0.1f) + .min(0f) + .max(2f) + .inc(0.02f) .build(); - + public final Property expandYProperty = new Property.PropertyBuilder(this.getClass()) + .name("ExpandY") + .value(0.1f) + .min(0f) + .max(2f) + .inc(0.02f) + .build(); + public final Property expandZProperty = new Property.PropertyBuilder(this.getClass()) + .name("ExpandZ") + .value(0.1f) + .min(0f) + .max(2f) + .inc(0.02f) + .build(); + public final Property playerProperty = new Property.PropertyBuilder(this.getClass()) + .name("Player") + .value(true) + .build(); + public final Property friendProperty = new Property.PropertyBuilder(this.getClass()) + .name("Friends") + .value(true) + .parent(playerProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property neutralProperty = new Property.PropertyBuilder(this.getClass()) + .name("Neutral") + .value(false) + .build(); + public final Property bossProperty = new Property.PropertyBuilder(this.getClass()) + .name("Boss") + .value(true) + .build(); + public final Property hostileProperty = new Property.PropertyBuilder(this.getClass()) + .name("Hostile") + .value(true) + .build(); + public final Property passiveProperty = new Property.PropertyBuilder(this.getClass()) + .name("Passive") + .value(true) + .build(); + public final Property petProperty = new Property.PropertyBuilder(this.getClass()) + .name("Pet") + .value(false) + .parent(passiveProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property specificFilterProperty = new Property.PropertyBuilder(this.getClass()) + .name("Specific Filter") + .value(true) + .build(); + public final Property ironGolemProperty = new Property.PropertyBuilder(this.getClass()) + .name("Iron Golem") + .value(true) + .parent(specificFilterProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property piglinProperty = new Property.PropertyBuilder(this.getClass()) + .name("Piglin") + .value(true) + .parent(specificFilterProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property zombiePiglinProperty = new Property.PropertyBuilder(this.getClass()) + .name("Zombie Piglin") + .value(false) + .parent(specificFilterProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property botCheckProperty = new Property.PropertyBuilder(this.getClass()) + .name("Bot") + .value(true) + .build(); + public final Property teamCheckProperty = new Property.PropertyBuilder(this.getClass()) + .name("Team Check") + .value(true) + .parent(botCheckProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property checkArmorProperty = new Property.PropertyBuilder(this.getClass()) + .name("Check Armor") + .value(true) + .parent(teamCheckProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property nolivingProperty = new Property.PropertyBuilder(this.getClass()) + .name("NoLiving") + .value(false) + .parent(specificFilterProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public Hitboxes() { - super(Category.COMBAT, "Resize entity hitboxes to make them easier to hit"); + super(Category.COMBAT); } @EventPointer private final EventListener eventEntityHitboxEventListener = new EventListener<>(event -> { + Entity entity = event.getEntity(); + if (isEnabled(entity)) { if (event.getEntity() == null || Wrapper.INSTANCE.getLocalPlayer() == null || event.getEntity().getId() == Wrapper.INSTANCE.getLocalPlayer().getId()) return; - event.setBox(event.getBox().expand(expansionProperty.value(), 0, expansionProperty.value())); - }); + event.setBox(event.getBox().expand(expandXProperty.value(), expandYProperty.value(), expandZProperty.value())); + } +}); + +public boolean isBot(PlayerEntity playerEntity) { + if (EntityHelper.INSTANCE.isNPC(playerEntity)) { + return true; + } else { + return false; + } + } + private boolean isEnabled(Entity entity) { + if (specificFilterProperty.value()) { + if (entity instanceof IronGolemEntity) + return ironGolemProperty.value(); + if (entity instanceof ZombifiedPiglinEntity) + return zombiePiglinProperty.value(); + if (entity instanceof PiglinEntity) + return piglinProperty.value(); + } + if (!(entity instanceof LivingEntity)) + return nolivingProperty.value(); + if (EntityHelper.INSTANCE.isPassiveMob(entity)) + return passiveProperty.value(); + if (EntityHelper.INSTANCE.doesPlayerOwn(entity)) + return petProperty.value(); + if (EntityHelper.INSTANCE.isBossMob(entity)) + return bossProperty.value(); + if (EntityHelper.INSTANCE.isHostileMob(entity)) + return hostileProperty.value(); + if (EntityHelper.INSTANCE.isNeutralMob(entity)) + return neutralProperty.value(); + if (entity instanceof PlayerEntity && entity != Wrapper.INSTANCE.getLocalPlayer()) + return playerProperty.value(); + if (FriendHelper.INSTANCE.isFriend(entity.getName().getString())) + return friendProperty.value(); + if (EntityHelper.INSTANCE.isOnSameTeam((PlayerEntity) entity, Wrapper.INSTANCE.getLocalPlayer(), teamCheckProperty.value())) + return false; + if (isBot((PlayerEntity) entity)) + return botCheckProperty.value(); + return false; + } } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/NoFriendDMG.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/NoFriendDMG.java index cf04f6de2..30073d7fd 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/NoFriendDMG.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/NoFriendDMG.java @@ -3,16 +3,52 @@ import me.dustin.events.core.EventListener; import me.dustin.events.core.annotate.EventPointer; import me.dustin.jex.event.player.EventAttackEntity; +import me.dustin.jex.feature.property.Property; import me.dustin.jex.feature.mod.core.Category; import me.dustin.jex.helper.entity.EntityHelper; import me.dustin.jex.helper.player.FriendHelper; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.mob.MobEntity; +import net.minecraft.entity.mob.PiglinEntity; +import net.minecraft.entity.mob.ZombifiedPiglinEntity; +import net.minecraft.entity.passive.IronGolemEntity; import me.dustin.jex.feature.mod.core.Feature; public class NoFriendDMG extends Feature { + + public final Property neutralProperty = new Property.PropertyBuilder(this.getClass()) + .name("Neutral") + .value(false) + .build(); + public final Property passiveProperty = new Property.PropertyBuilder(this.getClass()) + .name("Passive") + .value(true) + .build(); + public final Property specificFilterProperty = new Property.PropertyBuilder(this.getClass()) + .name("Specific Filter") + .value(true) + .build(); + public final Property ironGolemProperty = new Property.PropertyBuilder(this.getClass()) + .name("Iron Golem") + .value(true) + .parent(specificFilterProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property piglinProperty = new Property.PropertyBuilder(this.getClass()) + .name("Piglin") + .value(true) + .parent(specificFilterProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property zombiePiglinProperty = new Property.PropertyBuilder(this.getClass()) + .name("Zombie Piglin") + .value(false) + .parent(specificFilterProperty) + .depends(parent -> (boolean) parent.value()) + .build(); public NoFriendDMG() { - super(Category.COMBAT, "Prevent yourself from attacking your friends and pets"); + super(Category.COMBAT); } @EventPointer @@ -22,5 +58,30 @@ public NoFriendDMG() { event.cancel(); } else if (EntityHelper.INSTANCE.doesPlayerOwn(event.getEntity())) event.cancel(); + + if (event.getEntity() instanceof MobEntity) { + if (passiveProperty.value()) { + if (EntityHelper.INSTANCE.isPassiveMob(event.getEntity())) + event.cancel(); + } + if (neutralProperty.value()) { + if (EntityHelper.INSTANCE.isNeutralMob(event.getEntity())) + event.cancel(); + } + } + if (ironGolemProperty.value()) { + if (event.getEntity() instanceof IronGolemEntity) + event.cancel(); + } + + if (zombiePiglinProperty.value()) { + if (event.getEntity() instanceof ZombifiedPiglinEntity) + event.cancel(); + } + + if (piglinProperty.value()) { + if (event.getEntity() instanceof PiglinEntity) + event.cancel(); + } }); } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/Roaster.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/Roaster.java index 9d4f25126..c9daedbc2 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/Roaster.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/Roaster.java @@ -14,6 +14,8 @@ import net.minecraft.block.Blocks; import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.ItemEntity; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; @@ -25,19 +27,32 @@ import me.dustin.jex.feature.mod.core.Feature; public class Roaster extends Feature { - - public final Property playerProperty = new Property.PropertyBuilder(this.getClass()) + + public final Property distanceProperty = new Property.PropertyBuilder(this.getClass()) + .name("Distance") + .value(4) + .min(2) + .max(6) + .inc(1) + .build(); + public final Property playerProperty = new Property.PropertyBuilder(this.getClass()) .name("Player") .value(true) .build(); - public final Property friendsProperty = new Property.PropertyBuilder(this.getClass()) - .name("Player") - .description("Light your friends on fire too") - .value(false) + public final Property friendProperty = new Property.PropertyBuilder(this.getClass()) + .name("Friends") + .value(true) .parent(playerProperty) .depends(parent -> (boolean) parent.value()) .build(); - + public final Property neutralProperty = new Property.PropertyBuilder(this.getClass()) + .name("Neutral") + .value(false) + .build(); + public final Property bossProperty = new Property.PropertyBuilder(this.getClass()) + .name("Boss") + .value(true) + .build(); public final Property hostileProperty = new Property.PropertyBuilder(this.getClass()) .name("Hostile") .value(true) @@ -46,21 +61,33 @@ public class Roaster extends Feature { .name("Passive") .value(true) .build(); - public final Property neutralProperty = new Property.PropertyBuilder(this.getClass()) - .name("Neutral") - .value(true) + public final Property itemProperty = new Property.PropertyBuilder(this.getClass()) + .name("Item") + .value(false) .build(); public final Property onFireProperty = new Property.PropertyBuilder(this.getClass()) .name("On Fire") - .description("Keep placing fire under them even if they are already on fire.") .value(false) .build(); public final Property rotateProperty = new Property.PropertyBuilder(this.getClass()) .name("Rotate") - .description("Whether or not to rotate your head on the server.") .value(true) .build(); - public final Property swingProperty = new Property.PropertyBuilder(this.getClass()) + public final Property lockviewProperty = new Property.PropertyBuilder(this.getClass()) + .name("Client") + .value(false) + .parent(rotateProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property groundProperty = new Property.PropertyBuilder(this.getClass()) + .name("OutGround") + .value(true) + .build(); + public final Property fireimmuneProperty = new Property.PropertyBuilder(this.getClass()) + .name("FireImmune") + .value(true) + .build(); +public final Property swingProperty = new Property.PropertyBuilder(this.getClass()) .name("Swing") .value(true) .build(); @@ -69,7 +96,7 @@ public class Roaster extends Feature { private BlockPos blockPos = null; public Roaster() { - super(Category.COMBAT, "Roast your friends."); + super(Category.COMBAT); } @EventPointer @@ -85,18 +112,19 @@ public Roaster() { if (hand == null) return; Wrapper.INSTANCE.getWorld().getEntities().forEach(entity -> { - if (entity instanceof LivingEntity livingEntity) { - if (isValid(livingEntity)) { - Block footBlock = Wrapper.INSTANCE.getWorld().getBlockState(livingEntity.getBlockPos()).getBlock(); + if (isValid(entity)) { + Block footBlock = Wrapper.INSTANCE.getWorld().getBlockState(entity.getBlockPos()).getBlock(); if (footBlock == Blocks.AIR) { - blockPos = livingEntity.getBlockPos().down(); + blockPos = entity.getBlockPos().down(); if (rotateProperty.value()) { RotationVector rotations = PlayerHelper.INSTANCE.rotateToVec(Wrapper.INSTANCE.getLocalPlayer(), new Vec3d(blockPos.getX(), blockPos.getY(), blockPos.getZ())); event.setRotation(rotations); } + if (lockviewProperty.value()) { + PlayerHelper.INSTANCE.setRotation(event.getRotation()); + } } } - } }); } else { if (blockPos != null) { @@ -110,26 +138,34 @@ public Roaster() { } }); - private boolean isValid(LivingEntity livingEntity) { - if (livingEntity instanceof ClientPlayerEntity) - return false; - if (Wrapper.INSTANCE.getLocalPlayer().distanceTo(livingEntity) > 4) + private boolean isValid(Entity entity) { + if (entity instanceof LivingEntity) + return true; + if (entity instanceof ClientPlayerEntity) return false; - if (livingEntity.isOnFire() && !onFireProperty.value()) + if (Wrapper.INSTANCE.getLocalPlayer().distanceTo(entity) > distanceProperty.value()) return false; - if (livingEntity.isFireImmune()) - return false; - if (!livingEntity.isOnGround()) - return false; - if (livingEntity instanceof PlayerEntity) { - if (FriendHelper.INSTANCE.isFriend(livingEntity.getName().getString())) - return friendsProperty.value(); + if (entity instanceof ItemEntity) + return itemProperty.value(); + if (entity instanceof PlayerEntity) { + if (FriendHelper.INSTANCE.isFriend(entity.getName().getString())) + return friendProperty.value(); return playerProperty.value(); - } - if (EntityHelper.INSTANCE.isHostileMob(livingEntity)) + } + if (EntityHelper.INSTANCE.isBossMob(entity)) + return bossProperty.value(); + if (EntityHelper.INSTANCE.isHostileMob(entity)) return hostileProperty.value(); - if (EntityHelper.INSTANCE.isPassiveMob(livingEntity) && !EntityHelper.INSTANCE.doesPlayerOwn(livingEntity)) + if (EntityHelper.INSTANCE.isPassiveMob(entity) && !EntityHelper.INSTANCE.doesPlayerOwn(entity)) return passiveProperty.value(); + if (EntityHelper.INSTANCE.isNeutralMob(entity)) + return neutralProperty.value(); + if (entity.isFireImmune()) + return fireimmuneProperty.value(); + if (entity.isOnFire()) + return onFireProperty.value(); + if (!entity.isOnGround()) + return groundProperty.value(); return false; } } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/Surround.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/Surround.java index 26734ab3a..21be7a0b0 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/Surround.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/Surround.java @@ -27,7 +27,6 @@ public class Surround extends Feature { public Property autoTurnOffProperty = new Property.PropertyBuilder(this.getClass()) .name("Auto Turn Off") - .description("Turn off after surrounding yourself") .value(true) .build(); public Property placeDelayProperty = new Property.PropertyBuilder(this.getClass()) @@ -38,7 +37,6 @@ public class Surround extends Feature { .build(); public Property rotateProperty = new Property.PropertyBuilder(this.getClass()) .name("Rotate") - .description("Whether or not to rotate your head on the server.") .value(true) .build(); public Property placeColorProperty = new Property.PropertyBuilder(this.getClass()) @@ -51,7 +49,7 @@ public class Surround extends Feature { private BlockPos placingPos; public Surround() { - super(Category.COMBAT, "Automatically place obsidian around your feet to defend from crystals"); + super(Category.COMBAT); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/TPSSync.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/TPSSync.java index 78df093ff..e4bd33262 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/TPSSync.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/TPSSync.java @@ -9,17 +9,17 @@ import me.dustin.jex.feature.mod.core.Feature; public class TPSSync extends Feature { - - public Property sampleSizeProperty = new Property.PropertyBuilder(this.getClass()) + + public Property sampleSizeProperty = new Property.PropertyBuilder(this.getClass()) .name("Sample Size") - .description("The amount of ticks to store for the average.") .value(15) - .min(2) + .min(1) .max(100) + .inc(1) .build(); public TPSSync() { - super(Category.COMBAT, "Sync attacks to server TPS to deal more damage on laggy servers."); + super(Category.COMBAT); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/Triggerbot.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/Triggerbot.java index aae3b237d..dcac88a90 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/Triggerbot.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/Triggerbot.java @@ -13,54 +13,140 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.util.Hand; +import net.minecraft.entity.mob.PiglinEntity; +import net.minecraft.entity.mob.ZombifiedPiglinEntity; +import net.minecraft.entity.passive.IronGolemEntity; import net.minecraft.util.hit.EntityHitResult; +import net.minecraft.util.Hand; public class Triggerbot extends Feature { - public Property playersProperty = new Property.PropertyBuilder(this.getClass()) + public Property checkpressProperty = new Property.PropertyBuilder(this.getClass()) + .name("When-holding-attack") + .value(true) + .build(); + public final Property swingProperty = new Property.PropertyBuilder(this.getClass()) + .name("Swing") + .value(true) + .build(); + public final Property playerProperty = new Property.PropertyBuilder(this.getClass()) .name("Player") .value(true) .build(); - public Property passivesProperty = new Property.PropertyBuilder(this.getClass()) - .name("Passive") + public final Property friendProperty = new Property.PropertyBuilder(this.getClass()) + .name("Friends") + .value(true) + .parent(playerProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property neutralProperty = new Property.PropertyBuilder(this.getClass()) + .name("Neutral") + .value(false) + .build(); + public final Property bossProperty = new Property.PropertyBuilder(this.getClass()) + .name("Boss") .value(true) .build(); - public Property hostilesProperty = new Property.PropertyBuilder(this.getClass()) + public final Property hostileProperty = new Property.PropertyBuilder(this.getClass()) .name("Hostile") .value(true) .build(); - public Property neutralsProperty = new Property.PropertyBuilder(this.getClass()) - .name("Neutral") + public final Property passiveProperty = new Property.PropertyBuilder(this.getClass()) + .name("Passive") + .value(true) + .build(); + public final Property specificFilterProperty = new Property.PropertyBuilder(this.getClass()) + .name("Specific Filter") + .value(true) + .build(); + public final Property ironGolemProperty = new Property.PropertyBuilder(this.getClass()) + .name("Iron Golem") + .value(true) + .parent(specificFilterProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property piglinProperty = new Property.PropertyBuilder(this.getClass()) + .name("Piglin") + .value(true) + .parent(specificFilterProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property zombiePiglinProperty = new Property.PropertyBuilder(this.getClass()) + .name("Zombie Piglin") + .value(false) + .parent(specificFilterProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property nolivingProperty = new Property.PropertyBuilder(this.getClass()) + .name("NoLiving") + .value(false) + .parent(specificFilterProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property invisiblesProperty = new Property.PropertyBuilder(this.getClass()) + .name("Invisibles") + .value(true) + .build(); +public final Property nametaggedProperty = new Property.PropertyBuilder(this.getClass()) + .name("Nametagged") .value(true) .build(); public Triggerbot() { - super(Category.COMBAT, "Automatically attack entities you hover over"); + super(Category.COMBAT); } @EventPointer private final EventListener eventPlayerPacketsEventListener = new EventListener<>(event -> { if (Wrapper.INSTANCE.getMinecraft().crosshairTarget instanceof EntityHitResult entityHitResult) { Entity entity = entityHitResult.getEntity(); - if (isValid(entity) && Wrapper.INSTANCE.getLocalPlayer().getAttackCooldownProgress(0) == 1) { + if (checkpressProperty.value()) { + if (isValid(entity) && Wrapper.INSTANCE.getOptions().attackKey.isPressed() && Wrapper.INSTANCE.getLocalPlayer().getAttackCooldownProgress(0) == 1) { Wrapper.INSTANCE.getClientPlayerInteractionManager().attackEntity(Wrapper.INSTANCE.getLocalPlayer(), entity); + if (swingProperty.value()) { Wrapper.INSTANCE.getLocalPlayer().swingHand(Hand.MAIN_HAND); + } + } + } + else { + if (isValid(entity) && Wrapper.INSTANCE.getLocalPlayer().getAttackCooldownProgress(0) == 1) { + Wrapper.INSTANCE.getClientPlayerInteractionManager().attackEntity(Wrapper.INSTANCE.getLocalPlayer(), entity); + if (swingProperty.value()) { + Wrapper.INSTANCE.getLocalPlayer().swingHand(Hand.MAIN_HAND); + } + } } } }, new PlayerPacketsFilter(EventPlayerPackets.Mode.PRE)); private boolean isValid(Entity entity) { if (!(entity instanceof LivingEntity)) - return false; + return nolivingProperty.value(); + if (entity.isInvisible()) + return invisiblesProperty.value(); + if (entity.hasCustomName()) + return nametaggedProperty.value(); if (EntityHelper.INSTANCE.isPassiveMob(entity)) - return passivesProperty.value(); + return passiveProperty.value(); if (EntityHelper.INSTANCE.isNeutralMob(entity)) - return neutralsProperty.value(); + return neutralProperty.value(); if (EntityHelper.INSTANCE.isHostileMob(entity)) - return hostilesProperty.value(); - if (entity instanceof PlayerEntity playerEntity && !FriendHelper.INSTANCE.isFriend(playerEntity)) - return playersProperty.value(); + return hostileProperty.value(); + if (EntityHelper.INSTANCE.isBossMob(entity)) + return bossProperty.value(); + if (entity instanceof PlayerEntity) { + if (FriendHelper.INSTANCE.isFriend(entity.getName().getString())) + return friendProperty.value(); + return playerProperty.value(); + } + if (specificFilterProperty.value()) { + if (entity instanceof IronGolemEntity) + return ironGolemProperty.value(); + if (entity instanceof ZombifiedPiglinEntity) + return zombiePiglinProperty.value(); + if (entity instanceof PiglinEntity) + return piglinProperty.value(); + } return false; } } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/WebSpam.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/WebSpam.java index 5070fd239..eb54168c3 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/WebSpam.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/WebSpam.java @@ -35,14 +35,13 @@ public class WebSpam extends Feature { .build(); public final Property friendsProperty = new Property.PropertyBuilder(this.getClass()) .name("Friends") - .description("Whether or not to web your friends.") .value(false) .build(); private final StopWatch stopWatch = new StopWatch(); public WebSpam() { - super(Category.COMBAT, "Spam webs at players feet to slow them down"); + super(Category.COMBAT); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/aimbot/Aimbot.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/aimbot/Aimbot.java new file mode 100644 index 000000000..c6259f9de --- /dev/null +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/aimbot/Aimbot.java @@ -0,0 +1,300 @@ +package me.dustin.jex.feature.mod.impl.combat.aimbot; + +import me.dustin.events.core.Event; +import me.dustin.events.core.EventListener; +import me.dustin.jex.event.player.EventPlayerPackets; +import me.dustin.jex.event.render.EventRender3D; +import me.dustin.jex.feature.mod.core.FeatureExtension; +import me.dustin.jex.feature.mod.core.Category; +import me.dustin.jex.feature.mod.core.Feature; +import me.dustin.jex.feature.mod.impl.combat.aimbot.impl.SingleAimbot; +import me.dustin.jex.feature.mod.impl.player.Freecam; +import me.dustin.jex.feature.property.Property; +import me.dustin.jex.helper.entity.EntityHelper; +import me.dustin.jex.helper.baritone.BaritoneHelper; +import me.dustin.jex.helper.misc.StopWatch; +import me.dustin.jex.helper.misc.Wrapper; +import me.dustin.jex.helper.player.FriendHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.mob.PiglinEntity; +import net.minecraft.entity.mob.ZombifiedPiglinEntity; +import net.minecraft.entity.passive.IronGolemEntity; +import net.minecraft.entity.player.PlayerEntity; +import me.dustin.events.core.annotate.EventPointer; +import me.dustin.events.core.priority.Priority; +import org.lwjgl.glfw.GLFW; + +import java.awt.*; +import java.util.ArrayList; + +public class Aimbot extends Feature { + public static Aimbot INSTANCE; + + public final Property targetModeProperty = new Property.PropertyBuilder(this.getClass()) + .name("Mode") + .value(TargetMode.SINGLE) + .build(); + public final Property reachProperty = new Property.PropertyBuilder(this.getClass()) + .name("Reach") + .value(3.8f) + .min(3f) + .max(6f) + .inc(0.1f) + .build(); + public final Property ticksExistedProperty = new Property.PropertyBuilder(this.getClass()) + .name("Ticks Exsited") + .value(50) + .min(0) + .max(300) + .inc(1) + .build(); + public final Property rotdelProperty = new Property.PropertyBuilder(this.getClass()) + .name("Rotate Delay") + .value(0) + .min(0) + .max(1000) + .inc(10) + .build(); + public final Property playerProperty = new Property.PropertyBuilder(this.getClass()) + .name("Player") + .value(true) + .build(); + public final Property neutralProperty = new Property.PropertyBuilder(this.getClass()) + .name("Neutral") + .value(false) + .build(); + public final Property bossProperty = new Property.PropertyBuilder(this.getClass()) + .name("Boss") + .value(true) + .build(); + public final Property hostileProperty = new Property.PropertyBuilder(this.getClass()) + .name("Hostile") + .value(true) + .build(); + public final Property passiveProperty = new Property.PropertyBuilder(this.getClass()) + .name("Passive") + .value(true) + .build(); + public final Property specificFilterProperty = new Property.PropertyBuilder(this.getClass()) + .name("Specific Filter") + .value(true) + .build(); + public final Property ironGolemProperty = new Property.PropertyBuilder(this.getClass()) + .name("Iron Golem") + .value(true) + .parent(specificFilterProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property piglinProperty = new Property.PropertyBuilder(this.getClass()) + .name("Piglin") + .value(true) + .parent(specificFilterProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property zombiePiglinProperty = new Property.PropertyBuilder(this.getClass()) + .name("Zombie Piglin") + .value(false) + .parent(specificFilterProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property randomizeProperty = new Property.PropertyBuilder(this.getClass()) + .name("Randomize") + .description("Randomize where on the target you look.") + .value(false) + .build(); + public final Property randomWidthProperty = new Property.PropertyBuilder(this.getClass()) + .name("Random Width") + .value(0.1f) + .min(-1f) + .max(1f) + .inc(0.1f) + .parent(randomizeProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property randomHeightProperty = new Property.PropertyBuilder(this.getClass()) + .name("Random Height") + .value(0.1f) + .min(-1f) + .max(1f) + .inc(0.1f) + .parent(randomizeProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property botCheckProperty = new Property.PropertyBuilder(this.getClass()) + .name("Bot Check") + .description("Check whether a player is a bot before targeting.") + .value(true) + .build(); + public final Property teamCheckProperty = new Property.PropertyBuilder(this.getClass()) + .name("Team Check") + .description("Check whether a player is on your team before targeting.") + .value(true) + .build(); + public final Property checkArmorProperty = new Property.PropertyBuilder(this.getClass()) + .name("Check Armor") + .description("Check if you're wearing the same color armor for teams.") + .value(true) + .parent(teamCheckProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property nametaggedProperty = new Property.PropertyBuilder(this.getClass()) + .name("Nametagged") + .description("Whether or not to attack nametagged entities.") + .value(true) + .build(); + public final Property invisiblesProperty = new Property.PropertyBuilder(this.getClass()) + .name("Invisibles") + .description("Whether or not to attack invisible entities.") + .value(true) + .build(); + public final Property ignoreWallsProperty = new Property.PropertyBuilder(this.getClass()) + .name("Ignore Walls") + .description("Whether or not to attack entities through wall.") + .value(true) + .build(); + public final Property reachCircleProperty = new Property.PropertyBuilder(this.getClass()) + .name("Reach Sphere") + .value(false) + .build(); + public final Property reachCircleColorProperty = new Property.PropertyBuilder(this.getClass()) + .name("Sphere Color") + .value(Color.GREEN) + .parent(reachCircleProperty) + .depends(parent-> (boolean) parent.value()) + .build(); + +private final StopWatch stopWatch = new StopWatch(); + private TargetMode lastMode; + + private boolean hasTarget = false; + + public ArrayList touchedGround = new ArrayList<>(); + public ArrayList swung = new ArrayList<>(); + + public Aimbot() { + super(Category.COMBAT, "Attack entities around you.", GLFW.GLFW_KEY_R); + INSTANCE = this; + new SingleAimbot(); + } + + @EventPointer + private final EventListener eventPlayerPacketsEventListener = new EventListener<>(event -> { + for(Entity entity : Wrapper.INSTANCE.getWorld().getEntities()) { + if(entity instanceof PlayerEntity playerEntity) { + if(playerEntity.isOnGround() && !touchedGround.contains(playerEntity)) + touchedGround.add(playerEntity); + } + } + for(int i = 0; i < touchedGround.size() - 1; i++) { + PlayerEntity playerEntity = touchedGround.get(i); + if(playerEntity == null) { + touchedGround.remove(i); + } + } + setSuffix(targetModeProperty.value()); + sendEvent(event); + }, Priority.LAST); + + @EventPointer + private final EventListener eventRender3DEventListener = new EventListener<>(event -> sendEvent(event)); + + public void sendEvent(Event event) { + if (targetModeProperty.value() != lastMode && lastMode != null) { + FeatureExtension.get(lastMode, this).disable(); + FeatureExtension.get(targetModeProperty.value(), this).enable(); + } + FeatureExtension.get(targetModeProperty.value(), this).pass(event); + lastMode = targetModeProperty.value(); + } + + public boolean isValid(Entity entity, boolean rangecheck) { + if (!(entity instanceof LivingEntity livingEntity)) + return false; + if (entity == Wrapper.INSTANCE.getLocalPlayer() || entity == Freecam.playerEntity) + return false; + if (Wrapper.INSTANCE.getLocalPlayer().getVehicle() != null) { + if (entity == Wrapper.INSTANCE.getLocalPlayer().getVehicle()) + return false; + } + if (livingEntity.isSleeping()) + return false; + if (entity.age < ticksExistedProperty.value()) + return false; + if (entity.hasCustomName() && !nametaggedProperty.value()) + return false; + if (entity.isInvisible() && !invisiblesProperty.value()) + return false; + if (!entity.isAlive() || (((LivingEntity) entity).getHealth() <= 0 && !Double.isNaN(((LivingEntity) entity).getHealth()))) + return false; + boolean canSee = Wrapper.INSTANCE.getLocalPlayer().canSee(entity); + if (!canSee) + return false; + //TODO: fix this with 180/-180 having some issues + /*if (PlayerHelper.INSTANCE.getDistanceFromMouse(entity) * 2 > Aimbot.INSTANCE.fov) { + return false; + }*/ + if (rangecheck) { + float distance = reachProperty.value(); + if (!canSee) + distance = 3; + if (entity.distanceTo(Wrapper.INSTANCE.getPlayer()) > distance) + return false; + } + if (entity instanceof PlayerEntity && entity != Wrapper.INSTANCE.getLocalPlayer()) { + if (FriendHelper.INSTANCE.isFriend(entity.getName().getString())) + return false; + if (EntityHelper.INSTANCE.isOnSameTeam((PlayerEntity) entity, Wrapper.INSTANCE.getLocalPlayer(), checkArmorProperty.value()) && teamCheckProperty.value()) + return false; + if (botCheckProperty.value() && isBot((PlayerEntity) entity)) + return false; + return playerProperty.value(); + } + if (specificFilterProperty.value()) { + if (entity instanceof IronGolemEntity) + return ironGolemProperty.value(); + if (entity instanceof ZombifiedPiglinEntity) + return zombiePiglinProperty.value(); + if (entity instanceof PiglinEntity) + return piglinProperty.value(); + } + if (EntityHelper.INSTANCE.isPassiveMob(entity) && !EntityHelper.INSTANCE.doesPlayerOwn(entity)) + return passiveProperty.value(); + if (EntityHelper.INSTANCE.isBossMob(entity)) + return bossProperty.value(); + if (EntityHelper.INSTANCE.isHostileMob(entity)) + return hostileProperty.value(); + if (EntityHelper.INSTANCE.isNeutralMob(entity)) + return neutralProperty.value(); + return false; + } + + public boolean isBot(PlayerEntity playerEntity) { + if (EntityHelper.INSTANCE.isNPC(playerEntity)) { + return true; + } else { + return (!swung.contains(playerEntity) && !touchedGround.contains(playerEntity)) || playerEntity.getGameProfile().getProperties().isEmpty(); + } + } + + public void setHasTarget(boolean hasTarget) { + this.hasTarget = hasTarget; + } + + public boolean hasTarget() { + return hasTarget; + } + + @Override + public void onDisable() { + super.onDisable(); + setHasTarget(false); + if (BaritoneHelper.INSTANCE.baritoneExists()) + BaritoneHelper.INSTANCE.disableKillauraTargetProcess(); + FeatureExtension.get(targetModeProperty.value(), this).disable(); + } + + public enum TargetMode { + SINGLE + } +} diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/aimbot/impl/SingleAimbot.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/aimbot/impl/SingleAimbot.java new file mode 100644 index 000000000..91666f99d --- /dev/null +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/aimbot/impl/SingleAimbot.java @@ -0,0 +1,92 @@ +package me.dustin.jex.feature.mod.impl.combat.aimbot.impl; + +import com.mojang.blaze3d.systems.RenderSystem; +import me.dustin.events.core.Event; +import me.dustin.jex.event.player.EventPlayerPackets; +import me.dustin.jex.event.render.EventRender3D; +import me.dustin.jex.feature.mod.core.FeatureExtension; +import me.dustin.jex.feature.mod.impl.combat.aimbot.Aimbot; +import me.dustin.jex.feature.mod.impl.player.Freecam; +import me.dustin.jex.feature.mod.impl.world.Excavator; +import me.dustin.jex.helper.entity.EntityHelper; +import me.dustin.jex.helper.math.vector.RotationVector; +import me.dustin.jex.helper.misc.StopWatch; +import me.dustin.jex.helper.misc.Wrapper; +import me.dustin.jex.helper.player.PlayerHelper; +import me.dustin.jex.helper.render.Render3DHelper; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.entity.Entity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.util.math.Vec3d; +import me.dustin.jex.feature.mod.core.Feature; +import me.dustin.jex.feature.mod.impl.combat.AutoPot; +import me.dustin.jex.feature.mod.impl.player.AutoEat; + +public class SingleAimbot extends FeatureExtension { + + private LivingEntity target; + private final StopWatch stopWatch = new StopWatch(); + + + public SingleAimbot() { + super(Aimbot.TargetMode.SINGLE, Aimbot.class); + } + + @Override + public void pass(Event event1) { + if (Feature.get(AutoPot.class).throwing) + return; + if (AutoEat.isEating) + return; + if (event1 instanceof EventPlayerPackets event) { + if (event.getMode() == EventPlayerPackets.Mode.PRE) { + if (target == null || !Aimbot.INSTANCE.isValid(target, true)) { + target = getClosest(); + } + Aimbot.INSTANCE.setHasTarget(target != null); + if (target != null) { + if (stopWatch.hasPassed(Aimbot.INSTANCE.rotdelProperty.value())) { + RotationVector rotationVector = PlayerHelper.INSTANCE.rotateToEntity(target); + if (Aimbot.INSTANCE.randomizeProperty.value()) { + rotationVector = PlayerHelper.INSTANCE.randomRotateTo(target, Aimbot.INSTANCE.randomWidthProperty.value(), Aimbot.INSTANCE.randomHeightProperty.value()); + } + + event.setRotation(rotationVector); + Wrapper.INSTANCE.getLocalPlayer().headYaw = event.getYaw(); + Wrapper.INSTANCE.getLocalPlayer().bodyYaw = event.getYaw(); + PlayerHelper.INSTANCE.setRotation(event.getRotation()); + stopWatch.reset(); + } + } + } + } +if (event1 instanceof EventRender3D) { + if (Aimbot.INSTANCE.reachCircleProperty.value()) { + MatrixStack matrixStack = ((EventRender3D) event1).getPoseStack(); + matrixStack.push(); + Render3DHelper.INSTANCE.setup3DRender(false); + RenderSystem.lineWidth(1); + double x = Wrapper.INSTANCE.getLocalPlayer().prevX + ((Wrapper.INSTANCE.getLocalPlayer().getX() - Wrapper.INSTANCE.getLocalPlayer().prevX) * ((EventRender3D) event1).getPartialTicks()); + double y = Wrapper.INSTANCE.getLocalPlayer().prevY + ((Wrapper.INSTANCE.getLocalPlayer().getY() - Wrapper.INSTANCE.getLocalPlayer().prevY) * ((EventRender3D) event1).getPartialTicks()); + double z = Wrapper.INSTANCE.getLocalPlayer().prevZ + ((Wrapper.INSTANCE.getLocalPlayer().getZ() - Wrapper.INSTANCE.getLocalPlayer().prevZ) * ((EventRender3D) event1).getPartialTicks()); + Render3DHelper.INSTANCE.drawSphere(((EventRender3D) event1).getPoseStack(), Aimbot.INSTANCE.reachProperty.value(), 25, Aimbot.INSTANCE.reachCircleColorProperty.value().getRGB(), true, new Vec3d(x, y, z).subtract(0, Wrapper.INSTANCE.getLocalPlayer().getEyeHeight(Wrapper.INSTANCE.getLocalPlayer().getPose()), 0)); + Render3DHelper.INSTANCE.end3DRender(); + matrixStack.pop(); + } + } + } + + public LivingEntity getClosest() { + LivingEntity livingEntity = null; + float distance = Aimbot.INSTANCE.reachProperty.value(); + for (Entity entity : Wrapper.INSTANCE.getWorld().getEntities()) { + if (entity instanceof LivingEntity livingEntity1) { + if (Aimbot.INSTANCE.isValid(livingEntity1, true) && livingEntity1.distanceTo(Freecam.playerEntity != null ? Freecam.playerEntity : Wrapper.INSTANCE.getLocalPlayer()) <= distance) { + livingEntity = livingEntity1; + distance = livingEntity1.distanceTo(Wrapper.INSTANCE.getLocalPlayer()); + } + } + } + return livingEntity; + } +} diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/killaura/KillAura.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/killaura/KillAura.java index dec795f4e..3a5f9b88e 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/killaura/KillAura.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/killaura/KillAura.java @@ -1,5 +1,4 @@ package me.dustin.jex.feature.mod.impl.combat.killaura; - import me.dustin.events.core.Event; import me.dustin.events.core.EventListener; import me.dustin.jex.event.player.EventPlayerPackets; @@ -9,6 +8,11 @@ import me.dustin.jex.feature.mod.core.Feature; import me.dustin.jex.feature.mod.impl.combat.killaura.impl.MultiAura; import me.dustin.jex.feature.mod.impl.combat.killaura.impl.SingleAura; +import net.minecraft.entity.projectile.FireballEntity; +import net.minecraft.entity.projectile.ShulkerBulletEntity; +import net.minecraft.entity.projectile.WitherSkullEntity; +import net.minecraft.entity.projectile.DragonFireballEntity; +import net.minecraft.entity.projectile.PersistentProjectileEntity; import me.dustin.jex.feature.mod.impl.player.Freecam; import me.dustin.jex.feature.property.Property; import me.dustin.jex.helper.entity.EntityHelper; @@ -25,13 +29,10 @@ import me.dustin.events.core.annotate.EventPointer; import me.dustin.events.core.priority.Priority; import org.lwjgl.glfw.GLFW; - import java.awt.*; import java.util.ArrayList; - public class KillAura extends Feature { public static KillAura INSTANCE; - public final Property targetModeProperty = new Property.PropertyBuilder(this.getClass()) .name("Mode") .value(TargetMode.SINGLE) @@ -43,7 +44,7 @@ public class KillAura extends Feature { public final Property reachProperty = new Property.PropertyBuilder(this.getClass()) .name("Reach") .value(3.8f) - .min(3f) + .min(2f) .max(6f) .inc(0.1f) .build(); @@ -51,31 +52,28 @@ public class KillAura extends Feature { .name("Ticks Exsited") .value(50) .min(0) - .max(200) + .max(300) .inc(1) .build(); public final Property ignoreNewCombatProperty = new Property.PropertyBuilder(this.getClass()) .name("Old Combat") .value(false) .build(); - public final Property apsProperty = new Property.PropertyBuilder(this.getClass()) - .name("APS") - .description("How many attacks per second to use with Old Combat mode") - .value(10f) - .min(1) - .max(20) - .inc(0.1f) + public final Property delayProperty = new Property.PropertyBuilder(this.getClass()) + .name("Delay") + .value(10) + .min(0) + .max(1000) + .inc(10) .parent(ignoreNewCombatProperty) .depends(parent -> (boolean) parent.value()) .build(); public final Property baritoneOverrideProperty = new Property.PropertyBuilder(this.getClass()) .name("Baritone Override") - .description("Allow Killaura to override Baritone if currently pathing.") .value(true) .build(); public final Property followUntilDeadProperty = new Property.PropertyBuilder(this.getClass()) .name("Follow until dead") - .description("Follow your target until they die.") .value(true) .parent(baritoneOverrideProperty) .depends(parent -> (boolean) parent.value()) @@ -83,7 +81,7 @@ public class KillAura extends Feature { public final Property bMinDistProperty = new Property.PropertyBuilder(this.getClass()) .name("Min Distance") .value(3f) - .max(6) + .max(6f) .inc(0.1f) .parent(baritoneOverrideProperty) .depends(parent -> (boolean) parent.value()) @@ -101,10 +99,16 @@ public class KillAura extends Feature { .parent(autoBlockProperty) .depends(parent -> (boolean) parent.value()) .build(); - public final Property playerProperty = new Property.PropertyBuilder(this.getClass()) + public final Property playerProperty = new Property.PropertyBuilder(this.getClass()) .name("Player") .value(true) .build(); + public final Property friendProperty = new Property.PropertyBuilder(this.getClass()) + .name("Friends") + .value(true) + .parent(playerProperty) + .depends(parent -> (boolean) parent.value()) + .build(); public final Property neutralProperty = new Property.PropertyBuilder(this.getClass()) .name("Neutral") .value(false) @@ -121,6 +125,12 @@ public class KillAura extends Feature { .name("Passive") .value(true) .build(); + public final Property petProperty = new Property.PropertyBuilder(this.getClass()) + .name("Pet") + .value(false) + .parent(passiveProperty) + .depends(parent -> (boolean) parent.value()) + .build(); public final Property specificFilterProperty = new Property.PropertyBuilder(this.getClass()) .name("Specific Filter") .value(true) @@ -143,76 +153,127 @@ public class KillAura extends Feature { .parent(specificFilterProperty) .depends(parent -> (boolean) parent.value()) .build(); + public final Property deadProperty = new Property.PropertyBuilder(this.getClass()) + .name("Dead") + .value(false) + .parent(specificFilterProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property nolivingProperty = new Property.PropertyBuilder(this.getClass()) + .name("NoLiving") + .value(false) + .parent(specificFilterProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property projectilesProperty = new Property.PropertyBuilder(this.getClass()) + .name("Projectiles") + .value(true) + .build(); + public final Property fireballProperty = new Property.PropertyBuilder(this.getClass()) + .name("Fireball") + .value(true) + .parent(projectilesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property dfireballProperty = new Property.PropertyBuilder(this.getClass()) + .name("DragonFireball") + .value(true) + .parent(projectilesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property bulletProperty = new Property.PropertyBuilder(this.getClass()) + .name("ShulkerBullet") + .value(true) + .parent(projectilesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property skullProperty = new Property.PropertyBuilder(this.getClass()) + .name("WitherSkull") + .value(true) + .parent(projectilesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property botCheckProperty = new Property.PropertyBuilder(this.getClass()) + .name("Bot") + .value(true) + .build(); + public final Property teamCheckProperty = new Property.PropertyBuilder(this.getClass()) + .name("Team Check") + .value(true) + .parent(botCheckProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property checkArmorProperty = new Property.PropertyBuilder(this.getClass()) + .name("Check Armor") + .value(true) + .parent(teamCheckProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property nametaggedProperty = new Property.PropertyBuilder(this.getClass()) + .name("Nametagged") + .value(true) + .build(); + public final Property invisiblesProperty = new Property.PropertyBuilder(this.getClass()) + .name("Invisibles") + .value(true) + .build(); + public final Property sleepingProperty = new Property.PropertyBuilder(this.getClass()) + .name("Sleeping") + .value(true) + .build(); + public final Property swingProperty = new Property.PropertyBuilder(this.getClass()) + .name("Swing") + .value(true) + .build(); public final Property rayTraceProperty = new Property.PropertyBuilder(this.getClass()) .name("RayTrace") - .description("Hit whatever is between you and your target.") .value(false) .build(); public final Property rotateProperty = new Property.PropertyBuilder(this.getClass()) .name("Rotate") - .description("Whether or not to rotate your head on the server.") .value(true) .build(); + public final Property rotdelProperty = new Property.PropertyBuilder(this.getClass()) + .name("Rotate Delay") + .value(0) + .min(0) + .max(1000) + .inc(10) + .parent(rotateProperty) + .depends(parent -> (boolean) parent.value()) + .build(); public final Property lockviewProperty = new Property.PropertyBuilder(this.getClass()) .name("Lockview") - .description("Sets the rotations client-side.") .value(false) .parent(rotateProperty) .depends(parent -> (boolean) parent.value()) .build(); public final Property randomizeProperty = new Property.PropertyBuilder(this.getClass()) .name("Randomize") - .description("Randomize where on the target you look.") .value(false) .parent(rotateProperty) .depends(parent -> (boolean) parent.value()) .build(); public final Property randomWidthProperty = new Property.PropertyBuilder(this.getClass()) .name("Random Width") - .value(0.5f) - .min(0.2f) - .inc(0.5f) + .value(0.1f) + .min(-1f) + .max(1f) + .inc(0.1f) .parent(randomizeProperty) .depends(parent -> (boolean) parent.value()) .build(); public final Property randomHeightProperty = new Property.PropertyBuilder(this.getClass()) .name("Random Height") - .value(0.5f) - .min(0.2f) - .inc(0.5f) + .value(0.1f) + .min(-1f) + .max(1f) + .inc(0.1f) .parent(randomizeProperty) .depends(parent -> (boolean) parent.value()) .build(); - public final Property botCheckProperty = new Property.PropertyBuilder(this.getClass()) - .name("Bot Check") - .description("Check whether a player is a bot before targeting.") - .value(true) - .build(); - public final Property teamCheckProperty = new Property.PropertyBuilder(this.getClass()) - .name("Team Check") - .description("Check whether a player is on your team before targeting.") - .value(true) - .build(); - public final Property checkArmorProperty = new Property.PropertyBuilder(this.getClass()) - .name("Check Armor") - .description("Check if you're wearing the same color armor for teams.") - .value(true) - .parent(teamCheckProperty) - .depends(parent -> (boolean) parent.value()) - .build(); - public final Property nametaggedProperty = new Property.PropertyBuilder(this.getClass()) - .name("Nametagged") - .description("Whether or not to attack nametagged entities.") - .value(true) - .build(); - public final Property invisiblesProperty = new Property.PropertyBuilder(this.getClass()) - .name("Invisibles") - .description("Whether or not to attack invisible entities.") - .value(true) - .build(); public final Property ignoreWallsProperty = new Property.PropertyBuilder(this.getClass()) .name("Ignore Walls") - .description("Whether or not to attack entities through wall.") .value(true) .build(); public final Property showTargetProperty = new Property.PropertyBuilder(this.getClass()) @@ -235,22 +296,17 @@ public class KillAura extends Feature { .parent(reachCircleProperty) .depends(parent-> (boolean) parent.value()) .build(); - private final StopWatch stopWatch = new StopWatch(); private TargetMode lastMode; - private boolean hasTarget = false; - public ArrayList touchedGround = new ArrayList<>(); public ArrayList swung = new ArrayList<>(); - public KillAura() { - super(Category.COMBAT, "Attack entities around you.", GLFW.GLFW_KEY_R); + super(Category.COMBAT, "", GLFW.GLFW_KEY_R); INSTANCE = this; new SingleAura(); new MultiAura(); } - @EventPointer private final EventListener eventPlayerPacketsEventListener = new EventListener<>(event -> { for(Entity entity : Wrapper.INSTANCE.getWorld().getEntities()) { @@ -291,7 +347,7 @@ public void sendEvent(Event event) { public boolean canSwing() { if (ignoreNewCombatProperty.value()) { - if (stopWatch.hasPassed((long) (1000 / apsProperty.value()))) { + if (stopWatch.hasPassed(delayProperty.value())) { stopWatch.reset(); return true; } @@ -302,33 +358,10 @@ public boolean canSwing() { } return false; } - public boolean isValid(Entity entity, boolean rangecheck) { - if (!(entity instanceof LivingEntity livingEntity)) - return false; - if (entity == Wrapper.INSTANCE.getLocalPlayer() || entity == Freecam.playerEntity) - return false; - if (Wrapper.INSTANCE.getLocalPlayer().getVehicle() != null) { - if (entity == Wrapper.INSTANCE.getLocalPlayer().getVehicle()) - return false; - } - if (livingEntity.isSleeping()) - return false; - if (entity.age < ticksExistedProperty.value()) - return false; - if (entity.hasCustomName() && !nametaggedProperty.value()) - return false; - if (entity.isInvisible() && !invisiblesProperty.value()) - return false; - if (!entity.isAlive() || (((LivingEntity) entity).getHealth() <= 0 && !Double.isNaN(((LivingEntity) entity).getHealth()))) - return false; - boolean canSee = Wrapper.INSTANCE.getLocalPlayer().canSee(entity); - if (!canSee && !ignoreWallsProperty.value()) - return false; - //TODO: fix this with 180/-180 having some issues - /*if (PlayerHelper.INSTANCE.getDistanceFromMouse(entity) * 2 > KillAura.INSTANCE.fov) { - return false; - }*/ + boolean canSee = Wrapper.INSTANCE.getLocalPlayer().canSee(entity); + if (!canSee) + return ignoreWallsProperty.value(); if (rangecheck) { float distance = reachProperty.value(); if (!canSee) @@ -336,16 +369,54 @@ public boolean isValid(Entity entity, boolean rangecheck) { if (entity.distanceTo(Wrapper.INSTANCE.getPlayer()) > distance) return false; } - if (entity instanceof PlayerEntity && entity != Wrapper.INSTANCE.getLocalPlayer()) { - if (FriendHelper.INSTANCE.isFriend(entity.getName().getString())) + if (projectilesProperty.value()) { + if (entity instanceof ShulkerBulletEntity) + return bulletProperty.value(); + if (entity instanceof FireballEntity) + return fireballProperty.value(); + if (entity instanceof DragonFireballEntity) + return dfireballProperty.value(); + if (entity instanceof WitherSkullEntity) + return skullProperty.value(); + } + if (!(entity instanceof LivingEntity livingEntity)) + return nolivingProperty.value(); + if (livingEntity.isSleeping()) + return sleepingProperty.value(); + if (entity.hasCustomName()) + return nametaggedProperty.value(); + if (entity.isInvisible()) + return invisiblesProperty.value(); + if (!entity.isAlive() || (((LivingEntity) entity).getHealth() <= 0 && !Double.isNaN(((LivingEntity) entity).getHealth()))) + return deadProperty.value(); + if (entity.age < ticksExistedProperty.value()) + return false; + if (entity == Wrapper.INSTANCE.getLocalPlayer() || entity == Freecam.playerEntity) return false; - if (EntityHelper.INSTANCE.isOnSameTeam((PlayerEntity) entity, Wrapper.INSTANCE.getLocalPlayer(), checkArmorProperty.value()) && teamCheckProperty.value()) + if (Wrapper.INSTANCE.getLocalPlayer().getVehicle() != null) { + if (entity == Wrapper.INSTANCE.getLocalPlayer().getVehicle()) return false; - if (botCheckProperty.value() && isBot((PlayerEntity) entity)) + } + if (entity instanceof PlayerEntity && entity != Wrapper.INSTANCE.getLocalPlayer()) { + if (FriendHelper.INSTANCE.isFriend(entity.getName().getString())) + return friendProperty.value(); + if (EntityHelper.INSTANCE.isOnSameTeam((PlayerEntity) entity, Wrapper.INSTANCE.getLocalPlayer(), teamCheckProperty.value())) return false; + if (isBot((PlayerEntity) entity)) + return botCheckProperty.value(); return playerProperty.value(); } - if (specificFilterProperty.value()) { + if (EntityHelper.INSTANCE.isNeutralMob(entity)) + return neutralProperty.value(); + if (EntityHelper.INSTANCE.isPassiveMob(entity)) + return passiveProperty.value(); + if (EntityHelper.INSTANCE.doesPlayerOwn(entity)) + return petProperty.value(); + if (EntityHelper.INSTANCE.isBossMob(entity)) + return bossProperty.value(); + if (EntityHelper.INSTANCE.isHostileMob(entity)) + return hostileProperty.value(); + if (specificFilterProperty.value()) { if (entity instanceof IronGolemEntity) return ironGolemProperty.value(); if (entity instanceof ZombifiedPiglinEntity) @@ -353,17 +424,8 @@ public boolean isValid(Entity entity, boolean rangecheck) { if (entity instanceof PiglinEntity) return piglinProperty.value(); } - if (EntityHelper.INSTANCE.isPassiveMob(entity) && !EntityHelper.INSTANCE.doesPlayerOwn(entity)) - return passiveProperty.value(); - if (EntityHelper.INSTANCE.isBossMob(entity)) - return bossProperty.value(); - if (EntityHelper.INSTANCE.isHostileMob(entity)) - return hostileProperty.value(); - if (EntityHelper.INSTANCE.isNeutralMob(entity)) - return neutralProperty.value(); - return false; + return false; } - public boolean isBot(PlayerEntity playerEntity) { if (EntityHelper.INSTANCE.isNPC(playerEntity)) { return true; @@ -371,15 +433,12 @@ public boolean isBot(PlayerEntity playerEntity) { return (!swung.contains(playerEntity) && !touchedGround.contains(playerEntity)) || playerEntity.getGameProfile().getProperties().isEmpty(); } } - public void setHasTarget(boolean hasTarget) { this.hasTarget = hasTarget; } - public boolean hasTarget() { return hasTarget; } - @Override public void onDisable() { super.onDisable(); @@ -388,13 +447,11 @@ public void onDisable() { BaritoneHelper.INSTANCE.disableKillauraTargetProcess(); FeatureExtension.get(targetModeProperty.value(), this).disable(); } - public enum TargetMode { SINGLE, MULTI } - public enum AttackTiming { PRE, POST } - } +//lol diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/killaura/impl/MultiAura.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/killaura/impl/MultiAura.java index d78c6f633..9827e438e 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/killaura/impl/MultiAura.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/killaura/impl/MultiAura.java @@ -19,6 +19,7 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket; +import me.dustin.jex.helper.misc.StopWatch; import net.minecraft.util.Hand; import net.minecraft.util.math.Vec3d; import me.dustin.jex.feature.mod.core.Feature; @@ -28,7 +29,9 @@ public class MultiAura extends FeatureExtension { - private final ArrayList targets = new ArrayList<>(); + private final ArrayList targets = new ArrayList<>(); + private final ArrayList ltargets = new ArrayList<>(); + private final StopWatch stopWatch = new StopWatch(); public MultiAura() { super(KillAura.TargetMode.MULTI, KillAura.class); @@ -48,16 +51,18 @@ public void pass(Event event1) { if (event1 instanceof EventPlayerPackets event) { if (event.getMode() == EventPlayerPackets.Mode.PRE) { getTargets(); + getLivingTargets(); KillAura.INSTANCE.setHasTarget(!targets.isEmpty()); if (!targets.isEmpty()) { if (BaritoneHelper.INSTANCE.baritoneExists()) { if (BaritoneHelper.INSTANCE.isBaritoneRunning() && !(Feature.getState(Excavator.class) && Feature.get(Excavator.class).isPaused())) - BaritoneHelper.INSTANCE.followUntilDead(targets.get(0), KillAura.INSTANCE); + BaritoneHelper.INSTANCE.followUntilDead(ltargets.get(0), KillAura.INSTANCE); } - if (KillAura.INSTANCE.rotateProperty.value()) { + if (KillAura.INSTANCE.rotateProperty.value() && stopWatch.hasPassed(KillAura.INSTANCE.rotdelProperty.value())) { RotationVector rotationVector = new RotationVector(PlayerHelper.INSTANCE.getYaw(), 90); event.setRotation(rotationVector); - } + stopWatch.reset(); + } } else { if (BaritoneHelper.INSTANCE.baritoneExists()) if (KillAura.INSTANCE.baritoneOverrideProperty.value() && BaritoneHelper.INSTANCE.isBaritoneRunning()) @@ -70,7 +75,7 @@ public void pass(Event event1) { doAttack(); } if (event1 instanceof EventRender3D) { - for (LivingEntity target : targets) + for (Entity target : targets) if (target != null && KillAura.INSTANCE.showTargetProperty.value()) { Render3DHelper.INSTANCE.drawEntityBox(((EventRender3D) event1).getPoseStack(), target, ((EventRender3D) event1).getPartialTicks(), KillAura.INSTANCE.targetColorProperty.value().getRGB()); } @@ -102,9 +107,9 @@ public void doAttack() { } } }else { - if (KillAura.INSTANCE.autoBlockProperty.value()) + if (KillAura.INSTANCE.autoBlockProperty.value()) { PlayerHelper.INSTANCE.block(KillAura.INSTANCE.ignoreNewCombatProperty.value()); - + } boolean canSwing = KillAura.INSTANCE.canSwing(); if (canSwing) if (EntityHelper.INSTANCE.isAuraBlocking()) { @@ -112,7 +117,7 @@ public void doAttack() { PlayerHelper.INSTANCE.unblock(); } - for (LivingEntity target : targets) { + for (Entity target : targets) { if (KillAura.INSTANCE.rayTraceProperty.value() && target != null) { Entity possible = PlayerHelper.INSTANCE.getCrosshairEntity(Wrapper.INSTANCE.getMinecraft().getTickDelta(), PlayerHelper.INSTANCE.rotateToEntity(target), KillAura.INSTANCE.reachProperty.value()); if (possible instanceof LivingEntity && !targets.contains(possible)) { @@ -129,7 +134,9 @@ public void doAttack() { } } if (canSwing) { + if (KillAura.INSTANCE.swingProperty.value()) { PlayerHelper.INSTANCE.swing(Hand.MAIN_HAND); + } Wrapper.INSTANCE.getLocalPlayer().resetLastAttackedTicks(); } @@ -141,12 +148,21 @@ public void doAttack() { public void getTargets() { targets.clear(); + for (Entity entity : Wrapper.INSTANCE.getWorld().getEntities()) { + Entity entity1 = entity; + if (KillAura.INSTANCE.isValid(entity1, true)) { + targets.add(entity1); + } + } + } +public void getLivingTargets() { + ltargets.clear(); for (Entity entity : Wrapper.INSTANCE.getWorld().getEntities()) { if (entity instanceof LivingEntity livingEntity1) { if (KillAura.INSTANCE.isValid(livingEntity1, true)) { - targets.add(livingEntity1); + ltargets.add(livingEntity1); } } } - } + } } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/combat/killaura/impl/SingleAura.java b/src/main/java/me/dustin/jex/feature/mod/impl/combat/killaura/impl/SingleAura.java index f18f46a0e..275ee4bd4 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/combat/killaura/impl/SingleAura.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/combat/killaura/impl/SingleAura.java @@ -11,10 +11,12 @@ import me.dustin.jex.helper.entity.EntityHelper; import me.dustin.jex.helper.math.vector.RotationVector; import me.dustin.jex.helper.baritone.BaritoneHelper; +import me.dustin.jex.feature.property.Property; import me.dustin.jex.helper.misc.Wrapper; import me.dustin.jex.helper.player.PlayerHelper; import me.dustin.jex.helper.render.Render3DHelper; import net.minecraft.client.util.math.MatrixStack; +import me.dustin.jex.helper.misc.StopWatch; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.util.Hand; @@ -25,7 +27,9 @@ public class SingleAura extends FeatureExtension { - private LivingEntity target; + private Entity target; + private LivingEntity livingtarget; + private final StopWatch stopWatch = new StopWatch(); public SingleAura() { super(KillAura.TargetMode.SINGLE, KillAura.class); @@ -42,9 +46,12 @@ public void pass(Event event1) { if (target == null || !KillAura.INSTANCE.isValid(target, true)) { target = getClosest(); } + if (livingtarget == null || !KillAura.INSTANCE.isValid(livingtarget, true)) { + livingtarget = getLivingClosest(); + } KillAura.INSTANCE.setHasTarget(target != null); if (target != null) { - if (KillAura.INSTANCE.rotateProperty.value()) { + if (KillAura.INSTANCE.rotateProperty.value() && stopWatch.hasPassed(KillAura.INSTANCE.rotdelProperty.value())) { RotationVector rotationVector = PlayerHelper.INSTANCE.rotateToEntity(target); if (KillAura.INSTANCE.randomizeProperty.value()) { rotationVector = PlayerHelper.INSTANCE.randomRotateTo(target, KillAura.INSTANCE.randomWidthProperty.value(), KillAura.INSTANCE.randomHeightProperty.value()); @@ -55,7 +62,8 @@ public void pass(Event event1) { if (KillAura.INSTANCE.lockviewProperty.value()) { PlayerHelper.INSTANCE.setRotation(event.getRotation()); } - } + stopWatch.reset(); + } } if ((EntityHelper.INSTANCE.isAuraBlocking()) && PlayerHelper.INSTANCE.isMoving()) PlayerHelper.INSTANCE.unblock(); @@ -84,7 +92,7 @@ public void pass(Event event1) { public void doAttack() { boolean reblock = false; - LivingEntity savedTarget = null; + Entity savedTarget = null; if (KillAura.INSTANCE.rayTraceProperty.value() && target != null) { savedTarget = target; Entity possible = PlayerHelper.INSTANCE.getCrosshairEntity(Wrapper.INSTANCE.getMinecraft().getTickDelta(), PlayerHelper.INSTANCE.rotateToEntity(target), KillAura.INSTANCE.reachProperty.value()); @@ -106,8 +114,9 @@ public void doAttack() { if (BaritoneHelper.INSTANCE.baritoneExists()) { if (KillAura.INSTANCE.baritoneOverrideProperty.value()) if (BaritoneHelper.INSTANCE.isBaritoneRunning() && !(Feature.getState(Excavator.class) && Feature.get(Excavator.class).isPaused())) - BaritoneHelper.INSTANCE.followUntilDead(target, KillAura.INSTANCE); + BaritoneHelper.INSTANCE.followUntilDead(livingtarget, KillAura.INSTANCE); } + if (KillAura.INSTANCE.autoBlockProperty.value() && !alreadyBlocking) PlayerHelper.INSTANCE.block(KillAura.INSTANCE.ignoreNewCombatProperty.value()); @@ -117,7 +126,9 @@ public void doAttack() { PlayerHelper.INSTANCE.unblock(); } Wrapper.INSTANCE.getClientPlayerInteractionManager().attackEntity(Wrapper.INSTANCE.getLocalPlayer(), target); + if (KillAura.INSTANCE.swingProperty.value()) { PlayerHelper.INSTANCE.swing(Hand.MAIN_HAND); + } if (KillAura.INSTANCE.autoBlockProperty.value() && reblock) { PlayerHelper.INSTANCE.block(KillAura.INSTANCE.ignoreNewCombatProperty.value()); } @@ -133,17 +144,29 @@ public void doAttack() { } } - public LivingEntity getClosest() { - LivingEntity livingEntity = null; + public Entity getClosest() { + Entity livingEntity = null; float distance = KillAura.INSTANCE.reachProperty.value(); + for (Entity entity : Wrapper.INSTANCE.getWorld().getEntities()) { + Entity entity1 = entity; + if (KillAura.INSTANCE.isValid(entity1, true) && entity1.distanceTo(Freecam.playerEntity != null ? Freecam.playerEntity : Wrapper.INSTANCE.getLocalPlayer()) <= distance) { + livingEntity = entity1; + distance = entity1.distanceTo(Wrapper.INSTANCE.getLocalPlayer()); + } + } + return livingEntity; + } + public LivingEntity getLivingClosest() { + LivingEntity livingEntity0 = null; + float distance0 = KillAura.INSTANCE.reachProperty.value(); for (Entity entity : Wrapper.INSTANCE.getWorld().getEntities()) { if (entity instanceof LivingEntity livingEntity1) { - if (KillAura.INSTANCE.isValid(livingEntity1, true) && livingEntity1.distanceTo(Freecam.playerEntity != null ? Freecam.playerEntity : Wrapper.INSTANCE.getLocalPlayer()) <= distance) { - livingEntity = livingEntity1; - distance = livingEntity1.distanceTo(Wrapper.INSTANCE.getLocalPlayer()); + if (KillAura.INSTANCE.isValid(livingEntity1, true) && livingEntity1.distanceTo(Freecam.playerEntity != null ? Freecam.playerEntity : Wrapper.INSTANCE.getLocalPlayer()) <= distance0) { + livingEntity0 = livingEntity1; + distance0 = livingEntity1.distanceTo(Wrapper.INSTANCE.getLocalPlayer()); } } } - return livingEntity; + return livingEntity0; } } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/Announcer.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/Announcer.java index ecb8340a6..ec1dd0c81 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/Announcer.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/Announcer.java @@ -41,7 +41,7 @@ public class Announcer extends Feature { private final StopWatch stopWatch = new StopWatch(); public Announcer() { - super(Category.MISC, "Fastest way to get muted! Fully customizable with files in the Jex folder"); + super(Category.MISC); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/AntiAFK.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/AntiAFK.java index 96ceccedf..bdfec9184 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/AntiAFK.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/AntiAFK.java @@ -39,7 +39,7 @@ public class AntiAFK extends Feature { private BlockPos[] lastSpots; public AntiAFK() { - super(Category.MISC, "Prevent yourself from being detected as AFK and potentially kicked"); + super(Category.MISC); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/ArmorDerp.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/ArmorDerp.java index 5592b3b71..ccec72c45 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/ArmorDerp.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/ArmorDerp.java @@ -33,7 +33,7 @@ public class ArmorDerp extends Feature { private final StopWatch stopWatch = new StopWatch(); public ArmorDerp() { - super(Category.MISC, "Spam switch between armor in your inventory"); + super(Category.MISC); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoDisconnect.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoDisconnect.java index 00bc1fa3f..89e8a5101 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoDisconnect.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoDisconnect.java @@ -29,7 +29,7 @@ public class AutoDisconnect extends Feature { .build(); public AutoDisconnect() { - super(Category.MISC, "Automatically disconnect when your health gets below a certain value"); + super(Category.MISC); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoLibrarianRoll.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoLibrarianRoll.java index 5e10d5850..d91340be8 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoLibrarianRoll.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoLibrarianRoll.java @@ -52,7 +52,6 @@ public class AutoLibrarianRoll extends Feature { public final Property priceModeProperty = new Property.PropertyBuilder(this.getClass()) .name("Price Mode") - .description("The type of pricing to consider.") .value(PriceMode.NORMAL) .build(); public final Property priceProperty = new Property.PropertyBuilder(this.getClass()) @@ -63,7 +62,6 @@ public class AutoLibrarianRoll extends Feature { .build(); public final Property autoTradeProperty = new Property.PropertyBuilder(this.getClass()) .name("Auto Trade") - .description("Whether or not to automatically trade when it is found.") .value(true) .build(); @@ -81,7 +79,7 @@ public class AutoLibrarianRoll extends Feature { private static final Map doneVillagers = new HashMap<>(); public AutoLibrarianRoll() { - super(Category.MISC, "Automatically break lecterns matched to a villager until it has the trade you want"); + super(Category.MISC); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoMend.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoMend.java index 435cb028e..be192f48a 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoMend.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoMend.java @@ -16,7 +16,7 @@ public class AutoMend extends Feature { public AutoMend() { - super(Category.MISC, "Automatically hold a mending item in your offhand until it has full durability"); + super(Category.MISC); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoDogFeeder.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoPetFeeder.java similarity index 57% rename from src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoDogFeeder.java rename to src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoPetFeeder.java index 12339a760..9368a27ed 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoDogFeeder.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoPetFeeder.java @@ -9,31 +9,43 @@ import me.dustin.jex.helper.entity.EntityHelper; import me.dustin.jex.helper.misc.Wrapper; import me.dustin.jex.helper.player.InventoryHelper; +import me.dustin.jex.feature.property.Property; import net.minecraft.entity.passive.WolfEntity; +import net.minecraft.entity.passive.CatEntity; import net.minecraft.item.Items; import net.minecraft.util.Hand; -public class AutoDogFeeder extends Feature { +public class AutoPetFeeder extends Feature { - public AutoDogFeeder() { - super(Category.MISC, "Automatically feed your pups to keep them at full health at all times."); + public AutoPetFeeder() { + super(Category.MISC); } @EventPointer private final EventListener eventPlayerPacketsEventListener = new EventListener<>(event -> { - int slot = getDogFoodSlot(); - if (slot == -1) + int slotdog = getDogFoodSlot(); + if (slotdog == -1) + return; + int slotcat = getCatFoodSlot(); + if (slotcat == -1) return; int savedSlot = InventoryHelper.INSTANCE.getInventory().selectedSlot; - Wrapper.INSTANCE.getWorld().getEntities().forEach(entity -> { - if (entity instanceof WolfEntity wolfEntity && EntityHelper.INSTANCE.doesPlayerOwn(wolfEntity)) { + Wrapper.INSTANCE.getWorld().getEntities().forEach(entity -> { + if (entity instanceof CatEntity catEntity && EntityHelper.INSTANCE.doesPlayerOwn(catEntity)) { + if (catEntity.getHealth() < catEntity.getMaxHealth()) { + InventoryHelper.INSTANCE.setSlot(slotcat, false, true); + Wrapper.INSTANCE.getClientPlayerInteractionManager().interactEntity(Wrapper.INSTANCE.getLocalPlayer(), catEntity, Hand.MAIN_HAND); + InventoryHelper.INSTANCE.setSlot(savedSlot, false, true); + } + } + if (entity instanceof WolfEntity wolfEntity && EntityHelper.INSTANCE.doesPlayerOwn(wolfEntity)) { if (wolfEntity.getHealth() < wolfEntity.getMaxHealth()) { - InventoryHelper.INSTANCE.setSlot(slot, false, true); + InventoryHelper.INSTANCE.setSlot(slotdog, false, true); Wrapper.INSTANCE.getClientPlayerInteractionManager().interactEntity(Wrapper.INSTANCE.getLocalPlayer(), wolfEntity, Hand.MAIN_HAND); InventoryHelper.INSTANCE.setSlot(savedSlot, false, true); } - } - }); + } +}); }, new PlayerPacketsFilter(EventPlayerPackets.Mode.PRE)); private int getDogFoodSlot() { @@ -51,5 +63,15 @@ private int getDogFoodSlot() { return mutton; return InventoryHelper.INSTANCE.getFromHotbar(Items.COOKED_RABBIT); } - + +public int getCatFoodSlot() { + int cod = InventoryHelper.INSTANCE.getFromHotbar(Items.COD); + if (cod != -1) + return cod; + int salmon = InventoryHelper.INSTANCE.getFromHotbar(Items.SALMON); + if (salmon != -1) + return salmon; + int eat = cod + salmon; + return eat; +} } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoReconnect.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoReconnect.java index 63af9304a..dbd899867 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoReconnect.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoReconnect.java @@ -36,7 +36,7 @@ public class AutoReconnect extends Feature { private ServerAddress serverAddress; public AutoReconnect() { - super(Category.MISC, "Reconnect automatically."); + super(Category.MISC); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoRespawn.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoRespawn.java index 88f8ef4f5..9415f1eaa 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoRespawn.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoRespawn.java @@ -11,7 +11,7 @@ public class AutoRespawn extends Feature { public AutoRespawn() { - super(Category.MISC, "Respawn without having to click anything."); + super(Category.MISC); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoWither.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoWither.java index 1a8c96e41..5e8b35340 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoWither.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/AutoWither.java @@ -24,7 +24,7 @@ public class AutoWither extends Feature { private PlayerInteractBlockC2SPacket packet = null; public AutoWither() { - super(Category.MISC, "Automatically create withers by just placing soul sand"); + super(Category.MISC); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/CoordFinder.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/CoordFinder.java index 16d2e4926..ef29d7027 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/CoordFinder.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/CoordFinder.java @@ -12,7 +12,7 @@ public class CoordFinder extends Feature { public CoordFinder() { - super(Category.MISC, "Tells you exact coordinates of Wither Spawns and End Portal Activations on vanilla servers."); + super(Category.MISC); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/CreativeDrop.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/CreativeDrop.java index d21264ba4..300e3ff90 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/CreativeDrop.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/CreativeDrop.java @@ -31,19 +31,16 @@ public class CreativeDrop extends Feature { .build(); public final Property speedProperty = new Property.PropertyBuilder(this.getClass()) .name("Speed") - .description("The speed that you drop items at.") .value(1) .min(1) .max(10) .build(); public final Property nameProperty = new Property.PropertyBuilder(this.getClass()) .name("Name") - .description("Whether or not to name the item.") .value(true) .build(); public final Property enchantProperty = new Property.PropertyBuilder(this.getClass()) .name("Enchant") - .description("Whether or not to enchant the item.") .value(true) .build(); @@ -51,13 +48,13 @@ public class CreativeDrop extends Feature { private final StopWatch stopWatch = new StopWatch(); public CreativeDrop() { - super(Category.MISC, "Drop all items from your inventory in creative."); + super(Category.MISC); } @EventPointer private final EventListener eventPlayerPacketsEventListener = new EventListener<>(event -> { Random random = new Random(); - String[] names = new String[]{JexClient.INSTANCE.getBaseUrl(), "Download Jex Client to do this", "Nice FPS", "Oh look a shiny item", "Copper pants", "How do I stop dropping items?", "Can you hear me?", "Please help I am stuck in this item"}; + String[] names = new String[]{JexClient.INSTANCE.getBaseUrl(), "https://github.com/mdenials/JexClient"}; if (stopWatch.hasPassed(delayProperty.value()) && Wrapper.INSTANCE.getLocalPlayer().isCreative()) { for (int i = 0; i < speedProperty.value(); i++) { ItemStack itemStack = new ItemStack(Item.byRawId(slot)); diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/Derp.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/Derp.java index 3072f3615..383c694ab 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/Derp.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/Derp.java @@ -22,7 +22,6 @@ public class Derp extends Feature { .build(); public final Property normalizeAnglesProperty = new Property.PropertyBuilder(this.getClass()) .name("Normalize Angles") - .description("Keeps your angles vanilla.") .value(true) .build(); public final Property swingProperty = new Property.PropertyBuilder(this.getClass()) @@ -31,7 +30,6 @@ public class Derp extends Feature { .build(); public final Property showSwingProperty = new Property.PropertyBuilder(this.getClass()) .name("Show Swing") - .description("Show your arm swinging client-side.") .value(true) .parent(swingProperty) .depends(parent -> (boolean) parent.value()) @@ -40,7 +38,7 @@ public class Derp extends Feature { private int yaw, pitch; public Derp() { - super(Category.MISC, "Randomly look around for other players"); + super(Category.MISC); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/Fakelag.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/Fakelag.java index 4039b1dfc..0645950ba 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/Fakelag.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/Fakelag.java @@ -20,20 +20,20 @@ public class Fakelag extends Feature { .name("Catch When") .value(CatchWhen.BOTH) .build(); - public final Property chokeProperty = new Property.PropertyBuilder(this.getClass()) +public final Property chokeProperty = new Property.PropertyBuilder(this.getClass()) .name("Choke MS") .value(100) - .min(50) + .min(20) .max(2000) - .inc(10) + .inc(20) .build(); private final ArrayList> packets = new ArrayList<>(); private final StopWatch stopWatch = new StopWatch(); private boolean sending = false; - + public Fakelag() { - super(Category.MISC, "Pretend to lag"); + super(Category.MISC); } @EventPointer @@ -50,8 +50,8 @@ public Fakelag() { } else { sending = true; packets.forEach(Wrapper.INSTANCE.getLocalPlayer().networkHandler::sendPacket); - sending = false; packets.clear(); + sending = false; stopWatch.reset(); } }, new ClientPacketFilter(EventPacketSent.Mode.PRE)); @@ -82,7 +82,9 @@ public void onDisable() { if (Wrapper.INSTANCE.getLocalPlayer() != null) { try { packets.forEach(Wrapper.INSTANCE.getLocalPlayer().networkHandler::sendPacket); - } catch (Exception e) {} + } catch (Exception e) { + return; + } packets.clear(); } super.onDisable(); diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/IRC.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/IRC.java index 4b47850a5..aa8239608 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/IRC.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/IRC.java @@ -28,11 +28,22 @@ public class IRC extends Feature { public final Property sendPrefixProperty = new Property.PropertyBuilder(this.getClass()) - .name("Send Prefix") - .description("The prefix used to activate the IRC chat mode.") + .name("SendPrefix") .value("@") .max(2) .build(); + + public final Property sendIpProperty = new Property.PropertyBuilder(this.getClass()) + .name("SendIP") + .value("132.145.154.217") + .max(50) + .build(); + + public final Property sendPortProperty = new Property.PropertyBuilder(this.getClass()) + .name("SendPort") + .value("6969") + .max(5) + .build(); public boolean ircChatOverride; public boolean renderAboveChat = true; @@ -48,7 +59,7 @@ public class IRC extends Feature { }; public IRC() { - super("IRC", Category.MISC, "Connect to an IRC server to chat with other Jex users", true, true, 0); + super("IRC", Category.MISC, "", true, true, 0); } @@ -58,7 +69,8 @@ public void onEnable() { ircClient = new IRCClient(Wrapper.INSTANCE.getMinecraft().getSession().getUsername()); ircClient.setMessageConsumer(messageListener); ircClient.setDisconnectConsumer(disconnectListener); - ircClient.connect("132.145.154.217", 6969); + Integer port = Integer.valueOf(sendPortProperty.value()); + ircClient.connect(sendIpProperty.value(), port); } super.onEnable(); } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/InventoryAutoClicker.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/InventoryAutoClicker.java index 4f3a9ea2f..bd3e968c5 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/InventoryAutoClicker.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/InventoryAutoClicker.java @@ -18,7 +18,7 @@ public class InventoryAutoClicker extends Feature { public InventoryAutoClicker() { - super("InvAutoClicker", Category.MISC, "Hold shift+click or ctrl+q to automatically do them."); + super("InvAutoClicker", Category.MISC, "shift+click-move and ctrl+q-drop "); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/InventorySort.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/InventorySort.java index 61a60bd5a..bb3e9defd 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/InventorySort.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/InventorySort.java @@ -30,7 +30,7 @@ public class InventorySort extends Feature { private final StopWatch timeOutStopWatch = new StopWatch(); public InventorySort() { - super(Category.MISC, "Sort your inventory with a middle click while it's open."); + super(Category.MISC, ""); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/MassTPA.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/MassTPA.java index dd0108188..87dd63225 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/MassTPA.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/MassTPA.java @@ -30,7 +30,7 @@ public class MassTPA extends Feature { private final StopWatch stopWatch = new StopWatch(); public MassTPA() { - super(Category.MISC, "Send a TPA to everyone until one is accepted"); + super(Category.MISC, ""); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/MendingSaver.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/MendingSaver.java index ff4202fb1..badf06213 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/MendingSaver.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/MendingSaver.java @@ -18,17 +18,18 @@ public class MendingSaver extends Feature { public Property notifyProperty = new Property.PropertyBuilder(this.getClass()) .name("Notify") - .description("Whether or not to notify the player when activated.") .value(false) .build(); public Property itemPercentProperty = new Property.PropertyBuilder(this.getClass()) .name("Item %") .value(10) - .max(30) + .min(1) + .max(50) + .inc(1) .build(); public MendingSaver() { - super(Category.MISC, "Save your mending tools from breaking by putting them away automatically."); + super(Category.MISC, ""); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/MiddleClickFriend.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/MiddleClickFriend.java index 33b0e2846..ca127ff9f 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/MiddleClickFriend.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/MiddleClickFriend.java @@ -18,7 +18,7 @@ public class MiddleClickFriend extends Feature { public MiddleClickFriend() { - super(Category.MISC, "Middle click people to add them as friends."); + super(Category.MISC, ""); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/PingSpoof.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/PingSpoof.java index 80496da41..3e9a4d264 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/PingSpoof.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/PingSpoof.java @@ -20,7 +20,7 @@ public class PingSpoof extends Feature { .name("Ping") .value(5000L) .min(1000) - .max(14500) + .max(10000) .inc(100) .build(); @@ -28,14 +28,14 @@ public class PingSpoof extends Feature { private long keepAliveId = -1; public PingSpoof() { - super(Category.MISC, "Spoofs your ping to be as high as possible"); + super(Category.MISC, ""); } @EventPointer private final EventListener eventTickEventListener = new EventListener<>(event -> { if (Wrapper.INSTANCE.getLocalPlayer() == null) { - packetStopWatch.reset(); keepAliveId = -1; + packetStopWatch.reset(); } else if (keepAliveId != -1 && packetStopWatch.hasPassed(pingProperty.value())) { NetworkHelper.INSTANCE.sendPacketDirect(new KeepAliveC2SPacket(keepAliveId)); keepAliveId = -1; @@ -49,5 +49,20 @@ public PingSpoof() { packetStopWatch.reset(); event.cancel(); }, new ClientPacketFilter(EventPacketSent.Mode.PRE, KeepAliveC2SPacket.class)); + +@Override + public void onEnable() { + super.onEnable(); + } + @Override + public void onDisable() { + if (Wrapper.INSTANCE.getLocalPlayer() != null) { + try { + NetworkHelper.INSTANCE.sendPacketDirect(new KeepAliveC2SPacket(keepAliveId)); + } catch (Exception e) {} + keepAliveId = -1; + } + super.onDisable(); + } } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/SkinBlink.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/SkinBlink.java index ab4f686e1..c60585514 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/SkinBlink.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/SkinBlink.java @@ -21,49 +21,42 @@ public class SkinBlink extends Feature { .build(); public final Property headProperty = new Property.PropertyBuilder(this.getClass()) .name("Head") - .description("Enables toggling the head cover") .value(true) .parent(modeProperty) .depends(parent -> parent.value() == Mode.CUSTOM) .build(); public final Property jacketProperty = new Property.PropertyBuilder(this.getClass()) .name("Jacket") - .description("Enables toggling the jacket cover") .value(true) .parent(modeProperty) .depends(parent -> parent.value() == Mode.CUSTOM) .build(); public final Property capeProperty = new Property.PropertyBuilder(this.getClass()) .name("Cape") - .description("Enables toggling the cape") .value(true) .parent(modeProperty) .depends(parent -> parent.value() == Mode.CUSTOM) .build(); public final Property leftArmProperty = new Property.PropertyBuilder(this.getClass()) .name("Left Arm") - .description("Enables toggling the left arm cover") .value(true) .parent(modeProperty) .depends(parent -> parent.value() == Mode.CUSTOM) .build(); public final Property leftLegProperty = new Property.PropertyBuilder(this.getClass()) .name("Left Leg") - .description("Enables toggling the left leg cover") .value(true) .parent(modeProperty) .depends(parent -> parent.value() == Mode.CUSTOM) .build(); public final Property rightArmProperty = new Property.PropertyBuilder(this.getClass()) .name("Right Arm") - .description("Enables toggling the right arm cover") .value(true) .parent(modeProperty) .depends(parent -> parent.value() == Mode.CUSTOM) .build(); public final Property rightLegProperty = new Property.PropertyBuilder(this.getClass()) .name("Right Leg") - .description("Enables toggling the right leg cover") .value(true) .parent(modeProperty) .depends(parent -> parent.value() == Mode.CUSTOM) @@ -81,7 +74,7 @@ public class SkinBlink extends Feature { private boolean toggleCustom; public SkinBlink() { - super(Category.MISC, "Make your skin flash your layers on and off"); + super(Category.MISC, ""); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/Spammer.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/Spammer.java index cad631bb2..61affb834 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/Spammer.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/Spammer.java @@ -22,15 +22,13 @@ public class Spammer extends Feature { public final Property sourceProperty = new Property.PropertyBuilder(this.getClass()) - .name("Source") - .description("The source for the list of messages to spam.") + .name("SourceList") .value(SpamSource.SPAM_FILE) .build(); - public final Property delayProperty = new Property.PropertyBuilder(this.getClass()) + public final Property delayProperty = new Property.PropertyBuilder(this.getClass()) .name("Delay (MS)") - .value(500L) - .max(30000) - .inc(10) + .value("500") + .max(5) .build(); private String spamString; @@ -48,7 +46,8 @@ public static void createSpamFile() { @EventPointer private final EventListener eventPlayerPacketsEventListener = new EventListener<>(event -> { - if (!stopWatch.hasPassed(delayProperty.value())) + long delay = Long.valueOf(delayProperty.value()); + if (!stopWatch.hasPassed(delay)) return; String sentence = spamString.split("\n")[currentSpot]; while (containsSyntax(sentence)) { diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/SpeedCrafter.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/SpeedCrafter.java index 99cbe9038..06827bad6 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/SpeedCrafter.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/SpeedCrafter.java @@ -18,6 +18,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.recipe.Recipe; import net.minecraft.screen.CraftingScreenHandler; +import net.minecraft.screen.StonecutterScreenHandler; + import net.minecraft.screen.slot.SlotActionType; import java.util.List; @@ -26,7 +28,9 @@ public class SpeedCrafter extends Feature { public final Property delayProperty = new Property.PropertyBuilder(this.getClass()) .name("Delay") .value(0L) - .max(500) + .min(0) + .max(1000) + .inc(10) .build(); public Item craftingItem; @@ -34,7 +38,7 @@ public class SpeedCrafter extends Feature { private final StopWatch stopWatch = new StopWatch(); public SpeedCrafter() { - super(Category.MISC, "Automatically craft by opening a crafting table."); + super(Category.MISC); } @EventPointer @@ -42,7 +46,7 @@ public SpeedCrafter() { if (Wrapper.INSTANCE.getLocalPlayer().currentScreenHandler instanceof CraftingScreenHandler craftingScreenHandler) { if (InventoryHelper.INSTANCE.isInventoryFull(new ItemStack(craftingItem))) { if (!alerted) { - ChatHelper.INSTANCE.addClientMessage("Inventory is full! Speedcrafter can not craft!"); + ChatHelper.INSTANCE.addClientMessage("Inventory is full!"); alerted = true; } return; @@ -50,7 +54,7 @@ public SpeedCrafter() { alerted = false; if (!stopWatch.hasPassed(delayProperty.value())) return; - List recipeResultCollectionList = Wrapper.INSTANCE.getLocalPlayer().getRecipeBook().getResultsForGroup(RecipeBookGroup.CRAFTING_BUILDING_BLOCKS); + List recipeResultCollectionList = Wrapper.INSTANCE.getLocalPlayer().getRecipeBook().getResultsForGroup(RecipeBookGroup.CRAFTING_SEARCH); for (RecipeResultCollection recipeResultCollection : recipeResultCollectionList) { for (Recipe recipe : recipeResultCollection.getRecipes(true)) { if (recipe.getOutput().getItem() == craftingItem) { @@ -61,7 +65,7 @@ public SpeedCrafter() { return; } } - } + } } setSuffix(craftingItem == null ? "None" : craftingItem.getName().getString()); }, new PlayerPacketsFilter(EventPlayerPackets.Mode.PRE)); @@ -69,7 +73,7 @@ public SpeedCrafter() { @Override public void onEnable() { if (craftingItem == null) { - ChatHelper.INSTANCE.addClientMessage("Crafting item not set!"); + ChatHelper.INSTANCE.addClientMessage("Item not set!"); ChatHelper.INSTANCE.addClientMessage("Hold the intended output item and use " + CommandManager.INSTANCE.getPrefix() + "sc set"); } super.onEnable(); diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/UnfocusedFPS.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/UnfocusedFPS.java index 63c69d60b..68573ed1a 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/UnfocusedFPS.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/UnfocusedFPS.java @@ -18,7 +18,7 @@ public class UnfocusedFPS extends Feature { .build(); public UnfocusedFPS() { - super(Category.MISC, "Limit the FPS while Minecraft isn't in focus to save resources"); + super(Category.MISC); setState(true); } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/misc/VanillaSpoof.java b/src/main/java/me/dustin/jex/feature/mod/impl/misc/VanillaSpoof.java index f205fd6e2..b9aa81d1f 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/misc/VanillaSpoof.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/misc/VanillaSpoof.java @@ -15,7 +15,7 @@ public class VanillaSpoof extends Feature { public VanillaSpoof() { - super(Category.MISC, "Tell the server you are a vanilla player"); + super(Category.MISC); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/AntiVoid.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/AntiVoid.java index 201b5cb4a..8aa000207 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/AntiVoid.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/AntiVoid.java @@ -21,7 +21,7 @@ public class AntiVoid extends Feature { .build(); public AntiVoid() { - super(Category.MOVEMENT, "Prevent yourself from falling to the void"); + super(Category.MOVEMENT); } @EventPointer @@ -29,7 +29,7 @@ public AntiVoid() { setSuffix(modeProperty.value()); ChunkPos chunkPos = Wrapper.INSTANCE.getPlayer().getChunkPos(); if (modeProperty.value() == Mode.ANTICHEAT && Wrapper.INSTANCE.getPlayer().getY() <= Wrapper.INSTANCE.getWorld().getChunk(chunkPos.x, chunkPos.z).getBottomY()) - NetworkHelper.INSTANCE.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(Wrapper.INSTANCE.getPlayer().getX(), Wrapper.INSTANCE.getPlayer().getY() + 2, Wrapper.INSTANCE.getPlayer().getZ(), true)); + NetworkHelper.INSTANCE.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(Wrapper.INSTANCE.getPlayer().getX(), Wrapper.INSTANCE.getPlayer().getY() + 10, Wrapper.INSTANCE.getPlayer().getZ(), true)); }, new PlayerPacketsFilter(EventPlayerPackets.Mode.PRE)); @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/BucketCatch.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/BucketCatch.java index 2c9765a1c..8825876e8 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/BucketCatch.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/BucketCatch.java @@ -27,7 +27,6 @@ public class BucketCatch extends Feature { .build(); public final Property rotateProperty = new Property.PropertyBuilder(this.getClass()) .name("Rotate") - .description("Whether or not to rotate your head on the server.") .value(false) .build(); @@ -35,7 +34,7 @@ public class BucketCatch extends Feature { private boolean click; public BucketCatch() { - super(Category.MOVEMENT, "Place a water bucket under yourself when you fall to avoid fall damage. 90% of the time, it works every time"); + super(Category.MOVEMENT); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/CompatSwim.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/CompatSwim.java index 93f63cc0b..4f594f93d 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/CompatSwim.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/CompatSwim.java @@ -20,7 +20,7 @@ public class CompatSwim extends Feature { public CompatSwim() { - super(Category.MOVEMENT, "Change swim speed to work on pre 1.13 servers with anticheats"); + super(Category.MOVEMENT); } @EventPointer @@ -50,4 +50,4 @@ public CompatSwim() { event.cancel(); } }); -} \ No newline at end of file +} diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/DepthStrider.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/DepthStrider.java index 2d597190b..79daee72e 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/DepthStrider.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/DepthStrider.java @@ -15,10 +15,10 @@ public class DepthStrider extends Feature { public final Property levelProperty = new Property.PropertyBuilder(this.getClass()) .name("Level") - .description("The level of Depth-Strider enchantment to emulate.") .value(3) .min(1) .max(3) + .inc(1) .build(); public final Property allowSprintingProperty = new Property.PropertyBuilder(this.getClass()) .name("Allow Sprinting") @@ -26,7 +26,7 @@ public class DepthStrider extends Feature { .build(); public DepthStrider() { - super(Category.MOVEMENT, "Move through water like you have Depth Strider boots on"); + super(Category.MOVEMENT); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/FallSpeed.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/FallSpeed.java index c18bedccc..291213158 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/FallSpeed.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/FallSpeed.java @@ -4,7 +4,9 @@ import me.dustin.events.core.annotate.EventPointer; import me.dustin.jex.event.player.EventMove; import me.dustin.jex.feature.mod.core.Category; +import net.minecraft.util.math.Vec3d; import me.dustin.jex.feature.mod.impl.movement.fly.Fly; +import me.dustin.jex.helper.misc.StopWatch; import me.dustin.jex.feature.property.Property; import me.dustin.jex.helper.misc.Wrapper; import me.dustin.jex.feature.mod.core.Feature; @@ -14,7 +16,6 @@ public class FallSpeed extends Feature { public final Property fallDistanceProperty = new Property.PropertyBuilder(this.getClass()) .name("Fall Distance") - .description("The distance before the speed option kicks in") .value(3f) .min(0) .max(10) @@ -27,17 +28,44 @@ public class FallSpeed extends Feature { .max(15) .inc(0.1f) .build(); + public final Property hoveringProperty = new Property.PropertyBuilder(this.getClass()) + .name("Hovering") + .value(false) + .build(); + public final Property delayProperty = new Property.PropertyBuilder(this.getClass()) + .name("Hovering Delay") + .value(250L) + .min(0L) + .max(500L) + .inc(10L) + .parent(hoveringProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + +private final StopWatch stopWatch = new StopWatch(); public FallSpeed() { - super(Category.MOVEMENT, "Change your fall speed"); + super(Category.MOVEMENT); } @EventPointer private final EventListener eventMoveEventListener = new EventListener<>(event -> { if (Feature.getState(Fly.class) || Feature.getState(Freecam.class)) return; - if (Wrapper.INSTANCE.getLocalPlayer().fallDistance > fallDistanceProperty.value() && !Wrapper.INSTANCE.getLocalPlayer().isOnGround()) { - event.setY(-speedProperty.value()); + if (Wrapper.INSTANCE.getLocalPlayer().fallDistance > fallDistanceProperty.value() && !Wrapper.INSTANCE.getLocalPlayer().isOnGround()) { +if (hoveringProperty.value()) { +if (stopWatch.hasPassed(delayProperty.value())) { + event.setY(-speedProperty.value()); + stopWatch.reset(); } - }); + else + { + event.setY(0.0F); + } + } + else if (hoveringProperty.value() == false) { + event.setY(-speedProperty.value()); + } + } +}); } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/FastLadder.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/FastLadder.java index 8a5e77000..6e36c0c9b 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/FastLadder.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/FastLadder.java @@ -18,12 +18,11 @@ public class FastLadder extends Feature { public final Property skipLadderProperty = new Property.PropertyBuilder(this.getClass()) .name("SkipLadder") - .description("Allow spaces between ladders.") .value(false) .build(); public FastLadder() { - super(Category.MOVEMENT, "Move faster on ladders"); + super(Category.MOVEMENT); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/Gravity.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/Gravity.java new file mode 100644 index 000000000..85ac113ff --- /dev/null +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/Gravity.java @@ -0,0 +1,28 @@ +package me.dustin.jex.feature.mod.impl.movement; + +import me.dustin.events.core.EventListener; +import me.dustin.events.core.annotate.EventPointer; +import me.dustin.jex.event.filters.PlayerPacketsFilter; +import me.dustin.jex.event.player.EventPlayerPackets; +import me.dustin.jex.feature.mod.core.Category; +import me.dustin.jex.helper.entity.EntityHelper; +import me.dustin.jex.helper.misc.Wrapper; +import me.dustin.jex.helper.player.PlayerHelper; +import me.dustin.jex.feature.mod.core.Feature; +import net.minecraft.util.math.Vec3d; + +public class Gravity extends Feature { + + public Gravity() { + super(Category.MOVEMENT); + } + + @EventPointer + private final EventListener eventPlayerPacketsEventListener = new EventListener<>(event -> { + boolean gravity = Wrapper.INSTANCE.getOptions().sneakKey.isPressed(); + Vec3d orig = Wrapper.INSTANCE.getLocalPlayer().getVelocity(); + if (gravity) { + Wrapper.INSTANCE.getLocalPlayer().setVelocity(orig.getX(), 0.0568000030517578, orig.getZ()); + } + }, new PlayerPacketsFilter(EventPlayerPackets.Mode.PRE)); +} diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/InventoryMove.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/InventoryMove.java index c8b8c45fb..e0728366e 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/InventoryMove.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/InventoryMove.java @@ -17,7 +17,7 @@ public class InventoryMove extends Feature { public InventoryMove() { - super(Category.MOVEMENT, "Move while in your inventory."); + super(Category.MOVEMENT); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/NoSlow.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/NoSlow.java index c2c36d5f8..3b3545133 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/NoSlow.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/NoSlow.java @@ -37,7 +37,7 @@ public class NoSlow extends Feature { .build(); public NoSlow() { - super(Category.MOVEMENT, "Prevent actions from slowing you down"); + super(Category.MOVEMENT); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/Parkour.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/Parkour.java index 347eed59e..09abc76a5 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/Parkour.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/Parkour.java @@ -13,14 +13,13 @@ public class Parkour extends Feature { public Parkour() { - super(Category.MOVEMENT, "Jump while on edge of block."); + super(Category.MOVEMENT); } @EventPointer private final EventListener eventPlayerPacketsEventListener = new EventListener<>(event -> { - if (Wrapper.INSTANCE.getLocalPlayer().isOnGround() && EntityHelper.INSTANCE.distanceFromGround(Wrapper.INSTANCE.getLocalPlayer()) > 0.5f && PlayerHelper.INSTANCE.isMoving()) { + if (Wrapper.INSTANCE.getLocalPlayer().isOnGround() && EntityHelper.INSTANCE.distanceFromGround(Wrapper.INSTANCE.getLocalPlayer()) >= 0.5f && PlayerHelper.INSTANCE.isMoving()) { Wrapper.INSTANCE.getLocalPlayer().jump(); - Wrapper.INSTANCE.getLocalPlayer().getVelocity().multiply(1.2f, 1, 1.2f); } }, new PlayerPacketsFilter(EventPlayerPackets.Mode.PRE)); } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/Safewalk.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/Safewalk.java index 6d89765ca..5e3793ba4 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/Safewalk.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/Safewalk.java @@ -9,7 +9,7 @@ public class Safewalk extends Feature { public Safewalk() { - super(Category.MOVEMENT, "Prevent yourself from walking off of blocks like you're sneaking"); + super(Category.MOVEMENT); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/Scaffold.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/Scaffold.java index 9905470ec..343389d6c 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/Scaffold.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/Scaffold.java @@ -43,10 +43,31 @@ public class Scaffold extends Feature { .description("Sneak when you place a block.") .value(false) .build(); - public final Property rangeProperty = new Property.PropertyBuilder(this.getClass()) - .name("Range") - .value(0) - .max(4) + public final Property xrangeProperty = new Property.PropertyBuilder(this.getClass()) + .name("RangeX") + .value(1) + .min(0) + .max(6) + .build(); + public final Property zrangeProperty = new Property.PropertyBuilder(this.getClass()) + .name("RangeZ") + .value(1) + .min(0) + .max(6) + .build(); + public final Property rotateProperty = new Property.PropertyBuilder(this.getClass()) + .name("Rotate") + .description("Whether or not to rotate your head on the server.") + .value(false) + .build(); + public final Property pitchProperty = new Property.PropertyBuilder(this.getClass()) + .name("VerticalRotation") + .value(0.1f) + .min(-90f) + .max(90f) + .inc(1f) + .parent(rotateProperty) + .depends(parent -> (boolean) parent.value()) .build(); private BlockHitResult blockHitResult; @@ -116,7 +137,8 @@ private boolean isEqual(BlockPos pos1, BlockPos pos2) { private void getNearBlocks(BlockPos blockPos) { emptyNearBlocks.clear(); - if (rangeProperty.value() == 0) { + if (xrangeProperty.value() == 0) { + if (zrangeProperty.value() == 0) { BlockPos below = new BlockPos(Wrapper.INSTANCE.getLocalPlayer().getPos().x, Wrapper.INSTANCE.getLocalPlayer().getPos().y - 0.5, Wrapper.INSTANCE.getLocalPlayer().getPos().z); if (!isReplaceable(WorldHelper.INSTANCE.getBlock(below))) return; @@ -140,8 +162,9 @@ private void getNearBlocks(BlockPos blockPos) { } return; } - for (int x = -rangeProperty.value() - 1; x < rangeProperty.value() + 1; x++) { - for (int z = -rangeProperty.value() - 1; z < rangeProperty.value() + 1; z++) { + } + for (int x = -xrangeProperty.value(); x < xrangeProperty.value(); x++) { + for (int z = -zrangeProperty.value(); z < zrangeProperty.value(); z++) { BlockPos blockPos1 = new BlockPos(Wrapper.INSTANCE.getLocalPlayer().getPos().add(0, -0.5f, 0)).add(x, 0, z); if (isReplaceable(WorldHelper.INSTANCE.getBlock(blockPos1)) || goingToPlace(blockPos1)) { BlockInfo blockInfo = getBlockInfo(blockPos1); @@ -162,13 +185,14 @@ public void place(BlockInfo blockInfo, EventPlayerPackets event) { NetworkHelper.INSTANCE.sendPacket(new ClientCommandC2SPacket(Wrapper.INSTANCE.getLocalPlayer(), ClientCommandC2SPacket.Mode.PRESS_SHIFT_KEY)); } BlockPos lookAtPos = blockInfo.blockpos(); + if (rotateProperty.value()) { RotationVector rotation = PlayerHelper.INSTANCE.rotateToVec(Wrapper.INSTANCE.getLocalPlayer(), new Vec3d(lookAtPos.getX(), lookAtPos.getY(), lookAtPos.getZ())); event.setYaw(rotation.getYaw()); - event.setPitch(80); - + event.setPitch(pitchProperty.value()); + Wrapper.INSTANCE.getLocalPlayer().headYaw = event.getYaw(); Wrapper.INSTANCE.getLocalPlayer().bodyYaw = event.getYaw(); - + } blockHitResult = new BlockHitResult(new Vec3d(blockInfo.blockpos().getX(), blockInfo.blockpos().getY(), blockInfo.blockpos().getZ()), blockInfo.facing(), blockInfo.blockpos(), false); if (placeModeProperty.value() == PlaceTiming.PRE) PlayerHelper.INSTANCE.placeBlockInPos(blockInfo.blockpos(), Hand.MAIN_HAND, false); diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/SoulSpeed.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/SoulSpeed.java new file mode 100644 index 000000000..a44b5169d --- /dev/null +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/SoulSpeed.java @@ -0,0 +1,44 @@ +package me.dustin.jex.feature.mod.impl.movement; + +import me.dustin.events.core.EventListener; +import me.dustin.events.core.annotate.EventPointer; +import me.dustin.jex.event.player.EventMove; +import me.dustin.jex.feature.mod.core.Category; +import me.dustin.jex.feature.property.Property; +import me.dustin.jex.helper.misc.Wrapper; +import me.dustin.jex.helper.player.InventoryHelper; +import me.dustin.jex.helper.player.PlayerHelper; +import me.dustin.jex.helper.world.WorldHelper; +import me.dustin.jex.feature.mod.core.Feature; +import net.minecraft.block.Block; +import net.minecraft.block.Blocks; + +public class SoulSpeed extends Feature { + + public final Property levelProperty = new Property.PropertyBuilder(this.getClass()) + .name("Level") + .value(3) + .min(1) + .max(3) + .inc(1) + .build(); + public final Property allowSprintingProperty = new Property.PropertyBuilder(this.getClass()) + .name("Allow Sprinting") + .value(false) + .build(); + + public SoulSpeed() { + super(Category.MOVEMENT); + } + + @EventPointer + private final EventListener eventMoveEventListener = new EventListener<>(event -> { + int enchLevel = levelProperty.value(); + Block block = WorldHelper.INSTANCE.getBlockBelowEntity(Wrapper.INSTANCE.getLocalPlayer(), 0.7f); + if (InventoryHelper.INSTANCE.getSoulSpeedLevel() > enchLevel) + enchLevel = InventoryHelper.INSTANCE.getSoulSpeedLevel(); + if (block == Blocks.SOUL_SAND) { + PlayerHelper.INSTANCE.setMoveSpeed(event, PlayerHelper.INSTANCE.getSoulSandSpeed(enchLevel, allowSprintingProperty.value())); + } + }); +} diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/Spider.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/Spider.java index ebeacb638..e0be6c050 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/Spider.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/Spider.java @@ -32,8 +32,7 @@ public Spider() { Wrapper.INSTANCE.getLocalPlayer().setVelocity(orig.getX(), 0.3, orig.getZ()); } else { Wrapper.INSTANCE.getLocalPlayer().setVelocity(orig.getX(), 0, orig.getZ()); - NetworkHelper.INSTANCE.sendPacket(new PlayerMoveC2SPacket.Full(Wrapper.INSTANCE.getLocalPlayer().getX() + orig.getX() * 2, Wrapper.INSTANCE.getLocalPlayer().getY() + (Wrapper.INSTANCE.getOptions().sneakKey.isPressed() ? 0 : 0.0624), Wrapper.INSTANCE.getLocalPlayer().getZ() + orig.getZ() * 2, PlayerHelper.INSTANCE.getYaw(), PlayerHelper.INSTANCE.getPitch(), false)); - NetworkHelper.INSTANCE.sendPacket(new PlayerMoveC2SPacket.Full(Wrapper.INSTANCE.getLocalPlayer().getX() + orig.getX(), -1337 + Wrapper.INSTANCE.getLocalPlayer().getY(), Wrapper.INSTANCE.getLocalPlayer().getZ() + orig.getZ(), PlayerHelper.INSTANCE.getYaw(), PlayerHelper.INSTANCE.getPitch(), true)); + NetworkHelper.INSTANCE.sendPacket(new PlayerMoveC2SPacket.Full(Wrapper.INSTANCE.getLocalPlayer().getX() + orig.getX() * 2, Wrapper.INSTANCE.getLocalPlayer().getY() + (Wrapper.INSTANCE.getOptions().sneakKey.isPressed() ? 0 : 0.0624), Wrapper.INSTANCE.getLocalPlayer().getZ() + orig.getZ() * 2, PlayerHelper.INSTANCE.getYaw(), PlayerHelper.INSTANCE.getPitch(), true)); } } }, new PlayerPacketsFilter(EventPlayerPackets.Mode.PRE)); diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/Sprint.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/Sprint.java index fe0daa2a1..9d03808ce 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/Sprint.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/Sprint.java @@ -24,7 +24,7 @@ public class Sprint extends Feature { .build(); public Sprint() { - super(Category.MISC, "Automatically sprint", GLFW.GLFW_KEY_V); + super(Category.MISC, "", GLFW.GLFW_KEY_V); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/Step.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/Step.java index 4a460587c..38d3dcfb9 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/Step.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/Step.java @@ -35,7 +35,6 @@ public class Step extends Feature { .build(); public final Property cancelPacketProperty = new Property.PropertyBuilder(this.getClass()) .name("Cancel Packet") - .description("Cancels a packet every now and then.") .value(true) .parent(modeProperty) .depends(parent -> parent.value() == Mode.PACKET) @@ -46,7 +45,7 @@ public class Step extends Feature { private boolean slow; public Step() { - super(Category.MOVEMENT, "Step up blocks"); + super(Category.MOVEMENT); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/YawLock.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/YawLock.java index f6658f8c9..5a82fb105 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/YawLock.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/YawLock.java @@ -12,7 +12,7 @@ public class YawLock extends Feature { public YawLock() { - super(Category.MOVEMENT, "Keep your yaw locked to walk straight."); + super(Category.MOVEMENT); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/elytraplus/ElytraPlus.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/elytraplus/ElytraPlus.java index 679583f3d..d27dccb51 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/elytraplus/ElytraPlus.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/elytraplus/ElytraPlus.java @@ -24,7 +24,6 @@ public class ElytraPlus extends Feature { public final Property autoElytraProperty = new Property.PropertyBuilder(this.getClass()) .name("Auto Elytra") - .description("Automatically activate the elytra.") .value(true) .build(); public final Property fallDistanceProperty = new Property.PropertyBuilder(this.getClass()) @@ -56,15 +55,14 @@ public class ElytraPlus extends Feature { .build(); public Property slowGlideProperty = new Property.PropertyBuilder(this.getClass()) .name("Slow Glide") - .description("Glide down very slowly.") .value(false) .parent(modeProperty) .depends(parent -> parent.value() == Mode.HOVER) .build(); public Property boostProperty = new Property.PropertyBuilder(this.getClass()) .name("Boost") - .value(0.05f) - .max(0.15f) + .value(0.01f) + .max(1f) .inc(0.01f) .parent(modeProperty) .depends(parent -> parent.value() == Mode.BOOST) @@ -95,7 +93,7 @@ public class ElytraPlus extends Feature { private Mode lastMode; public ElytraPlus() { - super(Category.MOVEMENT, "Change how the Elytra flies."); + super(Category.MOVEMENT); new AlwaysBoostElytraFly(); new BoostElytraFly(); new ECMEElytraFly(); diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/fly/Fly.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/fly/Fly.java index 1043d3d9b..4d10d475a 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/fly/Fly.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/fly/Fly.java @@ -18,6 +18,8 @@ import me.dustin.jex.feature.mod.impl.movement.fly.impl.NormalFly; import me.dustin.jex.feature.mod.impl.movement.fly.impl.ThreeDFly; import me.dustin.jex.feature.mod.impl.movement.fly.impl.TightFly; +import me.dustin.jex.feature.mod.impl.movement.fly.impl.JetpackFly; +import me.dustin.jex.helper.misc.StopWatch; import me.dustin.jex.feature.mod.impl.player.Freecam; import me.dustin.jex.feature.property.Property; import me.dustin.jex.helper.entity.EntityHelper; @@ -33,23 +35,53 @@ public class Fly extends Feature { .name("Mode") .value(Mode.NORMAL) .build(); - public final Property speedProperty = new Property.PropertyBuilder(this.getClass()) - .name("Speed") - .value(0.5f) - .min(0.1f) - .max(5) - .inc(0.1f) + public final Property hspeedProperty = new Property.PropertyBuilder(this.getClass()) + .name("Horizontal Speed (km/h)") + .value(72) + .min(15) + .max(100) + .inc(1) + .build(); + public final Property vspeedProperty = new Property.PropertyBuilder(this.getClass()) + .name("Vertical Speed (km/h)") + .value(15) + .min(15) + .max(100) + .inc(1) + .build(); + public final Property multipleProperty = new Property.PropertyBuilder(this.getClass()) + .name("Multiplier") + .value(1) + .min(1) + .max(100) + .inc(1) .build(); public final Property walkAnimationProperty = new Property.PropertyBuilder(this.getClass()) .name("Walk Animation") - .description("Show the hand-moving walk animation while flying.") .value(true) .build(); public final Property flyCheckBypassProperty = new Property.PropertyBuilder(this.getClass()) .name("Fly Check Bypass") - .description("Attempt to bypass the server's fly check.") .value(true) .build(); + public final Property tProperty = new Property.PropertyBuilder(this.getClass()) + .name("Timeout (Tick)") + .value(1) + .min(0) + .max(80) + .inc(1) + .parent(flyCheckBypassProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property distanceProperty = new Property.PropertyBuilder(this.getClass()) + .name("Fall Distance") + .value(0.5f) + .min(0.1f) + .max(10f) + .inc(0.1f) + .parent(flyCheckBypassProperty) + .depends(parent -> (boolean) parent.value()) + .build(); public final Property glideProperty = new Property.PropertyBuilder(this.getClass()) .name("Glide") .value(false) @@ -67,11 +99,12 @@ public class Fly extends Feature { private Mode lastMode; public Fly() { - super(Category.MOVEMENT, "Fly in survival", GLFW.GLFW_KEY_F); + super(Category.MOVEMENT, "", GLFW.GLFW_KEY_F); new NormalFly(); new TightFly(); new ThreeDFly(); new CreativeFly(); + new JetpackFly(); } @EventPointer @@ -100,12 +133,13 @@ public Fly() { @EventPointer private final EventListener eventPacketSentEventListener = new EventListener<>(event -> { + float tick = tProperty.value() * 0.05f; if (!flyCheckBypassProperty.value() || Feature.getState(Freecam.class)) return; PlayerMoveC2SPacket playerMoveC2SPacket = (PlayerMoveC2SPacket) event.getPacket(); - if (Wrapper.INSTANCE.getLocalPlayer().age % 3 == 1) { + if (Wrapper.INSTANCE.getLocalPlayer().age >= tick) { if (EntityHelper.INSTANCE.distanceFromGround(Wrapper.INSTANCE.getLocalPlayer()) > 2) { - PlayerMoveC2SPacket modified = new PlayerMoveC2SPacket.Full(playerMoveC2SPacket.getX(Wrapper.INSTANCE.getLocalPlayer().getX()), playerMoveC2SPacket.getY(Wrapper.INSTANCE.getLocalPlayer().getY()) - 0.1, playerMoveC2SPacket.getZ(Wrapper.INSTANCE.getLocalPlayer().getZ()), playerMoveC2SPacket.getYaw(PlayerHelper.INSTANCE.getYaw()), playerMoveC2SPacket.getPitch(PlayerHelper.INSTANCE.getPitch()), true); + PlayerMoveC2SPacket modified = new PlayerMoveC2SPacket.Full(playerMoveC2SPacket.getX(Wrapper.INSTANCE.getLocalPlayer().getX()), playerMoveC2SPacket.getY(Wrapper.INSTANCE.getLocalPlayer().getY()) - distanceProperty.value(), playerMoveC2SPacket.getZ(Wrapper.INSTANCE.getLocalPlayer().getZ()), playerMoveC2SPacket.getYaw(PlayerHelper.INSTANCE.getYaw()), playerMoveC2SPacket.getPitch(PlayerHelper.INSTANCE.getPitch()), true); event.setPacket(modified); } } @@ -147,6 +181,6 @@ public void onDisable() { } public enum Mode { - NORMAL, CREATIVE, TIGHT, THREE_D + NORMAL, JETPACK, CREATIVE, TIGHT, THREE_D } } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/fly/impl/JetpackFly.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/fly/impl/JetpackFly.java new file mode 100644 index 000000000..1a8cd1c6e --- /dev/null +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/fly/impl/JetpackFly.java @@ -0,0 +1,27 @@ +package me.dustin.jex.feature.mod.impl.movement.fly.impl; + +import me.dustin.events.core.Event; +import me.dustin.jex.event.player.EventPlayerPackets; +import me.dustin.jex.feature.mod.core.Feature; +import me.dustin.jex.feature.mod.core.FeatureExtension; +import me.dustin.jex.feature.mod.impl.movement.fly.Fly; +import me.dustin.jex.helper.misc.Wrapper; + +public class JetpackFly extends FeatureExtension { + private Fly fly; + public JetpackFly() { + super(Fly.Mode.JETPACK, Fly.class); + } + + @Override + public void pass(Event event) { + if (event instanceof EventPlayerPackets eventPlayerPackets && eventPlayerPackets.getMode() == EventPlayerPackets.Mode.PRE) { + if (fly == null) + fly = Feature.get(Fly.class); + boolean jumping = Wrapper.INSTANCE.getOptions().jumpKey.isPressed(); + if (jumping) { + Wrapper.INSTANCE.getLocalPlayer().jump(); +} +} +} +} diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/fly/impl/NormalFly.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/fly/impl/NormalFly.java index afb68f324..ff187080a 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/fly/impl/NormalFly.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/fly/impl/NormalFly.java @@ -1,7 +1,7 @@ package me.dustin.jex.feature.mod.impl.movement.fly.impl; import me.dustin.events.core.Event; -import me.dustin.jex.event.player.EventPlayerPackets; +import me.dustin.jex.event.player.EventMove; import me.dustin.jex.feature.mod.core.FeatureExtension; import me.dustin.jex.feature.mod.core.Feature; import me.dustin.jex.feature.mod.impl.movement.fly.Fly; @@ -17,14 +17,14 @@ public NormalFly() { @Override public void pass(Event event) { - if (event instanceof EventPlayerPackets eventPlayerPackets && eventPlayerPackets.getMode() == EventPlayerPackets.Mode.PRE) { + if (event instanceof EventMove eventMove) { if (fly == null) fly = Feature.get(Fly.class); boolean jumping = Wrapper.INSTANCE.getOptions().jumpKey.isPressed(); boolean sneaking = Wrapper.INSTANCE.getOptions().sneakKey.isPressed(); - - - Wrapper.INSTANCE.getLocalPlayer().airStrafingSpeed = fly.speedProperty.value(); + double hkmh = fly.hspeedProperty.value() * fly.multipleProperty.value() * 0.01388888888888; + double vkmh = fly.vspeedProperty.value() * fly.multipleProperty.value() * 0.01388888888888; + PlayerHelper.INSTANCE.setMoveSpeed(eventMove, hkmh); if (!PathingHelper.INSTANCE.isPathing() || PathingHelper.INSTANCE.isThinking()) { PlayerHelper.INSTANCE.setVelocityX(0); PlayerHelper.INSTANCE.setVelocityZ(0); @@ -32,9 +32,9 @@ public void pass(Event event) { PlayerHelper.INSTANCE.setVelocityY(0); if (!jumping || !sneaking) { if (jumping) { - PlayerHelper.INSTANCE.setVelocityY(fly.speedProperty.value()); + PlayerHelper.INSTANCE.setVelocityY(vkmh); } else if (sneaking) { - PlayerHelper.INSTANCE.setVelocityY(-fly.speedProperty.value()); + PlayerHelper.INSTANCE.setVelocityY(-vkmh); } } if (fly.glideProperty.value() && !jumping) { diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/fly/impl/ThreeDFly.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/fly/impl/ThreeDFly.java index 6533d760e..0843f0990 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/fly/impl/ThreeDFly.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/fly/impl/ThreeDFly.java @@ -19,14 +19,16 @@ public void pass(Event event) { if (event instanceof EventMove eventMove) { if (fly == null) fly = Feature.get(Fly.class); + double hkmh = fly.hspeedProperty.value() * fly.multipleProperty.value() * 0.01388888888888; + double vkmh = fly.vspeedProperty.value() * fly.multipleProperty.value() * 0.01388888888888; if (!PlayerHelper.INSTANCE.isMoving()) { eventMove.setX(0); eventMove.setZ(0); } - PlayerHelper.INSTANCE.setMoveSpeed(eventMove, fly.speedProperty.value()); + PlayerHelper.INSTANCE.setMoveSpeed(eventMove, hkmh); eventMove.setY(0); if (PlayerHelper.INSTANCE.isMoving()) { - eventMove.setY((fly.speedProperty.value() / 50) * -PlayerHelper.INSTANCE.getPitch()); + eventMove.setY((vkmh / 50) * -PlayerHelper.INSTANCE.getPitch()); } } } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/fly/impl/TightFly.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/fly/impl/TightFly.java index d6dd7bad8..7e7c41508 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/fly/impl/TightFly.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/fly/impl/TightFly.java @@ -20,6 +20,8 @@ public void pass(Event event) { if (event instanceof EventMove eventMove) { if (fly == null) fly = Feature.get(Fly.class); + double hkmh = fly.hspeedProperty.value() * fly.multipleProperty.value() * 0.01388888888888; + double vkmh = fly.vspeedProperty.value() * fly.multipleProperty.value() * 0.01388888888888; if (!PlayerHelper.INSTANCE.isMoving()) { eventMove.setX(0); eventMove.setZ(0); @@ -27,12 +29,12 @@ public void pass(Event event) { boolean jumping = Wrapper.INSTANCE.getOptions().jumpKey.isPressed(); boolean sneaking = Wrapper.INSTANCE.getOptions().sneakKey.isPressed(); eventMove.setY(0); - PlayerHelper.INSTANCE.setMoveSpeed(eventMove, fly.speedProperty.value()); + PlayerHelper.INSTANCE.setMoveSpeed(eventMove, hkmh); if (!jumping || !sneaking) { if (jumping) { - eventMove.setY(fly.speedProperty.value()); + eventMove.setY(vkmh); } else if (sneaking) { - eventMove.setY(-fly.speedProperty.value()); + eventMove.setY(-vkmh); } } if (fly.glideProperty.value() && !jumping) { diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/speed/Speed.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/speed/Speed.java index 1bd12354d..ad77c4604 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/speed/Speed.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/speed/Speed.java @@ -21,28 +21,36 @@ public class Speed extends Feature { .name("Mode") .value(Mode.VANILLA) .build(); - public final Property vanillaSpeedProperty = new Property.PropertyBuilder(this.getClass()) - .name("Vanilla Speed") - .value(0.6f) - .min(0.3f) - .max(3) - .inc(0.01f) + public final Property vanillaSpeedProperty = new Property.PropertyBuilder(this.getClass()) + .name("Vanilla Speed (Km/H)") + .value(1) + .min(1) + .max(100) + .inc(1) .parent(modeProperty) .depends(parent -> parent.value() == Mode.VANILLA) .build(); - public final Property strafeSpeedProperty = new Property.PropertyBuilder(this.getClass()) - .name("Strafe Speed") - .value(0.6f) - .min(0.3f) - .max(3) - .inc(0.01f) + public final Property multipleProperty = new Property.PropertyBuilder(this.getClass()) + .name("Multiplier") + .value(1) + .min(1) + .max(100) + .inc(1) + .build(); + public final Property strafeSpeedProperty = new Property.PropertyBuilder(this.getClass()) + .name("Strafe Speed (Km/H)") + .value(1) + .min(1) + .max(100) + .inc(1) .parent(modeProperty) .depends(parent -> parent.value() == Mode.STRAFE) .build(); public final Property hopAmountProperty = new Property.PropertyBuilder(this.getClass()) .name("Hop Amount") - .value(0.42f) - .min(0.05f) + .value(0.05f) + .min(0.04f) + .max(1f) .inc(0.01f) .parent(modeProperty) .depends(parent -> parent.value() == Mode.STRAFE) @@ -51,7 +59,7 @@ public class Speed extends Feature { private Mode lastMode; public Speed() { - super(Category.MOVEMENT, "Sanic gotta go fast.", GLFW.GLFW_KEY_C); + super(Category.MOVEMENT, "", GLFW.GLFW_KEY_C); new StrafeSpeed(); new VanillaSpeed(); INSTANCE = this; diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/speed/impl/StrafeSpeed.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/speed/impl/StrafeSpeed.java index a2d3046f5..6f48e86ed 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/speed/impl/StrafeSpeed.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/speed/impl/StrafeSpeed.java @@ -21,13 +21,14 @@ public StrafeSpeed() { public void pass(Event event) { if (event instanceof EventMove eventMove) { Speed speed = Feature.get(Speed.class); + double kmh = speed.strafeSpeedProperty.value() * 0.01388888888888; if ((BaritoneHelper.INSTANCE.isBaritoneRunning() || PathingHelper.INSTANCE.isPathing()) && !Wrapper.INSTANCE.getLocalPlayer().isOnGround()) return; if (PathingHelper.INSTANCE.isPathing()) { - eventMove.setX(eventMove.getX() * speed.vanillaSpeedProperty.value()); - eventMove.setZ(eventMove.getZ() * speed.vanillaSpeedProperty.value()); - }else - PlayerHelper.INSTANCE.setMoveSpeed(eventMove, speed.strafeSpeedProperty.value()); + eventMove.setX(eventMove.getX() * speed.multipleProperty.value() * kmh); + eventMove.setZ(eventMove.getZ() * speed.multipleProperty.value() * kmh); + } else + PlayerHelper.INSTANCE.setMoveSpeed(eventMove, kmh * speed.multipleProperty.value()); } else if (event instanceof EventPlayerPackets eventPlayerPackets) { Speed speed = Feature.get(Speed.class); if (eventPlayerPackets.getMode() == EventPlayerPackets.Mode.PRE) { diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/movement/speed/impl/VanillaSpeed.java b/src/main/java/me/dustin/jex/feature/mod/impl/movement/speed/impl/VanillaSpeed.java index 6f91d3c3a..57db1f871 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/movement/speed/impl/VanillaSpeed.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/movement/speed/impl/VanillaSpeed.java @@ -20,13 +20,14 @@ public VanillaSpeed() { public void pass(Event event) { if (event instanceof EventMove eventMove) { Speed speed = Feature.get(Speed.class); + double kmh = speed.vanillaSpeedProperty.value() * 0.01388888888888; if ((BaritoneHelper.INSTANCE.isBaritoneRunning() || PathingHelper.INSTANCE.isPathing()) && !Wrapper.INSTANCE.getLocalPlayer().isOnGround()) return; if (PathingHelper.INSTANCE.isPathing()) { - eventMove.setX(eventMove.getX() * speed.vanillaSpeedProperty.value()); - eventMove.setZ(eventMove.getZ() * speed.vanillaSpeedProperty.value()); + eventMove.setX(eventMove.getX() * kmh * speed.multipleProperty.value()); + eventMove.setZ(eventMove.getZ() * kmh * speed.multipleProperty.value()); } else - PlayerHelper.INSTANCE.setMoveSpeed(eventMove, speed.vanillaSpeedProperty.value()); + PlayerHelper.INSTANCE.setMoveSpeed(eventMove, kmh * speed.multipleProperty.value()); } } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/player/AntiEffect.java b/src/main/java/me/dustin/jex/feature/mod/impl/player/AntiEffect.java index ebb6eb340..81e9492fb 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/player/AntiEffect.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/player/AntiEffect.java @@ -24,6 +24,22 @@ public class AntiEffect extends Feature { .name("Mining Fatigue") .value(true) .build(); + public final Property weaknessProperty = new Property.PropertyBuilder(this.getClass()) + .name("Weakness") + .value(true) + .build(); + public final Property slownessProperty = new Property.PropertyBuilder(this.getClass()) + .name("Slowness") + .value(true) + .build(); + public final Property hungerProperty = new Property.PropertyBuilder(this.getClass()) + .name("Hunger") + .value(true) + .build(); + public final Property poisonProperty = new Property.PropertyBuilder(this.getClass()) + .name("Poison") + .value(true) + .build(); public final Property levitationProperty = new Property.PropertyBuilder(this.getClass()) .name("Levitation") .value(true) @@ -38,7 +54,7 @@ public class AntiEffect extends Feature { .build(); public AntiEffect() { - super(Category.PLAYER, "Remove certain negative effects from yourself."); + super(Category.PLAYER); } @EventPointer @@ -49,11 +65,19 @@ public AntiEffect() { Wrapper.INSTANCE.getLocalPlayer().removeStatusEffect(StatusEffects.NAUSEA); if (miningFatigueProperty.value()) Wrapper.INSTANCE.getLocalPlayer().removeStatusEffect(StatusEffects.MINING_FATIGUE); + if (weaknessProperty.value()) + Wrapper.INSTANCE.getLocalPlayer().removeStatusEffect(StatusEffects.WEAKNESS); + if (hungerProperty.value()) + Wrapper.INSTANCE.getLocalPlayer().removeStatusEffect(StatusEffects.HUNGER); + if (poisonProperty.value()) + Wrapper.INSTANCE.getLocalPlayer().removeStatusEffect(StatusEffects.POISON); if (levitationProperty.value()) Wrapper.INSTANCE.getLocalPlayer().removeStatusEffect(StatusEffects.LEVITATION); if (slowFallingProperty.value()) Wrapper.INSTANCE.getLocalPlayer().removeStatusEffect(StatusEffects.SLOW_FALLING); if (darknessProperty.value()) Wrapper.INSTANCE.getLocalPlayer().removeStatusEffect(StatusEffects.DARKNESS); + if (slownessProperty.value()) + Wrapper.INSTANCE.getLocalPlayer().removeStatusEffect(StatusEffects.SLOWNESS); }, new PlayerPacketsFilter(EventPlayerPackets.Mode.PRE)); } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/player/AntiHunger.java b/src/main/java/me/dustin/jex/feature/mod/impl/player/AntiHunger.java index 1a15c8fc9..b919369ee 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/player/AntiHunger.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/player/AntiHunger.java @@ -11,7 +11,7 @@ public class AntiHunger extends Feature { public AntiHunger() { - super(Category.PLAYER, "Lose less hunger while sprinting."); + super(Category.PLAYER); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/player/AutoDrop.java b/src/main/java/me/dustin/jex/feature/mod/impl/player/AutoDrop.java index 2eb139f8d..20661c929 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/player/AutoDrop.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/player/AutoDrop.java @@ -31,7 +31,7 @@ public class AutoDrop extends Feature { private final StopWatch stopWatch = new StopWatch(); public AutoDrop() { - super(Category.PLAYER, "Automatically drop junk items from your inventory. Configurable in the Jex Options screen."); + super(Category.PLAYER); INSTANCE = this; items.add(Items.DIORITE); items.add(Items.ANDESITE); diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/player/AutoEat.java b/src/main/java/me/dustin/jex/feature/mod/impl/player/AutoEat.java index 5302f5abe..ea028686e 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/player/AutoEat.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/player/AutoEat.java @@ -45,6 +45,26 @@ public class AutoEat extends Feature { .description("Eat when your food is too low to regen if you don't have full health.") .value(false) .build(); + public final Property healthProperty = new Property.PropertyBuilder(this.getClass()) + .name("Health") + .value(10) + .min(1) + .max(20) + .inc(1) + .parent(eatToRegenProperty) + .depends(parent -> (boolean)parent.value()) + .build(); + public final Property hungerProperty = new Property.PropertyBuilder(this.getClass()) + .name("Hunger") + .value(18) + .min(18) + .max(20) + .inc(1) + .parent(eatToRegenProperty) + .depends(parent -> (boolean)parent.value()) + .build(); + + private boolean wasEating; private int savedSlot = 0; @@ -133,7 +153,7 @@ private boolean needsToEat(FoodInfo foodInfo) { if (!eatToRegenProperty.value()) { return 20 - Wrapper.INSTANCE.getLocalPlayer().getHungerManager().getFoodLevel() >= foodInfo.item.getFoodComponent().getHunger(); } else { - return 20 - Wrapper.INSTANCE.getLocalPlayer().getHungerManager().getFoodLevel() >= foodInfo.item.getFoodComponent().getHunger() || (Wrapper.INSTANCE.getLocalPlayer().getHealth() < 20 && Wrapper.INSTANCE.getLocalPlayer().getHungerManager().getFoodLevel() < 18); + return 20 - Wrapper.INSTANCE.getLocalPlayer().getHungerManager().getFoodLevel() >= foodInfo.item.getFoodComponent().getHunger() || (Wrapper.INSTANCE.getLocalPlayer().getHealth() <= healthProperty.value() && Wrapper.INSTANCE.getLocalPlayer().getHungerManager().getFoodLevel() <= hungerProperty.value()); } } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/player/AutoFish.java b/src/main/java/me/dustin/jex/feature/mod/impl/player/AutoFish.java index 3f4962e18..3df55d463 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/player/AutoFish.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/player/AutoFish.java @@ -33,9 +33,19 @@ public class AutoFish extends Feature { public final Property soundProperty = new Property.PropertyBuilder(this.getClass()) .name("Sound") - .description("Whether or not to use sound to determine when to reel the rod in.") .value(true) .build(); + public final Property swingProperty = new Property.PropertyBuilder(this.getClass()) + .name("Swing") + .value(true) + .build(); + public final Property bpdProperty = new Property.PropertyBuilder(this.getClass()) + .name("Bobber position difference") + .value(0.11f) + .min(0.01f) + .max(1f) + .inc(0.01f) + .build(); public final Property distanceCheckProperty = new Property.PropertyBuilder(this.getClass()) .name("Distance Check") .value(false) @@ -52,9 +62,10 @@ public class AutoFish extends Feature { .build(); public final Property delayProperty = new Property.PropertyBuilder(this.getClass()) .name("Delay") - .description("Delay between re-casting the rod.") .value(750L) + .min(0) .max(2000) + .inc(20) .parent(recastProperty) .depends(parent -> (boolean) parent.value()) .build(); @@ -62,10 +73,28 @@ public class AutoFish extends Feature { .name("Reel on Reconnect") .value(true) .build(); + public final Property rordProperty = new Property.PropertyBuilder(this.getClass()) + .name("Reel on Reconnect Delay") + .description("Delay between re-casting the rod.") + .value(5000) + .min(0) + .max(5000) + .inc(50) + .parent(reelOnReconnectProperty) + .depends(parent -> (boolean) parent.value()) + .build(); public final Property showIfOpenWaterProperty = new Property.PropertyBuilder(this.getClass()) .name("Show If OpenWater") .value(true) .build(); + public final Property owsrProperty = new Property.PropertyBuilder(this.getClass()) + .name("OpenWater Search radius") + .description("Delay between re-casting the rod.") + .value(2) + .min(2) + .max(6) + .inc(1) + .build(); private double lastY = -1; private boolean hasReeled = false; @@ -74,7 +103,7 @@ public class AutoFish extends Feature { private boolean hasReconnected; public AutoFish() { - super(Category.PLAYER, "Automatically detect a fish on the hook"); + super(Category.PLAYER); } @EventPointer @@ -104,7 +133,7 @@ public AutoFish() { return; } if (hasReconnected) { - if (stopWatch1.hasPassed(5000)) { + if (stopWatch1.hasPassed(rordProperty.value())) { reel(); stopWatch1.reset(); hasReconnected = false; @@ -117,7 +146,7 @@ public AutoFish() { if (lastY == -1) lastY = hook.getY(); double difference = Math.abs(hook.getY() - lastY); - if (difference > 0.11) { + if (difference > bpdProperty.value()) { reel(); hasReeled = true; stopWatch.reset(); @@ -156,10 +185,14 @@ void reel() { if (dontReelProperty.value()) return; if (PlayerHelper.INSTANCE.mainHandStack() != null && PlayerHelper.INSTANCE.mainHandStack().getItem() == Items.FISHING_ROD) { PlayerHelper.INSTANCE.useItem(Hand.MAIN_HAND); - PlayerHelper.INSTANCE.swing(Hand.MAIN_HAND); + if (swingProperty.value()) { + Wrapper.INSTANCE.getPlayer().swingHand(Hand.MAIN_HAND); + } } else if (PlayerHelper.INSTANCE.offHandStack() != null && PlayerHelper.INSTANCE.offHandStack().getItem() == Items.FISHING_ROD) { PlayerHelper.INSTANCE.useItem(Hand.OFF_HAND); - PlayerHelper.INSTANCE.swing(Hand.OFF_HAND); + if (swingProperty.value()) { + Wrapper.INSTANCE.getPlayer().swingHand(Hand.OFF_HAND); + } } } @@ -198,9 +231,9 @@ public FishingBobberEntity getClosest() { } private boolean isOpenOrWaterAround(BlockPos pos) { - for (int x = -2; x < 2; x++) - for (int y = -2; y < 2; y++) - for (int z = -2; z < 2; z++) { + for (int x = -owsrProperty.value(); x < owsrProperty.value(); x++) + for (int z = -owsrProperty.value(); z < owsrProperty.value(); z++) + for (int y = -owsrProperty.value(); y < owsrProperty.value(); y++) { BlockPos blockPos = pos.add(x, y, z); if (WorldHelper.INSTANCE.getBlock(blockPos) != Blocks.AIR && WorldHelper.INSTANCE.getBlock(blockPos) != Blocks.WATER) return false; diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/player/AutoTool.java b/src/main/java/me/dustin/jex/feature/mod/impl/player/AutoTool.java index 437bd827e..dea17db48 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/player/AutoTool.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/player/AutoTool.java @@ -31,7 +31,7 @@ public class AutoTool extends Feature { private int savedSlot; public AutoTool() { - super(Category.PLAYER, "Switch to the best tool for your needs."); + super(Category.PLAYER); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/player/AutoWalk.java b/src/main/java/me/dustin/jex/feature/mod/impl/player/AutoWalk.java index f58c98660..2c136b846 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/player/AutoWalk.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/player/AutoWalk.java @@ -12,7 +12,7 @@ public class AutoWalk extends Feature { public AutoWalk() { - super(Category.PLAYER, "Automatically hold W"); + super(Category.PLAYER); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/player/ElytraSwap.java b/src/main/java/me/dustin/jex/feature/mod/impl/player/ElytraSwap.java index 1bb085456..812b24342 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/player/ElytraSwap.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/player/ElytraSwap.java @@ -17,7 +17,7 @@ public class ElytraSwap extends Feature { public ElytraSwap() { - super(Category.PLAYER, "Automatically swap your Elytra and your Chestplate on toggle"); + super(Category.PLAYER); } @Override diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/player/Enderman.java b/src/main/java/me/dustin/jex/feature/mod/impl/player/Enderman.java index 0c8c95421..b63ddb71f 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/player/Enderman.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/player/Enderman.java @@ -27,7 +27,7 @@ public class Enderman extends Feature { .build(); public Enderman() { - super(Category.PLAYER, "Select how to deal with enderman."); + super(Category.PLAYER); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/player/FastPlace.java b/src/main/java/me/dustin/jex/feature/mod/impl/player/FastPlace.java index 49883d19c..d19685682 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/player/FastPlace.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/player/FastPlace.java @@ -4,19 +4,28 @@ import me.dustin.events.core.annotate.EventPointer; import me.dustin.jex.event.filters.PlayerPacketsFilter; import me.dustin.jex.event.player.EventPlayerPackets; +import me.dustin.jex.feature.property.Property; import me.dustin.jex.feature.mod.core.Category; import me.dustin.jex.helper.misc.Wrapper; import me.dustin.jex.feature.mod.core.Feature; public class FastPlace extends Feature { + + public Property delayProperty = new Property.PropertyBuilder(this.getClass()) + .name("RightClickDelay") + .value(0) + .min(0) + .max(1) + .inc(1) + .build(); public FastPlace() { - super(Category.PLAYER, "Place fast."); + super(Category.PLAYER); } @EventPointer private final EventListener eventPlayerPacketsEventListener = new EventListener<>(event -> { - Wrapper.INSTANCE.getIMinecraft().setRightClickDelayTimer(0); + Wrapper.INSTANCE.getIMinecraft().setRightClickDelayTimer(delayProperty.value()); }, new PlayerPacketsFilter(EventPlayerPackets.Mode.PRE)); @Override diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/player/Freecam.java b/src/main/java/me/dustin/jex/feature/mod/impl/player/Freecam.java index 4133fed5e..2e973715a 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/player/Freecam.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/player/Freecam.java @@ -33,7 +33,6 @@ public class Freecam extends Feature { public final Property stealthProperty = new Property.PropertyBuilder(this.getClass()) .name("Stealth") - .description("Cancels all packets.") .value(true) .build(); public final Property resetPosProperty = new Property.PropertyBuilder(this.getClass()) @@ -53,7 +52,7 @@ public class Freecam extends Feature { public static PlayerEntity playerEntity; public Freecam() { - super(Category.PLAYER, "Take a look around like a ghost."); + super(Category.PLAYER); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/player/Ghost.java b/src/main/java/me/dustin/jex/feature/mod/impl/player/Ghost.java index b0048cf18..da71aa500 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/player/Ghost.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/player/Ghost.java @@ -16,7 +16,7 @@ public class Ghost extends Feature { public Ghost() { - super(Category.PLAYER, "Never accept death. Relog for godmode. Only works on vanilla/fabric"); + super(Category.PLAYER); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/player/HotbarRefill.java b/src/main/java/me/dustin/jex/feature/mod/impl/player/HotbarRefill.java index 39a0686df..108df69b0 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/player/HotbarRefill.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/player/HotbarRefill.java @@ -23,7 +23,7 @@ public class HotbarRefill extends Feature { private int swapSlot = -1; public HotbarRefill() { - super(Category.PLAYER, "Attempts to refill your hotbar when you use up an item with the same item"); + super(Category.PLAYER); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/player/Jesus.java b/src/main/java/me/dustin/jex/feature/mod/impl/player/Jesus.java index df228f28d..3001ff263 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/player/Jesus.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/player/Jesus.java @@ -41,7 +41,6 @@ public class Jesus extends Feature { .build(); public final Property allowJumpProperty = new Property.PropertyBuilder(this.getClass()) .name("Jump") - .description("Allow jumping while on the water.") .value(true) .parent(modeProperty) .depends(parent -> parent.value() == Mode.DOLPHIN) @@ -49,7 +48,7 @@ public class Jesus extends Feature { private int ticks; public Jesus() { - super(Category.PLAYER, "Walk on water like Jesus.", GLFW.GLFW_KEY_J); + super(Category.PLAYER, "", GLFW.GLFW_KEY_J); } @EventPointer @@ -82,6 +81,10 @@ public Jesus() { return; } if (modeProperty.value() == Mode.SOLID && (WorldHelper.INSTANCE.isInLiquid(Wrapper.INSTANCE.getPlayer())) && !Wrapper.INSTANCE.getPlayer().isSneaking()) { + Vec3d orig = Wrapper.INSTANCE.getPlayer().getVelocity(); + Wrapper.INSTANCE.getPlayer().setVelocity(orig.getX(), 0.30, orig.getZ()); + } + if (modeProperty.value() == Mode.SOLIDOLD && (WorldHelper.INSTANCE.isInLiquid(Wrapper.INSTANCE.getPlayer())) && !Wrapper.INSTANCE.getPlayer().isSneaking()) { Vec3d orig = Wrapper.INSTANCE.getPlayer().getVelocity(); Wrapper.INSTANCE.getPlayer().setVelocity(orig.getX(), 0.11, orig.getZ()); } @@ -118,11 +121,27 @@ public Jesus() { }, new SoundFilter(EventPlaySound.Mode.PRE, new Identifier("ambient.underwater.enter"), new Identifier("ambient.underwater.exit"), new Identifier("ambient.underwater.loop"), new Identifier("entity.player.swim"), new Identifier("ambient.underwater.loop"), new Identifier("ambient.underwater.loop.additions"))); @EventPointer - private final EventListener eventBlockCollisionShapeEventListener = new EventListener<>(event -> { + private final EventListener eventBlockCollisionShape = new EventListener<>(event -> { if (Wrapper.INSTANCE.getPlayer() == null || Wrapper.INSTANCE.getWorld() == null || modeProperty.value() != Mode.SOLID || event.getBlockPos() == null) return; if (Wrapper.INSTANCE.getPlayer().isSubmergedInWater() || Wrapper.INSTANCE.getPlayer().isInLava() || (event.getBlockPos().getY() < Wrapper.INSTANCE.getPlayer().getY() + 0.5f && WorldHelper.INSTANCE.isInLiquid(Wrapper.INSTANCE.getPlayer())) || Wrapper.INSTANCE.getPlayer().isSneaking() || Wrapper.INSTANCE.getPlayer().fallDistance > 3) return; + if (WorldHelper.INSTANCE.isWaterlogged(event.getBlockPos()) && event.getVoxelShape().isEmpty()) { + FluidState fluidState = WorldHelper.INSTANCE.getFluidState(event.getBlockPos()); + if (fluidState.getLevel() == 8) { + event.setVoxelShape(VoxelShapes.fullCube()); + } else + event.setVoxelShape(fluidState.getShape(Wrapper.INSTANCE.getWorld(), event.getBlockPos())); + event.cancel(); + } + }); + + @EventPointer + private final EventListener eventBlockCollisionShapeEventListener = new EventListener<>(event -> { + if (Wrapper.INSTANCE.getPlayer() == null || Wrapper.INSTANCE.getWorld() == null || modeProperty.value() != Mode.SOLIDOLD || event.getBlockPos() == null) + return; + if (Wrapper.INSTANCE.getPlayer().isSubmergedInWater() || Wrapper.INSTANCE.getPlayer().isInLava() || (event.getBlockPos().getY() < Wrapper.INSTANCE.getPlayer().getY() + 0.5f && WorldHelper.INSTANCE.isInLiquid(Wrapper.INSTANCE.getPlayer())) || Wrapper.INSTANCE.getPlayer().isSneaking() || Wrapper.INSTANCE.getPlayer().fallDistance > 3) + return; if (WorldHelper.INSTANCE.isWaterlogged(event.getBlockPos()) && event.getVoxelShape().isEmpty()) { FluidState fluidState = WorldHelper.INSTANCE.getFluidState(event.getBlockPos()); if (fluidState.getLevel() == 8) { @@ -133,7 +152,7 @@ public Jesus() { event.cancel(); } }); - + @EventPointer private final EventListener eventMoveEventListener = new EventListener<>(event -> { BaritoneHelper.INSTANCE.setAssumeJesus(true); @@ -168,6 +187,6 @@ public void onDisable() { } public enum Mode { - SOLID, DOLPHIN, SWIM + SOLID, DOLPHIN, SWIM, SOLIDOLD } } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/player/NoFall.java b/src/main/java/me/dustin/jex/feature/mod/impl/player/NoFall.java index c4db596d4..fea5fc569 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/player/NoFall.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/player/NoFall.java @@ -17,7 +17,7 @@ public class NoFall extends Feature { public NoFall() { - super(Category.PLAYER, "Remove fall damage."); + super(Category.PLAYER); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/player/NoPush.java b/src/main/java/me/dustin/jex/feature/mod/impl/player/NoPush.java index 9484260e7..68e9d885c 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/player/NoPush.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/player/NoPush.java @@ -20,7 +20,7 @@ public class NoPush extends Feature { .build(); public NoPush() { - super(Category.PLAYER, "Don't let others push you around."); + super(Category.PLAYER); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/player/NoTurn.java b/src/main/java/me/dustin/jex/feature/mod/impl/player/NoTurn.java index 8e06cf6d3..eb4d4d73a 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/player/NoTurn.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/player/NoTurn.java @@ -12,7 +12,7 @@ public class NoTurn extends Feature { private boolean reconnected; public NoTurn() { - super(Category.PLAYER, "Ignore the server telling you to look somewhere."); + super(Category.PLAYER); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/player/PortalGui.java b/src/main/java/me/dustin/jex/feature/mod/impl/player/PortalGui.java index 61051eca6..2cde59f51 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/player/PortalGui.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/player/PortalGui.java @@ -9,7 +9,7 @@ public class PortalGui extends Feature { public PortalGui() { - super(Category.PLAYER, "Open GUIs while in portals."); + super(Category.PLAYER); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/player/Reach.java b/src/main/java/me/dustin/jex/feature/mod/impl/player/Reach.java index a99246840..9275f44eb 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/player/Reach.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/player/Reach.java @@ -31,7 +31,7 @@ public class Reach extends Feature { private Vec3d storedPos; public Reach() { - super(Category.PLAYER, "Stretch Armstrong, but nerfed."); + super(Category.PLAYER); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/player/Sneak.java b/src/main/java/me/dustin/jex/feature/mod/impl/player/Sneak.java index 51c92bfd8..58dc5c8dc 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/player/Sneak.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/player/Sneak.java @@ -13,7 +13,7 @@ public class Sneak extends Feature { public Sneak() { - super(Category.PLAYER, "Sneak around to hide your nametag", GLFW.GLFW_KEY_Z); + super(Category.PLAYER, "", GLFW.GLFW_KEY_Z); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/player/SpeedMine.java b/src/main/java/me/dustin/jex/feature/mod/impl/player/SpeedMine.java index b80468bfe..4d42b1c38 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/player/SpeedMine.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/player/SpeedMine.java @@ -11,17 +11,50 @@ import me.dustin.jex.helper.misc.Wrapper; import me.dustin.jex.feature.mod.core.Feature; import me.dustin.jex.helper.network.NetworkHelper; +import me.dustin.jex.helper.misc.StopWatch; import me.dustin.jex.helper.world.WorldHelper; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket; public class SpeedMine extends Feature { + + private final StopWatch stopWatch = new StopWatch(); public Property modeProperty = new Property.PropertyBuilder(this.getClass()) .name("Mode") .value(Mode.PROGRESS) .build(); + public Property delayProperty = new Property.PropertyBuilder(this.getClass()) + .name("Delay (ms)") + .value(1) + .min(0) + .max(1000) + .inc(10) + .parent(modeProperty) + .depends(parent -> parent.value() == Mode.PACKET) + .build(); + public Property paProperty = new Property.PropertyBuilder(this.getClass()) + .name("Packet Amount") + .value(1) + .min(1) + .max(25) + .inc(1) + .parent(modeProperty) + .depends(parent -> parent.value() == Mode.PACKET) + .build(); + public final Property startpProperty = new Property.PropertyBuilder(this.getClass()) + .name("StartPacket") + .value(true) + .parent(modeProperty) + .depends(parent -> parent.value() == Mode.PACKET) + .build(); + public final Property stoppProperty = new Property.PropertyBuilder(this.getClass()) + .name("StopPacket") + .value(true) + .parent(modeProperty) + .depends(parent -> parent.value() == Mode.PACKET) + .build(); public Property hasteLevelProperty = new Property.PropertyBuilder(this.getClass()) .name("Haste Level") .value(1) @@ -32,39 +65,34 @@ public class SpeedMine extends Feature { .build(); public Property breakProgressProperty = new Property.PropertyBuilder(this.getClass()) .name("Break Progress") - .description("How far into breaking a block before automatically finishing.") .value(0.65f) - .max(0.95f) - .inc(0.05f) + .min(0f) + .max(1f) + .inc(0.01f) .parent(modeProperty) .depends(parent -> parent.value() == Mode.PROGRESS) .build(); public Property breakCooldownProperty = new Property.PropertyBuilder(this.getClass()) .name("Break Cooldown") - .description("The amount of ticks to wait between breaking blocks. Default MC is 5.") .value(1) + .min(0) .max(5) + .inc(1) .build(); private boolean givenHaste; public SpeedMine() { - super(Category.PLAYER, "Break blocks faster"); + super(Category.PLAYER); } @EventPointer private final EventListener eventPlayerPacketsEventListener = new EventListener<>(event -> { - if (Wrapper.INSTANCE.getLocalPlayer().isCreative()) - return; switch (modeProperty.value()) { - case PROGRESS, INSTANT -> { + case PROGRESS, PACKET -> { if (givenHaste && Wrapper.INSTANCE.getLocalPlayer().hasStatusEffect(StatusEffects.HASTE)) Wrapper.INSTANCE.getLocalPlayer().removeStatusEffect(StatusEffects.HASTE); float bProgress = modeProperty.value() == Mode.PROGRESS ? breakProgressProperty.value() : 0; - if (!WorldHelper.INSTANCE.isBreakable(WorldHelper.INSTANCE.getBlock(Wrapper.INSTANCE.getIClientPlayerInteractionManager().currentBreakingPos()))) { - givenHaste = false; - break; - } if (Wrapper.INSTANCE.getIClientPlayerInteractionManager().getBlockBreakProgress() >= bProgress) { Wrapper.INSTANCE.getIClientPlayerInteractionManager().setBlockBreakProgress(1); } @@ -85,17 +113,19 @@ public SpeedMine() { @EventPointer private final EventListener eventClickBlockEventListener = new EventListener<>(event -> { - if (modeProperty.value() != Mode.INSTANT) + if (modeProperty.value() != Mode.PACKET) return; - if (Wrapper.INSTANCE.getLocalPlayer().isCreative()) - return; - if (!WorldHelper.INSTANCE.isBreakable(WorldHelper.INSTANCE.getBlock(event.getBlockPos()))) - return; - for (int i = 0; i < 10; i++) { - NetworkHelper.INSTANCE.sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, event.getBlockPos(), event.getFace())); - NetworkHelper.INSTANCE.sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, event.getBlockPos(), event.getFace())); - } - Wrapper.INSTANCE.getIClientPlayerInteractionManager().setBlockBreakProgress(1); + if (stopWatch.hasPassed(delayProperty.value())) { + for (int i = 0; i < paProperty.value(); i++) { + if (startpProperty.value()) { +NetworkHelper.INSTANCE.sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, event.getBlockPos(), event.getFace())); + } + if(stoppProperty.value()) { +NetworkHelper.INSTANCE.sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, event.getBlockPos(), event.getFace())); + } + } +} + Wrapper.INSTANCE.getIClientPlayerInteractionManager().setBlockBreakProgress(breakCooldownProperty.value()); }, new ClickBlockFilter(EventClickBlock.Mode.PRE)); @Override @@ -106,6 +136,6 @@ public void onDisable() { } public enum Mode { - PROGRESS, INSTANT, HASTE + PROGRESS, PACKET, HASTE } } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/player/ThrowPearl.java b/src/main/java/me/dustin/jex/feature/mod/impl/player/ThrowPearl.java index a28647fe6..c80ec6f59 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/player/ThrowPearl.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/player/ThrowPearl.java @@ -25,7 +25,7 @@ public class ThrowPearl extends Feature { .build(); public ThrowPearl() { - super(Category.PLAYER, "Automatically throw ender pearl from hotbar on button press."); + super(Category.PLAYER); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/AntiOverlay.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/AntiOverlay.java index 7be442e0f..1d484dbc8 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/AntiOverlay.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/AntiOverlay.java @@ -51,7 +51,7 @@ public class AntiOverlay extends Feature { .build(); public AntiOverlay() { - super(Category.VISUAL, "Remove overlays"); + super(Category.VISUAL); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/BarrierView.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/BarrierView.java index 72073cfde..01fc01474 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/BarrierView.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/BarrierView.java @@ -37,7 +37,7 @@ public class BarrierView extends Feature { private final StopWatch stopWatch = new StopWatch(); public BarrierView() { - super(Category.VISUAL, "See barriers as if you are in creative"); + super(Category.VISUAL); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/BlockOverlay.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/BlockOverlay.java index 75ff46532..764ad61c4 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/BlockOverlay.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/BlockOverlay.java @@ -28,7 +28,6 @@ public class BlockOverlay extends Feature { .build(); public final Property progressOverlayProperty = new Property.PropertyBuilder(this.getClass()) .name("Progress Overlay") - .description("Show block breaking progress.") .value(true) .build(); public final Property overlayColorProperty = new Property.PropertyBuilder(this.getClass()) @@ -39,7 +38,6 @@ public class BlockOverlay extends Feature { .build(); public final Property progressColorProperty = new Property.PropertyBuilder(this.getClass()) .name("Progress Based Color") - .description("Sets the color from green to red based on break progress") .value(true) .parent(overlayColorProperty) .build(); @@ -47,7 +45,7 @@ public class BlockOverlay extends Feature { public BlockHitResult clickedBlock; public BlockOverlay() { - super(Category.VISUAL, "Change the block outline and have an overlay show your break progress"); + super(Category.VISUAL); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/CameraClip.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/CameraClip.java index 43610aec6..9d59cd6d2 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/CameraClip.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/CameraClip.java @@ -9,7 +9,7 @@ public class CameraClip extends Feature { public CameraClip() { - super(Category.VISUAL, "Remove the restriction forcing cameras close near a wall"); + super(Category.VISUAL); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/Crosshair.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/Crosshair.java index 332fd49a5..57202dc28 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/Crosshair.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/Crosshair.java @@ -39,7 +39,7 @@ public class Crosshair extends Feature { public final Property gapProperty = new Property.PropertyBuilder(this.getClass()) .name("Gap") .value(1f) - .min(0) + .min(-1) .max(20) .inc(0.1f) .build(); @@ -62,7 +62,7 @@ public class Crosshair extends Feature { .name("Spin Speed") .value(1) .min(1) - .max(5) + .max(20) .parent(spinProperty) .depends(parent -> (boolean) parent.value()) .build(); @@ -71,7 +71,7 @@ public class Crosshair extends Feature { private final StopWatch stopWatch = new StopWatch(); public Crosshair() { - super(Category.VISUAL, "Draw a custom crosshair on-screen."); + super(Category.VISUAL); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/CustomBG.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/CustomBG.java index 978df2ba9..beb8e0522 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/CustomBG.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/CustomBG.java @@ -36,7 +36,7 @@ public class CustomBG extends Feature { public final Property blurIntensityProperty = new Property.PropertyBuilder(this.getClass()) .name("Blur Intensity") .value(10) - .min(5) + .min(0) .max(50) .parent(modeProperty) .depends(parent -> parent.value() == Mode.BLUR || parent.value() == Mode.BOTH) @@ -48,7 +48,7 @@ public class CustomBG extends Feature { private final StopWatch stopWatch = new StopWatch(); public CustomBG() { - super(Category.VISUAL, "Draws a custom background rather than the simple dark one"); + super(Category.VISUAL); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/CustomFont.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/CustomFont.java index 2fdc644d7..a8e3de42c 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/CustomFont.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/CustomFont.java @@ -34,10 +34,11 @@ public class CustomFont extends Feature { public final Property fontProperty = new Property.PropertyBuilder(this.getClass()) .name("Font") .value("Verdana") + .max(30) .build(); public CustomFont() { - super(Category.VISUAL, "Change the font in aspects of the game. Disable then re-enable to reload fonts from folder (.minecraft/JexClient/fonts)"); + super(Category.VISUAL); INSTANCE = this; } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/CustomMainMenu.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/CustomMainMenu.java index bc8cecc1b..52bfba3d5 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/CustomMainMenu.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/CustomMainMenu.java @@ -35,7 +35,7 @@ public class CustomMainMenu extends Feature { .build(); public CustomMainMenu() { - super("CustomMainMenu", Category.VISUAL, "The custom main menu for Jex", true, false, 0); + super("CustomMainMenu", Category.VISUAL, "", true, false, 0); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/CustomWidgets.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/CustomWidgets.java index ebecdd54c..9ec7c02a4 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/CustomWidgets.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/CustomWidgets.java @@ -44,7 +44,7 @@ public class CustomWidgets extends Feature { private final Map offsets = new HashMap<>(); public CustomWidgets() { - super("CustomWidgets", Category.VISUAL, "Change the visuals on widgets like buttons from Minecraft", true, false, 0); + super("CustomWidgets", Category.VISUAL, "", true, false, 0); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/EnchantColor.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/EnchantColor.java index 7ee3ef4d3..8de77990c 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/EnchantColor.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/EnchantColor.java @@ -35,7 +35,7 @@ public class EnchantColor extends Feature{ .name("Saturation") .value(0.75f) .min(0.1f) - .inc(0.05f) + .inc(0.01f) .parent(modeProperty) .depends(parent -> parent.value() == EffectMode.SHADER_RAINBOW) .build(); @@ -43,7 +43,7 @@ public class EnchantColor extends Feature{ .name("Alpha") .value(1f) .min(0.1f) - .inc(0.05f) + .inc(0.01f) .parent(modeProperty) .depends(parent -> parent.value() == EffectMode.SHADER_RAINBOW) .build(); @@ -62,7 +62,18 @@ public class EnchantColor extends Feature{ .name("Speed") .value(1) .min(1) - .inc(10) + .max(20) + .inc(1) + .parent(rainbowProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public Property stopwatchProperty = new Property.PropertyBuilder(this.getClass()) + .name("ColorTimer") + .description("Set the time interval before the color change (MS).") + .value(1) + .min(1) + .max(100) + .inc(1) .parent(rainbowProperty) .depends(parent -> (boolean) parent.value()) .build(); @@ -71,7 +82,7 @@ public class EnchantColor extends Feature{ private final StopWatch stopWatch = new StopWatch(); public EnchantColor() { - super(Category.VISUAL, "Change the color of the enchanment glint (or make it rainbow!)"); + super(Category.VISUAL); } @EventPointer @@ -84,7 +95,7 @@ public EnchantColor() { RenderSystem.enableBlend(); BufferRenderer.drawWithoutShader(buffer); ShaderHelper.INSTANCE.getEnchantColorShader().detach(); - if (stopWatch.hasPassed(25)) { + if (stopWatch.hasPassed(stopwatchProperty.value())) { col+=rainbowSpeedProperty.value(); if (col > 270) col-=270; diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/Gui.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/Gui.java index f2e72cd63..b5f9c5274 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/Gui.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/Gui.java @@ -11,12 +11,11 @@ public class Gui extends Feature { public final Property noCategoriesProperty = new Property.PropertyBuilder(this.getClass()) .name("No Categories") - .description("Display all mods on the first page rather than grouping by category.") .value(false) .build(); public Gui() { - super(Category.VISUAL, "Opens the ClickGui.", GLFW.GLFW_KEY_RIGHT_SHIFT); + super(Category.VISUAL, "", GLFW.GLFW_KEY_RIGHT_SHIFT); } @Override diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/HoleESP.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/HoleESP.java index 95588957d..d555a7a7a 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/HoleESP.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/HoleESP.java @@ -22,7 +22,6 @@ public class HoleESP extends Feature { public final Property fadeBoxProperty = new Property.PropertyBuilder(this.getClass()) .name("Fade Box") - .description("Make the box fade from bottom to top.") .value(true) .build(); public final Property rangeProperty = new Property.PropertyBuilder(this.getClass()) @@ -45,7 +44,7 @@ public class HoleESP extends Feature { private final ArrayList holes = new ArrayList<>(); public HoleESP() { - super(Category.VISUAL, "Automatically show holes for safe crystal-ing"); + super(Category.VISUAL); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/HolidayEvents.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/HolidayEvents.java index 84fa35772..909208287 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/HolidayEvents.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/HolidayEvents.java @@ -27,7 +27,7 @@ public class HolidayEvents extends Feature { .build(); public HolidayEvents() { - super(Category.VISUAL, "Have holiday events like christmas chests show year-round"); + super(Category.VISUAL); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/InventoryView.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/InventoryView.java index 64c8d6640..390d6f9ff 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/InventoryView.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/InventoryView.java @@ -32,7 +32,7 @@ public class InventoryView extends Feature { private final Identifier SHULKER_GUI = new Identifier("textures/gui/container/shulker_box.png"); public InventoryView() { - super(Category.VISUAL, "Show your inventory on your HUD"); + super(Category.VISUAL); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/ItemPhysics.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/ItemPhysics.java index c2c6772e4..aafca1c7b 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/ItemPhysics.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/ItemPhysics.java @@ -22,7 +22,7 @@ import java.util.Objects; import java.util.Random; -public class ItemPhysics extends Feature {//fancier version that's not just flat items on the ground like the fabric mod +public class ItemPhysics extends Feature { public final Property rollSpeedProperty = new Property.PropertyBuilder(this.getClass()) .name("Roll Spin Speed") @@ -45,7 +45,7 @@ public class ItemPhysics extends Feature {//fancier version that's not just flat private final HashMap negValues = new HashMap<>(); public ItemPhysics() { - super(Category.VISUAL, "Items will rotate around in the air and flop down"); + super(Category.VISUAL); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/ItemScale.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/ItemScale.java index 58472054b..03573dd3e 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/ItemScale.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/ItemScale.java @@ -17,9 +17,9 @@ public class ItemScale extends Feature { public final Property rightHandScaleProperty = new Property.PropertyBuilder(this.getClass()) .name("RH Scale") .value(1f) - .min(0.1f) - .max(3) - .inc(0.05f) + .min(0f) + .max(1f) + .inc(0.01f) .parent(rightHandProperty) .depends(parent -> (boolean)parent.value()) .build(); @@ -28,7 +28,7 @@ public class ItemScale extends Feature { .value(0f) .min(-2) .max(2) - .inc(0.05f) + .inc(0.02f) .parent(rightHandProperty) .depends(parent -> (boolean)parent.value()) .build(); @@ -37,7 +37,7 @@ public class ItemScale extends Feature { .value(0f) .min(-2) .max(2) - .inc(0.05f) + .inc(0.02f) .parent(rightHandProperty) .depends(parent -> (boolean)parent.value()) .build(); @@ -46,7 +46,7 @@ public class ItemScale extends Feature { .value(0f) .min(-2) .max(2) - .inc(0.05f) + .inc(0.02f) .parent(rightHandProperty) .depends(parent -> (boolean)parent.value()) .build(); @@ -58,10 +58,10 @@ public class ItemScale extends Feature { public final Property leftHandScaleProperty = new Property.PropertyBuilder(this.getClass()) .name("LH Scale") .value(1f) - .min(0.1f) - .max(3) - .inc(0.05f) - .parent(rightHandProperty) + .min(0f) + .max(1) + .inc(0.01f) + .parent(leftHandProperty) .depends(parent -> (boolean)parent.value()) .build(); public final Property leftHandXProperty = new Property.PropertyBuilder(this.getClass()) @@ -69,8 +69,8 @@ public class ItemScale extends Feature { .value(0f) .min(-2) .max(2) - .inc(0.05f) - .parent(rightHandProperty) + .inc(0.02f) + .parent(leftHandProperty) .depends(parent -> (boolean)parent.value()) .build(); public final Property leftHandYProperty = new Property.PropertyBuilder(this.getClass()) @@ -78,8 +78,8 @@ public class ItemScale extends Feature { .value(0f) .min(-2) .max(2) - .inc(0.05f) - .parent(rightHandProperty) + .inc(0.02f) + .parent(leftHandProperty) .depends(parent -> (boolean)parent.value()) .build(); public final Property leftHandZProperty = new Property.PropertyBuilder(this.getClass()) @@ -87,13 +87,13 @@ public class ItemScale extends Feature { .value(0f) .min(-2) .max(2) - .inc(0.05f) - .parent(rightHandProperty) + .inc(0.02f) + .parent(leftHandProperty) .depends(parent -> (boolean)parent.value()) .build(); public ItemScale() { - super(Category.VISUAL, "Change the scale and positioning of items in your hands"); + super(Category.VISUAL); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/ItemSearcher.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/ItemSearcher.java index 1af359284..e60057d10 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/ItemSearcher.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/ItemSearcher.java @@ -38,7 +38,7 @@ public class ItemSearcher extends Feature { private String searchField = ""; public ItemSearcher() { - super(Category.VISUAL, "Search for items while in a chest or your inventory"); + super(Category.VISUAL); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/Nametag.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/Nametag.java index a45cd3f11..44990fafa 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/Nametag.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/Nametag.java @@ -54,7 +54,6 @@ public class Nametag extends Feature { public final Property customFontProperty = new Property.PropertyBuilder(this.getClass()) .name("Custom Font") - .description("Use TTF font on the nametags.") .value(false) .build(); public final Property playersProperty = new Property.PropertyBuilder(this.getClass()) @@ -153,7 +152,7 @@ public class Nametag extends Feature { private final HashMap positions = Maps.newHashMap(); public Nametag() { - super(Category.VISUAL, "Render names above players with more info."); + super(Category.VISUAL); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/NoFog.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/NoFog.java index affd47828..b77efbd01 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/NoFog.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/NoFog.java @@ -10,7 +10,7 @@ public class NoFog extends Feature { public NoFog() { - super(Category.VISUAL, "Removes all fog from the game."); + super(Category.VISUAL); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/NoHurtCam.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/NoHurtCam.java index b6222ddb9..3328824c5 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/NoHurtCam.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/NoHurtCam.java @@ -9,7 +9,7 @@ public class NoHurtCam extends Feature { public NoHurtCam() { - super(Category.VISUAL, "Remove the hurt-cam effect that bobs your view when damaged."); + super(Category.VISUAL); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/NoRender.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/NoRender.java index 5dba33dbc..838f78a61 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/NoRender.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/NoRender.java @@ -8,13 +8,8 @@ import me.dustin.jex.feature.mod.core.Category; import me.dustin.jex.feature.mod.core.Feature; import me.dustin.jex.feature.property.Property; -import net.minecraft.block.entity.BannerBlockEntity; -import net.minecraft.block.entity.CampfireBlockEntity; -import net.minecraft.block.entity.ChestBlockEntity; -import net.minecraft.block.entity.EnchantingTableBlockEntity; -import net.minecraft.block.entity.EnderChestBlockEntity; -import net.minecraft.block.entity.HopperBlockEntity; -import net.minecraft.block.entity.SignBlockEntity; +import net.minecraft.entity.projectile.thrown.*; +import net.minecraft.block.entity.*; import net.minecraft.client.particle.*; import net.minecraft.entity.FallingBlockEntity; import net.minecraft.entity.ItemEntity; @@ -22,10 +17,6 @@ public class NoRender extends Feature { - public final Property itemProperty = new Property.PropertyBuilder(this.getClass()) - .name("Items") - .value(true) - .build(); public final Property particlesProperty = new Property.PropertyBuilder(this.getClass()) .name("Particles") .value(true) @@ -54,45 +45,341 @@ public class NoRender extends Feature { .parent(particlesProperty) .depends(parent -> (boolean) parent.value()) .build(); + public final Property damageProperty = new Property.PropertyBuilder(this.getClass()) + .name("Damage") + .value(true) + .parent(particlesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property glowProperty = new Property.PropertyBuilder(this.getClass()) + .name("Glow") + .value(true) + .parent(particlesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property totemProperty = new Property.PropertyBuilder(this.getClass()) + .name("Totem") + .value(true) + .parent(particlesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property ashProperty = new Property.PropertyBuilder(this.getClass()) + .name("Ash") + .value(true) + .parent(particlesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property cloudProperty = new Property.PropertyBuilder(this.getClass()) + .name("Cloud") + .value(true) + .parent(particlesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property dragonbreathProperty = new Property.PropertyBuilder(this.getClass()) + .name("Dragon Breath") + .value(true) + .parent(particlesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property crackProperty = new Property.PropertyBuilder(this.getClass()) + .name("Crack") + .value(true) + .parent(particlesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property endrodProperty = new Property.PropertyBuilder(this.getClass()) + .name("EndRod") + .value(true) + .parent(particlesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property bubbleProperty = new Property.PropertyBuilder(this.getClass()) + .name("Bubble") + .value(true) + .parent(particlesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property emotionProperty = new Property.PropertyBuilder(this.getClass()) + .name("Emotion") + .value(true) + .parent(particlesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property enchantglyphProperty = new Property.PropertyBuilder(this.getClass()) + .name("EnchantGlyph") + .value(true) + .parent(particlesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property lavaemberProperty = new Property.PropertyBuilder(this.getClass()) + .name("LavaEmber") + .value(true) + .parent(particlesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property noteProperty = new Property.PropertyBuilder(this.getClass()) + .name("Note") + .value(true) + .parent(particlesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property portalProperty = new Property.PropertyBuilder(this.getClass()) + .name("Portal") + .value(true) + .parent(particlesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property splashProperty = new Property.PropertyBuilder(this.getClass()) + .name("Splash") + .value(true) + .parent(particlesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property snowflakeProperty = new Property.PropertyBuilder(this.getClass()) + .name("SnowFlake") + .value(true) + .parent(particlesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property spellProperty = new Property.PropertyBuilder(this.getClass()) + .name("Spell") + .value(true) + .parent(particlesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property suspendProperty = new Property.PropertyBuilder(this.getClass()) + .name("Suspend") + .value(true) + .parent(particlesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property sweepProperty = new Property.PropertyBuilder(this.getClass()) + .name("SweepAttack") + .value(true) + .parent(particlesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property vibrationProperty = new Property.PropertyBuilder(this.getClass()) + .name("Vibration") + .value(true) + .parent(particlesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property flameProperty = new Property.PropertyBuilder(this.getClass()) + .name("Flame") + .value(true) + .parent(particlesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property soulProperty = new Property.PropertyBuilder(this.getClass()) + .name("Soul") + .value(true) + .parent(particlesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property entitiesProperty = new Property.PropertyBuilder(this.getClass()) + .name("Entities") + .value(true) + .build(); + public final Property itemProperty = new Property.PropertyBuilder(this.getClass()) + .name("Items") + .value(true) + .parent(entitiesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); public final Property withersProperty = new Property.PropertyBuilder(this.getClass()) .name("Withers") .value(true) + .parent(entitiesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property eggProperty = new Property.PropertyBuilder(this.getClass()) + .name("Egg") + .value(true) + .parent(entitiesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property snowballProperty = new Property.PropertyBuilder(this.getClass()) + .name("Snowball") + .value(true) + .parent(entitiesProperty) + .depends(parent -> (boolean) parent.value()) .build(); public final Property fallingBlocksProperty = new Property.PropertyBuilder(this.getClass()) .name("Falling Blocks") .value(true) + .parent(entitiesProperty) + .depends(parent -> (boolean) parent.value()) .build(); - public final Property signsProperty = new Property.PropertyBuilder(this.getClass()) - .name("Signs") + public final Property squidinkProperty = new Property.PropertyBuilder(this.getClass()) + .name("SquidInk") + .value(true) + .parent(entitiesProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property blocksProperty = new Property.PropertyBuilder(this.getClass()) + .name("Blocks") .value(true) .build(); public final Property chestsProperty = new Property.PropertyBuilder(this.getClass()) .name("Chests") .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property barrelProperty = new Property.PropertyBuilder(this.getClass()) + .name("Barrel") + .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property shulkerboxProperty = new Property.PropertyBuilder(this.getClass()) + .name("ShulkerBox") + .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property hoppersProperty = new Property.PropertyBuilder(this.getClass()) + .name("Hoppers") + .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property dispenserProperty = new Property.PropertyBuilder(this.getClass()) + .name("Dispenser") + .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) .build(); public final Property endchestsProperty = new Property.PropertyBuilder(this.getClass()) .name("End Chests") .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) .build(); public final Property enchantbooksProperty = new Property.PropertyBuilder(this.getClass()) .name("EnchantTable Books") .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) .build(); public final Property bannersProperty = new Property.PropertyBuilder(this.getClass()) .name("Banners") .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) .build(); - public final Property hoppersProperty = new Property.PropertyBuilder(this.getClass()) - .name("Hoppers") + public final Property signsProperty = new Property.PropertyBuilder(this.getClass()) + .name("Signs") .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) .build(); public final Property campfiresProperty = new Property.PropertyBuilder(this.getClass()) .name("Campfires") .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property beaconProperty = new Property.PropertyBuilder(this.getClass()) + .name("Beacon") + .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property bedProperty = new Property.PropertyBuilder(this.getClass()) + .name("Bed") + .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property beehiveProperty = new Property.PropertyBuilder(this.getClass()) + .name("Beehive") + .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property bellProperty = new Property.PropertyBuilder(this.getClass()) + .name("Bell") + .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property commandblockProperty = new Property.PropertyBuilder(this.getClass()) + .name("CommandBlock") + .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property comparatorProperty = new Property.PropertyBuilder(this.getClass()) + .name("Comparator") + .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property conduitProperty = new Property.PropertyBuilder(this.getClass()) + .name("Conduit") + .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property ddProperty = new Property.PropertyBuilder(this.getClass()) + .name("DaylightDetector") + .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property endportalProperty = new Property.PropertyBuilder(this.getClass()) + .name("EndPortal") + .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property jigsawProperty = new Property.PropertyBuilder(this.getClass()) + .name("Jigsaw") + .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property jukeboxProperty = new Property.PropertyBuilder(this.getClass()) + .name("Jukebox") + .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) .build(); + public final Property lecternProperty = new Property.PropertyBuilder(this.getClass()) + .name("Lectern") + .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property spawnerProperty = new Property.PropertyBuilder(this.getClass()) + .name("Spawner") + .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property pistonProperty = new Property.PropertyBuilder(this.getClass()) + .name("Piston") + .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property skullProperty = new Property.PropertyBuilder(this.getClass()) + .name("Skull") + .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property structureProperty = new Property.PropertyBuilder(this.getClass()) + .name("StructureBlock") + .value(true) + .parent(blocksProperty) + .depends(parent -> (boolean) parent.value()) + .build(); public NoRender() { - super(Category.VISUAL, "Don't render specific entities/blocks to improve fps"); + super(Category.VISUAL); } @EventPointer @@ -103,6 +390,10 @@ public NoRender() { event.cancel(); if (event.getEntity() instanceof FallingBlockEntity && fallingBlocksProperty.value()) event.cancel(); + if (event.getEntity() instanceof EggEntity && eggProperty.value()) + event.cancel(); + if (event.getEntity() instanceof SnowballEntity && snowballProperty.value()) + event.cancel(); }); @@ -122,6 +413,44 @@ public NoRender() { event.cancel(); if (event.blockEntity instanceof CampfireBlockEntity && campfiresProperty.value()) event.cancel(); + if(event.blockEntity instanceof BarrelBlockEntity && barrelProperty.value()) + event.cancel(); + if(event.blockEntity instanceof DispenserBlockEntity && dispenserProperty.value()) + event.cancel(); + if(event.blockEntity instanceof ShulkerBoxBlockEntity && shulkerboxProperty.value()) + event.cancel(); + if(event.blockEntity instanceof BeaconBlockEntity && beaconProperty.value()) + event.cancel(); + if(event.blockEntity instanceof BedBlockEntity && bedProperty.value()) + event.cancel(); + if(event.blockEntity instanceof BeehiveBlockEntity && beehiveProperty.value()) + event.cancel(); + if(event.blockEntity instanceof BellBlockEntity && bellProperty.value()) + event.cancel(); + if(event.blockEntity instanceof CommandBlockBlockEntity && commandblockProperty.value()) + event.cancel(); + if(event.blockEntity instanceof ComparatorBlockEntity && comparatorProperty.value()) + event.cancel(); + if(event.blockEntity instanceof ConduitBlockEntity && conduitProperty.value()) + event.cancel(); + if(event.blockEntity instanceof DaylightDetectorBlockEntity && ddProperty.value()) + event.cancel(); + if(event.blockEntity instanceof EndPortalBlockEntity && endportalProperty.value()) + event.cancel(); + if(event.blockEntity instanceof JigsawBlockEntity && jigsawProperty.value()) + event.cancel(); + if(event.blockEntity instanceof JukeboxBlockEntity && jukeboxProperty.value()) + event.cancel(); + if(event.blockEntity instanceof LecternBlockEntity && lecternProperty.value()) + event.cancel(); + if(event.blockEntity instanceof MobSpawnerBlockEntity && spawnerProperty.value()) + event.cancel(); + if(event.blockEntity instanceof PistonBlockEntity && pistonProperty.value()) + event.cancel(); + if(event.blockEntity instanceof SkullBlockEntity && skullProperty.value()) + event.cancel(); + if(event.blockEntity instanceof StructureBlockBlockEntity && structureProperty.value()) + event.cancel(); }); @EventPointer @@ -140,5 +469,74 @@ public NoRender() { if (event.getParticle() instanceof BlockDustParticle && blockBreakProperty.value()) { event.cancel(); } + if (event.getParticle() instanceof DamageParticle && damageProperty.value()) { + event.cancel(); + } + if (event.getParticle() instanceof GlowParticle && glowProperty.value()) { + event.cancel(); + } + if (event.getParticle() instanceof AshParticle || event.getParticle() instanceof WhiteAshParticle && ashProperty.value()) { + event.cancel(); + } + if (event.getParticle() instanceof TotemParticle && totemProperty.value()) { + event.cancel(); + } + if (event.getParticle() instanceof DragonBreathParticle && dragonbreathProperty.value()) { + event.cancel(); + } + if (event.getParticle() instanceof CrackParticle && crackProperty.value()) { + event.cancel(); + } + if (event.getParticle() instanceof EndRodParticle && endrodProperty.value()) { + event.cancel(); + } + if (event.getParticle() instanceof SquidInkParticle && squidinkProperty.value()) { + event.cancel(); + } + if (event.getParticle() instanceof BubbleColumnUpParticle || event.getParticle() instanceof WaterBubbleParticle || event.getParticle() instanceof CurrentDownParticle || event.getParticle() instanceof BubblePopParticle && bubbleProperty.value()) { + event.cancel(); + } + if (event.getParticle() instanceof EmotionParticle && emotionProperty.value()) { + event.cancel(); + } + if (event.getParticle() instanceof EnchantGlyphParticle && enchantglyphProperty.value()) { + event.cancel(); + } + if (event.getParticle() instanceof GlowParticle && glowProperty.value()) { + event.cancel(); + } + if (event.getParticle() instanceof LavaEmberParticle && lavaemberProperty.value()) { + event.cancel(); + } + if (event.getParticle() instanceof NoteParticle && noteProperty.value()) { + event.cancel(); + } + if (event.getParticle() instanceof PortalParticle && portalProperty.value()) { + event.cancel(); + } + if (event.getParticle() instanceof RainSplashParticle || event.getParticle() instanceof WaterSplashParticle && splashProperty.value()) { + event.cancel(); + } + if (event.getParticle() instanceof SnowflakeParticle && snowflakeProperty.value()) { + event.cancel(); + } + if (event.getParticle() instanceof SpellParticle && spellProperty.value()) { + event.cancel(); + } + if (event.getParticle() instanceof SuspendParticle || event.getParticle() instanceof WaterSuspendParticle && suspendProperty.value()) { + event.cancel(); + } + if (event.getParticle() instanceof SweepAttackParticle && sweepProperty.value()) { + event.cancel(); + } + if (event.getParticle() instanceof VibrationParticle && vibrationProperty.value()) { + event.cancel(); + } + if (event.getParticle() instanceof FlameParticle && flameProperty.value()) { + event.cancel(); + } + if (event.getParticle() instanceof SoulParticle && soulProperty.value()) { + event.cancel(); + } }); } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/NoVisualCooldown.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/NoVisualCooldown.java index c0f107df9..4fa239251 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/NoVisualCooldown.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/NoVisualCooldown.java @@ -9,7 +9,7 @@ public class NoVisualCooldown extends Feature { public NoVisualCooldown() { - super(Category.VISUAL, "Removes the visual effect of your weapon lowering after attacking."); + super(Category.VISUAL); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/OldBlocking.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/OldBlocking.java index a3ddf1535..19865b122 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/OldBlocking.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/OldBlocking.java @@ -27,7 +27,7 @@ public class OldBlocking extends Feature { .build(); public OldBlocking() { - super(Category.VISUAL, "Get the pre-1.9 block animation when blocking with a shield."); + super(Category.VISUAL); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/OwnerTags.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/OwnerTags.java index 36514acd5..7150f4746 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/OwnerTags.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/OwnerTags.java @@ -31,7 +31,7 @@ public class OwnerTags extends Feature { private final HashMap positions = Maps.newHashMap(); public OwnerTags() { - super(Category.VISUAL, "Show the names of the owners of tamed mobs"); + super(Category.VISUAL); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/Search.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/Search.java index 9a317dbfc..a860a0d66 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/Search.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/Search.java @@ -65,7 +65,7 @@ public class Search extends Feature { private final ConcurrentLinkedQueue chunksToUpdate = new ConcurrentLinkedQueue<>(); public Search() { - super(Category.VISUAL, "Search for a specific block. use \".help search\""); + super(Category.VISUAL); } public static void firstLoad() { @@ -119,7 +119,8 @@ public void onEnable() { continue; } Entity cameraEntity = Wrapper.INSTANCE.getMinecraft().getCameraEntity(); - assert cameraEntity != null; + if (cameraEntity == null) + return; if (limitRangeProperty.value() && ClientMathHelper.INSTANCE.getDistance(Wrapper.INSTANCE.getLocalPlayer().getPos(), ClientMathHelper.INSTANCE.getVec(pos)) > rangeProperty.value()) continue; Vec3d entityPos = Render3DHelper.INSTANCE.getRenderPosition(new Vec3d(pos.getX() + 0.5f, pos.getY(), pos.getZ() + 0.5f)); @@ -141,15 +142,12 @@ public void onEnable() { continue; } Entity cameraEntity = Wrapper.INSTANCE.getMinecraft().getCameraEntity(); - assert cameraEntity != null; + if (cameraEntity == null) + return; Vec3d entityPos = Render3DHelper.INSTANCE.getRenderPosition(new Vec3d(pos.getX() + 0.5f, pos.getY(), pos.getZ() + 0.5f)); - Color color1 = ColorHelper.INSTANCE.getColor(blocks.get(block)); - Render3DHelper.INSTANCE.setup3DRender(true); - Vec3d eyes = new Vec3d(0, 0, 1).rotateX(-(float) Math.toRadians(PlayerHelper.INSTANCE.getPitch())).rotateY(-(float) Math.toRadians(PlayerHelper.INSTANCE.getYaw())); - BufferBuilder bufferBuilder = BufferHelper.INSTANCE.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR); bufferBuilder.vertex(eyes.x, eyes.y, eyes.z).color(color1.getRed(), color1.getGreen(), color1.getBlue(), color1.getAlpha()).next(); bufferBuilder.vertex(entityPos.x, entityPos.y, entityPos.z).color(color1.getRed(), color1.getGreen(), color1.getBlue(), color1.getAlpha()).next(); diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/SignReader.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/SignReader.java index e0d186cae..5d16e8ad7 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/SignReader.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/SignReader.java @@ -31,7 +31,6 @@ public class SignReader extends Feature { .build(); public final Property hoverOnlyProperty = new Property.PropertyBuilder(this.getClass()) .name("Hover Only") - .description("Only show sign text when hovering over the sign.") .value(true) .build(); public final Property backgroundsProperty = new Property.PropertyBuilder(this.getClass()) @@ -42,7 +41,7 @@ public class SignReader extends Feature { private final HashMap positions = Maps.newHashMap(); public SignReader() { - super(Category.VISUAL, "Display the text of a hovered sign on screen."); + super(Category.VISUAL); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/Skeletons.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/Skeletons.java index dc16202f3..fa608dbb0 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/Skeletons.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/Skeletons.java @@ -31,7 +31,7 @@ import net.minecraft.util.math.Vec3f; import java.awt.*; -public class Skeletons extends Feature {//it looks cool as fuck but seriously fuck this was a massive pain in the ass +public class Skeletons extends Feature { public final Property skeletonColorProperty = new Property.PropertyBuilder(this.getClass()) .name("Color") @@ -39,7 +39,7 @@ public class Skeletons extends Feature {//it looks cool as fuck but seriously fu .build(); public Skeletons() { - super(Category.VISUAL, "Draw player skeletons"); + super(Category.VISUAL); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/SpawnHighlighter.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/SpawnHighlighter.java index 1cbe6bc4f..ebca562ab 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/SpawnHighlighter.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/SpawnHighlighter.java @@ -95,7 +95,7 @@ public class SpawnHighlighter extends Feature { private final StopWatch stopWatch = new StopWatch(); public SpawnHighlighter() { - super(Category.VISUAL, "Show all blocks near you that mobs can spawn on."); + super(Category.VISUAL); } @EventPointer @@ -157,7 +157,8 @@ private boolean isValidBlock(BlockPos blockPos) { if (checkWaterProperty.value()) if (WorldHelper.INSTANCE.isWaterlogged(above)) return false; - assert aboveBlock != null; + if (aboveBlock == null) + return false; if (!WorldHelper.INSTANCE.canMobSpawnInside(aboveState) || (checkHeightProperty.value() && !WorldHelper.INSTANCE.canMobSpawnInside(twoAboveState))) return false; if (checkLightProperty.value()) { diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/SuperheroFX.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/SuperheroFX.java index 6b613e171..0172bb4cb 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/SuperheroFX.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/SuperheroFX.java @@ -25,7 +25,6 @@ public class SuperheroFX extends Feature{ public final Property visibleOnlyProperty = new Property.PropertyBuilder(this.getClass()) .name("Visible Only") - .description("Only show particles when they would be visible.") .value(true) .build(); public final Property maxAgeProperty = new Property.PropertyBuilder(this.getClass()) @@ -52,7 +51,7 @@ public class SuperheroFX extends Feature{ private final ArrayList particles = new ArrayList<>(); public SuperheroFX() { - super(Category.VISUAL, "Add comic \"Pow!\" and others to the game"); + super(Category.VISUAL); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/TargetHud.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/TargetHud.java index fedfd2c6c..662963c7e 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/TargetHud.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/TargetHud.java @@ -8,12 +8,11 @@ public class TargetHud extends Feature { public TargetHud() { - super(Category.VISUAL, "Display information on the HUD of the entity you are attacking"); + super(Category.VISUAL); } public final Property markTargetProperty = new Property.PropertyBuilder(this.getClass()) .name("Mark Target") - .description("Show a triangle on the target on your HUD") .value(true) .build(); public final Property markColorProperty = new Property.PropertyBuilder(this.getClass()) diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/ToolTips.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/ToolTips.java index f45ccddda..dcf95bb3f 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/ToolTips.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/ToolTips.java @@ -38,17 +38,14 @@ public class ToolTips extends Feature { public final Property repairCostProperty = new Property.PropertyBuilder(this.getClass()) .name("Repair Cost") - .description("Show the repair cost of items in the tooltip.") .value(true) .build(); public final Property shulkerToolTipProperty = new Property.PropertyBuilder(this.getClass()) .name("ShulkerToolTip") - .description("Show the contents of a shulker above the tooltip") .value(true) .build(); public final Property inspectKeyProperty = new Property.PropertyBuilder(this.getClass()) .name("Inspect Key") - .description("The key you can hold to hover over items inside of the shulker box") .value(GLFW.GLFW_KEY_LEFT_CONTROL) .isKey() .parent(shulkerToolTipProperty) @@ -56,27 +53,22 @@ public class ToolTips extends Feature { .build(); public final Property mapToolTipProperty = new Property.PropertyBuilder(this.getClass()) .name("MapToolTip") - .description("Display the map texture above the tooltip.") .value(true) .build(); public final Property stewToolTipProperty = new Property.PropertyBuilder(this.getClass()) .name("StewToolTip") - .description("Display the Stew's potion effect in the tooltip.") .value(true) .build(); public final Property hiveToolTipProperty = new Property.PropertyBuilder(this.getClass()) .name("HiveToolTip") - .description("Show hive data in the tooltip.") .value(true) .build(); public final Property nbtToolTipProperty = new Property.PropertyBuilder(this.getClass()) .name("NBTToolTip") - .description("Show NBT data in the tooltip.") .value(true) .build(); public final Property nbtKeyProperty = new Property.PropertyBuilder(this.getClass()) .name("Show NBT Key") - .description("The key to press to display the NBT data.") .value(GLFW.GLFW_KEY_LEFT_SHIFT) .isKey() .parent(nbtToolTipProperty) @@ -89,7 +81,7 @@ public class ToolTips extends Feature { private ItemStack inspectStack; public ToolTips() { - super(Category.VISUAL, "Show extra tooltip info including seeing inside of shulkers and viewing maps and other NBT data"); + super(Category.VISUAL); } //ShulkerToolTip, also with the ability to hover over and inspect the items inside diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/Tracers.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/Tracers.java index 8d779a20d..9d87ca4af 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/Tracers.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/Tracers.java @@ -16,6 +16,7 @@ import me.dustin.jex.feature.mod.core.Feature; import me.dustin.jex.feature.mod.impl.render.esp.ESP; import me.dustin.jex.helper.render.shader.ShaderHelper; +import net.minecraft.entity.ItemEntity; import net.minecraft.client.render.*; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; @@ -30,16 +31,10 @@ public class Tracers extends Feature { .name("Spine") .value(false) .build(); - public final Property playersProperty = new Property.PropertyBuilder(this.getClass()) +public final Property playersProperty = new Property.PropertyBuilder(this.getClass()) .name("Players") .value(true) - .build(); - public final Property colorOnDistanceProperty = new Property.PropertyBuilder(this.getClass()) - .name("Color on distance") - .value(true) - .parent(playersProperty) - .depends(parent -> (boolean) parent.value()) - .build(); + .build(); public final Property bossesProperty = new Property.PropertyBuilder(this.getClass()) .name("Bosses") .value(true) @@ -56,6 +51,10 @@ public class Tracers extends Feature { .name("Neutrals") .value(true) .build(); + public final Property itemProperty = new Property.PropertyBuilder(this.getClass()) + .name("Items") + .value(true) + .build(); public Tracers() { super(Category.VISUAL, "Draw a line to entities in range."); @@ -64,10 +63,10 @@ public Tracers() { @EventPointer private final EventListener eventRender3DNoBobEventListener = new EventListener<>(event -> { Wrapper.INSTANCE.getWorld().getEntities().forEach(entity -> { - if (entity instanceof LivingEntity living && isValid((LivingEntity) entity)) { + if (isValid((Entity) entity)) { Entity cameraEntity = Wrapper.INSTANCE.getMinecraft().getCameraEntity(); assert cameraEntity != null; - Vec3d vec = Render3DHelper.INSTANCE.getEntityRenderPosition(living, event.getPartialTicks()); + Vec3d vec = Render3DHelper.INSTANCE.getEntityRenderPosition(entity, event.getPartialTicks()); Color color1 = ColorHelper.INSTANCE.getColor(getColor(entity)); Render3DHelper.INSTANCE.setup3DRender(true); @@ -87,23 +86,15 @@ public Tracers() { } }); }); - - private int getColor(Entity ent) { - if (ent instanceof PlayerEntity playerEntity && colorOnDistanceProperty.value()) { - if (!FriendHelper.INSTANCE.isFriend(playerEntity.getName().getString())) { - return ColorHelper.INSTANCE.redGreenShift(ent.distanceTo(Wrapper.INSTANCE.getLocalPlayer()) / 64); - } - } - return ESP.INSTANCE.getColor(ent); + private int getColor(Entity ent) { + return ESP.INSTANCE.getColor(ent); } - - private boolean isValid(LivingEntity e) { + +private boolean isValid(Entity e) { if (e == null) return false; if (e == Wrapper.INSTANCE.getLocalPlayer()) return false; - if (e.isSleeping()) - return false; if (e instanceof PlayerEntity) return playersProperty.value() && !EntityHelper.INSTANCE.isNPC((PlayerEntity) e); if (EntityHelper.INSTANCE.isPassiveMob(e)) @@ -114,6 +105,8 @@ private boolean isValid(LivingEntity e) { return hostilesProperty.value(); if (EntityHelper.INSTANCE.isNeutralMob(e)) return neutralsProperty.value(); + if (e instanceof ItemEntity) + return itemProperty.value(); return false; } } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/Trail.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/Trail.java index 15185d27c..0f990999d 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/Trail.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/Trail.java @@ -30,7 +30,7 @@ public class Trail extends Feature { private final Random r = new Random(); public Trail() { - super(Category.VISUAL, "Render a configurable list of particles as a trail behind you. Use command .trail to configure"); + super(Category.VISUAL); } @EventPointer @@ -53,9 +53,7 @@ public Trail() { public void onEnable() { ConfigManager.INSTANCE.get(TrailsFile.class).read(); if (particles.isEmpty()) { - particles.add(ParticleTypes.DRAGON_BREATH); - particles.add(ParticleTypes.SOUL_FIRE_FLAME); - particles.add(ParticleTypes.ASH); + particles.add(ParticleTypes.ASH); } super.onEnable(); } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/Trajectories.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/Trajectories.java index d8a45f460..c3c6d3993 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/Trajectories.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/Trajectories.java @@ -56,6 +56,13 @@ public class Trajectories extends Feature { + public final Property sizeProperty = new Property.PropertyBuilder(this.getClass()) + .name("Box Size") + .value(0.1f) + .min(0.01f) + .max(0.3f) + .inc(0.01f) + .build(); public final Property disableDepthProperty = new Property.PropertyBuilder(this.getClass()) .name("Z-Clip") .value(true) @@ -73,7 +80,7 @@ public class Trajectories extends Feature { private final ArrayList positions = new ArrayList<>(); public Trajectories() { - super(Category.VISUAL, "Show a trajectory line for things like bows and snowballs"); + super(Category.VISUAL); } @EventPointer @@ -108,7 +115,7 @@ public Trajectories() { Vec3d vec2 = Render3DHelper.INSTANCE.getEntityRenderPosition(hitEntity, event.getPartialTicks()); Render3DHelper.INSTANCE.drawEntityBox(event.getPoseStack(), hitEntity, vec2.x, vec2.y, vec2.z, hitColorProperty.value().getRGB()); } else { - Box bb1 = new Box(vec.x - 0.2f, vec.y - 0.2f, vec.z - 0.2f, vec.x + 0.2f, vec.y + 0.2f, vec.z + 0.2f); + Box bb1 = new Box(vec.x - sizeProperty.value(), vec.y - sizeProperty.value(), vec.z - sizeProperty.value(), vec.x + sizeProperty.value(), vec.y + sizeProperty.value(), vec.z + sizeProperty.value()); Render3DHelper.INSTANCE.drawBox(event.getPoseStack(), bb1, missColorProperty.value().getRGB()); } } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/TunnelFinder.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/TunnelFinder.java index f18662360..d01544edc 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/TunnelFinder.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/TunnelFinder.java @@ -38,7 +38,7 @@ public class TunnelFinder extends Feature { private Thread thread; public TunnelFinder() { - super(Category.VISUAL, "Find tunnels in the nether that might lead to bases."); + super(Category.VISUAL); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/Zoom.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/Zoom.java index 3e7a9aed8..575325d41 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/Zoom.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/Zoom.java @@ -16,15 +16,15 @@ public class Zoom extends Feature { public final Property mouseSmoothProperty = new Property.PropertyBuilder(this.getClass()) .name("Mouse Smooth") - .description("Smooth the mouse movement while zoomed like Optifine.") .value(true) .build(); public final Property zoomLevelProperty = new Property.PropertyBuilder(this.getClass()) .name("Zoom Level") .value(1f) - .min(1) - .max(5) + .min(0f) + .max(10f) .value(0.1f) + .inc(0.1f) .build(); public final Property zoomKeyProperty = new Property.PropertyBuilder(this.getClass()) .name("Zoom Key") @@ -36,7 +36,7 @@ public class Zoom extends Feature { boolean resetFOV = true; public Zoom() { - super(Category.VISUAL, "Zoom in like Optifine"); + super(Category.VISUAL); } @Override @@ -59,9 +59,9 @@ public void onDisable() { this.resetFOV = false; this.savedFOV = Wrapper.INSTANCE.getOptions().getFov().getValue(); } - int zoomFov = (int)(30 - (6 * zoomLevelProperty.value())); + int zoomFov = (int)(30 - (2 * zoomLevelProperty.value())); if (zoomFov == 0) - zoomFov = 1; + zoomFov = 30; if(Wrapper.INSTANCE.getOptions().getFov().getValue() > zoomFov) { Wrapper.INSTANCE.getOptions().getFov().setValue(zoomFov); if (mouseSmoothProperty.value()) diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/esp/ESP.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/esp/ESP.java index d9029fcca..506a725e7 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/esp/ESP.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/esp/ESP.java @@ -30,10 +30,8 @@ public class ESP extends Feature { .name("Mode") .value(Mode.SHADER) .build(); - public final Property lineWidthProperty = new Property.PropertyBuilder(this.getClass()) .name("Line Width") - .description("Line width for shaders (in pixels)") .value(2) .min(1) .max(10) @@ -42,14 +40,12 @@ public class ESP extends Feature { .build(); public final Property glowProperty = new Property.PropertyBuilder(this.getClass()) .name("Glow") - .description("Whether or not to add a glow effect to the outline") .value(false) .parent(modeProperty) .depends(parent -> parent.value() == Mode.SHADER || parent.value() == Mode.BOX_OUTLINE) .build(); public final Property glowIntensityProperty = new Property.PropertyBuilder(this.getClass()) .name("Glow Intensity") - .description("Intensity for the glow effect") .value(0.5f) .min(0.1f) .max(1) @@ -61,85 +57,120 @@ public class ESP extends Feature { .name("Player") .value(true) .build(); - public final Property colorOnDistanceProperty = new Property.PropertyBuilder(this.getClass()) - .name("Color on Distance") - .description("Change the color from green (far away) to red (close).") - .value(false) + public final Property friendProperty = new Property.PropertyBuilder(this.getClass()) + .name("Friends") + .value(true) .parent(playerProperty) .depends(parent -> (boolean) parent.value()) .build(); + public final Property neutralProperty = new Property.PropertyBuilder(this.getClass()) + .name("Neutral") + .value(false) + .build(); + public final Property bossProperty = new Property.PropertyBuilder(this.getClass()) + .name("Boss") + .value(true) + .build(); + public final Property hostileProperty = new Property.PropertyBuilder(this.getClass()) + .name("Hostile") + .value(true) + .build(); + public final Property passiveProperty = new Property.PropertyBuilder(this.getClass()) + .name("Passive") + .value(true) + .build(); +public final Property petProperty = new Property.PropertyBuilder(this.getClass()) + .name("Pet") + .value(false) + .parent(passiveProperty) + .depends(parent -> (boolean) parent.value()) + .build(); +public final Property localProperty = new Property.PropertyBuilder(this.getClass()) + .name("LocalPlayer") + .value(true) + .build(); +public final Property botProperty = new Property.PropertyBuilder(this.getClass()) + .name("Bot") + .value(true) + .build(); +public final Property nolivingProperty = new Property.PropertyBuilder(this.getClass()) + .name("NoLiving") + .value(false) + .build(); +public final Property itemProperty = new Property.PropertyBuilder(this.getClass()) + .name("Items") + .value(true) + .build(); public final Property playerColorProperty = new Property.PropertyBuilder(this.getClass()) .name("Player Color") .value(Color.RED) - .parent(playerProperty) - .depends(parent -> (boolean) parent.value()) + .parent(playerProperty) + .depends(parent -> (boolean)parent.value()) .build(); public final Property friendColorProperty = new Property.PropertyBuilder(this.getClass()) .name("Friend Color") .value(Color.BLUE) - .parent(playerProperty) - .depends(parent -> (boolean) parent.value()) - .build(); - public final Property neutralProperty = new Property.PropertyBuilder(this.getClass()) - .name("Neutral") - .value(true) + .parent(friendProperty) + .depends(parent -> (boolean)parent.value()) .build(); public final Property neutralColorProperty = new Property.PropertyBuilder(this.getClass()) .name("Neutral Color") .value(Color.PINK) - .parent(neutralProperty) - .depends(parent -> (boolean) parent.value()) - .build(); - public final Property bossProperty = new Property.PropertyBuilder(this.getClass()) - .name("Boss") - .value(true) + .parent(neutralProperty) + .depends(parent -> (boolean)parent.value()) .build(); public final Property bossColorProperty = new Property.PropertyBuilder(this.getClass()) .name("Boss Color") .value(Color.RED.darker()) - .parent(bossProperty) - .depends(parent -> (boolean) parent.value()) - .build(); - public final Property hostileProperty = new Property.PropertyBuilder(this.getClass()) - .name("Hostile") - .value(true) + .parent(bossProperty) + .depends(parent -> (boolean)parent.value()) .build(); public final Property hostileColorProperty = new Property.PropertyBuilder(this.getClass()) .name("Hostile Color") .value(Color.ORANGE) - .parent(hostileProperty) - .depends(parent -> (boolean) parent.value()) - .build(); - public final Property passiveProperty = new Property.PropertyBuilder(this.getClass()) - .name("Passive") - .value(true) + .parent(hostileProperty) + .depends(parent -> (boolean)parent.value()) .build(); public final Property passiveColorProperty = new Property.PropertyBuilder(this.getClass()) .name("Passive Color") .value(Color.GREEN) - .parent(passiveProperty) - .depends(parent -> (boolean) parent.value()) + .parent(passiveProperty) + .depends(parent -> (boolean)parent.value()) .build(); public final Property petColorProperty = new Property.PropertyBuilder(this.getClass()) .name("Pets Color") .value(Color.BLUE) - .parent(passiveColorProperty) + .parent(petProperty) + .depends(parent -> (boolean)parent.value()) .build(); - public final Property itemProperty = new Property.PropertyBuilder(this.getClass()) - .name("Item") - .value(true) + public final Property botColorProperty = new Property.PropertyBuilder(this.getClass()) + .name("Bots Color") + .value(Color.BLUE) + .parent(botProperty) + .depends(parent -> (boolean)parent.value()) + .build(); + public final Property localColorProperty = new Property.PropertyBuilder(this.getClass()) + .name("LocalPlayer Color") + .value(Color.BLUE) + .parent(localProperty) + .depends(parent -> (boolean) parent.value()) .build(); public final Property itemColorProperty = new Property.PropertyBuilder(this.getClass()) .name("Item Color") .value(Color.WHITE) - .parent(itemProperty) - .depends(parent -> (boolean) parent.value()) + .parent(itemProperty) + .depends(parent -> (boolean)parent.value()) + .build(); + public final Property noliveColorProperty = new Property.PropertyBuilder(this.getClass()) + .name("NoLiving Color") + .value(Color.WHITE) + .parent(nolivingProperty) + .depends(parent -> (boolean)parent.value()) .build(); - private Mode lastMode; public ESP() { - super(Category.VISUAL, "Mark entities/players through walls"); + super(Category.VISUAL); new ShaderESP(); new BoxESP(); new OutlineBox(); @@ -188,13 +219,13 @@ public boolean isValid(Entity entity) { if (entity instanceof ItemEntity) return itemProperty.value(); if (!(entity instanceof LivingEntity livingEntity)) - return false; - if (livingEntity == Wrapper.INSTANCE.getLocalPlayer()) - return false; - if (livingEntity instanceof PlayerEntity && EntityHelper.INSTANCE.isNPC((PlayerEntity) livingEntity)) - return false; + return nolivingProperty.value(); + if (livingEntity == Wrapper.INSTANCE.getLocalPlayer()) + return localProperty.value(); if (livingEntity instanceof PlayerEntity) return playerProperty.value(); + if (EntityHelper.INSTANCE.isNPC((PlayerEntity) livingEntity)) + return botProperty.value(); if (EntityHelper.INSTANCE.isNeutralMob(entity)) return neutralProperty.value(); if (EntityHelper.INSTANCE.isBossMob(entity)) @@ -209,26 +240,26 @@ public boolean isValid(Entity entity) { public int getColor(Entity entity) { if (entity instanceof ItemEntity) return itemColorProperty.value().getRGB(); + if (!(entity instanceof LivingEntity livingEntity)) + return noliveColorProperty.value().getRGB(); if (FriendHelper.INSTANCE.isFriend(entity.getName().getString())) return friendColorProperty.value().getRGB(); - if (entity instanceof PlayerEntity) { - if (colorOnDistanceProperty.value()) { - return ColorHelper.INSTANCE.redGreenShift(entity.distanceTo(Wrapper.INSTANCE.getLocalPlayer()) / 64); - } + if (entity instanceof PlayerEntity) return playerColorProperty.value().getRGB(); - } - if (EntityHelper.INSTANCE.isPassiveMob(entity)) - if (EntityHelper.INSTANCE.doesPlayerOwn(entity)) - return petColorProperty.value().getRGB(); - else - return passiveColorProperty.value().getRGB(); + return passiveColorProperty.value().getRGB(); + if (EntityHelper.INSTANCE.doesPlayerOwn(entity)) + return petColorProperty.value().getRGB(); if (EntityHelper.INSTANCE.isBossMob(entity)) return bossColorProperty.value().getRGB(); if (EntityHelper.INSTANCE.isHostileMob(entity)) return hostileColorProperty.value().getRGB(); if (EntityHelper.INSTANCE.isNeutralMob(entity)) return neutralColorProperty.value().getRGB(); + if (livingEntity == Wrapper.INSTANCE.getLocalPlayer()) + return localColorProperty.value().getRGB(); + if (EntityHelper.INSTANCE.isNPC((PlayerEntity) livingEntity)) + return botColorProperty.value().getRGB(); return -1; } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/esp/impl/OutlineBox.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/esp/impl/OutlineBox.java index b451f8fb1..0760210f8 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/esp/impl/OutlineBox.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/esp/impl/OutlineBox.java @@ -77,7 +77,7 @@ public void pass(Event event) { float maxX = (float) bb.maxX; float maxY = (float) bb.maxY; float maxZ = (float) bb.maxZ; - bufferBuilder.vertex(matrix4f, minX, minY, minZ).color(color1.getRed(), color1.getGreen(), color1.getBlue(), color1.getAlpha()).next(); + bufferBuilder.vertex(matrix4f, minX, minY, minZ).color(color1.getRed(), color1.getGreen(), color1.getBlue(), color1.getAlpha()).next(); bufferBuilder.vertex(matrix4f, maxX, minY, minZ).color(color1.getRed(), color1.getGreen(), color1.getBlue(), color1.getAlpha()).next(); bufferBuilder.vertex(matrix4f, maxX, minY, maxZ).color(color1.getRed(), color1.getGreen(), color1.getBlue(), color1.getAlpha()).next(); bufferBuilder.vertex(matrix4f, minX, minY, maxZ).color(color1.getRed(), color1.getGreen(), color1.getBlue(), color1.getAlpha()).next(); @@ -86,7 +86,7 @@ public void pass(Event event) { bufferBuilder.vertex(matrix4f, minX, maxY, maxZ).color(color1.getRed(), color1.getGreen(), color1.getBlue(), color1.getAlpha()).next(); bufferBuilder.vertex(matrix4f, maxX, maxY, maxZ).color(color1.getRed(), color1.getGreen(), color1.getBlue(), color1.getAlpha()).next(); bufferBuilder.vertex(matrix4f, maxX, maxY, minZ).color(color1.getRed(), color1.getGreen(), color1.getBlue(), color1.getAlpha()).next(); - + bufferBuilder.vertex(matrix4f, minX, minY, minZ).color(color1.getRed(), color1.getGreen(), color1.getBlue(), color1.getAlpha()).next(); bufferBuilder.vertex(matrix4f, minX, maxY, minZ).color(color1.getRed(), color1.getGreen(), color1.getBlue(), color1.getAlpha()).next(); bufferBuilder.vertex(matrix4f, maxX, maxY, minZ).color(color1.getRed(), color1.getGreen(), color1.getBlue(), color1.getAlpha()).next(); diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/hud/Hud.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/hud/Hud.java index a952bbfdc..dce3797d4 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/hud/Hud.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/hud/Hud.java @@ -7,6 +7,9 @@ import me.dustin.jex.event.misc.EventKeyPressed; import me.dustin.jex.event.misc.EventMouseButton; import me.dustin.jex.event.misc.EventTick; +import me.dustin.jex.helper.entity.EntityHelper; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.ItemEntity; import me.dustin.jex.event.render.EventRender2D; import me.dustin.jex.event.render.EventRender2DItem; import me.dustin.jex.event.render.EventRenderEffects; @@ -31,6 +34,7 @@ import me.dustin.jex.helper.render.Render2DHelper; import me.dustin.jex.feature.mod.core.Feature; import org.lwjgl.glfw.GLFW; +import net.minecraft.entity.Entity; import java.awt.*; import java.util.*; @@ -49,12 +53,10 @@ public class Hud extends Feature { .build(); public final Property collisionProperty = new Property.PropertyBuilder(this.getClass()) .name("Collision") - .description("Whether or not to allow the HUD elements to collide with one another.") .value(true) .build(); public final Property constrictKeyProperty = new Property.PropertyBuilder(this.getClass()) .name("Constrict Elements Key") - .description("The key to bring all elements back on screen.") .value(GLFW.GLFW_KEY_LEFT_CONTROL) .isKey() .build(); @@ -62,6 +64,60 @@ public class Hud extends Feature { .name("Watermark") .value(true) .build(); + public final Property radarProperty = new Property.PropertyBuilder(this.getClass()) + .name("Radar") + .value(true) + .build(); + public final Property rangeProperty = new Property.PropertyBuilder(this.getClass()) + .name("Range") + .value(16) + .min(16) + .max(100) + .parent(radarProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property waypointsProperty = new Property.PropertyBuilder(this.getClass()) + .name("Waypoints") + .value(true) + .parent(radarProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property playersProperty = new Property.PropertyBuilder(this.getClass()) + .name("Players") + .value(true) + .parent(radarProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property bossesProperty = new Property.PropertyBuilder(this.getClass()) + .name("Bosses") + .value(true) + .parent(radarProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property hostilesProperty = new Property.PropertyBuilder(this.getClass()) + .name("Hostiles") + .value(true) + .parent(radarProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property neutralsProperty = new Property.PropertyBuilder(this.getClass()) + .name("Neutrals") + .value(true) + .parent(radarProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property passivesProperty = new Property.PropertyBuilder(this.getClass()) + .name("Passives") + .value(true) + .parent(radarProperty) + .depends(parent -> (boolean) parent.value()) + .build(); + public final Property itemsProperty = new Property.PropertyBuilder(this.getClass()) + .name("Items") + .value(true) + .parent(radarProperty) + .depends(parent -> (boolean) parent.value()) + .build(); public final Property watermarkModeProperty = new Property.PropertyBuilder(this.getClass()) .name("Jex Effect") .value(WatermarkEffect.STATIC) @@ -78,7 +134,6 @@ public class Hud extends Feature { .build(); public final Property suffixesProperty = new Property.PropertyBuilder(this.getClass()) .name("Suffixes") - .description("Allow for suffixes to display in the ArrayList") .value(true) .parent(showArrayListProperty) .depends(parent -> (boolean) parent.value()) @@ -161,7 +216,7 @@ public class Hud extends Feature { public final Property tabGuiWidthProperty = new Property.PropertyBuilder(this.getClass()) .name("TabGui Width") .value(75f) - .min(55) + .min(45) .max(200) .parent(tabGuiProperty) .depends(parent -> (boolean) parent.value()) @@ -186,7 +241,6 @@ public class Hud extends Feature { .build(); public final Property serverNameProperty = new Property.PropertyBuilder(this.getClass()) .name("Server") - .description("Show the server IP on the HUD.") .value(true) .parent(infoProperty) .depends(parent -> (boolean) parent.value()) @@ -271,6 +325,22 @@ public Hud() { super("Hud", Category.VISUAL, "Mark entities/players through walls", true, false, 0); INSTANCE = this; } + + public boolean isValid(Entity entity) { + if (entity instanceof PlayerEntity && entity != Wrapper.INSTANCE.getLocalPlayer()) + return playersProperty.value(); + if (entity instanceof ItemEntity) + return itemsProperty.value(); + if (EntityHelper.INSTANCE.isBossMob(entity)) + return bossesProperty.value(); + if (EntityHelper.INSTANCE.isNeutralMob(entity)) + return neutralsProperty.value(); + if (EntityHelper.INSTANCE.isHostileMob(entity)) + return hostilesProperty.value(); + if (EntityHelper.INSTANCE.isPassiveMob(entity)) + return passivesProperty.value(); + return false; + } @Override public void onEnable() { @@ -409,7 +479,7 @@ public enum ArrayListColor { CLIENT_COLOR, RAINBOW, CATEGORY } public enum DistanceMode { - BLOCKS, FEET, MILES, KM + BLOCKS, FEET, MILES, METER, KM } public enum TimeMode { SECOND, TICK, MINUTE, HOUR, DAY diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/hud/elements/CoordinatesElement.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/hud/elements/CoordinatesElement.java index d308222fa..62613b0e0 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/hud/elements/CoordinatesElement.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/hud/elements/CoordinatesElement.java @@ -21,7 +21,7 @@ public void render(MatrixStack matrixStack) { float longest = 0; Vec3d pos = Wrapper.INSTANCE.getLocalPlayer().getPos(); - String coordString = String.format("XYZ\247f: \2477%.2f\247f/\2477%.2f\247f/\2477%.2f", pos.getX(), pos.getY(), pos.getZ()); + String coordString = String.format("XYZ\247f: \2477%.15f\247f/\2477%.15f\247f/\2477%.15f", pos.getX(), pos.getY(), pos.getZ()); float strLength = FontHelper.INSTANCE.getStringWidth(coordString); float strX = isLeftSide() ? getX() + 3 : getX() + getWidth() - strLength; float strY = getY() + (isTopSide() ? 2.5f : 12.5f); @@ -32,9 +32,9 @@ public void render(MatrixStack matrixStack) { if (getHud().netherCoordsProperty.value()) { double coordScale = Wrapper.INSTANCE.getLocalPlayer().clientWorld.getDimension().coordinateScale(); if (coordScale != 1.0D) { - coordString = String.format("Overworld\247f: \2477%.2f\247f/\2477%.2f\247f/\2477%.2f", pos.getX() * coordScale, pos.getY() * coordScale, pos.getZ() * coordScale); + coordString = String.format("Overworld\247f: \2477%.15f\247f/\2477%.15f\247f/\2477%.15f", pos.getX() * coordScale, pos.getY() * coordScale, pos.getZ() * coordScale); } else { - coordString = String.format("Nether\247f: \2477%.2f\247f/\2477%.2f\247f/\2477%.2f", pos.getX() / 8, pos.getY(), pos.getZ() / 8); + coordString = String.format("Nether\247f: \2477%.15f\247f/\2477%.15f\247f/\2477%.15f", pos.getX() / 8, pos.getY(), pos.getZ() / 8); } strLength = FontHelper.INSTANCE.getStringWidth(coordString); strX = isLeftSide() ? getX() + 3 : getX() + getWidth() - strLength; diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/hud/elements/RadarElement.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/hud/elements/RadarElement.java index bd36d50cb..42eba5e77 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/hud/elements/RadarElement.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/hud/elements/RadarElement.java @@ -1,7 +1,7 @@ package me.dustin.jex.feature.mod.impl.render.hud.elements; import me.dustin.jex.feature.mod.impl.render.esp.ESP; -import me.dustin.jex.feature.mod.impl.world.Radar; +import me.dustin.jex.feature.mod.impl.render.hud.Hud; import me.dustin.jex.feature.mod.impl.world.Waypoints; import me.dustin.jex.helper.math.ColorHelper; import me.dustin.jex.helper.misc.Wrapper; @@ -48,7 +48,7 @@ public void render(MatrixStack matrixStack) { if (Wrapper.INSTANCE.getWorld() != null) for (Entity entity : Wrapper.INSTANCE.getWorld().getEntities()) { - if (!Radar.INSTANCE.isValid(entity)) + if (!Hud.INSTANCE.isValid(entity)) continue; float xPos = (float) (entity.getX() - Wrapper.INSTANCE.getLocalPlayer().getX()) + midPos + this.getX(); float yPos = (float) (entity.getZ() - Wrapper.INSTANCE.getLocalPlayer().getZ()) + midPos + this.getY(); @@ -56,7 +56,7 @@ public void render(MatrixStack matrixStack) { Render2DHelper.INSTANCE.fill(matrixStack, xPos, yPos, xPos + 1, yPos + 1, ESP.INSTANCE.getColor(entity)); } } - if (Radar.INSTANCE.waypointsProperty.value()) { + if (Hud.INSTANCE.waypointsProperty.value()) { matrixStack.push(); float scale = 0.75f; matrixStack.scale(scale, scale, 1); @@ -103,7 +103,7 @@ public NativeImage createNativeImage() { for (int x = -nativeImage.getWidth() / 2; x < nativeImage.getWidth() / 2; x++) for (int z = -nativeImage.getHeight() / 2; z < nativeImage.getHeight() / 2; z++) { BlockPos blockPos = Wrapper.INSTANCE.getLocalPlayer().getBlockPos().add(x, 0, z); - int y = Wrapper.INSTANCE.getWorld().getChunk(blockPos.getX() / 16, blockPos.getZ() / 16).sampleHeightmap(Heightmap.Type.WORLD_SURFACE, x, z); + int y = Wrapper.INSTANCE.getWorld().getChunk(blockPos.getX() / Hud.INSTANCE.rangeProperty.value(), blockPos.getZ() / Hud.INSTANCE.rangeProperty.value()).sampleHeightmap(Heightmap.Type.WORLD_SURFACE, x, z); Block block = WorldHelper.INSTANCE.getBlock(new BlockPos(blockPos.getX(), y, blockPos.getZ())); nativeImage.setColor(x, z, block.getDefaultMapColor().color); } @@ -113,7 +113,7 @@ public NativeImage createNativeImage() { @Override public boolean isVisible() { - return Radar.INSTANCE.getState(); + return getHud().radarProperty.value(); } private void drawPointer(MatrixStack matrixStack) { diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/hud/elements/SpeedElement.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/hud/elements/SpeedElement.java index da67f3683..484a22267 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/hud/elements/SpeedElement.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/hud/elements/SpeedElement.java @@ -34,11 +34,13 @@ private String generateSpeedText() { switch (getHud().distanceModeProperty.value()) { case BLOCKS: break; + case METER: + break; case FEET: move = move.multiply(3.281); break; case MILES: - move = move.multiply(0.000621371); + move = move.multiply(0.00062137119223733); break; case KM: move = move.multiply(0.001); @@ -62,7 +64,7 @@ private String generateSpeedText() { time *= 86400; break; } - return String.format("%.2f %s/%s", (float) (Math.abs(length2D(move)) * time), WordUtils.capitalize(getHud().distanceModeProperty.value().name().toLowerCase().replace("_", " ")), WordUtils.capitalize(getHud().timeModeProperty.value().name().toLowerCase().replace("_", " "))); + return String.format("%.9f %s/%s", (float) (Math.abs(length2D(move)) * time), WordUtils.capitalize(getHud().distanceModeProperty.value().name().toLowerCase().replace("_", " ")), WordUtils.capitalize(getHud().timeModeProperty.value().name().toLowerCase().replace("_", " "))); } public double length2D(Vec3d vec3d) { diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/render/storageesp/StorageESP.java b/src/main/java/me/dustin/jex/feature/mod/impl/render/storageesp/StorageESP.java index ed46c6447..93739d4e4 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/render/storageesp/StorageESP.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/render/storageesp/StorageESP.java @@ -39,7 +39,6 @@ public class StorageESP extends Feature { .build(); public final Property lineWidthProperty = new Property.PropertyBuilder(this.getClass()) .name("Line Width") - .description("Line width for shaders (in pixels)") .value(2) .min(1) .max(10) @@ -48,14 +47,12 @@ public class StorageESP extends Feature { .build(); public final Property glowProperty = new Property.PropertyBuilder(this.getClass()) .name("Glow") - .description("Whether or not to add a glow effect to the outline") .value(false) .parent(modeProperty) .depends(parent -> parent.value() == Mode.SHADER) .build(); public final Property glowIntensityProperty = new Property.PropertyBuilder(this.getClass()) .name("Glow Intensity") - .description("Intensity for the glow effect") .value(0.5f) .min(0.1f) .max(1) @@ -65,10 +62,9 @@ public class StorageESP extends Feature { .build(); public final Property fadeBoxesWhenCloseProperty = new Property.PropertyBuilder(this.getClass()) .name("Fade When Close") - .description("Fade the boxes to make the storage block easier to see.") .value(true) .parent(modeProperty) - .depends(parent -> parent.value() == Mode.SHADER) + .depends(parent -> parent.value() == Mode.BOX) .build(); public final Property fadeDistanceProperty = new Property.PropertyBuilder(this.getClass()) .name("Fade Distance") @@ -197,7 +193,7 @@ public class StorageESP extends Feature { private Mode lastMode; public StorageESP() { - super(Category.VISUAL, "Show storage blocks through walls"); + super(Category.VISUAL); new OutlineStorageESP(); new BoxStorageESP(); } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/AccuratePlace.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/AccuratePlace.java index a597a34da..99c5554e5 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/AccuratePlace.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/AccuratePlace.java @@ -35,17 +35,19 @@ public class AccuratePlace extends Feature { public final Property nextKeyProperty = new Property.PropertyBuilder(this.getClass()) .name("Next Key") .value(GLFW.GLFW_KEY_UP) + .isKey() .build(); public final Property lastKeyProperty = new Property.PropertyBuilder(this.getClass()) .name("Last Key") .value(GLFW.GLFW_KEY_DOWN) + .isKey() .build(); private Direction facing = Direction.DOWN; private int index = 0; public AccuratePlace() { - super(Category.WORLD, "Change the direction that you place blocks"); + super(Category.WORLD); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/AirPlace.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/AirPlace.java index fdc99ad29..9ff9b9f0a 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/AirPlace.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/AirPlace.java @@ -27,19 +27,22 @@ public class AirPlace extends Feature { public final Property liquidsProperty = new Property.PropertyBuilder(this.getClass()) .name("Liquids") - .description("Allow placing inside of liquids.") .value(true) .build(); - public final Property reachProperty = new Property.PropertyBuilder(this.getClass()) + public final Property reachProperty = new Property.PropertyBuilder(this.getClass()) .name("Reach") - .value(4.5f) + .value(4) .min(3) .max(6) - .inc(0.1f) + .inc(1) + .build(); + public final Property swingProperty = new Property.PropertyBuilder(this.getClass()) + .name("Swing") + .value(true) .build(); public AirPlace() { - super(Category.WORLD, "Gives you the ability to place blocks in the air. (Anticheats usually block this)"); + super(Category.WORLD); } @EventPointer @@ -48,7 +51,9 @@ public AirPlace() { if (hitResult instanceof BlockHitResult blockHitResult) { if (canReplaceBlock(WorldHelper.INSTANCE.getBlock(blockHitResult.getBlockPos())) && Wrapper.INSTANCE.getLocalPlayer().getMainHandStack().getItem() instanceof BlockItem) { Wrapper.INSTANCE.getClientPlayerInteractionManager().interactBlock(Wrapper.INSTANCE.getLocalPlayer(), Hand.MAIN_HAND, blockHitResult); + if (swingProperty.value()) { Wrapper.INSTANCE.getLocalPlayer().swingHand(Hand.MAIN_HAND); + } event.cancel(); } } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/AntiGhostBlock.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/AntiGhostBlock.java index ef6c073c8..cc325271f 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/AntiGhostBlock.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/AntiGhostBlock.java @@ -12,7 +12,7 @@ public class AntiGhostBlock extends Feature { public AntiGhostBlock() { - super(Category.WORLD, "Prevent the game from creating ghost blocks."); + super(Category.WORLD); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/AntiHazard.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/AntiHazard.java index f685bc66c..59c412bf6 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/AntiHazard.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/AntiHazard.java @@ -37,9 +37,14 @@ public class AntiHazard extends Feature { .name("Powdered Snow") .value(true) .build(); + public final Property tripWireProperty = new Property.PropertyBuilder(this.getClass()) + .name("Tripwire") + .value(true) + .build(); + public AntiHazard() { - super(Category.WORLD, "Prevent yourself from walking into hazards like cactus"); + super(Category.WORLD); } @EventPointer @@ -64,6 +69,9 @@ public AntiHazard() { } else if (event.getBlock() == Blocks.POWDER_SNOW && powderedSnowProperty.value()) { event.setVoxelShape(VoxelShapes.cuboid(WorldHelper.SINGLE_BOX)); event.cancel(); + } else if (event.getBlock() == Blocks.TRIPWIRE && tripWireProperty.value()) { + event.setVoxelShape(VoxelShapes.cuboid(WorldHelper.SINGLE_BOX)); + event.cancel(); } }); } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/AntiLiquid.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/AntiLiquid.java index e18f248fa..3c7398c1d 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/AntiLiquid.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/AntiLiquid.java @@ -61,11 +61,10 @@ public class AntiLiquid extends Feature { .name("Distance") .value(3) .min(1) - .max(5) + .max(6) .build(); public final Property illegalPlaceProperty = new Property.PropertyBuilder(this.getClass()) .name("Allow Illegal Place") - .description("Allow placements without having a side of a block to use.") .value(true) .build(); diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/AutoBreak.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/AutoBreak.java index 22cc65ffe..d70744427 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/AutoBreak.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/AutoBreak.java @@ -62,7 +62,7 @@ public class AutoBreak extends Feature { private BlockPos pos; public AutoBreak() { - super(Category.WORLD, "Set a block to auto re-break when a new block is there."); + super(Category.WORLD); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/AutoFarm.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/AutoFarm.java index 7ffc8693b..d742f50dd 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/AutoFarm.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/AutoFarm.java @@ -59,6 +59,7 @@ public class AutoFarm extends Feature { public final Property sortDelayProperty = new Property.PropertyBuilder(this.getClass()) .name("Sort Delay") .value(250) + .min(0) .max(1000) .inc(10) .build(); @@ -71,7 +72,7 @@ public class AutoFarm extends Feature { private final StopWatch sortStopWatch = new StopWatch(); public AutoFarm() { - super(Category.WORLD, "Farm a selected area"); + super(Category.WORLD); } @EventPointer @@ -90,7 +91,6 @@ public AutoFarm() { switch (stage) { case FARMING -> { closest = farmArea.getClosestCrop(); - //if no plants to farm move to next stage if (closest == null) { this.stage = Stage.PLANTING; PathingHelper.INSTANCE.cancelPathing(); @@ -110,7 +110,6 @@ public AutoFarm() { closest = farmArea.getClosestFarmland(); int cropSlot = getPlantableCrop(); - //if out of crops to plant or no more area to plant crops move to next stage if (cropSlot == -1 || closest == null) { this.stage = Stage.ITEM_PICKUP; PathingHelper.INSTANCE.cancelPathing(); @@ -155,14 +154,12 @@ public AutoFarm() { stage = Stage.FARMING; return; } - //do planting check closest = farmArea.getClosestFarmland(); int cropSlot = getPlantableCrop(); if (cropSlot != -1 && closest != null) { this.stage = Stage.PLANTING; return; } - //do item check if (getClosestItem() != null) { stage = Stage.ITEM_PICKUP; return; @@ -179,17 +176,16 @@ public AutoFarm() { Vec3d miningAreaVec2 = Render3DHelper.INSTANCE.getRenderPosition(new BlockPos(farmArea.getAreaBB().maxX, farmArea.getAreaBB().maxY, farmArea.getAreaBB().maxZ)); Box miningAreaBox = new Box(miningAreaVec1.x, miningAreaVec1.y, miningAreaVec1.z, miningAreaVec2.x + 1, miningAreaVec2.y + 1, miningAreaVec2.z + 1); Render3DHelper.INSTANCE.drawBox(event.getPoseStack(), miningAreaBox, 0xffffff00); - } else if (tempPos1 != null) {//draws yellow box on first set pos + } else if (tempPos1 != null) { Vec3d tempVec = Render3DHelper.INSTANCE.getRenderPosition(tempPos1); Box closestBox = new Box(tempVec.x, tempVec.y, tempVec.z, tempVec.x + 1, tempVec.y + 1, tempVec.z + 1); Render3DHelper.INSTANCE.drawBox(event.getPoseStack(), closestBox, 0xffffff00); } - if (tempPos2 != null) {//draws yellow box on first set pos + if (tempPos2 != null) { Vec3d tempVec = Render3DHelper.INSTANCE.getRenderPosition(tempPos2); Box closestBox = new Box(tempVec.x, tempVec.y, tempVec.z, tempVec.x + 1, tempVec.y + 1, tempVec.z + 1); Render3DHelper.INSTANCE.drawBox(event.getPoseStack(), closestBox, 0xffffff00); } - //draws yellow box on crosshair block if (farmArea == null && Wrapper.INSTANCE.getMinecraft().crosshairTarget instanceof BlockHitResult blockHitResult) { Vec3d hitVec = Render3DHelper.INSTANCE.getRenderPosition(blockHitResult.getBlockPos()); Box hoverBox = new Box(hitVec.x, hitVec.y, hitVec.z, hitVec.x + 1, hitVec.y + 1, hitVec.z + 1); diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/AutoMine.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/AutoMine.java index fc123de1a..95cf5686f 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/AutoMine.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/AutoMine.java @@ -11,7 +11,7 @@ public class AutoMine extends Feature { public AutoMine() { - super(Category.WORLD, "Automatically mine any block you hover over."); + super(Category.WORLD); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/AutoSign.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/AutoSign.java index 7d712b880..af265af12 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/AutoSign.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/AutoSign.java @@ -23,7 +23,7 @@ public class AutoSign extends Feature { public Text[] signText = {Text.of(" "), Text.of(""), Text.of(""), Text.of("")}; public AutoSign() { - super(Category.WORLD, "Automatically write to signs."); + super(Category.WORLD); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/BedrockBreaker.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/BedrockBreaker.java index a802fd1ec..aebcd92a0 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/BedrockBreaker.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/BedrockBreaker.java @@ -18,7 +18,7 @@ public class BedrockBreaker extends Feature { public BedrockBreaker() { - super(Category.WORLD, "Break bedrock in survival mode using a well-known bug. Code from https://github.com/aria1th/Fabric-Bedrock-Miner"); + super(Category.WORLD); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/BedrockObf.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/BedrockObf.java index 72f7362da..79fbe9b96 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/BedrockObf.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/BedrockObf.java @@ -29,7 +29,7 @@ public class BedrockObf extends Feature { private Thread thread; public BedrockObf() { - super(Category.WORLD, "Rearranges Bedrock at the bottom of the world and top of the Nether to avoid seed searching."); + super(Category.WORLD); } @EventPointer @@ -57,7 +57,8 @@ public BedrockObf() { if (emptyChunk != null) { for (Chunk chunk : obfuscatedChunks) { - assert Wrapper.INSTANCE.getWorld() != null; + if (Wrapper.INSTANCE.getWorld() == null) + return; if (!Wrapper.INSTANCE.getWorld().getChunkManager().isChunkLoaded(chunk.getPos().x, chunk.getPos().z)) obfuscatedChunks.remove(chunk); } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/BonemealAura.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/BonemealAura.java index e5117ce0c..0a6e66447 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/BonemealAura.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/BonemealAura.java @@ -7,13 +7,14 @@ import me.dustin.jex.event.render.EventRender3D; import me.dustin.jex.feature.mod.core.Category; import me.dustin.jex.feature.mod.core.Feature; +import me.dustin.jex.feature.property.Property; import me.dustin.jex.helper.misc.Wrapper; import me.dustin.jex.helper.player.InventoryHelper; import me.dustin.jex.helper.player.PlayerHelper; import me.dustin.jex.helper.render.Render3DHelper; import me.dustin.jex.helper.world.WorldHelper; -import net.minecraft.block.Block; -import net.minecraft.block.CropBlock; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.block.*; import net.minecraft.item.Items; import net.minecraft.screen.slot.SlotActionType; import net.minecraft.util.Hand; @@ -25,8 +26,44 @@ public class BonemealAura extends Feature { public static BonemealAura INSTANCE; private boolean isBonemealing; +public final Property radiusProperty = new Property.PropertyBuilder(this.getClass()) + .name("Radius") + .value(6) + .min(2) + .max(6) + .inc(1) + .build(); +public final Property checkgrowProperty = new Property.PropertyBuilder(this.getClass()) + .name("CheckGrow") + .value(true) + .build(); +public final Property cropProperty = new Property.PropertyBuilder(this.getClass()) + .name("Crop") + .value(true) + .build(); +public final Property cocoaProperty = new Property.PropertyBuilder(this.getClass()) + .name("Cocoa") + .value(true) + .build(); +public final Property saplingProperty = new Property.PropertyBuilder(this.getClass()) + .name("Sapling") + .value(true) + .build(); +public final Property stemProperty = new Property.PropertyBuilder(this.getClass()) + .name("Stem") + .value(true) + .build(); +public final Property bambooProperty = new Property.PropertyBuilder(this.getClass()) + .name("Bamboo") + .value(true) + .build(); +public final Property otherProperty = new Property.PropertyBuilder(this.getClass()) + .name("Other") + .value(true) + .build(); + public BonemealAura() { - super(Category.WORLD, "Automatically bonemeal crops around the player"); + super(Category.WORLD); INSTANCE = this; } @@ -80,19 +117,52 @@ public boolean isBonemealing() { } public BlockPos getCrop() { - for (int x = -4; x < 4; x++) { - for (int y = -2; y < 2; y++) { - for (int z = -4; z < 4; z++) { - BlockPos blockPos = Wrapper.INSTANCE.getLocalPlayer().getBlockPos().add(x, y, z); - Block block = WorldHelper.INSTANCE.getBlock(blockPos); - if (block instanceof CropBlock cropBlock) { - int age = Wrapper.INSTANCE.getWorld().getBlockState(blockPos).get(cropBlock.getAgeProperty()); - if (age < cropBlock.getMaxAge()) + for (int x = -radiusProperty.value(); x < radiusProperty.value(); x++) { + for (int z = -radiusProperty.value(); z < radiusProperty.value(); z++) { + for (int y = -radiusProperty.value(); y < radiusProperty.value(); y++) { + BlockPos blockPos = Wrapper.INSTANCE.getLocalPlayer().getBlockPos().add(x, y, z); + Block block = WorldHelper.INSTANCE.getBlock(blockPos); + if (checkgrowProperty.value()) { + if(!(block instanceof Fertilizable) && block instanceof GrassBlock){ + return null; + } + } + if (cropProperty.value()) { + if (block instanceof CropBlock cropBlock) { + int age = Wrapper.INSTANCE.getWorld().getBlockState(blockPos).get(cropBlock.getAgeProperty()); + if (age < cropBlock.getMaxAge()) return blockPos; } - } - } - } + } + if (otherProperty.value()) { + if (block instanceof Fertilizable) { + Wrapper.INSTANCE.getWorld().getBlockState(blockPos); + return blockPos; + } + } + if (saplingProperty.value()) { + if (block instanceof SaplingBlock) { + return blockPos; + } + } + if (stemProperty.value()) { + if (block instanceof StemBlock) { + return blockPos; + } + } + if (cocoaProperty.value()) { + if (block instanceof CocoaBlock) { + return blockPos; + } + } + if (bambooProperty.value()) { + if (block instanceof BambooBlock || block instanceof BambooSaplingBlock) { + return blockPos; + } + } + } + } + } return null; } } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/ChestStealer.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/ChestStealer.java index 368a75227..9b68d4071 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/ChestStealer.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/ChestStealer.java @@ -10,6 +10,7 @@ import me.dustin.jex.helper.misc.Wrapper; import me.dustin.jex.helper.player.InventoryHelper; import net.minecraft.client.gui.screen.ingame.GenericContainerScreen; +import net.minecraft.client.gui.screen.ingame.ShulkerBoxScreen; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.screen.slot.Slot; @@ -21,26 +22,28 @@ public class ChestStealer extends Feature { public final Property delayProperty = new Property.PropertyBuilder(this.getClass()) .name("Delay") .value(50L) + .min(0) .max(1000) .inc(10) .build(); public final Property dumpProperty = new Property.PropertyBuilder(this.getClass()) .name("Dump") - .description("Throw the items on the ground.") + .value(false) + .build(); + public final Property shulkerProperty = new Property.PropertyBuilder(this.getClass()) + .name("Shulker") .value(false) .build(); private final StopWatch stopWatch = new StopWatch(); public ChestStealer() { - super(Category.WORLD, "Automatically steal from chests when opened."); + super(Category.WORLD); } @EventPointer private final EventListener eventPlayerPacketsEventListener = new EventListener<>(event -> { - if (!stopWatch.hasPassed(delayProperty.value())) - return; - if (Wrapper.INSTANCE.getMinecraft().currentScreen instanceof GenericContainerScreen) { + if (Wrapper.INSTANCE.getMinecraft().currentScreen instanceof GenericContainerScreen || Wrapper.INSTANCE.getMinecraft().currentScreen instanceof ShulkerBoxScreen && shulkerProperty.value()) { if (InventoryHelper.INSTANCE.isInventoryFull() && !dumpProperty.value()) { Wrapper.INSTANCE.getLocalPlayer().closeHandledScreen(); return; @@ -49,6 +52,7 @@ public ChestStealer() { Wrapper.INSTANCE.getLocalPlayer().closeHandledScreen(); } else { int most = Wrapper.INSTANCE.getLocalPlayer().currentScreenHandler.slots.size() - 36; + if (stopWatch.hasPassed(delayProperty.value())) { for (int i = 0; i < most; i++) { Slot slot = Wrapper.INSTANCE.getLocalPlayer().currentScreenHandler.slots.get(i); ItemStack stack = slot.getStack(); @@ -57,9 +61,10 @@ public ChestStealer() { stopWatch.reset(); if (delayProperty.value() > 0) return; - } - } - } + } + } + } + } } }, new PlayerPacketsFilter(EventPlayerPackets.Mode.PRE)); } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/ColoredSigns.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/ColoredSigns.java index df32c8040..ebb62ee40 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/ColoredSigns.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/ColoredSigns.java @@ -17,7 +17,7 @@ public class ColoredSigns extends Feature { public ColoredSigns() { - super(Category.WORLD, "Color coded signs. Use & for the color code"); + super(Category.WORLD); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/EndPortalFinder.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/EndPortalFinder.java index 35b00bb8a..bbc8d2d53 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/EndPortalFinder.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/EndPortalFinder.java @@ -24,7 +24,7 @@ public class EndPortalFinder extends Feature { private EyeOfEnderEntity trackedEye; public EndPortalFinder() { - super(Category.WORLD, "Find end portals with just two eye of ender. Math from https://www.omnicalculator.com/other/end-portal-finder"); + super(Category.WORLD); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/EntityRider.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/EntityRider.java index 5e49ce299..0c8c71d8c 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/EntityRider.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/EntityRider.java @@ -46,7 +46,7 @@ public class EntityRider extends Feature { .value(1f) .min(0.1f) .max(2) - .inc(0.05f) + .inc(0.02f) .parent(horseProperty) .depends(parent -> (boolean) parent.value()) .build(); @@ -55,7 +55,7 @@ public class EntityRider extends Feature { .value(1f) .min(0.1f) .max(2) - .inc(0.05f) + .inc(0.02f) .parent(horseProperty) .depends(parent -> (boolean) parent.value()) .build(); @@ -87,7 +87,7 @@ public class EntityRider extends Feature { .value(1f) .min(0.1f) .max(2) - .inc(0.05f) + .inc(0.02f) .parent(llamaProperty) .depends(parent -> (boolean) parent.value()) .build(); @@ -96,7 +96,7 @@ public class EntityRider extends Feature { .value(1f) .min(0.1f) .max(2) - .inc(0.05f) + .inc(0.02f) .parent(llamaProperty) .depends(parent -> (boolean) parent.value()) .build(); @@ -116,7 +116,7 @@ public class EntityRider extends Feature { .value(1f) .min(0.1f) .max(2) - .inc(0.05f) + .inc(0.02f) .parent(boatProperty) .depends(parent -> (boolean) parent.value()) .build(); @@ -125,13 +125,13 @@ public class EntityRider extends Feature { .value(1f) .min(0.1f) .max(2) - .inc(0.05f) + .inc(0.02f) .parent(boatProperty) .depends(parent -> (boolean) parent.value()) .build(); public EntityRider() { - super(Category.WORLD, "Change how ridable entities work."); + super(Category.WORLD); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/Excavator.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/Excavator.java index 4d4f0b715..47ca6a7aa 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/Excavator.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/Excavator.java @@ -86,7 +86,7 @@ public class Excavator extends Feature { private boolean baritoneAllowPlace; public Excavator() { - super(Category.WORLD, "Mine out a selected area"); + super(Category.WORLD); } @EventPointer @@ -368,9 +368,7 @@ public BlockPos getClosest() { excavator.sortStopWatch.reset(); } for (BlockPos blockPos : blockPosList) { - //able to be clicked if (WorldHelper.INSTANCE.getBlockState(blockPos).getOutlineShape(Wrapper.INSTANCE.getWorld(), blockPos) != VoxelShapes.empty()) { - //cheeky little workaround for being able to dig layers if (Math.abs(blockPos.getY() - getHighestBlockY()) <= excavator.layerDepthProperty.value() - 1) { return blockPos; } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/FarmAura.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/FarmAura.java index 5d5244bbe..81073cc21 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/FarmAura.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/FarmAura.java @@ -28,9 +28,14 @@ public class FarmAura extends Feature { public final Property checkAgeProperty = new Property.PropertyBuilder(this.getClass()) .name("Check Age") - .description("Check to make sure the crops are fully aged.") .value(true) .build(); + public final Property distanceProperty = new Property.PropertyBuilder(this.getClass()) + .name("Distance") + .value(4) + .min(3) + .max(6) + .build(); public final Property breakDelayProperty = new Property.PropertyBuilder(this.getClass()) .name("Break Delay (MS)") .value(100L) @@ -43,12 +48,16 @@ public class FarmAura extends Feature { .max(1000) .inc(10) .build(); + public final Property swingProperty = new Property.PropertyBuilder(this.getClass()) + .name("Swing") + .value(true) + .build(); private final StopWatch breakStopWatch = new StopWatch(); private final StopWatch plantStopWatch = new StopWatch(); public FarmAura() { - super(Category.WORLD, "Destroy any fully grown crops nearby"); + super(Category.WORLD); } @EventPointer @@ -64,7 +73,9 @@ public FarmAura() { event.setRotation(rot); Direction facing = Direction.fromRotation(-rot.getYaw()); Wrapper.INSTANCE.getClientPlayerInteractionManager().updateBlockBreakingProgress(crop, facing); + if (swingProperty.value()) { Wrapper.INSTANCE.getLocalPlayer().swingHand(Hand.MAIN_HAND); + } } } if (plantStopWatch.hasPassed(plantDelayProperty.value())) { @@ -79,7 +90,6 @@ public FarmAura() { cropSlot = 8; } InventoryHelper.INSTANCE.setSlot(cropSlot, true, true); - RotationVector rot = PlayerHelper.INSTANCE.rotateToVec(Wrapper.INSTANCE.getLocalPlayer(), Vec3d.ofCenter(farmland)); rot.normalize(); event.setRotation(rot); @@ -90,9 +100,10 @@ public FarmAura() { @EventPointer private final EventListener eventRender3DEventListener = new EventListener<>(event -> { - for (int x = -4; x < 4; x++) { - for (int y = -2; y < 2; y++) { - for (int z = -4; z < 4; z++) { + for (int x = -distanceProperty.value(); x < distanceProperty.value(); x++) { + for (int z = -distanceProperty.value(); z < distanceProperty.value(); z++) { + for (int y = -distanceProperty.value(); y < distanceProperty.value(); y++) { + BlockPos blockPos = Wrapper.INSTANCE.getLocalPlayer().getBlockPos().add(x, y, z); if (WorldHelper.INSTANCE.isCrop(blockPos, checkAgeProperty.value())) { Vec3d renderPos = Render3DHelper.INSTANCE.getRenderPosition(blockPos); @@ -123,9 +134,9 @@ private int getPlantableCrop() { } public BlockPos getFarmland() { - for (int x = -4; x < 4; x++) { - for (int y = -2; y < 2; y++) { - for (int z = -4; z < 4; z++) { + for (int x = -distanceProperty.value(); x < distanceProperty.value(); x++) { + for (int z = -distanceProperty.value(); z < distanceProperty.value(); z++) { + for (int y = -distanceProperty.value(); y < distanceProperty.value(); y++) { BlockPos blockPos = Wrapper.INSTANCE.getLocalPlayer().getBlockPos().add(x, y, z).down(); if (WorldHelper.INSTANCE.getBlock(blockPos) == Blocks.FARMLAND && WorldHelper.INSTANCE.getBlock(blockPos.up()) == Blocks.AIR) return blockPos; @@ -136,9 +147,9 @@ public BlockPos getFarmland() { } public BlockPos getCrop() { - for (int x = -4; x < 4; x++) { - for (int y = -2; y < 2; y++) { - for (int z = -4; z < 4; z++) { + for (int x = distanceProperty.value(); x < distanceProperty.value(); x++) { + for (int z = -distanceProperty.value(); z < distanceProperty.value(); z++) { + for (int y = -distanceProperty.value(); y resetGammaProperty = new Property.PropertyBuilder(this.getClass()) .name("Reset Gamma") - .description("The gamma to set the value to on disable.") .value(1D) .max(1) .inc(0.05f) .build(); public Fullbright() { - super(Category.WORLD, "Goodbye, darkness. You were never my friend."); + super(Category.WORLD); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/LogOutSpot.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/LogOutSpot.java index a031039a7..898ab1e4b 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/LogOutSpot.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/LogOutSpot.java @@ -28,7 +28,7 @@ public class LogOutSpot extends Feature { private final ArrayList fakePlayers = new ArrayList<>(); public LogOutSpot() { - super(Category.WORLD, "Shows you where players have logged out at"); + super(Category.WORLD); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/NewChunks.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/NewChunks.java index d6ee52827..8abd130bf 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/NewChunks.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/NewChunks.java @@ -35,7 +35,7 @@ public class NewChunks extends Feature { private final ArrayList oldChunks = new ArrayList<>(); public NewChunks() { - super(Category.WORLD, "Attempts to determine which chunks are newly generated."); + super(Category.WORLD); } @EventPointer @@ -46,18 +46,18 @@ public NewChunks() { if (chunk != null) new Thread(() -> { for (int x = 0; x < 16; x++) - for (int y = chunk.getBottomY(); y < chunk.getHighestNonEmptySectionYOffset(); y++) - for (int z = 0; z < 16; z++) { - FluidState fluidState = WorldHelper.INSTANCE.getFluidState(new BlockPos(chunk.getPos().getBlockPos(x, y, z))); - if (fluidState != null && !fluidState.isEmpty()) { - if (!fluidState.isStill()) { - oldChunks.add(chunk); - return; - } - } - } - }).start(); - }); + for (int z = 0; z < 16; z++) + for (int y = chunk.getBottomY(); y < chunk.getHighestNonEmptySectionYOffset(); y++) { + FluidState fluidState = WorldHelper.INSTANCE.getFluidState(new BlockPos(chunk.getPos().getBlockPos(x, y, z))); + if (fluidState != null && !fluidState.isEmpty()) { + if (!fluidState.isStill()) { + oldChunks.add(chunk); + return; + } + } + } + }).start(); +}); @EventPointer private final EventListener eventPacketReceiveEventListener = new EventListener<>(event -> { diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/NoWeather.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/NoWeather.java index 3d488abf6..bcb25d175 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/NoWeather.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/NoWeather.java @@ -17,7 +17,7 @@ public class NoWeather extends Feature { public NoWeather() { - super(Category.WORLD, "Remove rain and snow"); + super(Category.WORLD); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/Nuker.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/Nuker.java index e39fa1d5b..e42536360 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/Nuker.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/Nuker.java @@ -2,102 +2,91 @@ import me.dustin.events.core.EventListener; import me.dustin.events.core.annotate.EventPointer; -import me.dustin.jex.JexClient; import me.dustin.jex.event.filters.PlayerPacketsFilter; import me.dustin.jex.event.player.EventPlayerPackets; -import me.dustin.jex.event.render.EventRender3D; import me.dustin.jex.event.world.EventClickBlock; import me.dustin.jex.feature.mod.core.Category; import me.dustin.jex.feature.mod.core.Feature; import me.dustin.jex.feature.property.Property; import me.dustin.jex.helper.math.ClientMathHelper; -import me.dustin.jex.helper.misc.ChatHelper; import me.dustin.jex.helper.misc.StopWatch; import me.dustin.jex.helper.misc.Wrapper; import me.dustin.jex.helper.network.NetworkHelper; -import me.dustin.jex.helper.render.Render3DHelper; import me.dustin.jex.helper.world.WorldHelper; import net.minecraft.block.AirBlock; import net.minecraft.block.Block; import net.minecraft.block.FluidBlock; -import net.minecraft.client.network.PlayerListEntry; import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Box; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; -import net.minecraft.world.GameMode; - import java.awt.*; import java.util.ArrayList; import java.util.Comparator; public class Nuker extends Feature { public Nuker() { - super(Category.WORLD, "Nuke the blocks around you. (Creative mode only)"); + super(Category.WORLD); } private final StopWatch stopWatch = new StopWatch(); - + public final Property distanceProperty = new Property.PropertyBuilder(this.getClass()) .name("Distance") - .description("The distance at which to break blocks") .value(4) .min(3) .max(6) .build(); public final Property delayProperty = new Property.PropertyBuilder(this.getClass()) .name("Break Delay") - .description("Delay between breaking blocks in milliseconds") .value(0L) - .max(500) - .inc(10) + .max(1000L) + .inc(10L) .build(); public final Property keepFloorProperty = new Property.PropertyBuilder(this.getClass()) .name("Keep Floor") - .description("Don't break blocks below you, only above.") .value(true) .build(); + public final Property swingProperty = new Property.PropertyBuilder(this.getClass()) + .name("Swing") + .value(true) + .build(); + @EventPointer private final EventListener eventPlayerPacketsEventListener = new EventListener<>(event -> { - if (!stopWatch.hasPassed(delayProperty.value())) - return; ArrayList positions = getPositions(); + if (stopWatch.hasPassed(delayProperty.value())) { positions.forEach(blockPos -> { new EventClickBlock(blockPos, Direction.UP, EventClickBlock.Mode.PRE).run(); NetworkHelper.INSTANCE.sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, blockPos, Direction.UP)); NetworkHelper.INSTANCE.sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, blockPos, Direction.UP)); + if (swingProperty.value()) { Wrapper.INSTANCE.getLocalPlayer().swingHand(Hand.MAIN_HAND); + } stopWatch.reset(); - }); + }); + } }, new PlayerPacketsFilter(EventPlayerPackets.Mode.PRE)); public ArrayList getPositions() { ArrayList blockPosList = new ArrayList<>(); - int dist = distanceProperty.value() + 2; - int minX = -dist; - int maxX = dist; - int minY = keepFloorProperty.value() ? 0 : -dist; - int maxY = dist; - int minZ = -dist; - int maxZ = dist; - for (int x = minX; x < maxX; x++) - for (int y = minY; y < maxY; y++) - for (int z = minZ; z < maxZ; z++) { + int dist = distanceProperty.value(); + int minY = keepFloorProperty.value() ? 0 : -dist; + for (int x = dist; x > -dist; x--) + for (int z = dist; z > -dist; z--) + for (int y = dist; y >= minY; y--){ BlockPos pos = Wrapper.INSTANCE.getPlayer().getBlockPos().add(x, y, z); Block block = WorldHelper.INSTANCE.getBlock(pos); if (!(block instanceof AirBlock || block instanceof FluidBlock)) { - double distance = ClientMathHelper.INSTANCE.getDistance(Vec3d.ofCenter(pos), Wrapper.INSTANCE.getPlayer().getPos().add(0, 1, 0)); + double distance = ClientMathHelper.INSTANCE.getDistance(Vec3d.ofCenter(pos), Wrapper.INSTANCE.getPlayer().getPos().add(0, 0, 0)); if (distance > distanceProperty.value()) continue; blockPosList.add(pos); - if (delayProperty.value() > 0) - break; } } blockPosList.sort(Comparator.comparing(o -> o.getSquaredDistance(Wrapper.INSTANCE.getPlayer().getPos()))); return blockPosList; - } + } } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/Radar.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/Radar.java deleted file mode 100644 index 0d926b290..000000000 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/Radar.java +++ /dev/null @@ -1,64 +0,0 @@ -package me.dustin.jex.feature.mod.impl.world; - -import me.dustin.jex.feature.mod.core.Category; -import me.dustin.jex.feature.property.Property; -import me.dustin.jex.helper.entity.EntityHelper; -import me.dustin.jex.helper.misc.Wrapper; -import net.minecraft.entity.Entity; -import net.minecraft.entity.ItemEntity; -import net.minecraft.entity.player.PlayerEntity; -import me.dustin.jex.feature.mod.core.Feature; - -public class Radar extends Feature { - public static Radar INSTANCE; - - public final Property waypointsProperty = new Property.PropertyBuilder(this.getClass()) - .name("Waypoints") - .value(true) - .build(); - public final Property playersProperty = new Property.PropertyBuilder(this.getClass()) - .name("Players") - .value(true) - .build(); - public final Property bossesProperty = new Property.PropertyBuilder(this.getClass()) - .name("Bosses") - .value(true) - .build(); - public final Property hostilesProperty = new Property.PropertyBuilder(this.getClass()) - .name("Hostiles") - .value(true) - .build(); - public final Property neutralsProperty = new Property.PropertyBuilder(this.getClass()) - .name("Neutrals") - .value(true) - .build(); - public final Property passivesProperty = new Property.PropertyBuilder(this.getClass()) - .name("Passives") - .value(true) - .build(); - public final Property itemsProperty = new Property.PropertyBuilder(this.getClass()) - .name("Items") - .value(true) - .build(); - - public Radar() { - super(Category.WORLD, "Draws a Radar on your HUD telling you where entities are"); - INSTANCE = this; - } - - public boolean isValid(Entity entity) { - if (entity instanceof PlayerEntity && entity != Wrapper.INSTANCE.getLocalPlayer()) - return playersProperty.value(); - if (entity instanceof ItemEntity) - return itemsProperty.value(); - if (EntityHelper.INSTANCE.isBossMob(entity)) - return bossesProperty.value(); - if (EntityHelper.INSTANCE.isNeutralMob(entity)) - return neutralsProperty.value(); - if (EntityHelper.INSTANCE.isHostileMob(entity)) - return hostilesProperty.value(); - if (EntityHelper.INSTANCE.isPassiveMob(entity)) - return passivesProperty.value(); - return false; - } -} diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/SlimeSpawnMarker.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/SlimeSpawnMarker.java index f1824561e..ad2ab6f71 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/SlimeSpawnMarker.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/SlimeSpawnMarker.java @@ -42,7 +42,6 @@ public class SlimeSpawnMarker extends Feature { .build(); public final Property chunkColorProperty = new Property.PropertyBuilder(this.getClass()) .name("Chunk Color") - .description("Color of a marked slime chunk") .value(new Color(0, 255, 38)) .build(); @@ -50,7 +49,7 @@ public class SlimeSpawnMarker extends Feature { private final File chunksFile = new File(ModFileHelper.INSTANCE.getJexDirectory(), "slimes.txt"); public SlimeSpawnMarker() { - super(Category.WORLD, "Notify you when a slime spawns and mark the chunk it spawned in as a slime chunk. Good for finding Slime Chunks on servers without the seed."); + super(Category.WORLD); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/SpawnProofing.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/SpawnProofing.java index 537dc431e..83a862bb0 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/SpawnProofing.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/SpawnProofing.java @@ -46,14 +46,13 @@ public class SpawnProofing extends Feature { .build(); public final Property useGlassProperty = new Property.PropertyBuilder(this.getClass()) .name("Use Glass") - .description("Allow glass to be used for spawn proofing.") .value(true) .build(); private final StopWatch stopWatch = new StopWatch(); public SpawnProofing() { - super(Category.WORLD, "Automatically place carpets/slabs to spawn proof around you"); + super(Category.WORLD); } @EventPointer @@ -62,8 +61,8 @@ public SpawnProofing() { return; stopWatch.reset(); for (int x = -rangeProperty.value(); x < rangeProperty.value(); x++) { - for (int y = -rangeProperty.value(); y < rangeProperty.value(); y++) { - for (int z = -rangeProperty.value(); z < rangeProperty.value(); z++) { + for (int z = -rangeProperty.value(); z < rangeProperty.value(); z++) { + for (int y = -rangeProperty.value(); y < rangeProperty.value(); y++) { BlockPos pos = Wrapper.INSTANCE.getLocalPlayer().getBlockPos().add(x, y, z); if (x == 0 && y == 0 && z == 0) continue; diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/SpawnSphere.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/SpawnSphere.java index 22d623cb3..01cb70565 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/SpawnSphere.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/SpawnSphere.java @@ -50,7 +50,7 @@ public class SpawnSphere extends Feature { private final ArrayList outerSphere = new ArrayList<>(); public SpawnSphere() { - super(Category.WORLD, "Show a 128 block radius sphere around an area to see all spots mobs could spawn in that radius."); + super(Category.WORLD); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/Timer.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/Timer.java index ea76a9b8c..7bd0d149d 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/Timer.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/Timer.java @@ -15,12 +15,19 @@ public class Timer extends Feature { .name("Speed") .value(2f) .min(0.1f) - .max(5) + .max(20f) .inc(0.1f) .build(); + public final Property constProperty = new Property.PropertyBuilder(this.getClass()) + .name("Constant") + .value(20f) + .min(1f) + .max(100f) + .inc(1f) + .build(); public Timer() { - super(Category.WORLD, "Speed up or slow down the game"); + super(Category.WORLD); } @EventPointer @@ -28,9 +35,9 @@ public Timer() { if (Wrapper.INSTANCE.getLocalPlayer() == null && Wrapper.INSTANCE.getWorld() == null) this.setState(false); if (getState()) { - event.timeScale = 1000 / (20.f * speedProperty.value()); + event.timeScale = 1000 / (constProperty.value() * speedProperty.value()); } else { - event.timeScale = 1000 / 20.f; + event.timeScale = 1000 / constProperty.value(); EventManager.unregister(this); } }); diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/Tunneller.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/Tunneller.java index e1a79ea61..e845821d7 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/Tunneller.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/Tunneller.java @@ -39,19 +39,23 @@ public class Tunneller extends Feature { .name("Width") .value(3) .min(1) - .max(5) + .max(6) .build(); public final Property heightProperty = new Property.PropertyBuilder(this.getClass()) .name("Height") .value(3) .min(1) - .max(5) + .max(6) + .build(); + public final Property swingProperty = new Property.PropertyBuilder(this.getClass()) + .name("Swing") + .value(true) .build(); private Direction direction; public Tunneller() { - super(Category.WORLD, "Automatically dig tunnels"); + super(Category.WORLD); } @EventPointer @@ -75,7 +79,9 @@ public Tunneller() { } } else if (WorldHelper.INSTANCE.isWaterlogged(liquidCheckSpot)){ Wrapper.INSTANCE.getClientPlayerInteractionManager().updateBlockBreakingProgress(liquidCheckSpot, Direction.UP); + if (swingProperty.value()) { Wrapper.INSTANCE.getPlayer().swingHand(Hand.MAIN_HAND); + } return; } } @@ -83,7 +89,9 @@ public Tunneller() { for (BlockPos blockPos : getBlocksInTunnel()) { if (WorldHelper.INSTANCE.getBlockState(blockPos).getOutlineShape(Wrapper.INSTANCE.getWorld(), blockPos) != VoxelShapes.empty()) { Wrapper.INSTANCE.getClientPlayerInteractionManager().updateBlockBreakingProgress(blockPos, Direction.UP); + if (swingProperty.value()) { Wrapper.INSTANCE.getPlayer().swingHand(Hand.MAIN_HAND); + } return; } } @@ -175,10 +183,10 @@ private ArrayList getBlocksInTunnel() { private Box getTunnelBox() { Box box = new Box(Wrapper.INSTANCE.getPlayer().getBlockX() - widthProperty.value() / 2.f, Wrapper.INSTANCE.getPlayer().getBlockY(), Wrapper.INSTANCE.getPlayer().getBlockZ() - widthProperty.value() / 2.f, Wrapper.INSTANCE.getPlayer().getBlockX() + widthProperty.value() / 2.f, Wrapper.INSTANCE.getPlayer().getBlockY() + heightProperty.value() - 1, Wrapper.INSTANCE.getPlayer().getBlockZ() + widthProperty.value() / 2.f); switch (direction) { - case NORTH -> box = box.offset(0, 0, -widthProperty.value() / 2.f); - case SOUTH -> box = box.offset(0, 0, widthProperty.value() / 2.f); - case EAST -> box = box.offset(widthProperty.value() / 2.f, 0, 0); - case WEST -> box = box.offset(-widthProperty.value() / 2.f, 0, 0); + case NORTH -> box = box.offset(0, 0, -widthProperty.value()); + case SOUTH -> box = box.offset(0, 0, widthProperty.value()); + case EAST -> box = box.offset(widthProperty.value(), 0, 0); + case WEST -> box = box.offset(-widthProperty.value(), 0, 0); } return box; } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/Waypoints.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/Waypoints.java index 942bf06e6..9fe026a77 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/Waypoints.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/Waypoints.java @@ -62,7 +62,7 @@ public class Waypoints extends Feature { private static final Map waypointPositions = Maps.newHashMap(); public Waypoints() { - super(Category.WORLD, "Display Waypoints to mark areas."); + super(Category.WORLD); } public static Waypoint get(String name, String server) { @@ -106,7 +106,7 @@ public static ArrayList getServers() { float y = waypoint.getY(); float z = waypoint.getZ(); float distance = ClientMathHelper.INSTANCE.getDistance2D(Wrapper.INSTANCE.getLocalPlayer().getPos(), new Vec3d(x, y, z)); - Vec3d renderPos = Render3DHelper.INSTANCE.getRenderPosition(new Vec3d(x, waypoint.getY(), z)); + Vec3d renderPos = Render3DHelper.INSTANCE.getRenderPosition(new Vec3d(x, y, z)); if (distance < 270) { Box box = new Box(renderPos.x - 0.2f, renderPos.y, renderPos.z - 0.2f, renderPos.x + 0.2f, (256 - waypoint.y), renderPos.z + 0.2f); Render3DHelper.INSTANCE.drawBox(((EventRender3D) event).getPoseStack(), box, waypoint.getColor()); @@ -115,7 +115,7 @@ public static ArrayList getServers() { x = (float) Wrapper.INSTANCE.getLocalPlayer().getX() + 250 * (float) Math.cos(Math.toRadians(yaw + 90)); z = (float) Wrapper.INSTANCE.getLocalPlayer().getZ() + 250 * (float) Math.sin(Math.toRadians(yaw + 90)); } - Vec3d screenPos = Render2DHelper.INSTANCE.to2D(new Vec3d(x, waypoint.getY() + Wrapper.INSTANCE.getLocalPlayer().getEyeHeight(EntityPose.STANDING), z), event.getPoseStack()); + Vec3d screenPos = Render2DHelper.INSTANCE.to2D(new Vec3d(x, y + Wrapper.INSTANCE.getLocalPlayer().getEyeHeight(EntityPose.STANDING), z), event.getPoseStack()); waypointPositions.put(waypoint, screenPos); } } @@ -140,7 +140,8 @@ public static ArrayList getServers() { } Vec3d pos = new Vec3d(x, y, z); Entity cameraEntity = Wrapper.INSTANCE.getMinecraft().getCameraEntity(); - assert cameraEntity != null; + if (cameraEntity == null) + return; Vec3d entityPos = Render3DHelper.INSTANCE.getRenderPosition(new Vec3d(pos.getX() + 0.5f, pos.getY(), pos.getZ() + 0.5f)); Color color1 = ColorHelper.INSTANCE.getColor(waypoint.getColor()); diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/WorldTime.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/WorldTime.java index 05a89a9df..35d360a62 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/WorldTime.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/WorldTime.java @@ -17,11 +17,13 @@ public class WorldTime extends Feature { public final Property timeProperty = new Property.PropertyBuilder(this.getClass()) .name("Time") .value(6000L) + .min(0) .max(24000) + .inc(240) .build(); public WorldTime() { - super(Category.WORLD, "Change the World time"); + super(Category.WORLD); } @EventPointer diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/XPBottleSpammer.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/XPBottleSpammer.java index cba5ea5a8..5f4cc2d95 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/XPBottleSpammer.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/XPBottleSpammer.java @@ -7,6 +7,7 @@ import me.dustin.jex.feature.mod.core.Feature; import me.dustin.jex.feature.property.Property; import me.dustin.jex.helper.math.vector.RotationVector; +import me.dustin.jex.helper.misc.StopWatch; import me.dustin.jex.helper.misc.KeyboardHelper; import me.dustin.jex.helper.misc.Wrapper; import me.dustin.jex.helper.player.InventoryHelper; @@ -15,12 +16,28 @@ import net.minecraft.util.Hand; public class XPBottleSpammer extends Feature { - + +public Property modeProperty = new Property.PropertyBuilder(this.getClass()) + .name("Mode") + .value(Mode.DELAY) + .build(); + public final Property delayProperty = new Property.PropertyBuilder(this.getClass()) + .name("Delay") + .value(1) + .min(0) + .max(1000) + .inc(10) + .parent(modeProperty) + .depends(parent -> parent.value() == Mode.DELAY) + .build(); public final Property speedProperty = new Property.PropertyBuilder(this.getClass()) .name("Speed") .value(1) .min(1) .max(5) + .inc(1) + .parent(modeProperty) + .depends(parent -> parent.value() == Mode.CYCLE) .build(); public final Property throwKeyProperty = new Property.PropertyBuilder(this.getClass()) .name("Throw Key") @@ -29,32 +46,49 @@ public class XPBottleSpammer extends Feature { .build(); public XPBottleSpammer() { - super(Category.WORLD, "Spam XP Bottles on a button press"); + super(Category.WORLD); } + + private final StopWatch stopWatch = new StopWatch(); - @EventPointer + @EventPointer private final EventListener eventPlayerPacketsEventListener = new EventListener<>(event -> { if (event.getMode() == EventPlayerPackets.Mode.PRE) { + int xpBottleHotbar = InventoryHelper.INSTANCE.getFromHotbar(Items.EXPERIENCE_BOTTLE); if (!KeyboardHelper.INSTANCE.isPressed(throwKeyProperty.value())) return; - int xpBottleHotbar = InventoryHelper.INSTANCE.getFromHotbar(Items.EXPERIENCE_BOTTLE); if (xpBottleHotbar == -1) { int xpBottleInv = InventoryHelper.INSTANCE.getFromInv(Items.EXPERIENCE_BOTTLE); if (xpBottleInv == -1) return; InventoryHelper.INSTANCE.windowClick(Wrapper.INSTANCE.getLocalPlayer().currentScreenHandler, xpBottleInv < 9 ? xpBottleInv + 36 : xpBottleInv, SlotActionType.SWAP, 8); } - event.setRotation(new RotationVector(Wrapper.INSTANCE.getLocalPlayer().getYaw(), 90)); - } else if (event.getMode() == EventPlayerPackets.Mode.POST) { + event.setRotation(new RotationVector(Wrapper.INSTANCE.getLocalPlayer().getYaw(), 90)); + } + else if (event.getMode() == EventPlayerPackets.Mode.POST) { if (!KeyboardHelper.INSTANCE.isPressed(throwKeyProperty.value())) return; int xpBottleHotbar = InventoryHelper.INSTANCE.getFromHotbar(Items.EXPERIENCE_BOTTLE); if (xpBottleHotbar == -1) return; InventoryHelper.INSTANCE.setSlot(xpBottleHotbar, false, true); - for (int i = 0; i < speedProperty.value(); i++) + switch (modeProperty.value()) { + case DELAY -> { + if (stopWatch.hasPassed(delayProperty.value())) { Wrapper.INSTANCE.getClientPlayerInteractionManager().interactItem(Wrapper.INSTANCE.getLocalPlayer(), Hand.MAIN_HAND); + } InventoryHelper.INSTANCE.setSlot(InventoryHelper.INSTANCE.getInventory().selectedSlot, false, true); + } + case CYCLE -> { + for (int i = 0; i < speedProperty.value(); i++) { + Wrapper.INSTANCE.getClientPlayerInteractionManager().interactItem(Wrapper.INSTANCE.getLocalPlayer(), Hand.MAIN_HAND); + } + InventoryHelper.INSTANCE.setSlot(InventoryHelper.INSTANCE.getInventory().selectedSlot, false, true); + } + } } }); + public enum Mode { + DELAY, CYCLE + } } diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/xray/Xray.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/xray/Xray.java index d044880c3..13a636b40 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/xray/Xray.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/xray/Xray.java @@ -33,7 +33,6 @@ public class Xray extends Feature { .build(); public Property alphaProperty = new Property.PropertyBuilder(this.getClass()) .name("Opacity") - .description("How opaque the blocks should be (less = less visible)") .value(50) .min(1) .max(100) @@ -43,13 +42,12 @@ public class Xray extends Feature { public Property playerXray = new Property.PropertyBuilder(this.getClass()) .name("Player Xray") - .description("See through the clothes of other players!") .value(false) .build(); private Mode lastMode; public Xray() { - super(Category.WORLD, "Have 200 iq while mining. Not cheating I promise.", GLFW.GLFW_KEY_X); + super(Category.WORLD, "", GLFW.GLFW_KEY_X); INSTANCE = this; new NormalXray(); new OpacityXray(); diff --git a/src/main/java/me/dustin/jex/feature/mod/impl/world/xray/impl/OpacityXray.java b/src/main/java/me/dustin/jex/feature/mod/impl/world/xray/impl/OpacityXray.java index 2a5902e1a..a118e4b0d 100644 --- a/src/main/java/me/dustin/jex/feature/mod/impl/world/xray/impl/OpacityXray.java +++ b/src/main/java/me/dustin/jex/feature/mod/impl/world/xray/impl/OpacityXray.java @@ -32,7 +32,6 @@ public void pass(Event event) { } } else if (event instanceof EventWorldRender eventWorldRender && eventWorldRender.getMode() == EventWorldRender.Mode.PRE) { ShaderHelper.INSTANCE.getOpacityXrayShader().setUpdateUniforms(() -> { - ShaderHelper.INSTANCE.getOpacityXrayShader().getUniform("Projection").setMatrix(eventWorldRender.getPosMatrix()); ShaderHelper.INSTANCE.getOpacityXrayShader().getUniform("ModelView").setMatrix(eventWorldRender.getPoseStack().peek().getPositionMatrix()); ShaderHelper.INSTANCE.getOpacityXrayShader().getUniform("Alpha").setFloat(Xray.INSTANCE.alphaProperty.value() / 100.f); }); diff --git a/src/main/java/me/dustin/jex/gui/proxy/ProxyScreen.java b/src/main/java/me/dustin/jex/gui/proxy/ProxyScreen.java index eed5a17b4..c192d7496 100644 --- a/src/main/java/me/dustin/jex/gui/proxy/ProxyScreen.java +++ b/src/main/java/me/dustin/jex/gui/proxy/ProxyScreen.java @@ -1,5 +1,6 @@ package me.dustin.jex.gui.proxy; +import net.minecraft.client.MinecraftClient; import com.google.common.net.HostAndPort; import me.dustin.jex.helper.misc.Wrapper; import me.dustin.jex.helper.network.ProxyHelper; @@ -12,6 +13,7 @@ import net.minecraft.client.network.ServerAddress; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; +import net.minecraft.util.Formatting; public class ProxyScreen extends Screen { @@ -36,7 +38,7 @@ protected void init() { String currentProxyString = ""; if (ProxyHelper.INSTANCE.isConnectedToProxy()) { ProxyHelper.ClientProxy proxy = ProxyHelper.INSTANCE.getProxy(); - currentProxyString = proxy.host() + ":" + proxy.port(); + currentProxyString = proxy.hostname() + ":" + proxy.port(); } this.addSelectableChild(proxyField = new TextFieldWidget(Wrapper.INSTANCE.getTextRenderer(), width / 2 - 100, height / 2 - 25, 200, 20, Text.of(currentProxyString))); this.addSelectableChild(usernameField = new TextFieldWidget(Wrapper.INSTANCE.getTextRenderer(), width / 2 - 100, height / 2, 200, 20, Text.of(""))); @@ -80,7 +82,7 @@ public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { FontHelper.INSTANCE.drawCenteredString(matrices, Text.translatable("jex.proxy.title"), width / 2.f, height / 2.f - 38, -1); if (ProxyHelper.INSTANCE.isConnectedToProxy()) { ProxyHelper.ClientProxy proxy = ProxyHelper.INSTANCE.getProxy(); - FontHelper.INSTANCE.drawCenteredString(matrices, Text.translatable("jex.proxy.current", proxy.host() + ":" + proxy.port()), width / 2.f, height / 2.f - 70, -1); + FontHelper.INSTANCE.drawCenteredString(matrices, Text.translatable("jex.proxy.current", proxy.hostname() + ":" + proxy.port()), width / 2.f, height / 2.f - 70, -1); } super.render(matrices, mouseX, mouseY, delta); } diff --git a/src/main/java/me/dustin/jex/helper/addon/cape/JexCapeFeatureRenderer.java b/src/main/java/me/dustin/jex/helper/addon/cape/JexCapeFeatureRenderer.java index c44be59b2..1c161949a 100644 --- a/src/main/java/me/dustin/jex/helper/addon/cape/JexCapeFeatureRenderer.java +++ b/src/main/java/me/dustin/jex/helper/addon/cape/JexCapeFeatureRenderer.java @@ -36,7 +36,11 @@ public void render(MatrixStack matrixStack, VertexConsumerProvider vertexConsume return; } AddonHelper.AddonResponse addonResponse = AddonHelper.INSTANCE.getResponse(uuid); + try { render(matrixStack, vertexConsumerProvider, light, playerEntity, tickDelta, CapeHelper.INSTANCE.getCape(uuid), addonResponse.enchantedcape()); + } + catch (NullPointerException e) { + } } public void render(MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int light, PlayerEntity playerEntity, float tickDelta, Identifier texture, boolean enchanted) { matrixStack.push(); diff --git a/src/main/java/me/dustin/jex/helper/addon/ears/JexEarsFeatureRenderer.java b/src/main/java/me/dustin/jex/helper/addon/ears/JexEarsFeatureRenderer.java index 04e24b15b..d89557fb5 100644 --- a/src/main/java/me/dustin/jex/helper/addon/ears/JexEarsFeatureRenderer.java +++ b/src/main/java/me/dustin/jex/helper/addon/ears/JexEarsFeatureRenderer.java @@ -26,7 +26,11 @@ public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, return; } AddonHelper.AddonResponse addonResponse = AddonHelper.INSTANCE.getResponse(uuid); + try { render(matrices, vertexConsumers, light, playerEntity, EarsHelper.INSTANCE.getEars(uuid), addonResponse.enchantedears()); + } + catch (NullPointerException e) { + } } public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, PlayerEntity playerEntity, Identifier texture, boolean enchanted) { @@ -38,4 +42,4 @@ public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, this.getContextModel().renderEars(matrices, vertexConsumer, light, LivingEntityRenderer.getOverlay(playerEntity, 0.0f)); matrices.pop(); } -} \ No newline at end of file +} diff --git a/src/main/java/me/dustin/jex/helper/entity/EntityHelper.java b/src/main/java/me/dustin/jex/helper/entity/EntityHelper.java index de7789e9c..a6ac14780 100644 --- a/src/main/java/me/dustin/jex/helper/entity/EntityHelper.java +++ b/src/main/java/me/dustin/jex/helper/entity/EntityHelper.java @@ -13,10 +13,7 @@ import net.minecraft.entity.boss.dragon.EnderDragonEntity; import net.minecraft.entity.mob.ElderGuardianEntity; import net.minecraft.entity.mob.EndermanEntity; -import net.minecraft.entity.mob.GhastEntity; import net.minecraft.entity.mob.HoglinEntity; -import net.minecraft.entity.mob.HostileEntity; -import net.minecraft.entity.mob.PhantomEntity; import net.minecraft.entity.mob.PiglinActivity; import net.minecraft.entity.mob.PiglinEntity; import net.minecraft.entity.mob.ShulkerEntity; @@ -24,23 +21,19 @@ import net.minecraft.entity.mob.WardenEntity; import net.minecraft.entity.mob.ZombifiedPiglinEntity; import net.minecraft.entity.passive.AbstractHorseEntity; -import net.minecraft.entity.passive.AllayEntity; import net.minecraft.entity.passive.AnimalEntity; -import net.minecraft.entity.passive.BatEntity; import net.minecraft.entity.passive.BeeEntity; -import net.minecraft.entity.passive.DolphinEntity; -import net.minecraft.entity.passive.FishEntity; import net.minecraft.entity.passive.HorseEntity; import net.minecraft.entity.passive.IronGolemEntity; -import net.minecraft.entity.passive.OcelotEntity; import net.minecraft.entity.passive.PandaEntity; import net.minecraft.entity.passive.PolarBearEntity; -import net.minecraft.entity.passive.SquidEntity; import net.minecraft.entity.passive.TameableEntity; -import net.minecraft.entity.passive.VillagerEntity; import net.minecraft.entity.passive.WanderingTraderEntity; import net.minecraft.entity.passive.WolfEntity; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.passive.PassiveEntity; +import net.minecraft.entity.mob.HostileEntity; +import net.minecraft.entity.mob.FlyingEntity; import net.minecraft.item.ArmorItem; import net.minecraft.item.ArmorMaterials; import net.minecraft.item.DyeableArmorItem; @@ -72,7 +65,7 @@ public boolean isAuraBlocking() { } public boolean isPassiveMob(Entity entity) { - return !(entity instanceof HoglinEntity) && doesPlayerOwn(entity) || entity instanceof AllayEntity || entity instanceof WanderingTraderEntity || entity instanceof FishEntity || entity instanceof DolphinEntity || entity instanceof SquidEntity || entity instanceof BatEntity || entity instanceof VillagerEntity || entity instanceof OcelotEntity || entity instanceof HorseEntity || entity instanceof AnimalEntity; + return !(entity instanceof HoglinEntity) && doesPlayerOwn(entity) || entity instanceof PassiveEntity; } public boolean isNeutralMob(Entity entity) { @@ -82,7 +75,7 @@ public boolean isNeutralMob(Entity entity) { public boolean isHostileMob(Entity entity) { if (isNeutralMob(entity)) return isAngryAtPlayer(entity); - return entity instanceof ShulkerEntity || entity instanceof HoglinEntity || entity instanceof GhastEntity || entity instanceof HostileEntity || entity instanceof SlimeEntity || entity instanceof EnderDragonEntity || entity instanceof PhantomEntity; + return entity instanceof HostileEntity || entity instanceof ShulkerEntity || entity instanceof HoglinEntity || entity instanceof SlimeEntity || entity instanceof FlyingEntity; } public boolean isBossMob(Entity entity) { diff --git a/src/main/java/me/dustin/jex/helper/misc/ChatHelper.java b/src/main/java/me/dustin/jex/helper/misc/ChatHelper.java index f7afe606d..c4f77b358 100644 --- a/src/main/java/me/dustin/jex/helper/misc/ChatHelper.java +++ b/src/main/java/me/dustin/jex/helper/misc/ChatHelper.java @@ -1,5 +1,6 @@ package me.dustin.jex.helper.misc; +import net.minecraft.network.message.DecoratedContents; import com.mojang.brigadier.ParseResults; import me.dustin.jex.JexClient; import me.dustin.jex.helper.network.NetworkHelper; diff --git a/src/main/java/me/dustin/jex/helper/misc/HWID.java b/src/main/java/me/dustin/jex/helper/misc/HWID.java index ab978bb5e..21fb1ff5f 100644 --- a/src/main/java/me/dustin/jex/helper/misc/HWID.java +++ b/src/main/java/me/dustin/jex/helper/misc/HWID.java @@ -13,9 +13,9 @@ private String getLocalHostName() { } catch (Exception e) { } return "UNKNOWN"; - } + } public String getHWID() { - return DigestUtils.md5Hex(System.getenv("COMPUTERNAME") + System.getenv(new StringBuilder("PROCESSOR_IDENTIFIER").append(getLocalHostName()).toString())); - } + return DigestUtils.md5Hex(System.getenv("COMPUTERNAME") + System.getenv("JAVA_HOME")); + } } diff --git a/src/main/java/me/dustin/jex/helper/network/ConnectedServerHelper.java b/src/main/java/me/dustin/jex/helper/network/ConnectedServerHelper.java index e57ddd263..296301604 100644 --- a/src/main/java/me/dustin/jex/helper/network/ConnectedServerHelper.java +++ b/src/main/java/me/dustin/jex/helper/network/ConnectedServerHelper.java @@ -11,7 +11,7 @@ public enum ConnectedServerHelper { @EventPointer private final EventListener eventConnectEventListener = new EventListener<>(event -> { - this.serverAddress = event.getServerAddress(); + this.serverAddress = event.getServerAddress(); }); public ServerAddress getServerAddress() { diff --git a/src/main/java/me/dustin/jex/helper/network/ProxyHelper.java b/src/main/java/me/dustin/jex/helper/network/ProxyHelper.java index 8d7a450a7..6ff1bfb17 100644 --- a/src/main/java/me/dustin/jex/helper/network/ProxyHelper.java +++ b/src/main/java/me/dustin/jex/helper/network/ProxyHelper.java @@ -16,10 +16,11 @@ import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen; import net.minecraft.network.*; import java.net.InetSocketAddress; +import com.google.gson.annotations.SerializedName; public enum ProxyHelper { INSTANCE; - private ClientProxy proxy; + public ClientProxy proxy; public void connectToProxy(SocksType type, String hostname, int port, String username, String password) { this.proxy = new ClientProxy(hostname, port, type, username, password); @@ -37,7 +38,7 @@ public void disconnectFromProxy() { proxy = null; } - public record ClientProxy(String host, int port, SocksType socksType, String authName, String authPass){} + public record ClientProxy(String hostname, int port, SocksType socksType, String username, String password){} public enum SocksType { FOUR, FIVE; @@ -47,7 +48,7 @@ public enum SocksType { private final EventListener eventDrawScreenEventListener = new EventListener<>(event -> { if (isConnectedToProxy()) { ProxyHelper.ClientProxy proxy = getProxy(); - String string = "Current Proxy: " + proxy.host() + ":" + proxy.port(); + String string = "Current Proxy: " + proxy.hostname() + " " + proxy.port(); FontHelper.INSTANCE.drawWithShadow(event.getPoseStack(), string, Render2DHelper.INSTANCE.getScaledWidth() - FontHelper.INSTANCE.getStringWidth(string) - 2, 22, ColorHelper.INSTANCE.getClientColor()); } }, new DrawScreenFilter(EventDrawScreen.Mode.POST, MultiplayerScreen.class)); @@ -58,9 +59,9 @@ protected void initChannel(Channel channel) { ProxyHelper.ClientProxy proxy = ProxyHelper.INSTANCE.getProxy(); if (ProxyHelper.INSTANCE.isConnectedToProxy()) { if (proxy.socksType() == ProxyHelper.SocksType.FIVE) { - channel.pipeline().addFirst(new Socks5ProxyHandler(new InetSocketAddress(proxy.host(), proxy.port()), proxy.authName(), proxy.authPass())); + channel.pipeline().addFirst(new Socks5ProxyHandler(new InetSocketAddress(proxy.hostname(), proxy.port()), proxy.username(), proxy.password())); } else { - channel.pipeline().addFirst(new Socks4ProxyHandler(new InetSocketAddress(proxy.host(), proxy.port()))); + channel.pipeline().addFirst(new Socks4ProxyHandler(new InetSocketAddress(proxy.hostname(), proxy.port()))); } } channel.config().setOption(ChannelOption.TCP_NODELAY, true); diff --git a/src/main/java/me/dustin/jex/helper/player/InventoryHelper.java b/src/main/java/me/dustin/jex/helper/player/InventoryHelper.java index e72d0a4a1..5e89b3a7c 100644 --- a/src/main/java/me/dustin/jex/helper/player/InventoryHelper.java +++ b/src/main/java/me/dustin/jex/helper/player/InventoryHelper.java @@ -169,7 +169,18 @@ public int getDepthStriderLevel() { } return 0; } - + + public int getSoulSpeedLevel() { + ItemStack boots = getInventory().getArmorStack(0); + if (boots.hasEnchantments()) { + Map equippedEnchants = EnchantmentHelper.get(boots); + if (equippedEnchants.containsKey(Enchantments.SOUL_SPEED)) { + return equippedEnchants.get(Enchantments.SOUL_SPEED); + } + } + return 0; + } + public boolean isContainerEmpty(ScreenHandler container) { int most = Wrapper.INSTANCE.getLocalPlayer().currentScreenHandler.slots.size() - 36; for (int i = 0; i < most; i++) { @@ -321,4 +332,4 @@ public float getBlockBreakingSpeed(BlockState block, int slot) { private final EventListener eventJoinWorldEventListener = new EventListener<>(event -> { lastSlotSent = -1; }); -} \ No newline at end of file +} diff --git a/src/main/java/me/dustin/jex/helper/player/PlayerHelper.java b/src/main/java/me/dustin/jex/helper/player/PlayerHelper.java index 6f25d2e6d..f64136706 100644 --- a/src/main/java/me/dustin/jex/helper/player/PlayerHelper.java +++ b/src/main/java/me/dustin/jex/helper/player/PlayerHelper.java @@ -388,6 +388,29 @@ public double getWaterSpeed(int depthStriderLevel, boolean accountSprint) { speed += (speed * 0.3); return speed; } + + public double getSoulSandSpeed() { + double speed = 2.50 / 20; + int ssLevel = InventoryHelper.INSTANCE.getSoulSpeedLevel(); + switch (ssLevel) { + case 1 -> speed = 6.06 / 20; + case 2 -> speed = 6.52 / 20; + case 3 -> speed = 6.97 / 20; + } + return speed; + } + + public double getSoulSandSpeed(int soulSpeedLevel, boolean accountSprint) { + double speed = switch (soulSpeedLevel) { + case 1 -> 6.06 / 20; + case 2 -> 6.52 / 20; + case 3 -> 6.97 / 20; + default -> 2.50 / 20; + }; + if ((Wrapper.INSTANCE.getLocalPlayer().isSprinting() || (Feature.getState(Sprint.class) && isMoving())) && accountSprint) + speed += (speed * 0.3); + return speed; + } public boolean isMoving() { if (Wrapper.INSTANCE.getLocalPlayer() == null) diff --git a/src/main/java/me/dustin/jex/helper/player/bot/PlayerBot.java b/src/main/java/me/dustin/jex/helper/player/bot/PlayerBot.java index 5aedf869a..b34f09f92 100644 --- a/src/main/java/me/dustin/jex/helper/player/bot/PlayerBot.java +++ b/src/main/java/me/dustin/jex/helper/player/bot/PlayerBot.java @@ -500,4 +500,4 @@ public static PlayerBot getBot(String name) { } return null; } -} \ No newline at end of file +} diff --git a/src/main/java/me/dustin/jex/helper/render/GifDecoder.java b/src/main/java/me/dustin/jex/helper/render/GifDecoder.java index fc4c9b5b3..2c4358dd8 100644 --- a/src/main/java/me/dustin/jex/helper/render/GifDecoder.java +++ b/src/main/java/me/dustin/jex/helper/render/GifDecoder.java @@ -253,8 +253,7 @@ public int read(BufferedInputStream is) { } try { is.close(); - } catch (IOException e) { - } + } catch (IOException e) {} return status; } @@ -277,6 +276,7 @@ public int read(InputStream is) { try { is.close(); } catch (IOException e) { + return 0; } return status; } @@ -463,6 +463,7 @@ protected int readBlock() { n += count; } } catch (IOException e) { + return 0; } if (n < blockSize) { @@ -480,6 +481,7 @@ protected int[] readColorTable(int ncolors) { try { n = in.read(c); } catch (IOException e) { + return null; } if (n < nbytes) { status = STATUS_FORMAT_ERROR; @@ -681,4 +683,4 @@ protected void skip() { readBlock(); } while ((blockSize > 0) && !err()); } -} \ No newline at end of file +} diff --git a/src/main/java/me/dustin/jex/helper/render/font/FontHelper.java b/src/main/java/me/dustin/jex/helper/render/font/FontHelper.java index ed98c7a88..1f038eb21 100644 --- a/src/main/java/me/dustin/jex/helper/render/font/FontHelper.java +++ b/src/main/java/me/dustin/jex/helper/render/font/FontHelper.java @@ -108,8 +108,7 @@ public boolean setClientFont(NahrFont font) { try { this.clientFont = font; return true; - } catch (Exception e) { - } + } catch (Exception e) {} return false; } diff --git a/src/main/java/me/dustin/jex/helper/render/font/NahrFont.java b/src/main/java/me/dustin/jex/helper/render/font/NahrFont.java index dbe4c9bb6..8234ac195 100644 --- a/src/main/java/me/dustin/jex/helper/render/font/NahrFont.java +++ b/src/main/java/me/dustin/jex/helper/render/font/NahrFont.java @@ -242,6 +242,7 @@ private final void drawer(MatrixStack matrixStack, String text, float x, float y drawChar(matrixStack, c, x, y, newColor); x += getStringWidth(Character.toString(c)) * 2.0F; } catch (ArrayIndexOutOfBoundsException indexException) { + return; } } BufferHelper.INSTANCE.drawWithShader(bufferBuilder, GameRenderer::getPositionTexColorShader); @@ -429,4 +430,4 @@ public enum FontType { NORMAL, SHADOW_THICK, SHADOW_THIN, OUTLINE_THIN, EMBOSS_TOP, EMBOSS_BOTTOM; } -} \ No newline at end of file +} diff --git a/src/main/java/me/dustin/jex/helper/render/shader/ShaderProgram.java b/src/main/java/me/dustin/jex/helper/render/shader/ShaderProgram.java index 61563eaa3..f164ac45a 100644 --- a/src/main/java/me/dustin/jex/helper/render/shader/ShaderProgram.java +++ b/src/main/java/me/dustin/jex/helper/render/shader/ShaderProgram.java @@ -2,6 +2,7 @@ import me.dustin.jex.JexClient; +import java.io.IOException; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; @@ -111,7 +112,8 @@ private int loadShader(String source, int type) { private String readShader(String fileLoc) { try { InputStream in = getClass().getResourceAsStream(fileLoc); - assert in != null; + if (in == null) + return "InputStream is null"; BufferedReader reader = new BufferedReader(new InputStreamReader(in)); StringBuilder sb = new StringBuilder(); String inString; diff --git a/src/main/java/me/dustin/jex/helper/world/wurstpathfinder/FlyPathProcessor.java b/src/main/java/me/dustin/jex/helper/world/wurstpathfinder/FlyPathProcessor.java index 3a76e34bc..0eabc25d4 100644 --- a/src/main/java/me/dustin/jex/helper/world/wurstpathfinder/FlyPathProcessor.java +++ b/src/main/java/me/dustin/jex/helper/world/wurstpathfinder/FlyPathProcessor.java @@ -107,7 +107,8 @@ public void process() } //fix for speed going way past the point if (Feature.getState(Fly.class)) { - if (!creativeFlying && Wrapper.INSTANCE.getPlayer().getPos().distanceTo(vecInPos) <= fly.speedProperty.value()) { + float cmp = (fly.hspeedProperty.value() + fly.vspeedProperty.value()) / 2; + if (!creativeFlying && Wrapper.INSTANCE.getPlayer().getPos().distanceTo(vecInPos) <= cmp) { PlayerHelper.INSTANCE.setVelocityX(Wrapper.INSTANCE.getPlayer(), 0); PlayerHelper.INSTANCE.setVelocityZ(Wrapper.INSTANCE.getPlayer(), 0); Wrapper.INSTANCE.getPlayer().setPosition(vecInPos.x, vecInPos.y, vecInPos.z); @@ -126,23 +127,24 @@ public void process() if(Wrapper.INSTANCE.getPlayer().horizontalCollision) if(posVec.y > nextBox.maxY) - PlayerHelper.INSTANCE.setVelocityY(Wrapper.INSTANCE.getPlayer(), fly.speedProperty.value()); + PlayerHelper.INSTANCE.setVelocityY(Wrapper.INSTANCE.getPlayer(), fly.vspeedProperty.value()); else if(posVec.y < nextBox.minY) - PlayerHelper.INSTANCE.setVelocityY(Wrapper.INSTANCE.getPlayer(), -fly.speedProperty.value()); + PlayerHelper.INSTANCE.setVelocityY(Wrapper.INSTANCE.getPlayer(), -fly.vspeedProperty.value()); // vertical movement }else if(y) { + float cmp = (fly.hspeedProperty.value() + fly.vspeedProperty.value()) / 2; PlayerHelper.INSTANCE.setVelocityY(Wrapper.INSTANCE.getPlayer(), 0); - if(!creativeFlying && Wrapper.INSTANCE.getPlayer().getPos().distanceTo(vecInPos) <= fly.speedProperty.value()) { + if(!creativeFlying && Wrapper.INSTANCE.getPlayer().getPos().distanceTo(vecInPos) <= cmp) { Wrapper.INSTANCE.getPlayer().setPosition(vecInPos.x, vecInPos.y, vecInPos.z); return; } if(posVec.y < nextBox.minY) - PlayerHelper.INSTANCE.setVelocityY(Wrapper.INSTANCE.getPlayer(), fly.speedProperty.value()); + PlayerHelper.INSTANCE.setVelocityY(Wrapper.INSTANCE.getPlayer(), fly.vspeedProperty.value()); else - PlayerHelper.INSTANCE.setVelocityY(Wrapper.INSTANCE.getPlayer(), -fly.speedProperty.value()); + PlayerHelper.INSTANCE.setVelocityY(Wrapper.INSTANCE.getPlayer(), -fly.vspeedProperty.value()); if(Wrapper.INSTANCE.getPlayer().verticalCollision) { float yaw = PlayerHelper.INSTANCE.rotateToVec(Wrapper.INSTANCE.getPlayer(), new Vec3d(nextPos.getX() + 0.5f, nextPos.getY(), nextPos.getZ() + 0.5f)).getYaw(); @@ -160,7 +162,7 @@ else if(posVec.y < nextBox.minY) public double moveSpeed() { if (Speed.INSTANCE.getState()) { - return Feature.get(Fly.class).speedProperty.value(); + return Feature.get(Fly.class).hspeedProperty.value(); } return PlayerHelper.INSTANCE.getBaseMoveSpeed(); } diff --git a/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinBackgroundRenderer.java b/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinBackgroundRenderer.java index 4f6782afd..d3982d5b5 100644 --- a/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinBackgroundRenderer.java +++ b/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinBackgroundRenderer.java @@ -11,7 +11,7 @@ @Mixin(BackgroundRenderer.class) public class MixinBackgroundRenderer { - @Inject(method = {"applyFog"}, at = @At("RETURN")) + @Inject(method = {"applyFog"}, at = @At("TAIL")) private static void applyFogModifyDensity(Camera camera, BackgroundRenderer.FogType fogType, float viewDistance, boolean thickFog, float f, CallbackInfo ci) { new EventSetupFog(camera.getSubmersionType()).run(); } diff --git a/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinBlock.java b/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinBlock.java index 546d61ad0..6b00021eb 100644 --- a/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinBlock.java +++ b/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinBlock.java @@ -15,13 +15,14 @@ @Mixin(Block.class) public class MixinBlock { - @Inject(method = "shouldDrawSide", at = @At("HEAD"), cancellable = true) + @Inject(method = "shouldDrawSide", at = @At("RETURN"), cancellable = true) private static void shouldDrawSide1(BlockState state, BlockView world, BlockPos pos, Direction side, BlockPos blockPos, CallbackInfoReturnable cir) { try { EventShouldDrawSide eventShouldDrawSide = new EventShouldDrawSide(WorldHelper.INSTANCE.getBlock(pos), side, pos).run(); if (eventShouldDrawSide.isCancelled()) cir.setReturnValue(eventShouldDrawSide.isShouldDrawSide()); } catch (Exception e) { + return; } } diff --git a/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinChatInputSuggestor.java b/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinChatInputSuggestor.java index c3a76e336..965fc83d5 100644 --- a/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinChatInputSuggestor.java +++ b/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinChatInputSuggestor.java @@ -24,7 +24,7 @@ public abstract class MixinChatInputSuggestor implements IChatInputSuggestor { @Shadow @Final private TextFieldWidget textField; @Shadow @Nullable private ChatInputSuggestor.SuggestionWindow window; - @Redirect(method = "refresh", at = @At(value = "INVOKE", target = "com/mojang/brigadier/StringReader.peek()C")) + @Redirect(method = "refresh", at = @At(value = "INVOKE", target = "com/mojang/brigadier/StringReader.peek()C", remap = false)) public char refresh(StringReader stringReader) { String string = this.textField.getText(); boolean isJex = string.startsWith(CommandManager.INSTANCE.getPrefix()); diff --git a/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinInGameHud.java b/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinInGameHud.java index c18be16a3..79726d073 100644 --- a/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinInGameHud.java +++ b/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinInGameHud.java @@ -22,7 +22,7 @@ public class MixinInGameHud { @Shadow @Final private static Identifier POWDER_SNOW_OUTLINE; - @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/option/KeyBinding;isPressed()Z")) + @Inject(method = "render", at = @At(value = "TAIL", target = "Lnet/minecraft/client/option/KeyBinding;isPressed()Z")) public void draw(MatrixStack matrixStack, float float_1, CallbackInfo ci) { try { new EventRender2D(matrixStack).run(); @@ -30,7 +30,7 @@ public void draw(MatrixStack matrixStack, float float_1, CallbackInfo ci) { e.printStackTrace(); } } - + @Inject(method = "renderCrosshair", at = @At("HEAD"), cancellable = true) public void renderCrosshair(MatrixStack matrixStack, CallbackInfo ci) { EventRenderCrosshair eventRenderCrosshair = new EventRenderCrosshair(matrixStack).run(); diff --git a/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinItemEntityRenderer.java b/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinItemEntityRenderer.java index 0433f8e0a..c47a097b3 100644 --- a/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinItemEntityRenderer.java +++ b/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinItemEntityRenderer.java @@ -13,7 +13,7 @@ @Mixin(ItemEntityRenderer.class) public class MixinItemEntityRenderer { - @Inject(method = "render(Lnet/minecraft/entity/ItemEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At(value = "INVOKE", target = "net/minecraft/util/math/random/Random.setSeed(J)V ")) + @Inject(method = "render(Lnet/minecraft/entity/ItemEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At(value = "HEAD", target = "net/minecraft/util/math/random/Random.setSeed(J)V ")) public void renderItemEntity(ItemEntity itemEntity, float f, float g, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, CallbackInfo ci) { new EventRotateItemEntity(itemEntity, matrixStack, g).run(); } diff --git a/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinMinecraft.java b/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinMinecraft.java index f7ec0fcdf..7786d0a3a 100644 --- a/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinMinecraft.java +++ b/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinMinecraft.java @@ -61,7 +61,7 @@ public void setRightClickDelayTimer(int timer) { public void tickPre(CallbackInfo ci) { new EventTick(EventTick.Mode.PRE).run(); } - @Inject(method = "tick", at = @At("RETURN")) + @Inject(method = "tick", at = @At("TAIL")) public void tickPost(CallbackInfo ci) { new EventTick(EventTick.Mode.POST).run(); } diff --git a/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinMultiplayerScreen.java b/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinMultiplayerScreen.java index 8ae27e80b..7ede6db13 100644 --- a/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinMultiplayerScreen.java +++ b/src/main/java/me/dustin/jex/load/mixin/minecraft/MixinMultiplayerScreen.java @@ -21,7 +21,7 @@ protected MixinMultiplayerScreen(Text title) { super(title); } - @Inject(method = "init", at = @At("RETURN")) + @Inject(method = "init", at = @At("TAIL")) public void init(CallbackInfo ci) { this.addDrawableChild(new ButtonWidget(2, 2, 75, 20, Text.of("Alt Manager"), button -> { Wrapper.INSTANCE.getMinecraft().setScreen(new AccountManagerScreen()); diff --git a/src/main/java/me/dustin/jex/load/mixin/sodium/MixinBlockOcclusionCache.java b/src/main/java/me/dustin/jex/load/mixin/sodium/MixinBlockOcclusionCache.java index ad0fb9120..ea0c814f8 100644 --- a/src/main/java/me/dustin/jex/load/mixin/sodium/MixinBlockOcclusionCache.java +++ b/src/main/java/me/dustin/jex/load/mixin/sodium/MixinBlockOcclusionCache.java @@ -16,7 +16,7 @@ @Mixin(BlockOcclusionCache.class) public class MixinBlockOcclusionCache { - @Inject(method = "shouldDrawSide", at = @At("HEAD"), cancellable = true, remap = false) + @Inject(method = "shouldDrawSide", at = @At("RETURN"), cancellable = true, remap = false) public void shouldDrawSide1(BlockState selfState, BlockView view, BlockPos pos, Direction facing, CallbackInfoReturnable cir) { EventShouldDrawSide eventShouldDrawSide = new EventShouldDrawSide(selfState.getBlock(), facing, pos).run(); if (eventShouldDrawSide.isCancelled()) { diff --git a/src/main/java/me/dustin/jex/load/mixin/sodium/MixinBlockRenderer.java b/src/main/java/me/dustin/jex/load/mixin/sodium/MixinBlockRenderer.java index 60c01db4f..0f23a777c 100644 --- a/src/main/java/me/dustin/jex/load/mixin/sodium/MixinBlockRenderer.java +++ b/src/main/java/me/dustin/jex/load/mixin/sodium/MixinBlockRenderer.java @@ -29,7 +29,7 @@ public void renderModel1(BlockRenderView world, BlockState state, BlockPos pos, cir.setReturnValue(false); } - @ModifyArg(method = "renderQuad", at = @At(value = "INVOKE", target = "me/jellysquid/mods/sodium/client/render/chunk/format/ModelVertexSink.writeVertex(Lnet/minecraft/util/math/Vec3i;FFFIFFII)V"), index = 4) + @Inject(method = "renderQuad", at = @At(value = "HEAD"), cancellable = true) public int getBlockColor(int color) { Color col = ColorHelper.INSTANCE.getColor(color); int a = col.getAlpha(); diff --git a/src/main/java/net/jodah/typetools/TypeResolver.java b/src/main/java/net/jodah/typetools/TypeResolver.java index 6dae35f61..09d7a5635 100644 --- a/src/main/java/net/jodah/typetools/TypeResolver.java +++ b/src/main/java/net/jodah/typetools/TypeResolver.java @@ -50,12 +50,11 @@ public final class TypeResolver { try { final Unsafe unsafe = AccessController.doPrivileged(new PrivilegedExceptionAction() { - @Override - public Unsafe run() throws Exception { - final Field f = Unsafe.class.getDeclaredField("theUnsafe"); + @Override + public Unsafe run() throws Exception { + final Field f = Unsafe.class.getDeclaredField("theUnsafe"); f.setAccessible(true); - - return (Unsafe) f.get(null); + return (Unsafe) f.get(null); } });