From 8e4286cdd94f88e56712baebb513ea71a5f8178c Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Tue, 27 Feb 2024 19:26:29 +0100 Subject: [PATCH] Merge v7.41 into 1.20.1 --- .github/pull_request_template.md | 9 +- .github/workflows/gradle.yml | 15 +- CONTRIBUTING.md | 37 +- README.md | 11 +- build.gradle | 11 + codestyle/formatter.xml | 762 +++++++++--------- gradle.properties | 2 +- src/main/java/net/wurstclient/Category.java | 2 +- src/main/java/net/wurstclient/DontBlock.java | 2 +- src/main/java/net/wurstclient/Feature.java | 2 +- .../java/net/wurstclient/FriendsList.java | 2 +- .../java/net/wurstclient/RotationFaker.java | 23 +- src/main/java/net/wurstclient/SearchTags.java | 2 +- .../java/net/wurstclient/TooManyHaxFile.java | 2 +- .../java/net/wurstclient/WurstClient.java | 4 +- .../net/wurstclient/WurstInitializer.java | 60 +- .../net/wurstclient/ai/FlyPathProcessor.java | 2 +- .../java/net/wurstclient/ai/PathFinder.java | 2 +- src/main/java/net/wurstclient/ai/PathPos.java | 2 +- .../net/wurstclient/ai/PathProcessor.java | 2 +- .../java/net/wurstclient/ai/PathQueue.java | 2 +- .../java/net/wurstclient/ai/PathRenderer.java | 2 +- .../net/wurstclient/ai/WalkPathProcessor.java | 2 +- .../java/net/wurstclient/altmanager/Alt.java | 2 +- .../wurstclient/altmanager/AltManager.java | 2 +- .../wurstclient/altmanager/AltRenderer.java | 2 +- .../net/wurstclient/altmanager/AltsFile.java | 2 +- .../wurstclient/altmanager/CrackedAlt.java | 2 +- .../wurstclient/altmanager/Encryption.java | 2 +- .../altmanager/ExportAltsFileChooser.java | 2 +- .../altmanager/ImportAltsFileChooser.java | 2 +- .../altmanager/LoginException.java | 2 +- .../wurstclient/altmanager/LoginManager.java | 2 +- .../altmanager/MicrosoftLoginManager.java | 2 +- .../altmanager/MinecraftProfile.java | 2 +- .../net/wurstclient/altmanager/MojangAlt.java | 2 +- .../wurstclient/altmanager/NameGenerator.java | 2 +- .../wurstclient/altmanager/XBoxLiveToken.java | 2 +- .../altmanager/screens/AddAltScreen.java | 2 +- .../altmanager/screens/AltEditorScreen.java | 2 +- .../altmanager/screens/AltManagerScreen.java | 2 +- .../altmanager/screens/DirectLoginScreen.java | 2 +- .../altmanager/screens/EditAltScreen.java | 2 +- .../analytics/AnalyticsConfigFile.java | 2 +- .../wurstclient/analytics/WurstAnalytics.java | 2 +- .../analytics/WurstAnalyticsConfigData.java | 2 +- .../analytics/WurstAnalyticsTracker.java | 2 +- .../net/wurstclient/clickgui/ClickGui.java | 2 +- .../wurstclient/clickgui/ComboBoxPopup.java | 2 +- .../net/wurstclient/clickgui/Component.java | 2 +- .../java/net/wurstclient/clickgui/Popup.java | 2 +- .../wurstclient/clickgui/SettingsWindow.java | 2 +- .../java/net/wurstclient/clickgui/Window.java | 2 +- .../components/AbstractListEditButton.java | 2 +- .../clickgui/components/BlockComponent.java | 2 +- .../components/BlockListEditButton.java | 2 +- .../components/BookOffersEditButton.java | 2 +- .../components/CheckboxComponent.java | 2 +- .../clickgui/components/ColorComponent.java | 2 +- .../components/ComboBoxComponent.java | 2 +- .../clickgui/components/FeatureButton.java | 2 +- .../clickgui/components/FileComponent.java | 2 +- .../components/ItemListEditButton.java | 2 +- .../clickgui/components/RadarComponent.java | 2 +- .../clickgui/components/SliderComponent.java | 2 +- .../components/TextFieldEditButton.java | 2 +- .../clickgui/screens/AddBookOfferScreen.java | 2 +- .../clickgui/screens/ClickGuiScreen.java | 2 +- .../clickgui/screens/EditBlockListScreen.java | 2 +- .../clickgui/screens/EditBlockScreen.java | 2 +- .../clickgui/screens/EditBookOfferScreen.java | 2 +- .../screens/EditBookOffersScreen.java | 2 +- .../clickgui/screens/EditColorScreen.java | 2 +- .../clickgui/screens/EditItemListScreen.java | 2 +- .../clickgui/screens/EditSliderScreen.java | 2 +- .../clickgui/screens/EditTextFieldScreen.java | 2 +- .../clickgui/screens/SelectFileScreen.java | 2 +- .../net/wurstclient/command/CmdError.java | 2 +- .../net/wurstclient/command/CmdException.java | 2 +- .../java/net/wurstclient/command/CmdList.java | 2 +- .../net/wurstclient/command/CmdProcessor.java | 2 +- .../wurstclient/command/CmdSyntaxError.java | 2 +- .../java/net/wurstclient/command/Command.java | 2 +- .../net/wurstclient/commands/AddAltCmd.java | 2 +- .../net/wurstclient/commands/AnnoyCmd.java | 2 +- .../net/wurstclient/commands/AuthorCmd.java | 2 +- .../net/wurstclient/commands/BindCmd.java | 2 +- .../net/wurstclient/commands/BindsCmd.java | 2 +- .../net/wurstclient/commands/BlinkCmd.java | 2 +- .../wurstclient/commands/BlockListCmd.java | 2 +- .../net/wurstclient/commands/ClearCmd.java | 2 +- .../net/wurstclient/commands/CopyItemCmd.java | 2 +- .../net/wurstclient/commands/DamageCmd.java | 2 +- .../java/net/wurstclient/commands/DigCmd.java | 2 +- .../net/wurstclient/commands/DropCmd.java | 2 +- .../wurstclient/commands/EnabledHaxCmd.java | 2 +- .../net/wurstclient/commands/EnchantCmd.java | 178 ++-- .../net/wurstclient/commands/ExcavateCmd.java | 2 +- .../net/wurstclient/commands/FeaturesCmd.java | 2 +- .../net/wurstclient/commands/FollowCmd.java | 2 +- .../net/wurstclient/commands/FriendsCmd.java | 2 +- .../net/wurstclient/commands/GetPosCmd.java | 2 +- .../net/wurstclient/commands/GiveCmd.java | 2 +- .../java/net/wurstclient/commands/GmCmd.java | 2 +- .../net/wurstclient/commands/GoToCmd.java | 2 +- .../net/wurstclient/commands/HelpCmd.java | 2 +- .../net/wurstclient/commands/InvseeCmd.java | 2 +- .../java/net/wurstclient/commands/IpCmd.java | 2 +- .../net/wurstclient/commands/ItemListCmd.java | 2 +- .../net/wurstclient/commands/JumpCmd.java | 2 +- .../net/wurstclient/commands/LeaveCmd.java | 2 +- .../net/wurstclient/commands/ModifyCmd.java | 2 +- .../net/wurstclient/commands/PathCmd.java | 2 +- .../net/wurstclient/commands/PotionCmd.java | 2 +- .../net/wurstclient/commands/ProtectCmd.java | 2 +- .../net/wurstclient/commands/RenameCmd.java | 2 +- .../net/wurstclient/commands/RepairCmd.java | 2 +- .../java/net/wurstclient/commands/RvCmd.java | 2 +- .../java/net/wurstclient/commands/SayCmd.java | 2 +- .../net/wurstclient/commands/SetBlockCmd.java | 2 +- .../wurstclient/commands/SetCheckboxCmd.java | 2 +- .../net/wurstclient/commands/SetColorCmd.java | 2 +- .../net/wurstclient/commands/SetModeCmd.java | 2 +- .../wurstclient/commands/SetSliderCmd.java | 2 +- .../net/wurstclient/commands/SettingsCmd.java | 2 +- .../java/net/wurstclient/commands/SvCmd.java | 2 +- .../java/net/wurstclient/commands/TCmd.java | 2 +- .../net/wurstclient/commands/TacoCmd.java | 2 +- .../wurstclient/commands/TooManyHaxCmd.java | 2 +- .../java/net/wurstclient/commands/TpCmd.java | 2 +- .../net/wurstclient/commands/UnbindCmd.java | 2 +- .../net/wurstclient/commands/VClipCmd.java | 2 +- .../net/wurstclient/commands/ViewNbtCmd.java | 2 +- .../net/wurstclient/commands/XrayCmd.java | 2 +- .../wurstclient/event/CancellableEvent.java | 2 +- .../java/net/wurstclient/event/Event.java | 2 +- .../net/wurstclient/event/EventManager.java | 2 +- .../java/net/wurstclient/event/Listener.java | 2 +- .../events/AirStrafingSpeedListener.java | 2 +- .../events/BlockBreakingProgressListener.java | 2 +- .../events/CactusCollisionShapeListener.java | 2 +- .../CameraTransformViewBobbingListener.java | 2 +- .../wurstclient/events/ChatInputListener.java | 2 +- .../events/ChatOutputListener.java | 2 +- .../ConnectionPacketOutputListener.java | 2 +- .../net/wurstclient/events/DeathListener.java | 2 +- .../wurstclient/events/GUIRenderListener.java | 2 +- ...GetAmbientOcclusionLightLevelListener.java | 2 +- .../events/HitResultRayTraceListener.java | 2 +- .../events/IsNormalCubeListener.java | 2 +- .../events/IsPlayerInLavaListener.java | 2 +- .../events/IsPlayerInWaterListener.java | 2 +- .../wurstclient/events/KeyPressListener.java | 2 +- .../wurstclient/events/KnockbackListener.java | 2 +- .../wurstclient/events/LeftClickListener.java | 2 +- .../events/MouseScrollListener.java | 2 +- .../events/PacketInputListener.java | 2 +- .../events/PacketOutputListener.java | 2 +- .../events/PlayerMoveListener.java | 2 +- .../events/PostMotionListener.java | 2 +- .../wurstclient/events/PreMotionListener.java | 2 +- .../events/RenderBlockEntityListener.java | 2 +- .../wurstclient/events/RenderListener.java | 2 +- .../events/RightClickListener.java | 2 +- .../events/SetOpaqueCubeListener.java | 2 +- .../events/ShouldDrawSideListener.java | 2 +- .../events/StopUsingItemListener.java | 2 +- .../wurstclient/events/UpdateListener.java | 2 +- .../VelocityFromEntityCollisionListener.java | 2 +- .../events/VelocityFromFluidListener.java | 2 +- .../net/wurstclient/hack/DontSaveState.java | 2 +- .../wurstclient/hack/EnabledHacksFile.java | 2 +- src/main/java/net/wurstclient/hack/Hack.java | 2 +- .../java/net/wurstclient/hack/HackList.java | 3 +- .../net/wurstclient/hacks/AimAssistHack.java | 11 +- .../net/wurstclient/hacks/AirPlaceHack.java | 2 +- .../net/wurstclient/hacks/AnchorAuraHack.java | 2 +- .../net/wurstclient/hacks/AntiAfkHack.java | 4 +- .../net/wurstclient/hacks/AntiBlindHack.java | 2 +- .../net/wurstclient/hacks/AntiCactusHack.java | 2 +- .../wurstclient/hacks/AntiEntityPushHack.java | 2 +- .../net/wurstclient/hacks/AntiHungerHack.java | 2 +- .../wurstclient/hacks/AntiKnockbackHack.java | 2 +- .../net/wurstclient/hacks/AntiSpamHack.java | 2 +- .../wurstclient/hacks/AntiWaterPushHack.java | 2 +- .../net/wurstclient/hacks/AntiWobbleHack.java | 2 +- .../net/wurstclient/hacks/ArrowDmgHack.java | 2 +- .../net/wurstclient/hacks/AutoArmorHack.java | 2 +- .../net/wurstclient/hacks/AutoBuildHack.java | 10 +- .../wurstclient/hacks/AutoCompleteHack.java | 2 +- .../net/wurstclient/hacks/AutoDropHack.java | 2 +- .../net/wurstclient/hacks/AutoEatHack.java | 2 +- .../net/wurstclient/hacks/AutoFarmHack.java | 742 ++++++++--------- .../net/wurstclient/hacks/AutoFishHack.java | 85 +- .../net/wurstclient/hacks/AutoLeaveHack.java | 2 +- .../wurstclient/hacks/AutoLibrarianHack.java | 2 +- .../net/wurstclient/hacks/AutoMineHack.java | 2 +- .../net/wurstclient/hacks/AutoPotionHack.java | 13 +- .../wurstclient/hacks/AutoReconnectHack.java | 2 +- .../wurstclient/hacks/AutoRespawnHack.java | 2 +- .../net/wurstclient/hacks/AutoSignHack.java | 2 +- .../net/wurstclient/hacks/AutoSoupHack.java | 2 +- .../net/wurstclient/hacks/AutoSprintHack.java | 22 +- .../net/wurstclient/hacks/AutoStealHack.java | 4 +- .../net/wurstclient/hacks/AutoSwimHack.java | 2 +- .../net/wurstclient/hacks/AutoSwitchHack.java | 2 +- .../net/wurstclient/hacks/AutoSwordHack.java | 2 +- .../net/wurstclient/hacks/AutoToolHack.java | 2 +- .../net/wurstclient/hacks/AutoTotemHack.java | 2 +- .../net/wurstclient/hacks/AutoWalkHack.java | 2 +- .../net/wurstclient/hacks/BarrierEspHack.java | 2 +- .../net/wurstclient/hacks/BaseFinderHack.java | 2 +- .../java/net/wurstclient/hacks/BlinkHack.java | 2 +- .../net/wurstclient/hacks/BoatFlyHack.java | 2 +- .../wurstclient/hacks/BonemealAuraHack.java | 2 +- .../net/wurstclient/hacks/BowAimbotHack.java | 2 +- .../wurstclient/hacks/BuildRandomHack.java | 2 +- .../net/wurstclient/hacks/BunnyHopHack.java | 2 +- .../wurstclient/hacks/CameraDistanceHack.java | 70 +- .../wurstclient/hacks/CameraNoClipHack.java | 2 +- .../net/wurstclient/hacks/CaveFinderHack.java | 2 +- .../wurstclient/hacks/ChatTranslatorHack.java | 2 +- .../net/wurstclient/hacks/ChestEspHack.java | 2 +- .../net/wurstclient/hacks/ClickAuraHack.java | 12 +- .../net/wurstclient/hacks/ClickGuiHack.java | 2 +- .../net/wurstclient/hacks/CrashChestHack.java | 2 +- .../wurstclient/hacks/CreativeFlightHack.java | 2 +- .../net/wurstclient/hacks/CriticalsHack.java | 2 +- .../wurstclient/hacks/CrystalAuraHack.java | 2 +- .../java/net/wurstclient/hacks/DerpHack.java | 8 +- .../net/wurstclient/hacks/DolphinHack.java | 2 +- .../net/wurstclient/hacks/ExcavatorHack.java | 2 +- .../wurstclient/hacks/ExtraElytraHack.java | 2 +- .../net/wurstclient/hacks/FancyChatHack.java | 2 +- .../net/wurstclient/hacks/FastBreakHack.java | 2 +- .../net/wurstclient/hacks/FastLadderHack.java | 2 +- .../net/wurstclient/hacks/FastPlaceHack.java | 2 +- .../net/wurstclient/hacks/FeedAuraHack.java | 2 +- .../net/wurstclient/hacks/FightBotHack.java | 2 +- .../java/net/wurstclient/hacks/FishHack.java | 2 +- .../net/wurstclient/hacks/FlightHack.java | 2 +- .../net/wurstclient/hacks/FollowHack.java | 2 +- .../net/wurstclient/hacks/ForceOpHack.java | 2 +- .../net/wurstclient/hacks/FreecamHack.java | 2 +- .../net/wurstclient/hacks/FullbrightHack.java | 2 +- .../java/net/wurstclient/hacks/GlideHack.java | 2 +- .../net/wurstclient/hacks/HandNoClipHack.java | 2 +- .../net/wurstclient/hacks/HeadRollHack.java | 8 +- .../net/wurstclient/hacks/HealthTagsHack.java | 2 +- .../net/wurstclient/hacks/HighJumpHack.java | 2 +- .../net/wurstclient/hacks/InfiniChatHack.java | 2 +- .../wurstclient/hacks/InstantBunkerHack.java | 2 +- .../net/wurstclient/hacks/InvWalkHack.java | 2 +- .../net/wurstclient/hacks/ItemEspHack.java | 2 +- .../wurstclient/hacks/ItemGeneratorHack.java | 2 +- .../java/net/wurstclient/hacks/JesusHack.java | 2 +- .../net/wurstclient/hacks/JetpackHack.java | 2 +- .../net/wurstclient/hacks/KaboomHack.java | 2 +- .../net/wurstclient/hacks/KillPotionHack.java | 2 +- .../net/wurstclient/hacks/KillauraHack.java | 2 +- .../wurstclient/hacks/KillauraLegitHack.java | 8 +- .../net/wurstclient/hacks/LiquidsHack.java | 2 +- .../java/net/wurstclient/hacks/LsdHack.java | 2 +- .../net/wurstclient/hacks/MassTpaHack.java | 2 +- .../net/wurstclient/hacks/MileyCyrusHack.java | 2 +- .../net/wurstclient/hacks/MobEspHack.java | 2 +- .../wurstclient/hacks/MobSpawnEspHack.java | 2 +- .../net/wurstclient/hacks/MultiAuraHack.java | 13 +- .../wurstclient/hacks/NameProtectHack.java | 2 +- .../net/wurstclient/hacks/NameTagsHack.java | 46 +- .../net/wurstclient/hacks/NavigatorHack.java | 2 +- .../net/wurstclient/hacks/NewChunksHack.java | 2 +- .../wurstclient/hacks/NoBackgroundHack.java | 2 +- .../net/wurstclient/hacks/NoClipHack.java | 2 +- .../net/wurstclient/hacks/NoFallHack.java | 2 +- .../wurstclient/hacks/NoFireOverlayHack.java | 2 +- .../java/net/wurstclient/hacks/NoFogHack.java | 24 + .../net/wurstclient/hacks/NoHurtcamHack.java | 2 +- .../wurstclient/hacks/NoLevitationHack.java | 48 +- .../net/wurstclient/hacks/NoOverlayHack.java | 2 +- .../net/wurstclient/hacks/NoPumpkinHack.java | 2 +- .../hacks/NoShieldOverlayHack.java | 2 +- .../net/wurstclient/hacks/NoSlowdownHack.java | 2 +- .../net/wurstclient/hacks/NoWeatherHack.java | 2 +- .../java/net/wurstclient/hacks/NoWebHack.java | 2 +- .../java/net/wurstclient/hacks/NukerHack.java | 2 +- .../net/wurstclient/hacks/NukerLegitHack.java | 2 +- .../wurstclient/hacks/OpenWaterEspHack.java | 2 +- .../net/wurstclient/hacks/OverlayHack.java | 2 +- .../java/net/wurstclient/hacks/PanicHack.java | 2 +- .../net/wurstclient/hacks/ParkourHack.java | 14 +- .../net/wurstclient/hacks/PlayerEspHack.java | 2 +- .../net/wurstclient/hacks/PortalEspHack.java | 392 ++++----- .../net/wurstclient/hacks/PortalGuiHack.java | 2 +- .../wurstclient/hacks/PotionSaverHack.java | 2 +- .../wurstclient/hacks/ProphuntEspHack.java | 2 +- .../net/wurstclient/hacks/ProtectHack.java | 2 +- .../java/net/wurstclient/hacks/RadarHack.java | 2 +- .../net/wurstclient/hacks/RainbowUiHack.java | 2 +- .../java/net/wurstclient/hacks/ReachHack.java | 2 +- .../net/wurstclient/hacks/RemoteViewHack.java | 2 +- .../net/wurstclient/hacks/RestockHack.java | 2 +- .../net/wurstclient/hacks/SafeWalkHack.java | 2 +- .../wurstclient/hacks/ScaffoldWalkHack.java | 14 +- .../net/wurstclient/hacks/SearchHack.java | 2 +- .../net/wurstclient/hacks/SkinDerpHack.java | 2 +- .../java/net/wurstclient/hacks/SneakHack.java | 2 +- .../net/wurstclient/hacks/SnowShoeHack.java | 2 +- .../net/wurstclient/hacks/SpeedHackHack.java | 2 +- .../net/wurstclient/hacks/SpeedNukerHack.java | 2 +- .../net/wurstclient/hacks/SpiderHack.java | 2 +- .../java/net/wurstclient/hacks/StepHack.java | 2 +- .../java/net/wurstclient/hacks/ThrowHack.java | 2 +- .../net/wurstclient/hacks/TillauraHack.java | 2 +- .../java/net/wurstclient/hacks/TimerHack.java | 2 +- .../java/net/wurstclient/hacks/TiredHack.java | 9 +- .../net/wurstclient/hacks/TooManyHaxHack.java | 2 +- .../net/wurstclient/hacks/TpAuraHack.java | 11 +- .../wurstclient/hacks/TrajectoriesHack.java | 15 +- .../net/wurstclient/hacks/TreeBotHack.java | 2 +- .../net/wurstclient/hacks/TriggerBotHack.java | 2 +- .../wurstclient/hacks/TrollPotionHack.java | 2 +- .../net/wurstclient/hacks/TrueSightHack.java | 2 +- .../net/wurstclient/hacks/TunnellerHack.java | 2 +- .../java/net/wurstclient/hacks/XRayHack.java | 2 +- .../autocomplete/ApiProviderSetting.java | 2 +- .../hacks/autocomplete/MessageCompleter.java | 2 +- .../hacks/autocomplete/ModelSettings.java | 2 +- .../OobaboogaMessageCompleter.java | 2 +- .../autocomplete/OpenAiMessageCompleter.java | 2 +- .../hacks/autocomplete/SuggestionHandler.java | 2 +- .../hacks/autofarm/AutoFarmRenderer.java | 356 ++++---- .../hacks/autofish/AutoFishDebugDraw.java | 92 ++- .../hacks/autofish/AutoFishRodSelector.java | 55 +- .../hacks/autofish/FishingSpot.java | 20 + .../hacks/autofish/FishingSpotManager.java | 273 +++++++ .../hacks/autofish/PositionAndRotation.java | 33 + .../autofish/ShallowWaterWarningCheckbox.java | 5 +- .../hacks/autolibrarian/BookOffer.java | 2 +- .../autolibrarian/UpdateBooksSetting.java | 2 +- .../hacks/chestesp/ChestEspBlockGroup.java | 2 +- .../hacks/chestesp/ChestEspEntityGroup.java | 2 +- .../hacks/chestesp/ChestEspGroup.java | 2 +- .../hacks/chestesp/ChestEspRenderer.java | 2 +- .../newchunks/NewChunksChunkRenderer.java | 2 +- .../newchunks/NewChunksOutlineRenderer.java | 2 +- .../newchunks/NewChunksReasonsRenderer.java | 2 +- .../hacks/newchunks/NewChunksRenderer.java | 2 +- .../hacks/newchunks/NewChunksShowSetting.java | 2 +- .../newchunks/NewChunksSquareRenderer.java | 2 +- .../newchunks/NewChunksStyleSetting.java | 2 +- .../hacks/portalesp/PortalEspBlockGroup.java | 172 ++-- .../hacks/portalesp/PortalEspRenderer.java | 248 +++--- .../net/wurstclient/hacks/treebot/Tree.java | 2 +- .../hacks/treebot/TreeBotUtils.java | 2 +- .../java/net/wurstclient/hud/HackListHUD.java | 2 +- .../java/net/wurstclient/hud/IngameHUD.java | 2 +- src/main/java/net/wurstclient/hud/TabGui.java | 2 +- .../java/net/wurstclient/hud/WurstLogo.java | 2 +- .../net/wurstclient/keybinds/Keybind.java | 2 +- .../net/wurstclient/keybinds/KeybindList.java | 3 +- .../keybinds/KeybindProcessor.java | 2 +- .../wurstclient/keybinds/KeybindsFile.java | 2 +- .../wurstclient/keybinds/PossibleKeybind.java | 2 +- .../mixin/AbstractBlockStateMixin.java | 224 ++--- .../mixin/AbstractSignEditScreenMixin.java | 122 +-- .../mixin/AllowedAddressResolverMixin.java | 120 +-- .../mixin/BackgroundRendererMixin.java | 93 ++- .../mixin/BasicBakedModelMixin.java | 96 +-- .../BlockEntityRenderDispatcherMixin.java | 76 +- .../net/wurstclient/mixin/BlockMixin.java | 118 +-- .../wurstclient/mixin/CactusBlockMixin.java | 96 +-- .../net/wurstclient/mixin/CameraMixin.java | 108 +-- .../net/wurstclient/mixin/ChatHudMixin.java | 162 ++-- .../mixin/ChatInputSuggestorMixin.java | 108 +-- .../wurstclient/mixin/ChatScreenMixin.java | 158 ++-- .../ChunkOcclusionGraphBuilderMixin.java | 68 +- .../mixin/ClientConnectionMixin.java | 170 ++-- .../mixin/ClientPlayNetworkHandlerMixin.java | 208 ++--- .../mixin/ClientPlayerEntityMixin.java | 598 +++++++------- .../ClientPlayerInteractionManagerMixin.java | 330 ++++---- .../wurstclient/mixin/ClientWorldMixin.java | 2 +- .../mixin/CreativeInventoryScreenMixin.java | 86 +- .../wurstclient/mixin/DeathScreenMixin.java | 112 +-- .../mixin/DirectConnectScreenMixin.java | 82 +- .../mixin/DisconnectedRealmsScreenMixin.java | 100 +-- .../mixin/DisconnectedScreenMixin.java | 268 +++--- .../net/wurstclient/mixin/EntityMixin.java | 154 ++-- .../mixin/EntityRendererMixin.java | 232 +++--- .../wurstclient/mixin/FluidRendererMixin.java | 88 +- .../mixin/GameMenuScreenMixin.java | 276 +++---- .../wurstclient/mixin/GameRendererMixin.java | 304 +++---- .../mixin/GenericContainerScreenMixin.java | 244 +++--- .../mixin/HeldItemRendererMixin.java | 2 +- .../mixin/InGameOverlayRendererMixin.java | 86 +- .../net/wurstclient/mixin/IngameHudMixin.java | 104 +-- .../wurstclient/mixin/KeyBindingMixin.java | 80 +- .../net/wurstclient/mixin/KeyboardMixin.java | 56 +- .../mixin/LanguageManagerMixin.java | 84 +- .../mixin/LivingEntityRendererMixin.java | 111 +-- .../mixin/MinecraftClientMixin.java | 400 ++++----- .../mixin/MobEntityRendererMixin.java | 38 + .../net/wurstclient/mixin/MouseMixin.java | 56 +- .../mixin/MultiplayerScreenMixin.java | 200 ++--- .../wurstclient/mixin/PackScreenMixin.java | 74 +- .../mixin/PlayerInventoryMixin.java | 56 +- .../mixin/PlayerSkinProviderMixin.java | 326 ++++---- .../mixin/PowderSnowBlockMixin.java | 84 +- .../mixin/RenderTickCounterMixin.java | 72 +- .../net/wurstclient/mixin/ScreenMixin.java | 2 +- .../mixin/ShulkerBoxScreenMixin.java | 2 +- .../wurstclient/mixin/SimpleOptionMixin.java | 92 +-- .../mixin/SodiumBlockOcclusionCacheMixin.java | 92 +-- .../mixin/SodiumFluidRendererMixin.java | 94 +-- .../wurstclient/mixin/StatsScreenMixin.java | 2 +- .../mixin/StatusEffectInstanceMixin.java | 64 +- .../mixin/TelemetryManagerMixin.java | 2 +- .../mixin/TextVisitFactoryMixin.java | 58 +- .../wurstclient/mixin/TitleScreenMixin.java | 2 +- .../net/wurstclient/mixin/WorldMixin.java | 108 +-- .../wurstclient/mixin/WorldRendererMixin.java | 62 +- .../mixinterface/IClientPlayerEntity.java | 2 +- .../IClientPlayerInteractionManager.java | 2 +- .../wurstclient/mixinterface/IKeyBinding.java | 2 +- .../mixinterface/ILanguageManager.java | 2 +- .../mixinterface/IMinecraftClient.java | 2 +- .../mixinterface/IMultiplayerScreen.java | 2 +- .../mixinterface/ISimpleOption.java | 2 +- .../net/wurstclient/navigator/Navigator.java | 2 +- .../navigator/NavigatorFeatureScreen.java | 2 +- .../navigator/NavigatorMainScreen.java | 2 +- .../navigator/NavigatorNewKeybindScreen.java | 2 +- .../NavigatorRemoveKeybindScreen.java | 2 +- .../navigator/NavigatorScreen.java | 2 +- .../navigator/PreferencesFile.java | 2 +- .../ForcedChatReportsScreen.java | 2 +- .../nochatreports/NcrModRequiredScreen.java | 2 +- .../options/EnterProfileNameScreen.java | 2 +- .../options/KeybindEditorScreen.java | 2 +- .../options/KeybindManagerScreen.java | 2 +- .../options/KeybindProfilesScreen.java | 2 +- .../options/PressAKeyCallback.java | 2 +- .../wurstclient/options/PressAKeyScreen.java | 2 +- .../options/WurstOptionsScreen.java | 2 +- .../options/ZoomManagerScreen.java | 2 +- .../wurstclient/other_feature/OtfList.java | 2 +- .../other_feature/OtherFeature.java | 2 +- .../other_features/ChangelogOtf.java | 2 +- .../other_features/CleanUpOtf.java | 2 +- .../other_features/DisableOtf.java | 2 +- .../other_features/HackListOtf.java | 2 +- .../other_features/KeybindManagerOtf.java | 2 +- .../other_features/LastServerOtf.java | 2 +- .../other_features/NoChatReportsOtf.java | 2 +- .../other_features/NoTelemetryOtf.java | 2 +- .../other_features/ReconnectOtf.java | 2 +- .../other_features/ServerFinderOtf.java | 2 +- .../wurstclient/other_features/TabGuiOtf.java | 2 +- .../other_features/TranslationsOtf.java | 2 +- .../other_features/VanillaSpoofOtf.java | 2 +- .../other_features/WikiDataExportOtf.java | 2 +- .../other_features/WurstCapesOtf.java | 2 +- .../other_features/WurstLogoOtf.java | 2 +- .../wurstclient/other_features/ZoomOtf.java | 2 +- .../serverfinder/CleanUpScreen.java | 536 ++++++------ .../serverfinder/ServerFinderScreen.java | 2 +- .../serverfinder/WurstServerPinger.java | 2 +- .../settings/AttackSpeedSliderSetting.java | 2 +- .../settings/BlockListSetting.java | 2 +- .../wurstclient/settings/BlockSetting.java | 2 +- .../settings/BookOffersSetting.java | 2 +- .../wurstclient/settings/CheckboxLock.java | 2 +- .../wurstclient/settings/CheckboxSetting.java | 2 +- .../settings/ChunkAreaSetting.java | 2 +- .../wurstclient/settings/ColorSetting.java | 2 +- .../net/wurstclient/settings/EnumSetting.java | 2 +- .../settings/EspBoxSizeSetting.java | 2 +- .../wurstclient/settings/EspStyleSetting.java | 2 +- .../wurstclient/settings/FacingSetting.java | 15 +- .../net/wurstclient/settings/FileSetting.java | 2 +- .../wurstclient/settings/ItemListSetting.java | 2 +- .../PauseAttackOnContainersSetting.java | 2 +- .../net/wurstclient/settings/Setting.java | 2 +- .../wurstclient/settings/SettingsFile.java | 2 +- .../net/wurstclient/settings/SliderLock.java | 2 +- .../wurstclient/settings/SliderSetting.java | 2 +- .../settings/SwingHandSetting.java | 2 +- .../settings/TextFieldSetting.java | 2 +- .../filterlists/AnchorAuraFilterList.java | 2 +- .../filterlists/CrystalAuraFilterList.java | 2 +- .../filterlists/EntityFilterList.java | 2 +- .../filterlists/FollowFilterList.java | 2 +- .../filterlists/RemoteViewFilterList.java | 2 +- .../filters/AttackDetectingEntityFilter.java | 2 +- .../filters/EntityFilterCheckbox.java | 2 +- .../settings/filters/FilterAllaysSetting.java | 2 +- .../filters/FilterArmorStandsSetting.java | 2 +- .../settings/filters/FilterBabiesSetting.java | 2 +- .../settings/filters/FilterBatsSetting.java | 2 +- .../filters/FilterCrystalsSetting.java | 2 +- .../filters/FilterEndermenSetting.java | 2 +- .../settings/filters/FilterFlyingSetting.java | 2 +- .../settings/filters/FilterGolemsSetting.java | 2 +- .../filters/FilterHostileSetting.java | 2 +- .../filters/FilterInvisibleSetting.java | 2 +- .../filters/FilterMinecartsSetting.java | 2 +- .../settings/filters/FilterNamedSetting.java | 2 +- .../filters/FilterNeutralSetting.java | 2 +- .../filters/FilterPassiveSetting.java | 2 +- .../filters/FilterPassiveWaterSetting.java | 2 +- .../settings/filters/FilterPetsSetting.java | 2 +- .../filters/FilterPiglinsSetting.java | 2 +- .../filters/FilterPlayersSetting.java | 2 +- .../filters/FilterShulkerBulletSetting.java | 2 +- .../filters/FilterShulkersSetting.java | 2 +- .../filters/FilterSleepingSetting.java | 2 +- .../settings/filters/FilterSlimesSetting.java | 2 +- .../filters/FilterVillagersSetting.java | 2 +- .../filters/FilterZombiePiglinsSetting.java | 2 +- .../filters/FilterZombieVillagersSetting.java | 2 +- .../ProblematicResourcePackDetector.java | 2 +- .../java/net/wurstclient/update/Version.java | 2 +- .../net/wurstclient/update/WurstUpdater.java | 2 +- .../wurstclient/util/AutoBuildTemplate.java | 2 +- .../net/wurstclient/util/BlockBreaker.java | 2 +- .../net/wurstclient/util/BlockPlacer.java | 2 +- .../java/net/wurstclient/util/BlockUtils.java | 15 +- .../wurstclient/util/BlockVertexCompiler.java | 2 +- .../java/net/wurstclient/util/ChatUtils.java | 2 +- .../net/wurstclient/util/ChunkSearcher.java | 2 +- .../util/ChunkSearcherCoordinator.java | 2 +- .../java/net/wurstclient/util/ChunkUtils.java | 2 +- .../java/net/wurstclient/util/CmdUtils.java | 2 +- .../java/net/wurstclient/util/ColorUtils.java | 2 +- .../util/DefaultAutoBuildTemplates.java | 2 +- .../net/wurstclient/util/EntityUtils.java | 2 +- .../wurstclient/util/FakePlayerEntity.java | 2 +- .../net/wurstclient/util/ForceOpDialog.java | 2 +- .../net/wurstclient/util/GoogleTranslate.java | 2 +- .../util/InteractionSimulator.java | 2 +- .../net/wurstclient/util/InventoryUtils.java | 2 +- .../java/net/wurstclient/util/ItemUtils.java | 2 +- .../util/JustGiveMeTheStringVisitor.java | 2 +- .../util/LastServerRememberer.java | 2 +- .../java/net/wurstclient/util/ListWidget.java | 2 +- .../java/net/wurstclient/util/MathUtils.java | 2 +- .../util/MinPriorityThreadFactory.java | 2 +- .../util/MultiProcessingUtils.java | 2 +- .../net/wurstclient/util/OverlayRenderer.java | 2 +- .../java/net/wurstclient/util/RegionPos.java | 2 +- .../net/wurstclient/util/RenderUtils.java | 2 +- .../java/net/wurstclient/util/Rotation.java | 104 +++ .../net/wurstclient/util/RotationUtils.java | 153 +--- .../net/wurstclient/util/StreamUtils.java | 2 +- .../java/net/wurstclient/util/SwingUtils.java | 2 +- .../wurstclient/util/json/JsonException.java | 2 +- .../net/wurstclient/util/json/JsonUtils.java | 576 ++++++------- .../net/wurstclient/util/json/WsonArray.java | 2 +- .../net/wurstclient/util/json/WsonObject.java | 2 +- .../resources/assets/wurst/lang/en_us.json | 1 + src/main/resources/wurst.accesswidener | 1 + src/main/resources/wurst.mixins.json | 1 + 562 files changed, 7065 insertions(+), 6406 deletions(-) create mode 100644 src/main/java/net/wurstclient/hacks/NoFogHack.java create mode 100644 src/main/java/net/wurstclient/hacks/autofish/FishingSpot.java create mode 100644 src/main/java/net/wurstclient/hacks/autofish/FishingSpotManager.java create mode 100644 src/main/java/net/wurstclient/hacks/autofish/PositionAndRotation.java create mode 100644 src/main/java/net/wurstclient/mixin/MobEntityRendererMixin.java create mode 100644 src/main/java/net/wurstclient/util/Rotation.java diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index f6749f14..7c6c9577 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,7 +1,10 @@ - + ## Description > What have you added and what does it do? (Alternatively, what have you fixed and how does it work?) -## (Optional) screenshots / videos -> If applicable, add screenshots or videos to help explain your pull request. +## Testing +> How have you tested your changes? Any testing tips for the reviewer? + +## References +> List any related issues, forum posts, videos and such here. diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index ca9850e8..024b42be 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,5 +1,3 @@ -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle name: Java CI with Gradle on: @@ -17,24 +15,35 @@ on: jobs: build: runs-on: ubuntu-latest + steps: - name: Checkout repository uses: actions/checkout@v4 + - name: Validate Gradle wrapper uses: gradle/wrapper-validation-action@v1 + - name: Set up Java 17 uses: actions/setup-java@v3 with: java-version: '17' distribution: 'microsoft' + - name: Grant execute permission for gradlew run: chmod +x gradlew + - name: Setup Gradle uses: gradle/gradle-build-action@v2 + + - name: Check code style with Spotless + id: spotless_check + run: ./gradlew spotlessCheck + - name: Execute Gradle build run: ./gradlew build + - name: VirusTotal scan - if: github.event_name == 'push' + if: ${{ github.event_name == 'push' }} uses: crazy-max/ghaction-virustotal@v4 with: vt_api_key: ${{ secrets.VIRUSTOTAL_API_KEY }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0f77a0f2..19bbaa1f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,27 @@ -# How To Help -Thank you for considering to contribute! Here are some things you can help with, in no particular order: +# Contributing Guidelines +Thank you for considering to contribute! Here are some guidelines to help you get started. + +## Pull Requests + +### 1. Keep Pull Requests Small and Focused +- **1 PR = 1 change**: Each pull request should address a single issue or add a single feature. +- **Avoid Bloat**: Aim to keep the diff small and digestible. Don't stuff PRs with unrelated changes. + +### 2. Respect the Project's Scope and Vision +- **Communicate Before Coding**: Open an issue to discuss any major changes before you start working on them. This can save you a lot of time and effort in case your idea is rejected. When in doubt, ask first. +- **Avoid Breaking Changes**: When modifying existing features, it's usually better to make your changes optional. Your version may work better for you, but other people will often have different use cases that rely on the original behavior. + +### 3. Ensure Quality and Completeness +- **Finish the Code**: Submit a PR only when it's complete, tested, and ready for review. Don't use pull requests as a dumping ground for half-baked prototypes. +- If you need early feedback on a larger change, clearly mark the PR as a draft. You should have already started a discussion and gotten the go-ahead for your idea at this point. +- **Watch the Checks**: Make sure that all automated checks are passing and that there aren't any merge conflicts. Fix such issues before asking for a review. + +### 4. Follow the Code Style +- Run Eclipse's Clean Up and Format tools with the settings from the [codestyle folder](codestyle). +- If you don't use Eclipse, you can run `./gradlew spotlessApply` instead. However, be aware that this isn't as thorough as Eclipse's tools. +- For anything that these automated tools don't cover, please try to match the existing code style as closely as possible. + +## Other Ways To Help - fixing a typo - in the Wurst Client itself (look for the pen icon at the top right) @@ -14,17 +36,6 @@ Thank you for considering to contribute! Here are some things you can help with, - Can you explain how the feature works? - Can you add the feature in a Pull Request? - Do you know anything else about the feature that hasn't been mentioned? -- creating a pull request - - adding a new hack/command/etc. - - adding new settings to make Wurst more customizable - - adding/improving descriptions and tooltips to make Wurst easier to use -- downloading and testing an existing pull request - - Can you confirm that it actually works? - - Did you find any problems with it? -- writing a code review for an existing pull request - - looking for bugs in the code and pointing them out - - suggesting improvements - - checking that the code wasn't stolen from another client - helping with the [Wurst Wiki](https://wiki.wurstclient.net/) - translating Wurst Wiki articles to another language - adding screenshots of features where appropriate diff --git a/README.md b/README.md index 21999899..c0b9e644 100644 --- a/README.md +++ b/README.md @@ -8,22 +8,17 @@ (This assumes that you are using Windows with [Eclipse](https://www.eclipse.org/downloads/) and [Java Development Kit 17](https://adoptium.net/?variant=openjdk17&jvmVariant=hotspot) already installed.) -1. Run these two commands in PowerShell: +1. Run this command in PowerShell: ``` -./gradlew.bat genSources -./gradlew.bat eclipse +./gradlew.bat genSources eclipse --no-daemon ``` 2. In Eclipse, go to `Import...` > `Existing Projects into Workspace` and select this project. ## Contributing -If you want to help but are not sure what to do, take a look at our [planning board](https://github.com/orgs/Wurst-Imperium/projects/5/views/1) or the [help wanted list](https://github.com/Wurst-Imperium/Wurst7/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22). Of course you can contribute anything you like, but these issues are particularly useful. - -If you are contributing multiple unrelated features, please create a separate pull request for each feature. Squeezing everything into one giant pull request makes it very difficult for me to add your features, as I have to test, validate and add them one by one. - -Thank you for your understanding - and thanks again for taking the time to contribute!! +Pull requests are welcome, but please make sure to read the [contributing guidelines](CONTRIBUTING.md) first. ## Translations diff --git a/build.gradle b/build.gradle index 3e2f192c..2613a257 100644 --- a/build.gradle +++ b/build.gradle @@ -7,6 +7,7 @@ buildscript { plugins { id 'fabric-loom' version '1.5-SNAPSHOT' id 'maven-publish' + id 'com.diffplug.spotless' version '6.23.3' } def ENV = System.getenv() @@ -74,6 +75,16 @@ jar { } } +spotless { + java { + removeUnusedImports() + indentWithTabs() + trimTrailingWhitespace() + eclipse().configFile(file("codestyle/formatter.xml")) + lineEndings('WINDOWS') + } +} + // configure the maven publication publishing { publications { diff --git a/codestyle/formatter.xml b/codestyle/formatter.xml index cec91d99..b44984ad 100644 --- a/codestyle/formatter.xml +++ b/codestyle/formatter.xml @@ -1,365 +1,401 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gradle.properties b/gradle.properties index db78d7f7..3e1983dc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,7 +13,7 @@ loader_version=0.15.7 fabric_version=0.92.0+1.20.1 # Mod Properties -mod_version = v7.40-MC1.20.1 +mod_version = v7.41-MC1.20.1 maven_group = net.wurstclient archives_base_name = Wurst-Client diff --git a/src/main/java/net/wurstclient/Category.java b/src/main/java/net/wurstclient/Category.java index 63c979e5..72cde211 100644 --- a/src/main/java/net/wurstclient/Category.java +++ b/src/main/java/net/wurstclient/Category.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/DontBlock.java b/src/main/java/net/wurstclient/DontBlock.java index f73f4b0b..28dabe41 100644 --- a/src/main/java/net/wurstclient/DontBlock.java +++ b/src/main/java/net/wurstclient/DontBlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/Feature.java b/src/main/java/net/wurstclient/Feature.java index 4c40b7aa..fce48842 100644 --- a/src/main/java/net/wurstclient/Feature.java +++ b/src/main/java/net/wurstclient/Feature.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/FriendsList.java b/src/main/java/net/wurstclient/FriendsList.java index 3e166752..8ed6b373 100644 --- a/src/main/java/net/wurstclient/FriendsList.java +++ b/src/main/java/net/wurstclient/FriendsList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/RotationFaker.java b/src/main/java/net/wurstclient/RotationFaker.java index e54049ac..1bf1eb21 100644 --- a/src/main/java/net/wurstclient/RotationFaker.java +++ b/src/main/java/net/wurstclient/RotationFaker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -11,6 +11,7 @@ import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.util.math.Vec3d; import net.wurstclient.events.PostMotionListener; import net.wurstclient.events.PreMotionListener; +import net.wurstclient.util.Rotation; import net.wurstclient.util.RotationUtils; public final class RotationFaker @@ -49,33 +50,33 @@ public final class RotationFaker public void faceVectorPacket(Vec3d vec) { - RotationUtils.Rotation needed = RotationUtils.getNeededRotations(vec); + Rotation needed = RotationUtils.getNeededRotations(vec); ClientPlayerEntity player = WurstClient.MC.player; fakeRotation = true; serverYaw = - RotationUtils.limitAngleChange(player.getYaw(), needed.getYaw()); - serverPitch = needed.getPitch(); + RotationUtils.limitAngleChange(player.getYaw(), needed.yaw()); + serverPitch = needed.pitch(); } public void faceVectorClient(Vec3d vec) { - RotationUtils.Rotation needed = RotationUtils.getNeededRotations(vec); + Rotation needed = RotationUtils.getNeededRotations(vec); ClientPlayerEntity player = WurstClient.MC.player; player.setYaw( - RotationUtils.limitAngleChange(player.getYaw(), needed.getYaw())); - player.setPitch(needed.getPitch()); + RotationUtils.limitAngleChange(player.getYaw(), needed.yaw())); + player.setPitch(needed.pitch()); } public void faceVectorClientIgnorePitch(Vec3d vec) { - RotationUtils.Rotation needed = RotationUtils.getNeededRotations(vec); + Rotation needed = RotationUtils.getNeededRotations(vec); ClientPlayerEntity player = WurstClient.MC.player; - WurstClient.MC.player.setYaw( - RotationUtils.limitAngleChange(player.getYaw(), needed.getYaw())); - WurstClient.MC.player.setPitch(0); + player.setYaw( + RotationUtils.limitAngleChange(player.getYaw(), needed.yaw())); + player.setPitch(0); } public float getServerYaw() diff --git a/src/main/java/net/wurstclient/SearchTags.java b/src/main/java/net/wurstclient/SearchTags.java index ae5b7f07..db307a0b 100644 --- a/src/main/java/net/wurstclient/SearchTags.java +++ b/src/main/java/net/wurstclient/SearchTags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/TooManyHaxFile.java b/src/main/java/net/wurstclient/TooManyHaxFile.java index c20dbfe3..28bf1832 100644 --- a/src/main/java/net/wurstclient/TooManyHaxFile.java +++ b/src/main/java/net/wurstclient/TooManyHaxFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/WurstClient.java b/src/main/java/net/wurstclient/WurstClient.java index 6d547611..67b1e53f 100644 --- a/src/main/java/net/wurstclient/WurstClient.java +++ b/src/main/java/net/wurstclient/WurstClient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -57,7 +57,7 @@ public enum WurstClient public static MinecraftClient MC; public static IMinecraftClient IMC; - public static final String VERSION = "7.40"; + public static final String VERSION = "7.41"; public static final String MC_VERSION = "1.20.1"; private WurstAnalytics analytics; diff --git a/src/main/java/net/wurstclient/WurstInitializer.java b/src/main/java/net/wurstclient/WurstInitializer.java index b141d483..7a9d6fb5 100644 --- a/src/main/java/net/wurstclient/WurstInitializer.java +++ b/src/main/java/net/wurstclient/WurstInitializer.java @@ -1,30 +1,30 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient; - -import net.fabricmc.api.ModInitializer; - -public final class WurstInitializer implements ModInitializer -{ - private static boolean initialized; - - @Override - public void onInitialize() - { - // This code runs as soon as Minecraft is in a mod-load-ready state. - // However, some things (like resources) may still be uninitialized. - // Proceed with mild caution. - - if(initialized) - throw new RuntimeException( - "WurstInitializer.onInitialize() ran twice!"); - - WurstClient.INSTANCE.initialize(); - initialized = true; - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient; + +import net.fabricmc.api.ModInitializer; + +public final class WurstInitializer implements ModInitializer +{ + private static boolean initialized; + + @Override + public void onInitialize() + { + // This code runs as soon as Minecraft is in a mod-load-ready state. + // However, some things (like resources) may still be uninitialized. + // Proceed with mild caution. + + if(initialized) + throw new RuntimeException( + "WurstInitializer.onInitialize() ran twice!"); + + WurstClient.INSTANCE.initialize(); + initialized = true; + } +} diff --git a/src/main/java/net/wurstclient/ai/FlyPathProcessor.java b/src/main/java/net/wurstclient/ai/FlyPathProcessor.java index d9c6cfb0..b57051c1 100644 --- a/src/main/java/net/wurstclient/ai/FlyPathProcessor.java +++ b/src/main/java/net/wurstclient/ai/FlyPathProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/ai/PathFinder.java b/src/main/java/net/wurstclient/ai/PathFinder.java index 48c93dee..e90b226f 100644 --- a/src/main/java/net/wurstclient/ai/PathFinder.java +++ b/src/main/java/net/wurstclient/ai/PathFinder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/ai/PathPos.java b/src/main/java/net/wurstclient/ai/PathPos.java index d1bfa757..10cfa3af 100644 --- a/src/main/java/net/wurstclient/ai/PathPos.java +++ b/src/main/java/net/wurstclient/ai/PathPos.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/ai/PathProcessor.java b/src/main/java/net/wurstclient/ai/PathProcessor.java index e71a0522..0ad42fd7 100644 --- a/src/main/java/net/wurstclient/ai/PathProcessor.java +++ b/src/main/java/net/wurstclient/ai/PathProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/ai/PathQueue.java b/src/main/java/net/wurstclient/ai/PathQueue.java index 84042651..57578249 100644 --- a/src/main/java/net/wurstclient/ai/PathQueue.java +++ b/src/main/java/net/wurstclient/ai/PathQueue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/ai/PathRenderer.java b/src/main/java/net/wurstclient/ai/PathRenderer.java index d2d52ba8..d29b1a4c 100644 --- a/src/main/java/net/wurstclient/ai/PathRenderer.java +++ b/src/main/java/net/wurstclient/ai/PathRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/ai/WalkPathProcessor.java b/src/main/java/net/wurstclient/ai/WalkPathProcessor.java index 01d1e8e1..37f5ce7c 100644 --- a/src/main/java/net/wurstclient/ai/WalkPathProcessor.java +++ b/src/main/java/net/wurstclient/ai/WalkPathProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/altmanager/Alt.java b/src/main/java/net/wurstclient/altmanager/Alt.java index 9c1615be..cfa7a67d 100644 --- a/src/main/java/net/wurstclient/altmanager/Alt.java +++ b/src/main/java/net/wurstclient/altmanager/Alt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/altmanager/AltManager.java b/src/main/java/net/wurstclient/altmanager/AltManager.java index c032b4d8..806608a9 100644 --- a/src/main/java/net/wurstclient/altmanager/AltManager.java +++ b/src/main/java/net/wurstclient/altmanager/AltManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/altmanager/AltRenderer.java b/src/main/java/net/wurstclient/altmanager/AltRenderer.java index 5d83d0ad..cba38446 100644 --- a/src/main/java/net/wurstclient/altmanager/AltRenderer.java +++ b/src/main/java/net/wurstclient/altmanager/AltRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/altmanager/AltsFile.java b/src/main/java/net/wurstclient/altmanager/AltsFile.java index ce66f222..d21e8c9a 100644 --- a/src/main/java/net/wurstclient/altmanager/AltsFile.java +++ b/src/main/java/net/wurstclient/altmanager/AltsFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/altmanager/CrackedAlt.java b/src/main/java/net/wurstclient/altmanager/CrackedAlt.java index ffeefdf1..47efed12 100644 --- a/src/main/java/net/wurstclient/altmanager/CrackedAlt.java +++ b/src/main/java/net/wurstclient/altmanager/CrackedAlt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/altmanager/Encryption.java b/src/main/java/net/wurstclient/altmanager/Encryption.java index 3ea1dfe5..73ea764f 100644 --- a/src/main/java/net/wurstclient/altmanager/Encryption.java +++ b/src/main/java/net/wurstclient/altmanager/Encryption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/altmanager/ExportAltsFileChooser.java b/src/main/java/net/wurstclient/altmanager/ExportAltsFileChooser.java index a6343e97..b6347b8f 100644 --- a/src/main/java/net/wurstclient/altmanager/ExportAltsFileChooser.java +++ b/src/main/java/net/wurstclient/altmanager/ExportAltsFileChooser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/altmanager/ImportAltsFileChooser.java b/src/main/java/net/wurstclient/altmanager/ImportAltsFileChooser.java index 277ca2f4..a7906194 100644 --- a/src/main/java/net/wurstclient/altmanager/ImportAltsFileChooser.java +++ b/src/main/java/net/wurstclient/altmanager/ImportAltsFileChooser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/altmanager/LoginException.java b/src/main/java/net/wurstclient/altmanager/LoginException.java index 8761d8c4..531b2160 100644 --- a/src/main/java/net/wurstclient/altmanager/LoginException.java +++ b/src/main/java/net/wurstclient/altmanager/LoginException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/altmanager/LoginManager.java b/src/main/java/net/wurstclient/altmanager/LoginManager.java index 34d9c2e6..5e9799e2 100644 --- a/src/main/java/net/wurstclient/altmanager/LoginManager.java +++ b/src/main/java/net/wurstclient/altmanager/LoginManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/altmanager/MicrosoftLoginManager.java b/src/main/java/net/wurstclient/altmanager/MicrosoftLoginManager.java index 211b5c9e..abf61d12 100644 --- a/src/main/java/net/wurstclient/altmanager/MicrosoftLoginManager.java +++ b/src/main/java/net/wurstclient/altmanager/MicrosoftLoginManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/altmanager/MinecraftProfile.java b/src/main/java/net/wurstclient/altmanager/MinecraftProfile.java index ed36efbd..0d610935 100644 --- a/src/main/java/net/wurstclient/altmanager/MinecraftProfile.java +++ b/src/main/java/net/wurstclient/altmanager/MinecraftProfile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/altmanager/MojangAlt.java b/src/main/java/net/wurstclient/altmanager/MojangAlt.java index 79602973..f201642a 100644 --- a/src/main/java/net/wurstclient/altmanager/MojangAlt.java +++ b/src/main/java/net/wurstclient/altmanager/MojangAlt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/altmanager/NameGenerator.java b/src/main/java/net/wurstclient/altmanager/NameGenerator.java index 6a417199..723b1891 100644 --- a/src/main/java/net/wurstclient/altmanager/NameGenerator.java +++ b/src/main/java/net/wurstclient/altmanager/NameGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/altmanager/XBoxLiveToken.java b/src/main/java/net/wurstclient/altmanager/XBoxLiveToken.java index 50031dd3..471e31a6 100644 --- a/src/main/java/net/wurstclient/altmanager/XBoxLiveToken.java +++ b/src/main/java/net/wurstclient/altmanager/XBoxLiveToken.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/altmanager/screens/AddAltScreen.java b/src/main/java/net/wurstclient/altmanager/screens/AddAltScreen.java index cef225b0..b4384832 100644 --- a/src/main/java/net/wurstclient/altmanager/screens/AddAltScreen.java +++ b/src/main/java/net/wurstclient/altmanager/screens/AddAltScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/altmanager/screens/AltEditorScreen.java b/src/main/java/net/wurstclient/altmanager/screens/AltEditorScreen.java index 1a0d3bb7..f66d6cfe 100644 --- a/src/main/java/net/wurstclient/altmanager/screens/AltEditorScreen.java +++ b/src/main/java/net/wurstclient/altmanager/screens/AltEditorScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/altmanager/screens/AltManagerScreen.java b/src/main/java/net/wurstclient/altmanager/screens/AltManagerScreen.java index 6109579b..58eb7c21 100644 --- a/src/main/java/net/wurstclient/altmanager/screens/AltManagerScreen.java +++ b/src/main/java/net/wurstclient/altmanager/screens/AltManagerScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/altmanager/screens/DirectLoginScreen.java b/src/main/java/net/wurstclient/altmanager/screens/DirectLoginScreen.java index 24c3f783..2a325a25 100644 --- a/src/main/java/net/wurstclient/altmanager/screens/DirectLoginScreen.java +++ b/src/main/java/net/wurstclient/altmanager/screens/DirectLoginScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/altmanager/screens/EditAltScreen.java b/src/main/java/net/wurstclient/altmanager/screens/EditAltScreen.java index 15bd1a6a..159cc631 100644 --- a/src/main/java/net/wurstclient/altmanager/screens/EditAltScreen.java +++ b/src/main/java/net/wurstclient/altmanager/screens/EditAltScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/analytics/AnalyticsConfigFile.java b/src/main/java/net/wurstclient/analytics/AnalyticsConfigFile.java index ec008015..5581a53f 100644 --- a/src/main/java/net/wurstclient/analytics/AnalyticsConfigFile.java +++ b/src/main/java/net/wurstclient/analytics/AnalyticsConfigFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/analytics/WurstAnalytics.java b/src/main/java/net/wurstclient/analytics/WurstAnalytics.java index 1c86ff48..3d5a188a 100644 --- a/src/main/java/net/wurstclient/analytics/WurstAnalytics.java +++ b/src/main/java/net/wurstclient/analytics/WurstAnalytics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/analytics/WurstAnalyticsConfigData.java b/src/main/java/net/wurstclient/analytics/WurstAnalyticsConfigData.java index 084dd73a..7272eb1e 100644 --- a/src/main/java/net/wurstclient/analytics/WurstAnalyticsConfigData.java +++ b/src/main/java/net/wurstclient/analytics/WurstAnalyticsConfigData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/analytics/WurstAnalyticsTracker.java b/src/main/java/net/wurstclient/analytics/WurstAnalyticsTracker.java index 9cb73424..561a25cf 100644 --- a/src/main/java/net/wurstclient/analytics/WurstAnalyticsTracker.java +++ b/src/main/java/net/wurstclient/analytics/WurstAnalyticsTracker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/ClickGui.java b/src/main/java/net/wurstclient/clickgui/ClickGui.java index 76493e96..15460f04 100644 --- a/src/main/java/net/wurstclient/clickgui/ClickGui.java +++ b/src/main/java/net/wurstclient/clickgui/ClickGui.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/ComboBoxPopup.java b/src/main/java/net/wurstclient/clickgui/ComboBoxPopup.java index 0587f5db..ff94b860 100644 --- a/src/main/java/net/wurstclient/clickgui/ComboBoxPopup.java +++ b/src/main/java/net/wurstclient/clickgui/ComboBoxPopup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/Component.java b/src/main/java/net/wurstclient/clickgui/Component.java index b826fd84..6d5fcbef 100644 --- a/src/main/java/net/wurstclient/clickgui/Component.java +++ b/src/main/java/net/wurstclient/clickgui/Component.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/Popup.java b/src/main/java/net/wurstclient/clickgui/Popup.java index 240f7ba3..272a4d70 100644 --- a/src/main/java/net/wurstclient/clickgui/Popup.java +++ b/src/main/java/net/wurstclient/clickgui/Popup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/SettingsWindow.java b/src/main/java/net/wurstclient/clickgui/SettingsWindow.java index 93edc458..6645a67b 100644 --- a/src/main/java/net/wurstclient/clickgui/SettingsWindow.java +++ b/src/main/java/net/wurstclient/clickgui/SettingsWindow.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/Window.java b/src/main/java/net/wurstclient/clickgui/Window.java index 99f499ee..d4dc47be 100644 --- a/src/main/java/net/wurstclient/clickgui/Window.java +++ b/src/main/java/net/wurstclient/clickgui/Window.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/components/AbstractListEditButton.java b/src/main/java/net/wurstclient/clickgui/components/AbstractListEditButton.java index 37ab63e9..3cf86df6 100644 --- a/src/main/java/net/wurstclient/clickgui/components/AbstractListEditButton.java +++ b/src/main/java/net/wurstclient/clickgui/components/AbstractListEditButton.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/components/BlockComponent.java b/src/main/java/net/wurstclient/clickgui/components/BlockComponent.java index 0e9df940..e6f69f8b 100644 --- a/src/main/java/net/wurstclient/clickgui/components/BlockComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/BlockComponent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/components/BlockListEditButton.java b/src/main/java/net/wurstclient/clickgui/components/BlockListEditButton.java index cc387843..5bc07e29 100644 --- a/src/main/java/net/wurstclient/clickgui/components/BlockListEditButton.java +++ b/src/main/java/net/wurstclient/clickgui/components/BlockListEditButton.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/components/BookOffersEditButton.java b/src/main/java/net/wurstclient/clickgui/components/BookOffersEditButton.java index 2eb5ad92..340a1cec 100644 --- a/src/main/java/net/wurstclient/clickgui/components/BookOffersEditButton.java +++ b/src/main/java/net/wurstclient/clickgui/components/BookOffersEditButton.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/components/CheckboxComponent.java b/src/main/java/net/wurstclient/clickgui/components/CheckboxComponent.java index c1f4cf71..7406ba97 100644 --- a/src/main/java/net/wurstclient/clickgui/components/CheckboxComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/CheckboxComponent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/components/ColorComponent.java b/src/main/java/net/wurstclient/clickgui/components/ColorComponent.java index 52da223c..b9fa8188 100644 --- a/src/main/java/net/wurstclient/clickgui/components/ColorComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/ColorComponent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/components/ComboBoxComponent.java b/src/main/java/net/wurstclient/clickgui/components/ComboBoxComponent.java index 330e51fd..d5ed6c3e 100644 --- a/src/main/java/net/wurstclient/clickgui/components/ComboBoxComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/ComboBoxComponent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/components/FeatureButton.java b/src/main/java/net/wurstclient/clickgui/components/FeatureButton.java index 85f26915..c7723510 100644 --- a/src/main/java/net/wurstclient/clickgui/components/FeatureButton.java +++ b/src/main/java/net/wurstclient/clickgui/components/FeatureButton.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/components/FileComponent.java b/src/main/java/net/wurstclient/clickgui/components/FileComponent.java index 853e9c7c..a84b4d58 100644 --- a/src/main/java/net/wurstclient/clickgui/components/FileComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/FileComponent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/components/ItemListEditButton.java b/src/main/java/net/wurstclient/clickgui/components/ItemListEditButton.java index c1ce41ad..5670f0a3 100644 --- a/src/main/java/net/wurstclient/clickgui/components/ItemListEditButton.java +++ b/src/main/java/net/wurstclient/clickgui/components/ItemListEditButton.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/components/RadarComponent.java b/src/main/java/net/wurstclient/clickgui/components/RadarComponent.java index 764726e4..2b2af5ed 100644 --- a/src/main/java/net/wurstclient/clickgui/components/RadarComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/RadarComponent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/components/SliderComponent.java b/src/main/java/net/wurstclient/clickgui/components/SliderComponent.java index ef4d3f04..53bc5523 100644 --- a/src/main/java/net/wurstclient/clickgui/components/SliderComponent.java +++ b/src/main/java/net/wurstclient/clickgui/components/SliderComponent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/components/TextFieldEditButton.java b/src/main/java/net/wurstclient/clickgui/components/TextFieldEditButton.java index f97dceb1..c2e6d030 100644 --- a/src/main/java/net/wurstclient/clickgui/components/TextFieldEditButton.java +++ b/src/main/java/net/wurstclient/clickgui/components/TextFieldEditButton.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/screens/AddBookOfferScreen.java b/src/main/java/net/wurstclient/clickgui/screens/AddBookOfferScreen.java index b822164d..f45ab887 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/AddBookOfferScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/AddBookOfferScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/screens/ClickGuiScreen.java b/src/main/java/net/wurstclient/clickgui/screens/ClickGuiScreen.java index 67dffd84..b8b3256f 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/ClickGuiScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/ClickGuiScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/screens/EditBlockListScreen.java b/src/main/java/net/wurstclient/clickgui/screens/EditBlockListScreen.java index b3408132..6076c037 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/EditBlockListScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/EditBlockListScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/screens/EditBlockScreen.java b/src/main/java/net/wurstclient/clickgui/screens/EditBlockScreen.java index f5e223df..0e236a40 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/EditBlockScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/EditBlockScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/screens/EditBookOfferScreen.java b/src/main/java/net/wurstclient/clickgui/screens/EditBookOfferScreen.java index e3f66b5c..32ecad6c 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/EditBookOfferScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/EditBookOfferScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/screens/EditBookOffersScreen.java b/src/main/java/net/wurstclient/clickgui/screens/EditBookOffersScreen.java index f65894db..c4a9e27d 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/EditBookOffersScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/EditBookOffersScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/screens/EditColorScreen.java b/src/main/java/net/wurstclient/clickgui/screens/EditColorScreen.java index 787cc1bf..84075cf1 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/EditColorScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/EditColorScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/screens/EditItemListScreen.java b/src/main/java/net/wurstclient/clickgui/screens/EditItemListScreen.java index f49027dd..4b2b21d5 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/EditItemListScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/EditItemListScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/screens/EditSliderScreen.java b/src/main/java/net/wurstclient/clickgui/screens/EditSliderScreen.java index 29e70034..02b77eef 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/EditSliderScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/EditSliderScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/screens/EditTextFieldScreen.java b/src/main/java/net/wurstclient/clickgui/screens/EditTextFieldScreen.java index 3dfa0fd9..717f03f7 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/EditTextFieldScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/EditTextFieldScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/clickgui/screens/SelectFileScreen.java b/src/main/java/net/wurstclient/clickgui/screens/SelectFileScreen.java index 231dfd5c..1683a6a3 100644 --- a/src/main/java/net/wurstclient/clickgui/screens/SelectFileScreen.java +++ b/src/main/java/net/wurstclient/clickgui/screens/SelectFileScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/command/CmdError.java b/src/main/java/net/wurstclient/command/CmdError.java index 3254e684..6880f7e2 100644 --- a/src/main/java/net/wurstclient/command/CmdError.java +++ b/src/main/java/net/wurstclient/command/CmdError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/command/CmdException.java b/src/main/java/net/wurstclient/command/CmdException.java index 837cb3e2..27916a70 100644 --- a/src/main/java/net/wurstclient/command/CmdException.java +++ b/src/main/java/net/wurstclient/command/CmdException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/command/CmdList.java b/src/main/java/net/wurstclient/command/CmdList.java index 91f740bf..0031ba76 100644 --- a/src/main/java/net/wurstclient/command/CmdList.java +++ b/src/main/java/net/wurstclient/command/CmdList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/command/CmdProcessor.java b/src/main/java/net/wurstclient/command/CmdProcessor.java index 992bced6..9dc6e41f 100644 --- a/src/main/java/net/wurstclient/command/CmdProcessor.java +++ b/src/main/java/net/wurstclient/command/CmdProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/command/CmdSyntaxError.java b/src/main/java/net/wurstclient/command/CmdSyntaxError.java index 3e703d3d..8769c562 100644 --- a/src/main/java/net/wurstclient/command/CmdSyntaxError.java +++ b/src/main/java/net/wurstclient/command/CmdSyntaxError.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/command/Command.java b/src/main/java/net/wurstclient/command/Command.java index 49c19972..2cd63a7b 100644 --- a/src/main/java/net/wurstclient/command/Command.java +++ b/src/main/java/net/wurstclient/command/Command.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/AddAltCmd.java b/src/main/java/net/wurstclient/commands/AddAltCmd.java index 5dd92ea4..fd99e072 100644 --- a/src/main/java/net/wurstclient/commands/AddAltCmd.java +++ b/src/main/java/net/wurstclient/commands/AddAltCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/AnnoyCmd.java b/src/main/java/net/wurstclient/commands/AnnoyCmd.java index d0ce3c53..94b72faf 100644 --- a/src/main/java/net/wurstclient/commands/AnnoyCmd.java +++ b/src/main/java/net/wurstclient/commands/AnnoyCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/AuthorCmd.java b/src/main/java/net/wurstclient/commands/AuthorCmd.java index db9167eb..cc8d58ea 100644 --- a/src/main/java/net/wurstclient/commands/AuthorCmd.java +++ b/src/main/java/net/wurstclient/commands/AuthorCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/BindCmd.java b/src/main/java/net/wurstclient/commands/BindCmd.java index d231bc62..81b35c5f 100644 --- a/src/main/java/net/wurstclient/commands/BindCmd.java +++ b/src/main/java/net/wurstclient/commands/BindCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/BindsCmd.java b/src/main/java/net/wurstclient/commands/BindsCmd.java index 95e3753b..cfef381a 100644 --- a/src/main/java/net/wurstclient/commands/BindsCmd.java +++ b/src/main/java/net/wurstclient/commands/BindsCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/BlinkCmd.java b/src/main/java/net/wurstclient/commands/BlinkCmd.java index ff7c4d0b..34806170 100644 --- a/src/main/java/net/wurstclient/commands/BlinkCmd.java +++ b/src/main/java/net/wurstclient/commands/BlinkCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/BlockListCmd.java b/src/main/java/net/wurstclient/commands/BlockListCmd.java index 6d7be692..e2c66b0a 100644 --- a/src/main/java/net/wurstclient/commands/BlockListCmd.java +++ b/src/main/java/net/wurstclient/commands/BlockListCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/ClearCmd.java b/src/main/java/net/wurstclient/commands/ClearCmd.java index c10e39ef..d1947cb5 100644 --- a/src/main/java/net/wurstclient/commands/ClearCmd.java +++ b/src/main/java/net/wurstclient/commands/ClearCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/CopyItemCmd.java b/src/main/java/net/wurstclient/commands/CopyItemCmd.java index 5c2dea04..cad8c430 100644 --- a/src/main/java/net/wurstclient/commands/CopyItemCmd.java +++ b/src/main/java/net/wurstclient/commands/CopyItemCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/DamageCmd.java b/src/main/java/net/wurstclient/commands/DamageCmd.java index d48570b1..46095905 100644 --- a/src/main/java/net/wurstclient/commands/DamageCmd.java +++ b/src/main/java/net/wurstclient/commands/DamageCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/DigCmd.java b/src/main/java/net/wurstclient/commands/DigCmd.java index 5b60f46c..997b432f 100644 --- a/src/main/java/net/wurstclient/commands/DigCmd.java +++ b/src/main/java/net/wurstclient/commands/DigCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/DropCmd.java b/src/main/java/net/wurstclient/commands/DropCmd.java index 269d1701..0c50f4c0 100644 --- a/src/main/java/net/wurstclient/commands/DropCmd.java +++ b/src/main/java/net/wurstclient/commands/DropCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/EnabledHaxCmd.java b/src/main/java/net/wurstclient/commands/EnabledHaxCmd.java index ea9c348f..0b4cdce5 100644 --- a/src/main/java/net/wurstclient/commands/EnabledHaxCmd.java +++ b/src/main/java/net/wurstclient/commands/EnabledHaxCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/EnchantCmd.java b/src/main/java/net/wurstclient/commands/EnchantCmd.java index c7ad3da4..f8c745ca 100644 --- a/src/main/java/net/wurstclient/commands/EnchantCmd.java +++ b/src/main/java/net/wurstclient/commands/EnchantCmd.java @@ -1,89 +1,89 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.commands; - -import net.minecraft.enchantment.Enchantment; -import net.minecraft.enchantment.Enchantments; -import net.minecraft.item.ItemStack; -import net.minecraft.registry.Registries; -import net.wurstclient.command.CmdError; -import net.wurstclient.command.CmdException; -import net.wurstclient.command.CmdSyntaxError; -import net.wurstclient.command.Command; -import net.wurstclient.util.ChatUtils; -import net.wurstclient.util.ItemUtils; - -public final class EnchantCmd extends Command -{ - public EnchantCmd() - { - super("enchant", "Enchants an item with everything,\n" - + "except for silk touch and curses.", ".enchant"); - } - - @Override - public void call(String[] args) throws CmdException - { - if(!MC.player.getAbilities().creativeMode) - throw new CmdError("Creative mode only."); - - if(args.length > 1) - throw new CmdSyntaxError(); - - enchant(getHeldItem(), 127); - ChatUtils.message("Item enchanted."); - } - - private ItemStack getHeldItem() throws CmdError - { - ItemStack stack = MC.player.getMainHandStack(); - - if(stack.isEmpty()) - stack = MC.player.getOffHandStack(); - - if(stack.isEmpty()) - throw new CmdError("There is no item in your hand."); - - return stack; - } - - private void enchant(ItemStack stack, int level) - { - for(Enchantment enchantment : Registries.ENCHANTMENT) - { - // Skip curses - if(enchantment.isCursed()) - continue; - - // Skip Silk Touch so it doesn't remove Fortune - if(enchantment == Enchantments.SILK_TOUCH) - continue; - - // Limit Quick Charge to level 5 so it doesn't break - if(enchantment == Enchantments.QUICK_CHARGE) - { - stack.addEnchantment(enchantment, Math.min(level, 5)); - continue; - } - - ItemUtils.addEnchantment(stack, enchantment, level); - } - } - - @Override - public String getPrimaryAction() - { - return "Enchant Held Item"; - } - - @Override - public void doPrimaryAction() - { - WURST.getCmdProcessor().process("enchant"); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.commands; + +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.Enchantments; +import net.minecraft.item.ItemStack; +import net.minecraft.registry.Registries; +import net.wurstclient.command.CmdError; +import net.wurstclient.command.CmdException; +import net.wurstclient.command.CmdSyntaxError; +import net.wurstclient.command.Command; +import net.wurstclient.util.ChatUtils; +import net.wurstclient.util.ItemUtils; + +public final class EnchantCmd extends Command +{ + public EnchantCmd() + { + super("enchant", "Enchants an item with everything,\n" + + "except for silk touch and curses.", ".enchant"); + } + + @Override + public void call(String[] args) throws CmdException + { + if(!MC.player.getAbilities().creativeMode) + throw new CmdError("Creative mode only."); + + if(args.length > 1) + throw new CmdSyntaxError(); + + enchant(getHeldItem(), 127); + ChatUtils.message("Item enchanted."); + } + + private ItemStack getHeldItem() throws CmdError + { + ItemStack stack = MC.player.getMainHandStack(); + + if(stack.isEmpty()) + stack = MC.player.getOffHandStack(); + + if(stack.isEmpty()) + throw new CmdError("There is no item in your hand."); + + return stack; + } + + private void enchant(ItemStack stack, int level) + { + for(Enchantment enchantment : Registries.ENCHANTMENT) + { + // Skip curses + if(enchantment.isCursed()) + continue; + + // Skip Silk Touch so it doesn't remove Fortune + if(enchantment == Enchantments.SILK_TOUCH) + continue; + + // Limit Quick Charge to level 5 so it doesn't break + if(enchantment == Enchantments.QUICK_CHARGE) + { + stack.addEnchantment(enchantment, Math.min(level, 5)); + continue; + } + + ItemUtils.addEnchantment(stack, enchantment, level); + } + } + + @Override + public String getPrimaryAction() + { + return "Enchant Held Item"; + } + + @Override + public void doPrimaryAction() + { + WURST.getCmdProcessor().process("enchant"); + } +} diff --git a/src/main/java/net/wurstclient/commands/ExcavateCmd.java b/src/main/java/net/wurstclient/commands/ExcavateCmd.java index 8e14d703..929b2830 100644 --- a/src/main/java/net/wurstclient/commands/ExcavateCmd.java +++ b/src/main/java/net/wurstclient/commands/ExcavateCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/FeaturesCmd.java b/src/main/java/net/wurstclient/commands/FeaturesCmd.java index 30b328ab..8ac5ff80 100644 --- a/src/main/java/net/wurstclient/commands/FeaturesCmd.java +++ b/src/main/java/net/wurstclient/commands/FeaturesCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/FollowCmd.java b/src/main/java/net/wurstclient/commands/FollowCmd.java index 428bec89..3e7ce1a9 100644 --- a/src/main/java/net/wurstclient/commands/FollowCmd.java +++ b/src/main/java/net/wurstclient/commands/FollowCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/FriendsCmd.java b/src/main/java/net/wurstclient/commands/FriendsCmd.java index e2359c1c..ccb68e97 100644 --- a/src/main/java/net/wurstclient/commands/FriendsCmd.java +++ b/src/main/java/net/wurstclient/commands/FriendsCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/GetPosCmd.java b/src/main/java/net/wurstclient/commands/GetPosCmd.java index b25622ce..e87ed8ca 100644 --- a/src/main/java/net/wurstclient/commands/GetPosCmd.java +++ b/src/main/java/net/wurstclient/commands/GetPosCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/GiveCmd.java b/src/main/java/net/wurstclient/commands/GiveCmd.java index 77e6f62b..a55604bb 100644 --- a/src/main/java/net/wurstclient/commands/GiveCmd.java +++ b/src/main/java/net/wurstclient/commands/GiveCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/GmCmd.java b/src/main/java/net/wurstclient/commands/GmCmd.java index 01fbe3c0..15db20db 100644 --- a/src/main/java/net/wurstclient/commands/GmCmd.java +++ b/src/main/java/net/wurstclient/commands/GmCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/GoToCmd.java b/src/main/java/net/wurstclient/commands/GoToCmd.java index 0dedc5cc..2e37ab55 100644 --- a/src/main/java/net/wurstclient/commands/GoToCmd.java +++ b/src/main/java/net/wurstclient/commands/GoToCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/HelpCmd.java b/src/main/java/net/wurstclient/commands/HelpCmd.java index 18cfb221..ff3091ab 100644 --- a/src/main/java/net/wurstclient/commands/HelpCmd.java +++ b/src/main/java/net/wurstclient/commands/HelpCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/InvseeCmd.java b/src/main/java/net/wurstclient/commands/InvseeCmd.java index e9684340..26afa092 100644 --- a/src/main/java/net/wurstclient/commands/InvseeCmd.java +++ b/src/main/java/net/wurstclient/commands/InvseeCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/IpCmd.java b/src/main/java/net/wurstclient/commands/IpCmd.java index 2b7586f6..b01c1e8c 100644 --- a/src/main/java/net/wurstclient/commands/IpCmd.java +++ b/src/main/java/net/wurstclient/commands/IpCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/ItemListCmd.java b/src/main/java/net/wurstclient/commands/ItemListCmd.java index 53e6df54..4a9fa08a 100644 --- a/src/main/java/net/wurstclient/commands/ItemListCmd.java +++ b/src/main/java/net/wurstclient/commands/ItemListCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/JumpCmd.java b/src/main/java/net/wurstclient/commands/JumpCmd.java index 9610ce5a..d8cbbe22 100644 --- a/src/main/java/net/wurstclient/commands/JumpCmd.java +++ b/src/main/java/net/wurstclient/commands/JumpCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/LeaveCmd.java b/src/main/java/net/wurstclient/commands/LeaveCmd.java index 87a827db..4ba540f4 100644 --- a/src/main/java/net/wurstclient/commands/LeaveCmd.java +++ b/src/main/java/net/wurstclient/commands/LeaveCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/ModifyCmd.java b/src/main/java/net/wurstclient/commands/ModifyCmd.java index 9eaf7d38..675921b3 100644 --- a/src/main/java/net/wurstclient/commands/ModifyCmd.java +++ b/src/main/java/net/wurstclient/commands/ModifyCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/PathCmd.java b/src/main/java/net/wurstclient/commands/PathCmd.java index 98a2570a..b40a4fb4 100644 --- a/src/main/java/net/wurstclient/commands/PathCmd.java +++ b/src/main/java/net/wurstclient/commands/PathCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/PotionCmd.java b/src/main/java/net/wurstclient/commands/PotionCmd.java index edabef67..5ecb99da 100644 --- a/src/main/java/net/wurstclient/commands/PotionCmd.java +++ b/src/main/java/net/wurstclient/commands/PotionCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/ProtectCmd.java b/src/main/java/net/wurstclient/commands/ProtectCmd.java index 67e716cf..0f1df701 100644 --- a/src/main/java/net/wurstclient/commands/ProtectCmd.java +++ b/src/main/java/net/wurstclient/commands/ProtectCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/RenameCmd.java b/src/main/java/net/wurstclient/commands/RenameCmd.java index 7700a682..d7c96a08 100644 --- a/src/main/java/net/wurstclient/commands/RenameCmd.java +++ b/src/main/java/net/wurstclient/commands/RenameCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/RepairCmd.java b/src/main/java/net/wurstclient/commands/RepairCmd.java index 7e3b440a..2975fa0c 100644 --- a/src/main/java/net/wurstclient/commands/RepairCmd.java +++ b/src/main/java/net/wurstclient/commands/RepairCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/RvCmd.java b/src/main/java/net/wurstclient/commands/RvCmd.java index dcb9fe12..8aabcb97 100644 --- a/src/main/java/net/wurstclient/commands/RvCmd.java +++ b/src/main/java/net/wurstclient/commands/RvCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/SayCmd.java b/src/main/java/net/wurstclient/commands/SayCmd.java index cc196cd6..0531ed55 100644 --- a/src/main/java/net/wurstclient/commands/SayCmd.java +++ b/src/main/java/net/wurstclient/commands/SayCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/SetBlockCmd.java b/src/main/java/net/wurstclient/commands/SetBlockCmd.java index 69ffbfa1..f1f857b9 100644 --- a/src/main/java/net/wurstclient/commands/SetBlockCmd.java +++ b/src/main/java/net/wurstclient/commands/SetBlockCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/SetCheckboxCmd.java b/src/main/java/net/wurstclient/commands/SetCheckboxCmd.java index 5199c8e6..92ff2397 100644 --- a/src/main/java/net/wurstclient/commands/SetCheckboxCmd.java +++ b/src/main/java/net/wurstclient/commands/SetCheckboxCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/SetColorCmd.java b/src/main/java/net/wurstclient/commands/SetColorCmd.java index 35bdd318..71d0a996 100644 --- a/src/main/java/net/wurstclient/commands/SetColorCmd.java +++ b/src/main/java/net/wurstclient/commands/SetColorCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/SetModeCmd.java b/src/main/java/net/wurstclient/commands/SetModeCmd.java index 8093b0fa..4191df3d 100644 --- a/src/main/java/net/wurstclient/commands/SetModeCmd.java +++ b/src/main/java/net/wurstclient/commands/SetModeCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/SetSliderCmd.java b/src/main/java/net/wurstclient/commands/SetSliderCmd.java index c3d023e0..b30840c4 100644 --- a/src/main/java/net/wurstclient/commands/SetSliderCmd.java +++ b/src/main/java/net/wurstclient/commands/SetSliderCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/SettingsCmd.java b/src/main/java/net/wurstclient/commands/SettingsCmd.java index 40c257a0..7f8918f3 100644 --- a/src/main/java/net/wurstclient/commands/SettingsCmd.java +++ b/src/main/java/net/wurstclient/commands/SettingsCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/SvCmd.java b/src/main/java/net/wurstclient/commands/SvCmd.java index 18a6e67c..c54aad21 100644 --- a/src/main/java/net/wurstclient/commands/SvCmd.java +++ b/src/main/java/net/wurstclient/commands/SvCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/TCmd.java b/src/main/java/net/wurstclient/commands/TCmd.java index 8ee199ec..305d7775 100644 --- a/src/main/java/net/wurstclient/commands/TCmd.java +++ b/src/main/java/net/wurstclient/commands/TCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/TacoCmd.java b/src/main/java/net/wurstclient/commands/TacoCmd.java index 2a5745ef..19f83651 100644 --- a/src/main/java/net/wurstclient/commands/TacoCmd.java +++ b/src/main/java/net/wurstclient/commands/TacoCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/TooManyHaxCmd.java b/src/main/java/net/wurstclient/commands/TooManyHaxCmd.java index 860a07c3..f92d45b1 100644 --- a/src/main/java/net/wurstclient/commands/TooManyHaxCmd.java +++ b/src/main/java/net/wurstclient/commands/TooManyHaxCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/TpCmd.java b/src/main/java/net/wurstclient/commands/TpCmd.java index d45a3fd4..f3cc4f66 100644 --- a/src/main/java/net/wurstclient/commands/TpCmd.java +++ b/src/main/java/net/wurstclient/commands/TpCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/UnbindCmd.java b/src/main/java/net/wurstclient/commands/UnbindCmd.java index 25b56582..b57f9116 100644 --- a/src/main/java/net/wurstclient/commands/UnbindCmd.java +++ b/src/main/java/net/wurstclient/commands/UnbindCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/VClipCmd.java b/src/main/java/net/wurstclient/commands/VClipCmd.java index 23045ac1..6d84f8fd 100644 --- a/src/main/java/net/wurstclient/commands/VClipCmd.java +++ b/src/main/java/net/wurstclient/commands/VClipCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/ViewNbtCmd.java b/src/main/java/net/wurstclient/commands/ViewNbtCmd.java index e72b0e8a..da69ec56 100644 --- a/src/main/java/net/wurstclient/commands/ViewNbtCmd.java +++ b/src/main/java/net/wurstclient/commands/ViewNbtCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/commands/XrayCmd.java b/src/main/java/net/wurstclient/commands/XrayCmd.java index 7775a9e2..3d571c02 100644 --- a/src/main/java/net/wurstclient/commands/XrayCmd.java +++ b/src/main/java/net/wurstclient/commands/XrayCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/event/CancellableEvent.java b/src/main/java/net/wurstclient/event/CancellableEvent.java index c2a2c529..4a1c6170 100644 --- a/src/main/java/net/wurstclient/event/CancellableEvent.java +++ b/src/main/java/net/wurstclient/event/CancellableEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/event/Event.java b/src/main/java/net/wurstclient/event/Event.java index 292b393b..66074756 100644 --- a/src/main/java/net/wurstclient/event/Event.java +++ b/src/main/java/net/wurstclient/event/Event.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/event/EventManager.java b/src/main/java/net/wurstclient/event/EventManager.java index 071f52c2..e5aaec77 100644 --- a/src/main/java/net/wurstclient/event/EventManager.java +++ b/src/main/java/net/wurstclient/event/EventManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/event/Listener.java b/src/main/java/net/wurstclient/event/Listener.java index 49488f07..4a396837 100644 --- a/src/main/java/net/wurstclient/event/Listener.java +++ b/src/main/java/net/wurstclient/event/Listener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/AirStrafingSpeedListener.java b/src/main/java/net/wurstclient/events/AirStrafingSpeedListener.java index d1ff3dbc..2f9b500b 100644 --- a/src/main/java/net/wurstclient/events/AirStrafingSpeedListener.java +++ b/src/main/java/net/wurstclient/events/AirStrafingSpeedListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/BlockBreakingProgressListener.java b/src/main/java/net/wurstclient/events/BlockBreakingProgressListener.java index 97687e3b..14eb4f1f 100644 --- a/src/main/java/net/wurstclient/events/BlockBreakingProgressListener.java +++ b/src/main/java/net/wurstclient/events/BlockBreakingProgressListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/CactusCollisionShapeListener.java b/src/main/java/net/wurstclient/events/CactusCollisionShapeListener.java index f597f540..5c7150bf 100644 --- a/src/main/java/net/wurstclient/events/CactusCollisionShapeListener.java +++ b/src/main/java/net/wurstclient/events/CactusCollisionShapeListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/CameraTransformViewBobbingListener.java b/src/main/java/net/wurstclient/events/CameraTransformViewBobbingListener.java index ff3a980a..52a2957f 100644 --- a/src/main/java/net/wurstclient/events/CameraTransformViewBobbingListener.java +++ b/src/main/java/net/wurstclient/events/CameraTransformViewBobbingListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/ChatInputListener.java b/src/main/java/net/wurstclient/events/ChatInputListener.java index ba661e77..8743f04f 100644 --- a/src/main/java/net/wurstclient/events/ChatInputListener.java +++ b/src/main/java/net/wurstclient/events/ChatInputListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/ChatOutputListener.java b/src/main/java/net/wurstclient/events/ChatOutputListener.java index e2f24a77..2e8c002a 100644 --- a/src/main/java/net/wurstclient/events/ChatOutputListener.java +++ b/src/main/java/net/wurstclient/events/ChatOutputListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/ConnectionPacketOutputListener.java b/src/main/java/net/wurstclient/events/ConnectionPacketOutputListener.java index ff15e6cd..9d2dc22d 100644 --- a/src/main/java/net/wurstclient/events/ConnectionPacketOutputListener.java +++ b/src/main/java/net/wurstclient/events/ConnectionPacketOutputListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/DeathListener.java b/src/main/java/net/wurstclient/events/DeathListener.java index 5c5f170a..d602d3fb 100644 --- a/src/main/java/net/wurstclient/events/DeathListener.java +++ b/src/main/java/net/wurstclient/events/DeathListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/GUIRenderListener.java b/src/main/java/net/wurstclient/events/GUIRenderListener.java index 8fd0a170..8a52585b 100644 --- a/src/main/java/net/wurstclient/events/GUIRenderListener.java +++ b/src/main/java/net/wurstclient/events/GUIRenderListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/GetAmbientOcclusionLightLevelListener.java b/src/main/java/net/wurstclient/events/GetAmbientOcclusionLightLevelListener.java index f887888d..a0d50fb7 100644 --- a/src/main/java/net/wurstclient/events/GetAmbientOcclusionLightLevelListener.java +++ b/src/main/java/net/wurstclient/events/GetAmbientOcclusionLightLevelListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/HitResultRayTraceListener.java b/src/main/java/net/wurstclient/events/HitResultRayTraceListener.java index 84f55dd5..e67b2d42 100644 --- a/src/main/java/net/wurstclient/events/HitResultRayTraceListener.java +++ b/src/main/java/net/wurstclient/events/HitResultRayTraceListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/IsNormalCubeListener.java b/src/main/java/net/wurstclient/events/IsNormalCubeListener.java index 8f0fd29f..a81ae8ad 100644 --- a/src/main/java/net/wurstclient/events/IsNormalCubeListener.java +++ b/src/main/java/net/wurstclient/events/IsNormalCubeListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/IsPlayerInLavaListener.java b/src/main/java/net/wurstclient/events/IsPlayerInLavaListener.java index 50b755f4..c306753b 100644 --- a/src/main/java/net/wurstclient/events/IsPlayerInLavaListener.java +++ b/src/main/java/net/wurstclient/events/IsPlayerInLavaListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/IsPlayerInWaterListener.java b/src/main/java/net/wurstclient/events/IsPlayerInWaterListener.java index 9b6e0476..0befb70c 100644 --- a/src/main/java/net/wurstclient/events/IsPlayerInWaterListener.java +++ b/src/main/java/net/wurstclient/events/IsPlayerInWaterListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/KeyPressListener.java b/src/main/java/net/wurstclient/events/KeyPressListener.java index 446fc423..0193afaa 100644 --- a/src/main/java/net/wurstclient/events/KeyPressListener.java +++ b/src/main/java/net/wurstclient/events/KeyPressListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/KnockbackListener.java b/src/main/java/net/wurstclient/events/KnockbackListener.java index ddfd71f9..ff977a74 100644 --- a/src/main/java/net/wurstclient/events/KnockbackListener.java +++ b/src/main/java/net/wurstclient/events/KnockbackListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/LeftClickListener.java b/src/main/java/net/wurstclient/events/LeftClickListener.java index 606ba14d..7fe069ac 100644 --- a/src/main/java/net/wurstclient/events/LeftClickListener.java +++ b/src/main/java/net/wurstclient/events/LeftClickListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/MouseScrollListener.java b/src/main/java/net/wurstclient/events/MouseScrollListener.java index 0a9ea5c2..0a58d222 100644 --- a/src/main/java/net/wurstclient/events/MouseScrollListener.java +++ b/src/main/java/net/wurstclient/events/MouseScrollListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/PacketInputListener.java b/src/main/java/net/wurstclient/events/PacketInputListener.java index a6d128d0..ab6eb28c 100644 --- a/src/main/java/net/wurstclient/events/PacketInputListener.java +++ b/src/main/java/net/wurstclient/events/PacketInputListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/PacketOutputListener.java b/src/main/java/net/wurstclient/events/PacketOutputListener.java index a80899f7..e3a59bf5 100644 --- a/src/main/java/net/wurstclient/events/PacketOutputListener.java +++ b/src/main/java/net/wurstclient/events/PacketOutputListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/PlayerMoveListener.java b/src/main/java/net/wurstclient/events/PlayerMoveListener.java index 8b79bb2f..dedd9236 100644 --- a/src/main/java/net/wurstclient/events/PlayerMoveListener.java +++ b/src/main/java/net/wurstclient/events/PlayerMoveListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/PostMotionListener.java b/src/main/java/net/wurstclient/events/PostMotionListener.java index de633983..be292e71 100644 --- a/src/main/java/net/wurstclient/events/PostMotionListener.java +++ b/src/main/java/net/wurstclient/events/PostMotionListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/PreMotionListener.java b/src/main/java/net/wurstclient/events/PreMotionListener.java index 81a73b07..416fbc2d 100644 --- a/src/main/java/net/wurstclient/events/PreMotionListener.java +++ b/src/main/java/net/wurstclient/events/PreMotionListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/RenderBlockEntityListener.java b/src/main/java/net/wurstclient/events/RenderBlockEntityListener.java index 9485c943..1268bd13 100644 --- a/src/main/java/net/wurstclient/events/RenderBlockEntityListener.java +++ b/src/main/java/net/wurstclient/events/RenderBlockEntityListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/RenderListener.java b/src/main/java/net/wurstclient/events/RenderListener.java index 49814516..02a82c01 100644 --- a/src/main/java/net/wurstclient/events/RenderListener.java +++ b/src/main/java/net/wurstclient/events/RenderListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/RightClickListener.java b/src/main/java/net/wurstclient/events/RightClickListener.java index 4c1fdad7..b0ebad56 100644 --- a/src/main/java/net/wurstclient/events/RightClickListener.java +++ b/src/main/java/net/wurstclient/events/RightClickListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/SetOpaqueCubeListener.java b/src/main/java/net/wurstclient/events/SetOpaqueCubeListener.java index 2843e273..22b17eb9 100644 --- a/src/main/java/net/wurstclient/events/SetOpaqueCubeListener.java +++ b/src/main/java/net/wurstclient/events/SetOpaqueCubeListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/ShouldDrawSideListener.java b/src/main/java/net/wurstclient/events/ShouldDrawSideListener.java index bd0744a2..2f5e51ba 100644 --- a/src/main/java/net/wurstclient/events/ShouldDrawSideListener.java +++ b/src/main/java/net/wurstclient/events/ShouldDrawSideListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/StopUsingItemListener.java b/src/main/java/net/wurstclient/events/StopUsingItemListener.java index 19b72d00..96550e7c 100644 --- a/src/main/java/net/wurstclient/events/StopUsingItemListener.java +++ b/src/main/java/net/wurstclient/events/StopUsingItemListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/UpdateListener.java b/src/main/java/net/wurstclient/events/UpdateListener.java index a3d7a5fa..043c4c38 100644 --- a/src/main/java/net/wurstclient/events/UpdateListener.java +++ b/src/main/java/net/wurstclient/events/UpdateListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/VelocityFromEntityCollisionListener.java b/src/main/java/net/wurstclient/events/VelocityFromEntityCollisionListener.java index 9e08a725..369b1d28 100644 --- a/src/main/java/net/wurstclient/events/VelocityFromEntityCollisionListener.java +++ b/src/main/java/net/wurstclient/events/VelocityFromEntityCollisionListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/events/VelocityFromFluidListener.java b/src/main/java/net/wurstclient/events/VelocityFromFluidListener.java index 7a557876..cde8fb3a 100644 --- a/src/main/java/net/wurstclient/events/VelocityFromFluidListener.java +++ b/src/main/java/net/wurstclient/events/VelocityFromFluidListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hack/DontSaveState.java b/src/main/java/net/wurstclient/hack/DontSaveState.java index fc39f93c..4ffdb005 100644 --- a/src/main/java/net/wurstclient/hack/DontSaveState.java +++ b/src/main/java/net/wurstclient/hack/DontSaveState.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hack/EnabledHacksFile.java b/src/main/java/net/wurstclient/hack/EnabledHacksFile.java index 4773798c..2fafb1eb 100644 --- a/src/main/java/net/wurstclient/hack/EnabledHacksFile.java +++ b/src/main/java/net/wurstclient/hack/EnabledHacksFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hack/Hack.java b/src/main/java/net/wurstclient/hack/Hack.java index 44ae05ff..05c0805f 100644 --- a/src/main/java/net/wurstclient/hack/Hack.java +++ b/src/main/java/net/wurstclient/hack/Hack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hack/HackList.java b/src/main/java/net/wurstclient/hack/HackList.java index 97e3f890..94527624 100644 --- a/src/main/java/net/wurstclient/hack/HackList.java +++ b/src/main/java/net/wurstclient/hack/HackList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -134,6 +134,7 @@ public final class HackList implements UpdateListener public final NoClipHack noClipHack = new NoClipHack(); public final NoFallHack noFallHack = new NoFallHack(); public final NoFireOverlayHack noFireOverlayHack = new NoFireOverlayHack(); + public final NoFogHack noFogHack = new NoFogHack(); public final NoHurtcamHack noHurtcamHack = new NoHurtcamHack(); public final NoLevitationHack noLevitationHack = new NoLevitationHack(); public final NoOverlayHack noOverlayHack = new NoOverlayHack(); diff --git a/src/main/java/net/wurstclient/hacks/AimAssistHack.java b/src/main/java/net/wurstclient/hacks/AimAssistHack.java index 25d4f050..ef9c8a81 100644 --- a/src/main/java/net/wurstclient/hacks/AimAssistHack.java +++ b/src/main/java/net/wurstclient/hacks/AimAssistHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -27,8 +27,8 @@ import net.wurstclient.settings.filterlists.EntityFilterList; import net.wurstclient.settings.filters.*; import net.wurstclient.util.BlockUtils; import net.wurstclient.util.EntityUtils; +import net.wurstclient.util.Rotation; import net.wurstclient.util.RotationUtils; -import net.wurstclient.util.RotationUtils.Rotation; public final class AimAssistHack extends Hack implements UpdateListener, RenderListener @@ -97,7 +97,8 @@ public final class AimAssistHack extends Hack @Override protected void onEnable() { - // disable other killauras + // disable incompatible hacks + WURST.getHax().autoFishHack.setEnabled(false); WURST.getHax().clickAuraHack.setEnabled(false); WURST.getHax().crystalAuraHack.setEnabled(false); WURST.getHax().fightBotHack.setEnabled(false); @@ -163,8 +164,8 @@ public final class AimAssistHack extends Hack // turn towards center of boundingBox Rotation next = RotationUtils.slowlyTurnTowards(needed, rotationSpeed.getValueI() / 20F); - nextYaw = next.getYaw(); - nextPitch = next.getPitch(); + nextYaw = next.yaw(); + nextPitch = next.pitch(); // check if facing center if(RotationUtils.isAlreadyFacing(needed)) diff --git a/src/main/java/net/wurstclient/hacks/AirPlaceHack.java b/src/main/java/net/wurstclient/hacks/AirPlaceHack.java index 08b952e0..d0b4e564 100644 --- a/src/main/java/net/wurstclient/hacks/AirPlaceHack.java +++ b/src/main/java/net/wurstclient/hacks/AirPlaceHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AnchorAuraHack.java b/src/main/java/net/wurstclient/hacks/AnchorAuraHack.java index 824fa692..5c2d9c46 100644 --- a/src/main/java/net/wurstclient/hacks/AnchorAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/AnchorAuraHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AntiAfkHack.java b/src/main/java/net/wurstclient/hacks/AntiAfkHack.java index e6d7b849..d13341c3 100644 --- a/src/main/java/net/wurstclient/hacks/AntiAfkHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiAfkHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -61,6 +61,8 @@ public final class AntiAfkHack extends Hack pathFinder = new RandomPathFinder(start); creativeFlying = MC.player.getAbilities().flying; + WURST.getHax().autoFishHack.setEnabled(false); + EVENTS.add(UpdateListener.class, this); EVENTS.add(RenderListener.class, this); } diff --git a/src/main/java/net/wurstclient/hacks/AntiBlindHack.java b/src/main/java/net/wurstclient/hacks/AntiBlindHack.java index fc76a3a2..b0b8218c 100644 --- a/src/main/java/net/wurstclient/hacks/AntiBlindHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiBlindHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AntiCactusHack.java b/src/main/java/net/wurstclient/hacks/AntiCactusHack.java index f872c1f2..de638da8 100644 --- a/src/main/java/net/wurstclient/hacks/AntiCactusHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiCactusHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AntiEntityPushHack.java b/src/main/java/net/wurstclient/hacks/AntiEntityPushHack.java index cb714383..ac3ff3f3 100644 --- a/src/main/java/net/wurstclient/hacks/AntiEntityPushHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiEntityPushHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AntiHungerHack.java b/src/main/java/net/wurstclient/hacks/AntiHungerHack.java index 1cd41f90..2585f059 100644 --- a/src/main/java/net/wurstclient/hacks/AntiHungerHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiHungerHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AntiKnockbackHack.java b/src/main/java/net/wurstclient/hacks/AntiKnockbackHack.java index 3898436f..99bdfd1d 100644 --- a/src/main/java/net/wurstclient/hacks/AntiKnockbackHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiKnockbackHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AntiSpamHack.java b/src/main/java/net/wurstclient/hacks/AntiSpamHack.java index 5328caa0..efae48f6 100644 --- a/src/main/java/net/wurstclient/hacks/AntiSpamHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiSpamHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AntiWaterPushHack.java b/src/main/java/net/wurstclient/hacks/AntiWaterPushHack.java index fded3d56..f0637245 100644 --- a/src/main/java/net/wurstclient/hacks/AntiWaterPushHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiWaterPushHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AntiWobbleHack.java b/src/main/java/net/wurstclient/hacks/AntiWobbleHack.java index 7e6d0bed..6be58786 100644 --- a/src/main/java/net/wurstclient/hacks/AntiWobbleHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiWobbleHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/ArrowDmgHack.java b/src/main/java/net/wurstclient/hacks/ArrowDmgHack.java index 1c9acf93..d94f72ce 100644 --- a/src/main/java/net/wurstclient/hacks/ArrowDmgHack.java +++ b/src/main/java/net/wurstclient/hacks/ArrowDmgHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AutoArmorHack.java b/src/main/java/net/wurstclient/hacks/AutoArmorHack.java index e230ef52..0e609ad2 100644 --- a/src/main/java/net/wurstclient/hacks/AutoArmorHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoArmorHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AutoBuildHack.java b/src/main/java/net/wurstclient/hacks/AutoBuildHack.java index 021d196c..6139831a 100644 --- a/src/main/java/net/wurstclient/hacks/AutoBuildHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoBuildHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -19,7 +19,6 @@ import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.block.BlockState; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.util.Hand; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.HitResult; @@ -43,7 +42,6 @@ import net.wurstclient.util.DefaultAutoBuildTemplates; import net.wurstclient.util.RegionPos; import net.wurstclient.util.RenderUtils; import net.wurstclient.util.RotationUtils; -import net.wurstclient.util.RotationUtils.Rotation; import net.wurstclient.util.json.JsonException; public final class AutoBuildHack extends Hack @@ -257,11 +255,7 @@ public final class AutoBuildHack extends Hack continue; // face block - Rotation rotation = RotationUtils.getNeededRotations(hitVec); - PlayerMoveC2SPacket.LookAndOnGround packet = - new PlayerMoveC2SPacket.LookAndOnGround(rotation.getYaw(), - rotation.getPitch(), MC.player.isOnGround()); - MC.player.networkHandler.sendPacket(packet); + RotationUtils.getNeededRotations(hitVec).sendPlayerLookPacket(); // place block IMC.getInteractionManager().rightClickBlock(neighbor, diff --git a/src/main/java/net/wurstclient/hacks/AutoCompleteHack.java b/src/main/java/net/wurstclient/hacks/AutoCompleteHack.java index 32e7b309..800a2e6d 100644 --- a/src/main/java/net/wurstclient/hacks/AutoCompleteHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoCompleteHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AutoDropHack.java b/src/main/java/net/wurstclient/hacks/AutoDropHack.java index 228b31ad..61bccfe3 100644 --- a/src/main/java/net/wurstclient/hacks/AutoDropHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoDropHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AutoEatHack.java b/src/main/java/net/wurstclient/hacks/AutoEatHack.java index 488858cd..c038007f 100644 --- a/src/main/java/net/wurstclient/hacks/AutoEatHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoEatHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AutoFarmHack.java b/src/main/java/net/wurstclient/hacks/AutoFarmHack.java index 94062549..9d232d90 100644 --- a/src/main/java/net/wurstclient/hacks/AutoFarmHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoFarmHack.java @@ -1,371 +1,371 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.hacks; - -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import net.minecraft.block.*; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.item.Item; -import net.minecraft.item.Items; -import net.minecraft.network.packet.c2s.play.HandSwingC2SPacket; -import net.minecraft.registry.tag.BlockTags; -import net.minecraft.util.ActionResult; -import net.minecraft.util.Hand; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; -import net.wurstclient.Category; -import net.wurstclient.SearchTags; -import net.wurstclient.events.RenderListener; -import net.wurstclient.events.UpdateListener; -import net.wurstclient.hack.Hack; -import net.wurstclient.hacks.autofarm.AutoFarmRenderer; -import net.wurstclient.settings.CheckboxSetting; -import net.wurstclient.settings.SliderSetting; -import net.wurstclient.settings.SliderSetting.ValueDisplay; -import net.wurstclient.util.BlockBreaker; -import net.wurstclient.util.BlockPlacer; -import net.wurstclient.util.BlockPlacer.BlockPlacingParams; -import net.wurstclient.util.BlockUtils; -import net.wurstclient.util.InventoryUtils; -import net.wurstclient.util.OverlayRenderer; -import net.wurstclient.util.RotationUtils; - -@SearchTags({"auto farm", "AutoHarvest", "auto harvest"}) -public final class AutoFarmHack extends Hack - implements UpdateListener, RenderListener -{ - private final SliderSetting range = - new SliderSetting("Range", 5, 1, 6, 0.05, ValueDisplay.DECIMAL); - - private final CheckboxSetting replant = - new CheckboxSetting("Replant", true); - - private final HashMap seeds = new HashMap<>(); - { - seeds.put(Blocks.WHEAT, Items.WHEAT_SEEDS); - seeds.put(Blocks.CARROTS, Items.CARROT); - seeds.put(Blocks.POTATOES, Items.POTATO); - seeds.put(Blocks.BEETROOTS, Items.BEETROOT_SEEDS); - seeds.put(Blocks.PUMPKIN_STEM, Items.PUMPKIN_SEEDS); - seeds.put(Blocks.MELON_STEM, Items.MELON_SEEDS); - seeds.put(Blocks.NETHER_WART, Items.NETHER_WART); - seeds.put(Blocks.COCOA, Items.COCOA_BEANS); - } - - private final HashMap plants = new HashMap<>(); - private final ArrayDeque> prevBlocks = new ArrayDeque<>(); - private BlockPos currentlyHarvesting; - - private final AutoFarmRenderer renderer = new AutoFarmRenderer(); - private final OverlayRenderer overlay = new OverlayRenderer(); - - private boolean busy; - - public AutoFarmHack() - { - super("AutoFarm"); - - setCategory(Category.BLOCKS); - addSetting(range); - addSetting(replant); - } - - @Override - public void onEnable() - { - plants.clear(); - - EVENTS.add(UpdateListener.class, this); - EVENTS.add(RenderListener.class, this); - } - - @Override - public void onDisable() - { - EVENTS.remove(UpdateListener.class, this); - EVENTS.remove(RenderListener.class, this); - - if(currentlyHarvesting != null) - { - MC.interactionManager.breakingBlock = true; - MC.interactionManager.cancelBlockBreaking(); - currentlyHarvesting = null; - } - - prevBlocks.clear(); - overlay.resetProgress(); - busy = false; - - renderer.reset(); - } - - @Override - public void onUpdate() - { - currentlyHarvesting = null; - Vec3d eyesVec = RotationUtils.getEyesPos().subtract(0.5, 0.5, 0.5); - BlockPos eyesBlock = BlockPos.ofFloored(RotationUtils.getEyesPos()); - double rangeSq = range.getValueSq(); - int blockRange = range.getValueCeil(); - - // get nearby, non-empty blocks - ArrayList blocks = BlockUtils - .getAllInBoxStream(eyesBlock, blockRange) - .filter(pos -> eyesVec.squaredDistanceTo(Vec3d.of(pos)) <= rangeSq) - .filter(BlockUtils::canBeClicked) - .collect(Collectors.toCollection(ArrayList::new)); - - // check for any new plants and add them to the map - updatePlants(blocks); - - ArrayList blocksToHarvest = new ArrayList<>(); - ArrayList blocksToReplant = new ArrayList<>(); - - // don't place or break any blocks while Freecam is enabled - if(!WURST.getHax().freecamHack.isEnabled()) - { - // check which of the nearby blocks can be harvested - blocksToHarvest = getBlocksToHarvest(eyesVec, blocks); - - // do a new search to find empty blocks that can be replanted - if(replant.isChecked()) - blocksToReplant = - getBlocksToReplant(eyesVec, eyesBlock, rangeSq, blockRange); - } - - // first, try to replant - boolean replanting = replant(blocksToReplant); - - // if we can't replant, harvest instead - if(!replanting) - harvest(blocksToHarvest); - - // upate busy state - busy = replanting || currentlyHarvesting != null; - - // update renderer - renderer.updateVertexBuffers(blocksToHarvest, plants.keySet(), - blocksToReplant); - } - - @Override - public void onRender(MatrixStack matrixStack, float partialTicks) - { - renderer.render(matrixStack); - overlay.render(matrixStack, partialTicks, currentlyHarvesting); - } - - /** - * Returns true if AutoFarm is currently harvesting or replanting something. - */ - public boolean isBusy() - { - return busy; - } - - private void updatePlants(List blocks) - { - for(BlockPos pos : blocks) - { - Item seed = seeds.get(BlockUtils.getBlock(pos)); - if(seed == null) - continue; - - plants.put(pos, seed); - } - } - - private ArrayList getBlocksToHarvest(Vec3d eyesVec, - ArrayList blocks) - { - return blocks.parallelStream().filter(this::shouldBeHarvested) - .sorted(Comparator.comparingDouble( - pos -> eyesVec.squaredDistanceTo(Vec3d.of(pos)))) - .collect(Collectors.toCollection(ArrayList::new)); - } - - private boolean shouldBeHarvested(BlockPos pos) - { - Block block = BlockUtils.getBlock(pos); - BlockState state = BlockUtils.getState(pos); - - if(block instanceof CropBlock) - return ((CropBlock)block).isMature(state); - - if(block instanceof NetherWartBlock) - return state.get(NetherWartBlock.AGE) >= 3; - - if(block instanceof CocoaBlock) - return state.get(CocoaBlock.AGE) >= 2; - - if(block instanceof GourdBlock) - return true; - - if(block instanceof SugarCaneBlock) - return BlockUtils.getBlock(pos.down()) instanceof SugarCaneBlock - && !(BlockUtils - .getBlock(pos.down(2)) instanceof SugarCaneBlock); - - if(block instanceof CactusBlock) - return BlockUtils.getBlock(pos.down()) instanceof CactusBlock - && !(BlockUtils.getBlock(pos.down(2)) instanceof CactusBlock); - - if(block instanceof KelpPlantBlock) - return BlockUtils.getBlock(pos.down()) instanceof KelpPlantBlock - && !(BlockUtils - .getBlock(pos.down(2)) instanceof KelpPlantBlock); - - if(block instanceof BambooBlock) - return BlockUtils.getBlock(pos.down()) instanceof BambooBlock - && !(BlockUtils.getBlock(pos.down(2)) instanceof BambooBlock); - - return false; - } - - private ArrayList getBlocksToReplant(Vec3d eyesVec, - BlockPos eyesBlock, double rangeSq, int blockRange) - { - return BlockUtils.getAllInBoxStream(eyesBlock, blockRange) - .filter(pos -> eyesVec.squaredDistanceTo(Vec3d.of(pos)) <= rangeSq) - .filter(pos -> BlockUtils.getState(pos).isReplaceable()) - .filter(pos -> plants.containsKey(pos)).filter(this::canBeReplanted) - .sorted(Comparator.comparingDouble( - pos -> eyesVec.squaredDistanceTo(Vec3d.of(pos)))) - .collect(Collectors.toCollection(ArrayList::new)); - } - - private boolean canBeReplanted(BlockPos pos) - { - Item item = plants.get(pos); - - if(item == Items.WHEAT_SEEDS || item == Items.CARROT - || item == Items.POTATO || item == Items.BEETROOT_SEEDS - || item == Items.PUMPKIN_SEEDS || item == Items.MELON_SEEDS) - return BlockUtils.getBlock(pos.down()) instanceof FarmlandBlock; - - if(item == Items.NETHER_WART) - return BlockUtils.getBlock(pos.down()) instanceof SoulSandBlock; - - if(item == Items.COCOA_BEANS) - return BlockUtils.getState(pos.north()).isIn(BlockTags.JUNGLE_LOGS) - || BlockUtils.getState(pos.east()).isIn(BlockTags.JUNGLE_LOGS) - || BlockUtils.getState(pos.south()).isIn(BlockTags.JUNGLE_LOGS) - || BlockUtils.getState(pos.west()).isIn(BlockTags.JUNGLE_LOGS); - - return false; - } - - private boolean replant(List blocksToReplant) - { - // check cooldown - if(MC.itemUseCooldown > 0) - return false; - - // check if already holding one of the seeds needed for blocksToReplant - Optional heldSeed = blocksToReplant.stream().map(plants::get) - .distinct().filter(item -> MC.player.isHolding(item)).findFirst(); - - // if so, try to replant the blocks that need that seed - if(heldSeed.isPresent()) - { - // get the seed and the hand that is holding it - Item item = heldSeed.get(); - Hand hand = MC.player.getMainHandStack().isOf(item) ? Hand.MAIN_HAND - : Hand.OFF_HAND; - - // filter out blocks that need a different seed - ArrayList blocksToReplantWithHeldSeed = - blocksToReplant.stream().filter(pos -> plants.get(pos) == item) - .collect(Collectors.toCollection(ArrayList::new)); - - for(BlockPos pos : blocksToReplantWithHeldSeed) - { - // skip over blocks that we can't reach - BlockPlacingParams params = - BlockPlacer.getBlockPlacingParams(pos); - if(params == null || params.distanceSq() > range.getValueSq()) - continue; - - // face block - WURST.getRotationFaker().faceVectorPacket(params.hitVec()); - - // place seed - ActionResult result = MC.interactionManager - .interactBlock(MC.player, hand, params.toHitResult()); - - // swing arm - if(result.isAccepted() && result.shouldSwingHand()) - MC.player.networkHandler - .sendPacket(new HandSwingC2SPacket(hand)); - - // reset cooldown - MC.itemUseCooldown = 4; - return true; - } - } - - // otherwise, find a block that we can reach and have seeds for - for(BlockPos pos : blocksToReplant) - { - // skip over blocks that we can't reach - BlockPlacingParams params = BlockPlacer.getBlockPlacingParams(pos); - if(params == null || params.distanceSq() > range.getValueSq()) - continue; - - // try to select the seed (returns false if we don't have it) - Item item = plants.get(pos); - if(InventoryUtils.selectItem(item)) - return true; - } - - // if we couldn't replant anything, return false - return false; - } - - private void harvest(List blocksToHarvest) - { - if(MC.player.getAbilities().creativeMode) - { - Stream stream = blocksToHarvest.parallelStream(); - for(Set set : prevBlocks) - stream = stream.filter(pos -> !set.contains(pos)); - List filteredBlocks = stream.collect(Collectors.toList()); - - prevBlocks.addLast(new HashSet<>(filteredBlocks)); - while(prevBlocks.size() > 5) - prevBlocks.removeFirst(); - - if(!filteredBlocks.isEmpty()) - currentlyHarvesting = filteredBlocks.get(0); - - MC.interactionManager.cancelBlockBreaking(); - overlay.resetProgress(); - BlockBreaker.breakBlocksWithPacketSpam(filteredBlocks); - return; - } - - for(BlockPos pos : blocksToHarvest) - if(BlockBreaker.breakOneBlock(pos)) - { - currentlyHarvesting = pos; - break; - } - - if(currentlyHarvesting == null) - MC.interactionManager.cancelBlockBreaking(); - - if(currentlyHarvesting != null - && BlockUtils.getHardness(currentlyHarvesting) < 1) - overlay.updateProgress(); - else - overlay.resetProgress(); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.hacks; + +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import net.minecraft.block.*; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.item.Item; +import net.minecraft.item.Items; +import net.minecraft.network.packet.c2s.play.HandSwingC2SPacket; +import net.minecraft.registry.tag.BlockTags; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Hand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; +import net.wurstclient.Category; +import net.wurstclient.SearchTags; +import net.wurstclient.events.RenderListener; +import net.wurstclient.events.UpdateListener; +import net.wurstclient.hack.Hack; +import net.wurstclient.hacks.autofarm.AutoFarmRenderer; +import net.wurstclient.settings.CheckboxSetting; +import net.wurstclient.settings.SliderSetting; +import net.wurstclient.settings.SliderSetting.ValueDisplay; +import net.wurstclient.util.BlockBreaker; +import net.wurstclient.util.BlockPlacer; +import net.wurstclient.util.BlockPlacer.BlockPlacingParams; +import net.wurstclient.util.BlockUtils; +import net.wurstclient.util.InventoryUtils; +import net.wurstclient.util.OverlayRenderer; +import net.wurstclient.util.RotationUtils; + +@SearchTags({"auto farm", "AutoHarvest", "auto harvest"}) +public final class AutoFarmHack extends Hack + implements UpdateListener, RenderListener +{ + private final SliderSetting range = + new SliderSetting("Range", 5, 1, 6, 0.05, ValueDisplay.DECIMAL); + + private final CheckboxSetting replant = + new CheckboxSetting("Replant", true); + + private final HashMap seeds = new HashMap<>(); + { + seeds.put(Blocks.WHEAT, Items.WHEAT_SEEDS); + seeds.put(Blocks.CARROTS, Items.CARROT); + seeds.put(Blocks.POTATOES, Items.POTATO); + seeds.put(Blocks.BEETROOTS, Items.BEETROOT_SEEDS); + seeds.put(Blocks.PUMPKIN_STEM, Items.PUMPKIN_SEEDS); + seeds.put(Blocks.MELON_STEM, Items.MELON_SEEDS); + seeds.put(Blocks.NETHER_WART, Items.NETHER_WART); + seeds.put(Blocks.COCOA, Items.COCOA_BEANS); + } + + private final HashMap plants = new HashMap<>(); + private final ArrayDeque> prevBlocks = new ArrayDeque<>(); + private BlockPos currentlyHarvesting; + + private final AutoFarmRenderer renderer = new AutoFarmRenderer(); + private final OverlayRenderer overlay = new OverlayRenderer(); + + private boolean busy; + + public AutoFarmHack() + { + super("AutoFarm"); + + setCategory(Category.BLOCKS); + addSetting(range); + addSetting(replant); + } + + @Override + public void onEnable() + { + plants.clear(); + + EVENTS.add(UpdateListener.class, this); + EVENTS.add(RenderListener.class, this); + } + + @Override + public void onDisable() + { + EVENTS.remove(UpdateListener.class, this); + EVENTS.remove(RenderListener.class, this); + + if(currentlyHarvesting != null) + { + MC.interactionManager.breakingBlock = true; + MC.interactionManager.cancelBlockBreaking(); + currentlyHarvesting = null; + } + + prevBlocks.clear(); + overlay.resetProgress(); + busy = false; + + renderer.reset(); + } + + @Override + public void onUpdate() + { + currentlyHarvesting = null; + Vec3d eyesVec = RotationUtils.getEyesPos().subtract(0.5, 0.5, 0.5); + BlockPos eyesBlock = BlockPos.ofFloored(RotationUtils.getEyesPos()); + double rangeSq = range.getValueSq(); + int blockRange = range.getValueCeil(); + + // get nearby, non-empty blocks + ArrayList blocks = BlockUtils + .getAllInBoxStream(eyesBlock, blockRange) + .filter(pos -> eyesVec.squaredDistanceTo(Vec3d.of(pos)) <= rangeSq) + .filter(BlockUtils::canBeClicked) + .collect(Collectors.toCollection(ArrayList::new)); + + // check for any new plants and add them to the map + updatePlants(blocks); + + ArrayList blocksToHarvest = new ArrayList<>(); + ArrayList blocksToReplant = new ArrayList<>(); + + // don't place or break any blocks while Freecam is enabled + if(!WURST.getHax().freecamHack.isEnabled()) + { + // check which of the nearby blocks can be harvested + blocksToHarvest = getBlocksToHarvest(eyesVec, blocks); + + // do a new search to find empty blocks that can be replanted + if(replant.isChecked()) + blocksToReplant = + getBlocksToReplant(eyesVec, eyesBlock, rangeSq, blockRange); + } + + // first, try to replant + boolean replanting = replant(blocksToReplant); + + // if we can't replant, harvest instead + if(!replanting) + harvest(blocksToHarvest); + + // upate busy state + busy = replanting || currentlyHarvesting != null; + + // update renderer + renderer.updateVertexBuffers(blocksToHarvest, plants.keySet(), + blocksToReplant); + } + + @Override + public void onRender(MatrixStack matrixStack, float partialTicks) + { + renderer.render(matrixStack); + overlay.render(matrixStack, partialTicks, currentlyHarvesting); + } + + /** + * Returns true if AutoFarm is currently harvesting or replanting something. + */ + public boolean isBusy() + { + return busy; + } + + private void updatePlants(List blocks) + { + for(BlockPos pos : blocks) + { + Item seed = seeds.get(BlockUtils.getBlock(pos)); + if(seed == null) + continue; + + plants.put(pos, seed); + } + } + + private ArrayList getBlocksToHarvest(Vec3d eyesVec, + ArrayList blocks) + { + return blocks.parallelStream().filter(this::shouldBeHarvested) + .sorted(Comparator.comparingDouble( + pos -> eyesVec.squaredDistanceTo(Vec3d.of(pos)))) + .collect(Collectors.toCollection(ArrayList::new)); + } + + private boolean shouldBeHarvested(BlockPos pos) + { + Block block = BlockUtils.getBlock(pos); + BlockState state = BlockUtils.getState(pos); + + if(block instanceof CropBlock) + return ((CropBlock)block).isMature(state); + + if(block instanceof NetherWartBlock) + return state.get(NetherWartBlock.AGE) >= 3; + + if(block instanceof CocoaBlock) + return state.get(CocoaBlock.AGE) >= 2; + + if(block instanceof GourdBlock) + return true; + + if(block instanceof SugarCaneBlock) + return BlockUtils.getBlock(pos.down()) instanceof SugarCaneBlock + && !(BlockUtils + .getBlock(pos.down(2)) instanceof SugarCaneBlock); + + if(block instanceof CactusBlock) + return BlockUtils.getBlock(pos.down()) instanceof CactusBlock + && !(BlockUtils.getBlock(pos.down(2)) instanceof CactusBlock); + + if(block instanceof KelpPlantBlock) + return BlockUtils.getBlock(pos.down()) instanceof KelpPlantBlock + && !(BlockUtils + .getBlock(pos.down(2)) instanceof KelpPlantBlock); + + if(block instanceof BambooBlock) + return BlockUtils.getBlock(pos.down()) instanceof BambooBlock + && !(BlockUtils.getBlock(pos.down(2)) instanceof BambooBlock); + + return false; + } + + private ArrayList getBlocksToReplant(Vec3d eyesVec, + BlockPos eyesBlock, double rangeSq, int blockRange) + { + return BlockUtils.getAllInBoxStream(eyesBlock, blockRange) + .filter(pos -> eyesVec.squaredDistanceTo(Vec3d.of(pos)) <= rangeSq) + .filter(pos -> BlockUtils.getState(pos).isReplaceable()) + .filter(pos -> plants.containsKey(pos)).filter(this::canBeReplanted) + .sorted(Comparator.comparingDouble( + pos -> eyesVec.squaredDistanceTo(Vec3d.of(pos)))) + .collect(Collectors.toCollection(ArrayList::new)); + } + + private boolean canBeReplanted(BlockPos pos) + { + Item item = plants.get(pos); + + if(item == Items.WHEAT_SEEDS || item == Items.CARROT + || item == Items.POTATO || item == Items.BEETROOT_SEEDS + || item == Items.PUMPKIN_SEEDS || item == Items.MELON_SEEDS) + return BlockUtils.getBlock(pos.down()) instanceof FarmlandBlock; + + if(item == Items.NETHER_WART) + return BlockUtils.getBlock(pos.down()) instanceof SoulSandBlock; + + if(item == Items.COCOA_BEANS) + return BlockUtils.getState(pos.north()).isIn(BlockTags.JUNGLE_LOGS) + || BlockUtils.getState(pos.east()).isIn(BlockTags.JUNGLE_LOGS) + || BlockUtils.getState(pos.south()).isIn(BlockTags.JUNGLE_LOGS) + || BlockUtils.getState(pos.west()).isIn(BlockTags.JUNGLE_LOGS); + + return false; + } + + private boolean replant(List blocksToReplant) + { + // check cooldown + if(MC.itemUseCooldown > 0) + return false; + + // check if already holding one of the seeds needed for blocksToReplant + Optional heldSeed = blocksToReplant.stream().map(plants::get) + .distinct().filter(item -> MC.player.isHolding(item)).findFirst(); + + // if so, try to replant the blocks that need that seed + if(heldSeed.isPresent()) + { + // get the seed and the hand that is holding it + Item item = heldSeed.get(); + Hand hand = MC.player.getMainHandStack().isOf(item) ? Hand.MAIN_HAND + : Hand.OFF_HAND; + + // filter out blocks that need a different seed + ArrayList blocksToReplantWithHeldSeed = + blocksToReplant.stream().filter(pos -> plants.get(pos) == item) + .collect(Collectors.toCollection(ArrayList::new)); + + for(BlockPos pos : blocksToReplantWithHeldSeed) + { + // skip over blocks that we can't reach + BlockPlacingParams params = + BlockPlacer.getBlockPlacingParams(pos); + if(params == null || params.distanceSq() > range.getValueSq()) + continue; + + // face block + WURST.getRotationFaker().faceVectorPacket(params.hitVec()); + + // place seed + ActionResult result = MC.interactionManager + .interactBlock(MC.player, hand, params.toHitResult()); + + // swing arm + if(result.isAccepted() && result.shouldSwingHand()) + MC.player.networkHandler + .sendPacket(new HandSwingC2SPacket(hand)); + + // reset cooldown + MC.itemUseCooldown = 4; + return true; + } + } + + // otherwise, find a block that we can reach and have seeds for + for(BlockPos pos : blocksToReplant) + { + // skip over blocks that we can't reach + BlockPlacingParams params = BlockPlacer.getBlockPlacingParams(pos); + if(params == null || params.distanceSq() > range.getValueSq()) + continue; + + // try to select the seed (returns false if we don't have it) + Item item = plants.get(pos); + if(InventoryUtils.selectItem(item)) + return true; + } + + // if we couldn't replant anything, return false + return false; + } + + private void harvest(List blocksToHarvest) + { + if(MC.player.getAbilities().creativeMode) + { + Stream stream = blocksToHarvest.parallelStream(); + for(Set set : prevBlocks) + stream = stream.filter(pos -> !set.contains(pos)); + List filteredBlocks = stream.collect(Collectors.toList()); + + prevBlocks.addLast(new HashSet<>(filteredBlocks)); + while(prevBlocks.size() > 5) + prevBlocks.removeFirst(); + + if(!filteredBlocks.isEmpty()) + currentlyHarvesting = filteredBlocks.get(0); + + MC.interactionManager.cancelBlockBreaking(); + overlay.resetProgress(); + BlockBreaker.breakBlocksWithPacketSpam(filteredBlocks); + return; + } + + for(BlockPos pos : blocksToHarvest) + if(BlockBreaker.breakOneBlock(pos)) + { + currentlyHarvesting = pos; + break; + } + + if(currentlyHarvesting == null) + MC.interactionManager.cancelBlockBreaking(); + + if(currentlyHarvesting != null + && BlockUtils.getHardness(currentlyHarvesting) < 1) + overlay.updateProgress(); + else + overlay.resetProgress(); + } +} diff --git a/src/main/java/net/wurstclient/hacks/AutoFishHack.java b/src/main/java/net/wurstclient/hacks/AutoFishHack.java index 41ec13a5..1db80e85 100644 --- a/src/main/java/net/wurstclient/hacks/AutoFishHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoFishHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -9,10 +9,10 @@ package net.wurstclient.hacks; import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.entity.projectile.FishingBobberEntity; import net.minecraft.item.Items; import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket; import net.minecraft.sound.SoundEvents; +import net.minecraft.util.math.Vec3d; import net.wurstclient.Category; import net.wurstclient.SearchTags; import net.wurstclient.events.PacketInputListener; @@ -21,11 +21,10 @@ import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.Hack; import net.wurstclient.hacks.autofish.AutoFishDebugDraw; import net.wurstclient.hacks.autofish.AutoFishRodSelector; +import net.wurstclient.hacks.autofish.FishingSpotManager; import net.wurstclient.hacks.autofish.ShallowWaterWarningCheckbox; -import net.wurstclient.settings.CheckboxSetting; import net.wurstclient.settings.SliderSetting; import net.wurstclient.settings.SliderSetting.ValueDisplay; -import net.wurstclient.util.ChatUtils; @SearchTags({"AutoFishing", "auto fishing", "AutoFisher", "auto fisher", "AFKFishBot", "afk fish bot", "AFKFishingBot", "afk fishing bot", @@ -53,41 +52,37 @@ public final class AutoFishHack extends Hack "How long AutoFish will wait if it doesn't get a bite before reeling in.", 60, 10, 120, 1, ValueDisplay.INTEGER.withSuffix("s")); - private final CheckboxSetting stopWhenInvFull = new CheckboxSetting( - "Stop when inv full", - "If enabled, AutoFish will turn itself off when your inventory is full.", - false); - private final ShallowWaterWarningCheckbox shallowWaterWarning = new ShallowWaterWarningCheckbox(); + private final FishingSpotManager fishingSpots = new FishingSpotManager(); private final AutoFishDebugDraw debugDraw = - new AutoFishDebugDraw(validRange); + new AutoFishDebugDraw(validRange, fishingSpots); private final AutoFishRodSelector rodSelector = new AutoFishRodSelector(this); private int castRodTimer; private int reelInTimer; + private boolean biteDetected; public AutoFishHack() { super("AutoFish"); setCategory(Category.OTHER); - addSetting(validRange); addSetting(catchDelay); addSetting(retryDelay); addSetting(patience); debugDraw.getSettings().forEach(this::addSetting); rodSelector.getSettings().forEach(this::addSetting); - addSetting(stopWhenInvFull); addSetting(shallowWaterWarning); + fishingSpots.getSettings().forEach(this::addSetting); } @Override public String getRenderName() { - if(!rodSelector.hasARod()) + if(rodSelector.isOutOfRods()) return getName() + " [out of rods]"; return getName(); @@ -98,10 +93,15 @@ public final class AutoFishHack extends Hack { castRodTimer = 0; reelInTimer = 0; + biteDetected = false; rodSelector.reset(); debugDraw.reset(); + fishingSpots.reset(); shallowWaterWarning.reset(); + WURST.getHax().antiAfkHack.setEnabled(false); + WURST.getHax().aimAssistHack.setEnabled(false); + EVENTS.add(UpdateListener.class, this); EVENTS.add(PacketInputListener.class, this); EVENTS.add(RenderListener.class, this); @@ -124,22 +124,9 @@ public final class AutoFishHack extends Hack if(reelInTimer > 0) reelInTimer--; - // check if inventory is full - if(stopWhenInvFull.isChecked() - && MC.player.getInventory().getEmptySlot() == -1) - { - ChatUtils.message( - "AutoFish has stopped because your inventory is full."); - setEnabled(false); + // update inventory + if(!rodSelector.update()) return; - } - - // select fishing rod - if(!rodSelector.isBestRodAlreadySelected()) - { - rodSelector.selectBestRod(); - return; - } // if not fishing, cast rod if(!isFishing()) @@ -147,13 +134,28 @@ public final class AutoFishHack extends Hack if(castRodTimer > 0) return; + reelInTimer = 20 * patience.getValueI(); + if(!fishingSpots.onCast()) + return; + MC.doItemUse(); castRodTimer = retryDelay.getValueI(); - reelInTimer = 20 * patience.getValueI(); return; } - // otherwise, reel in when it's time + // if a bite was detected, check water type and reel in + if(biteDetected) + { + shallowWaterWarning.checkWaterType(); + reelInTimer = catchDelay.getValueI(); + fishingSpots.onBite(MC.player.fishHook); + biteDetected = false; + + // also reel in if an entity was hooked + }else if(MC.player.fishHook.getHookedEntity() != null) + reelInTimer = catchDelay.getValueI(); + + // otherwise, reel in when the timer runs out if(reelInTimer == 0) { MC.doItemUse(); @@ -178,23 +180,17 @@ public final class AutoFishHack extends Hack if(!isFishing()) return; - // check if player is holding a fishing rod - ClientPlayerEntity player = MC.player; - if(!player.getMainHandStack().isOf(Items.FISHING_ROD)) - return; - + // register sound position debugDraw.updateSoundPos(sound); - // check sound position - FishingBobberEntity bobber = player.fishHook; - if(Math.abs(sound.getX() - bobber.getX()) > validRange.getValue() - || Math.abs(sound.getZ() - bobber.getZ()) > validRange.getValue()) + // check sound position (Chebyshev distance) + Vec3d bobber = MC.player.fishHook.getPos(); + double dx = Math.abs(sound.getX() - bobber.getX()); + double dz = Math.abs(sound.getZ() - bobber.getZ()); + if(Math.max(dx, dz) > validRange.getValue()) return; - shallowWaterWarning.checkWaterAround(bobber); - - // catch fish - reelInTimer = catchDelay.getValueI(); + biteDetected = true; } @Override @@ -207,6 +203,7 @@ public final class AutoFishHack extends Hack { ClientPlayerEntity player = MC.player; return player != null && player.fishHook != null - && !player.fishHook.isRemoved(); + && !player.fishHook.isRemoved() + && player.getMainHandStack().isOf(Items.FISHING_ROD); } } diff --git a/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java b/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java index 6b4bfb25..851477cb 100644 --- a/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoLeaveHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java b/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java index 028452b4..0f1345be 100644 --- a/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoLibrarianHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AutoMineHack.java b/src/main/java/net/wurstclient/hacks/AutoMineHack.java index 4e8c1b8c..3fd8228e 100644 --- a/src/main/java/net/wurstclient/hacks/AutoMineHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoMineHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AutoPotionHack.java b/src/main/java/net/wurstclient/hacks/AutoPotionHack.java index 9fa1814a..76bf0aa2 100644 --- a/src/main/java/net/wurstclient/hacks/AutoPotionHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoPotionHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -12,7 +12,6 @@ import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; -import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.potion.PotionUtil; import net.wurstclient.Category; import net.wurstclient.SearchTags; @@ -20,6 +19,7 @@ import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.Hack; import net.wurstclient.settings.SliderSetting; import net.wurstclient.settings.SliderSetting.ValueDisplay; +import net.wurstclient.util.Rotation; @SearchTags({"AutoPotion", "auto potion", "AutoSplashPotion", "auto splash potion"}) @@ -77,16 +77,13 @@ public final class AutoPotionHack extends Hack implements UpdateListener // throw potion in hotbar MC.player.getInventory().selectedSlot = potionInHotbar; - MC.player.networkHandler.sendPacket( - new PlayerMoveC2SPacket.LookAndOnGround(MC.player.getYaw(), 90, - MC.player.isOnGround())); + new Rotation(MC.player.getYaw(), 90).sendPlayerLookPacket(); IMC.getInteractionManager().rightClickItem(); // reset slot and rotation MC.player.getInventory().selectedSlot = oldSlot; - MC.player.networkHandler.sendPacket( - new PlayerMoveC2SPacket.LookAndOnGround(MC.player.getYaw(), - MC.player.getPitch(), MC.player.isOnGround())); + new Rotation(MC.player.getYaw(), MC.player.getPitch()) + .sendPlayerLookPacket(); // reset timer timer = 10; diff --git a/src/main/java/net/wurstclient/hacks/AutoReconnectHack.java b/src/main/java/net/wurstclient/hacks/AutoReconnectHack.java index e6a43f62..0eae7dcf 100644 --- a/src/main/java/net/wurstclient/hacks/AutoReconnectHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoReconnectHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AutoRespawnHack.java b/src/main/java/net/wurstclient/hacks/AutoRespawnHack.java index 55b4efac..794b73e3 100644 --- a/src/main/java/net/wurstclient/hacks/AutoRespawnHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoRespawnHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AutoSignHack.java b/src/main/java/net/wurstclient/hacks/AutoSignHack.java index 86cca0cf..b7b1832c 100644 --- a/src/main/java/net/wurstclient/hacks/AutoSignHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoSignHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AutoSoupHack.java b/src/main/java/net/wurstclient/hacks/AutoSoupHack.java index 105288fb..6aecf849 100644 --- a/src/main/java/net/wurstclient/hacks/AutoSoupHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoSoupHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AutoSprintHack.java b/src/main/java/net/wurstclient/hacks/AutoSprintHack.java index 09115995..53f47e20 100644 --- a/src/main/java/net/wurstclient/hacks/AutoSprintHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoSprintHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -17,6 +17,10 @@ import net.wurstclient.settings.CheckboxSetting; @SearchTags({"auto sprint"}) public final class AutoSprintHack extends Hack implements UpdateListener { + private final CheckboxSetting allDirections = + new CheckboxSetting("Omnidirectional Sprint", + "Sprint in all directions, not just forward.", false); + private final CheckboxSetting hungry = new CheckboxSetting("Hungry Sprint", "Sprint even on low hunger.", false); @@ -24,6 +28,7 @@ public final class AutoSprintHack extends Hack implements UpdateListener { super("AutoSprint"); setCategory(Category.MOVEMENT); + addSetting(allDirections); addSetting(hungry); } @@ -43,15 +48,24 @@ public final class AutoSprintHack extends Hack implements UpdateListener public void onUpdate() { ClientPlayerEntity player = MC.player; - if(player.horizontalCollision || player.isSneaking()) return; if(player.isInsideWaterOrBubbleColumn() || player.isSubmergedInWater()) return; - if(player.forwardSpeed > 0) - player.setSprinting(true); + if(!allDirections.isChecked() && player.forwardSpeed <= 0) + return; + + if(player.input.getMovementInput().length() <= 1e-5F) + return; + + player.setSprinting(true); + } + + public boolean shouldOmniSprint() + { + return isEnabled() && allDirections.isChecked(); } public boolean shouldSprintHungry() diff --git a/src/main/java/net/wurstclient/hacks/AutoStealHack.java b/src/main/java/net/wurstclient/hacks/AutoStealHack.java index ea66c9b7..fe03796a 100644 --- a/src/main/java/net/wurstclient/hacks/AutoStealHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoStealHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -44,5 +44,5 @@ public final class AutoStealHack extends Hack return delay.getValueI(); } - // See ContainerScreen54Mixin and ShulkerBoxScreenMixin + // See GenericContainerScreenMixin and ShulkerBoxScreenMixin } diff --git a/src/main/java/net/wurstclient/hacks/AutoSwimHack.java b/src/main/java/net/wurstclient/hacks/AutoSwimHack.java index 8e2face3..04b52b09 100644 --- a/src/main/java/net/wurstclient/hacks/AutoSwimHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoSwimHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AutoSwitchHack.java b/src/main/java/net/wurstclient/hacks/AutoSwitchHack.java index e23293d0..3efe3aa4 100644 --- a/src/main/java/net/wurstclient/hacks/AutoSwitchHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoSwitchHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AutoSwordHack.java b/src/main/java/net/wurstclient/hacks/AutoSwordHack.java index 7a44fc7c..fb28cced 100644 --- a/src/main/java/net/wurstclient/hacks/AutoSwordHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoSwordHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AutoToolHack.java b/src/main/java/net/wurstclient/hacks/AutoToolHack.java index 3d5edab8..e8f6f395 100644 --- a/src/main/java/net/wurstclient/hacks/AutoToolHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoToolHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AutoTotemHack.java b/src/main/java/net/wurstclient/hacks/AutoTotemHack.java index 145e90d5..474be648 100644 --- a/src/main/java/net/wurstclient/hacks/AutoTotemHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoTotemHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/AutoWalkHack.java b/src/main/java/net/wurstclient/hacks/AutoWalkHack.java index 59cbd61b..ca9f2d45 100644 --- a/src/main/java/net/wurstclient/hacks/AutoWalkHack.java +++ b/src/main/java/net/wurstclient/hacks/AutoWalkHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/BarrierEspHack.java b/src/main/java/net/wurstclient/hacks/BarrierEspHack.java index 184626e7..443897b8 100644 --- a/src/main/java/net/wurstclient/hacks/BarrierEspHack.java +++ b/src/main/java/net/wurstclient/hacks/BarrierEspHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/BaseFinderHack.java b/src/main/java/net/wurstclient/hacks/BaseFinderHack.java index b5d5bc8d..16ea18ad 100644 --- a/src/main/java/net/wurstclient/hacks/BaseFinderHack.java +++ b/src/main/java/net/wurstclient/hacks/BaseFinderHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/BlinkHack.java b/src/main/java/net/wurstclient/hacks/BlinkHack.java index afcd7787..8ca84a62 100644 --- a/src/main/java/net/wurstclient/hacks/BlinkHack.java +++ b/src/main/java/net/wurstclient/hacks/BlinkHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/BoatFlyHack.java b/src/main/java/net/wurstclient/hacks/BoatFlyHack.java index 033846ef..1fb15d83 100644 --- a/src/main/java/net/wurstclient/hacks/BoatFlyHack.java +++ b/src/main/java/net/wurstclient/hacks/BoatFlyHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/BonemealAuraHack.java b/src/main/java/net/wurstclient/hacks/BonemealAuraHack.java index 9939ee81..ee21777d 100644 --- a/src/main/java/net/wurstclient/hacks/BonemealAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/BonemealAuraHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/BowAimbotHack.java b/src/main/java/net/wurstclient/hacks/BowAimbotHack.java index c8278899..f0fe15f7 100644 --- a/src/main/java/net/wurstclient/hacks/BowAimbotHack.java +++ b/src/main/java/net/wurstclient/hacks/BowAimbotHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/BuildRandomHack.java b/src/main/java/net/wurstclient/hacks/BuildRandomHack.java index 8016c755..a231b082 100644 --- a/src/main/java/net/wurstclient/hacks/BuildRandomHack.java +++ b/src/main/java/net/wurstclient/hacks/BuildRandomHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/BunnyHopHack.java b/src/main/java/net/wurstclient/hacks/BunnyHopHack.java index aa502bdb..a81545a8 100644 --- a/src/main/java/net/wurstclient/hacks/BunnyHopHack.java +++ b/src/main/java/net/wurstclient/hacks/BunnyHopHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/CameraDistanceHack.java b/src/main/java/net/wurstclient/hacks/CameraDistanceHack.java index c8b352af..875adf16 100644 --- a/src/main/java/net/wurstclient/hacks/CameraDistanceHack.java +++ b/src/main/java/net/wurstclient/hacks/CameraDistanceHack.java @@ -1,35 +1,35 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.hacks; - -import net.wurstclient.Category; -import net.wurstclient.SearchTags; -import net.wurstclient.hack.Hack; -import net.wurstclient.settings.SliderSetting; -import net.wurstclient.settings.SliderSetting.ValueDisplay; - -@SearchTags({"camera distance", "CamDistance", "cam distance"}) -public final class CameraDistanceHack extends Hack -{ - private final SliderSetting distance = - new SliderSetting("Distance", 12, -0.5, 150, 0.5, ValueDisplay.DECIMAL); - - public CameraDistanceHack() - { - super("CameraDistance"); - setCategory(Category.RENDER); - addSetting(distance); - } - - public double getDistance() - { - return distance.getValueF(); - } - - // See CameraMixin.changeClipToSpaceDistance() -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.hacks; + +import net.wurstclient.Category; +import net.wurstclient.SearchTags; +import net.wurstclient.hack.Hack; +import net.wurstclient.settings.SliderSetting; +import net.wurstclient.settings.SliderSetting.ValueDisplay; + +@SearchTags({"camera distance", "CamDistance", "cam distance"}) +public final class CameraDistanceHack extends Hack +{ + private final SliderSetting distance = + new SliderSetting("Distance", 12, -0.5, 150, 0.5, ValueDisplay.DECIMAL); + + public CameraDistanceHack() + { + super("CameraDistance"); + setCategory(Category.RENDER); + addSetting(distance); + } + + public double getDistance() + { + return distance.getValueF(); + } + + // See CameraMixin.changeClipToSpaceDistance() +} diff --git a/src/main/java/net/wurstclient/hacks/CameraNoClipHack.java b/src/main/java/net/wurstclient/hacks/CameraNoClipHack.java index 2d0e7089..202371db 100644 --- a/src/main/java/net/wurstclient/hacks/CameraNoClipHack.java +++ b/src/main/java/net/wurstclient/hacks/CameraNoClipHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/CaveFinderHack.java b/src/main/java/net/wurstclient/hacks/CaveFinderHack.java index 52be05fd..df43ea80 100644 --- a/src/main/java/net/wurstclient/hacks/CaveFinderHack.java +++ b/src/main/java/net/wurstclient/hacks/CaveFinderHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/ChatTranslatorHack.java b/src/main/java/net/wurstclient/hacks/ChatTranslatorHack.java index bea50443..a79831fe 100644 --- a/src/main/java/net/wurstclient/hacks/ChatTranslatorHack.java +++ b/src/main/java/net/wurstclient/hacks/ChatTranslatorHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/ChestEspHack.java b/src/main/java/net/wurstclient/hacks/ChestEspHack.java index 18b23871..0d92637c 100644 --- a/src/main/java/net/wurstclient/hacks/ChestEspHack.java +++ b/src/main/java/net/wurstclient/hacks/ChestEspHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/ClickAuraHack.java b/src/main/java/net/wurstclient/hacks/ClickAuraHack.java index 96e99f6a..1987aeb8 100644 --- a/src/main/java/net/wurstclient/hacks/ClickAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/ClickAuraHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -14,7 +14,6 @@ import java.util.stream.Stream; import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; -import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.util.Hand; import net.wurstclient.Category; import net.wurstclient.SearchTags; @@ -28,7 +27,6 @@ import net.wurstclient.settings.SliderSetting.ValueDisplay; import net.wurstclient.settings.filterlists.EntityFilterList; import net.wurstclient.util.EntityUtils; import net.wurstclient.util.RotationUtils; -import net.wurstclient.util.RotationUtils.Rotation; @SearchTags({"click aura", "ClickAimbot", "click aimbot"}) public final class ClickAuraHack extends Hack @@ -134,12 +132,8 @@ public final class ClickAuraHack extends Hack WURST.getHax().autoSwordHack.setSlot(target); // face entity - Rotation rotation = RotationUtils - .getNeededRotations(target.getBoundingBox().getCenter()); - PlayerMoveC2SPacket.LookAndOnGround packet = - new PlayerMoveC2SPacket.LookAndOnGround(rotation.getYaw(), - rotation.getPitch(), MC.player.isOnGround()); - MC.player.networkHandler.sendPacket(packet); + RotationUtils.getNeededRotations(target.getBoundingBox().getCenter()) + .sendPlayerLookPacket(); // attack entity WURST.getHax().criticalsHack.doCritical(); diff --git a/src/main/java/net/wurstclient/hacks/ClickGuiHack.java b/src/main/java/net/wurstclient/hacks/ClickGuiHack.java index cb395fe6..a377c444 100644 --- a/src/main/java/net/wurstclient/hacks/ClickGuiHack.java +++ b/src/main/java/net/wurstclient/hacks/ClickGuiHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/CrashChestHack.java b/src/main/java/net/wurstclient/hacks/CrashChestHack.java index 5816b4af..e76ce26d 100644 --- a/src/main/java/net/wurstclient/hacks/CrashChestHack.java +++ b/src/main/java/net/wurstclient/hacks/CrashChestHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/CreativeFlightHack.java b/src/main/java/net/wurstclient/hacks/CreativeFlightHack.java index 003e2f1b..407c11d3 100644 --- a/src/main/java/net/wurstclient/hacks/CreativeFlightHack.java +++ b/src/main/java/net/wurstclient/hacks/CreativeFlightHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/CriticalsHack.java b/src/main/java/net/wurstclient/hacks/CriticalsHack.java index 157ec827..c70165de 100644 --- a/src/main/java/net/wurstclient/hacks/CriticalsHack.java +++ b/src/main/java/net/wurstclient/hacks/CriticalsHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/CrystalAuraHack.java b/src/main/java/net/wurstclient/hacks/CrystalAuraHack.java index 28cb9353..0e09ece6 100644 --- a/src/main/java/net/wurstclient/hacks/CrystalAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/CrystalAuraHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/DerpHack.java b/src/main/java/net/wurstclient/hacks/DerpHack.java index 7d3f0b7a..30c989dc 100644 --- a/src/main/java/net/wurstclient/hacks/DerpHack.java +++ b/src/main/java/net/wurstclient/hacks/DerpHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -9,11 +9,11 @@ package net.wurstclient.hacks; import java.util.Random; -import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.wurstclient.Category; import net.wurstclient.SearchTags; import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.Hack; +import net.wurstclient.util.Rotation; @SearchTags({"Retarded"}) public final class DerpHack extends Hack implements UpdateListener @@ -48,8 +48,6 @@ public final class DerpHack extends Hack implements UpdateListener float yaw = MC.player.getYaw() + random.nextFloat() * 360F - 180F; float pitch = random.nextFloat() * 180F - 90F; - MC.player.networkHandler - .sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(yaw, pitch, - MC.player.isOnGround())); + new Rotation(yaw, pitch).sendPlayerLookPacket(); } } diff --git a/src/main/java/net/wurstclient/hacks/DolphinHack.java b/src/main/java/net/wurstclient/hacks/DolphinHack.java index d1dcf45d..264fdc6d 100644 --- a/src/main/java/net/wurstclient/hacks/DolphinHack.java +++ b/src/main/java/net/wurstclient/hacks/DolphinHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/ExcavatorHack.java b/src/main/java/net/wurstclient/hacks/ExcavatorHack.java index 73e8f332..1ce7df09 100644 --- a/src/main/java/net/wurstclient/hacks/ExcavatorHack.java +++ b/src/main/java/net/wurstclient/hacks/ExcavatorHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/ExtraElytraHack.java b/src/main/java/net/wurstclient/hacks/ExtraElytraHack.java index a096954d..b0d619e6 100644 --- a/src/main/java/net/wurstclient/hacks/ExtraElytraHack.java +++ b/src/main/java/net/wurstclient/hacks/ExtraElytraHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/FancyChatHack.java b/src/main/java/net/wurstclient/hacks/FancyChatHack.java index 95e5f704..87653579 100644 --- a/src/main/java/net/wurstclient/hacks/FancyChatHack.java +++ b/src/main/java/net/wurstclient/hacks/FancyChatHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/FastBreakHack.java b/src/main/java/net/wurstclient/hacks/FastBreakHack.java index 1f5f2e3f..34764288 100644 --- a/src/main/java/net/wurstclient/hacks/FastBreakHack.java +++ b/src/main/java/net/wurstclient/hacks/FastBreakHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/FastLadderHack.java b/src/main/java/net/wurstclient/hacks/FastLadderHack.java index 0ca53656..0e70ea54 100644 --- a/src/main/java/net/wurstclient/hacks/FastLadderHack.java +++ b/src/main/java/net/wurstclient/hacks/FastLadderHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/FastPlaceHack.java b/src/main/java/net/wurstclient/hacks/FastPlaceHack.java index 9620c03c..c1d037b1 100644 --- a/src/main/java/net/wurstclient/hacks/FastPlaceHack.java +++ b/src/main/java/net/wurstclient/hacks/FastPlaceHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/FeedAuraHack.java b/src/main/java/net/wurstclient/hacks/FeedAuraHack.java index 05809633..0e74c982 100644 --- a/src/main/java/net/wurstclient/hacks/FeedAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/FeedAuraHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/FightBotHack.java b/src/main/java/net/wurstclient/hacks/FightBotHack.java index 8fc41e86..e8e27a73 100644 --- a/src/main/java/net/wurstclient/hacks/FightBotHack.java +++ b/src/main/java/net/wurstclient/hacks/FightBotHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/FishHack.java b/src/main/java/net/wurstclient/hacks/FishHack.java index 07e8b0d6..e8c95740 100644 --- a/src/main/java/net/wurstclient/hacks/FishHack.java +++ b/src/main/java/net/wurstclient/hacks/FishHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/FlightHack.java b/src/main/java/net/wurstclient/hacks/FlightHack.java index 6c346daf..02f19253 100644 --- a/src/main/java/net/wurstclient/hacks/FlightHack.java +++ b/src/main/java/net/wurstclient/hacks/FlightHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/FollowHack.java b/src/main/java/net/wurstclient/hacks/FollowHack.java index 6a7ad57b..40a74497 100644 --- a/src/main/java/net/wurstclient/hacks/FollowHack.java +++ b/src/main/java/net/wurstclient/hacks/FollowHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/ForceOpHack.java b/src/main/java/net/wurstclient/hacks/ForceOpHack.java index bd17dcbc..97af13c7 100644 --- a/src/main/java/net/wurstclient/hacks/ForceOpHack.java +++ b/src/main/java/net/wurstclient/hacks/ForceOpHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/FreecamHack.java b/src/main/java/net/wurstclient/hacks/FreecamHack.java index dc3cd87e..fdfbaf25 100644 --- a/src/main/java/net/wurstclient/hacks/FreecamHack.java +++ b/src/main/java/net/wurstclient/hacks/FreecamHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/FullbrightHack.java b/src/main/java/net/wurstclient/hacks/FullbrightHack.java index bc1e9026..da37bebf 100644 --- a/src/main/java/net/wurstclient/hacks/FullbrightHack.java +++ b/src/main/java/net/wurstclient/hacks/FullbrightHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/GlideHack.java b/src/main/java/net/wurstclient/hacks/GlideHack.java index 8d797e90..eaa7f276 100644 --- a/src/main/java/net/wurstclient/hacks/GlideHack.java +++ b/src/main/java/net/wurstclient/hacks/GlideHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/HandNoClipHack.java b/src/main/java/net/wurstclient/hacks/HandNoClipHack.java index d0822906..0bc6b030 100644 --- a/src/main/java/net/wurstclient/hacks/HandNoClipHack.java +++ b/src/main/java/net/wurstclient/hacks/HandNoClipHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/HeadRollHack.java b/src/main/java/net/wurstclient/hacks/HeadRollHack.java index fab6224f..133321f2 100644 --- a/src/main/java/net/wurstclient/hacks/HeadRollHack.java +++ b/src/main/java/net/wurstclient/hacks/HeadRollHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -7,12 +7,12 @@ */ package net.wurstclient.hacks; -import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.util.math.MathHelper; import net.wurstclient.Category; import net.wurstclient.SearchTags; import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.Hack; +import net.wurstclient.util.Rotation; @SearchTags({"head roll", "nodding", "yes"}) public final class HeadRollHack extends Hack implements UpdateListener @@ -45,8 +45,6 @@ public final class HeadRollHack extends Hack implements UpdateListener float timer = MC.player.age % 20 / 10F; float pitch = MathHelper.sin(timer * (float)Math.PI) * 90F; - MC.player.networkHandler.sendPacket( - new PlayerMoveC2SPacket.LookAndOnGround(MC.player.getYaw(), pitch, - MC.player.isOnGround())); + new Rotation(MC.player.getYaw(), pitch).sendPlayerLookPacket(); } } diff --git a/src/main/java/net/wurstclient/hacks/HealthTagsHack.java b/src/main/java/net/wurstclient/hacks/HealthTagsHack.java index 573a2f17..94822fba 100644 --- a/src/main/java/net/wurstclient/hacks/HealthTagsHack.java +++ b/src/main/java/net/wurstclient/hacks/HealthTagsHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/HighJumpHack.java b/src/main/java/net/wurstclient/hacks/HighJumpHack.java index 62fa316f..e0c5ab76 100644 --- a/src/main/java/net/wurstclient/hacks/HighJumpHack.java +++ b/src/main/java/net/wurstclient/hacks/HighJumpHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/InfiniChatHack.java b/src/main/java/net/wurstclient/hacks/InfiniChatHack.java index 71e2d3e2..6a6736d9 100644 --- a/src/main/java/net/wurstclient/hacks/InfiniChatHack.java +++ b/src/main/java/net/wurstclient/hacks/InfiniChatHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/InstantBunkerHack.java b/src/main/java/net/wurstclient/hacks/InstantBunkerHack.java index eced4596..bded0324 100644 --- a/src/main/java/net/wurstclient/hacks/InstantBunkerHack.java +++ b/src/main/java/net/wurstclient/hacks/InstantBunkerHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/InvWalkHack.java b/src/main/java/net/wurstclient/hacks/InvWalkHack.java index 5598b51f..043102f5 100644 --- a/src/main/java/net/wurstclient/hacks/InvWalkHack.java +++ b/src/main/java/net/wurstclient/hacks/InvWalkHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/ItemEspHack.java b/src/main/java/net/wurstclient/hacks/ItemEspHack.java index 92a4abff..4d304c6c 100644 --- a/src/main/java/net/wurstclient/hacks/ItemEspHack.java +++ b/src/main/java/net/wurstclient/hacks/ItemEspHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/ItemGeneratorHack.java b/src/main/java/net/wurstclient/hacks/ItemGeneratorHack.java index 087b398d..33dc6d68 100644 --- a/src/main/java/net/wurstclient/hacks/ItemGeneratorHack.java +++ b/src/main/java/net/wurstclient/hacks/ItemGeneratorHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/JesusHack.java b/src/main/java/net/wurstclient/hacks/JesusHack.java index 371bae43..02ef86b3 100644 --- a/src/main/java/net/wurstclient/hacks/JesusHack.java +++ b/src/main/java/net/wurstclient/hacks/JesusHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/JetpackHack.java b/src/main/java/net/wurstclient/hacks/JetpackHack.java index 7d5bc54c..2cb7e6ff 100644 --- a/src/main/java/net/wurstclient/hacks/JetpackHack.java +++ b/src/main/java/net/wurstclient/hacks/JetpackHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/KaboomHack.java b/src/main/java/net/wurstclient/hacks/KaboomHack.java index 4969c729..17115e49 100644 --- a/src/main/java/net/wurstclient/hacks/KaboomHack.java +++ b/src/main/java/net/wurstclient/hacks/KaboomHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/KillPotionHack.java b/src/main/java/net/wurstclient/hacks/KillPotionHack.java index 0d320edf..65ef5b93 100644 --- a/src/main/java/net/wurstclient/hacks/KillPotionHack.java +++ b/src/main/java/net/wurstclient/hacks/KillPotionHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/KillauraHack.java b/src/main/java/net/wurstclient/hacks/KillauraHack.java index afa6d40d..cb06046b 100644 --- a/src/main/java/net/wurstclient/hacks/KillauraHack.java +++ b/src/main/java/net/wurstclient/hacks/KillauraHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java index f13bf020..1145b606 100644 --- a/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java +++ b/src/main/java/net/wurstclient/hacks/KillauraLegitHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -41,8 +41,8 @@ import net.wurstclient.util.BlockUtils; import net.wurstclient.util.EntityUtils; import net.wurstclient.util.RegionPos; import net.wurstclient.util.RenderUtils; +import net.wurstclient.util.Rotation; import net.wurstclient.util.RotationUtils; -import net.wurstclient.util.RotationUtils.Rotation; public final class KillauraLegitHack extends Hack implements UpdateListener, RenderListener @@ -207,8 +207,8 @@ public final class KillauraLegitHack extends Hack // turn towards center of boundingBox Rotation next = RotationUtils.slowlyTurnTowards(needed, rotationSpeed.getValueI() / 20F); - nextYaw = next.getYaw(); - nextPitch = next.getPitch(); + nextYaw = next.yaw(); + nextPitch = next.pitch(); // check if facing center if(RotationUtils.isAlreadyFacing(needed)) diff --git a/src/main/java/net/wurstclient/hacks/LiquidsHack.java b/src/main/java/net/wurstclient/hacks/LiquidsHack.java index 97752717..aa35148c 100644 --- a/src/main/java/net/wurstclient/hacks/LiquidsHack.java +++ b/src/main/java/net/wurstclient/hacks/LiquidsHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/LsdHack.java b/src/main/java/net/wurstclient/hacks/LsdHack.java index f3c0d9ae..f12687dd 100644 --- a/src/main/java/net/wurstclient/hacks/LsdHack.java +++ b/src/main/java/net/wurstclient/hacks/LsdHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/MassTpaHack.java b/src/main/java/net/wurstclient/hacks/MassTpaHack.java index d5a0a7d5..834d8eaa 100644 --- a/src/main/java/net/wurstclient/hacks/MassTpaHack.java +++ b/src/main/java/net/wurstclient/hacks/MassTpaHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/MileyCyrusHack.java b/src/main/java/net/wurstclient/hacks/MileyCyrusHack.java index 624dac3b..d39c6404 100644 --- a/src/main/java/net/wurstclient/hacks/MileyCyrusHack.java +++ b/src/main/java/net/wurstclient/hacks/MileyCyrusHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/MobEspHack.java b/src/main/java/net/wurstclient/hacks/MobEspHack.java index 3a2ad241..08b9dc64 100644 --- a/src/main/java/net/wurstclient/hacks/MobEspHack.java +++ b/src/main/java/net/wurstclient/hacks/MobEspHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java b/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java index 4cf0618e..d6de760d 100644 --- a/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java +++ b/src/main/java/net/wurstclient/hacks/MobSpawnEspHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/MultiAuraHack.java b/src/main/java/net/wurstclient/hacks/MultiAuraHack.java index 4c2ed8b3..c3d497b2 100644 --- a/src/main/java/net/wurstclient/hacks/MultiAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/MultiAuraHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -13,11 +13,9 @@ import java.util.stream.Stream; import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.entity.Entity; -import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.util.Hand; import net.wurstclient.Category; import net.wurstclient.SearchTags; -import net.wurstclient.WurstClient; import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.Hack; import net.wurstclient.settings.AttackSpeedSliderSetting; @@ -116,12 +114,9 @@ public final class MultiAuraHack extends Hack implements UpdateListener // attack entities for(Entity entity : entities) { - RotationUtils.Rotation rotations = RotationUtils - .getNeededRotations(entity.getBoundingBox().getCenter()); - - WurstClient.MC.player.networkHandler.sendPacket( - new PlayerMoveC2SPacket.LookAndOnGround(rotations.getYaw(), - rotations.getPitch(), MC.player.isOnGround())); + RotationUtils + .getNeededRotations(entity.getBoundingBox().getCenter()) + .sendPlayerLookPacket(); WURST.getHax().criticalsHack.doCritical(); MC.interactionManager.attackEntity(player, entity); diff --git a/src/main/java/net/wurstclient/hacks/NameProtectHack.java b/src/main/java/net/wurstclient/hacks/NameProtectHack.java index dbd08ca4..f38e94b9 100644 --- a/src/main/java/net/wurstclient/hacks/NameProtectHack.java +++ b/src/main/java/net/wurstclient/hacks/NameProtectHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/NameTagsHack.java b/src/main/java/net/wurstclient/hacks/NameTagsHack.java index 6e787e80..89c61d98 100644 --- a/src/main/java/net/wurstclient/hacks/NameTagsHack.java +++ b/src/main/java/net/wurstclient/hacks/NameTagsHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -11,10 +11,15 @@ import net.wurstclient.Category; import net.wurstclient.SearchTags; import net.wurstclient.hack.Hack; import net.wurstclient.settings.CheckboxSetting; +import net.wurstclient.settings.SliderSetting; @SearchTags({"name tags"}) public final class NameTagsHack extends Hack { + private final SliderSetting scale = + new SliderSetting("Scale", "How large the nametags should be.", 1, 0.05, + 5, 0.05, SliderSetting.ValueDisplay.PERCENTAGE); + private final CheckboxSetting unlimitedRange = new CheckboxSetting("Unlimited range", "Removes the 64 block distance limit for nametags.", true); @@ -22,21 +27,35 @@ public final class NameTagsHack extends Hack private final CheckboxSetting seeThrough = new CheckboxSetting( "See-through mode", "Renders nametags on the see-through text layer. This makes them" - + " easier to read behind walls, but harder to read behind water" - + " and other transparent things.", + + " easier to read behind walls, but causes some graphical glitches" + + " with water and other transparent things.", false); - private final CheckboxSetting forceNametags = new CheckboxSetting( - "Force nametags", - "Forces nametags of all players to be visible, even your own.", false); + private final CheckboxSetting forceMobNametags = new CheckboxSetting( + "Always show named mobs", "Displays the nametags of named mobs even" + + " when you are not looking directly at them.", + true); + + private final CheckboxSetting forcePlayerNametags = + new CheckboxSetting("Always show player names", + "Displays your own nametag as well as any player names that would" + + " normally be disabled by scoreboard team settings.", + false); public NameTagsHack() { super("NameTags"); setCategory(Category.RENDER); + addSetting(scale); addSetting(unlimitedRange); addSetting(seeThrough); - addSetting(forceNametags); + addSetting(forceMobNametags); + addSetting(forcePlayerNametags); + } + + public float getScale() + { + return scale.getValueF(); } public boolean isUnlimitedRange() @@ -49,11 +68,16 @@ public final class NameTagsHack extends Hack return isEnabled() && seeThrough.isChecked(); } - public boolean shouldForceNametags() + public boolean shouldForceMobNametags() { - return isEnabled() && forceNametags.isChecked(); + return isEnabled() && forceMobNametags.isChecked(); } - // See LivingEntityRendererMixin and - // EntityRendererMixin.wurstRenderLabelIfPresent() + public boolean shouldForcePlayerNametags() + { + return isEnabled() && forcePlayerNametags.isChecked(); + } + + // See EntityRendererMixin.wurstRenderLabelIfPresent(), + // LivingEntityRendererMixin, MobEntityRendererMixin } diff --git a/src/main/java/net/wurstclient/hacks/NavigatorHack.java b/src/main/java/net/wurstclient/hacks/NavigatorHack.java index 74932019..ff0c2515 100644 --- a/src/main/java/net/wurstclient/hacks/NavigatorHack.java +++ b/src/main/java/net/wurstclient/hacks/NavigatorHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/NewChunksHack.java b/src/main/java/net/wurstclient/hacks/NewChunksHack.java index 6f0eb7e8..75838bb0 100644 --- a/src/main/java/net/wurstclient/hacks/NewChunksHack.java +++ b/src/main/java/net/wurstclient/hacks/NewChunksHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/NoBackgroundHack.java b/src/main/java/net/wurstclient/hacks/NoBackgroundHack.java index 41ccc81a..29e08452 100644 --- a/src/main/java/net/wurstclient/hacks/NoBackgroundHack.java +++ b/src/main/java/net/wurstclient/hacks/NoBackgroundHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/NoClipHack.java b/src/main/java/net/wurstclient/hacks/NoClipHack.java index dd73450d..749ea9db 100644 --- a/src/main/java/net/wurstclient/hacks/NoClipHack.java +++ b/src/main/java/net/wurstclient/hacks/NoClipHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/NoFallHack.java b/src/main/java/net/wurstclient/hacks/NoFallHack.java index 6745cc18..ca234c01 100644 --- a/src/main/java/net/wurstclient/hacks/NoFallHack.java +++ b/src/main/java/net/wurstclient/hacks/NoFallHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/NoFireOverlayHack.java b/src/main/java/net/wurstclient/hacks/NoFireOverlayHack.java index cf2f287e..87b04566 100644 --- a/src/main/java/net/wurstclient/hacks/NoFireOverlayHack.java +++ b/src/main/java/net/wurstclient/hacks/NoFireOverlayHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/NoFogHack.java b/src/main/java/net/wurstclient/hacks/NoFogHack.java new file mode 100644 index 00000000..5b5cc93f --- /dev/null +++ b/src/main/java/net/wurstclient/hacks/NoFogHack.java @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.hacks; + +import net.wurstclient.Category; +import net.wurstclient.SearchTags; +import net.wurstclient.hack.Hack; + +@SearchTags({"no fog", "AntiFog", "anti fog"}) +public final class NoFogHack extends Hack +{ + public NoFogHack() + { + super("NoFog"); + setCategory(Category.RENDER); + } + + // See BackgroundRendererMixin +} diff --git a/src/main/java/net/wurstclient/hacks/NoHurtcamHack.java b/src/main/java/net/wurstclient/hacks/NoHurtcamHack.java index 1d3cd598..a4e48af0 100644 --- a/src/main/java/net/wurstclient/hacks/NoHurtcamHack.java +++ b/src/main/java/net/wurstclient/hacks/NoHurtcamHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/NoLevitationHack.java b/src/main/java/net/wurstclient/hacks/NoLevitationHack.java index 613b288e..d1a124d8 100644 --- a/src/main/java/net/wurstclient/hacks/NoLevitationHack.java +++ b/src/main/java/net/wurstclient/hacks/NoLevitationHack.java @@ -1,24 +1,24 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.hacks; - -import net.wurstclient.Category; -import net.wurstclient.SearchTags; -import net.wurstclient.hack.Hack; - -@SearchTags({"no levitation", "levitation", "levitate"}) -public final class NoLevitationHack extends Hack -{ - public NoLevitationHack() - { - super("NoLevitation"); - setCategory(Category.MOVEMENT); - } - - // See ClientPlayerEntityMixin.hasStatusEffect() -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.hacks; + +import net.wurstclient.Category; +import net.wurstclient.SearchTags; +import net.wurstclient.hack.Hack; + +@SearchTags({"no levitation", "levitation", "levitate"}) +public final class NoLevitationHack extends Hack +{ + public NoLevitationHack() + { + super("NoLevitation"); + setCategory(Category.MOVEMENT); + } + + // See ClientPlayerEntityMixin.hasStatusEffect() +} diff --git a/src/main/java/net/wurstclient/hacks/NoOverlayHack.java b/src/main/java/net/wurstclient/hacks/NoOverlayHack.java index cd20c234..c84a22a6 100644 --- a/src/main/java/net/wurstclient/hacks/NoOverlayHack.java +++ b/src/main/java/net/wurstclient/hacks/NoOverlayHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/NoPumpkinHack.java b/src/main/java/net/wurstclient/hacks/NoPumpkinHack.java index f892f4c9..dadeddd9 100644 --- a/src/main/java/net/wurstclient/hacks/NoPumpkinHack.java +++ b/src/main/java/net/wurstclient/hacks/NoPumpkinHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/NoShieldOverlayHack.java b/src/main/java/net/wurstclient/hacks/NoShieldOverlayHack.java index f0e32245..1c324c51 100644 --- a/src/main/java/net/wurstclient/hacks/NoShieldOverlayHack.java +++ b/src/main/java/net/wurstclient/hacks/NoShieldOverlayHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/NoSlowdownHack.java b/src/main/java/net/wurstclient/hacks/NoSlowdownHack.java index ac7c27a4..a254a451 100644 --- a/src/main/java/net/wurstclient/hacks/NoSlowdownHack.java +++ b/src/main/java/net/wurstclient/hacks/NoSlowdownHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/NoWeatherHack.java b/src/main/java/net/wurstclient/hacks/NoWeatherHack.java index 5d42141c..042a9b91 100644 --- a/src/main/java/net/wurstclient/hacks/NoWeatherHack.java +++ b/src/main/java/net/wurstclient/hacks/NoWeatherHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/NoWebHack.java b/src/main/java/net/wurstclient/hacks/NoWebHack.java index 4f633066..2fcafe6d 100644 --- a/src/main/java/net/wurstclient/hacks/NoWebHack.java +++ b/src/main/java/net/wurstclient/hacks/NoWebHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/NukerHack.java b/src/main/java/net/wurstclient/hacks/NukerHack.java index d8f08b77..45399f2e 100644 --- a/src/main/java/net/wurstclient/hacks/NukerHack.java +++ b/src/main/java/net/wurstclient/hacks/NukerHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/NukerLegitHack.java b/src/main/java/net/wurstclient/hacks/NukerLegitHack.java index 22d9999a..bd377080 100644 --- a/src/main/java/net/wurstclient/hacks/NukerLegitHack.java +++ b/src/main/java/net/wurstclient/hacks/NukerLegitHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/OpenWaterEspHack.java b/src/main/java/net/wurstclient/hacks/OpenWaterEspHack.java index a469c95e..03b6a7a9 100644 --- a/src/main/java/net/wurstclient/hacks/OpenWaterEspHack.java +++ b/src/main/java/net/wurstclient/hacks/OpenWaterEspHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/OverlayHack.java b/src/main/java/net/wurstclient/hacks/OverlayHack.java index d3b997d5..1bf2c2df 100644 --- a/src/main/java/net/wurstclient/hacks/OverlayHack.java +++ b/src/main/java/net/wurstclient/hacks/OverlayHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/PanicHack.java b/src/main/java/net/wurstclient/hacks/PanicHack.java index eeaa8077..1b3f90d5 100644 --- a/src/main/java/net/wurstclient/hacks/PanicHack.java +++ b/src/main/java/net/wurstclient/hacks/PanicHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/ParkourHack.java b/src/main/java/net/wurstclient/hacks/ParkourHack.java index c5cfb792..ef9ee13b 100644 --- a/src/main/java/net/wurstclient/hacks/ParkourHack.java +++ b/src/main/java/net/wurstclient/hacks/ParkourHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -11,6 +11,7 @@ import net.minecraft.util.math.Box; import net.wurstclient.Category; import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.Hack; +import net.wurstclient.settings.CheckboxSetting; import net.wurstclient.settings.SliderSetting; import net.wurstclient.settings.SliderSetting.ValueDisplay; @@ -27,12 +28,20 @@ public final class ParkourHack extends Hack implements UpdateListener "How close Parkour will let you get to the edge before jumping.", 0.001, 0.001, 0.25, 0.001, ValueDisplay.DECIMAL.withSuffix("m")); + private final CheckboxSetting sneak = new CheckboxSetting( + "Jump while sneaking", + "Keeps Parkour active even while you are sneaking.\n" + + "You may want to increase the \u00a7lEdge \u00a7ldistance\u00a7r" + + " slider when using this option.", + false); + public ParkourHack() { super("Parkour"); setCategory(Category.MOVEMENT); addSetting(minDepth); addSetting(edgeDistance); + addSetting(sneak); } @Override @@ -54,7 +63,8 @@ public final class ParkourHack extends Hack implements UpdateListener if(!MC.player.isOnGround() || MC.options.jumpKey.isPressed()) return; - if(MC.player.isSneaking() || MC.options.sneakKey.isPressed()) + if(!sneak.isChecked() + && (MC.player.isSneaking() || MC.options.sneakKey.isPressed())) return; Box box = MC.player.getBoundingBox(); diff --git a/src/main/java/net/wurstclient/hacks/PlayerEspHack.java b/src/main/java/net/wurstclient/hacks/PlayerEspHack.java index a44a5d2e..baf72d07 100644 --- a/src/main/java/net/wurstclient/hacks/PlayerEspHack.java +++ b/src/main/java/net/wurstclient/hacks/PlayerEspHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/PortalEspHack.java b/src/main/java/net/wurstclient/hacks/PortalEspHack.java index 4289e39d..1a7335a9 100644 --- a/src/main/java/net/wurstclient/hacks/PortalEspHack.java +++ b/src/main/java/net/wurstclient/hacks/PortalEspHack.java @@ -1,196 +1,196 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.hacks; - -import java.awt.Color; -import java.util.Arrays; -import java.util.List; -import java.util.function.BiPredicate; - -import org.lwjgl.opengl.GL11; - -import com.mojang.blaze3d.systems.RenderSystem; - -import net.minecraft.block.BlockState; -import net.minecraft.block.Blocks; -import net.minecraft.client.render.GameRenderer; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.util.math.BlockPos; -import net.wurstclient.Category; -import net.wurstclient.events.CameraTransformViewBobbingListener; -import net.wurstclient.events.PacketInputListener; -import net.wurstclient.events.RenderListener; -import net.wurstclient.events.UpdateListener; -import net.wurstclient.hack.Hack; -import net.wurstclient.hacks.portalesp.PortalEspBlockGroup; -import net.wurstclient.hacks.portalesp.PortalEspRenderer; -import net.wurstclient.settings.CheckboxSetting; -import net.wurstclient.settings.ChunkAreaSetting; -import net.wurstclient.settings.ColorSetting; -import net.wurstclient.settings.EspStyleSetting; -import net.wurstclient.util.ChunkSearcher.Result; -import net.wurstclient.util.ChunkSearcherCoordinator; -import net.wurstclient.util.RenderUtils; - -public final class PortalEspHack extends Hack implements UpdateListener, - CameraTransformViewBobbingListener, RenderListener -{ - private final EspStyleSetting style = new EspStyleSetting(); - - private final PortalEspBlockGroup netherPortal = - new PortalEspBlockGroup(Blocks.NETHER_PORTAL, - new ColorSetting("Nether portal color", - "Nether portals will be highlighted in this color.", Color.RED), - new CheckboxSetting("Include nether portals", true)); - - private final PortalEspBlockGroup endPortal = - new PortalEspBlockGroup(Blocks.END_PORTAL, - new ColorSetting("End portal color", - "End portals will be highlighted in this color.", Color.GREEN), - new CheckboxSetting("Include end portals", true)); - - private final PortalEspBlockGroup endPortalFrame = new PortalEspBlockGroup( - Blocks.END_PORTAL_FRAME, - new ColorSetting("End portal frame color", - "End portal frames will be highlighted in this color.", Color.BLUE), - new CheckboxSetting("Include end portal frames", true)); - - private final PortalEspBlockGroup endGateway = new PortalEspBlockGroup( - Blocks.END_GATEWAY, - new ColorSetting("End gateway color", - "End gateways will be highlighted in this color.", Color.YELLOW), - new CheckboxSetting("Include end gateways", true)); - - private final List groups = - Arrays.asList(netherPortal, endPortal, endPortalFrame, endGateway); - - private final ChunkAreaSetting area = new ChunkAreaSetting("Area", - "The area around the player to search in.\n" - + "Higher values require a faster computer."); - - private final BiPredicate query = - (pos, state) -> state.getBlock() == Blocks.NETHER_PORTAL - || state.getBlock() == Blocks.END_PORTAL - || state.getBlock() == Blocks.END_PORTAL_FRAME - || state.getBlock() == Blocks.END_GATEWAY; - - private final ChunkSearcherCoordinator coordinator = - new ChunkSearcherCoordinator(query, area); - - private boolean groupsUpToDate; - - public PortalEspHack() - { - super("PortalESP"); - setCategory(Category.RENDER); - - addSetting(style); - groups.stream().flatMap(PortalEspBlockGroup::getSettings) - .forEach(this::addSetting); - addSetting(area); - } - - @Override - public void onEnable() - { - groupsUpToDate = false; - - EVENTS.add(UpdateListener.class, this); - EVENTS.add(PacketInputListener.class, coordinator); - EVENTS.add(CameraTransformViewBobbingListener.class, this); - EVENTS.add(RenderListener.class, this); - - PortalEspRenderer.prepareBuffers(); - } - - @Override - public void onDisable() - { - EVENTS.remove(UpdateListener.class, this); - EVENTS.remove(PacketInputListener.class, coordinator); - EVENTS.remove(CameraTransformViewBobbingListener.class, this); - EVENTS.remove(RenderListener.class, this); - - coordinator.reset(); - groups.forEach(PortalEspBlockGroup::clear); - PortalEspRenderer.closeBuffers(); - } - - @Override - public void onCameraTransformViewBobbing( - CameraTransformViewBobbingEvent event) - { - if(style.getSelected().hasLines()) - event.cancel(); - } - - @Override - public void onUpdate() - { - boolean searchersChanged = coordinator.update(); - if(searchersChanged) - groupsUpToDate = false; - - if(!groupsUpToDate && coordinator.isDone()) - updateGroupBoxes(); - } - - @Override - public void onRender(MatrixStack matrixStack, float partialTicks) - { - // GL settings - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_DEPTH_TEST); - - matrixStack.push(); - RenderUtils.applyRegionalRenderOffset(matrixStack); - - PortalEspRenderer espRenderer = - new PortalEspRenderer(matrixStack, partialTicks); - - if(style.getSelected().hasBoxes()) - { - RenderSystem.setShader(GameRenderer::getPositionProgram); - groups.stream().filter(PortalEspBlockGroup::isEnabled) - .forEach(espRenderer::renderBoxes); - } - - if(style.getSelected().hasLines()) - { - RenderSystem.setShader(GameRenderer::getPositionProgram); - groups.stream().filter(PortalEspBlockGroup::isEnabled) - .forEach(espRenderer::renderLines); - } - - matrixStack.pop(); - - // GL resets - RenderSystem.setShaderColor(1, 1, 1, 1); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glDisable(GL11.GL_BLEND); - } - - private void updateGroupBoxes() - { - groups.forEach(PortalEspBlockGroup::clear); - coordinator.getMatches().forEach(this::addToGroupBoxes); - groupsUpToDate = true; - } - - private void addToGroupBoxes(Result result) - { - for(PortalEspBlockGroup group : groups) - if(result.state().getBlock() == group.getBlock()) - { - group.add(result.pos()); - break; - } - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.hacks; + +import java.awt.Color; +import java.util.Arrays; +import java.util.List; +import java.util.function.BiPredicate; + +import org.lwjgl.opengl.GL11; + +import com.mojang.blaze3d.systems.RenderSystem; + +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.client.render.GameRenderer; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.util.math.BlockPos; +import net.wurstclient.Category; +import net.wurstclient.events.CameraTransformViewBobbingListener; +import net.wurstclient.events.PacketInputListener; +import net.wurstclient.events.RenderListener; +import net.wurstclient.events.UpdateListener; +import net.wurstclient.hack.Hack; +import net.wurstclient.hacks.portalesp.PortalEspBlockGroup; +import net.wurstclient.hacks.portalesp.PortalEspRenderer; +import net.wurstclient.settings.CheckboxSetting; +import net.wurstclient.settings.ChunkAreaSetting; +import net.wurstclient.settings.ColorSetting; +import net.wurstclient.settings.EspStyleSetting; +import net.wurstclient.util.ChunkSearcher.Result; +import net.wurstclient.util.ChunkSearcherCoordinator; +import net.wurstclient.util.RenderUtils; + +public final class PortalEspHack extends Hack implements UpdateListener, + CameraTransformViewBobbingListener, RenderListener +{ + private final EspStyleSetting style = new EspStyleSetting(); + + private final PortalEspBlockGroup netherPortal = + new PortalEspBlockGroup(Blocks.NETHER_PORTAL, + new ColorSetting("Nether portal color", + "Nether portals will be highlighted in this color.", Color.RED), + new CheckboxSetting("Include nether portals", true)); + + private final PortalEspBlockGroup endPortal = + new PortalEspBlockGroup(Blocks.END_PORTAL, + new ColorSetting("End portal color", + "End portals will be highlighted in this color.", Color.GREEN), + new CheckboxSetting("Include end portals", true)); + + private final PortalEspBlockGroup endPortalFrame = new PortalEspBlockGroup( + Blocks.END_PORTAL_FRAME, + new ColorSetting("End portal frame color", + "End portal frames will be highlighted in this color.", Color.BLUE), + new CheckboxSetting("Include end portal frames", true)); + + private final PortalEspBlockGroup endGateway = new PortalEspBlockGroup( + Blocks.END_GATEWAY, + new ColorSetting("End gateway color", + "End gateways will be highlighted in this color.", Color.YELLOW), + new CheckboxSetting("Include end gateways", true)); + + private final List groups = + Arrays.asList(netherPortal, endPortal, endPortalFrame, endGateway); + + private final ChunkAreaSetting area = new ChunkAreaSetting("Area", + "The area around the player to search in.\n" + + "Higher values require a faster computer."); + + private final BiPredicate query = + (pos, state) -> state.getBlock() == Blocks.NETHER_PORTAL + || state.getBlock() == Blocks.END_PORTAL + || state.getBlock() == Blocks.END_PORTAL_FRAME + || state.getBlock() == Blocks.END_GATEWAY; + + private final ChunkSearcherCoordinator coordinator = + new ChunkSearcherCoordinator(query, area); + + private boolean groupsUpToDate; + + public PortalEspHack() + { + super("PortalESP"); + setCategory(Category.RENDER); + + addSetting(style); + groups.stream().flatMap(PortalEspBlockGroup::getSettings) + .forEach(this::addSetting); + addSetting(area); + } + + @Override + public void onEnable() + { + groupsUpToDate = false; + + EVENTS.add(UpdateListener.class, this); + EVENTS.add(PacketInputListener.class, coordinator); + EVENTS.add(CameraTransformViewBobbingListener.class, this); + EVENTS.add(RenderListener.class, this); + + PortalEspRenderer.prepareBuffers(); + } + + @Override + public void onDisable() + { + EVENTS.remove(UpdateListener.class, this); + EVENTS.remove(PacketInputListener.class, coordinator); + EVENTS.remove(CameraTransformViewBobbingListener.class, this); + EVENTS.remove(RenderListener.class, this); + + coordinator.reset(); + groups.forEach(PortalEspBlockGroup::clear); + PortalEspRenderer.closeBuffers(); + } + + @Override + public void onCameraTransformViewBobbing( + CameraTransformViewBobbingEvent event) + { + if(style.getSelected().hasLines()) + event.cancel(); + } + + @Override + public void onUpdate() + { + boolean searchersChanged = coordinator.update(); + if(searchersChanged) + groupsUpToDate = false; + + if(!groupsUpToDate && coordinator.isDone()) + updateGroupBoxes(); + } + + @Override + public void onRender(MatrixStack matrixStack, float partialTicks) + { + // GL settings + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_DEPTH_TEST); + + matrixStack.push(); + RenderUtils.applyRegionalRenderOffset(matrixStack); + + PortalEspRenderer espRenderer = + new PortalEspRenderer(matrixStack, partialTicks); + + if(style.getSelected().hasBoxes()) + { + RenderSystem.setShader(GameRenderer::getPositionProgram); + groups.stream().filter(PortalEspBlockGroup::isEnabled) + .forEach(espRenderer::renderBoxes); + } + + if(style.getSelected().hasLines()) + { + RenderSystem.setShader(GameRenderer::getPositionProgram); + groups.stream().filter(PortalEspBlockGroup::isEnabled) + .forEach(espRenderer::renderLines); + } + + matrixStack.pop(); + + // GL resets + RenderSystem.setShaderColor(1, 1, 1, 1); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_BLEND); + } + + private void updateGroupBoxes() + { + groups.forEach(PortalEspBlockGroup::clear); + coordinator.getMatches().forEach(this::addToGroupBoxes); + groupsUpToDate = true; + } + + private void addToGroupBoxes(Result result) + { + for(PortalEspBlockGroup group : groups) + if(result.state().getBlock() == group.getBlock()) + { + group.add(result.pos()); + break; + } + } +} diff --git a/src/main/java/net/wurstclient/hacks/PortalGuiHack.java b/src/main/java/net/wurstclient/hacks/PortalGuiHack.java index 74320e52..d2ae752f 100644 --- a/src/main/java/net/wurstclient/hacks/PortalGuiHack.java +++ b/src/main/java/net/wurstclient/hacks/PortalGuiHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/PotionSaverHack.java b/src/main/java/net/wurstclient/hacks/PotionSaverHack.java index 66446a47..9e9a2fb2 100644 --- a/src/main/java/net/wurstclient/hacks/PotionSaverHack.java +++ b/src/main/java/net/wurstclient/hacks/PotionSaverHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/ProphuntEspHack.java b/src/main/java/net/wurstclient/hacks/ProphuntEspHack.java index 33933c23..37ce9ef5 100644 --- a/src/main/java/net/wurstclient/hacks/ProphuntEspHack.java +++ b/src/main/java/net/wurstclient/hacks/ProphuntEspHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/ProtectHack.java b/src/main/java/net/wurstclient/hacks/ProtectHack.java index 30c86842..7a18c099 100644 --- a/src/main/java/net/wurstclient/hacks/ProtectHack.java +++ b/src/main/java/net/wurstclient/hacks/ProtectHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/RadarHack.java b/src/main/java/net/wurstclient/hacks/RadarHack.java index e08270fb..6b9f8118 100644 --- a/src/main/java/net/wurstclient/hacks/RadarHack.java +++ b/src/main/java/net/wurstclient/hacks/RadarHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/RainbowUiHack.java b/src/main/java/net/wurstclient/hacks/RainbowUiHack.java index f6c586fb..30a9b54d 100644 --- a/src/main/java/net/wurstclient/hacks/RainbowUiHack.java +++ b/src/main/java/net/wurstclient/hacks/RainbowUiHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/ReachHack.java b/src/main/java/net/wurstclient/hacks/ReachHack.java index c327427e..80f36baf 100644 --- a/src/main/java/net/wurstclient/hacks/ReachHack.java +++ b/src/main/java/net/wurstclient/hacks/ReachHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/RemoteViewHack.java b/src/main/java/net/wurstclient/hacks/RemoteViewHack.java index 820638fa..5550992c 100644 --- a/src/main/java/net/wurstclient/hacks/RemoteViewHack.java +++ b/src/main/java/net/wurstclient/hacks/RemoteViewHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/RestockHack.java b/src/main/java/net/wurstclient/hacks/RestockHack.java index e6f9b554..bd816d08 100644 --- a/src/main/java/net/wurstclient/hacks/RestockHack.java +++ b/src/main/java/net/wurstclient/hacks/RestockHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/SafeWalkHack.java b/src/main/java/net/wurstclient/hacks/SafeWalkHack.java index 745d5965..0bdd5230 100644 --- a/src/main/java/net/wurstclient/hacks/SafeWalkHack.java +++ b/src/main/java/net/wurstclient/hacks/SafeWalkHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/ScaffoldWalkHack.java b/src/main/java/net/wurstclient/hacks/ScaffoldWalkHack.java index ecb935dc..01f399d4 100644 --- a/src/main/java/net/wurstclient/hacks/ScaffoldWalkHack.java +++ b/src/main/java/net/wurstclient/hacks/ScaffoldWalkHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -14,7 +14,6 @@ import net.minecraft.block.BlockState; import net.minecraft.block.FallingBlock; import net.minecraft.item.BlockItem; import net.minecraft.item.ItemStack; -import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; @@ -26,7 +25,6 @@ import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.Hack; import net.wurstclient.util.BlockUtils; import net.wurstclient.util.RotationUtils; -import net.wurstclient.util.RotationUtils.Rotation; @SearchTags({"scaffold walk", "BridgeWalk", "bridge walk", "AutoBridge", "auto bridge", "tower"}) @@ -129,9 +127,7 @@ public final class ScaffoldWalkHack extends Hack implements UpdateListener private boolean placeBlock(BlockPos pos) { - Vec3d eyesPos = new Vec3d(MC.player.getX(), - MC.player.getY() + MC.player.getEyeHeight(MC.player.getPose()), - MC.player.getZ()); + Vec3d eyesPos = RotationUtils.getEyesPos(); for(Direction side : Direction.values()) { @@ -155,11 +151,7 @@ public final class ScaffoldWalkHack extends Hack implements UpdateListener continue; // place block - Rotation rotation = RotationUtils.getNeededRotations(hitVec); - PlayerMoveC2SPacket.LookAndOnGround packet = - new PlayerMoveC2SPacket.LookAndOnGround(rotation.getYaw(), - rotation.getPitch(), MC.player.isOnGround()); - MC.player.networkHandler.sendPacket(packet); + RotationUtils.getNeededRotations(hitVec).sendPlayerLookPacket(); IMC.getInteractionManager().rightClickBlock(neighbor, side2, hitVec); MC.player.swingHand(Hand.MAIN_HAND); diff --git a/src/main/java/net/wurstclient/hacks/SearchHack.java b/src/main/java/net/wurstclient/hacks/SearchHack.java index a0c86d6c..982d8fc2 100644 --- a/src/main/java/net/wurstclient/hacks/SearchHack.java +++ b/src/main/java/net/wurstclient/hacks/SearchHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/SkinDerpHack.java b/src/main/java/net/wurstclient/hacks/SkinDerpHack.java index 936f45c0..06b734b6 100644 --- a/src/main/java/net/wurstclient/hacks/SkinDerpHack.java +++ b/src/main/java/net/wurstclient/hacks/SkinDerpHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/SneakHack.java b/src/main/java/net/wurstclient/hacks/SneakHack.java index 89113747..ebc48db9 100644 --- a/src/main/java/net/wurstclient/hacks/SneakHack.java +++ b/src/main/java/net/wurstclient/hacks/SneakHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/SnowShoeHack.java b/src/main/java/net/wurstclient/hacks/SnowShoeHack.java index 494d79bc..6be908b3 100644 --- a/src/main/java/net/wurstclient/hacks/SnowShoeHack.java +++ b/src/main/java/net/wurstclient/hacks/SnowShoeHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/SpeedHackHack.java b/src/main/java/net/wurstclient/hacks/SpeedHackHack.java index 67aa2d89..97a822bd 100644 --- a/src/main/java/net/wurstclient/hacks/SpeedHackHack.java +++ b/src/main/java/net/wurstclient/hacks/SpeedHackHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/SpeedNukerHack.java b/src/main/java/net/wurstclient/hacks/SpeedNukerHack.java index b92de14a..b4a3c844 100644 --- a/src/main/java/net/wurstclient/hacks/SpeedNukerHack.java +++ b/src/main/java/net/wurstclient/hacks/SpeedNukerHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/SpiderHack.java b/src/main/java/net/wurstclient/hacks/SpiderHack.java index d0661c87..60c09244 100644 --- a/src/main/java/net/wurstclient/hacks/SpiderHack.java +++ b/src/main/java/net/wurstclient/hacks/SpiderHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/StepHack.java b/src/main/java/net/wurstclient/hacks/StepHack.java index 689cfcdc..5ee5bf09 100644 --- a/src/main/java/net/wurstclient/hacks/StepHack.java +++ b/src/main/java/net/wurstclient/hacks/StepHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/ThrowHack.java b/src/main/java/net/wurstclient/hacks/ThrowHack.java index 61e5f9e7..b5c1fe7c 100644 --- a/src/main/java/net/wurstclient/hacks/ThrowHack.java +++ b/src/main/java/net/wurstclient/hacks/ThrowHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/TillauraHack.java b/src/main/java/net/wurstclient/hacks/TillauraHack.java index 8650dfcb..d2cac5ee 100644 --- a/src/main/java/net/wurstclient/hacks/TillauraHack.java +++ b/src/main/java/net/wurstclient/hacks/TillauraHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/TimerHack.java b/src/main/java/net/wurstclient/hacks/TimerHack.java index 19b89d09..23060b34 100644 --- a/src/main/java/net/wurstclient/hacks/TimerHack.java +++ b/src/main/java/net/wurstclient/hacks/TimerHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/TiredHack.java b/src/main/java/net/wurstclient/hacks/TiredHack.java index 55f58132..2518a7f0 100644 --- a/src/main/java/net/wurstclient/hacks/TiredHack.java +++ b/src/main/java/net/wurstclient/hacks/TiredHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -7,10 +7,10 @@ */ package net.wurstclient.hacks; -import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.wurstclient.Category; import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.Hack; +import net.wurstclient.util.Rotation; public final class TiredHack extends Hack implements UpdateListener { @@ -39,8 +39,7 @@ public final class TiredHack extends Hack implements UpdateListener @Override public void onUpdate() { - MC.player.networkHandler.sendPacket( - new PlayerMoveC2SPacket.LookAndOnGround(MC.player.getYaw(), - MC.player.age % 100, MC.player.isOnGround())); + new Rotation(MC.player.getYaw(), MC.player.age % 100) + .sendPlayerLookPacket(); } } diff --git a/src/main/java/net/wurstclient/hacks/TooManyHaxHack.java b/src/main/java/net/wurstclient/hacks/TooManyHaxHack.java index 94637e9b..6ef5c98a 100644 --- a/src/main/java/net/wurstclient/hacks/TooManyHaxHack.java +++ b/src/main/java/net/wurstclient/hacks/TooManyHaxHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/TpAuraHack.java b/src/main/java/net/wurstclient/hacks/TpAuraHack.java index 23746187..8bb5db1d 100644 --- a/src/main/java/net/wurstclient/hacks/TpAuraHack.java +++ b/src/main/java/net/wurstclient/hacks/TpAuraHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -15,11 +15,9 @@ import java.util.stream.Stream; import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; -import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.util.Hand; import net.wurstclient.Category; import net.wurstclient.SearchTags; -import net.wurstclient.WurstClient; import net.wurstclient.events.UpdateListener; import net.wurstclient.hack.Hack; import net.wurstclient.settings.AttackSpeedSliderSetting; @@ -127,11 +125,8 @@ public final class TpAuraHack extends Hack implements UpdateListener return; // attack entity - RotationUtils.Rotation rotations = RotationUtils - .getNeededRotations(entity.getBoundingBox().getCenter()); - WurstClient.MC.player.networkHandler.sendPacket( - new PlayerMoveC2SPacket.LookAndOnGround(rotations.getYaw(), - rotations.getPitch(), MC.player.isOnGround())); + RotationUtils.getNeededRotations(entity.getBoundingBox().getCenter()) + .sendPlayerLookPacket(); WURST.getHax().criticalsHack.doCritical(); MC.interactionManager.attackEntity(player, entity); diff --git a/src/main/java/net/wurstclient/hacks/TrajectoriesHack.java b/src/main/java/net/wurstclient/hacks/TrajectoriesHack.java index 4d910d93..f99dbca6 100644 --- a/src/main/java/net/wurstclient/hacks/TrajectoriesHack.java +++ b/src/main/java/net/wurstclient/hacks/TrajectoriesHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -33,6 +33,7 @@ import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.Box; import net.minecraft.util.math.Vec3d; +import net.minecraft.world.RaycastContext.FluidHandling; import net.wurstclient.Category; import net.wurstclient.SearchTags; import net.wurstclient.events.RenderListener; @@ -185,6 +186,7 @@ public final class TrajectoriesHack extends Hack implements RenderListener Item item = stack.getItem(); double throwPower = getThrowPower(item); double gravity = getProjectileGravity(item); + FluidHandling fluidHandling = getFluidHandling(item); // prepare yaw and pitch double yaw = Math.toRadians(player.getYaw()); @@ -216,7 +218,8 @@ public final class TrajectoriesHack extends Hack implements RenderListener : RotationUtils.getEyesPos(); // check for block collision - BlockHitResult bResult = BlockUtils.raycast(lastPos, arrowPos); + BlockHitResult bResult = + BlockUtils.raycast(lastPos, arrowPos, fluidHandling); if(bResult.getType() != HitResult.Type.MISS) { // replace last pos with the collision point @@ -304,6 +307,14 @@ public final class TrajectoriesHack extends Hack implements RenderListener return 0.03; } + private FluidHandling getFluidHandling(Item item) + { + if(item instanceof FishingRodItem) + return FluidHandling.ANY; + + return FluidHandling.NONE; + } + public static boolean isThrowable(ItemStack stack) { if(stack.isEmpty()) diff --git a/src/main/java/net/wurstclient/hacks/TreeBotHack.java b/src/main/java/net/wurstclient/hacks/TreeBotHack.java index d36a55b2..03e7afc6 100644 --- a/src/main/java/net/wurstclient/hacks/TreeBotHack.java +++ b/src/main/java/net/wurstclient/hacks/TreeBotHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/TriggerBotHack.java b/src/main/java/net/wurstclient/hacks/TriggerBotHack.java index 0d246ce1..3aa7ffa7 100644 --- a/src/main/java/net/wurstclient/hacks/TriggerBotHack.java +++ b/src/main/java/net/wurstclient/hacks/TriggerBotHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/TrollPotionHack.java b/src/main/java/net/wurstclient/hacks/TrollPotionHack.java index 0d97fab9..e289a5ad 100644 --- a/src/main/java/net/wurstclient/hacks/TrollPotionHack.java +++ b/src/main/java/net/wurstclient/hacks/TrollPotionHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/TrueSightHack.java b/src/main/java/net/wurstclient/hacks/TrueSightHack.java index ecca3ddd..6edda3af 100644 --- a/src/main/java/net/wurstclient/hacks/TrueSightHack.java +++ b/src/main/java/net/wurstclient/hacks/TrueSightHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/TunnellerHack.java b/src/main/java/net/wurstclient/hacks/TunnellerHack.java index 3e97cbdd..9273eb8b 100644 --- a/src/main/java/net/wurstclient/hacks/TunnellerHack.java +++ b/src/main/java/net/wurstclient/hacks/TunnellerHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/XRayHack.java b/src/main/java/net/wurstclient/hacks/XRayHack.java index 648582ed..89221769 100644 --- a/src/main/java/net/wurstclient/hacks/XRayHack.java +++ b/src/main/java/net/wurstclient/hacks/XRayHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/autocomplete/ApiProviderSetting.java b/src/main/java/net/wurstclient/hacks/autocomplete/ApiProviderSetting.java index ec3d18cf..7cd1b473 100644 --- a/src/main/java/net/wurstclient/hacks/autocomplete/ApiProviderSetting.java +++ b/src/main/java/net/wurstclient/hacks/autocomplete/ApiProviderSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/autocomplete/MessageCompleter.java b/src/main/java/net/wurstclient/hacks/autocomplete/MessageCompleter.java index cf477e63..6feb1e37 100644 --- a/src/main/java/net/wurstclient/hacks/autocomplete/MessageCompleter.java +++ b/src/main/java/net/wurstclient/hacks/autocomplete/MessageCompleter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/autocomplete/ModelSettings.java b/src/main/java/net/wurstclient/hacks/autocomplete/ModelSettings.java index b7fb3980..9e47d3e6 100644 --- a/src/main/java/net/wurstclient/hacks/autocomplete/ModelSettings.java +++ b/src/main/java/net/wurstclient/hacks/autocomplete/ModelSettings.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/autocomplete/OobaboogaMessageCompleter.java b/src/main/java/net/wurstclient/hacks/autocomplete/OobaboogaMessageCompleter.java index 8ee7ce51..d6847970 100644 --- a/src/main/java/net/wurstclient/hacks/autocomplete/OobaboogaMessageCompleter.java +++ b/src/main/java/net/wurstclient/hacks/autocomplete/OobaboogaMessageCompleter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/autocomplete/OpenAiMessageCompleter.java b/src/main/java/net/wurstclient/hacks/autocomplete/OpenAiMessageCompleter.java index 39b66bca..2b74290c 100644 --- a/src/main/java/net/wurstclient/hacks/autocomplete/OpenAiMessageCompleter.java +++ b/src/main/java/net/wurstclient/hacks/autocomplete/OpenAiMessageCompleter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/autocomplete/SuggestionHandler.java b/src/main/java/net/wurstclient/hacks/autocomplete/SuggestionHandler.java index 66bed401..df759500 100644 --- a/src/main/java/net/wurstclient/hacks/autocomplete/SuggestionHandler.java +++ b/src/main/java/net/wurstclient/hacks/autocomplete/SuggestionHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/autofarm/AutoFarmRenderer.java b/src/main/java/net/wurstclient/hacks/autofarm/AutoFarmRenderer.java index f2997c71..f6af0559 100644 --- a/src/main/java/net/wurstclient/hacks/autofarm/AutoFarmRenderer.java +++ b/src/main/java/net/wurstclient/hacks/autofarm/AutoFarmRenderer.java @@ -1,178 +1,178 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.hacks.autofarm; - -import java.util.List; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Stream; - -import org.joml.Matrix4f; -import org.lwjgl.opengl.GL11; - -import com.mojang.blaze3d.systems.RenderSystem; - -import net.minecraft.client.gl.ShaderProgram; -import net.minecraft.client.gl.VertexBuffer; -import net.minecraft.client.render.BufferBuilder; -import net.minecraft.client.render.BufferBuilder.BuiltBuffer; -import net.minecraft.client.render.GameRenderer; -import net.minecraft.client.render.VertexFormat; -import net.minecraft.client.render.VertexFormats; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Box; -import net.minecraft.util.math.Vec3d; -import net.wurstclient.util.RenderUtils; - -public final class AutoFarmRenderer -{ - private VertexBuffer greenBuffer; - private VertexBuffer cyanBuffer; - private VertexBuffer redBuffer; - - public void reset() - { - Stream.of(greenBuffer, cyanBuffer, redBuffer).filter(Objects::nonNull) - .forEach(VertexBuffer::close); - greenBuffer = cyanBuffer = redBuffer = null; - } - - public void render(MatrixStack matrixStack) - { - // GL settings - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_DEPTH_TEST); - - matrixStack.push(); - - RenderUtils.applyRegionalRenderOffset(matrixStack); - - RenderSystem.setShader(GameRenderer::getPositionProgram); - Matrix4f viewMatrix = matrixStack.peek().getPositionMatrix(); - Matrix4f projMatrix = RenderSystem.getProjectionMatrix(); - ShaderProgram shader = RenderSystem.getShader(); - - if(greenBuffer != null) - { - RenderSystem.setShaderColor(0, 1, 0, 0.5F); - greenBuffer.bind(); - greenBuffer.draw(viewMatrix, projMatrix, shader); - VertexBuffer.unbind(); - } - - if(cyanBuffer != null) - { - RenderSystem.setShaderColor(0, 1, 1, 0.5F); - cyanBuffer.bind(); - cyanBuffer.draw(viewMatrix, projMatrix, shader); - VertexBuffer.unbind(); - } - - if(redBuffer != null) - { - RenderSystem.setShaderColor(1, 0, 0, 0.5F); - redBuffer.bind(); - redBuffer.draw(viewMatrix, projMatrix, shader); - VertexBuffer.unbind(); - } - - matrixStack.pop(); - - // GL resets - RenderSystem.setShaderColor(1, 1, 1, 1); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glDisable(GL11.GL_BLEND); - } - - public void updateVertexBuffers(List blocksToHarvest, - Set plants, List blocksToReplant) - { - BufferBuilder bufferBuilder = - RenderSystem.renderThreadTesselator().getBuffer(); - - Vec3d regionOffset = RenderUtils.getCameraRegion().negate().toVec3d(); - - double boxMin = 1 / 16.0; - double boxMax = 15 / 16.0; - Box box = new Box(boxMin, boxMin, boxMin, boxMax, boxMax, boxMax); - Box node = new Box(0.25, 0.25, 0.25, 0.75, 0.75, 0.75); - - updateGreenBuffer(blocksToHarvest, bufferBuilder, box, regionOffset); - updateCyanBuffer(plants, bufferBuilder, node, regionOffset); - updateRedBuffer(blocksToReplant, bufferBuilder, box, regionOffset); - } - - private void updateGreenBuffer(List blocksToHarvest, - BufferBuilder bufferBuilder, Box box, Vec3d regionOffset) - { - if(greenBuffer != null) - greenBuffer.close(); - - greenBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); - - for(BlockPos pos : blocksToHarvest) - { - Box renderBox = box.offset(pos).offset(regionOffset); - RenderUtils.drawOutlinedBox(renderBox, bufferBuilder); - } - - BuiltBuffer buffer = bufferBuilder.end(); - greenBuffer.bind(); - greenBuffer.upload(buffer); - VertexBuffer.unbind(); - } - - private void updateCyanBuffer(Set plants, - BufferBuilder bufferBuilder, Box node, Vec3d regionOffset) - { - if(cyanBuffer != null) - cyanBuffer.close(); - - cyanBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); - - for(BlockPos pos : plants) - { - Box renderNode = node.offset(pos).offset(regionOffset); - RenderUtils.drawNode(renderNode, bufferBuilder); - } - - BuiltBuffer buffer = bufferBuilder.end(); - cyanBuffer.bind(); - cyanBuffer.upload(buffer); - VertexBuffer.unbind(); - } - - private void updateRedBuffer(List blocksToReplant, - BufferBuilder bufferBuilder, Box box, Vec3d regionOffset) - { - if(redBuffer != null) - redBuffer.close(); - - redBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); - - for(BlockPos pos : blocksToReplant) - { - Box renderBox = box.offset(pos).offset(regionOffset); - RenderUtils.drawOutlinedBox(renderBox, bufferBuilder); - } - - BuiltBuffer buffer = bufferBuilder.end(); - redBuffer.bind(); - redBuffer.upload(buffer); - VertexBuffer.unbind(); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.hacks.autofarm; + +import java.util.List; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Stream; + +import org.joml.Matrix4f; +import org.lwjgl.opengl.GL11; + +import com.mojang.blaze3d.systems.RenderSystem; + +import net.minecraft.client.gl.ShaderProgram; +import net.minecraft.client.gl.VertexBuffer; +import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.BufferBuilder.BuiltBuffer; +import net.minecraft.client.render.GameRenderer; +import net.minecraft.client.render.VertexFormat; +import net.minecraft.client.render.VertexFormats; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Box; +import net.minecraft.util.math.Vec3d; +import net.wurstclient.util.RenderUtils; + +public final class AutoFarmRenderer +{ + private VertexBuffer greenBuffer; + private VertexBuffer cyanBuffer; + private VertexBuffer redBuffer; + + public void reset() + { + Stream.of(greenBuffer, cyanBuffer, redBuffer).filter(Objects::nonNull) + .forEach(VertexBuffer::close); + greenBuffer = cyanBuffer = redBuffer = null; + } + + public void render(MatrixStack matrixStack) + { + // GL settings + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_DEPTH_TEST); + + matrixStack.push(); + + RenderUtils.applyRegionalRenderOffset(matrixStack); + + RenderSystem.setShader(GameRenderer::getPositionProgram); + Matrix4f viewMatrix = matrixStack.peek().getPositionMatrix(); + Matrix4f projMatrix = RenderSystem.getProjectionMatrix(); + ShaderProgram shader = RenderSystem.getShader(); + + if(greenBuffer != null) + { + RenderSystem.setShaderColor(0, 1, 0, 0.5F); + greenBuffer.bind(); + greenBuffer.draw(viewMatrix, projMatrix, shader); + VertexBuffer.unbind(); + } + + if(cyanBuffer != null) + { + RenderSystem.setShaderColor(0, 1, 1, 0.5F); + cyanBuffer.bind(); + cyanBuffer.draw(viewMatrix, projMatrix, shader); + VertexBuffer.unbind(); + } + + if(redBuffer != null) + { + RenderSystem.setShaderColor(1, 0, 0, 0.5F); + redBuffer.bind(); + redBuffer.draw(viewMatrix, projMatrix, shader); + VertexBuffer.unbind(); + } + + matrixStack.pop(); + + // GL resets + RenderSystem.setShaderColor(1, 1, 1, 1); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_BLEND); + } + + public void updateVertexBuffers(List blocksToHarvest, + Set plants, List blocksToReplant) + { + BufferBuilder bufferBuilder = + RenderSystem.renderThreadTesselator().getBuffer(); + + Vec3d regionOffset = RenderUtils.getCameraRegion().negate().toVec3d(); + + double boxMin = 1 / 16.0; + double boxMax = 15 / 16.0; + Box box = new Box(boxMin, boxMin, boxMin, boxMax, boxMax, boxMax); + Box node = new Box(0.25, 0.25, 0.25, 0.75, 0.75, 0.75); + + updateGreenBuffer(blocksToHarvest, bufferBuilder, box, regionOffset); + updateCyanBuffer(plants, bufferBuilder, node, regionOffset); + updateRedBuffer(blocksToReplant, bufferBuilder, box, regionOffset); + } + + private void updateGreenBuffer(List blocksToHarvest, + BufferBuilder bufferBuilder, Box box, Vec3d regionOffset) + { + if(greenBuffer != null) + greenBuffer.close(); + + greenBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); + bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, + VertexFormats.POSITION); + + for(BlockPos pos : blocksToHarvest) + { + Box renderBox = box.offset(pos).offset(regionOffset); + RenderUtils.drawOutlinedBox(renderBox, bufferBuilder); + } + + BuiltBuffer buffer = bufferBuilder.end(); + greenBuffer.bind(); + greenBuffer.upload(buffer); + VertexBuffer.unbind(); + } + + private void updateCyanBuffer(Set plants, + BufferBuilder bufferBuilder, Box node, Vec3d regionOffset) + { + if(cyanBuffer != null) + cyanBuffer.close(); + + cyanBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); + bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, + VertexFormats.POSITION); + + for(BlockPos pos : plants) + { + Box renderNode = node.offset(pos).offset(regionOffset); + RenderUtils.drawNode(renderNode, bufferBuilder); + } + + BuiltBuffer buffer = bufferBuilder.end(); + cyanBuffer.bind(); + cyanBuffer.upload(buffer); + VertexBuffer.unbind(); + } + + private void updateRedBuffer(List blocksToReplant, + BufferBuilder bufferBuilder, Box box, Vec3d regionOffset) + { + if(redBuffer != null) + redBuffer.close(); + + redBuffer = new VertexBuffer(VertexBuffer.Usage.STATIC); + bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, + VertexFormats.POSITION); + + for(BlockPos pos : blocksToReplant) + { + Box renderBox = box.offset(pos).offset(regionOffset); + RenderUtils.drawOutlinedBox(renderBox, bufferBuilder); + } + + BuiltBuffer buffer = bufferBuilder.end(); + redBuffer.bind(); + redBuffer.upload(buffer); + VertexBuffer.unbind(); + } +} diff --git a/src/main/java/net/wurstclient/hacks/autofish/AutoFishDebugDraw.java b/src/main/java/net/wurstclient/hacks/autofish/AutoFishDebugDraw.java index 9755d310..9c0fe415 100644 --- a/src/main/java/net/wurstclient/hacks/autofish/AutoFishDebugDraw.java +++ b/src/main/java/net/wurstclient/hacks/autofish/AutoFishDebugDraw.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -37,18 +37,22 @@ import net.wurstclient.util.RenderUtils; public final class AutoFishDebugDraw { private final CheckboxSetting debugDraw = new CheckboxSetting("Debug draw", - "Shows where bites are occurring and where they will be detected. Useful for optimizing your 'Valid range' setting.", + "Shows where bites are occurring and where they will be detected." + + " Useful for optimizing your 'Valid range' setting.", false); private final ColorSetting ddColor = new ColorSetting("DD color", "Color of the debug draw, if enabled.", Color.RED); private final SliderSetting validRange; + private final FishingSpotManager fishingSpots; private Vec3d lastSoundPos; - public AutoFishDebugDraw(SliderSetting validRange) + public AutoFishDebugDraw(SliderSetting validRange, + FishingSpotManager fishingSpots) { this.validRange = validRange; + this.fishingSpots = fishingSpots; } public Stream getSettings() @@ -68,7 +72,7 @@ public final class AutoFishDebugDraw public void render(MatrixStack matrixStack, float partialTicks) { - if(!debugDraw.isChecked()) + if(!debugDraw.isChecked() && !fishingSpots.isMcmmoMode()) return; // GL settings @@ -82,12 +86,20 @@ public final class AutoFishDebugDraw RegionPos region = RenderUtils.getCameraRegion(); RenderUtils.applyRegionalRenderOffset(matrixStack, region); - FishingBobberEntity bobber = WurstClient.MC.player.fishHook; - if(bobber != null) - drawValidRange(matrixStack, partialTicks, bobber, region); + if(debugDraw.isChecked()) + { + FishingBobberEntity bobber = WurstClient.MC.player.fishHook; + if(bobber != null) + drawValidRange(matrixStack, partialTicks, bobber, region); + + if(lastSoundPos != null) + drawLastBite(matrixStack, region); + + drawFishingSpots(matrixStack, region); + } - if(lastSoundPos != null) - drawLastBite(matrixStack, region); + if(fishingSpots.isMcmmoMode()) + drawMcmmoRange(matrixStack, region); matrixStack.pop(); @@ -139,4 +151,66 @@ public final class AutoFishDebugDraw matrixStack.pop(); } + + private void drawFishingSpots(MatrixStack matrixStack, RegionPos region) + { + Box headBox = new Box(-0.25, 0, -0.25, 0.25, 0.5, 0.25); + Box noseBox = + headBox.offset(0.125, 0.125, 0.5).shrink(0.25, 0.35, 0.45); + + float[] colorF = ddColor.getColorF(); + RenderSystem.setShaderColor(colorF[0], colorF[1], colorF[2], 0.75F); + + for(FishingSpot spot : fishingSpots.getFishingSpots()) + { + Vec3d playerPos = spot.input().pos().subtract(region.toVec3d()); + Vec3d bobberPos = spot.bobberPos().subtract(region.toVec3d()); + + matrixStack.push(); + matrixStack.translate(playerPos.x, playerPos.y, playerPos.z); + + matrixStack.push(); + matrixStack.multiply(spot.input().rotation().toQuaternion()); + + RenderUtils.drawOutlinedBox(headBox, matrixStack); + RenderUtils.drawOutlinedBox(noseBox, matrixStack); + if(!spot.openWater()) + RenderUtils.drawCrossBox(headBox, matrixStack); + + matrixStack.pop(); + + RenderUtils.drawArrow(Vec3d.ZERO, bobberPos.subtract(playerPos), + matrixStack); + + matrixStack.pop(); + } + } + + private void drawMcmmoRange(MatrixStack matrixStack, RegionPos region) + { + FishingSpot lastSpot = fishingSpots.getLastSpot(); + if(lastSpot == null) + return; + + // only draw range during setup, or if debug draw is enabled + if(fishingSpots.isSetupDone() && !debugDraw.isChecked()) + return; + + Vec3d bobberPos = lastSpot.bobberPos().subtract(region.toVec3d()); + + matrixStack.push(); + matrixStack.translate(bobberPos.x, bobberPos.y, bobberPos.z); + + int mcmmoRange = fishingSpots.getRange(); + Box rangeBox = + new Box(0, 0, 0, 0, 0, 0).expand(mcmmoRange, 1, mcmmoRange); + RenderSystem.setShaderColor(1, 0, 0, 0.25F); + RenderUtils.drawSolidBox(rangeBox, matrixStack); + + RenderSystem.setShaderColor(1, 0, 0, 0.5F); + RenderUtils.drawOutlinedBox(rangeBox, matrixStack); + RenderUtils.drawOutlinedBox(rangeBox.contract(0, 1, 0), matrixStack); + + matrixStack.pop(); + } } diff --git a/src/main/java/net/wurstclient/hacks/autofish/AutoFishRodSelector.java b/src/main/java/net/wurstclient/hacks/autofish/AutoFishRodSelector.java index 7cd13707..d3544547 100644 --- a/src/main/java/net/wurstclient/hacks/autofish/AutoFishRodSelector.java +++ b/src/main/java/net/wurstclient/hacks/autofish/AutoFishRodSelector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -32,8 +32,12 @@ public final class AutoFishRodSelector "If enabled, AutoFish will turn itself off when it runs out of fishing rods.", false); + private final CheckboxSetting stopWhenInvFull = new CheckboxSetting( + "Stop when inv full", + "If enabled, AutoFish will turn itself off when your inventory is full.", + false); + private final AutoFishHack autoFish; - private int bestRodValue; private int bestRodSlot; public AutoFishRodSelector(AutoFishHack autoFish) @@ -43,28 +47,33 @@ public final class AutoFishRodSelector public Stream getSettings() { - return Stream.of(stopWhenOutOfRods); + return Stream.of(stopWhenOutOfRods, stopWhenInvFull); } public void reset() { - bestRodValue = -1; bestRodSlot = -1; } - public boolean hasARod() + public boolean isOutOfRods() { - return bestRodSlot != -1; + return bestRodSlot == -1; } - public boolean isBestRodAlreadySelected() + /** + * Reevaluates the player's fishing rods, checks for any inventory-related + * issues and updates the selected rod if necessary. + * + * @return true if it's OK to proceed with fishing in the same tick + */ + public boolean update() { PlayerInventory inventory = MC.player.getInventory(); int selectedSlot = inventory.selectedSlot; ItemStack selectedStack = inventory.getStack(selectedSlot); // evaluate selected rod (or lack thereof) - bestRodValue = getRodValue(selectedStack); + int bestRodValue = getRodValue(selectedStack); bestRodSlot = bestRodValue > -1 ? selectedSlot : -1; // create a stream of all slots that we want to search @@ -84,20 +93,34 @@ public final class AutoFishRodSelector } } - // return true if selected rod is best rod - return bestRodSlot == selectedSlot; - } - - public void selectBestRod() - { - if(bestRodSlot == -1 && stopWhenOutOfRods.isChecked()) + // wait for AutoEat to finish eating + if(WurstClient.INSTANCE.getHax().autoEatHack.isEating()) + return false; + + // stop if out of rods + if(stopWhenOutOfRods.isChecked() && bestRodSlot == -1) { ChatUtils.message("AutoFish has run out of fishing rods."); autoFish.setEnabled(false); - return; + return false; } + // stop if inventory is full + if(stopWhenInvFull.isChecked() && inventory.getEmptySlot() == -1) + { + ChatUtils.message( + "AutoFish has stopped because your inventory is full."); + autoFish.setEnabled(false); + return false; + } + + // check if selected rod is still the best one + if(MC.player.getInventory().selectedSlot == bestRodSlot) + return true; + + // change selected rod and wait until the next tick InventoryUtils.selectItem(bestRodSlot); + return false; } private int getRodValue(ItemStack stack) diff --git a/src/main/java/net/wurstclient/hacks/autofish/FishingSpot.java b/src/main/java/net/wurstclient/hacks/autofish/FishingSpot.java new file mode 100644 index 00000000..68e4087c --- /dev/null +++ b/src/main/java/net/wurstclient/hacks/autofish/FishingSpot.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.hacks.autofish; + +import net.minecraft.entity.projectile.FishingBobberEntity; +import net.minecraft.util.math.Vec3d; + +public record FishingSpot(PositionAndRotation input, Vec3d bobberPos, + boolean openWater) +{ + public FishingSpot(PositionAndRotation input, FishingBobberEntity bobber) + { + this(input, bobber.getPos(), bobber.isInOpenWater()); + } +} diff --git a/src/main/java/net/wurstclient/hacks/autofish/FishingSpotManager.java b/src/main/java/net/wurstclient/hacks/autofish/FishingSpotManager.java new file mode 100644 index 00000000..62e4f625 --- /dev/null +++ b/src/main/java/net/wurstclient/hacks/autofish/FishingSpotManager.java @@ -0,0 +1,273 @@ +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.hacks.autofish; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.stream.Stream; + +import net.minecraft.client.MinecraftClient; +import net.minecraft.entity.projectile.FishingBobberEntity; +import net.minecraft.util.math.Vec3d; +import net.wurstclient.WurstClient; +import net.wurstclient.mixinterface.IKeyBinding; +import net.wurstclient.settings.CheckboxSetting; +import net.wurstclient.settings.Setting; +import net.wurstclient.settings.SliderSetting; +import net.wurstclient.settings.SliderSetting.ValueDisplay; +import net.wurstclient.util.ChatUtils; +import net.wurstclient.util.Rotation; +import net.wurstclient.util.RotationUtils; + +public final class FishingSpotManager +{ + private static final MinecraftClient MC = WurstClient.MC; + + private final CheckboxSetting mcmmoMode = new CheckboxSetting("mcMMO mode", + "If enabled, AutoFish will cycle between two different fishing spots" + + " to bypass mcMMO's overfishing mechanic.\n\n" + + "All other mcMMO settings will do nothing if this is disabled.", + false); + + private final SliderSetting mcmmoRange = new SliderSetting("mcMMO range", + "The value of mcMMO's MoveRange config option. This is the minimum" + + " distance between two fishing spots needed to avoid overfishing.\n\n" + + "mcMMO only cares about the position of the bobber, so you don't" + + " need to move your character unless some other anti-AFK plugin" + + " is present.", + 3, 1, 50, 1, ValueDisplay.INTEGER.withSuffix(" blocks")); + + private final CheckboxSetting mcmmoRangeBug = + new CheckboxSetting("mcMMO range bug", + "At the time of writing, there is a bug in mcMMO's range" + + " calculation, meaning the default range of 3 blocks is" + + " actually just 2 blocks.\n\n" + + "Uncheck this box if they ever fix it.", + true); + + private final SliderSetting mcmmoLimit = new SliderSetting("mcMMO limit", + "The value of mcMMO's OverFishLimit config option. Overfishing starts" + + " at this value, so you can actually only catch (limit - 1) fish" + + " from the same spot.", + 10, 2, 1000, 1, ValueDisplay.INTEGER); + + private final ArrayList fishingSpots = new ArrayList<>(); + private FishingSpot lastSpot; + private FishingSpot nextSpot; + private PositionAndRotation castPosRot; + private int fishCaughtAtLastSpot; + private boolean spot1MsgShown; + private boolean spot2MsgShown; + private boolean setupDoneMsgShown; + + /** + * Changes the player's fishing spot if necessary. + * + * @return true if it's OK to cast the fishing rod + */ + public boolean onCast() + { + castPosRot = new PositionAndRotation(MC.player); + if(!mcmmoMode.isChecked()) + return true; + + // allow first cast, tell user to wait + if(lastSpot == null) + { + if(spot1MsgShown) + return true; + + ChatUtils.message("Starting AutoFish mcMMO mode."); + ChatUtils.message("Please wait while the first fishing spot is" + + " being recorded."); + spot1MsgShown = true; + return true; + } + spot1MsgShown = false; + + // set next spot if necessary, instruct user if new spot is needed + if(nextSpot == null && (nextSpot = chooseNextSpot()) == null) + { + if(spot2MsgShown) + return false; + + ChatUtils + .message("AutoFish mcMMO mode requires another fishing spot."); + ChatUtils.message("Move your camera (or the player, if necessary)" + + " so that the bobber will land outside of the red box, then" + + " cast the rod."); + spot2MsgShown = true; + setupDoneMsgShown = false; + return false; + } + spot2MsgShown = false; + + // confirm setup is done + if(!setupDoneMsgShown) + { + ChatUtils.message("All done! AutoFish will now run automatically" + + " and switch between the fishing spots as needed."); + setupDoneMsgShown = true; + } + + // automatically move to next spot when limit is reached + if(fishCaughtAtLastSpot >= mcmmoLimit.getValueI() - 1) + { + moveToNextSpot(); + return false; + } + + return true; + } + + private void moveToNextSpot() + { + PositionAndRotation nextPosRot = nextSpot.input(); + ((IKeyBinding)MC.options.forwardKey).resetPressedState(); + ((IKeyBinding)MC.options.jumpKey).resetPressedState(); + + // match position + Vec3d nextPos = nextPosRot.pos(); + double distance = nextPos.distanceTo(castPosRot.pos()); + if(distance > 0.1) + { + // face next spot + Rotation needed = + RotationUtils.getNeededRotations(nextPos).withPitch(0); + if(!RotationUtils.isAlreadyFacing(needed)) + { + RotationUtils.slowlyTurnTowards(needed, 5) + .applyToClientPlayer(); + return; + } + + // jump if necessary + MC.options.jumpKey.setPressed( + MC.player.isTouchingWater() || MC.player.horizontalCollision); + + // walk or teleport depending on distance + if(distance < 0.2) + MC.player.setPosition(nextPos.x, nextPos.y, nextPos.z); + else if(distance > 0.7 || MC.player.age % 10 == 0) + MC.options.forwardKey.setPressed(true); + return; + } + + // match rotation + Rotation nextRot = nextPosRot.rotation(); + if(!RotationUtils.isAlreadyFacing(nextRot)) + { + RotationUtils.slowlyTurnTowards(nextRot, 5).applyToClientPlayer(); + return; + } + + // update spot and reset counter + lastSpot = nextSpot; + nextSpot = null; + fishCaughtAtLastSpot = 0; + } + + public void onBite(FishingBobberEntity bobber) + { + boolean samePlayerInput = lastSpot != null + && lastSpot.input().isNearlyIdenticalTo(castPosRot); + boolean sameBobberPos = lastSpot != null + && isInRange(lastSpot.bobberPos(), bobber.getPos()); + + // update counter based on bobber position + if(sameBobberPos) + fishCaughtAtLastSpot++; + else + fishCaughtAtLastSpot = 1; + + // register new fishing spot if input changed + if(!samePlayerInput) + { + lastSpot = new FishingSpot(castPosRot, bobber); + fishingSpots.add(lastSpot); + return; + } + + // update last spot if same input led to different bobber position + if(!sameBobberPos) + { + FishingSpot updatedSpot = new FishingSpot(lastSpot.input(), bobber); + fishingSpots.remove(lastSpot); + fishingSpots.add(updatedSpot); + lastSpot = updatedSpot; + } + } + + public void reset() + { + fishingSpots.clear(); + lastSpot = null; + nextSpot = null; + castPosRot = null; + fishCaughtAtLastSpot = 0; + spot1MsgShown = false; + spot2MsgShown = false; + setupDoneMsgShown = false; + } + + private FishingSpot chooseNextSpot() + { + return fishingSpots.stream().filter(spot -> spot != lastSpot) + .filter(spot -> !isInRange(spot.bobberPos(), lastSpot.bobberPos())) + .min(Comparator.comparingDouble( + spot -> spot.input().differenceTo(lastSpot.input()))) + .orElse(null); + } + + private boolean isInRange(Vec3d pos1, Vec3d pos2) + { + double dy = Math.abs(pos1.y - pos2.y); + if(dy > 2) + return false; + + double dx = Math.abs(pos1.x - pos2.x); + double dz = Math.abs(pos1.z - pos2.z); + return Math.max(dx, dz) <= getRange(); + } + + public int getRange() + { + // rounded down to the nearest even number + if(mcmmoRangeBug.isChecked()) + return mcmmoRange.getValueI() / 2 * 2; + + return mcmmoRange.getValueI(); + } + + public FishingSpot getLastSpot() + { + return lastSpot; + } + + public boolean isSetupDone() + { + return lastSpot != null && nextSpot != null; + } + + public boolean isMcmmoMode() + { + return mcmmoMode.isChecked(); + } + + public Stream getSettings() + { + return Stream.of(mcmmoMode, mcmmoRange, mcmmoRangeBug, mcmmoLimit); + } + + public List getFishingSpots() + { + return Collections.unmodifiableList(fishingSpots); + } +} diff --git a/src/main/java/net/wurstclient/hacks/autofish/PositionAndRotation.java b/src/main/java/net/wurstclient/hacks/autofish/PositionAndRotation.java new file mode 100644 index 00000000..617cd59c --- /dev/null +++ b/src/main/java/net/wurstclient/hacks/autofish/PositionAndRotation.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.hacks.autofish; + +import net.minecraft.entity.Entity; +import net.minecraft.util.math.Vec3d; +import net.wurstclient.util.Rotation; + +public record PositionAndRotation(Vec3d pos, Rotation rotation) +{ + public PositionAndRotation(Entity entity) + { + this(entity.getPos(), + Rotation.wrapped(entity.getYaw(), entity.getPitch())); + } + + public boolean isNearlyIdenticalTo(PositionAndRotation other) + { + return pos.distanceTo(other.pos) < 0.5 + && rotation.getAngleTo(other.rotation) < 5; + } + + public double differenceTo(PositionAndRotation other) + { + return pos.distanceTo(other.pos) + + rotation.getAngleTo(other.rotation) / 100; + } +} diff --git a/src/main/java/net/wurstclient/hacks/autofish/ShallowWaterWarningCheckbox.java b/src/main/java/net/wurstclient/hacks/autofish/ShallowWaterWarningCheckbox.java index 2944e4fd..9d745992 100644 --- a/src/main/java/net/wurstclient/hacks/autofish/ShallowWaterWarningCheckbox.java +++ b/src/main/java/net/wurstclient/hacks/autofish/ShallowWaterWarningCheckbox.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -29,8 +29,9 @@ public class ShallowWaterWarningCheckbox extends CheckboxSetting hasAlreadyWarned = false; } - public void checkWaterAround(FishingBobberEntity bobber) + public void checkWaterType() { + FishingBobberEntity bobber = WurstClient.MC.player.fishHook; if(bobber.isOpenOrWaterAround(bobber.getBlockPos())) { hasAlreadyWarned = false; diff --git a/src/main/java/net/wurstclient/hacks/autolibrarian/BookOffer.java b/src/main/java/net/wurstclient/hacks/autolibrarian/BookOffer.java index 5ea262b4..08507a92 100644 --- a/src/main/java/net/wurstclient/hacks/autolibrarian/BookOffer.java +++ b/src/main/java/net/wurstclient/hacks/autolibrarian/BookOffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/autolibrarian/UpdateBooksSetting.java b/src/main/java/net/wurstclient/hacks/autolibrarian/UpdateBooksSetting.java index 8820de15..d0a41f13 100644 --- a/src/main/java/net/wurstclient/hacks/autolibrarian/UpdateBooksSetting.java +++ b/src/main/java/net/wurstclient/hacks/autolibrarian/UpdateBooksSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/chestesp/ChestEspBlockGroup.java b/src/main/java/net/wurstclient/hacks/chestesp/ChestEspBlockGroup.java index 8cbd7965..d983da54 100644 --- a/src/main/java/net/wurstclient/hacks/chestesp/ChestEspBlockGroup.java +++ b/src/main/java/net/wurstclient/hacks/chestesp/ChestEspBlockGroup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/chestesp/ChestEspEntityGroup.java b/src/main/java/net/wurstclient/hacks/chestesp/ChestEspEntityGroup.java index 13a636d3..dc9c168c 100644 --- a/src/main/java/net/wurstclient/hacks/chestesp/ChestEspEntityGroup.java +++ b/src/main/java/net/wurstclient/hacks/chestesp/ChestEspEntityGroup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/chestesp/ChestEspGroup.java b/src/main/java/net/wurstclient/hacks/chestesp/ChestEspGroup.java index 220c1910..51cfb4fd 100644 --- a/src/main/java/net/wurstclient/hacks/chestesp/ChestEspGroup.java +++ b/src/main/java/net/wurstclient/hacks/chestesp/ChestEspGroup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/chestesp/ChestEspRenderer.java b/src/main/java/net/wurstclient/hacks/chestesp/ChestEspRenderer.java index ed0ade7a..10fcad97 100644 --- a/src/main/java/net/wurstclient/hacks/chestesp/ChestEspRenderer.java +++ b/src/main/java/net/wurstclient/hacks/chestesp/ChestEspRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksChunkRenderer.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksChunkRenderer.java index c41c4a2b..a8017391 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksChunkRenderer.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksChunkRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksOutlineRenderer.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksOutlineRenderer.java index 6e99cf1e..e4d82fd5 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksOutlineRenderer.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksOutlineRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksReasonsRenderer.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksReasonsRenderer.java index 05f7e38c..9702033e 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksReasonsRenderer.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksReasonsRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksRenderer.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksRenderer.java index 04f19135..3f86b084 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksRenderer.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksShowSetting.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksShowSetting.java index ee23d684..768af702 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksShowSetting.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksShowSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksSquareRenderer.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksSquareRenderer.java index 094ab3d9..2a2ecd51 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksSquareRenderer.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksSquareRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksStyleSetting.java b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksStyleSetting.java index 44cb6b33..657e540b 100644 --- a/src/main/java/net/wurstclient/hacks/newchunks/NewChunksStyleSetting.java +++ b/src/main/java/net/wurstclient/hacks/newchunks/NewChunksStyleSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/portalesp/PortalEspBlockGroup.java b/src/main/java/net/wurstclient/hacks/portalesp/PortalEspBlockGroup.java index db988f20..ca38fbc5 100644 --- a/src/main/java/net/wurstclient/hacks/portalesp/PortalEspBlockGroup.java +++ b/src/main/java/net/wurstclient/hacks/portalesp/PortalEspBlockGroup.java @@ -1,86 +1,86 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.hacks.portalesp; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.stream.Stream; - -import net.minecraft.block.Block; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Box; -import net.wurstclient.settings.CheckboxSetting; -import net.wurstclient.settings.ColorSetting; -import net.wurstclient.settings.Setting; -import net.wurstclient.util.BlockUtils; - -public final class PortalEspBlockGroup -{ - protected final ArrayList boxes = new ArrayList<>(); - private final Block block; - private final ColorSetting color; - private final CheckboxSetting enabled; - - public PortalEspBlockGroup(Block block, ColorSetting color, - CheckboxSetting enabled) - { - this.block = block; - this.color = Objects.requireNonNull(color); - this.enabled = enabled; - } - - public void add(BlockPos pos) - { - Box box = getBox(pos); - if(box == null) - return; - - boxes.add(box); - } - - private Box getBox(BlockPos pos) - { - if(!BlockUtils.canBeClicked(pos)) - return null; - - return BlockUtils.getBoundingBox(pos); - } - - public void clear() - { - boxes.clear(); - } - - public boolean isEnabled() - { - return enabled == null || enabled.isChecked(); - } - - public Stream getSettings() - { - return Stream.of(enabled, color).filter(Objects::nonNull); - } - - public Block getBlock() - { - return block; - } - - public float[] getColorF() - { - return color.getColorF(); - } - - public List getBoxes() - { - return Collections.unmodifiableList(boxes); - } - -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.hacks.portalesp; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.stream.Stream; + +import net.minecraft.block.Block; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Box; +import net.wurstclient.settings.CheckboxSetting; +import net.wurstclient.settings.ColorSetting; +import net.wurstclient.settings.Setting; +import net.wurstclient.util.BlockUtils; + +public final class PortalEspBlockGroup +{ + protected final ArrayList boxes = new ArrayList<>(); + private final Block block; + private final ColorSetting color; + private final CheckboxSetting enabled; + + public PortalEspBlockGroup(Block block, ColorSetting color, + CheckboxSetting enabled) + { + this.block = block; + this.color = Objects.requireNonNull(color); + this.enabled = enabled; + } + + public void add(BlockPos pos) + { + Box box = getBox(pos); + if(box == null) + return; + + boxes.add(box); + } + + private Box getBox(BlockPos pos) + { + if(!BlockUtils.canBeClicked(pos)) + return null; + + return BlockUtils.getBoundingBox(pos); + } + + public void clear() + { + boxes.clear(); + } + + public boolean isEnabled() + { + return enabled == null || enabled.isChecked(); + } + + public Stream getSettings() + { + return Stream.of(enabled, color).filter(Objects::nonNull); + } + + public Block getBlock() + { + return block; + } + + public float[] getColorF() + { + return color.getColorF(); + } + + public List getBoxes() + { + return Collections.unmodifiableList(boxes); + } + +} diff --git a/src/main/java/net/wurstclient/hacks/portalesp/PortalEspRenderer.java b/src/main/java/net/wurstclient/hacks/portalesp/PortalEspRenderer.java index d44716d2..34d0696e 100644 --- a/src/main/java/net/wurstclient/hacks/portalesp/PortalEspRenderer.java +++ b/src/main/java/net/wurstclient/hacks/portalesp/PortalEspRenderer.java @@ -1,124 +1,124 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.hacks.portalesp; - -import java.util.Objects; -import java.util.stream.Stream; - -import org.joml.Matrix4f; - -import com.mojang.blaze3d.systems.RenderSystem; - -import net.minecraft.client.gl.ShaderProgram; -import net.minecraft.client.gl.VertexBuffer; -import net.minecraft.client.render.BufferBuilder; -import net.minecraft.client.render.Tessellator; -import net.minecraft.client.render.VertexFormat; -import net.minecraft.client.render.VertexFormats; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Box; -import net.minecraft.util.math.Vec3d; -import net.wurstclient.util.RegionPos; -import net.wurstclient.util.RenderUtils; -import net.wurstclient.util.RotationUtils; - -public final class PortalEspRenderer -{ - private static VertexBuffer solidBox; - private static VertexBuffer outlinedBox; - - private final MatrixStack matrixStack; - private final RegionPos region; - private final Vec3d start; - - public PortalEspRenderer(MatrixStack matrixStack, float partialTicks) - { - this.matrixStack = matrixStack; - region = RenderUtils.getCameraRegion(); - start = RotationUtils.getClientLookVec(partialTicks) - .add(RenderUtils.getCameraPos()).subtract(region.toVec3d()); - } - - public void renderBoxes(PortalEspBlockGroup group) - { - float[] colorF = group.getColorF(); - - for(Box box : group.getBoxes()) - { - matrixStack.push(); - - matrixStack.translate(box.minX - region.x(), box.minY, - box.minZ - region.z()); - - matrixStack.scale((float)(box.maxX - box.minX), - (float)(box.maxY - box.minY), (float)(box.maxZ - box.minZ)); - - Matrix4f viewMatrix = matrixStack.peek().getPositionMatrix(); - Matrix4f projMatrix = RenderSystem.getProjectionMatrix(); - ShaderProgram shader = RenderSystem.getShader(); - - RenderSystem.setShaderColor(colorF[0], colorF[1], colorF[2], 0.25F); - solidBox.bind(); - solidBox.draw(viewMatrix, projMatrix, shader); - VertexBuffer.unbind(); - - RenderSystem.setShaderColor(colorF[0], colorF[1], colorF[2], 0.5F); - outlinedBox.bind(); - outlinedBox.draw(viewMatrix, projMatrix, shader); - VertexBuffer.unbind(); - - matrixStack.pop(); - } - } - - public void renderLines(PortalEspBlockGroup group) - { - Matrix4f matrix = matrixStack.peek().getPositionMatrix(); - Tessellator tessellator = RenderSystem.renderThreadTesselator(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); - - float[] colorF = group.getColorF(); - RenderSystem.setShaderColor(colorF[0], colorF[1], colorF[2], 0.5F); - - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, - VertexFormats.POSITION); - - for(Box box : group.getBoxes()) - { - Vec3d end = box.getCenter().subtract(region.toVec3d()); - - bufferBuilder - .vertex(matrix, (float)start.x, (float)start.y, (float)start.z) - .next(); - - bufferBuilder - .vertex(matrix, (float)end.x, (float)end.y, (float)end.z) - .next(); - } - - tessellator.draw(); - } - - public static void prepareBuffers() - { - closeBuffers(); - solidBox = new VertexBuffer(VertexBuffer.Usage.STATIC); - outlinedBox = new VertexBuffer(VertexBuffer.Usage.STATIC); - - Box box = new Box(BlockPos.ORIGIN); - RenderUtils.drawSolidBox(box, solidBox); - RenderUtils.drawOutlinedBox(box, outlinedBox); - } - - public static void closeBuffers() - { - Stream.of(solidBox, outlinedBox).filter(Objects::nonNull) - .forEach(VertexBuffer::close); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.hacks.portalesp; + +import java.util.Objects; +import java.util.stream.Stream; + +import org.joml.Matrix4f; + +import com.mojang.blaze3d.systems.RenderSystem; + +import net.minecraft.client.gl.ShaderProgram; +import net.minecraft.client.gl.VertexBuffer; +import net.minecraft.client.render.BufferBuilder; +import net.minecraft.client.render.Tessellator; +import net.minecraft.client.render.VertexFormat; +import net.minecraft.client.render.VertexFormats; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Box; +import net.minecraft.util.math.Vec3d; +import net.wurstclient.util.RegionPos; +import net.wurstclient.util.RenderUtils; +import net.wurstclient.util.RotationUtils; + +public final class PortalEspRenderer +{ + private static VertexBuffer solidBox; + private static VertexBuffer outlinedBox; + + private final MatrixStack matrixStack; + private final RegionPos region; + private final Vec3d start; + + public PortalEspRenderer(MatrixStack matrixStack, float partialTicks) + { + this.matrixStack = matrixStack; + region = RenderUtils.getCameraRegion(); + start = RotationUtils.getClientLookVec(partialTicks) + .add(RenderUtils.getCameraPos()).subtract(region.toVec3d()); + } + + public void renderBoxes(PortalEspBlockGroup group) + { + float[] colorF = group.getColorF(); + + for(Box box : group.getBoxes()) + { + matrixStack.push(); + + matrixStack.translate(box.minX - region.x(), box.minY, + box.minZ - region.z()); + + matrixStack.scale((float)(box.maxX - box.minX), + (float)(box.maxY - box.minY), (float)(box.maxZ - box.minZ)); + + Matrix4f viewMatrix = matrixStack.peek().getPositionMatrix(); + Matrix4f projMatrix = RenderSystem.getProjectionMatrix(); + ShaderProgram shader = RenderSystem.getShader(); + + RenderSystem.setShaderColor(colorF[0], colorF[1], colorF[2], 0.25F); + solidBox.bind(); + solidBox.draw(viewMatrix, projMatrix, shader); + VertexBuffer.unbind(); + + RenderSystem.setShaderColor(colorF[0], colorF[1], colorF[2], 0.5F); + outlinedBox.bind(); + outlinedBox.draw(viewMatrix, projMatrix, shader); + VertexBuffer.unbind(); + + matrixStack.pop(); + } + } + + public void renderLines(PortalEspBlockGroup group) + { + Matrix4f matrix = matrixStack.peek().getPositionMatrix(); + Tessellator tessellator = RenderSystem.renderThreadTesselator(); + BufferBuilder bufferBuilder = tessellator.getBuffer(); + + float[] colorF = group.getColorF(); + RenderSystem.setShaderColor(colorF[0], colorF[1], colorF[2], 0.5F); + + bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, + VertexFormats.POSITION); + + for(Box box : group.getBoxes()) + { + Vec3d end = box.getCenter().subtract(region.toVec3d()); + + bufferBuilder + .vertex(matrix, (float)start.x, (float)start.y, (float)start.z) + .next(); + + bufferBuilder + .vertex(matrix, (float)end.x, (float)end.y, (float)end.z) + .next(); + } + + tessellator.draw(); + } + + public static void prepareBuffers() + { + closeBuffers(); + solidBox = new VertexBuffer(VertexBuffer.Usage.STATIC); + outlinedBox = new VertexBuffer(VertexBuffer.Usage.STATIC); + + Box box = new Box(BlockPos.ORIGIN); + RenderUtils.drawSolidBox(box, solidBox); + RenderUtils.drawOutlinedBox(box, outlinedBox); + } + + public static void closeBuffers() + { + Stream.of(solidBox, outlinedBox).filter(Objects::nonNull) + .forEach(VertexBuffer::close); + } +} diff --git a/src/main/java/net/wurstclient/hacks/treebot/Tree.java b/src/main/java/net/wurstclient/hacks/treebot/Tree.java index 98d01351..de6093f3 100644 --- a/src/main/java/net/wurstclient/hacks/treebot/Tree.java +++ b/src/main/java/net/wurstclient/hacks/treebot/Tree.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hacks/treebot/TreeBotUtils.java b/src/main/java/net/wurstclient/hacks/treebot/TreeBotUtils.java index fa1cf19f..9ef06a9e 100644 --- a/src/main/java/net/wurstclient/hacks/treebot/TreeBotUtils.java +++ b/src/main/java/net/wurstclient/hacks/treebot/TreeBotUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hud/HackListHUD.java b/src/main/java/net/wurstclient/hud/HackListHUD.java index 2386687c..1554fe4f 100644 --- a/src/main/java/net/wurstclient/hud/HackListHUD.java +++ b/src/main/java/net/wurstclient/hud/HackListHUD.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hud/IngameHUD.java b/src/main/java/net/wurstclient/hud/IngameHUD.java index 81a577cc..c7a5858b 100644 --- a/src/main/java/net/wurstclient/hud/IngameHUD.java +++ b/src/main/java/net/wurstclient/hud/IngameHUD.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hud/TabGui.java b/src/main/java/net/wurstclient/hud/TabGui.java index f5b67fce..e8398431 100644 --- a/src/main/java/net/wurstclient/hud/TabGui.java +++ b/src/main/java/net/wurstclient/hud/TabGui.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/hud/WurstLogo.java b/src/main/java/net/wurstclient/hud/WurstLogo.java index 1efea4e5..1875d939 100644 --- a/src/main/java/net/wurstclient/hud/WurstLogo.java +++ b/src/main/java/net/wurstclient/hud/WurstLogo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/keybinds/Keybind.java b/src/main/java/net/wurstclient/keybinds/Keybind.java index 215549cb..1006043b 100644 --- a/src/main/java/net/wurstclient/keybinds/Keybind.java +++ b/src/main/java/net/wurstclient/keybinds/Keybind.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/keybinds/KeybindList.java b/src/main/java/net/wurstclient/keybinds/KeybindList.java index 05e364a7..f5846fbd 100644 --- a/src/main/java/net/wurstclient/keybinds/KeybindList.java +++ b/src/main/java/net/wurstclient/keybinds/KeybindList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -117,7 +117,6 @@ public final class KeybindList { Set set = new LinkedHashSet<>(); addKB(set, "b", "fastplace;fastbreak"); - addKB(set, "b", "fastplace;fastbreak"); addKB(set, "c", "fullbright"); addKB(set, "g", "flight"); addKB(set, "semicolon", "speednuker"); diff --git a/src/main/java/net/wurstclient/keybinds/KeybindProcessor.java b/src/main/java/net/wurstclient/keybinds/KeybindProcessor.java index 9f314967..bd9bb96f 100644 --- a/src/main/java/net/wurstclient/keybinds/KeybindProcessor.java +++ b/src/main/java/net/wurstclient/keybinds/KeybindProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/keybinds/KeybindsFile.java b/src/main/java/net/wurstclient/keybinds/KeybindsFile.java index ad72c959..783c72b2 100644 --- a/src/main/java/net/wurstclient/keybinds/KeybindsFile.java +++ b/src/main/java/net/wurstclient/keybinds/KeybindsFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/keybinds/PossibleKeybind.java b/src/main/java/net/wurstclient/keybinds/PossibleKeybind.java index 103e0183..7f683aa3 100644 --- a/src/main/java/net/wurstclient/keybinds/PossibleKeybind.java +++ b/src/main/java/net/wurstclient/keybinds/PossibleKeybind.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/mixin/AbstractBlockStateMixin.java b/src/main/java/net/wurstclient/mixin/AbstractBlockStateMixin.java index e786c508..885abc2a 100644 --- a/src/main/java/net/wurstclient/mixin/AbstractBlockStateMixin.java +++ b/src/main/java/net/wurstclient/mixin/AbstractBlockStateMixin.java @@ -1,112 +1,112 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import com.google.common.collect.ImmutableMap; -import com.mojang.serialization.MapCodec; - -import net.minecraft.block.AbstractBlock.AbstractBlockState; -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.block.ShapeContext; -import net.minecraft.fluid.FluidState; -import net.minecraft.state.State; -import net.minecraft.state.property.Property; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.shape.VoxelShape; -import net.minecraft.util.shape.VoxelShapes; -import net.minecraft.world.BlockView; -import net.wurstclient.WurstClient; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.GetAmbientOcclusionLightLevelListener.GetAmbientOcclusionLightLevelEvent; -import net.wurstclient.events.IsNormalCubeListener.IsNormalCubeEvent; -import net.wurstclient.hack.HackList; -import net.wurstclient.hacks.HandNoClipHack; - -@Mixin(AbstractBlockState.class) -public abstract class AbstractBlockStateMixin extends State -{ - private AbstractBlockStateMixin(WurstClient wurst, Block object, - ImmutableMap, Comparable> immutableMap, - MapCodec mapCodec) - { - super(object, immutableMap, mapCodec); - } - - @Inject(at = @At("TAIL"), - method = "isFullCube(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)Z", - cancellable = true) - private void onIsFullCube(BlockView world, BlockPos pos, - CallbackInfoReturnable cir) - { - IsNormalCubeEvent event = new IsNormalCubeEvent(); - EventManager.fire(event); - - cir.setReturnValue(cir.getReturnValue() && !event.isCancelled()); - } - - @Inject(at = @At("TAIL"), - method = "getAmbientOcclusionLightLevel(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)F", - cancellable = true) - private void onGetAmbientOcclusionLightLevel(BlockView blockView, - BlockPos blockPos, CallbackInfoReturnable cir) - { - GetAmbientOcclusionLightLevelEvent event = - new GetAmbientOcclusionLightLevelEvent((BlockState)(Object)this, - cir.getReturnValueF()); - - EventManager.fire(event); - cir.setReturnValue(event.getLightLevel()); - } - - @Inject(at = @At("HEAD"), - method = "getOutlineShape(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/ShapeContext;)Lnet/minecraft/util/shape/VoxelShape;", - cancellable = true) - private void onGetOutlineShape(BlockView view, BlockPos pos, - ShapeContext context, CallbackInfoReturnable cir) - { - if(context == ShapeContext.absent()) - return; - - HackList hax = WurstClient.INSTANCE.getHax(); - if(hax == null) - return; - - HandNoClipHack handNoClipHack = hax.handNoClipHack; - if(!handNoClipHack.isEnabled() || handNoClipHack.isBlockInList(pos)) - return; - - cir.setReturnValue(VoxelShapes.empty()); - } - - @Inject(at = @At("HEAD"), - method = "getCollisionShape(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/ShapeContext;)Lnet/minecraft/util/shape/VoxelShape;", - cancellable = true) - private void onGetCollisionShape(BlockView world, BlockPos pos, - ShapeContext context, CallbackInfoReturnable cir) - { - if(getFluidState().isEmpty()) - return; - - HackList hax = WurstClient.INSTANCE.getHax(); - if(hax == null || !hax.jesusHack.shouldBeSolid()) - return; - - cir.setReturnValue(VoxelShapes.fullCube()); - cir.cancel(); - } - - @Shadow - public abstract FluidState getFluidState(); -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import com.google.common.collect.ImmutableMap; +import com.mojang.serialization.MapCodec; + +import net.minecraft.block.AbstractBlock.AbstractBlockState; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.ShapeContext; +import net.minecraft.fluid.FluidState; +import net.minecraft.state.State; +import net.minecraft.state.property.Property; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.util.shape.VoxelShapes; +import net.minecraft.world.BlockView; +import net.wurstclient.WurstClient; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.GetAmbientOcclusionLightLevelListener.GetAmbientOcclusionLightLevelEvent; +import net.wurstclient.events.IsNormalCubeListener.IsNormalCubeEvent; +import net.wurstclient.hack.HackList; +import net.wurstclient.hacks.HandNoClipHack; + +@Mixin(AbstractBlockState.class) +public abstract class AbstractBlockStateMixin extends State +{ + private AbstractBlockStateMixin(WurstClient wurst, Block object, + ImmutableMap, Comparable> immutableMap, + MapCodec mapCodec) + { + super(object, immutableMap, mapCodec); + } + + @Inject(at = @At("TAIL"), + method = "isFullCube(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)Z", + cancellable = true) + private void onIsFullCube(BlockView world, BlockPos pos, + CallbackInfoReturnable cir) + { + IsNormalCubeEvent event = new IsNormalCubeEvent(); + EventManager.fire(event); + + cir.setReturnValue(cir.getReturnValue() && !event.isCancelled()); + } + + @Inject(at = @At("TAIL"), + method = "getAmbientOcclusionLightLevel(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)F", + cancellable = true) + private void onGetAmbientOcclusionLightLevel(BlockView blockView, + BlockPos blockPos, CallbackInfoReturnable cir) + { + GetAmbientOcclusionLightLevelEvent event = + new GetAmbientOcclusionLightLevelEvent((BlockState)(Object)this, + cir.getReturnValueF()); + + EventManager.fire(event); + cir.setReturnValue(event.getLightLevel()); + } + + @Inject(at = @At("HEAD"), + method = "getOutlineShape(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/ShapeContext;)Lnet/minecraft/util/shape/VoxelShape;", + cancellable = true) + private void onGetOutlineShape(BlockView view, BlockPos pos, + ShapeContext context, CallbackInfoReturnable cir) + { + if(context == ShapeContext.absent()) + return; + + HackList hax = WurstClient.INSTANCE.getHax(); + if(hax == null) + return; + + HandNoClipHack handNoClipHack = hax.handNoClipHack; + if(!handNoClipHack.isEnabled() || handNoClipHack.isBlockInList(pos)) + return; + + cir.setReturnValue(VoxelShapes.empty()); + } + + @Inject(at = @At("HEAD"), + method = "getCollisionShape(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/ShapeContext;)Lnet/minecraft/util/shape/VoxelShape;", + cancellable = true) + private void onGetCollisionShape(BlockView world, BlockPos pos, + ShapeContext context, CallbackInfoReturnable cir) + { + if(getFluidState().isEmpty()) + return; + + HackList hax = WurstClient.INSTANCE.getHax(); + if(hax == null || !hax.jesusHack.shouldBeSolid()) + return; + + cir.setReturnValue(VoxelShapes.fullCube()); + cir.cancel(); + } + + @Shadow + public abstract FluidState getFluidState(); +} diff --git a/src/main/java/net/wurstclient/mixin/AbstractSignEditScreenMixin.java b/src/main/java/net/wurstclient/mixin/AbstractSignEditScreenMixin.java index 4d076237..fb45c158 100644 --- a/src/main/java/net/wurstclient/mixin/AbstractSignEditScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/AbstractSignEditScreenMixin.java @@ -1,61 +1,61 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.screen.ingame.AbstractSignEditScreen; -import net.minecraft.text.Text; -import net.wurstclient.WurstClient; -import net.wurstclient.hacks.AutoSignHack; - -@Mixin(AbstractSignEditScreen.class) -public abstract class AbstractSignEditScreenMixin extends Screen -{ - @Shadow - @Final - private String[] messages; - - private AbstractSignEditScreenMixin(WurstClient wurst, Text title) - { - super(title); - } - - @Inject(at = @At("HEAD"), method = "init()V") - private void onInit(CallbackInfo ci) - { - AutoSignHack autoSignHack = WurstClient.INSTANCE.getHax().autoSignHack; - - String[] autoSignText = autoSignHack.getSignText(); - if(autoSignText == null) - return; - - for(int i = 0; i < 4; i++) - messages[i] = autoSignText[i]; - - finishEditing(); - } - - @Inject(at = @At("HEAD"), method = "finishEditing()V") - private void onFinishEditing(CallbackInfo ci) - { - WurstClient.INSTANCE.getHax().autoSignHack.setSignText(messages); - } - - @Shadow - private void finishEditing() - { - - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.screen.ingame.AbstractSignEditScreen; +import net.minecraft.text.Text; +import net.wurstclient.WurstClient; +import net.wurstclient.hacks.AutoSignHack; + +@Mixin(AbstractSignEditScreen.class) +public abstract class AbstractSignEditScreenMixin extends Screen +{ + @Shadow + @Final + private String[] messages; + + private AbstractSignEditScreenMixin(WurstClient wurst, Text title) + { + super(title); + } + + @Inject(at = @At("HEAD"), method = "init()V") + private void onInit(CallbackInfo ci) + { + AutoSignHack autoSignHack = WurstClient.INSTANCE.getHax().autoSignHack; + + String[] autoSignText = autoSignHack.getSignText(); + if(autoSignText == null) + return; + + for(int i = 0; i < 4; i++) + messages[i] = autoSignText[i]; + + finishEditing(); + } + + @Inject(at = @At("HEAD"), method = "finishEditing()V") + private void onFinishEditing(CallbackInfo ci) + { + WurstClient.INSTANCE.getHax().autoSignHack.setSignText(messages); + } + + @Shadow + private void finishEditing() + { + + } +} diff --git a/src/main/java/net/wurstclient/mixin/AllowedAddressResolverMixin.java b/src/main/java/net/wurstclient/mixin/AllowedAddressResolverMixin.java index 1fe53f1e..a7fe7a83 100644 --- a/src/main/java/net/wurstclient/mixin/AllowedAddressResolverMixin.java +++ b/src/main/java/net/wurstclient/mixin/AllowedAddressResolverMixin.java @@ -1,60 +1,60 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import java.util.Optional; - -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import net.minecraft.client.network.Address; -import net.minecraft.client.network.AddressResolver; -import net.minecraft.client.network.AllowedAddressResolver; -import net.minecraft.client.network.RedirectResolver; -import net.minecraft.client.network.ServerAddress; -import net.wurstclient.WurstClient; - -@Mixin(AllowedAddressResolver.class) -public class AllowedAddressResolverMixin -{ - @Shadow - @Final - private AddressResolver addressResolver; - - @Shadow - @Final - private RedirectResolver redirectResolver; - - /** - * This mixin allows users to connect to servers that have been shadowbanned - * by Mojang, such as CS:GO and GTA clones that are apparently "too - * adult-oriented" for having pixelated guns. - */ - @Inject(at = @At("HEAD"), - method = "resolve(Lnet/minecraft/client/network/ServerAddress;)Ljava/util/Optional;", - cancellable = true) - public void resolve(ServerAddress address, - CallbackInfoReturnable> cir) - { - if(!WurstClient.INSTANCE.isEnabled()) - return; - - Optional
optionalAddress = addressResolver.resolve(address); - Optional optionalRedirect = - redirectResolver.lookupRedirect(address); - - if(optionalRedirect.isPresent()) - optionalAddress = addressResolver.resolve(optionalRedirect.get()); - - cir.setReturnValue(optionalAddress); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import java.util.Optional; + +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.client.network.Address; +import net.minecraft.client.network.AddressResolver; +import net.minecraft.client.network.AllowedAddressResolver; +import net.minecraft.client.network.RedirectResolver; +import net.minecraft.client.network.ServerAddress; +import net.wurstclient.WurstClient; + +@Mixin(AllowedAddressResolver.class) +public class AllowedAddressResolverMixin +{ + @Shadow + @Final + private AddressResolver addressResolver; + + @Shadow + @Final + private RedirectResolver redirectResolver; + + /** + * This mixin allows users to connect to servers that have been shadowbanned + * by Mojang, such as CS:GO and GTA clones that are apparently "too + * adult-oriented" for having pixelated guns. + */ + @Inject(at = @At("HEAD"), + method = "resolve(Lnet/minecraft/client/network/ServerAddress;)Ljava/util/Optional;", + cancellable = true) + public void resolve(ServerAddress address, + CallbackInfoReturnable> cir) + { + if(!WurstClient.INSTANCE.isEnabled()) + return; + + Optional
optionalAddress = addressResolver.resolve(address); + Optional optionalRedirect = + redirectResolver.lookupRedirect(address); + + if(optionalRedirect.isPresent()) + optionalAddress = addressResolver.resolve(optionalRedirect.get()); + + cir.setReturnValue(optionalAddress); + } +} diff --git a/src/main/java/net/wurstclient/mixin/BackgroundRendererMixin.java b/src/main/java/net/wurstclient/mixin/BackgroundRendererMixin.java index 62e03146..4fe47fe9 100644 --- a/src/main/java/net/wurstclient/mixin/BackgroundRendererMixin.java +++ b/src/main/java/net/wurstclient/mixin/BackgroundRendererMixin.java @@ -1,32 +1,61 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import net.minecraft.client.render.BackgroundRenderer; -import net.minecraft.client.render.BackgroundRenderer.StatusEffectFogModifier; -import net.minecraft.entity.Entity; -import net.wurstclient.WurstClient; - -@Mixin(BackgroundRenderer.class) -public class BackgroundRendererMixin -{ - @Inject(at = @At("HEAD"), - method = "getFogModifier(Lnet/minecraft/entity/Entity;F)Lnet/minecraft/client/render/BackgroundRenderer$StatusEffectFogModifier;", - cancellable = true) - private static void onGetFogModifier(Entity entity, float tickDelta, - CallbackInfoReturnable ci) - { - if(WurstClient.INSTANCE.getHax().antiBlindHack.isEnabled()) - ci.setReturnValue(null); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import com.mojang.blaze3d.systems.RenderSystem; + +import net.minecraft.client.render.BackgroundRenderer; +import net.minecraft.client.render.BackgroundRenderer.StatusEffectFogModifier; +import net.minecraft.client.render.Camera; +import net.minecraft.client.render.CameraSubmersionType; +import net.minecraft.entity.Entity; +import net.wurstclient.WurstClient; + +@Mixin(BackgroundRenderer.class) +public abstract class BackgroundRendererMixin +{ + /** + * Makes the distance fog 100% transparent when NoFog is enabled, + * effectively removing it. + */ + @Inject(at = @At("HEAD"), + method = "applyFog(Lnet/minecraft/client/render/Camera;Lnet/minecraft/client/render/BackgroundRenderer$FogType;FZF)V") + private static void onApplyFog(Camera camera, + BackgroundRenderer.FogType fogType, float viewDistance, + boolean thickFog, float tickDelta, CallbackInfo ci) + { + if(!WurstClient.INSTANCE.getHax().noFogHack.isEnabled()) + return; + + CameraSubmersionType cameraSubmersionType = camera.getSubmersionType(); + if(cameraSubmersionType != CameraSubmersionType.NONE) + return; + + Entity entity = camera.getFocusedEntity(); + if(BackgroundRenderer.getFogModifier(entity, tickDelta) != null) + return; + + RenderSystem.setShaderFogColor(0, 0, 0, 0); + } + + @Inject(at = @At("HEAD"), + method = "getFogModifier(Lnet/minecraft/entity/Entity;F)Lnet/minecraft/client/render/BackgroundRenderer$StatusEffectFogModifier;", + cancellable = true) + private static void onGetFogModifier(Entity entity, float tickDelta, + CallbackInfoReturnable ci) + { + if(WurstClient.INSTANCE.getHax().antiBlindHack.isEnabled()) + ci.setReturnValue(null); + } +} diff --git a/src/main/java/net/wurstclient/mixin/BasicBakedModelMixin.java b/src/main/java/net/wurstclient/mixin/BasicBakedModelMixin.java index 98c372ae..6219d4fc 100644 --- a/src/main/java/net/wurstclient/mixin/BasicBakedModelMixin.java +++ b/src/main/java/net/wurstclient/mixin/BasicBakedModelMixin.java @@ -1,48 +1,48 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import java.util.List; - -import org.jetbrains.annotations.Nullable; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import net.minecraft.block.BlockState; -import net.minecraft.client.render.model.BakedQuad; -import net.minecraft.client.render.model.BasicBakedModel; -import net.minecraft.util.math.Direction; -import net.minecraft.util.math.random.Random; -import net.wurstclient.WurstClient; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.ShouldDrawSideListener.ShouldDrawSideEvent; - -@Mixin(BasicBakedModel.class) -public class BasicBakedModelMixin -{ - /** - * This mixin hides blocks like grass and snow when using X-Ray. It works - * with and without Sodium installed. - */ - @Inject(at = @At("HEAD"), method = "getQuads", cancellable = true) - private void getQuads(@Nullable BlockState state, @Nullable Direction face, - Random random, CallbackInfoReturnable> cir) - { - if(face != null || state == null - || !WurstClient.INSTANCE.getHax().xRayHack.isEnabled()) - return; - - ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, null); - EventManager.fire(event); - - if(Boolean.FALSE.equals(event.isRendered())) - cir.setReturnValue(List.of()); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import java.util.List; + +import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.block.BlockState; +import net.minecraft.client.render.model.BakedQuad; +import net.minecraft.client.render.model.BasicBakedModel; +import net.minecraft.util.math.Direction; +import net.minecraft.util.math.random.Random; +import net.wurstclient.WurstClient; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.ShouldDrawSideListener.ShouldDrawSideEvent; + +@Mixin(BasicBakedModel.class) +public class BasicBakedModelMixin +{ + /** + * This mixin hides blocks like grass and snow when using X-Ray. It works + * with and without Sodium installed. + */ + @Inject(at = @At("HEAD"), method = "getQuads", cancellable = true) + private void getQuads(@Nullable BlockState state, @Nullable Direction face, + Random random, CallbackInfoReturnable> cir) + { + if(face != null || state == null + || !WurstClient.INSTANCE.getHax().xRayHack.isEnabled()) + return; + + ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, null); + EventManager.fire(event); + + if(Boolean.FALSE.equals(event.isRendered())) + cir.setReturnValue(List.of()); + } +} diff --git a/src/main/java/net/wurstclient/mixin/BlockEntityRenderDispatcherMixin.java b/src/main/java/net/wurstclient/mixin/BlockEntityRenderDispatcherMixin.java index b2df3a40..7112ad87 100644 --- a/src/main/java/net/wurstclient/mixin/BlockEntityRenderDispatcherMixin.java +++ b/src/main/java/net/wurstclient/mixin/BlockEntityRenderDispatcherMixin.java @@ -1,38 +1,38 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import net.minecraft.block.entity.BlockEntity; -import net.minecraft.client.render.VertexConsumerProvider; -import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher; -import net.minecraft.client.util.math.MatrixStack; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.RenderBlockEntityListener.RenderBlockEntityEvent; - -@Mixin(BlockEntityRenderDispatcher.class) -public class BlockEntityRenderDispatcherMixin -{ - @Inject(at = @At("HEAD"), - method = "render(Lnet/minecraft/block/entity/BlockEntity;FLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;)V", - cancellable = true) - private void onRender(E blockEntity, - float tickDelta, MatrixStack matrices, - VertexConsumerProvider vertexConsumers, CallbackInfo ci) - { - RenderBlockEntityEvent event = new RenderBlockEntityEvent(blockEntity); - EventManager.fire(event); - - if(event.isCancelled()) - ci.cancel(); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.client.render.VertexConsumerProvider; +import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher; +import net.minecraft.client.util.math.MatrixStack; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.RenderBlockEntityListener.RenderBlockEntityEvent; + +@Mixin(BlockEntityRenderDispatcher.class) +public class BlockEntityRenderDispatcherMixin +{ + @Inject(at = @At("HEAD"), + method = "render(Lnet/minecraft/block/entity/BlockEntity;FLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;)V", + cancellable = true) + private void onRender(E blockEntity, + float tickDelta, MatrixStack matrices, + VertexConsumerProvider vertexConsumers, CallbackInfo ci) + { + RenderBlockEntityEvent event = new RenderBlockEntityEvent(blockEntity); + EventManager.fire(event); + + if(event.isCancelled()) + ci.cancel(); + } +} diff --git a/src/main/java/net/wurstclient/mixin/BlockMixin.java b/src/main/java/net/wurstclient/mixin/BlockMixin.java index c5936a18..b15e6061 100644 --- a/src/main/java/net/wurstclient/mixin/BlockMixin.java +++ b/src/main/java/net/wurstclient/mixin/BlockMixin.java @@ -1,59 +1,59 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.item.ItemConvertible; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.world.BlockView; -import net.wurstclient.WurstClient; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.ShouldDrawSideListener.ShouldDrawSideEvent; -import net.wurstclient.hack.HackList; - -@Mixin(Block.class) -public abstract class BlockMixin implements ItemConvertible -{ - /** - * This mixin allows X-Ray to show ores that would normally be obstructed by - * other blocks. - */ - @Inject(at = @At("HEAD"), - method = "shouldDrawSide(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;Lnet/minecraft/util/math/BlockPos;)Z", - cancellable = true) - private static void onShouldDrawSide(BlockState state, BlockView world, - BlockPos pos, Direction direction, BlockPos blockPos, - CallbackInfoReturnable cir) - { - ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, pos); - EventManager.fire(event); - - if(event.isRendered() != null) - cir.setReturnValue(event.isRendered()); - } - - @Inject(at = @At("HEAD"), - method = "getVelocityMultiplier()F", - cancellable = true) - private void onGetVelocityMultiplier(CallbackInfoReturnable cir) - { - HackList hax = WurstClient.INSTANCE.getHax(); - if(hax == null || !hax.noSlowdownHack.isEnabled()) - return; - - if(cir.getReturnValueF() < 1) - cir.setReturnValue(1F); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.item.ItemConvertible; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.BlockView; +import net.wurstclient.WurstClient; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.ShouldDrawSideListener.ShouldDrawSideEvent; +import net.wurstclient.hack.HackList; + +@Mixin(Block.class) +public abstract class BlockMixin implements ItemConvertible +{ + /** + * This mixin allows X-Ray to show ores that would normally be obstructed by + * other blocks. + */ + @Inject(at = @At("HEAD"), + method = "shouldDrawSide(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;Lnet/minecraft/util/math/BlockPos;)Z", + cancellable = true) + private static void onShouldDrawSide(BlockState state, BlockView world, + BlockPos pos, Direction direction, BlockPos blockPos, + CallbackInfoReturnable cir) + { + ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, pos); + EventManager.fire(event); + + if(event.isRendered() != null) + cir.setReturnValue(event.isRendered()); + } + + @Inject(at = @At("HEAD"), + method = "getVelocityMultiplier()F", + cancellable = true) + private void onGetVelocityMultiplier(CallbackInfoReturnable cir) + { + HackList hax = WurstClient.INSTANCE.getHax(); + if(hax == null || !hax.noSlowdownHack.isEnabled()) + return; + + if(cir.getReturnValueF() < 1) + cir.setReturnValue(1F); + } +} diff --git a/src/main/java/net/wurstclient/mixin/CactusBlockMixin.java b/src/main/java/net/wurstclient/mixin/CactusBlockMixin.java index f161d3f6..3d4ab2d6 100644 --- a/src/main/java/net/wurstclient/mixin/CactusBlockMixin.java +++ b/src/main/java/net/wurstclient/mixin/CactusBlockMixin.java @@ -1,48 +1,48 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.block.CactusBlock; -import net.minecraft.block.ShapeContext; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.shape.VoxelShape; -import net.minecraft.world.BlockView; -import net.wurstclient.WurstClient; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.CactusCollisionShapeListener.CactusCollisionShapeEvent; - -@Mixin(CactusBlock.class) -public abstract class CactusBlockMixin extends Block -{ - private CactusBlockMixin(WurstClient wurst, Settings settings) - { - super(settings); - } - - @Inject(at = @At("HEAD"), - method = "getCollisionShape(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/ShapeContext;)Lnet/minecraft/util/shape/VoxelShape;", - cancellable = true) - private void onGetCollisionShape(BlockState state, BlockView world, - BlockPos pos, ShapeContext context, - CallbackInfoReturnable cir) - { - CactusCollisionShapeEvent event = new CactusCollisionShapeEvent(); - EventManager.fire(event); - - VoxelShape collisionShape = event.getCollisionShape(); - if(collisionShape != null) - cir.setReturnValue(collisionShape); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.CactusBlock; +import net.minecraft.block.ShapeContext; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.world.BlockView; +import net.wurstclient.WurstClient; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.CactusCollisionShapeListener.CactusCollisionShapeEvent; + +@Mixin(CactusBlock.class) +public abstract class CactusBlockMixin extends Block +{ + private CactusBlockMixin(WurstClient wurst, Settings settings) + { + super(settings); + } + + @Inject(at = @At("HEAD"), + method = "getCollisionShape(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/ShapeContext;)Lnet/minecraft/util/shape/VoxelShape;", + cancellable = true) + private void onGetCollisionShape(BlockState state, BlockView world, + BlockPos pos, ShapeContext context, + CallbackInfoReturnable cir) + { + CactusCollisionShapeEvent event = new CactusCollisionShapeEvent(); + EventManager.fire(event); + + VoxelShape collisionShape = event.getCollisionShape(); + if(collisionShape != null) + cir.setReturnValue(collisionShape); + } +} diff --git a/src/main/java/net/wurstclient/mixin/CameraMixin.java b/src/main/java/net/wurstclient/mixin/CameraMixin.java index b6e6d43f..d28d7515 100644 --- a/src/main/java/net/wurstclient/mixin/CameraMixin.java +++ b/src/main/java/net/wurstclient/mixin/CameraMixin.java @@ -1,54 +1,54 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.ModifyVariable; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import net.minecraft.client.render.Camera; -import net.minecraft.client.render.CameraSubmersionType; -import net.wurstclient.WurstClient; -import net.wurstclient.hacks.CameraDistanceHack; - -@Mixin(Camera.class) -public abstract class CameraMixin -{ - @ModifyVariable(at = @At("HEAD"), - method = "clipToSpace(D)D", - argsOnly = true) - private double changeClipToSpaceDistance(double desiredCameraDistance) - { - CameraDistanceHack cameraDistance = - WurstClient.INSTANCE.getHax().cameraDistanceHack; - if(cameraDistance.isEnabled()) - return cameraDistance.getDistance(); - - return desiredCameraDistance; - } - - @Inject(at = @At("HEAD"), method = "clipToSpace(D)D", cancellable = true) - private void onClipToSpace(double desiredCameraDistance, - CallbackInfoReturnable cir) - { - if(WurstClient.INSTANCE.getHax().cameraNoClipHack.isEnabled()) - cir.setReturnValue(desiredCameraDistance); - } - - @Inject(at = @At("HEAD"), - method = "getSubmersionType()Lnet/minecraft/client/render/CameraSubmersionType;", - cancellable = true) - private void onGetSubmersionType( - CallbackInfoReturnable cir) - { - if(WurstClient.INSTANCE.getHax().noOverlayHack.isEnabled()) - cir.setReturnValue(CameraSubmersionType.NONE); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.ModifyVariable; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.client.render.Camera; +import net.minecraft.client.render.CameraSubmersionType; +import net.wurstclient.WurstClient; +import net.wurstclient.hacks.CameraDistanceHack; + +@Mixin(Camera.class) +public abstract class CameraMixin +{ + @ModifyVariable(at = @At("HEAD"), + method = "clipToSpace(D)D", + argsOnly = true) + private double changeClipToSpaceDistance(double desiredCameraDistance) + { + CameraDistanceHack cameraDistance = + WurstClient.INSTANCE.getHax().cameraDistanceHack; + if(cameraDistance.isEnabled()) + return cameraDistance.getDistance(); + + return desiredCameraDistance; + } + + @Inject(at = @At("HEAD"), method = "clipToSpace(D)D", cancellable = true) + private void onClipToSpace(double desiredCameraDistance, + CallbackInfoReturnable cir) + { + if(WurstClient.INSTANCE.getHax().cameraNoClipHack.isEnabled()) + cir.setReturnValue(desiredCameraDistance); + } + + @Inject(at = @At("HEAD"), + method = "getSubmersionType()Lnet/minecraft/client/render/CameraSubmersionType;", + cancellable = true) + private void onGetSubmersionType( + CallbackInfoReturnable cir) + { + if(WurstClient.INSTANCE.getHax().noOverlayHack.isEnabled()) + cir.setReturnValue(CameraSubmersionType.NONE); + } +} diff --git a/src/main/java/net/wurstclient/mixin/ChatHudMixin.java b/src/main/java/net/wurstclient/mixin/ChatHudMixin.java index 95f63708..65793b3d 100644 --- a/src/main/java/net/wurstclient/mixin/ChatHudMixin.java +++ b/src/main/java/net/wurstclient/mixin/ChatHudMixin.java @@ -1,81 +1,81 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import java.util.List; - -import org.jetbrains.annotations.Nullable; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.gui.hud.ChatHud; -import net.minecraft.client.gui.hud.ChatHudLine; -import net.minecraft.client.gui.hud.MessageIndicator; -import net.minecraft.network.message.MessageSignatureData; -import net.minecraft.text.Text; -import net.wurstclient.WurstClient; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.ChatInputListener.ChatInputEvent; - -@Mixin(ChatHud.class) -public class ChatHudMixin -{ - @Shadow - @Final - private List visibleMessages; - @Shadow - @Final - private MinecraftClient client; - - @Inject(at = @At("HEAD"), - method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignatureData;Lnet/minecraft/client/gui/hud/MessageIndicator;)V", - cancellable = true) - private void onAddMessage(Text message, - @Nullable MessageSignatureData signature, - @Nullable MessageIndicator indicator, CallbackInfo ci) - { - ChatInputEvent event = new ChatInputEvent(message, visibleMessages); - - EventManager.fire(event); - if(event.isCancelled()) - { - ci.cancel(); - return; - } - - message = event.getComponent(); - indicator = WurstClient.INSTANCE.getOtfs().noChatReportsOtf - .modifyIndicator(message, signature, indicator); - - shadow$logChatMessage(message, indicator); - shadow$addMessage(message, signature, client.inGameHud.getTicks(), - indicator, false); - - ci.cancel(); - } - - @Shadow - private void shadow$logChatMessage(Text message, - @Nullable MessageIndicator indicator) - { - - } - - @Shadow - private void shadow$addMessage(Text message, - @Nullable MessageSignatureData signature, int ticks, - @Nullable MessageIndicator indicator, boolean refresh) - { - - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import java.util.List; + +import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.hud.ChatHud; +import net.minecraft.client.gui.hud.ChatHudLine; +import net.minecraft.client.gui.hud.MessageIndicator; +import net.minecraft.network.message.MessageSignatureData; +import net.minecraft.text.Text; +import net.wurstclient.WurstClient; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.ChatInputListener.ChatInputEvent; + +@Mixin(ChatHud.class) +public class ChatHudMixin +{ + @Shadow + @Final + private List visibleMessages; + @Shadow + @Final + private MinecraftClient client; + + @Inject(at = @At("HEAD"), + method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignatureData;Lnet/minecraft/client/gui/hud/MessageIndicator;)V", + cancellable = true) + private void onAddMessage(Text message, + @Nullable MessageSignatureData signature, + @Nullable MessageIndicator indicator, CallbackInfo ci) + { + ChatInputEvent event = new ChatInputEvent(message, visibleMessages); + + EventManager.fire(event); + if(event.isCancelled()) + { + ci.cancel(); + return; + } + + message = event.getComponent(); + indicator = WurstClient.INSTANCE.getOtfs().noChatReportsOtf + .modifyIndicator(message, signature, indicator); + + shadow$logChatMessage(message, indicator); + shadow$addMessage(message, signature, client.inGameHud.getTicks(), + indicator, false); + + ci.cancel(); + } + + @Shadow + private void shadow$logChatMessage(Text message, + @Nullable MessageIndicator indicator) + { + + } + + @Shadow + private void shadow$addMessage(Text message, + @Nullable MessageSignatureData signature, int ticks, + @Nullable MessageIndicator indicator, boolean refresh) + { + + } +} diff --git a/src/main/java/net/wurstclient/mixin/ChatInputSuggestorMixin.java b/src/main/java/net/wurstclient/mixin/ChatInputSuggestorMixin.java index 5192afe7..aba2971a 100644 --- a/src/main/java/net/wurstclient/mixin/ChatInputSuggestorMixin.java +++ b/src/main/java/net/wurstclient/mixin/ChatInputSuggestorMixin.java @@ -1,54 +1,54 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import java.util.concurrent.CompletableFuture; - -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import com.mojang.brigadier.suggestion.Suggestions; - -import net.minecraft.client.gui.screen.ChatInputSuggestor; -import net.minecraft.client.gui.widget.TextFieldWidget; -import net.wurstclient.WurstClient; -import net.wurstclient.hacks.AutoCompleteHack; - -@Mixin(ChatInputSuggestor.class) -public abstract class ChatInputSuggestorMixin -{ - @Shadow - @Final - private TextFieldWidget textField; - @Shadow - private CompletableFuture pendingSuggestions; - - @Inject(at = @At("TAIL"), method = "refresh()V") - private void onRefresh(CallbackInfo ci) - { - AutoCompleteHack autoComplete = - WurstClient.INSTANCE.getHax().autoCompleteHack; - if(!autoComplete.isEnabled()) - return; - - String draftMessage = - textField.getText().substring(0, textField.getCursor()); - autoComplete.onRefresh(draftMessage, (builder, suggestion) -> { - textField.setSuggestion(suggestion); - pendingSuggestions = builder.buildFuture(); - show(false); - }); - } - - @Shadow - public abstract void show(boolean narrateFirstSuggestion); -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import java.util.concurrent.CompletableFuture; + +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import com.mojang.brigadier.suggestion.Suggestions; + +import net.minecraft.client.gui.screen.ChatInputSuggestor; +import net.minecraft.client.gui.widget.TextFieldWidget; +import net.wurstclient.WurstClient; +import net.wurstclient.hacks.AutoCompleteHack; + +@Mixin(ChatInputSuggestor.class) +public abstract class ChatInputSuggestorMixin +{ + @Shadow + @Final + private TextFieldWidget textField; + @Shadow + private CompletableFuture pendingSuggestions; + + @Inject(at = @At("TAIL"), method = "refresh()V") + private void onRefresh(CallbackInfo ci) + { + AutoCompleteHack autoComplete = + WurstClient.INSTANCE.getHax().autoCompleteHack; + if(!autoComplete.isEnabled()) + return; + + String draftMessage = + textField.getText().substring(0, textField.getCursor()); + autoComplete.onRefresh(draftMessage, (builder, suggestion) -> { + textField.setSuggestion(suggestion); + pendingSuggestions = builder.buildFuture(); + show(false); + }); + } + + @Shadow + public abstract void show(boolean narrateFirstSuggestion); +} diff --git a/src/main/java/net/wurstclient/mixin/ChatScreenMixin.java b/src/main/java/net/wurstclient/mixin/ChatScreenMixin.java index e813cf41..e79095d4 100644 --- a/src/main/java/net/wurstclient/mixin/ChatScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/ChatScreenMixin.java @@ -1,79 +1,79 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import net.minecraft.client.gui.screen.ChatScreen; -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.widget.TextFieldWidget; -import net.minecraft.text.Text; -import net.wurstclient.WurstClient; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.ChatOutputListener.ChatOutputEvent; - -@Mixin(ChatScreen.class) -public abstract class ChatScreenMixin extends Screen -{ - @Shadow - protected TextFieldWidget chatField; - - private ChatScreenMixin(WurstClient wurst, Text title) - { - super(title); - } - - @Inject(at = @At("TAIL"), method = "init()V") - protected void onInit(CallbackInfo ci) - { - if(WurstClient.INSTANCE.getHax().infiniChatHack.isEnabled()) - chatField.setMaxLength(Integer.MAX_VALUE); - } - - @Inject(at = @At("HEAD"), - method = "sendMessage(Ljava/lang/String;Z)Z", - cancellable = true) - public void onSendMessage(String message, boolean addToHistory, - CallbackInfoReturnable cir) - { - if((message = normalize(message)).isEmpty()) - return; - - ChatOutputEvent event = new ChatOutputEvent(message); - EventManager.fire(event); - - if(event.isCancelled()) - { - cir.setReturnValue(true); - return; - } - - if(!event.isModified()) - return; - - String newMessage = event.getMessage(); - if(addToHistory) - client.inGameHud.getChatHud().addToMessageHistory(newMessage); - - if(newMessage.startsWith("/")) - client.player.networkHandler - .sendChatCommand(newMessage.substring(1)); - else - client.player.networkHandler.sendChatMessage(newMessage); - - cir.setReturnValue(true); - } - - @Shadow - public abstract String normalize(String chatText); -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.client.gui.screen.ChatScreen; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.widget.TextFieldWidget; +import net.minecraft.text.Text; +import net.wurstclient.WurstClient; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.ChatOutputListener.ChatOutputEvent; + +@Mixin(ChatScreen.class) +public abstract class ChatScreenMixin extends Screen +{ + @Shadow + protected TextFieldWidget chatField; + + private ChatScreenMixin(WurstClient wurst, Text title) + { + super(title); + } + + @Inject(at = @At("TAIL"), method = "init()V") + protected void onInit(CallbackInfo ci) + { + if(WurstClient.INSTANCE.getHax().infiniChatHack.isEnabled()) + chatField.setMaxLength(Integer.MAX_VALUE); + } + + @Inject(at = @At("HEAD"), + method = "sendMessage(Ljava/lang/String;Z)Z", + cancellable = true) + public void onSendMessage(String message, boolean addToHistory, + CallbackInfoReturnable cir) + { + if((message = normalize(message)).isEmpty()) + return; + + ChatOutputEvent event = new ChatOutputEvent(message); + EventManager.fire(event); + + if(event.isCancelled()) + { + cir.setReturnValue(true); + return; + } + + if(!event.isModified()) + return; + + String newMessage = event.getMessage(); + if(addToHistory) + client.inGameHud.getChatHud().addToMessageHistory(newMessage); + + if(newMessage.startsWith("/")) + client.player.networkHandler + .sendChatCommand(newMessage.substring(1)); + else + client.player.networkHandler.sendChatMessage(newMessage); + + cir.setReturnValue(true); + } + + @Shadow + public abstract String normalize(String chatText); +} diff --git a/src/main/java/net/wurstclient/mixin/ChunkOcclusionGraphBuilderMixin.java b/src/main/java/net/wurstclient/mixin/ChunkOcclusionGraphBuilderMixin.java index 2a8ae36c..93fe9086 100644 --- a/src/main/java/net/wurstclient/mixin/ChunkOcclusionGraphBuilderMixin.java +++ b/src/main/java/net/wurstclient/mixin/ChunkOcclusionGraphBuilderMixin.java @@ -1,34 +1,34 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import net.minecraft.client.render.chunk.ChunkOcclusionDataBuilder; -import net.minecraft.util.math.BlockPos; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.SetOpaqueCubeListener.SetOpaqueCubeEvent; - -@Mixin(ChunkOcclusionDataBuilder.class) -public class ChunkOcclusionGraphBuilderMixin -{ - @Inject(at = @At("HEAD"), - method = "markClosed(Lnet/minecraft/util/math/BlockPos;)V", - cancellable = true) - private void onMarkClosed(BlockPos pos, CallbackInfo ci) - { - SetOpaqueCubeEvent event = new SetOpaqueCubeEvent(); - EventManager.fire(event); - - if(event.isCancelled()) - ci.cancel(); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.minecraft.client.render.chunk.ChunkOcclusionDataBuilder; +import net.minecraft.util.math.BlockPos; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.SetOpaqueCubeListener.SetOpaqueCubeEvent; + +@Mixin(ChunkOcclusionDataBuilder.class) +public class ChunkOcclusionGraphBuilderMixin +{ + @Inject(at = @At("HEAD"), + method = "markClosed(Lnet/minecraft/util/math/BlockPos;)V", + cancellable = true) + private void onMarkClosed(BlockPos pos, CallbackInfo ci) + { + SetOpaqueCubeEvent event = new SetOpaqueCubeEvent(); + EventManager.fire(event); + + if(event.isCancelled()) + ci.cancel(); + } +} diff --git a/src/main/java/net/wurstclient/mixin/ClientConnectionMixin.java b/src/main/java/net/wurstclient/mixin/ClientConnectionMixin.java index c79f59bd..0110eebd 100644 --- a/src/main/java/net/wurstclient/mixin/ClientConnectionMixin.java +++ b/src/main/java/net/wurstclient/mixin/ClientConnectionMixin.java @@ -1,85 +1,85 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import java.util.concurrent.ConcurrentLinkedQueue; - -import org.jetbrains.annotations.Nullable; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.ModifyVariable; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.SimpleChannelInboundHandler; -import net.minecraft.network.ClientConnection; -import net.minecraft.network.PacketCallbacks; -import net.minecraft.network.packet.Packet; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.ConnectionPacketOutputListener.ConnectionPacketOutputEvent; -import net.wurstclient.events.PacketInputListener.PacketInputEvent; - -@Mixin(ClientConnection.class) -public abstract class ClientConnectionMixin - extends SimpleChannelInboundHandler> -{ - private ConcurrentLinkedQueue events = - new ConcurrentLinkedQueue<>(); - - @Inject(at = @At(value = "INVOKE", - target = "Lnet/minecraft/network/ClientConnection;handlePacket(Lnet/minecraft/network/packet/Packet;Lnet/minecraft/network/listener/PacketListener;)V", - ordinal = 0), - method = "channelRead0(Lio/netty/channel/ChannelHandlerContext;Lnet/minecraft/network/packet/Packet;)V", - cancellable = true) - private void onChannelRead0(ChannelHandlerContext context, Packet packet, - CallbackInfo ci) - { - PacketInputEvent event = new PacketInputEvent(packet); - EventManager.fire(event); - - if(event.isCancelled()) - ci.cancel(); - } - - @ModifyVariable(at = @At("HEAD"), - method = "send(Lnet/minecraft/network/packet/Packet;Lnet/minecraft/network/PacketCallbacks;)V") - public Packet modifyPacket(Packet packet) - { - ConnectionPacketOutputEvent event = - new ConnectionPacketOutputEvent(packet); - events.add(event); - EventManager.fire(event); - return event.getPacket(); - } - - @Inject(at = @At("HEAD"), - method = "send(Lnet/minecraft/network/packet/Packet;Lnet/minecraft/network/PacketCallbacks;)V", - cancellable = true) - private void onSend(Packet packet, @Nullable PacketCallbacks callback, - CallbackInfo ci) - { - ConnectionPacketOutputEvent event = getEvent(packet); - if(event == null) - return; - - if(event.isCancelled()) - ci.cancel(); - - events.remove(event); - } - - private ConnectionPacketOutputEvent getEvent(Packet packet) - { - for(ConnectionPacketOutputEvent event : events) - if(event.getPacket() == packet) - return event; - - return null; - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import java.util.concurrent.ConcurrentLinkedQueue; + +import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.ModifyVariable; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.SimpleChannelInboundHandler; +import net.minecraft.network.ClientConnection; +import net.minecraft.network.PacketCallbacks; +import net.minecraft.network.packet.Packet; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.ConnectionPacketOutputListener.ConnectionPacketOutputEvent; +import net.wurstclient.events.PacketInputListener.PacketInputEvent; + +@Mixin(ClientConnection.class) +public abstract class ClientConnectionMixin + extends SimpleChannelInboundHandler> +{ + private ConcurrentLinkedQueue events = + new ConcurrentLinkedQueue<>(); + + @Inject(at = @At(value = "INVOKE", + target = "Lnet/minecraft/network/ClientConnection;handlePacket(Lnet/minecraft/network/packet/Packet;Lnet/minecraft/network/listener/PacketListener;)V", + ordinal = 0), + method = "channelRead0(Lio/netty/channel/ChannelHandlerContext;Lnet/minecraft/network/packet/Packet;)V", + cancellable = true) + private void onChannelRead0(ChannelHandlerContext context, Packet packet, + CallbackInfo ci) + { + PacketInputEvent event = new PacketInputEvent(packet); + EventManager.fire(event); + + if(event.isCancelled()) + ci.cancel(); + } + + @ModifyVariable(at = @At("HEAD"), + method = "send(Lnet/minecraft/network/packet/Packet;Lnet/minecraft/network/PacketCallbacks;)V") + public Packet modifyPacket(Packet packet) + { + ConnectionPacketOutputEvent event = + new ConnectionPacketOutputEvent(packet); + events.add(event); + EventManager.fire(event); + return event.getPacket(); + } + + @Inject(at = @At("HEAD"), + method = "send(Lnet/minecraft/network/packet/Packet;Lnet/minecraft/network/PacketCallbacks;)V", + cancellable = true) + private void onSend(Packet packet, @Nullable PacketCallbacks callback, + CallbackInfo ci) + { + ConnectionPacketOutputEvent event = getEvent(packet); + if(event == null) + return; + + if(event.isCancelled()) + ci.cancel(); + + events.remove(event); + } + + private ConnectionPacketOutputEvent getEvent(Packet packet) + { + for(ConnectionPacketOutputEvent event : events) + if(event.getPacket() == packet) + return event; + + return null; + } +} diff --git a/src/main/java/net/wurstclient/mixin/ClientPlayNetworkHandlerMixin.java b/src/main/java/net/wurstclient/mixin/ClientPlayNetworkHandlerMixin.java index 9d246a74..bdab07de 100644 --- a/src/main/java/net/wurstclient/mixin/ClientPlayNetworkHandlerMixin.java +++ b/src/main/java/net/wurstclient/mixin/ClientPlayNetworkHandlerMixin.java @@ -1,104 +1,104 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.network.ClientPlayNetworkHandler; -import net.minecraft.client.toast.SystemToast; -import net.minecraft.network.listener.ClientPlayPacketListener; -import net.minecraft.network.packet.Packet; -import net.minecraft.network.packet.s2c.play.BlockUpdateS2CPacket; -import net.minecraft.network.packet.s2c.play.ChunkData; -import net.minecraft.network.packet.s2c.play.ChunkDeltaUpdateS2CPacket; -import net.minecraft.network.packet.s2c.play.ServerMetadataS2CPacket; -import net.minecraft.text.MutableText; -import net.minecraft.text.Text; -import net.wurstclient.WurstClient; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.PacketOutputListener.PacketOutputEvent; -import net.wurstclient.util.ChatUtils; - -@Mixin(ClientPlayNetworkHandler.class) -public abstract class ClientPlayNetworkHandlerMixin - implements ClientPlayPacketListener -{ - @Shadow - @Final - private MinecraftClient client; - - @Inject(at = @At("HEAD"), - method = "sendPacket(Lnet/minecraft/network/packet/Packet;)V", - cancellable = true) - private void onSendPacket(Packet packet, CallbackInfo ci) - { - PacketOutputEvent event = new PacketOutputEvent(packet); - EventManager.fire(event); - - if(event.isCancelled()) - ci.cancel(); - } - - @Inject(at = @At("TAIL"), - method = "onServerMetadata(Lnet/minecraft/network/packet/s2c/play/ServerMetadataS2CPacket;)V") - public void onOnServerMetadata(ServerMetadataS2CPacket packet, - CallbackInfo ci) - { - if(!WurstClient.INSTANCE.isEnabled()) - return; - - // Remove Mojang's dishonest warning toast on safe servers - if(!packet.isSecureChatEnforced()) - { - client.getToastManager().toastQueue.removeIf(toast -> toast - .getType() == SystemToast.Type.UNSECURE_SERVER_WARNING); - return; - } - - // Add an honest warning toast on unsafe servers - MutableText title = Text.literal(ChatUtils.WURST_PREFIX).append( - Text.translatable("toast.wurst.nochatreports.unsafe_server.title")); - MutableText message = Text - .translatable("toast.wurst.nochatreports.unsafe_server.message"); - - SystemToast systemToast = SystemToast.create(client, - SystemToast.Type.UNSECURE_SERVER_WARNING, title, message); - client.getToastManager().add(systemToast); - } - - @Inject(at = @At("TAIL"), - method = "loadChunk(IILnet/minecraft/network/packet/s2c/play/ChunkData;)V") - private void onLoadChunk(int x, int z, ChunkData chunkData, CallbackInfo ci) - { - WurstClient.INSTANCE.getHax().newChunksHack.afterLoadChunk(x, z); - } - - @Inject(at = @At("TAIL"), - method = "onBlockUpdate(Lnet/minecraft/network/packet/s2c/play/BlockUpdateS2CPacket;)V") - private void onOnBlockUpdate(BlockUpdateS2CPacket packet, CallbackInfo ci) - { - WurstClient.INSTANCE.getHax().newChunksHack - .afterUpdateBlock(packet.getPos()); - } - - @Inject(at = @At("TAIL"), - method = "onChunkDeltaUpdate(Lnet/minecraft/network/packet/s2c/play/ChunkDeltaUpdateS2CPacket;)V") - private void onOnChunkDeltaUpdate(ChunkDeltaUpdateS2CPacket packet, - CallbackInfo ci) - { - packet.visitUpdates( - (pos, state) -> WurstClient.INSTANCE.getHax().newChunksHack - .afterUpdateBlock(pos)); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.network.ClientPlayNetworkHandler; +import net.minecraft.client.toast.SystemToast; +import net.minecraft.network.listener.ClientPlayPacketListener; +import net.minecraft.network.packet.Packet; +import net.minecraft.network.packet.s2c.play.BlockUpdateS2CPacket; +import net.minecraft.network.packet.s2c.play.ChunkData; +import net.minecraft.network.packet.s2c.play.ChunkDeltaUpdateS2CPacket; +import net.minecraft.network.packet.s2c.play.ServerMetadataS2CPacket; +import net.minecraft.text.MutableText; +import net.minecraft.text.Text; +import net.wurstclient.WurstClient; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.PacketOutputListener.PacketOutputEvent; +import net.wurstclient.util.ChatUtils; + +@Mixin(ClientPlayNetworkHandler.class) +public abstract class ClientPlayNetworkHandlerMixin + implements ClientPlayPacketListener +{ + @Shadow + @Final + private MinecraftClient client; + + @Inject(at = @At("HEAD"), + method = "sendPacket(Lnet/minecraft/network/packet/Packet;)V", + cancellable = true) + private void onSendPacket(Packet packet, CallbackInfo ci) + { + PacketOutputEvent event = new PacketOutputEvent(packet); + EventManager.fire(event); + + if(event.isCancelled()) + ci.cancel(); + } + + @Inject(at = @At("TAIL"), + method = "onServerMetadata(Lnet/minecraft/network/packet/s2c/play/ServerMetadataS2CPacket;)V") + public void onOnServerMetadata(ServerMetadataS2CPacket packet, + CallbackInfo ci) + { + if(!WurstClient.INSTANCE.isEnabled()) + return; + + // Remove Mojang's dishonest warning toast on safe servers + if(!packet.isSecureChatEnforced()) + { + client.getToastManager().toastQueue.removeIf(toast -> toast + .getType() == SystemToast.Type.UNSECURE_SERVER_WARNING); + return; + } + + // Add an honest warning toast on unsafe servers + MutableText title = Text.literal(ChatUtils.WURST_PREFIX).append( + Text.translatable("toast.wurst.nochatreports.unsafe_server.title")); + MutableText message = Text + .translatable("toast.wurst.nochatreports.unsafe_server.message"); + + SystemToast systemToast = SystemToast.create(client, + SystemToast.Type.UNSECURE_SERVER_WARNING, title, message); + client.getToastManager().add(systemToast); + } + + @Inject(at = @At("TAIL"), + method = "loadChunk(IILnet/minecraft/network/packet/s2c/play/ChunkData;)V") + private void onLoadChunk(int x, int z, ChunkData chunkData, CallbackInfo ci) + { + WurstClient.INSTANCE.getHax().newChunksHack.afterLoadChunk(x, z); + } + + @Inject(at = @At("TAIL"), + method = "onBlockUpdate(Lnet/minecraft/network/packet/s2c/play/BlockUpdateS2CPacket;)V") + private void onOnBlockUpdate(BlockUpdateS2CPacket packet, CallbackInfo ci) + { + WurstClient.INSTANCE.getHax().newChunksHack + .afterUpdateBlock(packet.getPos()); + } + + @Inject(at = @At("TAIL"), + method = "onChunkDeltaUpdate(Lnet/minecraft/network/packet/s2c/play/ChunkDeltaUpdateS2CPacket;)V") + private void onOnChunkDeltaUpdate(ChunkDeltaUpdateS2CPacket packet, + CallbackInfo ci) + { + packet.visitUpdates( + (pos, state) -> WurstClient.INSTANCE.getHax().newChunksHack + .afterUpdateBlock(pos)); + } +} diff --git a/src/main/java/net/wurstclient/mixin/ClientPlayerEntityMixin.java b/src/main/java/net/wurstclient/mixin/ClientPlayerEntityMixin.java index b58b0de5..1ea24898 100644 --- a/src/main/java/net/wurstclient/mixin/ClientPlayerEntityMixin.java +++ b/src/main/java/net/wurstclient/mixin/ClientPlayerEntityMixin.java @@ -1,289 +1,309 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.objectweb.asm.Opcodes; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import com.mojang.authlib.GameProfile; - -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.network.AbstractClientPlayerEntity; -import net.minecraft.client.network.ClientPlayerEntity; -import net.minecraft.client.world.ClientWorld; -import net.minecraft.entity.MovementType; -import net.minecraft.entity.effect.StatusEffect; -import net.minecraft.entity.effect.StatusEffects; -import net.minecraft.util.math.Vec3d; -import net.wurstclient.WurstClient; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.AirStrafingSpeedListener.AirStrafingSpeedEvent; -import net.wurstclient.events.IsPlayerInLavaListener.IsPlayerInLavaEvent; -import net.wurstclient.events.IsPlayerInWaterListener.IsPlayerInWaterEvent; -import net.wurstclient.events.KnockbackListener.KnockbackEvent; -import net.wurstclient.events.PlayerMoveListener.PlayerMoveEvent; -import net.wurstclient.events.PostMotionListener.PostMotionEvent; -import net.wurstclient.events.PreMotionListener.PreMotionEvent; -import net.wurstclient.events.UpdateListener.UpdateEvent; -import net.wurstclient.hack.HackList; -import net.wurstclient.mixinterface.IClientPlayerEntity; - -@Mixin(ClientPlayerEntity.class) -public class ClientPlayerEntityMixin extends AbstractClientPlayerEntity - implements IClientPlayerEntity -{ - @Shadow - @Final - protected MinecraftClient client; - - private Screen tempCurrentScreen; - private boolean hideNextItemUse; - - public ClientPlayerEntityMixin(WurstClient wurst, ClientWorld world, - GameProfile profile) - { - super(world, profile); - } - - @Inject(at = @At(value = "INVOKE", - target = "Lnet/minecraft/client/network/AbstractClientPlayerEntity;tick()V", - ordinal = 0), method = "tick()V") - private void onTick(CallbackInfo ci) - { - EventManager.fire(UpdateEvent.INSTANCE); - } - - /** - * This mixin runs just before the tickMovement() method calls - * isUsingItem(), so that the onIsUsingItem() mixin knows which - * call to intercept. - */ - @Inject(at = @At(value = "INVOKE", - target = "Lnet/minecraft/client/network/ClientPlayerEntity;isUsingItem()Z", - ordinal = 0), method = "tickMovement()V") - private void onTickMovementItemUse(CallbackInfo ci) - { - if(WurstClient.INSTANCE.getHax().noSlowdownHack.isEnabled()) - hideNextItemUse = true; - } - - /** - * Pretends that the player is not using an item when instructed to do so by - * the onTickMovement() mixin. - */ - @Inject(at = @At("HEAD"), method = "isUsingItem()Z", cancellable = true) - private void onIsUsingItem(CallbackInfoReturnable cir) - { - if(!hideNextItemUse) - return; - - cir.setReturnValue(false); - hideNextItemUse = false; - } - - /** - * This mixin is injected into a random field access later in the - * tickMovement() method to ensure that hideNextItemUse is always reset - * after the item use slowdown calculation. - */ - @Inject(at = @At(value = "FIELD", - target = "Lnet/minecraft/client/network/ClientPlayerEntity;ticksToNextAutojump:I", - opcode = Opcodes.GETFIELD, - ordinal = 0), method = "tickMovement()V") - private void afterIsUsingItem(CallbackInfo ci) - { - hideNextItemUse = false; - } - - @Inject(at = @At("HEAD"), method = "sendMovementPackets()V") - private void onSendMovementPacketsHEAD(CallbackInfo ci) - { - EventManager.fire(PreMotionEvent.INSTANCE); - } - - @Inject(at = @At("TAIL"), method = "sendMovementPackets()V") - private void onSendMovementPacketsTAIL(CallbackInfo ci) - { - EventManager.fire(PostMotionEvent.INSTANCE); - } - - @Inject(at = @At("HEAD"), - method = "move(Lnet/minecraft/entity/MovementType;Lnet/minecraft/util/math/Vec3d;)V") - private void onMove(MovementType type, Vec3d offset, CallbackInfo ci) - { - EventManager.fire(PlayerMoveEvent.INSTANCE); - } - - @Inject(at = @At("HEAD"), - method = "isAutoJumpEnabled()Z", - cancellable = true) - private void onIsAutoJumpEnabled(CallbackInfoReturnable cir) - { - if(!WurstClient.INSTANCE.getHax().stepHack.isAutoJumpAllowed()) - cir.setReturnValue(false); - } - - /** - * When PortalGUI is enabled, this mixin temporarily sets the current screen - * to null to prevent the updateNausea() method from closing it. - */ - @Inject(at = @At(value = "FIELD", - target = "Lnet/minecraft/client/MinecraftClient;currentScreen:Lnet/minecraft/client/gui/screen/Screen;", - opcode = Opcodes.GETFIELD, - ordinal = 0), method = "updateNausea()V") - private void beforeUpdateNausea(CallbackInfo ci) - { - if(!WurstClient.INSTANCE.getHax().portalGuiHack.isEnabled()) - return; - - tempCurrentScreen = client.currentScreen; - client.currentScreen = null; - } - - /** - * This mixin restores the current screen as soon as the updateNausea() - * method is done looking at it. - */ - @Inject(at = @At(value = "FIELD", - target = "Lnet/minecraft/client/network/ClientPlayerEntity;nauseaIntensity:F", - opcode = Opcodes.GETFIELD, - ordinal = 1), method = "updateNausea()V") - private void afterUpdateNausea(CallbackInfo ci) - { - if(tempCurrentScreen == null) - return; - - client.currentScreen = tempCurrentScreen; - tempCurrentScreen = null; - } - - /** - * This mixin allows AutoSprint to enable sprinting even when the player is - * too hungry. - */ - @Inject(at = @At("HEAD"), method = "canSprint()Z", cancellable = true) - private void onCanSprint(CallbackInfoReturnable cir) - { - if(WurstClient.INSTANCE.getHax().autoSprintHack.shouldSprintHungry()) - cir.setReturnValue(true); - } - - /** - * Getter method for what used to be airStrafingSpeed. - * Overridden to allow for the speed to be modified by hacks. - */ - @Override - protected float getOffGroundSpeed() - { - AirStrafingSpeedEvent event = - new AirStrafingSpeedEvent(super.getOffGroundSpeed()); - EventManager.fire(event); - return event.getSpeed(); - } - - @Override - public void setVelocityClient(double x, double y, double z) - { - KnockbackEvent event = new KnockbackEvent(x, y, z); - EventManager.fire(event); - super.setVelocityClient(event.getX(), event.getY(), event.getZ()); - } - - @Override - public boolean isTouchingWater() - { - boolean inWater = super.isTouchingWater(); - IsPlayerInWaterEvent event = new IsPlayerInWaterEvent(inWater); - EventManager.fire(event); - - return event.isInWater(); - } - - @Override - public boolean isInLava() - { - boolean inLava = super.isInLava(); - IsPlayerInLavaEvent event = new IsPlayerInLavaEvent(inLava); - EventManager.fire(event); - - return event.isInLava(); - } - - @Override - public boolean isSpectator() - { - return super.isSpectator() - || WurstClient.INSTANCE.getHax().freecamHack.isEnabled(); - } - - @Override - public boolean isTouchingWaterBypass() - { - return super.isTouchingWater(); - } - - @Override - protected float getJumpVelocity() - { - return super.getJumpVelocity() - + WurstClient.INSTANCE.getHax().highJumpHack - .getAdditionalJumpMotion(); - } - - /** - * This is the part that makes SafeWalk work. - */ - @Override - protected boolean clipAtLedge() - { - return super.clipAtLedge() - || WurstClient.INSTANCE.getHax().safeWalkHack.isEnabled(); - } - - /** - * This mixin allows SafeWalk to sneak visibly when the player is - * near a ledge. - */ - @Override - protected Vec3d adjustMovementForSneaking(Vec3d movement, MovementType type) - { - Vec3d result = super.adjustMovementForSneaking(movement, type); - - if(movement != null) - WurstClient.INSTANCE.getHax().safeWalkHack - .onClipAtLedge(!movement.equals(result)); - - return result; - } - - @Override - public boolean hasStatusEffect(StatusEffect effect) - { - HackList hax = WurstClient.INSTANCE.getHax(); - - if(effect == StatusEffects.NIGHT_VISION - && hax.fullbrightHack.isNightVisionActive()) - return true; - - if(effect == StatusEffects.LEVITATION - && hax.noLevitationHack.isEnabled()) - return false; - - if(effect == StatusEffects.DARKNESS && hax.antiBlindHack.isEnabled()) - return false; - - return super.hasStatusEffect(effect); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.objectweb.asm.Opcodes; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import com.llamalad7.mixinextras.injector.wrapoperation.Operation; +import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; +import com.mojang.authlib.GameProfile; + +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.input.Input; +import net.minecraft.client.network.AbstractClientPlayerEntity; +import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.entity.MovementType; +import net.minecraft.entity.effect.StatusEffect; +import net.minecraft.entity.effect.StatusEffects; +import net.minecraft.util.math.Vec3d; +import net.wurstclient.WurstClient; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.AirStrafingSpeedListener.AirStrafingSpeedEvent; +import net.wurstclient.events.IsPlayerInLavaListener.IsPlayerInLavaEvent; +import net.wurstclient.events.IsPlayerInWaterListener.IsPlayerInWaterEvent; +import net.wurstclient.events.KnockbackListener.KnockbackEvent; +import net.wurstclient.events.PlayerMoveListener.PlayerMoveEvent; +import net.wurstclient.events.PostMotionListener.PostMotionEvent; +import net.wurstclient.events.PreMotionListener.PreMotionEvent; +import net.wurstclient.events.UpdateListener.UpdateEvent; +import net.wurstclient.hack.HackList; +import net.wurstclient.mixinterface.IClientPlayerEntity; + +@Mixin(ClientPlayerEntity.class) +public class ClientPlayerEntityMixin extends AbstractClientPlayerEntity + implements IClientPlayerEntity +{ + @Shadow + @Final + protected MinecraftClient client; + + private Screen tempCurrentScreen; + private boolean hideNextItemUse; + + public ClientPlayerEntityMixin(WurstClient wurst, ClientWorld world, + GameProfile profile) + { + super(world, profile); + } + + @Inject(at = @At(value = "INVOKE", + target = "Lnet/minecraft/client/network/AbstractClientPlayerEntity;tick()V", + ordinal = 0), method = "tick()V") + private void onTick(CallbackInfo ci) + { + EventManager.fire(UpdateEvent.INSTANCE); + } + + /** + * This mixin makes AutoSprint's "Omnidirectional Sprint" setting work. + */ + @WrapOperation( + at = @At(value = "INVOKE", + target = "Lnet/minecraft/client/input/Input;hasForwardMovement()Z", + ordinal = 0), + method = "tickMovement()V") + private boolean wrapHasForwardMovement(Input input, + Operation original) + { + if(WurstClient.INSTANCE.getHax().autoSprintHack.shouldOmniSprint()) + return input.getMovementInput().length() > 1e-5F; + + return original.call(input); + } + + /** + * This mixin runs just before the tickMovement() method calls + * isUsingItem(), so that the onIsUsingItem() mixin knows which + * call to intercept. + */ + @Inject(at = @At(value = "INVOKE", + target = "Lnet/minecraft/client/network/ClientPlayerEntity;isUsingItem()Z", + ordinal = 0), method = "tickMovement()V") + private void onTickMovementItemUse(CallbackInfo ci) + { + if(WurstClient.INSTANCE.getHax().noSlowdownHack.isEnabled()) + hideNextItemUse = true; + } + + /** + * Pretends that the player is not using an item when instructed to do so by + * the onTickMovement() mixin. + */ + @Inject(at = @At("HEAD"), method = "isUsingItem()Z", cancellable = true) + private void onIsUsingItem(CallbackInfoReturnable cir) + { + if(!hideNextItemUse) + return; + + cir.setReturnValue(false); + hideNextItemUse = false; + } + + /** + * This mixin is injected into a random field access later in the + * tickMovement() method to ensure that hideNextItemUse is always reset + * after the item use slowdown calculation. + */ + @Inject(at = @At(value = "FIELD", + target = "Lnet/minecraft/client/network/ClientPlayerEntity;ticksToNextAutojump:I", + opcode = Opcodes.GETFIELD, + ordinal = 0), method = "tickMovement()V") + private void afterIsUsingItem(CallbackInfo ci) + { + hideNextItemUse = false; + } + + @Inject(at = @At("HEAD"), method = "sendMovementPackets()V") + private void onSendMovementPacketsHEAD(CallbackInfo ci) + { + EventManager.fire(PreMotionEvent.INSTANCE); + } + + @Inject(at = @At("TAIL"), method = "sendMovementPackets()V") + private void onSendMovementPacketsTAIL(CallbackInfo ci) + { + EventManager.fire(PostMotionEvent.INSTANCE); + } + + @Inject(at = @At("HEAD"), + method = "move(Lnet/minecraft/entity/MovementType;Lnet/minecraft/util/math/Vec3d;)V") + private void onMove(MovementType type, Vec3d offset, CallbackInfo ci) + { + EventManager.fire(PlayerMoveEvent.INSTANCE); + } + + @Inject(at = @At("HEAD"), + method = "isAutoJumpEnabled()Z", + cancellable = true) + private void onIsAutoJumpEnabled(CallbackInfoReturnable cir) + { + if(!WurstClient.INSTANCE.getHax().stepHack.isAutoJumpAllowed()) + cir.setReturnValue(false); + } + + /** + * When PortalGUI is enabled, this mixin temporarily sets the current screen + * to null to prevent the updateNausea() method from closing it. + */ + @Inject(at = @At(value = "FIELD", + target = "Lnet/minecraft/client/MinecraftClient;currentScreen:Lnet/minecraft/client/gui/screen/Screen;", + opcode = Opcodes.GETFIELD, + ordinal = 0), method = "updateNausea()V") + private void beforeUpdateNausea(CallbackInfo ci) + { + if(!WurstClient.INSTANCE.getHax().portalGuiHack.isEnabled()) + return; + + tempCurrentScreen = client.currentScreen; + client.currentScreen = null; + } + + /** + * This mixin restores the current screen as soon as the updateNausea() + * method is done looking at it. + */ + @Inject(at = @At(value = "FIELD", + target = "Lnet/minecraft/client/network/ClientPlayerEntity;nauseaIntensity:F", + opcode = Opcodes.GETFIELD, + ordinal = 1), method = "updateNausea()V") + private void afterUpdateNausea(CallbackInfo ci) + { + if(tempCurrentScreen == null) + return; + + client.currentScreen = tempCurrentScreen; + tempCurrentScreen = null; + } + + /** + * This mixin allows AutoSprint to enable sprinting even when the player is + * too hungry. + */ + @Inject(at = @At("HEAD"), method = "canSprint()Z", cancellable = true) + private void onCanSprint(CallbackInfoReturnable cir) + { + if(WurstClient.INSTANCE.getHax().autoSprintHack.shouldSprintHungry()) + cir.setReturnValue(true); + } + + /** + * Getter method for what used to be airStrafingSpeed. + * Overridden to allow for the speed to be modified by hacks. + */ + @Override + protected float getOffGroundSpeed() + { + AirStrafingSpeedEvent event = + new AirStrafingSpeedEvent(super.getOffGroundSpeed()); + EventManager.fire(event); + return event.getSpeed(); + } + + @Override + public void setVelocityClient(double x, double y, double z) + { + KnockbackEvent event = new KnockbackEvent(x, y, z); + EventManager.fire(event); + super.setVelocityClient(event.getX(), event.getY(), event.getZ()); + } + + @Override + public boolean isTouchingWater() + { + boolean inWater = super.isTouchingWater(); + IsPlayerInWaterEvent event = new IsPlayerInWaterEvent(inWater); + EventManager.fire(event); + + return event.isInWater(); + } + + @Override + public boolean isInLava() + { + boolean inLava = super.isInLava(); + IsPlayerInLavaEvent event = new IsPlayerInLavaEvent(inLava); + EventManager.fire(event); + + return event.isInLava(); + } + + @Override + public boolean isSpectator() + { + return super.isSpectator() + || WurstClient.INSTANCE.getHax().freecamHack.isEnabled(); + } + + @Override + public boolean isTouchingWaterBypass() + { + return super.isTouchingWater(); + } + + @Override + protected float getJumpVelocity() + { + return super.getJumpVelocity() + + WurstClient.INSTANCE.getHax().highJumpHack + .getAdditionalJumpMotion(); + } + + /** + * This is the part that makes SafeWalk work. + */ + @Override + protected boolean clipAtLedge() + { + return super.clipAtLedge() + || WurstClient.INSTANCE.getHax().safeWalkHack.isEnabled(); + } + + /** + * This mixin allows SafeWalk to sneak visibly when the player is + * near a ledge. + */ + @Override + protected Vec3d adjustMovementForSneaking(Vec3d movement, MovementType type) + { + Vec3d result = super.adjustMovementForSneaking(movement, type); + + if(movement != null) + WurstClient.INSTANCE.getHax().safeWalkHack + .onClipAtLedge(!movement.equals(result)); + + return result; + } + + @Override + public boolean hasStatusEffect(StatusEffect effect) + { + HackList hax = WurstClient.INSTANCE.getHax(); + + if(effect == StatusEffects.NIGHT_VISION + && hax.fullbrightHack.isNightVisionActive()) + return true; + + if(effect == StatusEffects.LEVITATION + && hax.noLevitationHack.isEnabled()) + return false; + + if(effect == StatusEffects.DARKNESS && hax.antiBlindHack.isEnabled()) + return false; + + return super.hasStatusEffect(effect); + } +} diff --git a/src/main/java/net/wurstclient/mixin/ClientPlayerInteractionManagerMixin.java b/src/main/java/net/wurstclient/mixin/ClientPlayerInteractionManagerMixin.java index d99dd469..caa51a00 100644 --- a/src/main/java/net/wurstclient/mixin/ClientPlayerInteractionManagerMixin.java +++ b/src/main/java/net/wurstclient/mixin/ClientPlayerInteractionManagerMixin.java @@ -1,165 +1,165 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.network.ClientPlayerEntity; -import net.minecraft.client.network.ClientPlayerInteractionManager; -import net.minecraft.client.network.SequencedPacketCreator; -import net.minecraft.client.world.ClientWorld; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket; -import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket.Action; -import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket; -import net.minecraft.screen.slot.SlotActionType; -import net.minecraft.util.ActionResult; -import net.minecraft.util.Hand; -import net.minecraft.util.hit.BlockHitResult; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.util.math.Vec3d; -import net.wurstclient.WurstClient; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.BlockBreakingProgressListener.BlockBreakingProgressEvent; -import net.wurstclient.events.StopUsingItemListener.StopUsingItemEvent; -import net.wurstclient.hack.HackList; -import net.wurstclient.hacks.ReachHack; -import net.wurstclient.mixinterface.IClientPlayerInteractionManager; - -@Mixin(ClientPlayerInteractionManager.class) -public abstract class ClientPlayerInteractionManagerMixin - implements IClientPlayerInteractionManager -{ - @Shadow - @Final - private MinecraftClient client; - - @Inject(at = @At(value = "INVOKE", - target = "Lnet/minecraft/client/network/ClientPlayerEntity;getId()I", - ordinal = 0), - method = "updateBlockBreakingProgress(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;)Z") - private void onPlayerDamageBlock(BlockPos pos, Direction direction, - CallbackInfoReturnable cir) - { - EventManager.fire(new BlockBreakingProgressEvent(pos, direction)); - } - - @Inject(at = @At("HEAD"), - method = "getReachDistance()F", - cancellable = true) - private void onGetReachDistance(CallbackInfoReturnable ci) - { - HackList hax = WurstClient.INSTANCE.getHax(); - if(hax == null) - return; - - ReachHack reach = hax.reachHack; - if(reach.isEnabled()) - ci.setReturnValue(reach.getReachDistance()); - } - - @Inject(at = @At("HEAD"), - method = "hasExtendedReach()Z", - cancellable = true) - private void hasExtendedReach(CallbackInfoReturnable cir) - { - HackList hax = WurstClient.INSTANCE.getHax(); - if(hax == null || !hax.reachHack.isEnabled()) - return; - - cir.setReturnValue(true); - } - - @Inject(at = @At("HEAD"), - method = "stopUsingItem(Lnet/minecraft/entity/player/PlayerEntity;)V") - private void onStopUsingItem(PlayerEntity player, CallbackInfo ci) - { - EventManager.fire(StopUsingItemEvent.INSTANCE); - } - - @Override - public void windowClick_PICKUP(int slot) - { - clickSlot(0, slot, 0, SlotActionType.PICKUP, client.player); - } - - @Override - public void windowClick_QUICK_MOVE(int slot) - { - clickSlot(0, slot, 0, SlotActionType.QUICK_MOVE, client.player); - } - - @Override - public void windowClick_THROW(int slot) - { - clickSlot(0, slot, 1, SlotActionType.THROW, client.player); - } - - @Override - public void windowClick_SWAP(int from, int to) - { - clickSlot(0, from, to, SlotActionType.SWAP, client.player); - } - - @Override - public void rightClickItem() - { - interactItem(client.player, Hand.MAIN_HAND); - } - - @Override - public void rightClickBlock(BlockPos pos, Direction side, Vec3d hitVec) - { - BlockHitResult hitResult = new BlockHitResult(hitVec, side, pos, false); - Hand hand = Hand.MAIN_HAND; - interactBlock(client.player, hand, hitResult); - interactItem(client.player, hand); - } - - @Override - public void sendPlayerActionC2SPacket(Action action, BlockPos blockPos, - Direction direction) - { - sendSequencedPacket(client.world, - i -> new PlayerActionC2SPacket(action, blockPos, direction, i)); - } - - @Override - public void sendPlayerInteractBlockPacket(Hand hand, - BlockHitResult blockHitResult) - { - sendSequencedPacket(client.world, - i -> new PlayerInteractBlockC2SPacket(hand, blockHitResult, i)); - } - - @Shadow - private void sendSequencedPacket(ClientWorld world, - SequencedPacketCreator packetCreator) - { - - } - - @Shadow - public abstract ActionResult interactBlock(ClientPlayerEntity player, - Hand hand, BlockHitResult hitResult); - - @Shadow - public abstract ActionResult interactItem(PlayerEntity player, Hand hand); - - @Shadow - public abstract void clickSlot(int syncId, int slotId, int button, - SlotActionType actionType, PlayerEntity player); -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.client.network.ClientPlayerInteractionManager; +import net.minecraft.client.network.SequencedPacketCreator; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket; +import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket.Action; +import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket; +import net.minecraft.screen.slot.SlotActionType; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Hand; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.math.Vec3d; +import net.wurstclient.WurstClient; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.BlockBreakingProgressListener.BlockBreakingProgressEvent; +import net.wurstclient.events.StopUsingItemListener.StopUsingItemEvent; +import net.wurstclient.hack.HackList; +import net.wurstclient.hacks.ReachHack; +import net.wurstclient.mixinterface.IClientPlayerInteractionManager; + +@Mixin(ClientPlayerInteractionManager.class) +public abstract class ClientPlayerInteractionManagerMixin + implements IClientPlayerInteractionManager +{ + @Shadow + @Final + private MinecraftClient client; + + @Inject(at = @At(value = "INVOKE", + target = "Lnet/minecraft/client/network/ClientPlayerEntity;getId()I", + ordinal = 0), + method = "updateBlockBreakingProgress(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;)Z") + private void onPlayerDamageBlock(BlockPos pos, Direction direction, + CallbackInfoReturnable cir) + { + EventManager.fire(new BlockBreakingProgressEvent(pos, direction)); + } + + @Inject(at = @At("HEAD"), + method = "getReachDistance()F", + cancellable = true) + private void onGetReachDistance(CallbackInfoReturnable ci) + { + HackList hax = WurstClient.INSTANCE.getHax(); + if(hax == null) + return; + + ReachHack reach = hax.reachHack; + if(reach.isEnabled()) + ci.setReturnValue(reach.getReachDistance()); + } + + @Inject(at = @At("HEAD"), + method = "hasExtendedReach()Z", + cancellable = true) + private void hasExtendedReach(CallbackInfoReturnable cir) + { + HackList hax = WurstClient.INSTANCE.getHax(); + if(hax == null || !hax.reachHack.isEnabled()) + return; + + cir.setReturnValue(true); + } + + @Inject(at = @At("HEAD"), + method = "stopUsingItem(Lnet/minecraft/entity/player/PlayerEntity;)V") + private void onStopUsingItem(PlayerEntity player, CallbackInfo ci) + { + EventManager.fire(StopUsingItemEvent.INSTANCE); + } + + @Override + public void windowClick_PICKUP(int slot) + { + clickSlot(0, slot, 0, SlotActionType.PICKUP, client.player); + } + + @Override + public void windowClick_QUICK_MOVE(int slot) + { + clickSlot(0, slot, 0, SlotActionType.QUICK_MOVE, client.player); + } + + @Override + public void windowClick_THROW(int slot) + { + clickSlot(0, slot, 1, SlotActionType.THROW, client.player); + } + + @Override + public void windowClick_SWAP(int from, int to) + { + clickSlot(0, from, to, SlotActionType.SWAP, client.player); + } + + @Override + public void rightClickItem() + { + interactItem(client.player, Hand.MAIN_HAND); + } + + @Override + public void rightClickBlock(BlockPos pos, Direction side, Vec3d hitVec) + { + BlockHitResult hitResult = new BlockHitResult(hitVec, side, pos, false); + Hand hand = Hand.MAIN_HAND; + interactBlock(client.player, hand, hitResult); + interactItem(client.player, hand); + } + + @Override + public void sendPlayerActionC2SPacket(Action action, BlockPos blockPos, + Direction direction) + { + sendSequencedPacket(client.world, + i -> new PlayerActionC2SPacket(action, blockPos, direction, i)); + } + + @Override + public void sendPlayerInteractBlockPacket(Hand hand, + BlockHitResult blockHitResult) + { + sendSequencedPacket(client.world, + i -> new PlayerInteractBlockC2SPacket(hand, blockHitResult, i)); + } + + @Shadow + private void sendSequencedPacket(ClientWorld world, + SequencedPacketCreator packetCreator) + { + + } + + @Shadow + public abstract ActionResult interactBlock(ClientPlayerEntity player, + Hand hand, BlockHitResult hitResult); + + @Shadow + public abstract ActionResult interactItem(PlayerEntity player, Hand hand); + + @Shadow + public abstract void clickSlot(int syncId, int slotId, int button, + SlotActionType actionType, PlayerEntity player); +} diff --git a/src/main/java/net/wurstclient/mixin/ClientWorldMixin.java b/src/main/java/net/wurstclient/mixin/ClientWorldMixin.java index 5a2c5171..c43f7067 100644 --- a/src/main/java/net/wurstclient/mixin/ClientWorldMixin.java +++ b/src/main/java/net/wurstclient/mixin/ClientWorldMixin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/mixin/CreativeInventoryScreenMixin.java b/src/main/java/net/wurstclient/mixin/CreativeInventoryScreenMixin.java index d8326c6c..ea206cf7 100644 --- a/src/main/java/net/wurstclient/mixin/CreativeInventoryScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/CreativeInventoryScreenMixin.java @@ -1,43 +1,43 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen; -import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen; -import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen.CreativeScreenHandler; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.PlayerInventory; -import net.minecraft.text.Text; -import net.wurstclient.WurstClient; - -@Mixin(CreativeInventoryScreen.class) -public abstract class CreativeInventoryScreenMixin - extends AbstractInventoryScreen -{ - private CreativeInventoryScreenMixin(WurstClient wurst, - CreativeScreenHandler screenHandler, PlayerInventory inventory, - Text title) - { - super(screenHandler, inventory, title); - } - - @Inject(at = @At("HEAD"), - method = "shouldShowOperatorTab(Lnet/minecraft/entity/player/PlayerEntity;)Z", - cancellable = true) - private void onShouldShowOperatorTab(PlayerEntity player, - CallbackInfoReturnable cir) - { - if(WurstClient.INSTANCE.isEnabled()) - cir.setReturnValue(true); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen; +import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen; +import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen.CreativeScreenHandler; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.text.Text; +import net.wurstclient.WurstClient; + +@Mixin(CreativeInventoryScreen.class) +public abstract class CreativeInventoryScreenMixin + extends AbstractInventoryScreen +{ + private CreativeInventoryScreenMixin(WurstClient wurst, + CreativeScreenHandler screenHandler, PlayerInventory inventory, + Text title) + { + super(screenHandler, inventory, title); + } + + @Inject(at = @At("HEAD"), + method = "shouldShowOperatorTab(Lnet/minecraft/entity/player/PlayerEntity;)Z", + cancellable = true) + private void onShouldShowOperatorTab(PlayerEntity player, + CallbackInfoReturnable cir) + { + if(WurstClient.INSTANCE.isEnabled()) + cir.setReturnValue(true); + } +} diff --git a/src/main/java/net/wurstclient/mixin/DeathScreenMixin.java b/src/main/java/net/wurstclient/mixin/DeathScreenMixin.java index 579ba88b..8a10e6c5 100644 --- a/src/main/java/net/wurstclient/mixin/DeathScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/DeathScreenMixin.java @@ -1,56 +1,56 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import net.minecraft.client.gui.screen.DeathScreen; -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.widget.ButtonWidget; -import net.minecraft.text.Text; -import net.wurstclient.WurstClient; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.DeathListener.DeathEvent; -import net.wurstclient.hacks.AutoRespawnHack; - -@Mixin(DeathScreen.class) -public abstract class DeathScreenMixin extends Screen -{ - private DeathScreenMixin(WurstClient wurst, Text title) - { - super(title); - } - - @Inject(at = @At("TAIL"), method = "tick()V") - private void onTick(CallbackInfo ci) - { - EventManager.fire(DeathEvent.INSTANCE); - } - - @Inject(at = @At("TAIL"), method = "init()V") - private void onInit(CallbackInfo ci) - { - AutoRespawnHack autoRespawn = - WurstClient.INSTANCE.getHax().autoRespawnHack; - - if(!autoRespawn.shouldShowButton()) - return; - - int backButtonX = width / 2 - 100; - int backButtonY = height / 4; - - addDrawableChild( - ButtonWidget.builder(Text.literal("AutoRespawn: OFF"), b -> { - autoRespawn.setEnabled(true); - autoRespawn.onDeath(); - }).dimensions(backButtonX, backButtonY + 48, 200, 20).build()); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.minecraft.client.gui.screen.DeathScreen; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.text.Text; +import net.wurstclient.WurstClient; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.DeathListener.DeathEvent; +import net.wurstclient.hacks.AutoRespawnHack; + +@Mixin(DeathScreen.class) +public abstract class DeathScreenMixin extends Screen +{ + private DeathScreenMixin(WurstClient wurst, Text title) + { + super(title); + } + + @Inject(at = @At("TAIL"), method = "tick()V") + private void onTick(CallbackInfo ci) + { + EventManager.fire(DeathEvent.INSTANCE); + } + + @Inject(at = @At("TAIL"), method = "init()V") + private void onInit(CallbackInfo ci) + { + AutoRespawnHack autoRespawn = + WurstClient.INSTANCE.getHax().autoRespawnHack; + + if(!autoRespawn.shouldShowButton()) + return; + + int backButtonX = width / 2 - 100; + int backButtonY = height / 4; + + addDrawableChild( + ButtonWidget.builder(Text.literal("AutoRespawn: OFF"), b -> { + autoRespawn.setEnabled(true); + autoRespawn.onDeath(); + }).dimensions(backButtonX, backButtonY + 48, 200, 20).build()); + } +} diff --git a/src/main/java/net/wurstclient/mixin/DirectConnectScreenMixin.java b/src/main/java/net/wurstclient/mixin/DirectConnectScreenMixin.java index 31a195b8..0a5ea9cc 100644 --- a/src/main/java/net/wurstclient/mixin/DirectConnectScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/DirectConnectScreenMixin.java @@ -1,41 +1,41 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import net.minecraft.client.gui.screen.DirectConnectScreen; -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.network.ServerInfo; -import net.minecraft.text.Text; -import net.wurstclient.WurstClient; -import net.wurstclient.util.LastServerRememberer; - -@Mixin(DirectConnectScreen.class) -public class DirectConnectScreenMixin extends Screen -{ - @Shadow - @Final - private ServerInfo serverEntry; - - private DirectConnectScreenMixin(WurstClient wurst, Text title) - { - super(title); - } - - @Inject(at = @At("TAIL"), method = "saveAndClose()V") - private void onSaveAndClose(CallbackInfo ci) - { - LastServerRememberer.setLastServer(serverEntry); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.minecraft.client.gui.screen.DirectConnectScreen; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.network.ServerInfo; +import net.minecraft.text.Text; +import net.wurstclient.WurstClient; +import net.wurstclient.util.LastServerRememberer; + +@Mixin(DirectConnectScreen.class) +public class DirectConnectScreenMixin extends Screen +{ + @Shadow + @Final + private ServerInfo serverEntry; + + private DirectConnectScreenMixin(WurstClient wurst, Text title) + { + super(title); + } + + @Inject(at = @At("TAIL"), method = "saveAndClose()V") + private void onSaveAndClose(CallbackInfo ci) + { + LastServerRememberer.setLastServer(serverEntry); + } +} diff --git a/src/main/java/net/wurstclient/mixin/DisconnectedRealmsScreenMixin.java b/src/main/java/net/wurstclient/mixin/DisconnectedRealmsScreenMixin.java index 61de4a99..3122d7af 100644 --- a/src/main/java/net/wurstclient/mixin/DisconnectedRealmsScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/DisconnectedRealmsScreenMixin.java @@ -1,50 +1,50 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.realms.gui.screen.DisconnectedRealmsScreen; -import net.minecraft.client.realms.gui.screen.RealmsScreen; -import net.minecraft.text.Text; -import net.wurstclient.WurstClient; -import net.wurstclient.nochatreports.ForcedChatReportsScreen; - -@Mixin(DisconnectedRealmsScreen.class) -public class DisconnectedRealmsScreenMixin extends RealmsScreen -{ - @Shadow - @Final - private Text reason; - @Shadow - @Final - private Screen parent; - - private DisconnectedRealmsScreenMixin(WurstClient wurst, Text title) - { - super(title); - } - - @Inject(at = @At("TAIL"), method = "init()V") - private void onInit(CallbackInfo ci) - { - if(!WurstClient.INSTANCE.isEnabled()) - return; - - System.out.println("Realms disconnected: " + reason); - - if(ForcedChatReportsScreen.isCausedByNoChatReports(reason)) - client.setScreen(new ForcedChatReportsScreen(parent)); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.realms.gui.screen.DisconnectedRealmsScreen; +import net.minecraft.client.realms.gui.screen.RealmsScreen; +import net.minecraft.text.Text; +import net.wurstclient.WurstClient; +import net.wurstclient.nochatreports.ForcedChatReportsScreen; + +@Mixin(DisconnectedRealmsScreen.class) +public class DisconnectedRealmsScreenMixin extends RealmsScreen +{ + @Shadow + @Final + private Text reason; + @Shadow + @Final + private Screen parent; + + private DisconnectedRealmsScreenMixin(WurstClient wurst, Text title) + { + super(title); + } + + @Inject(at = @At("TAIL"), method = "init()V") + private void onInit(CallbackInfo ci) + { + if(!WurstClient.INSTANCE.isEnabled()) + return; + + System.out.println("Realms disconnected: " + reason); + + if(ForcedChatReportsScreen.isCausedByNoChatReports(reason)) + client.setScreen(new ForcedChatReportsScreen(parent)); + } +} diff --git a/src/main/java/net/wurstclient/mixin/DisconnectedScreenMixin.java b/src/main/java/net/wurstclient/mixin/DisconnectedScreenMixin.java index 5d54bf38..aefaa4f8 100644 --- a/src/main/java/net/wurstclient/mixin/DisconnectedScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/DisconnectedScreenMixin.java @@ -1,134 +1,134 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import java.util.stream.Stream; - -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import net.minecraft.client.gui.screen.DisconnectedScreen; -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.widget.ButtonWidget; -import net.minecraft.client.gui.widget.GridWidget; -import net.minecraft.text.Text; -import net.wurstclient.WurstClient; -import net.wurstclient.hacks.AutoReconnectHack; -import net.wurstclient.nochatreports.ForcedChatReportsScreen; -import net.wurstclient.nochatreports.NcrModRequiredScreen; -import net.wurstclient.util.LastServerRememberer; - -@Mixin(DisconnectedScreen.class) -public class DisconnectedScreenMixin extends Screen -{ - private int autoReconnectTimer; - private ButtonWidget autoReconnectButton; - - @Shadow - @Final - private Text reason; - @Shadow - @Final - private Screen parent; - @Shadow - @Final - private GridWidget grid; - - private DisconnectedScreenMixin(WurstClient wurst, Text title) - { - super(title); - } - - @Inject(at = @At("TAIL"), method = "init()V") - private void onInit(CallbackInfo ci) - { - if(!WurstClient.INSTANCE.isEnabled()) - return; - - System.out.println("Disconnected: " + reason); - - if(ForcedChatReportsScreen.isCausedByNoChatReports(reason)) - { - client.setScreen(new ForcedChatReportsScreen(parent)); - return; - } - - if(NcrModRequiredScreen.isCausedByLackOfNCR(reason)) - { - client.setScreen(new NcrModRequiredScreen(parent)); - return; - } - - addReconnectButtons(); - } - - private void addReconnectButtons() - { - ButtonWidget reconnectButton = grid.add( - ButtonWidget.builder(Text.literal("Reconnect"), - b -> LastServerRememberer.reconnect(parent)).build(), - 3, 0, 1, 1, grid.copyPositioner().margin(2).marginTop(-6)); - - autoReconnectButton = grid.add( - ButtonWidget.builder(Text.literal("AutoReconnect"), - b -> pressAutoReconnect()).build(), - 4, 0, 1, 1, grid.copyPositioner().margin(2)); - - grid.refreshPositions(); - Stream.of(reconnectButton, autoReconnectButton) - .forEach(this::addDrawableChild); - - AutoReconnectHack autoReconnect = - WurstClient.INSTANCE.getHax().autoReconnectHack; - - if(autoReconnect.isEnabled()) - autoReconnectTimer = autoReconnect.getWaitTicks(); - } - - private void pressAutoReconnect() - { - AutoReconnectHack autoReconnect = - WurstClient.INSTANCE.getHax().autoReconnectHack; - - autoReconnect.setEnabled(!autoReconnect.isEnabled()); - - if(autoReconnect.isEnabled()) - autoReconnectTimer = autoReconnect.getWaitTicks(); - } - - @Override - public void tick() - { - if(!WurstClient.INSTANCE.isEnabled() || autoReconnectButton == null) - return; - - AutoReconnectHack autoReconnect = - WurstClient.INSTANCE.getHax().autoReconnectHack; - - if(!autoReconnect.isEnabled()) - { - autoReconnectButton.setMessage(Text.literal("AutoReconnect")); - return; - } - - autoReconnectButton.setMessage(Text.literal("AutoReconnect (" - + (int)Math.ceil(autoReconnectTimer / 20.0) + ")")); - - if(autoReconnectTimer > 0) - { - autoReconnectTimer--; - return; - } - - LastServerRememberer.reconnect(parent); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import java.util.stream.Stream; + +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.minecraft.client.gui.screen.DisconnectedScreen; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.client.gui.widget.GridWidget; +import net.minecraft.text.Text; +import net.wurstclient.WurstClient; +import net.wurstclient.hacks.AutoReconnectHack; +import net.wurstclient.nochatreports.ForcedChatReportsScreen; +import net.wurstclient.nochatreports.NcrModRequiredScreen; +import net.wurstclient.util.LastServerRememberer; + +@Mixin(DisconnectedScreen.class) +public class DisconnectedScreenMixin extends Screen +{ + private int autoReconnectTimer; + private ButtonWidget autoReconnectButton; + + @Shadow + @Final + private Text reason; + @Shadow + @Final + private Screen parent; + @Shadow + @Final + private GridWidget grid; + + private DisconnectedScreenMixin(WurstClient wurst, Text title) + { + super(title); + } + + @Inject(at = @At("TAIL"), method = "init()V") + private void onInit(CallbackInfo ci) + { + if(!WurstClient.INSTANCE.isEnabled()) + return; + + System.out.println("Disconnected: " + reason); + + if(ForcedChatReportsScreen.isCausedByNoChatReports(reason)) + { + client.setScreen(new ForcedChatReportsScreen(parent)); + return; + } + + if(NcrModRequiredScreen.isCausedByLackOfNCR(reason)) + { + client.setScreen(new NcrModRequiredScreen(parent)); + return; + } + + addReconnectButtons(); + } + + private void addReconnectButtons() + { + ButtonWidget reconnectButton = grid.add( + ButtonWidget.builder(Text.literal("Reconnect"), + b -> LastServerRememberer.reconnect(parent)).build(), + 3, 0, 1, 1, grid.copyPositioner().margin(2).marginTop(-6)); + + autoReconnectButton = grid.add( + ButtonWidget.builder(Text.literal("AutoReconnect"), + b -> pressAutoReconnect()).build(), + 4, 0, 1, 1, grid.copyPositioner().margin(2)); + + grid.refreshPositions(); + Stream.of(reconnectButton, autoReconnectButton) + .forEach(this::addDrawableChild); + + AutoReconnectHack autoReconnect = + WurstClient.INSTANCE.getHax().autoReconnectHack; + + if(autoReconnect.isEnabled()) + autoReconnectTimer = autoReconnect.getWaitTicks(); + } + + private void pressAutoReconnect() + { + AutoReconnectHack autoReconnect = + WurstClient.INSTANCE.getHax().autoReconnectHack; + + autoReconnect.setEnabled(!autoReconnect.isEnabled()); + + if(autoReconnect.isEnabled()) + autoReconnectTimer = autoReconnect.getWaitTicks(); + } + + @Override + public void tick() + { + if(!WurstClient.INSTANCE.isEnabled() || autoReconnectButton == null) + return; + + AutoReconnectHack autoReconnect = + WurstClient.INSTANCE.getHax().autoReconnectHack; + + if(!autoReconnect.isEnabled()) + { + autoReconnectButton.setMessage(Text.literal("AutoReconnect")); + return; + } + + autoReconnectButton.setMessage(Text.literal("AutoReconnect (" + + (int)Math.ceil(autoReconnectTimer / 20.0) + ")")); + + if(autoReconnectTimer > 0) + { + autoReconnectTimer--; + return; + } + + LastServerRememberer.reconnect(parent); + } +} diff --git a/src/main/java/net/wurstclient/mixin/EntityMixin.java b/src/main/java/net/wurstclient/mixin/EntityMixin.java index ef0d9d9c..93b9094c 100644 --- a/src/main/java/net/wurstclient/mixin/EntityMixin.java +++ b/src/main/java/net/wurstclient/mixin/EntityMixin.java @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.objectweb.asm.Opcodes; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.Redirect; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.server.command.CommandOutput; -import net.minecraft.util.Nameable; -import net.minecraft.util.math.Vec3d; -import net.minecraft.world.entity.EntityLike; -import net.wurstclient.WurstClient; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.VelocityFromEntityCollisionListener.VelocityFromEntityCollisionEvent; -import net.wurstclient.events.VelocityFromFluidListener.VelocityFromFluidEvent; - -@Mixin(Entity.class) -public abstract class EntityMixin implements Nameable, EntityLike, CommandOutput -{ - @Redirect(at = @At(value = "INVOKE", - target = "Lnet/minecraft/entity/Entity;setVelocity(Lnet/minecraft/util/math/Vec3d;)V", - opcode = Opcodes.INVOKEVIRTUAL, - ordinal = 0), - method = "updateMovementInFluid(Lnet/minecraft/registry/tag/TagKey;D)Z") - private void setVelocityFromFluid(Entity entity, Vec3d velocity) - { - VelocityFromFluidEvent event = - new VelocityFromFluidEvent((Entity)(Object)this); - EventManager.fire(event); - - if(!event.isCancelled()) - entity.setVelocity(velocity); - } - - @Inject(at = @At("HEAD"), - method = "Lnet/minecraft/entity/Entity;pushAwayFrom(Lnet/minecraft/entity/Entity;)V", - cancellable = true) - private void onPushAwayFrom(Entity entity, CallbackInfo ci) - { - VelocityFromEntityCollisionEvent event = - new VelocityFromEntityCollisionEvent((Entity)(Object)this); - EventManager.fire(event); - - if(event.isCancelled()) - ci.cancel(); - } - - /** - * Makes invisible entities render as ghosts if TrueSight is enabled. - */ - @Inject(at = @At("RETURN"), - method = "Lnet/minecraft/entity/Entity;isInvisibleTo(Lnet/minecraft/entity/player/PlayerEntity;)Z", - cancellable = true) - private void onIsInvisibleTo(PlayerEntity player, - CallbackInfoReturnable cir) - { - // Return early if the entity is not invisible - if(!cir.getReturnValueZ()) - return; - - if(WurstClient.INSTANCE.getHax().trueSightHack - .shouldBeVisible((Entity)(Object)this)) - cir.setReturnValue(false); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.objectweb.asm.Opcodes; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.Redirect; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.server.command.CommandOutput; +import net.minecraft.util.Nameable; +import net.minecraft.util.math.Vec3d; +import net.minecraft.world.entity.EntityLike; +import net.wurstclient.WurstClient; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.VelocityFromEntityCollisionListener.VelocityFromEntityCollisionEvent; +import net.wurstclient.events.VelocityFromFluidListener.VelocityFromFluidEvent; + +@Mixin(Entity.class) +public abstract class EntityMixin implements Nameable, EntityLike, CommandOutput +{ + @Redirect(at = @At(value = "INVOKE", + target = "Lnet/minecraft/entity/Entity;setVelocity(Lnet/minecraft/util/math/Vec3d;)V", + opcode = Opcodes.INVOKEVIRTUAL, + ordinal = 0), + method = "updateMovementInFluid(Lnet/minecraft/registry/tag/TagKey;D)Z") + private void setVelocityFromFluid(Entity entity, Vec3d velocity) + { + VelocityFromFluidEvent event = + new VelocityFromFluidEvent((Entity)(Object)this); + EventManager.fire(event); + + if(!event.isCancelled()) + entity.setVelocity(velocity); + } + + @Inject(at = @At("HEAD"), + method = "Lnet/minecraft/entity/Entity;pushAwayFrom(Lnet/minecraft/entity/Entity;)V", + cancellable = true) + private void onPushAwayFrom(Entity entity, CallbackInfo ci) + { + VelocityFromEntityCollisionEvent event = + new VelocityFromEntityCollisionEvent((Entity)(Object)this); + EventManager.fire(event); + + if(event.isCancelled()) + ci.cancel(); + } + + /** + * Makes invisible entities render as ghosts if TrueSight is enabled. + */ + @Inject(at = @At("RETURN"), + method = "Lnet/minecraft/entity/Entity;isInvisibleTo(Lnet/minecraft/entity/player/PlayerEntity;)Z", + cancellable = true) + private void onIsInvisibleTo(PlayerEntity player, + CallbackInfoReturnable cir) + { + // Return early if the entity is not invisible + if(!cir.getReturnValueZ()) + return; + + if(WurstClient.INSTANCE.getHax().trueSightHack + .shouldBeVisible((Entity)(Object)this)) + cir.setReturnValue(false); + } +} diff --git a/src/main/java/net/wurstclient/mixin/EntityRendererMixin.java b/src/main/java/net/wurstclient/mixin/EntityRendererMixin.java index 7cf6fd7a..a1b39ea3 100644 --- a/src/main/java/net/wurstclient/mixin/EntityRendererMixin.java +++ b/src/main/java/net/wurstclient/mixin/EntityRendererMixin.java @@ -1,116 +1,116 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.joml.Matrix4f; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import net.minecraft.client.font.TextRenderer; -import net.minecraft.client.font.TextRenderer.TextLayerType; -import net.minecraft.client.render.VertexConsumerProvider; -import net.minecraft.client.render.entity.EntityRenderDispatcher; -import net.minecraft.client.render.entity.EntityRenderer; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.entity.Entity; -import net.minecraft.entity.LivingEntity; -import net.minecraft.text.Text; -import net.wurstclient.WurstClient; -import net.wurstclient.hacks.NameTagsHack; - -@Mixin(EntityRenderer.class) -public abstract class EntityRendererMixin -{ - @Shadow - @Final - protected EntityRenderDispatcher dispatcher; - - @Inject(at = @At("HEAD"), - method = "renderLabelIfPresent(Lnet/minecraft/entity/Entity;Lnet/minecraft/text/Text;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", - cancellable = true) - private void onRenderLabelIfPresent(T entity, Text text, - MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, - int i, CallbackInfo ci) - { - // add HealthTags info - if(entity instanceof LivingEntity) - text = WurstClient.INSTANCE.getHax().healthTagsHack - .addHealth((LivingEntity)entity, text); - - // do NameTags adjustments - wurstRenderLabelIfPresent(entity, text, matrixStack, - vertexConsumerProvider, i); - ci.cancel(); - } - - /** - * Copy of renderLabelIfPresent() since calling the original would result in - * an infinite loop. Also makes it easier to modify. - */ - protected void wurstRenderLabelIfPresent(T entity, Text text, - MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light) - { - NameTagsHack nameTags = WurstClient.INSTANCE.getHax().nameTagsHack; - - // disable distance limit if configured in NameTags - double distanceSq = dispatcher.getSquaredDistanceToCamera(entity); - if(distanceSq > 4096 && !nameTags.isUnlimitedRange()) - return; - - // disable sneaking changes if NameTags is enabled - boolean notSneaky = !entity.isSneaky() || nameTags.isEnabled(); - - float matrixY = entity.getHeight() + 0.5F; - int labelY = "deadmau5".equals(text.getString()) ? -10 : 0; - - matrices.push(); - matrices.translate(0, matrixY, 0); - matrices.multiply(dispatcher.getRotation()); - - // adjust scale if NameTags is enabled - float scale = 0.025F; - if(nameTags.isEnabled()) - { - double distance = WurstClient.MC.player.distanceTo(entity); - if(distance > 10) - scale *= distance / 10; - } - matrices.scale(-scale, -scale, scale); - - Matrix4f matrix = matrices.peek().getPositionMatrix(); - float bgOpacity = - WurstClient.MC.options.getTextBackgroundOpacity(0.25F); - int bgColor = (int)(bgOpacity * 255F) << 24; - TextRenderer tr = getTextRenderer(); - float labelX = -tr.getWidth(text) / 2; - - // draw background - tr.draw(text, labelX, labelY, 0x20FFFFFF, false, matrix, - vertexConsumers, - notSneaky ? TextLayerType.SEE_THROUGH : TextLayerType.NORMAL, - bgColor, light); - - // use the see-through layer for text if configured in NameTags - TextLayerType textLayer = nameTags.isSeeThrough() - ? TextLayerType.SEE_THROUGH : TextLayerType.NORMAL; - - // draw text - if(notSneaky) - tr.draw(text, labelX, labelY, 0xFFFFFFFF, false, matrix, - vertexConsumers, textLayer, 0, light); - - matrices.pop(); - } - - @Shadow - public abstract TextRenderer getTextRenderer(); -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.joml.Matrix4f; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.minecraft.client.font.TextRenderer; +import net.minecraft.client.font.TextRenderer.TextLayerType; +import net.minecraft.client.render.VertexConsumerProvider; +import net.minecraft.client.render.entity.EntityRenderDispatcher; +import net.minecraft.client.render.entity.EntityRenderer; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.entity.Entity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.text.Text; +import net.wurstclient.WurstClient; +import net.wurstclient.hacks.NameTagsHack; + +@Mixin(EntityRenderer.class) +public abstract class EntityRendererMixin +{ + @Shadow + @Final + protected EntityRenderDispatcher dispatcher; + + @Inject(at = @At("HEAD"), + method = "renderLabelIfPresent(Lnet/minecraft/entity/Entity;Lnet/minecraft/text/Text;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", + cancellable = true) + private void onRenderLabelIfPresent(T entity, Text text, + MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, + int i, CallbackInfo ci) + { + // add HealthTags info + if(entity instanceof LivingEntity) + text = WurstClient.INSTANCE.getHax().healthTagsHack + .addHealth((LivingEntity)entity, text); + + // do NameTags adjustments + wurstRenderLabelIfPresent(entity, text, matrixStack, + vertexConsumerProvider, i); + ci.cancel(); + } + + /** + * Copy of renderLabelIfPresent() since calling the original would result in + * an infinite loop. Also makes it easier to modify. + */ + protected void wurstRenderLabelIfPresent(T entity, Text text, + MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light) + { + NameTagsHack nameTags = WurstClient.INSTANCE.getHax().nameTagsHack; + + // disable distance limit if configured in NameTags + double distanceSq = dispatcher.getSquaredDistanceToCamera(entity); + if(distanceSq > 4096 && !nameTags.isUnlimitedRange()) + return; + + // disable sneaking changes if NameTags is enabled + boolean notSneaky = !entity.isSneaky() || nameTags.isEnabled(); + + float matrixY = entity.getHeight() + 0.5F; + int labelY = "deadmau5".equals(text.getString()) ? -10 : 0; + + matrices.push(); + matrices.translate(0, matrixY, 0); + matrices.multiply(dispatcher.getRotation()); + + // adjust scale if NameTags is enabled + float scale = 0.025F * nameTags.getScale(); + if(nameTags.isEnabled()) + { + double distance = WurstClient.MC.player.distanceTo(entity); + if(distance > 10) + scale *= distance / 10; + } + matrices.scale(-scale, -scale, scale); + + Matrix4f matrix = matrices.peek().getPositionMatrix(); + float bgOpacity = + WurstClient.MC.options.getTextBackgroundOpacity(0.25F); + int bgColor = (int)(bgOpacity * 255F) << 24; + TextRenderer tr = getTextRenderer(); + float labelX = -tr.getWidth(text) / 2; + + // adjust layers if using NameTags in see-through mode + TextLayerType bgLayer = notSneaky && !nameTags.isSeeThrough() + ? TextLayerType.SEE_THROUGH : TextLayerType.NORMAL; + TextLayerType textLayer = nameTags.isSeeThrough() + ? TextLayerType.SEE_THROUGH : TextLayerType.NORMAL; + + // draw background + tr.draw(text, labelX, labelY, 0x20FFFFFF, false, matrix, + vertexConsumers, bgLayer, bgColor, light); + + // draw text + if(notSneaky) + tr.draw(text, labelX, labelY, 0xFFFFFFFF, false, matrix, + vertexConsumers, textLayer, 0, light); + + matrices.pop(); + } + + @Shadow + public abstract TextRenderer getTextRenderer(); +} diff --git a/src/main/java/net/wurstclient/mixin/FluidRendererMixin.java b/src/main/java/net/wurstclient/mixin/FluidRendererMixin.java index ce119c44..1d80e0fd 100644 --- a/src/main/java/net/wurstclient/mixin/FluidRendererMixin.java +++ b/src/main/java/net/wurstclient/mixin/FluidRendererMixin.java @@ -1,44 +1,44 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import net.minecraft.block.BlockState; -import net.minecraft.client.render.block.FluidRenderer; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.world.BlockView; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.ShouldDrawSideListener.ShouldDrawSideEvent; - -@Mixin(FluidRenderer.class) -public class FluidRendererMixin -{ - /** - * This mixin hides and shows fluids when using X-Ray without Sodium - * installed. - */ - @Inject(at = @At("HEAD"), - method = "isSideCovered(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;FLnet/minecraft/block/BlockState;)Z", - cancellable = true) - private static void onIsSideCovered(BlockView world, BlockPos pos, - Direction side, float maxDeviation, BlockState neighboringBlockState, - CallbackInfoReturnable cir) - { - BlockState state = world.getBlockState(pos); - ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, pos); - EventManager.fire(event); - - if(event.isRendered() != null) - cir.setReturnValue(!event.isRendered()); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.block.BlockState; +import net.minecraft.client.render.block.FluidRenderer; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.BlockView; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.ShouldDrawSideListener.ShouldDrawSideEvent; + +@Mixin(FluidRenderer.class) +public class FluidRendererMixin +{ + /** + * This mixin hides and shows fluids when using X-Ray without Sodium + * installed. + */ + @Inject(at = @At("HEAD"), + method = "isSideCovered(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;FLnet/minecraft/block/BlockState;)Z", + cancellable = true) + private static void onIsSideCovered(BlockView world, BlockPos pos, + Direction side, float maxDeviation, BlockState neighboringBlockState, + CallbackInfoReturnable cir) + { + BlockState state = world.getBlockState(pos); + ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, pos); + EventManager.fire(event); + + if(event.isRendered() != null) + cir.setReturnValue(!event.isRendered()); + } +} diff --git a/src/main/java/net/wurstclient/mixin/GameMenuScreenMixin.java b/src/main/java/net/wurstclient/mixin/GameMenuScreenMixin.java index 8a8bddb1..19797948 100644 --- a/src/main/java/net/wurstclient/mixin/GameMenuScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/GameMenuScreenMixin.java @@ -1,138 +1,138 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import java.util.List; - -import org.lwjgl.opengl.GL11; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import com.mojang.blaze3d.systems.RenderSystem; - -import net.fabricmc.fabric.api.client.screen.v1.Screens; -import net.minecraft.client.gui.DrawContext; -import net.minecraft.client.gui.screen.GameMenuScreen; -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.widget.ButtonWidget; -import net.minecraft.client.gui.widget.ClickableWidget; -import net.minecraft.client.resource.language.I18n; -import net.minecraft.text.Text; -import net.minecraft.util.Identifier; -import net.minecraft.util.crash.CrashException; -import net.minecraft.util.crash.CrashReport; -import net.wurstclient.WurstClient; -import net.wurstclient.options.WurstOptionsScreen; - -@Mixin(GameMenuScreen.class) -public abstract class GameMenuScreenMixin extends Screen -{ - private static final Identifier WURST_TEXTURE = - new Identifier("wurst", "wurst_128.png"); - - private ButtonWidget wurstOptionsButton; - - private GameMenuScreenMixin(WurstClient wurst, Text title) - { - super(title); - } - - @Inject(at = @At("TAIL"), method = "initWidgets()V") - private void onInitWidgets(CallbackInfo ci) - { - if(!WurstClient.INSTANCE.isEnabled()) - return; - - addWurstOptionsButton(); - } - - @Inject(at = @At("TAIL"), - method = "render(Lnet/minecraft/client/gui/DrawContext;IIF)V") - private void onRender(DrawContext context, int mouseX, int mouseY, - float partialTicks, CallbackInfo ci) - { - if(!WurstClient.INSTANCE.isEnabled() || wurstOptionsButton == null) - return; - - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_DEPTH_TEST); - GL11.glDepthMask(false); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - RenderSystem.setShaderColor(1, 1, 1, 1); - - int x = wurstOptionsButton.getX() + 34; - int y = wurstOptionsButton.getY() + 2; - int w = 63; - int h = 16; - int fw = 63; - int fh = 16; - float u = 0; - float v = 0; - context.drawTexture(WURST_TEXTURE, x, y, u, v, w, h, fw, fh); - } - - private void addWurstOptionsButton() - { - List buttons = Screens.getButtons(this); - - int buttonY = -1; - int buttonI = -1; - - for(int i = 0; i < buttons.size(); i++) - { - ClickableWidget button = buttons.get(i); - - // insert Wurst button in place of feedback/report row - if(isFeedbackButton(button)) - { - buttonY = button.getY(); - buttonI = i; - } - - // make feedback/report buttons invisible - // (removing them completely would break ModMenu) - if(isFeedbackButton(button) || isBugReportButton(button)) - button.visible = false; - } - - if(buttonY == -1 || buttonI == -1) - throw new CrashException( - CrashReport.create(new IllegalStateException(), - "Someone deleted the Feedback button!")); - - wurstOptionsButton = ButtonWidget - .builder(Text.literal(" Options"), - b -> openWurstOptions()) - .dimensions(width / 2 - 102, buttonY, 204, 20).build(); - buttons.add(wurstOptionsButton); - } - - private void openWurstOptions() - { - client.setScreen(new WurstOptionsScreen(this)); - } - - private boolean isFeedbackButton(ClickableWidget button) - { - return hasTrKey(button, "menu.sendFeedback"); - } - - private boolean isBugReportButton(ClickableWidget button) - { - return hasTrKey(button, "menu.reportBugs"); - } - - private boolean hasTrKey(ClickableWidget button, String key) - { - String message = button.getMessage().getString(); - return message != null && message.equals(I18n.translate(key)); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import java.util.List; + +import org.lwjgl.opengl.GL11; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import com.mojang.blaze3d.systems.RenderSystem; + +import net.fabricmc.fabric.api.client.screen.v1.Screens; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.screen.GameMenuScreen; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.client.gui.widget.ClickableWidget; +import net.minecraft.client.resource.language.I18n; +import net.minecraft.text.Text; +import net.minecraft.util.Identifier; +import net.minecraft.util.crash.CrashException; +import net.minecraft.util.crash.CrashReport; +import net.wurstclient.WurstClient; +import net.wurstclient.options.WurstOptionsScreen; + +@Mixin(GameMenuScreen.class) +public abstract class GameMenuScreenMixin extends Screen +{ + private static final Identifier WURST_TEXTURE = + new Identifier("wurst", "wurst_128.png"); + + private ButtonWidget wurstOptionsButton; + + private GameMenuScreenMixin(WurstClient wurst, Text title) + { + super(title); + } + + @Inject(at = @At("TAIL"), method = "initWidgets()V") + private void onInitWidgets(CallbackInfo ci) + { + if(!WurstClient.INSTANCE.isEnabled()) + return; + + addWurstOptionsButton(); + } + + @Inject(at = @At("TAIL"), + method = "render(Lnet/minecraft/client/gui/DrawContext;IIF)V") + private void onRender(DrawContext context, int mouseX, int mouseY, + float partialTicks, CallbackInfo ci) + { + if(!WurstClient.INSTANCE.isEnabled() || wurstOptionsButton == null) + return; + + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDepthMask(false); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + RenderSystem.setShaderColor(1, 1, 1, 1); + + int x = wurstOptionsButton.getX() + 34; + int y = wurstOptionsButton.getY() + 2; + int w = 63; + int h = 16; + int fw = 63; + int fh = 16; + float u = 0; + float v = 0; + context.drawTexture(WURST_TEXTURE, x, y, u, v, w, h, fw, fh); + } + + private void addWurstOptionsButton() + { + List buttons = Screens.getButtons(this); + + int buttonY = -1; + int buttonI = -1; + + for(int i = 0; i < buttons.size(); i++) + { + ClickableWidget button = buttons.get(i); + + // insert Wurst button in place of feedback/report row + if(isFeedbackButton(button)) + { + buttonY = button.getY(); + buttonI = i; + } + + // make feedback/report buttons invisible + // (removing them completely would break ModMenu) + if(isFeedbackButton(button) || isBugReportButton(button)) + button.visible = false; + } + + if(buttonY == -1 || buttonI == -1) + throw new CrashException( + CrashReport.create(new IllegalStateException(), + "Someone deleted the Feedback button!")); + + wurstOptionsButton = ButtonWidget + .builder(Text.literal(" Options"), + b -> openWurstOptions()) + .dimensions(width / 2 - 102, buttonY, 204, 20).build(); + buttons.add(wurstOptionsButton); + } + + private void openWurstOptions() + { + client.setScreen(new WurstOptionsScreen(this)); + } + + private boolean isFeedbackButton(ClickableWidget button) + { + return hasTrKey(button, "menu.sendFeedback"); + } + + private boolean isBugReportButton(ClickableWidget button) + { + return hasTrKey(button, "menu.reportBugs"); + } + + private boolean hasTrKey(ClickableWidget button, String key) + { + String message = button.getMessage().getString(); + return message != null && message.equals(I18n.translate(key)); + } +} diff --git a/src/main/java/net/wurstclient/mixin/GameRendererMixin.java b/src/main/java/net/wurstclient/mixin/GameRendererMixin.java index 7171764c..f363dfdc 100644 --- a/src/main/java/net/wurstclient/mixin/GameRendererMixin.java +++ b/src/main/java/net/wurstclient/mixin/GameRendererMixin.java @@ -1,152 +1,152 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.objectweb.asm.Opcodes; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.Redirect; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import net.minecraft.client.render.Camera; -import net.minecraft.client.render.GameRenderer; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.entity.LivingEntity; -import net.minecraft.util.math.MathHelper; -import net.wurstclient.WurstClient; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.CameraTransformViewBobbingListener.CameraTransformViewBobbingEvent; -import net.wurstclient.events.HitResultRayTraceListener.HitResultRayTraceEvent; -import net.wurstclient.events.RenderListener.RenderEvent; -import net.wurstclient.hacks.FullbrightHack; - -@Mixin(GameRenderer.class) -public abstract class GameRendererMixin implements AutoCloseable -{ - private boolean cancelNextBobView; - - /** - * Fires the CameraTransformViewBobbingEvent event and records whether the - * next view-bobbing call should be cancelled. - */ - @Inject(at = @At(value = "INVOKE", - target = "Lnet/minecraft/client/render/GameRenderer;bobView(Lnet/minecraft/client/util/math/MatrixStack;F)V", - ordinal = 0), - method = "renderWorld(FJLnet/minecraft/client/util/math/MatrixStack;)V") - private void onRenderWorldViewBobbing(float tickDelta, long limitTime, - MatrixStack matrices, CallbackInfo ci) - { - CameraTransformViewBobbingEvent event = - new CameraTransformViewBobbingEvent(); - EventManager.fire(event); - - if(event.isCancelled()) - cancelNextBobView = true; - } - - /** - * Cancels the view-bobbing call if requested by the last - * CameraTransformViewBobbingEvent. - */ - @Inject(at = @At("HEAD"), - method = "bobView(Lnet/minecraft/client/util/math/MatrixStack;F)V", - cancellable = true) - private void onBobView(MatrixStack matrices, float tickDelta, - CallbackInfo ci) - { - if(!cancelNextBobView) - return; - - ci.cancel(); - cancelNextBobView = false; - } - - /** - * This mixin is injected into a random method call later in the - * renderWorld() method to ensure that cancelNextBobView is always reset - * after the view-bobbing call. - */ - @Inject(at = @At("HEAD"), - method = "renderHand(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/Camera;F)V") - private void onRenderHand(MatrixStack matrices, Camera camera, - float tickDelta, CallbackInfo ci) - { - cancelNextBobView = false; - } - - @Inject( - at = @At(value = "FIELD", - target = "Lnet/minecraft/client/render/GameRenderer;renderHand:Z", - opcode = Opcodes.GETFIELD, - ordinal = 0), - method = "renderWorld(FJLnet/minecraft/client/util/math/MatrixStack;)V") - private void onRenderWorld(float tickDelta, long limitTime, - MatrixStack matrices, CallbackInfo ci) - { - RenderEvent event = new RenderEvent(matrices, tickDelta); - EventManager.fire(event); - } - - @Inject(at = @At(value = "RETURN", ordinal = 1), - method = "getFov(Lnet/minecraft/client/render/Camera;FZ)D", - cancellable = true) - private void onGetFov(Camera camera, float tickDelta, boolean changingFov, - CallbackInfoReturnable cir) - { - cir.setReturnValue(WurstClient.INSTANCE.getOtfs().zoomOtf - .changeFovBasedOnZoom(cir.getReturnValueD())); - } - - @Inject(at = @At(value = "INVOKE", - target = "Lnet/minecraft/entity/Entity;getCameraPosVec(F)Lnet/minecraft/util/math/Vec3d;", - opcode = Opcodes.INVOKEVIRTUAL, - ordinal = 0), method = "updateTargetedEntity(F)V") - private void onHitResultRayTrace(float tickDelta, CallbackInfo ci) - { - HitResultRayTraceEvent event = new HitResultRayTraceEvent(tickDelta); - EventManager.fire(event); - } - - @Redirect( - at = @At(value = "INVOKE", - target = "Lnet/minecraft/util/math/MathHelper;lerp(FFF)F", - ordinal = 0), - method = "renderWorld(FJLnet/minecraft/client/util/math/MatrixStack;)V") - private float wurstNauseaLerp(float delta, float start, float end) - { - if(!WurstClient.INSTANCE.getHax().antiWobbleHack.isEnabled()) - return MathHelper.lerp(delta, start, end); - - return 0; - } - - @Inject(at = @At("HEAD"), - method = "getNightVisionStrength(Lnet/minecraft/entity/LivingEntity;F)F", - cancellable = true) - private static void onGetNightVisionStrength(LivingEntity entity, - float tickDelta, CallbackInfoReturnable cir) - { - FullbrightHack fullbright = - WurstClient.INSTANCE.getHax().fullbrightHack; - - if(fullbright.isNightVisionActive()) - cir.setReturnValue(fullbright.getNightVisionStrength()); - } - - @Inject(at = @At("HEAD"), - method = "tiltViewWhenHurt(Lnet/minecraft/client/util/math/MatrixStack;F)V", - cancellable = true) - private void onTiltViewWhenHurt(MatrixStack matrices, float tickDelta, - CallbackInfo ci) - { - if(WurstClient.INSTANCE.getHax().noHurtcamHack.isEnabled()) - ci.cancel(); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.objectweb.asm.Opcodes; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.Redirect; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.client.render.Camera; +import net.minecraft.client.render.GameRenderer; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.entity.LivingEntity; +import net.minecraft.util.math.MathHelper; +import net.wurstclient.WurstClient; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.CameraTransformViewBobbingListener.CameraTransformViewBobbingEvent; +import net.wurstclient.events.HitResultRayTraceListener.HitResultRayTraceEvent; +import net.wurstclient.events.RenderListener.RenderEvent; +import net.wurstclient.hacks.FullbrightHack; + +@Mixin(GameRenderer.class) +public abstract class GameRendererMixin implements AutoCloseable +{ + private boolean cancelNextBobView; + + /** + * Fires the CameraTransformViewBobbingEvent event and records whether the + * next view-bobbing call should be cancelled. + */ + @Inject(at = @At(value = "INVOKE", + target = "Lnet/minecraft/client/render/GameRenderer;bobView(Lnet/minecraft/client/util/math/MatrixStack;F)V", + ordinal = 0), + method = "renderWorld(FJLnet/minecraft/client/util/math/MatrixStack;)V") + private void onRenderWorldViewBobbing(float tickDelta, long limitTime, + MatrixStack matrices, CallbackInfo ci) + { + CameraTransformViewBobbingEvent event = + new CameraTransformViewBobbingEvent(); + EventManager.fire(event); + + if(event.isCancelled()) + cancelNextBobView = true; + } + + /** + * Cancels the view-bobbing call if requested by the last + * CameraTransformViewBobbingEvent. + */ + @Inject(at = @At("HEAD"), + method = "bobView(Lnet/minecraft/client/util/math/MatrixStack;F)V", + cancellable = true) + private void onBobView(MatrixStack matrices, float tickDelta, + CallbackInfo ci) + { + if(!cancelNextBobView) + return; + + ci.cancel(); + cancelNextBobView = false; + } + + /** + * This mixin is injected into a random method call later in the + * renderWorld() method to ensure that cancelNextBobView is always reset + * after the view-bobbing call. + */ + @Inject(at = @At("HEAD"), + method = "renderHand(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/Camera;F)V") + private void onRenderHand(MatrixStack matrices, Camera camera, + float tickDelta, CallbackInfo ci) + { + cancelNextBobView = false; + } + + @Inject( + at = @At(value = "FIELD", + target = "Lnet/minecraft/client/render/GameRenderer;renderHand:Z", + opcode = Opcodes.GETFIELD, + ordinal = 0), + method = "renderWorld(FJLnet/minecraft/client/util/math/MatrixStack;)V") + private void onRenderWorld(float tickDelta, long limitTime, + MatrixStack matrices, CallbackInfo ci) + { + RenderEvent event = new RenderEvent(matrices, tickDelta); + EventManager.fire(event); + } + + @Inject(at = @At(value = "RETURN", ordinal = 1), + method = "getFov(Lnet/minecraft/client/render/Camera;FZ)D", + cancellable = true) + private void onGetFov(Camera camera, float tickDelta, boolean changingFov, + CallbackInfoReturnable cir) + { + cir.setReturnValue(WurstClient.INSTANCE.getOtfs().zoomOtf + .changeFovBasedOnZoom(cir.getReturnValueD())); + } + + @Inject(at = @At(value = "INVOKE", + target = "Lnet/minecraft/entity/Entity;getCameraPosVec(F)Lnet/minecraft/util/math/Vec3d;", + opcode = Opcodes.INVOKEVIRTUAL, + ordinal = 0), method = "updateTargetedEntity(F)V") + private void onHitResultRayTrace(float tickDelta, CallbackInfo ci) + { + HitResultRayTraceEvent event = new HitResultRayTraceEvent(tickDelta); + EventManager.fire(event); + } + + @Redirect( + at = @At(value = "INVOKE", + target = "Lnet/minecraft/util/math/MathHelper;lerp(FFF)F", + ordinal = 0), + method = "renderWorld(FJLnet/minecraft/client/util/math/MatrixStack;)V") + private float wurstNauseaLerp(float delta, float start, float end) + { + if(!WurstClient.INSTANCE.getHax().antiWobbleHack.isEnabled()) + return MathHelper.lerp(delta, start, end); + + return 0; + } + + @Inject(at = @At("HEAD"), + method = "getNightVisionStrength(Lnet/minecraft/entity/LivingEntity;F)F", + cancellable = true) + private static void onGetNightVisionStrength(LivingEntity entity, + float tickDelta, CallbackInfoReturnable cir) + { + FullbrightHack fullbright = + WurstClient.INSTANCE.getHax().fullbrightHack; + + if(fullbright.isNightVisionActive()) + cir.setReturnValue(fullbright.getNightVisionStrength()); + } + + @Inject(at = @At("HEAD"), + method = "tiltViewWhenHurt(Lnet/minecraft/client/util/math/MatrixStack;F)V", + cancellable = true) + private void onTiltViewWhenHurt(MatrixStack matrices, float tickDelta, + CallbackInfo ci) + { + if(WurstClient.INSTANCE.getHax().noHurtcamHack.isEnabled()) + ci.cancel(); + } +} diff --git a/src/main/java/net/wurstclient/mixin/GenericContainerScreenMixin.java b/src/main/java/net/wurstclient/mixin/GenericContainerScreenMixin.java index 4ef08b15..92c79cb8 100644 --- a/src/main/java/net/wurstclient/mixin/GenericContainerScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/GenericContainerScreenMixin.java @@ -1,122 +1,122 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; - -import net.minecraft.client.gui.screen.ingame.GenericContainerScreen; -import net.minecraft.client.gui.screen.ingame.HandledScreen; -import net.minecraft.client.gui.screen.ingame.ScreenHandlerProvider; -import net.minecraft.client.gui.widget.ButtonWidget; -import net.minecraft.entity.player.PlayerInventory; -import net.minecraft.screen.GenericContainerScreenHandler; -import net.minecraft.screen.slot.Slot; -import net.minecraft.screen.slot.SlotActionType; -import net.minecraft.text.Text; -import net.wurstclient.WurstClient; -import net.wurstclient.hacks.AutoStealHack; - -@Mixin(GenericContainerScreen.class) -public abstract class GenericContainerScreenMixin - extends HandledScreen - implements ScreenHandlerProvider -{ - @Shadow - @Final - private int rows; - - private final AutoStealHack autoSteal = - WurstClient.INSTANCE.getHax().autoStealHack; - private int mode; - - public GenericContainerScreenMixin(WurstClient wurst, - GenericContainerScreenHandler container, - PlayerInventory playerInventory, Text name) - { - super(container, playerInventory, name); - } - - @Override - protected void init() - { - super.init(); - - if(!WurstClient.INSTANCE.isEnabled()) - return; - - if(autoSteal.areButtonsVisible()) - { - addDrawableChild(ButtonWidget - .builder(Text.literal("Steal"), b -> steal()) - .dimensions(x + backgroundWidth - 108, y + 4, 50, 12).build()); - - addDrawableChild(ButtonWidget - .builder(Text.literal("Store"), b -> store()) - .dimensions(x + backgroundWidth - 56, y + 4, 50, 12).build()); - } - - if(autoSteal.isEnabled()) - steal(); - } - - private void steal() - { - runInThread(() -> shiftClickSlots(0, rows * 9, 1)); - } - - private void store() - { - runInThread(() -> shiftClickSlots(rows * 9, rows * 9 + 44, 2)); - } - - private void runInThread(Runnable r) - { - new Thread(() -> { - try - { - r.run(); - - }catch(Exception e) - { - e.printStackTrace(); - } - }).start(); - } - - private void shiftClickSlots(int from, int to, int mode) - { - this.mode = mode; - - for(int i = from; i < to; i++) - { - Slot slot = handler.slots.get(i); - if(slot.getStack().isEmpty()) - continue; - - waitForDelay(); - if(this.mode != mode || client.currentScreen == null) - break; - - onMouseClick(slot, slot.id, 0, SlotActionType.QUICK_MOVE); - } - } - - private void waitForDelay() - { - try - { - Thread.sleep(autoSteal.getDelay()); - - }catch(InterruptedException e) - { - throw new RuntimeException(e); - } - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; + +import net.minecraft.client.gui.screen.ingame.GenericContainerScreen; +import net.minecraft.client.gui.screen.ingame.HandledScreen; +import net.minecraft.client.gui.screen.ingame.ScreenHandlerProvider; +import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.screen.GenericContainerScreenHandler; +import net.minecraft.screen.slot.Slot; +import net.minecraft.screen.slot.SlotActionType; +import net.minecraft.text.Text; +import net.wurstclient.WurstClient; +import net.wurstclient.hacks.AutoStealHack; + +@Mixin(GenericContainerScreen.class) +public abstract class GenericContainerScreenMixin + extends HandledScreen + implements ScreenHandlerProvider +{ + @Shadow + @Final + private int rows; + + private final AutoStealHack autoSteal = + WurstClient.INSTANCE.getHax().autoStealHack; + private int mode; + + public GenericContainerScreenMixin(WurstClient wurst, + GenericContainerScreenHandler container, + PlayerInventory playerInventory, Text name) + { + super(container, playerInventory, name); + } + + @Override + protected void init() + { + super.init(); + + if(!WurstClient.INSTANCE.isEnabled()) + return; + + if(autoSteal.areButtonsVisible()) + { + addDrawableChild(ButtonWidget + .builder(Text.literal("Steal"), b -> steal()) + .dimensions(x + backgroundWidth - 108, y + 4, 50, 12).build()); + + addDrawableChild(ButtonWidget + .builder(Text.literal("Store"), b -> store()) + .dimensions(x + backgroundWidth - 56, y + 4, 50, 12).build()); + } + + if(autoSteal.isEnabled()) + steal(); + } + + private void steal() + { + runInThread(() -> shiftClickSlots(0, rows * 9, 1)); + } + + private void store() + { + runInThread(() -> shiftClickSlots(rows * 9, rows * 9 + 44, 2)); + } + + private void runInThread(Runnable r) + { + new Thread(() -> { + try + { + r.run(); + + }catch(Exception e) + { + e.printStackTrace(); + } + }).start(); + } + + private void shiftClickSlots(int from, int to, int mode) + { + this.mode = mode; + + for(int i = from; i < to; i++) + { + Slot slot = handler.slots.get(i); + if(slot.getStack().isEmpty()) + continue; + + waitForDelay(); + if(this.mode != mode || client.currentScreen == null) + break; + + onMouseClick(slot, slot.id, 0, SlotActionType.QUICK_MOVE); + } + } + + private void waitForDelay() + { + try + { + Thread.sleep(autoSteal.getDelay()); + + }catch(InterruptedException e) + { + throw new RuntimeException(e); + } + } +} diff --git a/src/main/java/net/wurstclient/mixin/HeldItemRendererMixin.java b/src/main/java/net/wurstclient/mixin/HeldItemRendererMixin.java index 3dec779d..5831af94 100644 --- a/src/main/java/net/wurstclient/mixin/HeldItemRendererMixin.java +++ b/src/main/java/net/wurstclient/mixin/HeldItemRendererMixin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/mixin/InGameOverlayRendererMixin.java b/src/main/java/net/wurstclient/mixin/InGameOverlayRendererMixin.java index 20cd33bc..e30f0c87 100644 --- a/src/main/java/net/wurstclient/mixin/InGameOverlayRendererMixin.java +++ b/src/main/java/net/wurstclient/mixin/InGameOverlayRendererMixin.java @@ -1,43 +1,43 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Constant; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.ModifyConstant; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.gui.hud.InGameOverlayRenderer; -import net.minecraft.client.util.math.MatrixStack; -import net.wurstclient.WurstClient; - -@Mixin(InGameOverlayRenderer.class) -public class InGameOverlayRendererMixin -{ - @ModifyConstant( - method = "renderFireOverlay(Lnet/minecraft/client/MinecraftClient;Lnet/minecraft/client/util/math/MatrixStack;)V", - constant = @Constant(floatValue = -0.3F)) - private static float getFireOffset(float original) - { - return original - WurstClient.INSTANCE.getHax().noFireOverlayHack - .getOverlayOffset(); - } - - @Inject(at = @At("HEAD"), - method = "renderUnderwaterOverlay(Lnet/minecraft/client/MinecraftClient;Lnet/minecraft/client/util/math/MatrixStack;)V", - cancellable = true) - private static void onRenderUnderwaterOverlay(MinecraftClient client, - MatrixStack matrices, CallbackInfo ci) - { - if(WurstClient.INSTANCE.getHax().noOverlayHack.isEnabled()) - ci.cancel(); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.ModifyConstant; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.hud.InGameOverlayRenderer; +import net.minecraft.client.util.math.MatrixStack; +import net.wurstclient.WurstClient; + +@Mixin(InGameOverlayRenderer.class) +public class InGameOverlayRendererMixin +{ + @ModifyConstant( + method = "renderFireOverlay(Lnet/minecraft/client/MinecraftClient;Lnet/minecraft/client/util/math/MatrixStack;)V", + constant = @Constant(floatValue = -0.3F)) + private static float getFireOffset(float original) + { + return original - WurstClient.INSTANCE.getHax().noFireOverlayHack + .getOverlayOffset(); + } + + @Inject(at = @At("HEAD"), + method = "renderUnderwaterOverlay(Lnet/minecraft/client/MinecraftClient;Lnet/minecraft/client/util/math/MatrixStack;)V", + cancellable = true) + private static void onRenderUnderwaterOverlay(MinecraftClient client, + MatrixStack matrices, CallbackInfo ci) + { + if(WurstClient.INSTANCE.getHax().noOverlayHack.isEnabled()) + ci.cancel(); + } +} diff --git a/src/main/java/net/wurstclient/mixin/IngameHudMixin.java b/src/main/java/net/wurstclient/mixin/IngameHudMixin.java index 1ad14ac1..23d67331 100644 --- a/src/main/java/net/wurstclient/mixin/IngameHudMixin.java +++ b/src/main/java/net/wurstclient/mixin/IngameHudMixin.java @@ -1,52 +1,52 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import net.minecraft.client.gui.DrawContext; -import net.minecraft.client.gui.hud.InGameHud; -import net.minecraft.util.Identifier; -import net.wurstclient.WurstClient; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.GUIRenderListener.GUIRenderEvent; - -@Mixin(InGameHud.class) -public class IngameHudMixin -{ - @Inject( - at = @At(value = "INVOKE", - target = "Lcom/mojang/blaze3d/systems/RenderSystem;enableBlend()V", - remap = false, - ordinal = 3), - method = "render(Lnet/minecraft/client/gui/DrawContext;F)V") - private void onRender(DrawContext context, float tickDelta, CallbackInfo ci) - { - if(WurstClient.MC.options.debugEnabled) - return; - - EventManager.fire(new GUIRenderEvent(context, tickDelta)); - } - - @Inject(at = @At("HEAD"), - method = "renderOverlay(Lnet/minecraft/client/gui/DrawContext;Lnet/minecraft/util/Identifier;F)V", - cancellable = true) - private void onRenderOverlay(DrawContext context, Identifier texture, - float opacity, CallbackInfo ci) - { - if(texture == null - || !"textures/misc/pumpkinblur.png".equals(texture.getPath())) - return; - - if(WurstClient.INSTANCE.getHax().noPumpkinHack.isEnabled()) - ci.cancel(); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.hud.InGameHud; +import net.minecraft.util.Identifier; +import net.wurstclient.WurstClient; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.GUIRenderListener.GUIRenderEvent; + +@Mixin(InGameHud.class) +public class IngameHudMixin +{ + @Inject( + at = @At(value = "INVOKE", + target = "Lcom/mojang/blaze3d/systems/RenderSystem;enableBlend()V", + remap = false, + ordinal = 3), + method = "render(Lnet/minecraft/client/gui/DrawContext;F)V") + private void onRender(DrawContext context, float tickDelta, CallbackInfo ci) + { + if(WurstClient.MC.options.debugEnabled) + return; + + EventManager.fire(new GUIRenderEvent(context, tickDelta)); + } + + @Inject(at = @At("HEAD"), + method = "renderOverlay(Lnet/minecraft/client/gui/DrawContext;Lnet/minecraft/util/Identifier;F)V", + cancellable = true) + private void onRenderOverlay(DrawContext context, Identifier texture, + float opacity, CallbackInfo ci) + { + if(texture == null + || !"textures/misc/pumpkinblur.png".equals(texture.getPath())) + return; + + if(WurstClient.INSTANCE.getHax().noPumpkinHack.isEnabled()) + ci.cancel(); + } +} diff --git a/src/main/java/net/wurstclient/mixin/KeyBindingMixin.java b/src/main/java/net/wurstclient/mixin/KeyBindingMixin.java index 23d994d9..6c3731a2 100644 --- a/src/main/java/net/wurstclient/mixin/KeyBindingMixin.java +++ b/src/main/java/net/wurstclient/mixin/KeyBindingMixin.java @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; - -import net.minecraft.client.option.KeyBinding; -import net.minecraft.client.util.InputUtil; -import net.wurstclient.WurstClient; -import net.wurstclient.mixinterface.IKeyBinding; - -@Mixin(KeyBinding.class) -public abstract class KeyBindingMixin implements IKeyBinding -{ - @Shadow - private InputUtil.Key boundKey; - - @Override - public boolean isActallyPressed() - { - long handle = WurstClient.MC.getWindow().getHandle(); - int code = boundKey.getCode(); - return InputUtil.isKeyPressed(handle, code); - } - - @Override - public void resetPressedState() - { - setPressed(isActallyPressed()); - } - - @Shadow - public abstract void setPressed(boolean pressed); -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; + +import net.minecraft.client.option.KeyBinding; +import net.minecraft.client.util.InputUtil; +import net.wurstclient.WurstClient; +import net.wurstclient.mixinterface.IKeyBinding; + +@Mixin(KeyBinding.class) +public abstract class KeyBindingMixin implements IKeyBinding +{ + @Shadow + private InputUtil.Key boundKey; + + @Override + public boolean isActallyPressed() + { + long handle = WurstClient.MC.getWindow().getHandle(); + int code = boundKey.getCode(); + return InputUtil.isKeyPressed(handle, code); + } + + @Override + public void resetPressedState() + { + setPressed(isActallyPressed()); + } + + @Shadow + public abstract void setPressed(boolean pressed); +} diff --git a/src/main/java/net/wurstclient/mixin/KeyboardMixin.java b/src/main/java/net/wurstclient/mixin/KeyboardMixin.java index 9ab6a055..6b7f9cff 100644 --- a/src/main/java/net/wurstclient/mixin/KeyboardMixin.java +++ b/src/main/java/net/wurstclient/mixin/KeyboardMixin.java @@ -1,28 +1,28 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import net.minecraft.client.Keyboard; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.KeyPressListener.KeyPressEvent; - -@Mixin(Keyboard.class) -public class KeyboardMixin -{ - @Inject(at = @At("HEAD"), method = "onKey(JIIII)V") - private void onOnKey(long windowHandle, int key, int scancode, int action, - int modifiers, CallbackInfo ci) - { - EventManager.fire(new KeyPressEvent(key, scancode, action, modifiers)); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.minecraft.client.Keyboard; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.KeyPressListener.KeyPressEvent; + +@Mixin(Keyboard.class) +public class KeyboardMixin +{ + @Inject(at = @At("HEAD"), method = "onKey(JIIII)V") + private void onOnKey(long windowHandle, int key, int scancode, int action, + int modifiers, CallbackInfo ci) + { + EventManager.fire(new KeyPressEvent(key, scancode, action, modifiers)); + } +} diff --git a/src/main/java/net/wurstclient/mixin/LanguageManagerMixin.java b/src/main/java/net/wurstclient/mixin/LanguageManagerMixin.java index 5a5471b1..42f486fc 100644 --- a/src/main/java/net/wurstclient/mixin/LanguageManagerMixin.java +++ b/src/main/java/net/wurstclient/mixin/LanguageManagerMixin.java @@ -1,42 +1,42 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import com.google.common.collect.Lists; - -import net.minecraft.client.resource.language.LanguageManager; -import net.minecraft.client.resource.language.TranslationStorage; -import net.minecraft.resource.ResourceManager; -import net.minecraft.resource.SynchronousResourceReloader; -import net.wurstclient.mixinterface.ILanguageManager; - -@Mixin(LanguageManager.class) -public abstract class LanguageManagerMixin - implements SynchronousResourceReloader, ILanguageManager -{ - private TranslationStorage wurstEnglish; - - @Inject(at = @At("HEAD"), - method = "reload(Lnet/minecraft/resource/ResourceManager;)V") - private void onReload(ResourceManager manager, CallbackInfo ci) - { - wurstEnglish = TranslationStorage.load(manager, - Lists.newArrayList("en_us"), false); - } - - @Override - public TranslationStorage wurst_getEnglish() - { - return wurstEnglish; - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import com.google.common.collect.Lists; + +import net.minecraft.client.resource.language.LanguageManager; +import net.minecraft.client.resource.language.TranslationStorage; +import net.minecraft.resource.ResourceManager; +import net.minecraft.resource.SynchronousResourceReloader; +import net.wurstclient.mixinterface.ILanguageManager; + +@Mixin(LanguageManager.class) +public abstract class LanguageManagerMixin + implements SynchronousResourceReloader, ILanguageManager +{ + private TranslationStorage wurstEnglish; + + @Inject(at = @At("HEAD"), + method = "reload(Lnet/minecraft/resource/ResourceManager;)V") + private void onReload(ResourceManager manager, CallbackInfo ci) + { + wurstEnglish = TranslationStorage.load(manager, + Lists.newArrayList("en_us"), false); + } + + @Override + public TranslationStorage wurst_getEnglish() + { + return wurstEnglish; + } +} diff --git a/src/main/java/net/wurstclient/mixin/LivingEntityRendererMixin.java b/src/main/java/net/wurstclient/mixin/LivingEntityRendererMixin.java index 86e5b45e..24d05ff8 100644 --- a/src/main/java/net/wurstclient/mixin/LivingEntityRendererMixin.java +++ b/src/main/java/net/wurstclient/mixin/LivingEntityRendererMixin.java @@ -1,55 +1,56 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.Redirect; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import net.minecraft.client.render.entity.EntityRenderDispatcher; -import net.minecraft.client.render.entity.LivingEntityRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.LivingEntity; -import net.wurstclient.WurstClient; - -@Mixin(LivingEntityRenderer.class) -public abstract class LivingEntityRendererMixin -{ - /** - * Disables the distance limit in hasLabel() if configured in NameTags. - */ - @Redirect(at = @At(value = "INVOKE", - target = "Lnet/minecraft/client/render/entity/EntityRenderDispatcher;getSquaredDistanceToCamera(Lnet/minecraft/entity/Entity;)D", - ordinal = 0), method = "hasLabel(Lnet/minecraft/entity/LivingEntity;)Z") - private double adjustDistance(EntityRenderDispatcher render, Entity entity) - { - // pretend the distance is 1 so the check always passes - if(WurstClient.INSTANCE.getHax().nameTagsHack.isUnlimitedRange()) - return 1; - - return render.getSquaredDistanceToCamera(entity); - } - - /** - * Forces the nametag to be rendered if configured in NameTags. - */ - @Inject(at = @At(value = "INVOKE", - target = "Lnet/minecraft/client/MinecraftClient;getInstance()Lnet/minecraft/client/MinecraftClient;", - ordinal = 0), - method = "hasLabel(Lnet/minecraft/entity/LivingEntity;)Z", - cancellable = true) - private void shouldForceLabel(LivingEntity entity, - CallbackInfoReturnable cir) - { - // return true immediately after the distance check - if(WurstClient.INSTANCE.getHax().nameTagsHack.shouldForceNametags()) - cir.setReturnValue(true); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.Redirect; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.client.render.entity.EntityRenderDispatcher; +import net.minecraft.client.render.entity.LivingEntityRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.LivingEntity; +import net.wurstclient.WurstClient; + +@Mixin(LivingEntityRenderer.class) +public abstract class LivingEntityRendererMixin +{ + /** + * Disables the distance limit in hasLabel() if configured in NameTags. + */ + @Redirect(at = @At(value = "INVOKE", + target = "Lnet/minecraft/client/render/entity/EntityRenderDispatcher;getSquaredDistanceToCamera(Lnet/minecraft/entity/Entity;)D", + ordinal = 0), method = "hasLabel(Lnet/minecraft/entity/LivingEntity;)Z") + private double adjustDistance(EntityRenderDispatcher render, Entity entity) + { + // pretend the distance is 1 so the check always passes + if(WurstClient.INSTANCE.getHax().nameTagsHack.isUnlimitedRange()) + return 1; + + return render.getSquaredDistanceToCamera(entity); + } + + /** + * Forces the nametag to be rendered if configured in NameTags. + */ + @Inject(at = @At(value = "INVOKE", + target = "Lnet/minecraft/client/MinecraftClient;getInstance()Lnet/minecraft/client/MinecraftClient;", + ordinal = 0), + method = "hasLabel(Lnet/minecraft/entity/LivingEntity;)Z", + cancellable = true) + private void shouldForceLabel(LivingEntity entity, + CallbackInfoReturnable cir) + { + // return true immediately after the distance check + if(WurstClient.INSTANCE.getHax().nameTagsHack + .shouldForcePlayerNametags()) + cir.setReturnValue(true); + } +} diff --git a/src/main/java/net/wurstclient/mixin/MinecraftClientMixin.java b/src/main/java/net/wurstclient/mixin/MinecraftClientMixin.java index 7ab5aadc..cf929046 100644 --- a/src/main/java/net/wurstclient/mixin/MinecraftClientMixin.java +++ b/src/main/java/net/wurstclient/mixin/MinecraftClientMixin.java @@ -1,200 +1,200 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import java.io.File; -import java.util.UUID; - -import org.objectweb.asm.Opcodes; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.Redirect; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import com.mojang.authlib.exceptions.AuthenticationException; -import com.mojang.authlib.minecraft.UserApiService; -import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; - -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.WindowEventHandler; -import net.minecraft.client.network.ClientPlayerEntity; -import net.minecraft.client.network.ClientPlayerInteractionManager; -import net.minecraft.client.util.ProfileKeys; -import net.minecraft.client.util.ProfileKeysImpl; -import net.minecraft.client.util.Session; -import net.minecraft.util.hit.EntityHitResult; -import net.minecraft.util.hit.HitResult; -import net.minecraft.util.thread.ReentrantThreadExecutor; -import net.wurstclient.WurstClient; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.LeftClickListener.LeftClickEvent; -import net.wurstclient.events.RightClickListener.RightClickEvent; -import net.wurstclient.mixinterface.IClientPlayerEntity; -import net.wurstclient.mixinterface.IClientPlayerInteractionManager; -import net.wurstclient.mixinterface.IMinecraftClient; - -@Mixin(MinecraftClient.class) -public abstract class MinecraftClientMixin - extends ReentrantThreadExecutor - implements WindowEventHandler, IMinecraftClient -{ - @Shadow - @Final - public File runDirectory; - @Shadow - public ClientPlayerInteractionManager interactionManager; - @Shadow - public ClientPlayerEntity player; - @Shadow - @Final - private Session session; - @Shadow - @Final - private YggdrasilAuthenticationService authenticationService; - - private Session wurstSession; - private ProfileKeysImpl wurstProfileKeys; - - private MinecraftClientMixin(WurstClient wurst, String name) - { - super(name); - } - - @Inject(at = @At(value = "FIELD", - target = "Lnet/minecraft/client/MinecraftClient;crosshairTarget:Lnet/minecraft/util/hit/HitResult;", - ordinal = 0), method = "doAttack()Z", cancellable = true) - private void onDoAttack(CallbackInfoReturnable cir) - { - LeftClickEvent event = new LeftClickEvent(); - EventManager.fire(event); - - if(event.isCancelled()) - cir.setReturnValue(false); - } - - @Inject( - at = @At(value = "FIELD", - target = "Lnet/minecraft/client/MinecraftClient;itemUseCooldown:I", - ordinal = 0), - method = "doItemUse()V", - cancellable = true) - private void onDoItemUse(CallbackInfo ci) - { - RightClickEvent event = new RightClickEvent(); - EventManager.fire(event); - - if(event.isCancelled()) - ci.cancel(); - } - - @Inject(at = @At("HEAD"), method = "doItemPick()V") - private void onDoItemPick(CallbackInfo ci) - { - if(!WurstClient.INSTANCE.isEnabled()) - return; - - HitResult hitResult = WurstClient.MC.crosshairTarget; - if(!(hitResult instanceof EntityHitResult eHitResult)) - return; - - WurstClient.INSTANCE.getFriends().middleClick(eHitResult.getEntity()); - } - - @Inject(at = @At("HEAD"), - method = "getSession()Lnet/minecraft/client/util/Session;", - cancellable = true) - private void onGetSession(CallbackInfoReturnable cir) - { - if(wurstSession != null) - cir.setReturnValue(wurstSession); - } - - @Redirect(at = @At(value = "FIELD", - target = "Lnet/minecraft/client/MinecraftClient;session:Lnet/minecraft/client/util/Session;", - opcode = Opcodes.GETFIELD, - ordinal = 0), - method = "getSessionProperties()Lcom/mojang/authlib/properties/PropertyMap;") - private Session getSessionForSessionProperties(MinecraftClient mc) - { - return wurstSession != null ? wurstSession : session; - } - - @Inject(at = @At("HEAD"), - method = "getProfileKeys()Lnet/minecraft/client/util/ProfileKeys;", - cancellable = true) - private void onGetProfileKeys(CallbackInfoReturnable cir) - { - if(WurstClient.INSTANCE.getOtfs().noChatReportsOtf.isActive()) - cir.setReturnValue(ProfileKeys.MISSING); - - if(wurstProfileKeys == null) - return; - - cir.setReturnValue(wurstProfileKeys); - } - - @Inject(at = @At("HEAD"), - method = "isTelemetryEnabledByApi()Z", - cancellable = true) - private void onIsTelemetryEnabledByApi(CallbackInfoReturnable cir) - { - cir.setReturnValue( - !WurstClient.INSTANCE.getOtfs().noTelemetryOtf.isEnabled()); - } - - @Inject(at = @At("HEAD"), - method = "isOptionalTelemetryEnabledByApi()Z", - cancellable = true) - private void onIsOptionalTelemetryEnabledByApi( - CallbackInfoReturnable cir) - { - cir.setReturnValue( - !WurstClient.INSTANCE.getOtfs().noTelemetryOtf.isEnabled()); - } - - @Override - public IClientPlayerEntity getPlayer() - { - return (IClientPlayerEntity)player; - } - - @Override - public IClientPlayerInteractionManager getInteractionManager() - { - return (IClientPlayerInteractionManager)interactionManager; - } - - @Override - public void setSession(Session session) - { - wurstSession = session; - - UserApiService userApiService = - wurst_createUserApiService(session.getAccessToken()); - UUID uuid = wurstSession.getProfile().getId(); - wurstProfileKeys = - new ProfileKeysImpl(userApiService, uuid, runDirectory.toPath()); - } - - private UserApiService wurst_createUserApiService(String accessToken) - { - try - { - return authenticationService.createUserApiService(accessToken); - - }catch(AuthenticationException e) - { - e.printStackTrace(); - return UserApiService.OFFLINE; - } - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import java.io.File; +import java.util.UUID; + +import org.objectweb.asm.Opcodes; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.Redirect; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import com.mojang.authlib.exceptions.AuthenticationException; +import com.mojang.authlib.minecraft.UserApiService; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; + +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.WindowEventHandler; +import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.client.network.ClientPlayerInteractionManager; +import net.minecraft.client.util.ProfileKeys; +import net.minecraft.client.util.ProfileKeysImpl; +import net.minecraft.client.util.Session; +import net.minecraft.util.hit.EntityHitResult; +import net.minecraft.util.hit.HitResult; +import net.minecraft.util.thread.ReentrantThreadExecutor; +import net.wurstclient.WurstClient; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.LeftClickListener.LeftClickEvent; +import net.wurstclient.events.RightClickListener.RightClickEvent; +import net.wurstclient.mixinterface.IClientPlayerEntity; +import net.wurstclient.mixinterface.IClientPlayerInteractionManager; +import net.wurstclient.mixinterface.IMinecraftClient; + +@Mixin(MinecraftClient.class) +public abstract class MinecraftClientMixin + extends ReentrantThreadExecutor + implements WindowEventHandler, IMinecraftClient +{ + @Shadow + @Final + public File runDirectory; + @Shadow + public ClientPlayerInteractionManager interactionManager; + @Shadow + public ClientPlayerEntity player; + @Shadow + @Final + private Session session; + @Shadow + @Final + private YggdrasilAuthenticationService authenticationService; + + private Session wurstSession; + private ProfileKeysImpl wurstProfileKeys; + + private MinecraftClientMixin(WurstClient wurst, String name) + { + super(name); + } + + @Inject(at = @At(value = "FIELD", + target = "Lnet/minecraft/client/MinecraftClient;crosshairTarget:Lnet/minecraft/util/hit/HitResult;", + ordinal = 0), method = "doAttack()Z", cancellable = true) + private void onDoAttack(CallbackInfoReturnable cir) + { + LeftClickEvent event = new LeftClickEvent(); + EventManager.fire(event); + + if(event.isCancelled()) + cir.setReturnValue(false); + } + + @Inject( + at = @At(value = "FIELD", + target = "Lnet/minecraft/client/MinecraftClient;itemUseCooldown:I", + ordinal = 0), + method = "doItemUse()V", + cancellable = true) + private void onDoItemUse(CallbackInfo ci) + { + RightClickEvent event = new RightClickEvent(); + EventManager.fire(event); + + if(event.isCancelled()) + ci.cancel(); + } + + @Inject(at = @At("HEAD"), method = "doItemPick()V") + private void onDoItemPick(CallbackInfo ci) + { + if(!WurstClient.INSTANCE.isEnabled()) + return; + + HitResult hitResult = WurstClient.MC.crosshairTarget; + if(!(hitResult instanceof EntityHitResult eHitResult)) + return; + + WurstClient.INSTANCE.getFriends().middleClick(eHitResult.getEntity()); + } + + @Inject(at = @At("HEAD"), + method = "getSession()Lnet/minecraft/client/util/Session;", + cancellable = true) + private void onGetSession(CallbackInfoReturnable cir) + { + if(wurstSession != null) + cir.setReturnValue(wurstSession); + } + + @Redirect(at = @At(value = "FIELD", + target = "Lnet/minecraft/client/MinecraftClient;session:Lnet/minecraft/client/util/Session;", + opcode = Opcodes.GETFIELD, + ordinal = 0), + method = "getSessionProperties()Lcom/mojang/authlib/properties/PropertyMap;") + private Session getSessionForSessionProperties(MinecraftClient mc) + { + return wurstSession != null ? wurstSession : session; + } + + @Inject(at = @At("HEAD"), + method = "getProfileKeys()Lnet/minecraft/client/util/ProfileKeys;", + cancellable = true) + private void onGetProfileKeys(CallbackInfoReturnable cir) + { + if(WurstClient.INSTANCE.getOtfs().noChatReportsOtf.isActive()) + cir.setReturnValue(ProfileKeys.MISSING); + + if(wurstProfileKeys == null) + return; + + cir.setReturnValue(wurstProfileKeys); + } + + @Inject(at = @At("HEAD"), + method = "isTelemetryEnabledByApi()Z", + cancellable = true) + private void onIsTelemetryEnabledByApi(CallbackInfoReturnable cir) + { + cir.setReturnValue( + !WurstClient.INSTANCE.getOtfs().noTelemetryOtf.isEnabled()); + } + + @Inject(at = @At("HEAD"), + method = "isOptionalTelemetryEnabledByApi()Z", + cancellable = true) + private void onIsOptionalTelemetryEnabledByApi( + CallbackInfoReturnable cir) + { + cir.setReturnValue( + !WurstClient.INSTANCE.getOtfs().noTelemetryOtf.isEnabled()); + } + + @Override + public IClientPlayerEntity getPlayer() + { + return (IClientPlayerEntity)player; + } + + @Override + public IClientPlayerInteractionManager getInteractionManager() + { + return (IClientPlayerInteractionManager)interactionManager; + } + + @Override + public void setSession(Session session) + { + wurstSession = session; + + UserApiService userApiService = + wurst_createUserApiService(session.getAccessToken()); + UUID uuid = wurstSession.getProfile().getId(); + wurstProfileKeys = + new ProfileKeysImpl(userApiService, uuid, runDirectory.toPath()); + } + + private UserApiService wurst_createUserApiService(String accessToken) + { + try + { + return authenticationService.createUserApiService(accessToken); + + }catch(AuthenticationException e) + { + e.printStackTrace(); + return UserApiService.OFFLINE; + } + } +} diff --git a/src/main/java/net/wurstclient/mixin/MobEntityRendererMixin.java b/src/main/java/net/wurstclient/mixin/MobEntityRendererMixin.java new file mode 100644 index 00000000..2be63abf --- /dev/null +++ b/src/main/java/net/wurstclient/mixin/MobEntityRendererMixin.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.objectweb.asm.Opcodes; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.client.render.entity.MobEntityRenderer; +import net.wurstclient.WurstClient; + +@Mixin(MobEntityRenderer.class) +public abstract class MobEntityRendererMixin +{ + /** + * Makes name-tagged mobs always show their name tags if configured in + * NameTags. + */ + @Inject(at = @At(value = "FIELD", + target = "Lnet/minecraft/client/render/entity/EntityRenderDispatcher;targetedEntity:Lnet/minecraft/entity/Entity;", + opcode = Opcodes.GETFIELD, + ordinal = 0), + method = "hasLabel(Lnet/minecraft/entity/mob/MobEntity;)Z", + cancellable = true) + private void onHasLabel(CallbackInfoReturnable cir) + { + // skip the mobEntity == dispatcher.targetedEntity check and return true + if(WurstClient.INSTANCE.getHax().nameTagsHack.shouldForceMobNametags()) + cir.setReturnValue(true); + } +} diff --git a/src/main/java/net/wurstclient/mixin/MouseMixin.java b/src/main/java/net/wurstclient/mixin/MouseMixin.java index c6e6d5f8..5b5e3690 100644 --- a/src/main/java/net/wurstclient/mixin/MouseMixin.java +++ b/src/main/java/net/wurstclient/mixin/MouseMixin.java @@ -1,28 +1,28 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import net.minecraft.client.Mouse; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.MouseScrollListener.MouseScrollEvent; - -@Mixin(Mouse.class) -public class MouseMixin -{ - @Inject(at = @At("RETURN"), method = "onMouseScroll(JDD)V") - private void onOnMouseScroll(long window, double horizontal, - double vertical, CallbackInfo ci) - { - EventManager.fire(new MouseScrollEvent(vertical)); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.minecraft.client.Mouse; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.MouseScrollListener.MouseScrollEvent; + +@Mixin(Mouse.class) +public class MouseMixin +{ + @Inject(at = @At("RETURN"), method = "onMouseScroll(JDD)V") + private void onOnMouseScroll(long window, double horizontal, + double vertical, CallbackInfo ci) + { + EventManager.fire(new MouseScrollEvent(vertical)); + } +} diff --git a/src/main/java/net/wurstclient/mixin/MultiplayerScreenMixin.java b/src/main/java/net/wurstclient/mixin/MultiplayerScreenMixin.java index 9a946565..1b2f861d 100644 --- a/src/main/java/net/wurstclient/mixin/MultiplayerScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/MultiplayerScreenMixin.java @@ -1,100 +1,100 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen; -import net.minecraft.client.gui.screen.multiplayer.MultiplayerServerListWidget; -import net.minecraft.client.gui.widget.ButtonWidget; -import net.minecraft.client.network.ServerInfo; -import net.minecraft.text.Text; -import net.wurstclient.WurstClient; -import net.wurstclient.mixinterface.IMultiplayerScreen; -import net.wurstclient.serverfinder.CleanUpScreen; -import net.wurstclient.serverfinder.ServerFinderScreen; -import net.wurstclient.util.LastServerRememberer; - -@Mixin(MultiplayerScreen.class) -public class MultiplayerScreenMixin extends Screen implements IMultiplayerScreen -{ - @Shadow - protected MultiplayerServerListWidget serverListWidget; - - private ButtonWidget lastServerButton; - - private MultiplayerScreenMixin(WurstClient wurst, Text title) - { - super(title); - } - - @Inject(at = @At("TAIL"), method = "init()V") - private void onInit(CallbackInfo ci) - { - if(!WurstClient.INSTANCE.isEnabled()) - return; - - lastServerButton = addDrawableChild(ButtonWidget - .builder(Text.literal("Last Server"), - b -> LastServerRememberer - .joinLastServer((MultiplayerScreen)(Object)this)) - .dimensions(width / 2 - 154, 10, 100, 20).build()); - - addDrawableChild( - ButtonWidget - .builder(Text.literal("Server Finder"), - b -> client.setScreen(new ServerFinderScreen( - (MultiplayerScreen)(Object)this))) - .dimensions(width / 2 + 154 + 4, height - 54, 100, 20).build()); - - addDrawableChild(ButtonWidget - .builder(Text.literal("Clean Up"), - b -> client.setScreen( - new CleanUpScreen((MultiplayerScreen)(Object)this))) - .dimensions(width / 2 + 154 + 4, height - 30, 100, 20).build()); - } - - @Inject(at = @At("TAIL"), method = "tick()V") - private void onTick(CallbackInfo ci) - { - if(lastServerButton == null) - return; - - lastServerButton.active = LastServerRememberer.getLastServer() != null; - } - - @Inject(at = @At("HEAD"), - method = "connect(Lnet/minecraft/client/network/ServerInfo;)V") - private void onConnect(ServerInfo entry, CallbackInfo ci) - { - LastServerRememberer.setLastServer(entry); - } - - @Override - public MultiplayerServerListWidget getServerListSelector() - { - return serverListWidget; - } - - @Override - public void connectToServer(ServerInfo server) - { - connect(server); - } - - @Shadow - private void connect(ServerInfo entry) - { - - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen; +import net.minecraft.client.gui.screen.multiplayer.MultiplayerServerListWidget; +import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.client.network.ServerInfo; +import net.minecraft.text.Text; +import net.wurstclient.WurstClient; +import net.wurstclient.mixinterface.IMultiplayerScreen; +import net.wurstclient.serverfinder.CleanUpScreen; +import net.wurstclient.serverfinder.ServerFinderScreen; +import net.wurstclient.util.LastServerRememberer; + +@Mixin(MultiplayerScreen.class) +public class MultiplayerScreenMixin extends Screen implements IMultiplayerScreen +{ + @Shadow + protected MultiplayerServerListWidget serverListWidget; + + private ButtonWidget lastServerButton; + + private MultiplayerScreenMixin(WurstClient wurst, Text title) + { + super(title); + } + + @Inject(at = @At("TAIL"), method = "init()V") + private void onInit(CallbackInfo ci) + { + if(!WurstClient.INSTANCE.isEnabled()) + return; + + lastServerButton = addDrawableChild(ButtonWidget + .builder(Text.literal("Last Server"), + b -> LastServerRememberer + .joinLastServer((MultiplayerScreen)(Object)this)) + .dimensions(width / 2 - 154, 10, 100, 20).build()); + + addDrawableChild( + ButtonWidget + .builder(Text.literal("Server Finder"), + b -> client.setScreen(new ServerFinderScreen( + (MultiplayerScreen)(Object)this))) + .dimensions(width / 2 + 154 + 4, height - 54, 100, 20).build()); + + addDrawableChild(ButtonWidget + .builder(Text.literal("Clean Up"), + b -> client.setScreen( + new CleanUpScreen((MultiplayerScreen)(Object)this))) + .dimensions(width / 2 + 154 + 4, height - 30, 100, 20).build()); + } + + @Inject(at = @At("TAIL"), method = "tick()V") + private void onTick(CallbackInfo ci) + { + if(lastServerButton == null) + return; + + lastServerButton.active = LastServerRememberer.getLastServer() != null; + } + + @Inject(at = @At("HEAD"), + method = "connect(Lnet/minecraft/client/network/ServerInfo;)V") + private void onConnect(ServerInfo entry, CallbackInfo ci) + { + LastServerRememberer.setLastServer(entry); + } + + @Override + public MultiplayerServerListWidget getServerListSelector() + { + return serverListWidget; + } + + @Override + public void connectToServer(ServerInfo server) + { + connect(server); + } + + @Shadow + private void connect(ServerInfo entry) + { + + } +} diff --git a/src/main/java/net/wurstclient/mixin/PackScreenMixin.java b/src/main/java/net/wurstclient/mixin/PackScreenMixin.java index f4a107b3..89b10a7c 100644 --- a/src/main/java/net/wurstclient/mixin/PackScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/PackScreenMixin.java @@ -1,37 +1,37 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.screen.pack.PackScreen; -import net.minecraft.text.Text; -import net.wurstclient.WurstClient; - -@Mixin(PackScreen.class) -public class PackScreenMixin extends Screen -{ - private PackScreenMixin(WurstClient wurst, Text title) - { - super(title); - } - - /** - * Scans for problematic resource packs (currently just VanillaTweaks - * Twinkling Stars) whenever the resource pack screen is closed. - */ - @Inject(at = @At("HEAD"), method = "close()V") - public void onClose(CallbackInfo ci) - { - WurstClient.INSTANCE.getProblematicPackDetector().start(); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.screen.pack.PackScreen; +import net.minecraft.text.Text; +import net.wurstclient.WurstClient; + +@Mixin(PackScreen.class) +public class PackScreenMixin extends Screen +{ + private PackScreenMixin(WurstClient wurst, Text title) + { + super(title); + } + + /** + * Scans for problematic resource packs (currently just VanillaTweaks + * Twinkling Stars) whenever the resource pack screen is closed. + */ + @Inject(at = @At("HEAD"), method = "close()V") + public void onClose(CallbackInfo ci) + { + WurstClient.INSTANCE.getProblematicPackDetector().start(); + } +} diff --git a/src/main/java/net/wurstclient/mixin/PlayerInventoryMixin.java b/src/main/java/net/wurstclient/mixin/PlayerInventoryMixin.java index f4e06c0d..c4a21545 100644 --- a/src/main/java/net/wurstclient/mixin/PlayerInventoryMixin.java +++ b/src/main/java/net/wurstclient/mixin/PlayerInventoryMixin.java @@ -1,28 +1,28 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import net.minecraft.entity.player.PlayerInventory; -import net.wurstclient.WurstClient; - -@Mixin(PlayerInventory.class) -public class PlayerInventoryMixin -{ - @Inject(at = @At("HEAD"), method = "scrollInHotbar(D)V", cancellable = true) - private void onScrollInHotbar(double scrollAmount, CallbackInfo ci) - { - if(WurstClient.INSTANCE.getOtfs().zoomOtf - .shouldPreventHotbarScrolling()) - ci.cancel(); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.minecraft.entity.player.PlayerInventory; +import net.wurstclient.WurstClient; + +@Mixin(PlayerInventory.class) +public class PlayerInventoryMixin +{ + @Inject(at = @At("HEAD"), method = "scrollInHotbar(D)V", cancellable = true) + private void onScrollInHotbar(double scrollAmount, CallbackInfo ci) + { + if(WurstClient.INSTANCE.getOtfs().zoomOtf + .shouldPreventHotbarScrolling()) + ci.cancel(); + } +} diff --git a/src/main/java/net/wurstclient/mixin/PlayerSkinProviderMixin.java b/src/main/java/net/wurstclient/mixin/PlayerSkinProviderMixin.java index 358302cc..f2f64137 100644 --- a/src/main/java/net/wurstclient/mixin/PlayerSkinProviderMixin.java +++ b/src/main/java/net/wurstclient/mixin/PlayerSkinProviderMixin.java @@ -1,163 +1,163 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import java.io.InputStreamReader; -import java.net.URL; -import java.util.HashMap; - -import javax.annotation.Nullable; - -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Maps; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import com.mojang.authlib.GameProfile; -import com.mojang.authlib.minecraft.InsecurePublicKeyException; -import com.mojang.authlib.minecraft.MinecraftProfileTexture; -import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type; -import com.mojang.authlib.minecraft.MinecraftSessionService; -import com.mojang.blaze3d.systems.RenderSystem; - -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.texture.PlayerSkinProvider; -import net.minecraft.util.Identifier; -import net.minecraft.util.Util; - -@Mixin(PlayerSkinProvider.class) -public abstract class PlayerSkinProviderMixin -{ - @Shadow - @Final - private MinecraftSessionService sessionService; - - private static JsonObject capes; - - @Inject(at = @At("HEAD"), - method = "loadSkin(Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/texture/PlayerSkinProvider$SkinTextureAvailableCallback;Z)V", - cancellable = true) - private void onLoadSkin(GameProfile profile, - PlayerSkinProvider.SkinTextureAvailableCallback callback, - boolean requireSecure, CallbackInfo ci) - { - // Can't @Inject nicely because everything is wrapped in a lambda. - // Had to replace the whole method. - - Runnable runnable = () -> { - HashMap map = - Maps.newHashMap(); - try - { - map.putAll(sessionService.getTextures(profile, requireSecure)); - }catch(InsecurePublicKeyException e) - { - // empty catch block - } - if(map.isEmpty()) - { - profile.getProperties().clear(); - if(profile.getId().equals(MinecraftClient.getInstance() - .getSession().getProfile().getId())) - { - profile.getProperties().putAll( - MinecraftClient.getInstance().getSessionProperties()); - map.putAll(sessionService.getTextures(profile, false)); - }else - { - sessionService.fillProfileProperties(profile, - requireSecure); - try - { - map.putAll( - sessionService.getTextures(profile, requireSecure)); - }catch(InsecurePublicKeyException e) - { - - } - } - } - - addWurstCape(profile, map); - - MinecraftClient.getInstance().execute(() -> { - RenderSystem.recordRenderCall(() -> { - ImmutableList.of(Type.SKIN, Type.CAPE).forEach(type -> { - if(map.containsKey(type)) - loadSkin(map.get(type), type, callback); - }); - }); - }); - }; - Util.getMainWorkerExecutor().execute(runnable); - - ci.cancel(); - } - - private void addWurstCape(GameProfile profile, - HashMap map) - { - String name = profile.getName(); - String uuid = profile.getId().toString(); - - try - { - if(capes == null) - setupWurstCapes(); - - if(capes.has(name)) - { - String capeURL = capes.get(name).getAsString(); - map.put(Type.CAPE, new MinecraftProfileTexture(capeURL, null)); - - }else if(capes.has(uuid)) - { - String capeURL = capes.get(uuid).getAsString(); - map.put(Type.CAPE, new MinecraftProfileTexture(capeURL, null)); - } - - }catch(Exception e) - { - System.err.println("[Wurst] Failed to load cape for '" + name - + "' (" + uuid + ")"); - - e.printStackTrace(); - } - } - - private void setupWurstCapes() - { - try - { - // TODO: download capes to file - URL url = new URL("https://www.wurstclient.net/api/v1/capes.json"); - - capes = - JsonParser.parseReader(new InputStreamReader(url.openStream())) - .getAsJsonObject(); - - }catch(Exception e) - { - System.err - .println("[Wurst] Failed to load capes from wurstclient.net!"); - - e.printStackTrace(); - } - } - - @Shadow - public abstract Identifier loadSkin(MinecraftProfileTexture profileTexture, - Type type, - @Nullable PlayerSkinProvider.SkinTextureAvailableCallback callback); -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import java.io.InputStreamReader; +import java.net.URL; +import java.util.HashMap; + +import javax.annotation.Nullable; + +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Maps; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.minecraft.InsecurePublicKeyException; +import com.mojang.authlib.minecraft.MinecraftProfileTexture; +import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type; +import com.mojang.authlib.minecraft.MinecraftSessionService; +import com.mojang.blaze3d.systems.RenderSystem; + +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.texture.PlayerSkinProvider; +import net.minecraft.util.Identifier; +import net.minecraft.util.Util; + +@Mixin(PlayerSkinProvider.class) +public abstract class PlayerSkinProviderMixin +{ + @Shadow + @Final + private MinecraftSessionService sessionService; + + private static JsonObject capes; + + @Inject(at = @At("HEAD"), + method = "loadSkin(Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/texture/PlayerSkinProvider$SkinTextureAvailableCallback;Z)V", + cancellable = true) + private void onLoadSkin(GameProfile profile, + PlayerSkinProvider.SkinTextureAvailableCallback callback, + boolean requireSecure, CallbackInfo ci) + { + // Can't @Inject nicely because everything is wrapped in a lambda. + // Had to replace the whole method. + + Runnable runnable = () -> { + HashMap map = + Maps.newHashMap(); + try + { + map.putAll(sessionService.getTextures(profile, requireSecure)); + }catch(InsecurePublicKeyException e) + { + // empty catch block + } + if(map.isEmpty()) + { + profile.getProperties().clear(); + if(profile.getId().equals(MinecraftClient.getInstance() + .getSession().getProfile().getId())) + { + profile.getProperties().putAll( + MinecraftClient.getInstance().getSessionProperties()); + map.putAll(sessionService.getTextures(profile, false)); + }else + { + sessionService.fillProfileProperties(profile, + requireSecure); + try + { + map.putAll( + sessionService.getTextures(profile, requireSecure)); + }catch(InsecurePublicKeyException e) + { + + } + } + } + + addWurstCape(profile, map); + + MinecraftClient.getInstance().execute(() -> { + RenderSystem.recordRenderCall(() -> { + ImmutableList.of(Type.SKIN, Type.CAPE).forEach(type -> { + if(map.containsKey(type)) + loadSkin(map.get(type), type, callback); + }); + }); + }); + }; + Util.getMainWorkerExecutor().execute(runnable); + + ci.cancel(); + } + + private void addWurstCape(GameProfile profile, + HashMap map) + { + String name = profile.getName(); + String uuid = profile.getId().toString(); + + try + { + if(capes == null) + setupWurstCapes(); + + if(capes.has(name)) + { + String capeURL = capes.get(name).getAsString(); + map.put(Type.CAPE, new MinecraftProfileTexture(capeURL, null)); + + }else if(capes.has(uuid)) + { + String capeURL = capes.get(uuid).getAsString(); + map.put(Type.CAPE, new MinecraftProfileTexture(capeURL, null)); + } + + }catch(Exception e) + { + System.err.println("[Wurst] Failed to load cape for '" + name + + "' (" + uuid + ")"); + + e.printStackTrace(); + } + } + + private void setupWurstCapes() + { + try + { + // TODO: download capes to file + URL url = new URL("https://www.wurstclient.net/api/v1/capes.json"); + + capes = + JsonParser.parseReader(new InputStreamReader(url.openStream())) + .getAsJsonObject(); + + }catch(Exception e) + { + System.err + .println("[Wurst] Failed to load capes from wurstclient.net!"); + + e.printStackTrace(); + } + } + + @Shadow + public abstract Identifier loadSkin(MinecraftProfileTexture profileTexture, + Type type, + @Nullable PlayerSkinProvider.SkinTextureAvailableCallback callback); +} diff --git a/src/main/java/net/wurstclient/mixin/PowderSnowBlockMixin.java b/src/main/java/net/wurstclient/mixin/PowderSnowBlockMixin.java index 9850818e..e5951b1b 100644 --- a/src/main/java/net/wurstclient/mixin/PowderSnowBlockMixin.java +++ b/src/main/java/net/wurstclient/mixin/PowderSnowBlockMixin.java @@ -1,42 +1,42 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import net.minecraft.block.Block; -import net.minecraft.block.FluidDrainable; -import net.minecraft.block.PowderSnowBlock; -import net.minecraft.entity.Entity; -import net.wurstclient.WurstClient; - -@Mixin(PowderSnowBlock.class) -public abstract class PowderSnowBlockMixin extends Block - implements FluidDrainable -{ - private PowderSnowBlockMixin(WurstClient wurst, Settings settings) - { - super(settings); - } - - @Inject(at = @At("HEAD"), - method = "canWalkOnPowderSnow(Lnet/minecraft/entity/Entity;)Z", - cancellable = true) - private static void onCanWalkOnPowderSnow(Entity entity, - CallbackInfoReturnable cir) - { - if(!WurstClient.INSTANCE.getHax().snowShoeHack.isEnabled()) - return; - - if(entity == WurstClient.MC.player) - cir.setReturnValue(true); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.block.Block; +import net.minecraft.block.FluidDrainable; +import net.minecraft.block.PowderSnowBlock; +import net.minecraft.entity.Entity; +import net.wurstclient.WurstClient; + +@Mixin(PowderSnowBlock.class) +public abstract class PowderSnowBlockMixin extends Block + implements FluidDrainable +{ + private PowderSnowBlockMixin(WurstClient wurst, Settings settings) + { + super(settings); + } + + @Inject(at = @At("HEAD"), + method = "canWalkOnPowderSnow(Lnet/minecraft/entity/Entity;)Z", + cancellable = true) + private static void onCanWalkOnPowderSnow(Entity entity, + CallbackInfoReturnable cir) + { + if(!WurstClient.INSTANCE.getHax().snowShoeHack.isEnabled()) + return; + + if(entity == WurstClient.MC.player) + cir.setReturnValue(true); + } +} diff --git a/src/main/java/net/wurstclient/mixin/RenderTickCounterMixin.java b/src/main/java/net/wurstclient/mixin/RenderTickCounterMixin.java index bf520849..adbd84dc 100644 --- a/src/main/java/net/wurstclient/mixin/RenderTickCounterMixin.java +++ b/src/main/java/net/wurstclient/mixin/RenderTickCounterMixin.java @@ -1,36 +1,36 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.objectweb.asm.Opcodes; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import net.minecraft.client.render.RenderTickCounter; -import net.wurstclient.WurstClient; - -@Mixin(RenderTickCounter.class) -public abstract class RenderTickCounterMixin -{ - @Shadow - public float lastFrameDuration; - - @Inject(at = @At(value = "FIELD", - target = "Lnet/minecraft/client/render/RenderTickCounter;prevTimeMillis:J", - opcode = Opcodes.PUTFIELD, - ordinal = 0), method = "beginRenderTick(J)I") - public void onBeginRenderTick(long timeMillis, - CallbackInfoReturnable cir) - { - lastFrameDuration *= - WurstClient.INSTANCE.getHax().timerHack.getTimerSpeed(); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.objectweb.asm.Opcodes; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.client.render.RenderTickCounter; +import net.wurstclient.WurstClient; + +@Mixin(RenderTickCounter.class) +public abstract class RenderTickCounterMixin +{ + @Shadow + public float lastFrameDuration; + + @Inject(at = @At(value = "FIELD", + target = "Lnet/minecraft/client/render/RenderTickCounter;prevTimeMillis:J", + opcode = Opcodes.PUTFIELD, + ordinal = 0), method = "beginRenderTick(J)I") + public void onBeginRenderTick(long timeMillis, + CallbackInfoReturnable cir) + { + lastFrameDuration *= + WurstClient.INSTANCE.getHax().timerHack.getTimerSpeed(); + } +} diff --git a/src/main/java/net/wurstclient/mixin/ScreenMixin.java b/src/main/java/net/wurstclient/mixin/ScreenMixin.java index d9fd7d63..3d4ab192 100644 --- a/src/main/java/net/wurstclient/mixin/ScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/ScreenMixin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/mixin/ShulkerBoxScreenMixin.java b/src/main/java/net/wurstclient/mixin/ShulkerBoxScreenMixin.java index a25432f4..dfb98e92 100644 --- a/src/main/java/net/wurstclient/mixin/ShulkerBoxScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/ShulkerBoxScreenMixin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/mixin/SimpleOptionMixin.java b/src/main/java/net/wurstclient/mixin/SimpleOptionMixin.java index bb2eb39d..2ff8dfdd 100644 --- a/src/main/java/net/wurstclient/mixin/SimpleOptionMixin.java +++ b/src/main/java/net/wurstclient/mixin/SimpleOptionMixin.java @@ -1,46 +1,46 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import java.util.Objects; -import java.util.function.Consumer; - -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; - -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.option.SimpleOption; -import net.wurstclient.mixinterface.ISimpleOption; - -@Mixin(SimpleOption.class) -public class SimpleOptionMixin implements ISimpleOption -{ - @Shadow - T value; - - @Shadow - @Final - private Consumer changeCallback; - - @Override - public void forceSetValue(T newValue) - { - if(!MinecraftClient.getInstance().isRunning()) - { - value = newValue; - return; - } - - if(!Objects.equals(value, newValue)) - { - value = newValue; - changeCallback.accept(value); - } - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import java.util.Objects; +import java.util.function.Consumer; + +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; + +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.option.SimpleOption; +import net.wurstclient.mixinterface.ISimpleOption; + +@Mixin(SimpleOption.class) +public class SimpleOptionMixin implements ISimpleOption +{ + @Shadow + T value; + + @Shadow + @Final + private Consumer changeCallback; + + @Override + public void forceSetValue(T newValue) + { + if(!MinecraftClient.getInstance().isRunning()) + { + value = newValue; + return; + } + + if(!Objects.equals(value, newValue)) + { + value = newValue; + changeCallback.accept(value); + } + } +} diff --git a/src/main/java/net/wurstclient/mixin/SodiumBlockOcclusionCacheMixin.java b/src/main/java/net/wurstclient/mixin/SodiumBlockOcclusionCacheMixin.java index cd36e13c..0d331286 100644 --- a/src/main/java/net/wurstclient/mixin/SodiumBlockOcclusionCacheMixin.java +++ b/src/main/java/net/wurstclient/mixin/SodiumBlockOcclusionCacheMixin.java @@ -1,46 +1,46 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Pseudo; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import net.minecraft.block.BlockState; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.world.BlockView; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.ShouldDrawSideListener.ShouldDrawSideEvent; - -@Pseudo -@Mixin(targets = { - // current target - "me.jellysquid.mods.sodium.client.render.chunk.compile.pipeline.BlockOcclusionCache", - // < Sodium 0.5.0 - "me.jellysquid.mods.sodium.client.render.occlusion.BlockOcclusionCache"}, - remap = false) -public class SodiumBlockOcclusionCacheMixin -{ - /** - * This mixin hides and shows regular full blocks when using X-Ray with - * Sodium installed. - */ - @Inject(at = @At("HEAD"), method = "shouldDrawSide", cancellable = true) - public void shouldDrawSide(BlockState state, BlockView world, BlockPos pos, - Direction side, CallbackInfoReturnable cir) - { - ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, pos); - EventManager.fire(event); - - if(event.isRendered() != null) - cir.setReturnValue(event.isRendered()); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Pseudo; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.block.BlockState; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.BlockView; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.ShouldDrawSideListener.ShouldDrawSideEvent; + +@Pseudo +@Mixin(targets = { + // current target + "me.jellysquid.mods.sodium.client.render.chunk.compile.pipeline.BlockOcclusionCache", + // < Sodium 0.5.0 + "me.jellysquid.mods.sodium.client.render.occlusion.BlockOcclusionCache"}, + remap = false) +public class SodiumBlockOcclusionCacheMixin +{ + /** + * This mixin hides and shows regular full blocks when using X-Ray with + * Sodium installed. + */ + @Inject(at = @At("HEAD"), method = "shouldDrawSide", cancellable = true) + public void shouldDrawSide(BlockState state, BlockView world, BlockPos pos, + Direction side, CallbackInfoReturnable cir) + { + ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, pos); + EventManager.fire(event); + + if(event.isRendered() != null) + cir.setReturnValue(event.isRendered()); + } +} diff --git a/src/main/java/net/wurstclient/mixin/SodiumFluidRendererMixin.java b/src/main/java/net/wurstclient/mixin/SodiumFluidRendererMixin.java index 550debc1..86d69c83 100644 --- a/src/main/java/net/wurstclient/mixin/SodiumFluidRendererMixin.java +++ b/src/main/java/net/wurstclient/mixin/SodiumFluidRendererMixin.java @@ -1,47 +1,47 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Pseudo; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import net.minecraft.block.BlockState; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.world.BlockRenderView; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.ShouldDrawSideListener.ShouldDrawSideEvent; - -@Pseudo -@Mixin(targets = { - // current target - "me.jellysquid.mods.sodium.client.render.chunk.compile.pipeline.FluidRenderer", - // < Sodium 0.4.9 - "me.jellysquid.mods.sodium.client.render.pipeline.FluidRenderer"}, - remap = false) -public class SodiumFluidRendererMixin -{ - /** - * This mixin hides and shows fluids when using X-Ray with Sodium installed. - */ - @Inject(at = @At("HEAD"), method = "isSideExposed", cancellable = true) - private void isSideExposed(BlockRenderView world, int x, int y, int z, - Direction dir, float height, CallbackInfoReturnable cir) - { - BlockPos pos = new BlockPos(x, y, z); - BlockState state = world.getBlockState(pos); - ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, pos); - EventManager.fire(event); - - if(event.isRendered() != null) - cir.setReturnValue(event.isRendered()); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Pseudo; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.block.BlockState; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.BlockRenderView; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.ShouldDrawSideListener.ShouldDrawSideEvent; + +@Pseudo +@Mixin(targets = { + // current target + "me.jellysquid.mods.sodium.client.render.chunk.compile.pipeline.FluidRenderer", + // < Sodium 0.4.9 + "me.jellysquid.mods.sodium.client.render.pipeline.FluidRenderer"}, + remap = false) +public class SodiumFluidRendererMixin +{ + /** + * This mixin hides and shows fluids when using X-Ray with Sodium installed. + */ + @Inject(at = @At("HEAD"), method = "isSideExposed", cancellable = true) + private void isSideExposed(BlockRenderView world, int x, int y, int z, + Direction dir, float height, CallbackInfoReturnable cir) + { + BlockPos pos = new BlockPos(x, y, z); + BlockState state = world.getBlockState(pos); + ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, pos); + EventManager.fire(event); + + if(event.isRendered() != null) + cir.setReturnValue(event.isRendered()); + } +} diff --git a/src/main/java/net/wurstclient/mixin/StatsScreenMixin.java b/src/main/java/net/wurstclient/mixin/StatsScreenMixin.java index 464c5ae3..b445e13a 100644 --- a/src/main/java/net/wurstclient/mixin/StatsScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/StatsScreenMixin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/mixin/StatusEffectInstanceMixin.java b/src/main/java/net/wurstclient/mixin/StatusEffectInstanceMixin.java index 2c70cdc4..e28fa060 100644 --- a/src/main/java/net/wurstclient/mixin/StatusEffectInstanceMixin.java +++ b/src/main/java/net/wurstclient/mixin/StatusEffectInstanceMixin.java @@ -1,32 +1,32 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import net.minecraft.entity.effect.StatusEffectInstance; -import net.wurstclient.WurstClient; - -@Mixin(StatusEffectInstance.class) -public abstract class StatusEffectInstanceMixin - implements Comparable -{ - @Shadow - private int duration; - - @Inject(at = @At("HEAD"), method = "updateDuration()I", cancellable = true) - private void onUpdateDuration(CallbackInfoReturnable cir) - { - if(WurstClient.INSTANCE.getHax().potionSaverHack.isFrozen()) - cir.setReturnValue(duration); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.entity.effect.StatusEffectInstance; +import net.wurstclient.WurstClient; + +@Mixin(StatusEffectInstance.class) +public abstract class StatusEffectInstanceMixin + implements Comparable +{ + @Shadow + private int duration; + + @Inject(at = @At("HEAD"), method = "updateDuration()I", cancellable = true) + private void onUpdateDuration(CallbackInfoReturnable cir) + { + if(WurstClient.INSTANCE.getHax().potionSaverHack.isFrozen()) + cir.setReturnValue(duration); + } +} diff --git a/src/main/java/net/wurstclient/mixin/TelemetryManagerMixin.java b/src/main/java/net/wurstclient/mixin/TelemetryManagerMixin.java index 2586718c..627be646 100644 --- a/src/main/java/net/wurstclient/mixin/TelemetryManagerMixin.java +++ b/src/main/java/net/wurstclient/mixin/TelemetryManagerMixin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/mixin/TextVisitFactoryMixin.java b/src/main/java/net/wurstclient/mixin/TextVisitFactoryMixin.java index cb8a8d2b..7b61061e 100644 --- a/src/main/java/net/wurstclient/mixin/TextVisitFactoryMixin.java +++ b/src/main/java/net/wurstclient/mixin/TextVisitFactoryMixin.java @@ -1,29 +1,29 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.ModifyArg; - -import net.minecraft.text.TextVisitFactory; -import net.wurstclient.WurstClient; - -@Mixin(TextVisitFactory.class) -public abstract class TextVisitFactoryMixin -{ - @ModifyArg(at = @At(value = "INVOKE", - target = "Lnet/minecraft/text/TextVisitFactory;visitFormatted(Ljava/lang/String;ILnet/minecraft/text/Style;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Z", - ordinal = 0), - method = "visitFormatted(Ljava/lang/String;ILnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Z", - index = 0) - private static String adjustText(String text) - { - return WurstClient.INSTANCE.getHax().nameProtectHack.protect(text); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.ModifyArg; + +import net.minecraft.text.TextVisitFactory; +import net.wurstclient.WurstClient; + +@Mixin(TextVisitFactory.class) +public abstract class TextVisitFactoryMixin +{ + @ModifyArg(at = @At(value = "INVOKE", + target = "Lnet/minecraft/text/TextVisitFactory;visitFormatted(Ljava/lang/String;ILnet/minecraft/text/Style;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Z", + ordinal = 0), + method = "visitFormatted(Ljava/lang/String;ILnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Z", + index = 0) + private static String adjustText(String text) + { + return WurstClient.INSTANCE.getHax().nameProtectHack.protect(text); + } +} diff --git a/src/main/java/net/wurstclient/mixin/TitleScreenMixin.java b/src/main/java/net/wurstclient/mixin/TitleScreenMixin.java index 3f54c79f..022879a4 100644 --- a/src/main/java/net/wurstclient/mixin/TitleScreenMixin.java +++ b/src/main/java/net/wurstclient/mixin/TitleScreenMixin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/mixin/WorldMixin.java b/src/main/java/net/wurstclient/mixin/WorldMixin.java index 4dc50827..5b4a7357 100644 --- a/src/main/java/net/wurstclient/mixin/WorldMixin.java +++ b/src/main/java/net/wurstclient/mixin/WorldMixin.java @@ -1,54 +1,54 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import net.minecraft.world.World; -import net.minecraft.world.WorldAccess; -import net.wurstclient.WurstClient; -import net.wurstclient.hacks.NoWeatherHack; - -@Mixin(World.class) -public abstract class WorldMixin implements WorldAccess, AutoCloseable -{ - @Inject(at = @At("HEAD"), - method = "getRainGradient(F)F", - cancellable = true) - private void onGetRainGradient(float delta, - CallbackInfoReturnable cir) - { - if(WurstClient.INSTANCE.getHax().noWeatherHack.isRainDisabled()) - cir.setReturnValue(0F); - } - - @Override - public float getSkyAngle(float tickDelta) - { - NoWeatherHack noWeather = WurstClient.INSTANCE.getHax().noWeatherHack; - - long timeOfDay = noWeather.isTimeChanged() ? noWeather.getChangedTime() - : getLevelProperties().getTimeOfDay(); - - return getDimension().getSkyAngle(timeOfDay); - } - - @Override - public int getMoonPhase() - { - NoWeatherHack noWeather = WurstClient.INSTANCE.getHax().noWeatherHack; - - if(noWeather.isMoonPhaseChanged()) - return noWeather.getChangedMoonPhase(); - - return getDimension().getMoonPhase(getLunarTime()); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.world.World; +import net.minecraft.world.WorldAccess; +import net.wurstclient.WurstClient; +import net.wurstclient.hacks.NoWeatherHack; + +@Mixin(World.class) +public abstract class WorldMixin implements WorldAccess, AutoCloseable +{ + @Inject(at = @At("HEAD"), + method = "getRainGradient(F)F", + cancellable = true) + private void onGetRainGradient(float delta, + CallbackInfoReturnable cir) + { + if(WurstClient.INSTANCE.getHax().noWeatherHack.isRainDisabled()) + cir.setReturnValue(0F); + } + + @Override + public float getSkyAngle(float tickDelta) + { + NoWeatherHack noWeather = WurstClient.INSTANCE.getHax().noWeatherHack; + + long timeOfDay = noWeather.isTimeChanged() ? noWeather.getChangedTime() + : getLevelProperties().getTimeOfDay(); + + return getDimension().getSkyAngle(timeOfDay); + } + + @Override + public int getMoonPhase() + { + NoWeatherHack noWeather = WurstClient.INSTANCE.getHax().noWeatherHack; + + if(noWeather.isMoonPhaseChanged()) + return noWeather.getChangedMoonPhase(); + + return getDimension().getMoonPhase(getLunarTime()); + } +} diff --git a/src/main/java/net/wurstclient/mixin/WorldRendererMixin.java b/src/main/java/net/wurstclient/mixin/WorldRendererMixin.java index 433dd1cf..3099ee5c 100644 --- a/src/main/java/net/wurstclient/mixin/WorldRendererMixin.java +++ b/src/main/java/net/wurstclient/mixin/WorldRendererMixin.java @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.mixin; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import net.minecraft.client.render.Camera; -import net.minecraft.client.render.WorldRenderer; -import net.wurstclient.WurstClient; - -@Mixin(WorldRenderer.class) -public class WorldRendererMixin -{ - @Inject(at = @At("HEAD"), - method = "hasBlindnessOrDarkness(Lnet/minecraft/client/render/Camera;)Z", - cancellable = true) - private void onHasBlindnessOrDarkness(Camera camera, - CallbackInfoReturnable ci) - { - if(WurstClient.INSTANCE.getHax().antiBlindHack.isEnabled()) - ci.setReturnValue(false); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.client.render.Camera; +import net.minecraft.client.render.WorldRenderer; +import net.wurstclient.WurstClient; + +@Mixin(WorldRenderer.class) +public class WorldRendererMixin +{ + @Inject(at = @At("HEAD"), + method = "hasBlindnessOrDarkness(Lnet/minecraft/client/render/Camera;)Z", + cancellable = true) + private void onHasBlindnessOrDarkness(Camera camera, + CallbackInfoReturnable ci) + { + if(WurstClient.INSTANCE.getHax().antiBlindHack.isEnabled()) + ci.setReturnValue(false); + } +} diff --git a/src/main/java/net/wurstclient/mixinterface/IClientPlayerEntity.java b/src/main/java/net/wurstclient/mixinterface/IClientPlayerEntity.java index 68e031fc..dc4d8bbc 100644 --- a/src/main/java/net/wurstclient/mixinterface/IClientPlayerEntity.java +++ b/src/main/java/net/wurstclient/mixinterface/IClientPlayerEntity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/mixinterface/IClientPlayerInteractionManager.java b/src/main/java/net/wurstclient/mixinterface/IClientPlayerInteractionManager.java index 84868ca1..b7913582 100644 --- a/src/main/java/net/wurstclient/mixinterface/IClientPlayerInteractionManager.java +++ b/src/main/java/net/wurstclient/mixinterface/IClientPlayerInteractionManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/mixinterface/IKeyBinding.java b/src/main/java/net/wurstclient/mixinterface/IKeyBinding.java index 48f80188..8b0409a8 100644 --- a/src/main/java/net/wurstclient/mixinterface/IKeyBinding.java +++ b/src/main/java/net/wurstclient/mixinterface/IKeyBinding.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/mixinterface/ILanguageManager.java b/src/main/java/net/wurstclient/mixinterface/ILanguageManager.java index e0213f0b..3a0e6491 100644 --- a/src/main/java/net/wurstclient/mixinterface/ILanguageManager.java +++ b/src/main/java/net/wurstclient/mixinterface/ILanguageManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/mixinterface/IMinecraftClient.java b/src/main/java/net/wurstclient/mixinterface/IMinecraftClient.java index 06796c49..eb10f297 100644 --- a/src/main/java/net/wurstclient/mixinterface/IMinecraftClient.java +++ b/src/main/java/net/wurstclient/mixinterface/IMinecraftClient.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/mixinterface/IMultiplayerScreen.java b/src/main/java/net/wurstclient/mixinterface/IMultiplayerScreen.java index 39f7539d..0183c6c6 100644 --- a/src/main/java/net/wurstclient/mixinterface/IMultiplayerScreen.java +++ b/src/main/java/net/wurstclient/mixinterface/IMultiplayerScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/mixinterface/ISimpleOption.java b/src/main/java/net/wurstclient/mixinterface/ISimpleOption.java index a117be67..287e4e5e 100644 --- a/src/main/java/net/wurstclient/mixinterface/ISimpleOption.java +++ b/src/main/java/net/wurstclient/mixinterface/ISimpleOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/navigator/Navigator.java b/src/main/java/net/wurstclient/navigator/Navigator.java index 8f0d8427..36dbc095 100644 --- a/src/main/java/net/wurstclient/navigator/Navigator.java +++ b/src/main/java/net/wurstclient/navigator/Navigator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/navigator/NavigatorFeatureScreen.java b/src/main/java/net/wurstclient/navigator/NavigatorFeatureScreen.java index ffaa183a..e5c7b997 100644 --- a/src/main/java/net/wurstclient/navigator/NavigatorFeatureScreen.java +++ b/src/main/java/net/wurstclient/navigator/NavigatorFeatureScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/navigator/NavigatorMainScreen.java b/src/main/java/net/wurstclient/navigator/NavigatorMainScreen.java index 70cd9d69..74f27d39 100644 --- a/src/main/java/net/wurstclient/navigator/NavigatorMainScreen.java +++ b/src/main/java/net/wurstclient/navigator/NavigatorMainScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/navigator/NavigatorNewKeybindScreen.java b/src/main/java/net/wurstclient/navigator/NavigatorNewKeybindScreen.java index d6558973..5da1a8fe 100644 --- a/src/main/java/net/wurstclient/navigator/NavigatorNewKeybindScreen.java +++ b/src/main/java/net/wurstclient/navigator/NavigatorNewKeybindScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/navigator/NavigatorRemoveKeybindScreen.java b/src/main/java/net/wurstclient/navigator/NavigatorRemoveKeybindScreen.java index 9bfa8da1..d17ca9c1 100644 --- a/src/main/java/net/wurstclient/navigator/NavigatorRemoveKeybindScreen.java +++ b/src/main/java/net/wurstclient/navigator/NavigatorRemoveKeybindScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/navigator/NavigatorScreen.java b/src/main/java/net/wurstclient/navigator/NavigatorScreen.java index 556bf174..ea26ce7c 100644 --- a/src/main/java/net/wurstclient/navigator/NavigatorScreen.java +++ b/src/main/java/net/wurstclient/navigator/NavigatorScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/navigator/PreferencesFile.java b/src/main/java/net/wurstclient/navigator/PreferencesFile.java index 852fdb6a..56fd82b2 100644 --- a/src/main/java/net/wurstclient/navigator/PreferencesFile.java +++ b/src/main/java/net/wurstclient/navigator/PreferencesFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/nochatreports/ForcedChatReportsScreen.java b/src/main/java/net/wurstclient/nochatreports/ForcedChatReportsScreen.java index 88864e7c..55b02e44 100644 --- a/src/main/java/net/wurstclient/nochatreports/ForcedChatReportsScreen.java +++ b/src/main/java/net/wurstclient/nochatreports/ForcedChatReportsScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/nochatreports/NcrModRequiredScreen.java b/src/main/java/net/wurstclient/nochatreports/NcrModRequiredScreen.java index fe212eb8..56d727e2 100644 --- a/src/main/java/net/wurstclient/nochatreports/NcrModRequiredScreen.java +++ b/src/main/java/net/wurstclient/nochatreports/NcrModRequiredScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/options/EnterProfileNameScreen.java b/src/main/java/net/wurstclient/options/EnterProfileNameScreen.java index b8f8962c..eff23e17 100644 --- a/src/main/java/net/wurstclient/options/EnterProfileNameScreen.java +++ b/src/main/java/net/wurstclient/options/EnterProfileNameScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/options/KeybindEditorScreen.java b/src/main/java/net/wurstclient/options/KeybindEditorScreen.java index fe346160..5322a871 100644 --- a/src/main/java/net/wurstclient/options/KeybindEditorScreen.java +++ b/src/main/java/net/wurstclient/options/KeybindEditorScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/options/KeybindManagerScreen.java b/src/main/java/net/wurstclient/options/KeybindManagerScreen.java index 43d5d7c4..5749393c 100644 --- a/src/main/java/net/wurstclient/options/KeybindManagerScreen.java +++ b/src/main/java/net/wurstclient/options/KeybindManagerScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/options/KeybindProfilesScreen.java b/src/main/java/net/wurstclient/options/KeybindProfilesScreen.java index 0946e70a..282858e1 100644 --- a/src/main/java/net/wurstclient/options/KeybindProfilesScreen.java +++ b/src/main/java/net/wurstclient/options/KeybindProfilesScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/options/PressAKeyCallback.java b/src/main/java/net/wurstclient/options/PressAKeyCallback.java index 001f6343..0864db43 100644 --- a/src/main/java/net/wurstclient/options/PressAKeyCallback.java +++ b/src/main/java/net/wurstclient/options/PressAKeyCallback.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/options/PressAKeyScreen.java b/src/main/java/net/wurstclient/options/PressAKeyScreen.java index da209054..5be2d1ed 100644 --- a/src/main/java/net/wurstclient/options/PressAKeyScreen.java +++ b/src/main/java/net/wurstclient/options/PressAKeyScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/options/WurstOptionsScreen.java b/src/main/java/net/wurstclient/options/WurstOptionsScreen.java index 7a1eee33..b73f84ca 100644 --- a/src/main/java/net/wurstclient/options/WurstOptionsScreen.java +++ b/src/main/java/net/wurstclient/options/WurstOptionsScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/options/ZoomManagerScreen.java b/src/main/java/net/wurstclient/options/ZoomManagerScreen.java index e9df08ef..10293eac 100644 --- a/src/main/java/net/wurstclient/options/ZoomManagerScreen.java +++ b/src/main/java/net/wurstclient/options/ZoomManagerScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/other_feature/OtfList.java b/src/main/java/net/wurstclient/other_feature/OtfList.java index 5076b5fe..4ae69537 100644 --- a/src/main/java/net/wurstclient/other_feature/OtfList.java +++ b/src/main/java/net/wurstclient/other_feature/OtfList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/other_feature/OtherFeature.java b/src/main/java/net/wurstclient/other_feature/OtherFeature.java index 8065e3da..d7a5ce58 100644 --- a/src/main/java/net/wurstclient/other_feature/OtherFeature.java +++ b/src/main/java/net/wurstclient/other_feature/OtherFeature.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/other_features/ChangelogOtf.java b/src/main/java/net/wurstclient/other_features/ChangelogOtf.java index 36b9eab2..651c122d 100644 --- a/src/main/java/net/wurstclient/other_features/ChangelogOtf.java +++ b/src/main/java/net/wurstclient/other_features/ChangelogOtf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/other_features/CleanUpOtf.java b/src/main/java/net/wurstclient/other_features/CleanUpOtf.java index 035abc8b..c14f7a4a 100644 --- a/src/main/java/net/wurstclient/other_features/CleanUpOtf.java +++ b/src/main/java/net/wurstclient/other_features/CleanUpOtf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/other_features/DisableOtf.java b/src/main/java/net/wurstclient/other_features/DisableOtf.java index ff6ecb44..edcb61c8 100644 --- a/src/main/java/net/wurstclient/other_features/DisableOtf.java +++ b/src/main/java/net/wurstclient/other_features/DisableOtf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/other_features/HackListOtf.java b/src/main/java/net/wurstclient/other_features/HackListOtf.java index 96915c27..a7566a68 100644 --- a/src/main/java/net/wurstclient/other_features/HackListOtf.java +++ b/src/main/java/net/wurstclient/other_features/HackListOtf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/other_features/KeybindManagerOtf.java b/src/main/java/net/wurstclient/other_features/KeybindManagerOtf.java index 6ca4277b..5f755a06 100644 --- a/src/main/java/net/wurstclient/other_features/KeybindManagerOtf.java +++ b/src/main/java/net/wurstclient/other_features/KeybindManagerOtf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/other_features/LastServerOtf.java b/src/main/java/net/wurstclient/other_features/LastServerOtf.java index 77b94c25..c766bef1 100644 --- a/src/main/java/net/wurstclient/other_features/LastServerOtf.java +++ b/src/main/java/net/wurstclient/other_features/LastServerOtf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/other_features/NoChatReportsOtf.java b/src/main/java/net/wurstclient/other_features/NoChatReportsOtf.java index c6e38a45..3e81dd82 100644 --- a/src/main/java/net/wurstclient/other_features/NoChatReportsOtf.java +++ b/src/main/java/net/wurstclient/other_features/NoChatReportsOtf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/other_features/NoTelemetryOtf.java b/src/main/java/net/wurstclient/other_features/NoTelemetryOtf.java index 2b27d467..68b1e62f 100644 --- a/src/main/java/net/wurstclient/other_features/NoTelemetryOtf.java +++ b/src/main/java/net/wurstclient/other_features/NoTelemetryOtf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/other_features/ReconnectOtf.java b/src/main/java/net/wurstclient/other_features/ReconnectOtf.java index fdba473c..0ebaae00 100644 --- a/src/main/java/net/wurstclient/other_features/ReconnectOtf.java +++ b/src/main/java/net/wurstclient/other_features/ReconnectOtf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/other_features/ServerFinderOtf.java b/src/main/java/net/wurstclient/other_features/ServerFinderOtf.java index e1562408..b2e853c7 100644 --- a/src/main/java/net/wurstclient/other_features/ServerFinderOtf.java +++ b/src/main/java/net/wurstclient/other_features/ServerFinderOtf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/other_features/TabGuiOtf.java b/src/main/java/net/wurstclient/other_features/TabGuiOtf.java index 681fa091..a9f3b6ba 100644 --- a/src/main/java/net/wurstclient/other_features/TabGuiOtf.java +++ b/src/main/java/net/wurstclient/other_features/TabGuiOtf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/other_features/TranslationsOtf.java b/src/main/java/net/wurstclient/other_features/TranslationsOtf.java index 886d0c5d..194c8a4d 100644 --- a/src/main/java/net/wurstclient/other_features/TranslationsOtf.java +++ b/src/main/java/net/wurstclient/other_features/TranslationsOtf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/other_features/VanillaSpoofOtf.java b/src/main/java/net/wurstclient/other_features/VanillaSpoofOtf.java index ba0ee0b5..e39d7147 100644 --- a/src/main/java/net/wurstclient/other_features/VanillaSpoofOtf.java +++ b/src/main/java/net/wurstclient/other_features/VanillaSpoofOtf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/other_features/WikiDataExportOtf.java b/src/main/java/net/wurstclient/other_features/WikiDataExportOtf.java index c5117094..1ad79d0f 100644 --- a/src/main/java/net/wurstclient/other_features/WikiDataExportOtf.java +++ b/src/main/java/net/wurstclient/other_features/WikiDataExportOtf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/other_features/WurstCapesOtf.java b/src/main/java/net/wurstclient/other_features/WurstCapesOtf.java index b1e1f698..d2966810 100644 --- a/src/main/java/net/wurstclient/other_features/WurstCapesOtf.java +++ b/src/main/java/net/wurstclient/other_features/WurstCapesOtf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/other_features/WurstLogoOtf.java b/src/main/java/net/wurstclient/other_features/WurstLogoOtf.java index 7034203f..d1d9569f 100644 --- a/src/main/java/net/wurstclient/other_features/WurstLogoOtf.java +++ b/src/main/java/net/wurstclient/other_features/WurstLogoOtf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/other_features/ZoomOtf.java b/src/main/java/net/wurstclient/other_features/ZoomOtf.java index 20f6c56b..1af1905a 100644 --- a/src/main/java/net/wurstclient/other_features/ZoomOtf.java +++ b/src/main/java/net/wurstclient/other_features/ZoomOtf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/serverfinder/CleanUpScreen.java b/src/main/java/net/wurstclient/serverfinder/CleanUpScreen.java index c2fe9d46..41e250c9 100644 --- a/src/main/java/net/wurstclient/serverfinder/CleanUpScreen.java +++ b/src/main/java/net/wurstclient/serverfinder/CleanUpScreen.java @@ -1,268 +1,268 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.serverfinder; - -import java.util.Arrays; -import java.util.List; -import java.util.function.Supplier; - -import org.lwjgl.glfw.GLFW; - -import net.fabricmc.fabric.api.client.screen.v1.Screens; -import net.minecraft.SharedConstants; -import net.minecraft.client.gui.DrawContext; -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen; -import net.minecraft.client.gui.screen.multiplayer.MultiplayerServerListWidget; -import net.minecraft.client.gui.widget.ButtonWidget; -import net.minecraft.client.gui.widget.ClickableWidget; -import net.minecraft.client.network.ServerInfo; -import net.minecraft.text.Text; -import net.wurstclient.mixinterface.IMultiplayerScreen; - -public class CleanUpScreen extends Screen -{ - private MultiplayerScreen prevScreen; - private ButtonWidget cleanUpButton; - - private boolean removeAll; - private boolean cleanupFailed = true; - private boolean cleanupOutdated = true; - private boolean cleanupRename = true; - private boolean cleanupUnknown = true; - private boolean cleanupGriefMe; - - public CleanUpScreen(MultiplayerScreen prevScreen) - { - super(Text.literal("")); - this.prevScreen = prevScreen; - } - - @Override - public void init() - { - addDrawableChild( - new CleanUpButton(width / 2 - 100, height / 4 + 168 + 12, - () -> "Cancel", "", b -> client.setScreen(prevScreen))); - - addDrawableChild(cleanUpButton = new CleanUpButton(width / 2 - 100, - height / 4 + 144 + 12, () -> "Clean Up", - "Start the Clean Up with the settings\n" + "you specified above.\n" - + "It might look like the game is not\n" - + "responding for a couple of seconds.", - b -> cleanUp())); - - addDrawableChild( - new CleanUpButton(width / 2 - 100, height / 4 - 24 + 12, - () -> "Unknown Hosts: " + removeOrKeep(cleanupUnknown), - "Servers that clearly don't exist.", - b -> cleanupUnknown = !cleanupUnknown)); - - addDrawableChild(new CleanUpButton(width / 2 - 100, height / 4 + 0 + 12, - () -> "Outdated Servers: " + removeOrKeep(cleanupOutdated), - "Servers that run a different Minecraft\n" + "version than you.", - b -> cleanupOutdated = !cleanupOutdated)); - - addDrawableChild( - new CleanUpButton(width / 2 - 100, height / 4 + 24 + 12, - () -> "Failed Ping: " + removeOrKeep(cleanupFailed), - "All servers that failed the last ping.\n" - + "Make sure that the last ping is complete\n" - + "before you do this. That means: Go back,\n" - + "press the refresh button and wait until\n" - + "all servers are done refreshing.", - b -> cleanupFailed = !cleanupFailed)); - - addDrawableChild( - new CleanUpButton(width / 2 - 100, height / 4 + 48 + 12, - () -> "\"Grief me\" Servers: " + removeOrKeep(cleanupGriefMe), - "All servers where the name starts with \"Grief me\"\n" - + "Useful for removing servers found by ServerFinder.", - b -> cleanupGriefMe = !cleanupGriefMe)); - - addDrawableChild( - new CleanUpButton(width / 2 - 100, height / 4 + 72 + 12, - () -> "\u00a7cRemove all Servers: " + yesOrNo(removeAll), - "This will completely clear your server\n" - + "list. \u00a7cUse with caution!\u00a7r", - b -> removeAll = !removeAll)); - - addDrawableChild( - new CleanUpButton(width / 2 - 100, height / 4 + 96 + 12, - () -> "Rename all Servers: " + yesOrNo(cleanupRename), - "Renames your servers to \"Grief me #1\",\n" - + "\"Grief me #2\", etc.", - b -> cleanupRename = !cleanupRename)); - } - - private String yesOrNo(boolean b) - { - return b ? "Yes" : "No"; - } - - private String removeOrKeep(boolean b) - { - return b ? "Remove" : "Keep"; - } - - private void cleanUp() - { - for(int i = prevScreen.getServerList().size() - 1; i >= 0; i--) - { - ServerInfo server = prevScreen.getServerList().get(i); - - if(removeAll || shouldRemove(server)) - prevScreen.getServerList().remove(server); - } - - if(cleanupRename) - for(int i = 0; i < prevScreen.getServerList().size(); i++) - { - ServerInfo server = prevScreen.getServerList().get(i); - server.name = "Grief me #" + (i + 1); - } - - saveServerList(); - client.setScreen(prevScreen); - } - - private boolean shouldRemove(ServerInfo server) - { - if(server == null) - return false; - - if(cleanupUnknown && isUnknownHost(server)) - return true; - - if(cleanupOutdated && !isSameProtocol(server)) - return true; - - if(cleanupFailed && isFailedPing(server)) - return true; - - if(cleanupGriefMe && isGriefMeServer(server)) - return true; - - return false; - } - - private boolean isUnknownHost(ServerInfo server) - { - if(server.label == null) - return false; - - if(server.label.getString() == null) - return false; - - return server.label.getString() - .equals("\u00a74Can\'t resolve hostname"); - } - - private boolean isSameProtocol(ServerInfo server) - { - return server.protocolVersion == SharedConstants.getGameVersion() - .getProtocolVersion(); - } - - private boolean isFailedPing(ServerInfo server) - { - return server.ping != -2L && server.ping < 0L; - } - - private boolean isGriefMeServer(ServerInfo server) - { - return server.name != null && server.name.startsWith("Grief me"); - } - - private void saveServerList() - { - prevScreen.getServerList().saveFile(); - - MultiplayerServerListWidget serverListSelector = - ((IMultiplayerScreen)prevScreen).getServerListSelector(); - - serverListSelector.setSelected(null); - serverListSelector.setServers(prevScreen.getServerList()); - } - - @Override - public boolean keyPressed(int keyCode, int scanCode, int int_3) - { - if(keyCode == GLFW.GLFW_KEY_ENTER) - cleanUpButton.onPress(); - - return super.keyPressed(keyCode, scanCode, int_3); - } - - @Override - public void render(DrawContext context, int mouseX, int mouseY, - float partialTicks) - { - renderBackground(context); - context.drawCenteredTextWithShadow(textRenderer, "Clean Up", width / 2, - 20, 16777215); - context.drawCenteredTextWithShadow(textRenderer, - "Please select the servers you want to remove:", width / 2, 36, - 10526880); - - super.render(context, mouseX, mouseY, partialTicks); - renderButtonTooltip(context, mouseX, mouseY); - } - - private void renderButtonTooltip(DrawContext context, int mouseX, - int mouseY) - { - for(ClickableWidget button : Screens.getButtons(this)) - { - if(!button.isSelected() || !(button instanceof CleanUpButton)) - continue; - - CleanUpButton cuButton = (CleanUpButton)button; - - if(cuButton.tooltip.isEmpty()) - continue; - - context.drawTooltip(textRenderer, cuButton.tooltip, mouseX, mouseY); - break; - } - } - - private final class CleanUpButton extends ButtonWidget - { - private final Supplier messageSupplier; - private final List tooltip; - - public CleanUpButton(int x, int y, Supplier messageSupplier, - String tooltip, PressAction pressAction) - { - super(x, y, 200, 20, Text.literal(messageSupplier.get()), - pressAction, ButtonWidget.DEFAULT_NARRATION_SUPPLIER); - this.messageSupplier = messageSupplier; - - if(tooltip.isEmpty()) - this.tooltip = Arrays.asList(); - else - { - String[] lines = tooltip.split("\n"); - - Text[] lines2 = new Text[lines.length]; - for(int i = 0; i < lines.length; i++) - lines2[i] = Text.literal(lines[i]); - - this.tooltip = Arrays.asList(lines2); - } - } - - @Override - public void onPress() - { - super.onPress(); - setMessage(Text.literal(messageSupplier.get())); - } - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.serverfinder; + +import java.util.Arrays; +import java.util.List; +import java.util.function.Supplier; + +import org.lwjgl.glfw.GLFW; + +import net.fabricmc.fabric.api.client.screen.v1.Screens; +import net.minecraft.SharedConstants; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen; +import net.minecraft.client.gui.screen.multiplayer.MultiplayerServerListWidget; +import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.client.gui.widget.ClickableWidget; +import net.minecraft.client.network.ServerInfo; +import net.minecraft.text.Text; +import net.wurstclient.mixinterface.IMultiplayerScreen; + +public class CleanUpScreen extends Screen +{ + private MultiplayerScreen prevScreen; + private ButtonWidget cleanUpButton; + + private boolean removeAll; + private boolean cleanupFailed = true; + private boolean cleanupOutdated = true; + private boolean cleanupRename = true; + private boolean cleanupUnknown = true; + private boolean cleanupGriefMe; + + public CleanUpScreen(MultiplayerScreen prevScreen) + { + super(Text.literal("")); + this.prevScreen = prevScreen; + } + + @Override + public void init() + { + addDrawableChild( + new CleanUpButton(width / 2 - 100, height / 4 + 168 + 12, + () -> "Cancel", "", b -> client.setScreen(prevScreen))); + + addDrawableChild(cleanUpButton = new CleanUpButton(width / 2 - 100, + height / 4 + 144 + 12, () -> "Clean Up", + "Start the Clean Up with the settings\n" + "you specified above.\n" + + "It might look like the game is not\n" + + "responding for a couple of seconds.", + b -> cleanUp())); + + addDrawableChild( + new CleanUpButton(width / 2 - 100, height / 4 - 24 + 12, + () -> "Unknown Hosts: " + removeOrKeep(cleanupUnknown), + "Servers that clearly don't exist.", + b -> cleanupUnknown = !cleanupUnknown)); + + addDrawableChild(new CleanUpButton(width / 2 - 100, height / 4 + 0 + 12, + () -> "Outdated Servers: " + removeOrKeep(cleanupOutdated), + "Servers that run a different Minecraft\n" + "version than you.", + b -> cleanupOutdated = !cleanupOutdated)); + + addDrawableChild( + new CleanUpButton(width / 2 - 100, height / 4 + 24 + 12, + () -> "Failed Ping: " + removeOrKeep(cleanupFailed), + "All servers that failed the last ping.\n" + + "Make sure that the last ping is complete\n" + + "before you do this. That means: Go back,\n" + + "press the refresh button and wait until\n" + + "all servers are done refreshing.", + b -> cleanupFailed = !cleanupFailed)); + + addDrawableChild( + new CleanUpButton(width / 2 - 100, height / 4 + 48 + 12, + () -> "\"Grief me\" Servers: " + removeOrKeep(cleanupGriefMe), + "All servers where the name starts with \"Grief me\"\n" + + "Useful for removing servers found by ServerFinder.", + b -> cleanupGriefMe = !cleanupGriefMe)); + + addDrawableChild( + new CleanUpButton(width / 2 - 100, height / 4 + 72 + 12, + () -> "\u00a7cRemove all Servers: " + yesOrNo(removeAll), + "This will completely clear your server\n" + + "list. \u00a7cUse with caution!\u00a7r", + b -> removeAll = !removeAll)); + + addDrawableChild( + new CleanUpButton(width / 2 - 100, height / 4 + 96 + 12, + () -> "Rename all Servers: " + yesOrNo(cleanupRename), + "Renames your servers to \"Grief me #1\",\n" + + "\"Grief me #2\", etc.", + b -> cleanupRename = !cleanupRename)); + } + + private String yesOrNo(boolean b) + { + return b ? "Yes" : "No"; + } + + private String removeOrKeep(boolean b) + { + return b ? "Remove" : "Keep"; + } + + private void cleanUp() + { + for(int i = prevScreen.getServerList().size() - 1; i >= 0; i--) + { + ServerInfo server = prevScreen.getServerList().get(i); + + if(removeAll || shouldRemove(server)) + prevScreen.getServerList().remove(server); + } + + if(cleanupRename) + for(int i = 0; i < prevScreen.getServerList().size(); i++) + { + ServerInfo server = prevScreen.getServerList().get(i); + server.name = "Grief me #" + (i + 1); + } + + saveServerList(); + client.setScreen(prevScreen); + } + + private boolean shouldRemove(ServerInfo server) + { + if(server == null) + return false; + + if(cleanupUnknown && isUnknownHost(server)) + return true; + + if(cleanupOutdated && !isSameProtocol(server)) + return true; + + if(cleanupFailed && isFailedPing(server)) + return true; + + if(cleanupGriefMe && isGriefMeServer(server)) + return true; + + return false; + } + + private boolean isUnknownHost(ServerInfo server) + { + if(server.label == null) + return false; + + if(server.label.getString() == null) + return false; + + return server.label.getString() + .equals("\u00a74Can\'t resolve hostname"); + } + + private boolean isSameProtocol(ServerInfo server) + { + return server.protocolVersion == SharedConstants.getGameVersion() + .getProtocolVersion(); + } + + private boolean isFailedPing(ServerInfo server) + { + return server.ping != -2L && server.ping < 0L; + } + + private boolean isGriefMeServer(ServerInfo server) + { + return server.name != null && server.name.startsWith("Grief me"); + } + + private void saveServerList() + { + prevScreen.getServerList().saveFile(); + + MultiplayerServerListWidget serverListSelector = + ((IMultiplayerScreen)prevScreen).getServerListSelector(); + + serverListSelector.setSelected(null); + serverListSelector.setServers(prevScreen.getServerList()); + } + + @Override + public boolean keyPressed(int keyCode, int scanCode, int int_3) + { + if(keyCode == GLFW.GLFW_KEY_ENTER) + cleanUpButton.onPress(); + + return super.keyPressed(keyCode, scanCode, int_3); + } + + @Override + public void render(DrawContext context, int mouseX, int mouseY, + float partialTicks) + { + renderBackground(context); + context.drawCenteredTextWithShadow(textRenderer, "Clean Up", width / 2, + 20, 16777215); + context.drawCenteredTextWithShadow(textRenderer, + "Please select the servers you want to remove:", width / 2, 36, + 10526880); + + super.render(context, mouseX, mouseY, partialTicks); + renderButtonTooltip(context, mouseX, mouseY); + } + + private void renderButtonTooltip(DrawContext context, int mouseX, + int mouseY) + { + for(ClickableWidget button : Screens.getButtons(this)) + { + if(!button.isSelected() || !(button instanceof CleanUpButton)) + continue; + + CleanUpButton cuButton = (CleanUpButton)button; + + if(cuButton.tooltip.isEmpty()) + continue; + + context.drawTooltip(textRenderer, cuButton.tooltip, mouseX, mouseY); + break; + } + } + + private final class CleanUpButton extends ButtonWidget + { + private final Supplier messageSupplier; + private final List tooltip; + + public CleanUpButton(int x, int y, Supplier messageSupplier, + String tooltip, PressAction pressAction) + { + super(x, y, 200, 20, Text.literal(messageSupplier.get()), + pressAction, ButtonWidget.DEFAULT_NARRATION_SUPPLIER); + this.messageSupplier = messageSupplier; + + if(tooltip.isEmpty()) + this.tooltip = Arrays.asList(); + else + { + String[] lines = tooltip.split("\n"); + + Text[] lines2 = new Text[lines.length]; + for(int i = 0; i < lines.length; i++) + lines2[i] = Text.literal(lines[i]); + + this.tooltip = Arrays.asList(lines2); + } + } + + @Override + public void onPress() + { + super.onPress(); + setMessage(Text.literal(messageSupplier.get())); + } + } +} diff --git a/src/main/java/net/wurstclient/serverfinder/ServerFinderScreen.java b/src/main/java/net/wurstclient/serverfinder/ServerFinderScreen.java index f8429ed6..0c26c6fb 100644 --- a/src/main/java/net/wurstclient/serverfinder/ServerFinderScreen.java +++ b/src/main/java/net/wurstclient/serverfinder/ServerFinderScreen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/serverfinder/WurstServerPinger.java b/src/main/java/net/wurstclient/serverfinder/WurstServerPinger.java index 387fad20..85dec06a 100644 --- a/src/main/java/net/wurstclient/serverfinder/WurstServerPinger.java +++ b/src/main/java/net/wurstclient/serverfinder/WurstServerPinger.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/AttackSpeedSliderSetting.java b/src/main/java/net/wurstclient/settings/AttackSpeedSliderSetting.java index f6854fdb..c1653bf7 100644 --- a/src/main/java/net/wurstclient/settings/AttackSpeedSliderSetting.java +++ b/src/main/java/net/wurstclient/settings/AttackSpeedSliderSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/BlockListSetting.java b/src/main/java/net/wurstclient/settings/BlockListSetting.java index afc3d329..f53f6c93 100644 --- a/src/main/java/net/wurstclient/settings/BlockListSetting.java +++ b/src/main/java/net/wurstclient/settings/BlockListSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/BlockSetting.java b/src/main/java/net/wurstclient/settings/BlockSetting.java index b0ad53f1..d52e9e90 100644 --- a/src/main/java/net/wurstclient/settings/BlockSetting.java +++ b/src/main/java/net/wurstclient/settings/BlockSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/BookOffersSetting.java b/src/main/java/net/wurstclient/settings/BookOffersSetting.java index 46dcbe63..3ff6bb34 100644 --- a/src/main/java/net/wurstclient/settings/BookOffersSetting.java +++ b/src/main/java/net/wurstclient/settings/BookOffersSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/CheckboxLock.java b/src/main/java/net/wurstclient/settings/CheckboxLock.java index 72815f63..4b8b996d 100644 --- a/src/main/java/net/wurstclient/settings/CheckboxLock.java +++ b/src/main/java/net/wurstclient/settings/CheckboxLock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/CheckboxSetting.java b/src/main/java/net/wurstclient/settings/CheckboxSetting.java index d6e750a5..f420adac 100644 --- a/src/main/java/net/wurstclient/settings/CheckboxSetting.java +++ b/src/main/java/net/wurstclient/settings/CheckboxSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/ChunkAreaSetting.java b/src/main/java/net/wurstclient/settings/ChunkAreaSetting.java index 9c60b777..ee96f801 100644 --- a/src/main/java/net/wurstclient/settings/ChunkAreaSetting.java +++ b/src/main/java/net/wurstclient/settings/ChunkAreaSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/ColorSetting.java b/src/main/java/net/wurstclient/settings/ColorSetting.java index bc16de00..105b253d 100644 --- a/src/main/java/net/wurstclient/settings/ColorSetting.java +++ b/src/main/java/net/wurstclient/settings/ColorSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/EnumSetting.java b/src/main/java/net/wurstclient/settings/EnumSetting.java index 51f47983..2b3b84be 100644 --- a/src/main/java/net/wurstclient/settings/EnumSetting.java +++ b/src/main/java/net/wurstclient/settings/EnumSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/EspBoxSizeSetting.java b/src/main/java/net/wurstclient/settings/EspBoxSizeSetting.java index dce32108..c4db0e01 100644 --- a/src/main/java/net/wurstclient/settings/EspBoxSizeSetting.java +++ b/src/main/java/net/wurstclient/settings/EspBoxSizeSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/EspStyleSetting.java b/src/main/java/net/wurstclient/settings/EspStyleSetting.java index f06da31b..277ecbac 100644 --- a/src/main/java/net/wurstclient/settings/EspStyleSetting.java +++ b/src/main/java/net/wurstclient/settings/EspStyleSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/FacingSetting.java b/src/main/java/net/wurstclient/settings/FacingSetting.java index e6435c33..079e88c6 100644 --- a/src/main/java/net/wurstclient/settings/FacingSetting.java +++ b/src/main/java/net/wurstclient/settings/FacingSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -9,17 +9,13 @@ package net.wurstclient.settings; import java.util.function.Consumer; -import net.minecraft.client.MinecraftClient; -import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.util.math.Vec3d; import net.wurstclient.WurstClient; import net.wurstclient.util.RotationUtils; -import net.wurstclient.util.RotationUtils.Rotation; public final class FacingSetting extends EnumSetting { private static final WurstClient WURST = WurstClient.INSTANCE; - private static final MinecraftClient MC = WurstClient.MC; private FacingSetting(String name, String description, Facing[] values, Facing selected) @@ -55,13 +51,8 @@ public final class FacingSetting extends EnumSetting CLIENT("Client-side", v -> WURST.getRotationFaker().faceVectorClient(v)), - SPAM("Packet spam", v -> { - Rotation rotation = RotationUtils.getNeededRotations(v); - PlayerMoveC2SPacket.LookAndOnGround packet = - new PlayerMoveC2SPacket.LookAndOnGround(rotation.getYaw(), - rotation.getPitch(), MC.player.isOnGround()); - MC.player.networkHandler.sendPacket(packet); - }); + SPAM("Packet spam", + v -> RotationUtils.getNeededRotations(v).sendPlayerLookPacket()); private String name; private Consumer face; diff --git a/src/main/java/net/wurstclient/settings/FileSetting.java b/src/main/java/net/wurstclient/settings/FileSetting.java index cac273b4..e68ef236 100644 --- a/src/main/java/net/wurstclient/settings/FileSetting.java +++ b/src/main/java/net/wurstclient/settings/FileSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/ItemListSetting.java b/src/main/java/net/wurstclient/settings/ItemListSetting.java index 2ad4c317..26236b54 100644 --- a/src/main/java/net/wurstclient/settings/ItemListSetting.java +++ b/src/main/java/net/wurstclient/settings/ItemListSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/PauseAttackOnContainersSetting.java b/src/main/java/net/wurstclient/settings/PauseAttackOnContainersSetting.java index 247eabbd..6a4cec57 100644 --- a/src/main/java/net/wurstclient/settings/PauseAttackOnContainersSetting.java +++ b/src/main/java/net/wurstclient/settings/PauseAttackOnContainersSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/Setting.java b/src/main/java/net/wurstclient/settings/Setting.java index 3b8b7f04..0cafa989 100644 --- a/src/main/java/net/wurstclient/settings/Setting.java +++ b/src/main/java/net/wurstclient/settings/Setting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/SettingsFile.java b/src/main/java/net/wurstclient/settings/SettingsFile.java index c77d1882..60f69f4c 100644 --- a/src/main/java/net/wurstclient/settings/SettingsFile.java +++ b/src/main/java/net/wurstclient/settings/SettingsFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/SliderLock.java b/src/main/java/net/wurstclient/settings/SliderLock.java index f1609c3a..896b4843 100644 --- a/src/main/java/net/wurstclient/settings/SliderLock.java +++ b/src/main/java/net/wurstclient/settings/SliderLock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/SliderSetting.java b/src/main/java/net/wurstclient/settings/SliderSetting.java index 0aa83bfb..fb190074 100644 --- a/src/main/java/net/wurstclient/settings/SliderSetting.java +++ b/src/main/java/net/wurstclient/settings/SliderSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/SwingHandSetting.java b/src/main/java/net/wurstclient/settings/SwingHandSetting.java index 9a08daa7..da846eca 100644 --- a/src/main/java/net/wurstclient/settings/SwingHandSetting.java +++ b/src/main/java/net/wurstclient/settings/SwingHandSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/TextFieldSetting.java b/src/main/java/net/wurstclient/settings/TextFieldSetting.java index d59201ef..590ac30f 100644 --- a/src/main/java/net/wurstclient/settings/TextFieldSetting.java +++ b/src/main/java/net/wurstclient/settings/TextFieldSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java index 0506b057..3970a581 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/AnchorAuraFilterList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java index 993c5dd8..c4d8b918 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/CrystalAuraFilterList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java index e3c3d0ab..68aad62b 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java index 2a834efd..02618d1a 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/FollowFilterList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java b/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java index ac0e0bbd..e56fd603 100644 --- a/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java +++ b/src/main/java/net/wurstclient/settings/filterlists/RemoteViewFilterList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/AttackDetectingEntityFilter.java b/src/main/java/net/wurstclient/settings/filters/AttackDetectingEntityFilter.java index 96f0426e..a8c7deef 100644 --- a/src/main/java/net/wurstclient/settings/filters/AttackDetectingEntityFilter.java +++ b/src/main/java/net/wurstclient/settings/filters/AttackDetectingEntityFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/EntityFilterCheckbox.java b/src/main/java/net/wurstclient/settings/filters/EntityFilterCheckbox.java index 178e234d..c53b8f68 100644 --- a/src/main/java/net/wurstclient/settings/filters/EntityFilterCheckbox.java +++ b/src/main/java/net/wurstclient/settings/filters/EntityFilterCheckbox.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterAllaysSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterAllaysSetting.java index 43322339..b4e92262 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterAllaysSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterAllaysSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterArmorStandsSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterArmorStandsSetting.java index cf067edf..2808853b 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterArmorStandsSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterArmorStandsSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterBabiesSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterBabiesSetting.java index 98d2bfe1..a6001403 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterBabiesSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterBabiesSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterBatsSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterBatsSetting.java index 734c7539..af859875 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterBatsSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterBatsSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterCrystalsSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterCrystalsSetting.java index d757e411..d6a16a9a 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterCrystalsSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterCrystalsSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterEndermenSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterEndermenSetting.java index ddf0f9e5..48ce3fbb 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterEndermenSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterEndermenSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterFlyingSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterFlyingSetting.java index 87714ded..08ccca0b 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterFlyingSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterFlyingSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterGolemsSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterGolemsSetting.java index 61dd05d8..b39ae2c1 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterGolemsSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterGolemsSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterHostileSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterHostileSetting.java index c6d44d5c..638f6026 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterHostileSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterHostileSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterInvisibleSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterInvisibleSetting.java index 67ef6746..3bd52373 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterInvisibleSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterInvisibleSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterMinecartsSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterMinecartsSetting.java index d9fb6cda..8ba8a9ba 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterMinecartsSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterMinecartsSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterNamedSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterNamedSetting.java index 3d830d51..616ff961 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterNamedSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterNamedSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterNeutralSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterNeutralSetting.java index 48c94dc6..58626d06 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterNeutralSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterNeutralSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterPassiveSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterPassiveSetting.java index f0b9c8c0..affa9013 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterPassiveSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterPassiveSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterPassiveWaterSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterPassiveWaterSetting.java index 86664dc3..40d22045 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterPassiveWaterSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterPassiveWaterSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterPetsSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterPetsSetting.java index 72c4409d..84617917 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterPetsSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterPetsSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterPiglinsSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterPiglinsSetting.java index 005191ff..6bef4028 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterPiglinsSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterPiglinsSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterPlayersSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterPlayersSetting.java index 1c0bc4bb..1f7795d2 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterPlayersSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterPlayersSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterShulkerBulletSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterShulkerBulletSetting.java index 871574e9..1aa6c45f 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterShulkerBulletSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterShulkerBulletSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterShulkersSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterShulkersSetting.java index a6797d4a..7e97cc5d 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterShulkersSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterShulkersSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterSleepingSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterSleepingSetting.java index b78d0c71..b4cf1926 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterSleepingSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterSleepingSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterSlimesSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterSlimesSetting.java index 9783f59b..41bea23e 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterSlimesSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterSlimesSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterVillagersSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterVillagersSetting.java index 31f6f649..3df46ee3 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterVillagersSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterVillagersSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterZombiePiglinsSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterZombiePiglinsSetting.java index 62fae589..80ec7dfe 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterZombiePiglinsSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterZombiePiglinsSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/settings/filters/FilterZombieVillagersSetting.java b/src/main/java/net/wurstclient/settings/filters/FilterZombieVillagersSetting.java index 205ba327..493bc8a5 100644 --- a/src/main/java/net/wurstclient/settings/filters/FilterZombieVillagersSetting.java +++ b/src/main/java/net/wurstclient/settings/filters/FilterZombieVillagersSetting.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/update/ProblematicResourcePackDetector.java b/src/main/java/net/wurstclient/update/ProblematicResourcePackDetector.java index 4cf41e1f..3c77751e 100644 --- a/src/main/java/net/wurstclient/update/ProblematicResourcePackDetector.java +++ b/src/main/java/net/wurstclient/update/ProblematicResourcePackDetector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/update/Version.java b/src/main/java/net/wurstclient/update/Version.java index 201e6d2d..6c5562d3 100644 --- a/src/main/java/net/wurstclient/update/Version.java +++ b/src/main/java/net/wurstclient/update/Version.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/update/WurstUpdater.java b/src/main/java/net/wurstclient/update/WurstUpdater.java index 87dd53e9..6c1b2962 100644 --- a/src/main/java/net/wurstclient/update/WurstUpdater.java +++ b/src/main/java/net/wurstclient/update/WurstUpdater.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/AutoBuildTemplate.java b/src/main/java/net/wurstclient/util/AutoBuildTemplate.java index 235d1791..0146f815 100644 --- a/src/main/java/net/wurstclient/util/AutoBuildTemplate.java +++ b/src/main/java/net/wurstclient/util/AutoBuildTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/BlockBreaker.java b/src/main/java/net/wurstclient/util/BlockBreaker.java index a1cf34ee..cbcfcc89 100644 --- a/src/main/java/net/wurstclient/util/BlockBreaker.java +++ b/src/main/java/net/wurstclient/util/BlockBreaker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/BlockPlacer.java b/src/main/java/net/wurstclient/util/BlockPlacer.java index 96121057..88c210bc 100644 --- a/src/main/java/net/wurstclient/util/BlockPlacer.java +++ b/src/main/java/net/wurstclient/util/BlockPlacer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/BlockUtils.java b/src/main/java/net/wurstclient/util/BlockUtils.java index f1b70f04..7c96963d 100644 --- a/src/main/java/net/wurstclient/util/BlockUtils.java +++ b/src/main/java/net/wurstclient/util/BlockUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -132,15 +132,20 @@ public enum BlockUtils return getState(pos).isOpaqueFullCube(MC.world, pos); } - public static BlockHitResult raycast(Vec3d from, Vec3d to) + public static BlockHitResult raycast(Vec3d from, Vec3d to, + RaycastContext.FluidHandling fluidHandling) { - RaycastContext context = - new RaycastContext(from, to, RaycastContext.ShapeType.COLLIDER, - RaycastContext.FluidHandling.NONE, MC.player); + RaycastContext context = new RaycastContext(from, to, + RaycastContext.ShapeType.COLLIDER, fluidHandling, MC.player); return MC.world.raycast(context); } + public static BlockHitResult raycast(Vec3d from, Vec3d to) + { + return raycast(from, to, RaycastContext.FluidHandling.NONE); + } + public static boolean hasLineOfSight(Vec3d from, Vec3d to) { return raycast(from, to).getType() == HitResult.Type.MISS; diff --git a/src/main/java/net/wurstclient/util/BlockVertexCompiler.java b/src/main/java/net/wurstclient/util/BlockVertexCompiler.java index f9fbe77f..1f32ca65 100644 --- a/src/main/java/net/wurstclient/util/BlockVertexCompiler.java +++ b/src/main/java/net/wurstclient/util/BlockVertexCompiler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/ChatUtils.java b/src/main/java/net/wurstclient/util/ChatUtils.java index 210771b1..bd1f99da 100644 --- a/src/main/java/net/wurstclient/util/ChatUtils.java +++ b/src/main/java/net/wurstclient/util/ChatUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/ChunkSearcher.java b/src/main/java/net/wurstclient/util/ChunkSearcher.java index 3ee5679e..30f8310b 100644 --- a/src/main/java/net/wurstclient/util/ChunkSearcher.java +++ b/src/main/java/net/wurstclient/util/ChunkSearcher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/ChunkSearcherCoordinator.java b/src/main/java/net/wurstclient/util/ChunkSearcherCoordinator.java index 004f8e4a..bf0f7bdb 100644 --- a/src/main/java/net/wurstclient/util/ChunkSearcherCoordinator.java +++ b/src/main/java/net/wurstclient/util/ChunkSearcherCoordinator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/ChunkUtils.java b/src/main/java/net/wurstclient/util/ChunkUtils.java index cc8138c6..e9f9298b 100644 --- a/src/main/java/net/wurstclient/util/ChunkUtils.java +++ b/src/main/java/net/wurstclient/util/ChunkUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/CmdUtils.java b/src/main/java/net/wurstclient/util/CmdUtils.java index 4a62ec8f..816d58a1 100644 --- a/src/main/java/net/wurstclient/util/CmdUtils.java +++ b/src/main/java/net/wurstclient/util/CmdUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/ColorUtils.java b/src/main/java/net/wurstclient/util/ColorUtils.java index c0157b31..6eb92444 100644 --- a/src/main/java/net/wurstclient/util/ColorUtils.java +++ b/src/main/java/net/wurstclient/util/ColorUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/DefaultAutoBuildTemplates.java b/src/main/java/net/wurstclient/util/DefaultAutoBuildTemplates.java index 964dcd90..67461680 100644 --- a/src/main/java/net/wurstclient/util/DefaultAutoBuildTemplates.java +++ b/src/main/java/net/wurstclient/util/DefaultAutoBuildTemplates.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/EntityUtils.java b/src/main/java/net/wurstclient/util/EntityUtils.java index 50d6b950..8e56c805 100644 --- a/src/main/java/net/wurstclient/util/EntityUtils.java +++ b/src/main/java/net/wurstclient/util/EntityUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/FakePlayerEntity.java b/src/main/java/net/wurstclient/util/FakePlayerEntity.java index 8f75312a..68056c7c 100644 --- a/src/main/java/net/wurstclient/util/FakePlayerEntity.java +++ b/src/main/java/net/wurstclient/util/FakePlayerEntity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/ForceOpDialog.java b/src/main/java/net/wurstclient/util/ForceOpDialog.java index c41592e1..e1d4e2e1 100644 --- a/src/main/java/net/wurstclient/util/ForceOpDialog.java +++ b/src/main/java/net/wurstclient/util/ForceOpDialog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/GoogleTranslate.java b/src/main/java/net/wurstclient/util/GoogleTranslate.java index b982b34b..e3414e06 100644 --- a/src/main/java/net/wurstclient/util/GoogleTranslate.java +++ b/src/main/java/net/wurstclient/util/GoogleTranslate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/InteractionSimulator.java b/src/main/java/net/wurstclient/util/InteractionSimulator.java index 0d79b302..ef69bb90 100644 --- a/src/main/java/net/wurstclient/util/InteractionSimulator.java +++ b/src/main/java/net/wurstclient/util/InteractionSimulator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/InventoryUtils.java b/src/main/java/net/wurstclient/util/InventoryUtils.java index de414746..1f290c62 100644 --- a/src/main/java/net/wurstclient/util/InventoryUtils.java +++ b/src/main/java/net/wurstclient/util/InventoryUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/ItemUtils.java b/src/main/java/net/wurstclient/util/ItemUtils.java index 4a036b2a..22829a1e 100644 --- a/src/main/java/net/wurstclient/util/ItemUtils.java +++ b/src/main/java/net/wurstclient/util/ItemUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/JustGiveMeTheStringVisitor.java b/src/main/java/net/wurstclient/util/JustGiveMeTheStringVisitor.java index e95ed26a..e2ef1adb 100644 --- a/src/main/java/net/wurstclient/util/JustGiveMeTheStringVisitor.java +++ b/src/main/java/net/wurstclient/util/JustGiveMeTheStringVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/LastServerRememberer.java b/src/main/java/net/wurstclient/util/LastServerRememberer.java index 2ac7eede..16fbb7c0 100644 --- a/src/main/java/net/wurstclient/util/LastServerRememberer.java +++ b/src/main/java/net/wurstclient/util/LastServerRememberer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/ListWidget.java b/src/main/java/net/wurstclient/util/ListWidget.java index be6b52d5..35cbbd87 100644 --- a/src/main/java/net/wurstclient/util/ListWidget.java +++ b/src/main/java/net/wurstclient/util/ListWidget.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/MathUtils.java b/src/main/java/net/wurstclient/util/MathUtils.java index 30663885..1a72502a 100644 --- a/src/main/java/net/wurstclient/util/MathUtils.java +++ b/src/main/java/net/wurstclient/util/MathUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/MinPriorityThreadFactory.java b/src/main/java/net/wurstclient/util/MinPriorityThreadFactory.java index 6c8b54d3..d5d92857 100644 --- a/src/main/java/net/wurstclient/util/MinPriorityThreadFactory.java +++ b/src/main/java/net/wurstclient/util/MinPriorityThreadFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/MultiProcessingUtils.java b/src/main/java/net/wurstclient/util/MultiProcessingUtils.java index 4bab3d67..f3672466 100644 --- a/src/main/java/net/wurstclient/util/MultiProcessingUtils.java +++ b/src/main/java/net/wurstclient/util/MultiProcessingUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/OverlayRenderer.java b/src/main/java/net/wurstclient/util/OverlayRenderer.java index df2230a9..548b1738 100644 --- a/src/main/java/net/wurstclient/util/OverlayRenderer.java +++ b/src/main/java/net/wurstclient/util/OverlayRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/RegionPos.java b/src/main/java/net/wurstclient/util/RegionPos.java index af19a297..833ca173 100644 --- a/src/main/java/net/wurstclient/util/RegionPos.java +++ b/src/main/java/net/wurstclient/util/RegionPos.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/RenderUtils.java b/src/main/java/net/wurstclient/util/RenderUtils.java index f894e8ff..efe5e64c 100644 --- a/src/main/java/net/wurstclient/util/RenderUtils.java +++ b/src/main/java/net/wurstclient/util/RenderUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/Rotation.java b/src/main/java/net/wurstclient/util/Rotation.java new file mode 100644 index 00000000..a6a872b6 --- /dev/null +++ b/src/main/java/net/wurstclient/util/Rotation.java @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.util; + +import org.joml.Quaternionf; + +import net.minecraft.client.MinecraftClient; +import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Vec3d; +import net.wurstclient.WurstClient; + +public record Rotation(float yaw, float pitch) +{ + private static final MinecraftClient MC = WurstClient.MC; + + public void applyToClientPlayer() + { + float adjustedYaw = + RotationUtils.limitAngleChange(MC.player.getYaw(), yaw); + MC.player.setYaw(adjustedYaw); + MC.player.setPitch(pitch); + } + + public void sendPlayerLookPacket() + { + sendPlayerLookPacket(MC.player.isOnGround()); + } + + public void sendPlayerLookPacket(boolean onGround) + { + MC.player.networkHandler.sendPacket( + new PlayerMoveC2SPacket.LookAndOnGround(yaw, pitch, onGround)); + } + + public double getAngleTo(Rotation other) + { + float yaw1 = MathHelper.wrapDegrees(yaw); + float yaw2 = MathHelper.wrapDegrees(other.yaw); + float diffYaw = MathHelper.wrapDegrees(yaw1 - yaw2); + + float pitch1 = MathHelper.wrapDegrees(pitch); + float pitch2 = MathHelper.wrapDegrees(other.pitch); + float diffPitch = MathHelper.wrapDegrees(pitch1 - pitch2); + + return Math.sqrt(diffYaw * diffYaw + diffPitch * diffPitch); + } + + public Rotation withYaw(float yaw) + { + return new Rotation(yaw, pitch); + } + + public Rotation withPitch(float pitch) + { + return new Rotation(yaw, pitch); + } + + public Vec3d toLookVec() + { + float radPerDeg = MathHelper.RADIANS_PER_DEGREE; + float pi = MathHelper.PI; + + float adjustedYaw = -MathHelper.wrapDegrees(yaw) * radPerDeg - pi; + float cosYaw = MathHelper.cos(adjustedYaw); + float sinYaw = MathHelper.sin(adjustedYaw); + + float adjustedPitch = -MathHelper.wrapDegrees(pitch) * radPerDeg; + float nCosPitch = -MathHelper.cos(adjustedPitch); + float sinPitch = MathHelper.sin(adjustedPitch); + + return new Vec3d(sinYaw * nCosPitch, sinPitch, cosYaw * nCosPitch); + } + + public Quaternionf toQuaternion() + { + float radPerDeg = MathHelper.RADIANS_PER_DEGREE; + float yawRad = -MathHelper.wrapDegrees(yaw) * radPerDeg; + float pitchRad = MathHelper.wrapDegrees(pitch) * radPerDeg; + + float sinYaw = MathHelper.sin(yawRad / 2); + float cosYaw = MathHelper.cos(yawRad / 2); + float sinPitch = MathHelper.sin(pitchRad / 2); + float cosPitch = MathHelper.cos(pitchRad / 2); + + float x = sinPitch * cosYaw; + float y = cosPitch * sinYaw; + float z = -sinPitch * sinYaw; + float w = cosPitch * cosYaw; + + return new Quaternionf(x, y, z, w); + } + + public static Rotation wrapped(float yaw, float pitch) + { + return new Rotation(MathHelper.wrapDegrees(yaw), + MathHelper.wrapDegrees(pitch)); + } +} diff --git a/src/main/java/net/wurstclient/util/RotationUtils.java b/src/main/java/net/wurstclient/util/RotationUtils.java index f17bdfb7..caab79fa 100644 --- a/src/main/java/net/wurstclient/util/RotationUtils.java +++ b/src/main/java/net/wurstclient/util/RotationUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this @@ -7,8 +7,8 @@ */ package net.wurstclient.util; +import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.ClientPlayerEntity; -import net.minecraft.entity.Entity; import net.minecraft.util.math.Box; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; @@ -19,100 +19,56 @@ public enum RotationUtils { ; + private static final MinecraftClient MC = WurstClient.MC; + public static Vec3d getEyesPos() { - ClientPlayerEntity player = WurstClient.MC.player; - - return new Vec3d(player.getX(), - player.getY() + player.getEyeHeight(player.getPose()), - player.getZ()); + ClientPlayerEntity player = MC.player; + float eyeHeight = player.getEyeHeight(player.getPose()); + return player.getPos().add(0, eyeHeight, 0); } public static Vec3d getClientLookVec(float partialTicks) { - ClientPlayerEntity player = WurstClient.MC.player; - float f = 0.017453292F; - float pi = (float)Math.PI; - - float f1 = MathHelper.cos(-player.getYaw(partialTicks) * f - pi); - float f2 = MathHelper.sin(-player.getYaw(partialTicks) * f - pi); - float f3 = -MathHelper.cos(-player.getPitch(partialTicks) * f); - float f4 = MathHelper.sin(-player.getPitch(partialTicks) * f); - - return new Vec3d(f2 * f3, f4, f1 * f3); + float yaw = MC.player.getYaw(partialTicks); + float pitch = MC.player.getPitch(partialTicks); + return new Rotation(yaw, pitch).toLookVec(); } public static Vec3d getServerLookVec() { - RotationFaker rotationFaker = WurstClient.INSTANCE.getRotationFaker(); - float serverYaw = rotationFaker.getServerYaw(); - float serverPitch = rotationFaker.getServerPitch(); - - float f = MathHelper.cos(-serverYaw * 0.017453292F - (float)Math.PI); - float f1 = MathHelper.sin(-serverYaw * 0.017453292F - (float)Math.PI); - float f2 = -MathHelper.cos(-serverPitch * 0.017453292F); - float f3 = MathHelper.sin(-serverPitch * 0.017453292F); - return new Vec3d(f1 * f2, f3, f * f2); + RotationFaker rf = WurstClient.INSTANCE.getRotationFaker(); + return new Rotation(rf.getServerYaw(), rf.getServerPitch()).toLookVec(); } public static Rotation getNeededRotations(Vec3d vec) { - Vec3d eyesPos = getEyesPos(); + Vec3d eyes = getEyesPos(); - double diffX = vec.x - eyesPos.x; - double diffY = vec.y - eyesPos.y; - double diffZ = vec.z - eyesPos.z; + double diffX = vec.x - eyes.x; + double diffZ = vec.z - eyes.z; + double yaw = Math.toDegrees(Math.atan2(diffZ, diffX)) - 90F; + double diffY = vec.y - eyes.y; double diffXZ = Math.sqrt(diffX * diffX + diffZ * diffZ); + double pitch = -Math.toDegrees(Math.atan2(diffY, diffXZ)); - float yaw = (float)Math.toDegrees(Math.atan2(diffZ, diffX)) - 90F; - float pitch = (float)-Math.toDegrees(Math.atan2(diffY, diffXZ)); - - return Rotation.wrapped(yaw, pitch); + return Rotation.wrapped((float)yaw, (float)pitch); } public static double getAngleToLookVec(Vec3d vec) { + ClientPlayerEntity player = MC.player; + Rotation current = new Rotation(player.getYaw(), player.getPitch()); Rotation needed = getNeededRotations(vec); - - ClientPlayerEntity player = WurstClient.MC.player; - float currentYaw = MathHelper.wrapDegrees(player.getYaw()); - float currentPitch = MathHelper.wrapDegrees(player.getPitch()); - - float diffYaw = MathHelper.wrapDegrees(currentYaw - needed.yaw); - float diffPitch = MathHelper.wrapDegrees(currentPitch - needed.pitch); - - return Math.sqrt(diffYaw * diffYaw + diffPitch * diffPitch); + return current.getAngleTo(needed); } - public static double getAngleToLastReportedLookVec(Vec3d vec) + public static float getHorizontalAngleToLookVec(Vec3d vec) { - Rotation needed = getNeededRotations(vec); - - ClientPlayerEntity player = WurstClient.MC.player; - float lastReportedYaw = MathHelper.wrapDegrees(player.lastYaw); - float lastReportedPitch = MathHelper.wrapDegrees(player.lastPitch); - - float diffYaw = MathHelper.wrapDegrees(lastReportedYaw - needed.yaw); - float diffPitch = - MathHelper.wrapDegrees(lastReportedPitch - needed.pitch); - - return Math.sqrt(diffYaw * diffYaw + diffPitch * diffPitch); - } - - public static double getAngleToLastReportedLookVec(Rotation rotation) - { - float yaw = MathHelper.wrapDegrees(rotation.getYaw()); - float pitch = MathHelper.wrapDegrees(rotation.getPitch()); - - ClientPlayerEntity player = WurstClient.MC.player; - float lastReportedYaw = MathHelper.wrapDegrees(player.lastYaw); - float lastReportedPitch = MathHelper.wrapDegrees(player.lastPitch); - - float diffYaw = MathHelper.wrapDegrees(lastReportedYaw - yaw); - float diffPitch = MathHelper.wrapDegrees(lastReportedPitch - pitch); - - return Math.sqrt(diffYaw * diffYaw + diffPitch * diffPitch); + float currentYaw = MathHelper.wrapDegrees(MC.player.getYaw()); + float neededYaw = getNeededRotations(vec).yaw(); + return MathHelper.wrapDegrees(currentYaw - neededYaw); } /** @@ -124,6 +80,19 @@ public enum RotationUtils return getAngleToLastReportedLookVec(rotation) <= 1.0; } + public static double getAngleToLastReportedLookVec(Vec3d vec) + { + Rotation needed = getNeededRotations(vec); + return getAngleToLastReportedLookVec(needed); + } + + public static double getAngleToLastReportedLookVec(Rotation rotation) + { + ClientPlayerEntity player = MC.player; + Rotation lastReported = new Rotation(player.lastYaw, player.lastPitch); + return lastReported.getAngleTo(rotation); + } + /** * Returns true if the player is facing anywhere within the given box * and is no further away than the given range. @@ -135,13 +104,6 @@ public enum RotationUtils return box.raycast(start, end).isPresent(); } - public static float getHorizontalAngleToLookVec(Vec3d vec) - { - Rotation needed = getNeededRotations(vec); - return MathHelper.wrapDegrees(WurstClient.MC.player.getYaw()) - - needed.yaw; - } - /** * Returns the next rotation that the player should be facing in order to * slowly turn towards the specified end rotation, at a rate of roughly @@ -149,11 +111,10 @@ public enum RotationUtils */ public static Rotation slowlyTurnTowards(Rotation end, float maxChange) { - Entity player = WurstClient.MC.player; - float startYaw = player.prevYaw; - float startPitch = player.prevPitch; - float endYaw = end.getYaw(); - float endPitch = end.getPitch(); + float startYaw = MC.player.prevYaw; + float startPitch = MC.player.prevPitch; + float endYaw = end.yaw(); + float endPitch = end.pitch(); float yawChange = Math.abs(MathHelper.wrapDegrees(endYaw - startYaw)); float pitchChange = @@ -214,32 +175,4 @@ public enum RotationUtils return current + change; } - - public static final class Rotation - { - private final float yaw; - private final float pitch; - - public Rotation(float yaw, float pitch) - { - this.yaw = yaw; - this.pitch = pitch; - } - - public static Rotation wrapped(float yaw, float pitch) - { - return new Rotation(MathHelper.wrapDegrees(yaw), - MathHelper.wrapDegrees(pitch)); - } - - public float getYaw() - { - return yaw; - } - - public float getPitch() - { - return pitch; - } - } } diff --git a/src/main/java/net/wurstclient/util/StreamUtils.java b/src/main/java/net/wurstclient/util/StreamUtils.java index b5a70709..f8f4ef98 100644 --- a/src/main/java/net/wurstclient/util/StreamUtils.java +++ b/src/main/java/net/wurstclient/util/StreamUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/SwingUtils.java b/src/main/java/net/wurstclient/util/SwingUtils.java index ec73b1d8..35c58df0 100644 --- a/src/main/java/net/wurstclient/util/SwingUtils.java +++ b/src/main/java/net/wurstclient/util/SwingUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/json/JsonException.java b/src/main/java/net/wurstclient/util/json/JsonException.java index b4b74c89..4b52e50a 100644 --- a/src/main/java/net/wurstclient/util/json/JsonException.java +++ b/src/main/java/net/wurstclient/util/json/JsonException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/json/JsonUtils.java b/src/main/java/net/wurstclient/util/json/JsonUtils.java index 987d5585..d48e42dc 100644 --- a/src/main/java/net/wurstclient/util/json/JsonUtils.java +++ b/src/main/java/net/wurstclient/util/json/JsonUtils.java @@ -1,288 +1,288 @@ -/* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. - * - * This source code is subject to the terms of the GNU General Public - * License, version 3. If a copy of the GPL was not distributed with this - * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt - */ -package net.wurstclient.util.json; - -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.URI; -import java.net.URLConnection; -import java.nio.file.Files; -import java.nio.file.Path; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonElement; -import com.google.gson.JsonParseException; -import com.google.gson.JsonParser; -import com.google.gson.JsonPrimitive; -import com.google.gson.stream.MalformedJsonException; - -public enum JsonUtils -{ - ; - - public static final Gson GSON = new Gson(); - - public static final Gson PRETTY_GSON = - new GsonBuilder().setPrettyPrinting().create(); - - public static JsonElement parseFile(Path path) - throws IOException, JsonException - { - try(BufferedReader reader = Files.newBufferedReader(path)) - { - return JsonParser.parseReader(reader); - - }catch(JsonParseException e) - { - if(e.getCause() instanceof MalformedJsonException c) - throw new JsonException(c.getMessage(), c); - - throw new JsonException(e); - } - } - - public static WsonArray parseFileToArray(Path path) - throws IOException, JsonException - { - return getAsArray(parseFile(path)); - } - - public static WsonObject parseFileToObject(Path path) - throws IOException, JsonException - { - return getAsObject(parseFile(path)); - } - - public static JsonElement parseURL(String url) - throws IOException, JsonException - { - URI uri = URI.create(url); - try(InputStream input = uri.toURL().openStream()) - { - InputStreamReader reader = new InputStreamReader(input); - BufferedReader bufferedReader = new BufferedReader(reader); - return JsonParser.parseReader(bufferedReader); - - }catch(JsonParseException e) - { - if(e.getCause() instanceof MalformedJsonException c) - throw new JsonException(c.getMessage(), c); - - throw new JsonException(e); - } - } - - public static WsonArray parseURLToArray(String url) - throws IOException, JsonException - { - return getAsArray(parseURL(url)); - } - - public static WsonObject parseURLToObject(String url) - throws IOException, JsonException - { - return getAsObject(parseURL(url)); - } - - /** - * For more complex connections where {@link #parseURL(String)} won't do. - */ - public static JsonElement parseConnection(URLConnection connection) - throws IOException, JsonException - { - try(InputStream input = connection.getInputStream()) - { - InputStreamReader reader = new InputStreamReader(input); - BufferedReader bufferedReader = new BufferedReader(reader); - return JsonParser.parseReader(bufferedReader); - - }catch(JsonParseException e) - { - if(e.getCause() instanceof MalformedJsonException c) - throw new JsonException(c.getMessage(), c); - - throw new JsonException(e); - } - } - - /** - * For more complex connections where {@link #parseURLToArray(String)} won't - * do. - */ - public static WsonArray parseConnectionToArray(URLConnection connection) - throws IOException, JsonException - { - return getAsArray(parseConnection(connection)); - } - - /** - * For more complex connections where {@link #parseURLToObject(String)} - * won't do. - */ - public static WsonObject parseConnectionToObject(URLConnection connection) - throws IOException, JsonException - { - return getAsObject(parseConnection(connection)); - } - - public static void toJson(JsonElement json, Path path) - throws IOException, JsonException - { - try(BufferedWriter writer = Files.newBufferedWriter(path)) - { - JsonUtils.PRETTY_GSON.toJson(json, writer); - - }catch(JsonParseException e) - { - throw new JsonException(e); - } - } - - public static boolean isBoolean(JsonElement json) - { - if(json == null || !json.isJsonPrimitive()) - return false; - - JsonPrimitive primitive = json.getAsJsonPrimitive(); - return primitive.isBoolean(); - } - - public static boolean getAsBoolean(JsonElement json) throws JsonException - { - if(!isBoolean(json)) - throw new JsonException("Not a boolean: " + json); - - return json.getAsBoolean(); - } - - public static boolean getAsBoolean(JsonElement json, boolean fallback) - { - if(!isBoolean(json)) - return fallback; - - return json.getAsBoolean(); - } - - public static boolean isNumber(JsonElement json) - { - if(json == null || !json.isJsonPrimitive()) - return false; - - JsonPrimitive primitive = json.getAsJsonPrimitive(); - return primitive.isNumber(); - } - - public static int getAsInt(JsonElement json) throws JsonException - { - if(!isNumber(json)) - throw new JsonException("Not a number: " + json); - - return json.getAsInt(); - } - - public static int getAsInt(JsonElement json, int fallback) - { - if(!isNumber(json)) - return fallback; - - return json.getAsInt(); - } - - public static long getAsLong(JsonElement json) throws JsonException - { - if(!isNumber(json)) - throw new JsonException("Not a number: " + json); - - return json.getAsLong(); - } - - public static long getAsLong(JsonElement json, long fallback) - { - if(!isNumber(json)) - return fallback; - - return json.getAsLong(); - } - - public static float getAsFloat(JsonElement json) throws JsonException - { - if(!isNumber(json)) - throw new JsonException("Not a number: " + json); - - return json.getAsFloat(); - } - - public static float getAsFloat(JsonElement json, float fallback) - { - if(!isNumber(json)) - return fallback; - - return json.getAsFloat(); - } - - public static double getAsDouble(JsonElement json) throws JsonException - { - if(!isNumber(json)) - throw new JsonException("Not a number: " + json); - - return json.getAsDouble(); - } - - public static double getAsDouble(JsonElement json, double fallback) - { - if(!isNumber(json)) - return fallback; - - return json.getAsDouble(); - } - - public static boolean isString(JsonElement json) - { - if(json == null || !json.isJsonPrimitive()) - return false; - - JsonPrimitive primitive = json.getAsJsonPrimitive(); - return primitive.isString(); - } - - public static String getAsString(JsonElement json) throws JsonException - { - if(!isString(json)) - throw new JsonException("Not a string: " + json); - - return json.getAsString(); - } - - public static String getAsString(JsonElement json, String fallback) - { - if(!isString(json)) - return fallback; - - return json.getAsString(); - } - - public static WsonArray getAsArray(JsonElement json) throws JsonException - { - if(!json.isJsonArray()) - throw new JsonException("Not an array: " + json); - - return new WsonArray(json.getAsJsonArray()); - } - - public static WsonObject getAsObject(JsonElement json) throws JsonException - { - if(!json.isJsonObject()) - throw new JsonException("Not an object: " + json); - - return new WsonObject(json.getAsJsonObject()); - } -} +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.util.json; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URI; +import java.net.URLConnection; +import java.nio.file.Files; +import java.nio.file.Path; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; +import com.google.gson.JsonParser; +import com.google.gson.JsonPrimitive; +import com.google.gson.stream.MalformedJsonException; + +public enum JsonUtils +{ + ; + + public static final Gson GSON = new Gson(); + + public static final Gson PRETTY_GSON = + new GsonBuilder().setPrettyPrinting().create(); + + public static JsonElement parseFile(Path path) + throws IOException, JsonException + { + try(BufferedReader reader = Files.newBufferedReader(path)) + { + return JsonParser.parseReader(reader); + + }catch(JsonParseException e) + { + if(e.getCause() instanceof MalformedJsonException c) + throw new JsonException(c.getMessage(), c); + + throw new JsonException(e); + } + } + + public static WsonArray parseFileToArray(Path path) + throws IOException, JsonException + { + return getAsArray(parseFile(path)); + } + + public static WsonObject parseFileToObject(Path path) + throws IOException, JsonException + { + return getAsObject(parseFile(path)); + } + + public static JsonElement parseURL(String url) + throws IOException, JsonException + { + URI uri = URI.create(url); + try(InputStream input = uri.toURL().openStream()) + { + InputStreamReader reader = new InputStreamReader(input); + BufferedReader bufferedReader = new BufferedReader(reader); + return JsonParser.parseReader(bufferedReader); + + }catch(JsonParseException e) + { + if(e.getCause() instanceof MalformedJsonException c) + throw new JsonException(c.getMessage(), c); + + throw new JsonException(e); + } + } + + public static WsonArray parseURLToArray(String url) + throws IOException, JsonException + { + return getAsArray(parseURL(url)); + } + + public static WsonObject parseURLToObject(String url) + throws IOException, JsonException + { + return getAsObject(parseURL(url)); + } + + /** + * For more complex connections where {@link #parseURL(String)} won't do. + */ + public static JsonElement parseConnection(URLConnection connection) + throws IOException, JsonException + { + try(InputStream input = connection.getInputStream()) + { + InputStreamReader reader = new InputStreamReader(input); + BufferedReader bufferedReader = new BufferedReader(reader); + return JsonParser.parseReader(bufferedReader); + + }catch(JsonParseException e) + { + if(e.getCause() instanceof MalformedJsonException c) + throw new JsonException(c.getMessage(), c); + + throw new JsonException(e); + } + } + + /** + * For more complex connections where {@link #parseURLToArray(String)} won't + * do. + */ + public static WsonArray parseConnectionToArray(URLConnection connection) + throws IOException, JsonException + { + return getAsArray(parseConnection(connection)); + } + + /** + * For more complex connections where {@link #parseURLToObject(String)} + * won't do. + */ + public static WsonObject parseConnectionToObject(URLConnection connection) + throws IOException, JsonException + { + return getAsObject(parseConnection(connection)); + } + + public static void toJson(JsonElement json, Path path) + throws IOException, JsonException + { + try(BufferedWriter writer = Files.newBufferedWriter(path)) + { + JsonUtils.PRETTY_GSON.toJson(json, writer); + + }catch(JsonParseException e) + { + throw new JsonException(e); + } + } + + public static boolean isBoolean(JsonElement json) + { + if(json == null || !json.isJsonPrimitive()) + return false; + + JsonPrimitive primitive = json.getAsJsonPrimitive(); + return primitive.isBoolean(); + } + + public static boolean getAsBoolean(JsonElement json) throws JsonException + { + if(!isBoolean(json)) + throw new JsonException("Not a boolean: " + json); + + return json.getAsBoolean(); + } + + public static boolean getAsBoolean(JsonElement json, boolean fallback) + { + if(!isBoolean(json)) + return fallback; + + return json.getAsBoolean(); + } + + public static boolean isNumber(JsonElement json) + { + if(json == null || !json.isJsonPrimitive()) + return false; + + JsonPrimitive primitive = json.getAsJsonPrimitive(); + return primitive.isNumber(); + } + + public static int getAsInt(JsonElement json) throws JsonException + { + if(!isNumber(json)) + throw new JsonException("Not a number: " + json); + + return json.getAsInt(); + } + + public static int getAsInt(JsonElement json, int fallback) + { + if(!isNumber(json)) + return fallback; + + return json.getAsInt(); + } + + public static long getAsLong(JsonElement json) throws JsonException + { + if(!isNumber(json)) + throw new JsonException("Not a number: " + json); + + return json.getAsLong(); + } + + public static long getAsLong(JsonElement json, long fallback) + { + if(!isNumber(json)) + return fallback; + + return json.getAsLong(); + } + + public static float getAsFloat(JsonElement json) throws JsonException + { + if(!isNumber(json)) + throw new JsonException("Not a number: " + json); + + return json.getAsFloat(); + } + + public static float getAsFloat(JsonElement json, float fallback) + { + if(!isNumber(json)) + return fallback; + + return json.getAsFloat(); + } + + public static double getAsDouble(JsonElement json) throws JsonException + { + if(!isNumber(json)) + throw new JsonException("Not a number: " + json); + + return json.getAsDouble(); + } + + public static double getAsDouble(JsonElement json, double fallback) + { + if(!isNumber(json)) + return fallback; + + return json.getAsDouble(); + } + + public static boolean isString(JsonElement json) + { + if(json == null || !json.isJsonPrimitive()) + return false; + + JsonPrimitive primitive = json.getAsJsonPrimitive(); + return primitive.isString(); + } + + public static String getAsString(JsonElement json) throws JsonException + { + if(!isString(json)) + throw new JsonException("Not a string: " + json); + + return json.getAsString(); + } + + public static String getAsString(JsonElement json, String fallback) + { + if(!isString(json)) + return fallback; + + return json.getAsString(); + } + + public static WsonArray getAsArray(JsonElement json) throws JsonException + { + if(!json.isJsonArray()) + throw new JsonException("Not an array: " + json); + + return new WsonArray(json.getAsJsonArray()); + } + + public static WsonObject getAsObject(JsonElement json) throws JsonException + { + if(!json.isJsonObject()) + throw new JsonException("Not an object: " + json); + + return new WsonObject(json.getAsJsonObject()); + } +} diff --git a/src/main/java/net/wurstclient/util/json/WsonArray.java b/src/main/java/net/wurstclient/util/json/WsonArray.java index d90d3b7e..9e1a6aad 100644 --- a/src/main/java/net/wurstclient/util/json/WsonArray.java +++ b/src/main/java/net/wurstclient/util/json/WsonArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/java/net/wurstclient/util/json/WsonObject.java b/src/main/java/net/wurstclient/util/json/WsonObject.java index f2873150..bd396ba1 100644 --- a/src/main/java/net/wurstclient/util/json/WsonObject.java +++ b/src/main/java/net/wurstclient/util/json/WsonObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. * * This source code is subject to the terms of the GNU General Public * License, version 3. If a copy of the GPL was not distributed with this diff --git a/src/main/resources/assets/wurst/lang/en_us.json b/src/main/resources/assets/wurst/lang/en_us.json index 21ff899a..9221583a 100644 --- a/src/main/resources/assets/wurst/lang/en_us.json +++ b/src/main/resources/assets/wurst/lang/en_us.json @@ -115,6 +115,7 @@ "description.wurst.hack.nocomcrash": "Lags and crashes servers using the Nocom exploit.\nDoes not work on Paper servers. Tested working on Vanilla, Spigot, and Fabric. Can be disabled by some AntiCheats.", "description.wurst.hack.nofall": "Protects you from fall damage.", "description.wurst.hack.nofireoverlay": "Blocks the overlay when you are on fire.\n\n§c§lWARNING:§r This can cause you to burn to death without noticing.", + "description.wurst.hack.nofog": "Removes distance fog from the world.", "description.wurst.hack.nohurtcam": "Disables the shaking effect when you get hurt.", "description.wurst.hack.nolevitation": "Disables the levitation effect when you get hit by a Shulker.\n\n§c§lWARNING:§r You will fall if you activate this while the levitation effect is already active!", "description.wurst.hack.nooverlay": "Blocks the overlays of water and lava.", diff --git a/src/main/resources/wurst.accesswidener b/src/main/resources/wurst.accesswidener index 6961e92a..5017ea72 100644 --- a/src/main/resources/wurst.accesswidener +++ b/src/main/resources/wurst.accesswidener @@ -1,6 +1,7 @@ accessWidener v1 named accessible class net/minecraft/client/render/BackgroundRenderer$StatusEffectFogModifier accessible method net/minecraft/client/MinecraftClient doItemUse ()V +accessible method net/minecraft/client/render/BackgroundRenderer getFogModifier (Lnet/minecraft/entity/Entity;F)Lnet/minecraft/client/render/BackgroundRenderer$StatusEffectFogModifier; accessible method net/minecraft/client/render/GameRenderer loadPostProcessor (Lnet/minecraft/util/Identifier;)V accessible method net/minecraft/entity/projectile/FishingBobberEntity isOpenOrWaterAround (Lnet/minecraft/util/math/BlockPos;)Z accessible field net/minecraft/client/MinecraftClient itemUseCooldown I diff --git a/src/main/resources/wurst.mixins.json b/src/main/resources/wurst.mixins.json index 69b1d8b2..57575c98 100644 --- a/src/main/resources/wurst.mixins.json +++ b/src/main/resources/wurst.mixins.json @@ -44,6 +44,7 @@ "LanguageManagerMixin", "LivingEntityRendererMixin", "MinecraftClientMixin", + "MobEntityRendererMixin", "MouseMixin", "MultiplayerScreenMixin", "PackScreenMixin",