├── .editorconfig ├── .github └── workflows │ └── build.yml ├── .gitignore ├── LICENSE.md ├── README.md ├── build.gradle.kts ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── root.gradle.kts ├── settings.gradle.kts ├── src ├── dummy │ └── java │ │ ├── com │ │ └── unascribed │ │ │ └── ears │ │ │ └── Ears.java │ │ └── gg │ │ └── essential │ │ └── api │ │ ├── EssentialAPI.java │ │ ├── config │ │ └── EssentialConfig.java │ │ ├── data │ │ └── OnboardingData.java │ │ └── utils │ │ └── TrustedHostsUtil.java └── main │ ├── java │ ├── club │ │ └── sk1er │ │ │ ├── container │ │ │ └── ContainerMessage.java │ │ │ └── patcher │ │ │ ├── Patcher.java │ │ │ ├── PolyPatcher.java │ │ │ ├── asm │ │ │ ├── external │ │ │ │ ├── forge │ │ │ │ │ ├── loader │ │ │ │ │ │ ├── ASMModParserTransformer.java │ │ │ │ │ │ ├── JarDiscovererTransformer.java │ │ │ │ │ │ ├── MinecraftForgeTransformer.java │ │ │ │ │ │ ├── ModClassLoaderTransformer.java │ │ │ │ │ │ └── ModContainerFactoryTransformer.java │ │ │ │ │ └── render │ │ │ │ │ │ ├── ForgeHooksClientTransformer.java │ │ │ │ │ │ ├── block │ │ │ │ │ │ ├── BlockInfoTransformer.java │ │ │ │ │ │ └── ForgeBlockModelRendererTransformer.java │ │ │ │ │ │ ├── lighting │ │ │ │ │ │ ├── LightUtilTransformer.java │ │ │ │ │ │ ├── VertexLighterFlatTransformer.java │ │ │ │ │ │ └── VertexLighterSmoothAoTransformer.java │ │ │ │ │ │ └── screen │ │ │ │ │ │ ├── GuiIngameForgeTransformer.java │ │ │ │ │ │ ├── GuiModListTransformer.java │ │ │ │ │ │ └── GuiUtilsTransformer.java │ │ │ │ ├── lwjgl │ │ │ │ │ ├── KeyboardTransformer.java │ │ │ │ │ ├── LibraryLWJGLOpenALTransformer.java │ │ │ │ │ ├── WindowsDisplayTransformer.java │ │ │ │ │ └── WindowsKeycodesTransformer.java │ │ │ │ └── mods │ │ │ │ │ ├── essential │ │ │ │ │ └── EssentialModelRendererTransformer.java │ │ │ │ │ ├── optifine │ │ │ │ │ ├── EntityCullingTransformer.java │ │ │ │ │ ├── EntityRendererTransformer.java │ │ │ │ │ ├── FullbrightTickerTransformer.java │ │ │ │ │ ├── GuiDetailSettingsOFTransformer.java │ │ │ │ │ ├── LagometerTransformer.java │ │ │ │ │ ├── OptiFineHookTransformer.java │ │ │ │ │ ├── OptifineFontRendererTransformer.java │ │ │ │ │ ├── RandomEntitiesTransformer.java │ │ │ │ │ ├── RendererLivingEntityTransformer.java │ │ │ │ │ ├── reflectionoptimizations │ │ │ │ │ │ ├── common │ │ │ │ │ │ │ ├── BakedQuadReflectionOptimizer.java │ │ │ │ │ │ │ ├── EntityRendererReflectionOptimizer.java │ │ │ │ │ │ │ ├── ExtendedBlockStorageReflectionOptimizer.java │ │ │ │ │ │ │ ├── FaceBakeryReflectionOptimizer.java │ │ │ │ │ │ │ └── ModelRotationReflectionOptimizer.java │ │ │ │ │ │ └── modern │ │ │ │ │ │ │ ├── CustomColorsReflectionOptimizer.java │ │ │ │ │ │ │ ├── ItemModelMesherReflectionOptimizer.java │ │ │ │ │ │ │ └── RenderChunkReflectionOptimizer.java │ │ │ │ │ ├── signfix │ │ │ │ │ │ ├── GuiEditSignTransformer.java │ │ │ │ │ │ └── TileEntitySignRendererTransformer.java │ │ │ │ │ ├── witherfix │ │ │ │ │ │ └── EntityWitherTransformer.java │ │ │ │ │ └── xpfix │ │ │ │ │ │ └── GuiIngameForgeTransformer.java │ │ │ │ │ ├── pingtag │ │ │ │ │ ├── TagRendererListenerTransformer.java │ │ │ │ │ └── TagRendererTransformer.java │ │ │ │ │ ├── sidebarmod │ │ │ │ │ └── GuiSidebarTransformer.java │ │ │ │ │ └── ve │ │ │ │ │ └── BetterChatTransformer.java │ │ │ ├── network │ │ │ │ ├── NetHandlerPlayClientTransformer.java │ │ │ │ ├── NetHandlerPlayServerTransformer.java │ │ │ │ └── packet │ │ │ │ │ ├── S0EPacketSpawnObjectTransformer.java │ │ │ │ │ └── S34PacketMapsTransformer.java │ │ │ ├── render │ │ │ │ ├── particle │ │ │ │ │ └── EffectRendererTransformer.java │ │ │ │ ├── screen │ │ │ │ │ ├── GuiChatTransformer.java │ │ │ │ │ ├── GuiNewChatTransformer.java │ │ │ │ │ └── InventoryEffectRendererTransformer.java │ │ │ │ └── world │ │ │ │ │ ├── RenderGlobalTransformer.java │ │ │ │ │ ├── VertexFormatTransformer.java │ │ │ │ │ ├── VisGraphTransformer.java │ │ │ │ │ └── entity │ │ │ │ │ ├── LayerCustomHeadTransformer.java │ │ │ │ │ ├── LayerHeldItemTransformer.java │ │ │ │ │ ├── RenderPlayerTransformer.java │ │ │ │ │ └── RenderWitherTransformer.java │ │ │ └── world │ │ │ │ └── entity │ │ │ │ └── data │ │ │ │ └── nbt │ │ │ │ └── NBTTagCompoundTransformer.java │ │ │ ├── commands │ │ │ └── PatcherCommand.java │ │ │ ├── config │ │ │ ├── OldPatcherConfig.java │ │ │ ├── PatcherConfig.java │ │ │ └── PatcherSoundConfig.java │ │ │ ├── ducks │ │ │ ├── BlockExt.java │ │ │ ├── EntityFXExt.java │ │ │ ├── FMLClientHandlerExt.java │ │ │ ├── FontRendererExt.java │ │ │ ├── GameSettingsExt.java │ │ │ ├── VisGraphExt.java │ │ │ └── WorldExt.java │ │ │ ├── hooks │ │ │ ├── BlockInfoHook.java │ │ │ ├── ChunkHook.java │ │ │ ├── ContainerOpacityHook.java │ │ │ ├── CropUtilities.java │ │ │ ├── DebugCrosshairHook.java │ │ │ ├── EarsModHook.java │ │ │ ├── EntityRendererHook.java │ │ │ ├── FaceDataHook.java │ │ │ ├── FontRendererHook.java │ │ │ ├── ForgeChunkManagerHook.java │ │ │ ├── GuiIngameForgeHook.java │ │ │ ├── GuiNewChatHook.java │ │ │ ├── ItemRendererHook.java │ │ │ ├── LightUtilHook.java │ │ │ ├── MinecraftHook.java │ │ │ ├── MinecraftServerHook.java │ │ │ ├── ModContainerFactoryHook.java │ │ │ ├── NetHandlerPlayClientHook.java │ │ │ ├── OptiFineHook.java │ │ │ ├── RenderArrowHook.java │ │ │ ├── RendererLivingEntityHook.java │ │ │ ├── ResourcePackRepositoryHook.java │ │ │ ├── ResourceReloadHooks.java │ │ │ ├── ScreenshotManagerHook.java │ │ │ ├── TRSRTransformationHook.java │ │ │ ├── VertexLighterFlatHook.java │ │ │ ├── VertexLighterSmoothAoHook.java │ │ │ ├── ZoomHook.java │ │ │ └── accessors │ │ │ │ └── IVertexLighterFlat.java │ │ │ ├── mixins │ │ │ ├── accessors │ │ │ │ ├── BlockAccessor.java │ │ │ │ ├── EntityArrowAccessor.java │ │ │ │ ├── EventBusAccessor.java │ │ │ │ ├── FontRendererAccessor.java │ │ │ │ ├── GlStateManagerAccessor.java │ │ │ │ ├── GuiBossOverlayAccessor.java │ │ │ │ ├── GuiIngameAccessor.java │ │ │ │ ├── GuiIngameForgeAccessor.java │ │ │ │ ├── GuiMainMenuAccessor.java │ │ │ │ ├── GuiMultiplayerAccessor.java │ │ │ │ ├── GuiNewChatAccessor.java │ │ │ │ ├── GuiSelectWorldAccessor.java │ │ │ │ ├── ItemAccessor.java │ │ │ │ ├── ItemRendererAccessor.java │ │ │ │ ├── ItemStackAccessor.java │ │ │ │ ├── KeyBindingAccessor.java │ │ │ │ ├── MinecraftAccessor.java │ │ │ │ ├── MinecraftForgeClientAccessor.java │ │ │ │ ├── PositionedSoundAccessor.java │ │ │ │ ├── RegistrySimpleAccessor.java │ │ │ │ ├── RenderManagerAccessor.java │ │ │ │ ├── ResourcePackRepositoryAccessor.java │ │ │ │ ├── SoundHandlerAccessor.java │ │ │ │ ├── SoundManagerAccessor.java │ │ │ │ ├── SoundRegistryAccessor.java │ │ │ │ ├── WorldRendererAccessor.java │ │ │ │ └── optifine │ │ │ │ │ ├── ConfigAccessor.java │ │ │ │ │ └── CustomColorsAccessor.java │ │ │ ├── bugfixes │ │ │ │ ├── BlockFluidRendererMixin_FixStitching.java │ │ │ │ ├── BlockModelRendererMixin_SmoothLighting.java │ │ │ │ ├── CommandHandlerMixin_CaseCommands.java │ │ │ │ ├── ContainerMixin_PlaySound.java │ │ │ │ ├── EntityLivingBaseMixin_MouseDelayFix.java │ │ │ │ ├── EntityMixin_FixedBrightness.java │ │ │ │ ├── EntityMixin_SprintParticles.java │ │ │ │ ├── EntityRendererMixin_AdjustEyeHeightLighting.java │ │ │ │ ├── EntityRendererMixin_PolygonOffset.java │ │ │ │ ├── EntityRendererMixin_SpectatorShader.java │ │ │ │ ├── EntityXPOrbMixin_AdjustHeight.java │ │ │ │ ├── FontRendererMixin_ResetStyles.java │ │ │ │ ├── GameSettingsMixin_MipmapSlider.java │ │ │ │ ├── GuiContainerMixin_SplitRemnants.java │ │ │ │ ├── GuiGameOverMixin_ResolveButtonClick.java │ │ │ │ ├── GuiIngameForgeMixin_FixProfilerSection.java │ │ │ │ ├── GuiIngameForgeMixin_HotbarAlpha.java │ │ │ │ ├── GuiIngameMixin_RemoveSpectatorPumpkinOverlay.java │ │ │ │ ├── GuiIngameMixin_ScoreboardTextTransparency.java │ │ │ │ ├── GuiLanguageMixin_ResetUnicodeFont.java │ │ │ │ ├── GuiNewChatMixin_ChatComponentBoundary.java │ │ │ │ ├── GuiNewChatMixin_NullChatLineFix.java │ │ │ │ ├── GuiNewChat_RemoveChatLimit.java │ │ │ │ ├── GuiOptionsMixin_SaveSettings.java │ │ │ │ ├── GuiScreenAddServerMixin_RemoveSpaces.java │ │ │ │ ├── GuiScreenBookMixin_AddBackground.java │ │ │ │ ├── GuiScreenBookMixin_ResolveRenderLayer.java │ │ │ │ ├── GuiScreenMixin_FixWindowsIME.java │ │ │ │ ├── GuiScreenOptionsSoundsMixin_PacketSpam.java │ │ │ │ ├── GuiScreenResourcePacksMixin_ChangeTextPosition.java │ │ │ │ ├── GuiScreenResourcePacksMixin_ClearHandles.java │ │ │ │ ├── GuiScreenResourcePacksMixin_FixOpenPackFolder.java │ │ │ │ ├── GuiScreenServerListMixin_RemoveSpaces.java │ │ │ │ ├── GuiVideoSettingsMixin_MipmapSlider.java │ │ │ │ ├── InventoryEffectRendererMixin_FixPotionEffectNumerals.java │ │ │ │ ├── LayerArrowMixin_FixedBrightness.java │ │ │ │ ├── LayerCreeperChargeMixin_FixDepth.java │ │ │ │ ├── LayerSpiderEyesMixin_FixDepth.java │ │ │ │ ├── LayerWitherAuraMixin_FixDepth.java │ │ │ │ ├── MinecraftMixin_DisplayScreen.java │ │ │ │ ├── MinecraftMixin_FixScreenState.java │ │ │ │ ├── MinecraftMixin_ForeignKeyboards.java │ │ │ │ ├── MinecraftMixin_PersistentShaders.java │ │ │ │ ├── NetHandlerPlayClientMixin_FixHandleSpawnPlayerNPE.java │ │ │ │ ├── NetHandlerPlayClientMixin_FixTileEntityNPE.java │ │ │ │ ├── RenderGlobalMixin_RenderOobEntities.java │ │ │ │ ├── RenderManagerMixin_PerspectiveViewFix.java │ │ │ │ ├── RenderPlayerMixin_ArmPosition.java │ │ │ │ ├── ScoreboardMixin_FixLogSpam.java │ │ │ │ ├── ServerListEntryNormalMixin_BufferFix.java │ │ │ │ ├── SoundManagerMixin_DuplicatedSounds.java │ │ │ │ ├── SoundManagerMixin_LogSpam.java │ │ │ │ ├── TileEntityBannerRendererMixin_BannerAnimation.java │ │ │ │ ├── TileEntityBannerRendererMixin_ChestDisplay.java │ │ │ │ ├── TileEntityRendererDispatcherMixin_EnableLighting.java │ │ │ │ ├── TileEntitySkullRendererMixin_EnableBlending.java │ │ │ │ ├── UtilMixin_StopLogSpam.java │ │ │ │ ├── VertexBufferMixin_ResolveLockups.java │ │ │ │ ├── WorldMixin_SkyHeight.java │ │ │ │ ├── crashes │ │ │ │ │ ├── EntityLivingBaseMixin_ResolveCrash.java │ │ │ │ │ ├── GameSettingsMixin_ResolveCrash.java │ │ │ │ │ ├── GuiScreenMixin_ResolveCrash.java │ │ │ │ │ ├── NBTTagCompoundMixin_FailFast.java │ │ │ │ │ ├── ResourcePackRepositoryMixin_ResolveCrash.java │ │ │ │ │ ├── ServerListEntryNormalMixin_ResolveCrash.java │ │ │ │ │ ├── ServerSelectionListMixin_ResolveCrash.java │ │ │ │ │ └── WorldRendererMixin_ResolveCrash.java │ │ │ │ ├── forge │ │ │ │ │ ├── BlockChestMixin_VanillaSlabChests.java │ │ │ │ │ ├── BlockMixin_VanillaSlabChests.java │ │ │ │ │ ├── BlockPaneMixin_VanillaPanes.java │ │ │ │ │ └── ClientCommandHandlerMixin_CaseCommands.java │ │ │ │ ├── gui │ │ │ │ │ ├── GuiContainerMixin_Alpha.java │ │ │ │ │ └── GuiScreenBookMixin.java │ │ │ │ ├── levelhead │ │ │ │ │ └── AboveHeadRender_ReFixNametagPerspective.java │ │ │ │ ├── modelfixes │ │ │ │ │ ├── ModelPlayerMixin_FixedTransformations.java │ │ │ │ │ ├── ModelSkeletonMixin_FixedHeldItemTransformations.java │ │ │ │ │ └── ModelVillagerMixin_ResolveRobeHeight.java │ │ │ │ ├── mousebindfix │ │ │ │ │ ├── GuiContainerMixin_MouseBindFix.java │ │ │ │ │ └── GuiContainerMixin_MouseBindFixThatLabyBreaks.java │ │ │ │ ├── network │ │ │ │ │ ├── LazyLoadBaseMixin_RaceCondition.java │ │ │ │ │ ├── NetHandlerPlayClientMixin_ResourceExploitFix.java │ │ │ │ │ ├── NetHandlerPlayClientMixin_SignChatSpam.java │ │ │ │ │ ├── PacketThreadUtilMixin_LogSpam.java │ │ │ │ │ ├── ServerAddressMixin_ResolveCrash.java │ │ │ │ │ ├── ServerListMixin_ResolveNpe.java │ │ │ │ │ └── packet │ │ │ │ │ │ └── EntityPacketsMixin_ResolveNpe.java │ │ │ │ ├── optifine │ │ │ │ │ ├── RegionRenderCacheMixin_FixConnectedTextures.java │ │ │ │ │ └── RenderGlobalMixin_FixSkyVBOs.java │ │ │ │ └── render │ │ │ │ │ ├── entity │ │ │ │ │ ├── RenderArrowMixin_AlphaFix.java │ │ │ │ │ ├── RenderFishMixin_AlphaFix.java │ │ │ │ │ └── RenderMixin_FireLayerFix.java │ │ │ │ │ └── item │ │ │ │ │ ├── ItemModelMesherMixin_ResolveCrash.java │ │ │ │ │ ├── ItemStackMixin_HexColorTooltip.java │ │ │ │ │ ├── RenderItemMixin_CullFace.java │ │ │ │ │ └── RenderItemMixin_FixGlint.java │ │ │ ├── features │ │ │ │ ├── AbstractResourcePackMixin_DownscaleImages.java │ │ │ │ ├── ArmorStandRendererMixin_HideNametag.java │ │ │ │ ├── BlockRendererDispatcherMixin_RemoveFoliage.java │ │ │ │ ├── ChatStyleMixin_ModifyHoverEvent.java │ │ │ │ ├── ChunkRenderDispatcherMixin_LimitUpdates.java │ │ │ │ ├── EnchantmentMixin_RomanNumerals.java │ │ │ │ ├── EntityFXMixin_TrackCullState.java │ │ │ │ ├── EntityMixin_NaturalCapes.java │ │ │ │ ├── EntityPlayerMixin_NaturalCapes.java │ │ │ │ ├── EntityPlayerSPMixin_NauseaEffect.java │ │ │ │ ├── EntityRendererMixin_CameraPerspective.java │ │ │ │ ├── EntityRendererMixin_Distortion.java │ │ │ │ ├── EntityRendererMixin_Fog.java │ │ │ │ ├── EntityRendererMixin_NightVisionEffect.java │ │ │ │ ├── EntityRendererMixin_ParallaxFix.java │ │ │ │ ├── EntityRendererMixin_ViewBobbing.java │ │ │ │ ├── FontRenderMixin_ShadowTypes.java │ │ │ │ ├── GuiAchievementMixin_CancelRender.java │ │ │ │ ├── GuiChatMixin_ExtendedChatLength.java │ │ │ │ ├── GuiChatMixin_SafeChatClicksHistory.java │ │ │ │ ├── GuiContainerMixin_ClickOutOfContainers.java │ │ │ │ ├── GuiContainerMixin_DropModifierKey.java │ │ │ │ ├── GuiIngameForgeMixin_TitleRendering.java │ │ │ │ ├── GuiIngameMixin_PumpkinBlurRendering.java │ │ │ │ ├── GuiModListMixin_RemoveDummyPatcherMod.java │ │ │ │ ├── GuiMultiplayerMixin_FastServerJoin.java │ │ │ │ ├── GuiNewChatMixin_ChatDelay.java │ │ │ │ ├── GuiNewChatMixin_CompactChat.java │ │ │ │ ├── GuiScreenMixin_BackgroundRendering.java │ │ │ │ ├── GuiScreenServerListMixin_FakeServerListDirectConnect.java │ │ │ │ ├── ImageBufferDownloadMixin_ImprovedHeadRendering.java │ │ │ │ ├── ImageBufferDownload_EarsMod.java │ │ │ │ ├── InventoryPlayerTransformer_HotbarScrolling.java │ │ │ │ ├── LayerArrowMixin_CancelRender.java │ │ │ │ ├── LayerCapeMixin_NaturalCapes.java │ │ │ │ ├── LayerWitherAuraMixin_DisableWhenInvisible.java │ │ │ │ ├── MinecraftMixin_BetterKeybindHandling.java │ │ │ │ ├── MinecraftMixin_CustomDebugKeys.java │ │ │ │ ├── MinecraftMixin_FpsLimit.java │ │ │ │ ├── MinecraftMixin_KeepChatMessages.java │ │ │ │ ├── MinecraftMixin_Metrics.java │ │ │ │ ├── MinecraftMixin_SeparateResources.java │ │ │ │ ├── MinecraftMixin_WindowedFullscreen.java │ │ │ │ ├── MinecraftServerMixin_Metrics.java │ │ │ │ ├── RenderArrowMixin_CancelRender.java │ │ │ │ ├── RenderEntityItemMixin_StaticItems.java │ │ │ │ ├── RenderEntityItemMixin_UnstackedItems.java │ │ │ │ ├── RenderFallingBlockMixin_CancelRender.java │ │ │ │ ├── RenderFishMixin_CleanProjectiles.java │ │ │ │ ├── RenderItemFrameMixin_CancelRender.java │ │ │ │ ├── RenderLightningBoltMixin_CancelRender.java │ │ │ │ ├── RenderManagerMixin_CancelArrowRender.java │ │ │ │ ├── RenderSnowballMixin_CleanProjectiles.java │ │ │ │ ├── RendererLivingEntityMixin_NametagRendering.java │ │ │ │ ├── ScreenShotHelperMixin_ScreenshotManager.java │ │ │ │ ├── TileEntityEnchantmentTableRendererMixin_CancelRender.java │ │ │ │ ├── TileEntityEndPortalRendererMixins_CancelRender.java │ │ │ │ ├── TileEntityMixin_RenderDistance.java │ │ │ │ ├── TileEntitySkullRendererMixin_CancelRender.java │ │ │ │ ├── WorldMixin_CameraPerspective.java │ │ │ │ ├── containeropacity │ │ │ │ │ ├── GuiChestMixin_ContainerOpacity.java │ │ │ │ │ └── GuiInventoryMixin_ContainerOpacity.java │ │ │ │ ├── cropheight │ │ │ │ │ ├── BlockCactusMixin_CropHitbox.java │ │ │ │ │ ├── BlockCropsMixin_CropHeight.java │ │ │ │ │ ├── BlockMixin_CropHitbox.java │ │ │ │ │ └── BlockNetherWartMixin_CropHeight.java │ │ │ │ ├── disableenchantglint │ │ │ │ │ ├── LayerArmorBaseMixin_DisableEnchantGlint.java │ │ │ │ │ └── RenderItemMixin_DisableEnchantGlint.java │ │ │ │ ├── fullbright │ │ │ │ │ ├── ChunkMixin_Fullbright.java │ │ │ │ │ └── WorldMixin_Fullbright.java │ │ │ │ ├── invscale │ │ │ │ │ ├── ForgeHooksClientMixin_InventoryScale.java │ │ │ │ │ ├── GuiScreenMixin_InventoryScale.java │ │ │ │ │ └── ScaledResolutionMixin_InventoryScale.java │ │ │ │ ├── lefthand │ │ │ │ │ ├── EntityRendererMixin_LeftHandedness.java │ │ │ │ │ ├── ItemRendererMixin_LeftHandedness.java │ │ │ │ │ ├── RenderFishMixin_LeftHandedness.java │ │ │ │ │ └── RenderItemMixin_LeftHandedness.java │ │ │ │ ├── network │ │ │ │ │ ├── NetHandlerPlayClientMixin_ChatDelay.java │ │ │ │ │ └── packet │ │ │ │ │ │ ├── C01PacketChatMessageMixin_ExtendedChatLength.java │ │ │ │ │ │ └── S2EPacketCloseWindowMixin_NoCloseMyChat.java │ │ │ │ ├── optifine │ │ │ │ │ ├── ConfigMixin_SimplifyFpsCounter.java │ │ │ │ │ ├── EntityRendererMixin_ZoomTweaks.java │ │ │ │ │ ├── GuiOverlayDebugMixin_SimplifyFpsCounter.java │ │ │ │ │ ├── GuiOverlayDebugMixin_VanillaMetricsRenderer.java │ │ │ │ │ └── LayerCapeMixin_NaturalCapes_OptifineCompat.java │ │ │ │ ├── render │ │ │ │ │ └── item │ │ │ │ │ │ ├── ItemRendererMixin_FireRendering.java │ │ │ │ │ │ └── ItemRendererMixin_RemoveWaterOverlay.java │ │ │ │ └── smoothscrolling │ │ │ │ │ └── GuiSlotMixin.java │ │ │ ├── performance │ │ │ │ ├── AnvilChunkLoaderMixin_UnclosedStream.java │ │ │ │ ├── BlockPosMixin_ReduceAllocations.java │ │ │ │ ├── BlockRedstoneTorchMixin_MemoryLeak.java │ │ │ │ ├── ChunkMixin_Optimization.java │ │ │ │ ├── ChunkMixin_TileEntityUnload.java │ │ │ │ ├── EffectRendererMixin_ParticleCulling.java │ │ │ │ ├── EnchantmentHelperMixin_MemoryLeak.java │ │ │ │ ├── EntityMixin_Capability.java │ │ │ │ ├── EntityMixin_DisplayNames.java │ │ │ │ ├── EntityOtherPlayerMPMixin_UselessAnimations.java │ │ │ │ ├── EntityPlayerMixin_DisplayNames.java │ │ │ │ ├── EntityRendererMixin_CancelLightmapBuild.java │ │ │ │ ├── EntityRendererMixin_EntityCulling.java │ │ │ │ ├── EntityRendererMixin_SkipTwitchRendering.java │ │ │ │ ├── EnumFacingMixin_ReduceAllocations.java │ │ │ │ ├── FontRendererMixin_Optimization.java │ │ │ │ ├── GameRulesValueMixin_Optimization.java │ │ │ │ ├── GuiLanguageMixin_RefreshLanguage.java │ │ │ │ ├── LoadingScreenRendererMixin_SkipProgress.java │ │ │ │ ├── MathHelperMixin_CompactLUT.java │ │ │ │ ├── MinecraftMixin_MemoryIssues.java │ │ │ │ ├── MinecraftMixin_OptimizedWorldSwapping.java │ │ │ │ ├── MinecraftMixin_SkipTwitchStuff.java │ │ │ │ ├── MinecraftMixin_ToggleGLErrorChecking.java │ │ │ │ ├── MinecraftServerMixin_MemoryLeak.java │ │ │ │ ├── ModelRendererMixin_BatchDrawing.java │ │ │ │ ├── NBTTagStringMixin_DataCache.java │ │ │ │ ├── NetHandlerPlayClientMixin_InstantDimensionSwapping.java │ │ │ │ ├── NodeProcessorMixin_MemoryLeak.java │ │ │ │ ├── RenderChunkMixin_OptimizeSpecialTileEntities.java │ │ │ │ ├── RenderEntityItemMixin_EntityCulling.java │ │ │ │ ├── RenderGlobalMixin_LimitVisGraphScan.java │ │ │ │ ├── ResourceLocation_Deduplicate.java │ │ │ │ ├── ResourcePackRepositoryMixin_FasterSearching.java │ │ │ │ ├── SimpleReloadableResourceManager_OnlyRefreshNecessaryListeners.java │ │ │ │ ├── TextureManagerMixin_MemoryLeak.java │ │ │ │ ├── TexturedQuadMixin_BatchDraw.java │ │ │ │ ├── TileEntityMobSpawnerRendererMixin_EntityCulling.java │ │ │ │ ├── TileEntityRendererDispatcherMixin_BatchDraw.java │ │ │ │ ├── TileEntityRendererDispatcherMixin_RemoveInvalidEntities.java │ │ │ │ ├── VisGraphMixin_LimitScan.java │ │ │ │ ├── WorldClientMixin_AnimationTick.java │ │ │ │ ├── WorldMixin_EntityOptimization.java │ │ │ │ ├── WorldMixin_FixEarlyLightInitialization.java │ │ │ │ ├── WorldMixin_TileEntityUnload.java │ │ │ │ ├── forge │ │ │ │ │ ├── ASMDataTableMixin_ComputeParallel.java │ │ │ │ │ ├── ExtendedBlockStateMixin_FasterCreateState.java │ │ │ │ │ ├── FMLClientHandlerMixin_GetErrors.java │ │ │ │ │ ├── FMLClientHandlerMixin_Optimization.java │ │ │ │ │ ├── FMLControlledNamespacedRegistryMixin_TrimAvailabilityMap.java │ │ │ │ │ ├── FMLIndexedMessageToMessageCodecMixin_FastUtil.java │ │ │ │ │ ├── FluidRegistryMixin_Optimization.java │ │ │ │ │ ├── ForgeBlockStateV1Mixin_OptimizeTransforms.java │ │ │ │ │ ├── ForgeHooksClientMixin_OptimizeTransforms.java │ │ │ │ │ ├── InvWrapperMixin_ImproveInsertion.java │ │ │ │ │ ├── ItemLayerModelMixin_ReduceQuadCount.java │ │ │ │ │ ├── ItemModelMesherForgeMixin_FastUtil.java │ │ │ │ │ ├── JarDiscovererMixin_ReplaceRegex.java │ │ │ │ │ ├── LightUtilMixin_OptimizeNormals.java │ │ │ │ │ ├── ModDiscovererMixin_Logging.java │ │ │ │ │ ├── ModDiscovererMixin_ReplaceRegex.java │ │ │ │ │ ├── ModelLoaderMixin_SkipFatalModels.java │ │ │ │ │ ├── ModelLoader_SkipFirstBaking.java │ │ │ │ │ ├── OBJLoaderMixin_UnclosedStream.java │ │ │ │ │ ├── OBJModelMixin_UnclosedStreams.java │ │ │ │ │ ├── SidedInvWrapperMixin_ImproveInsertion.java │ │ │ │ │ ├── TRSRTransformationMixin_OptimizeTransforms.java │ │ │ │ │ └── VertexLighterFlatMixin_OptimizeNormals.java │ │ │ │ ├── hudcaching │ │ │ │ │ ├── EntityRendererMixin_HUDCaching.java │ │ │ │ │ ├── FramebufferMixin_HUDCaching.java │ │ │ │ │ ├── GlStateManagerMixin_HUDCaching.java │ │ │ │ │ ├── GuiIngameForgeMixin_HUDCaching.java │ │ │ │ │ └── GuiIngameMixin_HUDCaching.java │ │ │ │ ├── network │ │ │ │ │ └── packet │ │ │ │ │ │ ├── C17PacketCustomPayloadMixin_MemoryLeak.java │ │ │ │ │ │ └── S3FPacketCustomPayloadMixin_MemoryLeak.java │ │ │ │ ├── optifine │ │ │ │ │ └── MathHelperMixin_OFFastMath.java │ │ │ │ └── render │ │ │ │ │ └── item │ │ │ │ │ └── ItemStackMixin_CacheDisplayName.java │ │ │ └── plugin │ │ │ │ └── PatcherMixinPlugin.java │ │ │ ├── optifine │ │ │ ├── OptiFineFontRendererHandler.java │ │ │ └── OptiFineGenerations.java │ │ │ ├── screen │ │ │ ├── FakeMultiplayerMenu.java │ │ │ ├── PatcherMenuEditor.java │ │ │ ├── ResolutionHelper.java │ │ │ ├── disconnect │ │ │ │ └── SmartDisconnectScreen.java │ │ │ ├── quit │ │ │ │ └── ConfirmQuitScreen.java │ │ │ └── render │ │ │ │ ├── caching │ │ │ │ └── HUDCaching.java │ │ │ │ ├── overlay │ │ │ │ ├── ArmorStatusRenderer.java │ │ │ │ ├── GlanceRenderer.java │ │ │ │ ├── ImagePreview.java │ │ │ │ └── metrics │ │ │ │ │ ├── MetricsData.java │ │ │ │ │ └── MetricsRenderer.java │ │ │ │ └── title │ │ │ │ └── TitleFix.java │ │ │ ├── tweaker │ │ │ ├── ClassTransformer.java │ │ │ ├── PatcherClassWriter.java │ │ │ ├── PatcherTweaker.java │ │ │ ├── other │ │ │ │ ├── ModClassTransformer.java │ │ │ │ └── ModTweaker.java │ │ │ └── transform │ │ │ │ ├── CommonTransformer.java │ │ │ │ └── PatcherTransformer.java │ │ │ └── util │ │ │ ├── RomanNumerals.java │ │ │ ├── animation │ │ │ └── EaseOutQuart.java │ │ │ ├── chat │ │ │ ├── ChatComponentIgnored.java │ │ │ ├── ChatHandler.java │ │ │ └── ChatUtilities.java │ │ │ ├── enhancement │ │ │ ├── Enhancement.java │ │ │ ├── EnhancementManager.java │ │ │ ├── ReloadListener.java │ │ │ ├── hash │ │ │ │ ├── StringHash.java │ │ │ │ └── impl │ │ │ │ │ └── AbstractHash.java │ │ │ └── text │ │ │ │ ├── CachedString.java │ │ │ │ └── EnhancedFontRenderer.java │ │ │ ├── forge │ │ │ ├── EntrypointCaching.java │ │ │ └── ExtendedStateImplementation.java │ │ │ ├── fov │ │ │ └── FovHandler.java │ │ │ ├── keybind │ │ │ ├── FunctionKeyChanger.java │ │ │ ├── KeybindDropModifier.java │ │ │ ├── KeycodeHelper.java │ │ │ ├── MousePerspectiveKeybindHandler.java │ │ │ └── linux │ │ │ │ └── LinuxKeybindFix.java │ │ │ ├── screenshot │ │ │ └── AsyncScreenshots.java │ │ │ ├── status │ │ │ └── ProtocolVersionDetector.java │ │ │ └── world │ │ │ ├── SavesWatcher.java │ │ │ ├── render │ │ │ ├── FullbrightTicker.java │ │ │ ├── culling │ │ │ │ ├── EntityCulling.java │ │ │ │ └── ParticleCulling.java │ │ │ └── entity │ │ │ │ └── EntityRendering.java │ │ │ └── sound │ │ │ ├── SoundHandler.java │ │ │ └── audioswitcher │ │ │ ├── ALCHelper.java │ │ │ ├── AudioSwitcher.java │ │ │ └── LibraryLWJGLOpenALImpl.java │ └── me │ │ └── jellysquid │ │ └── mods │ │ ├── hydrogen │ │ └── common │ │ │ └── dedup │ │ │ ├── DeduplicationCache.java │ │ │ └── IdentifierCaches.java │ │ └── lithium │ │ └── common │ │ └── util │ │ └── math │ │ └── CompactSineLUT.java │ ├── kotlin │ └── club │ │ └── sk1er │ │ └── patcher │ │ ├── asm │ │ ├── external │ │ │ ├── forge │ │ │ │ ├── ForgeChunkManagerTransformer.kt │ │ │ │ └── ModelLoaderTransformer.kt │ │ │ └── optifine │ │ │ │ └── WorldVertexBufferUploaderTransformer.kt │ │ └── render │ │ │ └── screen │ │ │ └── GuiPlayerTabOverlayTransformer.kt │ │ └── render │ │ └── ScreenshotPreview.kt │ └── resources │ ├── LICENSE.md │ ├── LITHIUM-FABRIC-LICENSE.txt │ ├── assets │ └── patcher │ │ └── font_glyph_data.bin │ ├── mcmod.info │ ├── mixins.patcher.json │ ├── patcher.png │ ├── patcher.svg │ ├── patcher112_at.cfg │ └── patcher18_at.cfg └── versions ├── 1.12.2-1.8.9.txt └── mainProject /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*.java] 4 | charset = utf-8 5 | insert_final_newline = true 6 | indent_size = 4 7 | indent_style = space 8 | ij_java_use_single_class_imports = true 9 | 10 | [*.json] 11 | indent_size = 2 12 | charset = utf-8 -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: 4 | push: 5 | pull_request: 6 | 7 | jobs: 8 | build: 9 | name: "Build" 10 | runs-on: "ubuntu-latest" 11 | 12 | steps: 13 | - uses: actions/checkout@v4 14 | 15 | - uses: gradle/wrapper-validation-action@v3 16 | 17 | - uses: actions/setup-java@v4 18 | with: 19 | distribution: "temurin" 20 | java-version: "21" 21 | 22 | - uses: actions/cache@v4 23 | with: 24 | path: | 25 | ~/.gradle/caches 26 | ~/.gradle/wrapper 27 | **/loom-cache 28 | key: ${{ runner.os }}-gradle-v2-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} 29 | restore-keys: | 30 | ${{ runner.os }}-gradle-v2- 31 | 32 | - run: ./gradlew --no-daemon build 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # eclipse 2 | eclipse 3 | bin 4 | *.launch 5 | .settings 6 | .metadata 7 | .classpath 8 | .project 9 | 10 | # idea 11 | out 12 | classes 13 | *.ipr 14 | *.iws 15 | *.iml 16 | .idea 17 | .run 18 | 19 | # gradle 20 | build 21 | .gradle 22 | 23 | #Netbeans 24 | .nb-gradle 25 | .nb-gradle-properties 26 | 27 | # other 28 | run 29 | .DS_Store 30 | Thumbs.db 31 | .vscode 32 | 33 | versions/*/tmp.srg -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # gradle.properties file -- CHANGE THE VALUES STARTING WITH `mod_*` AND REMOVE THIS COMMENT. 2 | 3 | # Sets the name of your mod. 4 | mod_name=Patcher 5 | # Sets the id of your mod that mod loaders use to recognize it. 6 | mod_id=patcher 7 | # Sets the version of your mod. 8 | # normal versions will be "1.x.x" 9 | # betas will be "1.x.x+beta-y" / "1.x.x+branch_beta-y" 10 | # rcs will be 1.x.x+rc-y 11 | # extra branches will be 1.x.x+branch-y 12 | mod_version=1.10.3 13 | # Sets the name of the jar file that you put in your 'mods' folder. 14 | mod_archives_name=PolyPatcher 15 | 16 | # Gradle Configuration -- DO NOT TOUCH THESE VALUES. 17 | polyfrost.defaults.loom=3 18 | org.gradle.daemon=true 19 | org.gradle.parallel=true 20 | org.gradle.configureoncommand=true 21 | org.gradle.parallel.threads=4 22 | org.gradle.jvmargs=-Xmx2G -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Polyfrost/PolyPatcher/20fb4b2fb97974b3d522d91315c503c0a5e8e2de/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /root.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | kotlin("jvm") version "1.9.10" apply false 3 | id("org.polyfrost.multi-version.root") 4 | id("com.github.johnrengelman.shadow") version "8.1.1" apply false 5 | } 6 | 7 | preprocess { 8 | strictExtraMappings.set(true) 9 | "1.12.2-forge"(11202, "srg") { 10 | "1.8.9-forge"(10809, "srg", file("versions/1.12.2-1.8.9.txt")) 11 | } 12 | } -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | @file:Suppress("PropertyName") 2 | 3 | pluginManagement { 4 | repositories { 5 | gradlePluginPortal() 6 | mavenCentral() 7 | maven("https://repo.polyfrost.org/releases") // Adds the Polyfrost maven repository to get Polyfrost Gradle Toolkit 8 | } 9 | plugins { 10 | val pgtVersion = "0.6.7" // Sets the default versions for Polyfrost Gradle Toolkit 11 | id("org.polyfrost.multi-version.root") version pgtVersion 12 | } 13 | } 14 | 15 | val mod_name: String by settings 16 | 17 | // Configures the root project Gradle name based on the value in `gradle.properties` 18 | rootProject.name = mod_name 19 | rootProject.buildFileName = "root.gradle.kts" 20 | 21 | // Adds all of our build target versions to the classpath if we need to add version-specific code. 22 | listOf( 23 | "1.8.9-forge", // Update this if you want to remove/add a version, along with `build.gradle.kts` and `root.gradle.kts`. 24 | "1.12.2-forge" 25 | ).forEach { version -> 26 | include(":$version") 27 | project(":$version").apply { 28 | projectDir = file("versions/$version") 29 | buildFileName = "../../build.gradle.kts" 30 | } 31 | } -------------------------------------------------------------------------------- /src/dummy/java/com/unascribed/ears/Ears.java: -------------------------------------------------------------------------------- 1 | package com.unascribed.ears; 2 | 3 | import net.minecraft.client.renderer.ImageBufferDownload; 4 | 5 | import java.awt.image.BufferedImage; 6 | 7 | public class Ears { 8 | public static void preprocessSkin(ImageBufferDownload subject, BufferedImage rawImg, BufferedImage img) { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/dummy/java/gg/essential/api/config/EssentialConfig.java: -------------------------------------------------------------------------------- 1 | package gg.essential.api.config; 2 | 3 | public interface EssentialConfig { 4 | boolean getEssentialScreenshots(); 5 | 6 | boolean getOpenToFriends(); 7 | 8 | boolean getEssentialFull(); 9 | } 10 | -------------------------------------------------------------------------------- /src/dummy/java/gg/essential/api/data/OnboardingData.java: -------------------------------------------------------------------------------- 1 | package gg.essential.api.data; 2 | 3 | public interface OnboardingData { 4 | boolean hasAcceptedEssentialTOS(); 5 | } 6 | -------------------------------------------------------------------------------- /src/dummy/java/gg/essential/api/utils/TrustedHostsUtil.java: -------------------------------------------------------------------------------- 1 | package gg.essential.api.utils; 2 | 3 | import java.util.Set; 4 | 5 | public interface TrustedHostsUtil { 6 | Set getTrustedHosts(); 7 | 8 | final class TrustedHost { 9 | private Set domains; 10 | public Set getDomains() { 11 | return domains; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/PolyPatcher.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher; 2 | 3 | import com.google.common.eventbus.EventBus; 4 | import net.minecraftforge.fml.common.DummyModContainer; 5 | import net.minecraftforge.fml.common.LoadController; 6 | import net.minecraftforge.fml.common.ModMetadata; 7 | 8 | public class PolyPatcher extends DummyModContainer { 9 | 10 | public PolyPatcher() { 11 | super(new ModMetadata()); 12 | ModMetadata meta = getMetadata(); 13 | meta.modId = "polypatcher"; 14 | meta.name = "PolyPatcher"; 15 | meta.description = "A Forge mod full of Vanilla bug fixes, Quality of Life improvements, and performance enhancements."; 16 | meta.version = "@VER@"; 17 | meta.authorList.add("Polyfrost"); 18 | meta.authorList.add("Sk1er LLC"); 19 | meta.credits = "prplz, 2pi, UserTeemu, DJtheRedstoner"; 20 | meta.url = "https://modrinth.com/mod/patcher"; 21 | meta.logoFile = "/patcher.png"; 22 | } 23 | 24 | @Override 25 | public boolean registerBus(EventBus bus, LoadController controller) { 26 | return true; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/asm/external/mods/pingtag/TagRendererListenerTransformer.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.asm.external.mods.pingtag; 2 | 3 | import club.sk1er.patcher.tweaker.transform.CommonTransformer; 4 | import org.objectweb.asm.tree.ClassNode; 5 | import org.objectweb.asm.tree.MethodNode; 6 | 7 | public class TagRendererListenerTransformer implements CommonTransformer { 8 | 9 | /** 10 | * The class name that's being transformed 11 | * 12 | * @return the class name 13 | */ 14 | @Override 15 | public String[] getClassName() { 16 | return new String[]{"me.powns.pingtag.rendering.TagRenderListener"}; 17 | } 18 | 19 | /** 20 | * Perform any asm in order to transform code 21 | * 22 | * @param classNode the transformed class node 23 | * @param name the transformed class name 24 | */ 25 | @Override 26 | public void transform(ClassNode classNode, String name) { 27 | for (MethodNode methodNode : classNode.methods) { 28 | if (methodNode.name.equals("render")) { 29 | methodNode.instructions.insert(modifyNametagRenderState(true)); 30 | break; 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/asm/external/mods/ve/BetterChatTransformer.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.asm.external.mods.ve; 2 | 3 | import club.sk1er.patcher.tweaker.transform.CommonTransformer; 4 | import org.objectweb.asm.tree.ClassNode; 5 | import org.objectweb.asm.tree.MethodNode; 6 | 7 | public class BetterChatTransformer implements CommonTransformer { 8 | @Override 9 | public String[] getClassName() { 10 | return new String[]{"com.orangemarshall.enhancements.modules.chat.BetterChat"}; 11 | } 12 | 13 | @Override 14 | public void transform(ClassNode classNode, String name) { 15 | for (MethodNode method : classNode.methods) { 16 | final String methodName = mapMethodName(classNode, method); 17 | 18 | if (methodName.equals("getChatComponent") || methodName.equals("func_146236_a")) { 19 | this.changeChatComponentHeight(method); 20 | break; 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/asm/world/entity/data/nbt/NBTTagCompoundTransformer.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.asm.world.entity.data.nbt; 2 | 3 | import club.sk1er.patcher.tweaker.transform.PatcherTransformer; 4 | import org.objectweb.asm.Opcodes; 5 | import org.objectweb.asm.tree.ClassNode; 6 | import org.objectweb.asm.tree.FieldNode; 7 | 8 | public class NBTTagCompoundTransformer implements PatcherTransformer { 9 | 10 | /** 11 | * The class name that's being transformed 12 | * 13 | * @return the class name 14 | */ 15 | @Override 16 | public String[] getClassName() { 17 | return new String[]{"net.minecraft.nbt.NBTTagCompound"}; 18 | } 19 | 20 | /** 21 | * Perform any asm in order to transform code 22 | * 23 | * @param classNode the transformed class node 24 | * @param name the transformed class name 25 | */ 26 | @Override 27 | public void transform(ClassNode classNode, String name) { 28 | classNode.fields.add(new FieldNode(Opcodes.ACC_PUBLIC, "profile", "Lcom/mojang/authlib/GameProfile;", null, null)); 29 | classNode.fields.add(new FieldNode(Opcodes.ACC_PUBLIC, "compound", "Lnet/minecraft/nbt/NBTTagCompound;", null, null)); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/ducks/BlockExt.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.ducks; 2 | 3 | import net.minecraft.util.BlockPos; 4 | import net.minecraft.util.EnumFacing; 5 | import net.minecraft.world.IBlockAccess; 6 | 7 | public interface BlockExt { 8 | boolean patcher$doesSideBlockChestOpening(IBlockAccess world, BlockPos pos, EnumFacing side); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/ducks/EntityFXExt.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.ducks; 2 | 3 | public interface EntityFXExt { 4 | void patcher$setCullState(float cullState); 5 | float patcher$getCullState(); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/ducks/FMLClientHandlerExt.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.ducks; 2 | 3 | public interface FMLClientHandlerExt { 4 | default boolean patcher$hasErrors() { 5 | return false; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/ducks/FontRendererExt.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.ducks; 2 | 3 | import club.sk1er.patcher.hooks.FontRendererHook; 4 | 5 | public interface FontRendererExt { 6 | FontRendererHook patcher$getFontRendererHook(); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/ducks/GameSettingsExt.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.ducks; 2 | 3 | public interface GameSettingsExt { 4 | void patcher$onSettingsGuiClosed(); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/ducks/VisGraphExt.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.ducks; 2 | 3 | public interface VisGraphExt { 4 | void patcher$setLimitScan(boolean limitScan); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/ducks/WorldExt.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.ducks; 2 | 3 | import net.minecraft.world.chunk.Chunk; 4 | 5 | public interface WorldExt { 6 | void patcher$markTileEntitiesInChunkForRemoval(Chunk chunk); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/hooks/ChunkHook.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.hooks; 2 | 3 | import net.minecraft.block.state.IBlockState; 4 | import net.minecraft.init.Blocks; 5 | import net.minecraft.util.BlockPos; 6 | import net.minecraft.world.chunk.Chunk; 7 | import net.minecraft.world.chunk.storage.ExtendedBlockStorage; 8 | 9 | @SuppressWarnings("unused") 10 | public class ChunkHook { 11 | 12 | public static IBlockState getBlockState(Chunk chunk, BlockPos pos) { 13 | final int y = pos.getY(); 14 | 15 | if (y >= 0 && y >> 4 < chunk.getBlockStorageArray().length) { 16 | final ExtendedBlockStorage storage = chunk.getBlockStorageArray()[y >> 4]; 17 | if (storage != null) return storage.get(pos.getX() & 15, y & 15, pos.getZ() & 15); 18 | } 19 | 20 | return Blocks.air.getDefaultState(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/hooks/ContainerOpacityHook.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.hooks; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.renderer.GlStateManager; 5 | import org.lwjgl.opengl.GL11; 6 | 7 | public class ContainerOpacityHook { 8 | 9 | public static void beginTransparency() { 10 | float containerOpacity = PatcherConfig.containerOpacity / 100F; 11 | if (containerOpacity == 1.0f) return; 12 | 13 | GlStateManager.enableBlend(); 14 | GlStateManager.enableAlpha(); 15 | GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F); 16 | GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); 17 | GlStateManager.color(1, 1, 1, containerOpacity); 18 | } 19 | 20 | public static void endTransparency() { 21 | if (PatcherConfig.containerOpacity / 100F == 1.0F) return; 22 | 23 | GlStateManager.disableBlend(); 24 | GlStateManager.disableAlpha(); 25 | GlStateManager.color(1, 1, 1, 1); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/hooks/EarsModHook.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.hooks; 2 | 3 | import com.unascribed.ears.Ears; 4 | import net.minecraft.client.renderer.ImageBufferDownload; 5 | 6 | import java.awt.image.BufferedImage; 7 | 8 | public class EarsModHook { 9 | private static boolean isEarsModPresent; 10 | private static boolean isEarsModPresentChecked; 11 | public static void preprocessSkin(ImageBufferDownload imageBufferDownload, BufferedImage image, BufferedImage bufferedImage) { 12 | if (!isEarsModPresentChecked) { 13 | isEarsModPresentChecked = true; 14 | try { 15 | Class clazz = Class.forName("com.unascribed.ears.Ears"); 16 | clazz.getMethod("preprocessSkin", ImageBufferDownload.class, BufferedImage.class, BufferedImage.class); 17 | isEarsModPresent = true; 18 | } catch (ClassNotFoundException e) { 19 | isEarsModPresent = false; 20 | } catch (NoSuchMethodException e) { 21 | e.printStackTrace(); 22 | isEarsModPresent = false; 23 | } 24 | } 25 | if (!isEarsModPresent) return; 26 | Ears.preprocessSkin(imageBufferDownload, image, bufferedImage); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/hooks/FaceDataHook.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.hooks; 2 | 3 | import net.minecraft.util.EnumFacing; 4 | 5 | import java.util.BitSet; 6 | import java.util.EnumMap; 7 | 8 | public class FaceDataHook { 9 | 10 | private final EnumMap data; 11 | private final int vMax; 12 | 13 | public FaceDataHook(final int uMax, final int vMax) { 14 | this.data = new EnumMap<>(EnumFacing.class); 15 | this.vMax = vMax; 16 | int size = uMax * vMax; 17 | BitSet initialData = new BitSet(size); 18 | this.data.put(EnumFacing.WEST, initialData); 19 | this.data.put(EnumFacing.EAST, new BitSet(size)); 20 | this.data.put(EnumFacing.UP, new BitSet(size)); 21 | this.data.put(EnumFacing.DOWN, new BitSet(size)); 22 | } 23 | 24 | public void set(final EnumFacing facing, final int u, final int v) { 25 | BitSet dataSet = this.data.get(facing); 26 | dataSet.set(getIndex(u, v)); 27 | } 28 | 29 | public boolean get(final EnumFacing facing, final int u, final int v) { 30 | BitSet dataSet = this.data.get(facing); 31 | return dataSet.get(getIndex(u, v)); 32 | } 33 | 34 | private int getIndex(final int u, final int v) { 35 | return v * this.vMax + u; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/hooks/ForgeChunkManagerHook.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.hooks; 2 | 3 | //#if MC==10809 4 | import club.sk1er.patcher.asm.external.forge.ForgeChunkManagerTransformer; 5 | import com.google.common.collect.ImmutableSetMultimap; 6 | import net.minecraft.world.ChunkCoordIntPair; 7 | import net.minecraft.world.World; 8 | import net.minecraftforge.common.ForgeChunkManager.Ticket; 9 | import org.objectweb.asm.tree.ClassNode; 10 | 11 | import java.util.Map; 12 | 13 | /** 14 | * Used in {@link ForgeChunkManagerTransformer#transform(ClassNode, String)} 15 | */ 16 | @SuppressWarnings("unused") 17 | public class ForgeChunkManagerHook { 18 | 19 | public static ImmutableSetMultimap getPersistentChunksFor(World world, Map> forcedChunks) { 20 | if (world.isRemote) { 21 | return ImmutableSetMultimap.of(); 22 | } 23 | 24 | ImmutableSetMultimap persistentChunks = forcedChunks.get(world); 25 | return persistentChunks != null ? persistentChunks : ImmutableSetMultimap.of(); 26 | } 27 | } 28 | //#endif 29 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/hooks/GuiIngameForgeHook.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.hooks; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.potion.Potion; 5 | 6 | @SuppressWarnings("unused") 7 | public class GuiIngameForgeHook { 8 | 9 | private static final Minecraft mc = Minecraft.getMinecraft(); 10 | 11 | public static int fixHealthMargin(int original) { 12 | if (mc.thePlayer.isPotionActive(Potion.poison)) original -= 36; 13 | else if (mc.thePlayer.isPotionActive(Potion.wither)) original -= 108; 14 | return original; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/hooks/ItemRendererHook.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.hooks; 2 | 3 | public class ItemRendererHook { 4 | public static boolean isRenderingItemInFirstPerson; 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/hooks/LightUtilHook.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.hooks; 2 | 3 | @SuppressWarnings("unused") 4 | public class LightUtilHook { 5 | public static float diffuseLight(float x, float y, float z) { 6 | return Math.min(x * x * 0.6f + y * y * ((3f + y) / 4f) + z * z * 0.8f, 1f); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/hooks/MinecraftServerHook.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.hooks; 2 | 3 | import club.sk1er.patcher.screen.render.overlay.metrics.MetricsData; 4 | 5 | public class MinecraftServerHook { 6 | public static MetricsData metricsData; 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/hooks/OptiFineHook.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.hooks; 2 | 3 | import net.minecraft.client.gui.FontRenderer; 4 | 5 | public class OptiFineHook { 6 | 7 | public float getCharWidth(FontRenderer renderer, char c) {//Remapped by OptiFineHookTransformer to Optifine if needed 8 | return renderer.getCharWidth(c); 9 | } 10 | 11 | public float getOptifineBoldOffset(FontRenderer renderer) { //Remapped by FontRendererHookTransformer to Optifine if needed 12 | return 1; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/hooks/RenderArrowHook.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.hooks; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import club.sk1er.patcher.mixins.accessors.EntityArrowAccessor; 5 | import net.minecraft.entity.projectile.EntityArrow; 6 | 7 | public class RenderArrowHook { 8 | public static boolean cancelRendering(EntityArrow entity) { 9 | boolean grounded = ((EntityArrowAccessor) entity).getInGround(); 10 | boolean moving = entity.motionX > 0 || entity.motionY > 0 || entity.motionZ > 0; 11 | return (PatcherConfig.disableMovingArrows && moving && !grounded) || (PatcherConfig.disableGroundedArrows && grounded); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/hooks/ScreenshotManagerHook.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.hooks; 2 | 3 | import gg.essential.api.EssentialAPI; 4 | 5 | public class ScreenshotManagerHook { 6 | public static boolean isEssentialScreenshot() { 7 | return EssentialAPI.getConfig().getEssentialScreenshots(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/hooks/VertexLighterFlatHook.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.hooks; 2 | 3 | import net.minecraft.client.renderer.vertex.DefaultVertexFormats; 4 | import net.minecraft.client.renderer.vertex.VertexFormat; 5 | import net.minecraft.client.renderer.vertex.VertexFormatElement; 6 | 7 | public class VertexLighterFlatHook { 8 | private static final VertexFormatElement NORMAL_4F = new VertexFormatElement(0, VertexFormatElement.EnumType.FLOAT, VertexFormatElement.EnumUsage.NORMAL, 4); 9 | private static final VertexFormat BLOCK_WITH_NORMAL = withNormalUncached(DefaultVertexFormats.BLOCK); 10 | 11 | public static VertexFormat withNormal(VertexFormat format) { 12 | if (format == DefaultVertexFormats.BLOCK) return BLOCK_WITH_NORMAL; 13 | return withNormalUncached(format); 14 | } 15 | 16 | private static VertexFormat withNormalUncached(VertexFormat format) { 17 | if (format == null || format.hasNormal()) return format; 18 | return new VertexFormat(format).addElement(NORMAL_4F); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/hooks/accessors/IVertexLighterFlat.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.hooks.accessors; 2 | 3 | import net.minecraftforge.client.model.pipeline.BlockInfo; 4 | 5 | @SuppressWarnings("unused") 6 | public interface IVertexLighterFlat { 7 | BlockInfo getBlockInfo(); 8 | 9 | void resetBlockInfo(); 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/BlockAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraft.block.Block; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(Block.class) 8 | public interface BlockAccessor { 9 | //#if MC==10809 10 | @Accessor 11 | void setMaxY(double maxY); 12 | //#endif 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/EntityArrowAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraft.entity.projectile.EntityArrow; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(EntityArrow.class) 8 | public interface EntityArrowAccessor { 9 | @Accessor 10 | boolean getInGround(); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/EventBusAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.EventBus; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(EventBus.class) 8 | public interface EventBusAccessor { 9 | @Accessor(remap = false) 10 | int getBusID(); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/GlStateManagerAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraft.client.renderer.GlStateManager; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(GlStateManager.class) 8 | public interface GlStateManagerAccessor { 9 | @Accessor 10 | static GlStateManager.Color getColorState() { 11 | throw new UnsupportedOperationException("Mixin failed to inject!"); 12 | } 13 | 14 | @Accessor 15 | static GlStateManager.TextureState[] getTextureState() { 16 | throw new UnsupportedOperationException("Mixin failed to inject!"); 17 | } 18 | 19 | @Accessor 20 | static int getActiveTextureUnit() { 21 | throw new UnsupportedOperationException("Mixin failed to inject!"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/GuiBossOverlayAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | //#if MC==11202 4 | //$$ import org.spongepowered.asm.mixin.gen.Accessor; 5 | //$$ import java.util.Map; 6 | //$$ import java.util.UUID; 7 | //$$ import net.minecraft.client.gui.GuiBossOverlay; 8 | //$$ import net.minecraft.client.gui.BossInfoClient; 9 | //#endif 10 | 11 | import org.spongepowered.asm.mixin.Mixin; 12 | 13 | //#if MC==10809 14 | import net.minecraft.client.Minecraft; 15 | @Mixin(Minecraft.class) // dummy so it doesn't complain in the mixin file 16 | //#else 17 | //$$ @Mixin(GuiBossOverlay.class) 18 | //#endif 19 | public interface GuiBossOverlayAccessor { 20 | //#if MC==11202 21 | //$$ @Accessor 22 | //$$ Map getMapBossInfos(); 23 | //#endif 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/GuiIngameAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraft.client.gui.GuiIngame; 4 | import net.minecraft.client.gui.ScaledResolution; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | import org.spongepowered.asm.mixin.gen.Invoker; 8 | 9 | @Mixin(GuiIngame.class) 10 | public interface GuiIngameAccessor { 11 | @Accessor 12 | String getDisplayedTitle(); 13 | 14 | @Accessor 15 | String getDisplayedSubTitle(); 16 | 17 | @Accessor 18 | void setDisplayedTitle(String title); 19 | 20 | @Accessor 21 | void setDisplayedSubTitle(String subTitle); 22 | 23 | //#if MC==10809 24 | @Invoker 25 | boolean invokeShowCrosshair(); 26 | //#endif 27 | 28 | @Invoker 29 | void invokeRenderVignette(float lightLevel, ScaledResolution scaledRes); 30 | 31 | @Invoker 32 | void invokeRenderPumpkinOverlay(ScaledResolution scaledRes); 33 | 34 | // render portal 35 | @Invoker 36 | void invokeRenderPortal(float timeInPortal, ScaledResolution scaledRes); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/GuiIngameForgeAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraft.client.gui.ScaledResolution; 4 | import net.minecraftforge.client.GuiIngameForge; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Invoker; 7 | 8 | @Mixin(GuiIngameForge.class) 9 | public interface GuiIngameForgeAccessor { 10 | @Invoker(remap = false) 11 | void callRenderCrosshairs( 12 | //#if MC==10809 13 | int width, int height 14 | //#else 15 | //$$ float partialTicks 16 | //#endif 17 | ); 18 | 19 | 20 | @Invoker(remap = false) 21 | void callRenderHelmet(ScaledResolution res, float partialTicks); 22 | 23 | @Invoker(remap = false) 24 | void callRenderPortal(ScaledResolution res, float partialTicks); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/GuiMainMenuAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraft.client.gui.GuiButton; 4 | import net.minecraft.client.gui.GuiMainMenu; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(GuiMainMenu.class) 9 | public interface GuiMainMenuAccessor { 10 | @Accessor 11 | GuiButton getRealmsButton(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/GuiMultiplayerAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraft.client.gui.GuiMultiplayer; 4 | import net.minecraft.client.gui.GuiScreen; 5 | import net.minecraft.client.multiplayer.ServerData; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Accessor; 8 | 9 | @Mixin(GuiMultiplayer.class) 10 | public interface GuiMultiplayerAccessor { 11 | @Accessor 12 | void setParentScreen(GuiScreen screen); 13 | 14 | @Accessor 15 | void setDirectConnect(boolean b); 16 | 17 | @Accessor 18 | void setSelectedServer(ServerData data); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/GuiNewChatAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraft.client.gui.ChatLine; 4 | import net.minecraft.client.gui.GuiNewChat; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | import java.util.List; 9 | 10 | @Mixin(GuiNewChat.class) 11 | public interface GuiNewChatAccessor { 12 | @Accessor 13 | List getChatLines(); 14 | 15 | @Accessor 16 | List getDrawnChatLines(); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/GuiSelectWorldAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraft.client.gui.GuiScreen; 4 | import net.minecraft.client.gui.GuiSelectWorld; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(GuiSelectWorld.class) 9 | public interface GuiSelectWorldAccessor { 10 | @Accessor 11 | //#if MC==10809 12 | GuiScreen getParentScreen(); 13 | //#else 14 | //$$ GuiScreen getPrevScreen(); 15 | //#endif 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/ItemAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraft.item.Item; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | import java.util.UUID; 8 | 9 | @Mixin(Item.class) 10 | public interface ItemAccessor { 11 | @Accessor 12 | static UUID getItemModifierUUID() { 13 | throw new UnsupportedOperationException("Mixin failed to inject!"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/ItemRendererAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraft.client.renderer.ItemRenderer; 4 | import net.minecraft.item.ItemStack; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(ItemRenderer.class) 9 | public interface ItemRendererAccessor { 10 | //#if MC==10809 11 | @Accessor 12 | ItemStack getItemToRender(); 13 | //#endif 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/ItemStackAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(ItemStack.class) 8 | public interface ItemStackAccessor { 9 | @Accessor 10 | int getStackSize(); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/KeyBindingAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraft.client.settings.KeyBinding; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | import java.util.List; 8 | 9 | @Mixin(KeyBinding.class) 10 | public interface KeyBindingAccessor { 11 | //#if MC==10809 12 | @Accessor 13 | static List getKeybindArray() { 14 | throw new UnsupportedOperationException("Mixin failed to inject!"); 15 | } 16 | //#endif 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/MinecraftAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import org.spongepowered.asm.mixin.gen.Invoker; 7 | 8 | @Mixin(Minecraft.class) 9 | public interface MinecraftAccessor { 10 | @Accessor("fullscreen") 11 | void setFullScreen(boolean b); 12 | 13 | @Accessor 14 | int getTempDisplayWidth(); 15 | 16 | @Accessor 17 | int getTempDisplayHeight(); 18 | 19 | @Invoker 20 | void invokeUpdateFramebufferSize(); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/MinecraftForgeClientAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | //#if MC==10809 4 | import com.google.common.cache.LoadingCache; 5 | import net.minecraft.client.renderer.RegionRenderCache; 6 | import net.minecraft.util.BlockPos; 7 | import net.minecraft.world.World; 8 | import org.apache.commons.lang3.tuple.Pair; 9 | import org.spongepowered.asm.mixin.gen.Accessor; 10 | //#endif 11 | import net.minecraftforge.client.MinecraftForgeClient; 12 | import org.spongepowered.asm.mixin.Mixin; 13 | 14 | @Mixin(MinecraftForgeClient.class) 15 | public interface MinecraftForgeClientAccessor { 16 | //#if MC==10809 17 | @SuppressWarnings("UnstableApiUsage") 18 | @Accessor(remap = false) 19 | static LoadingCache, RegionRenderCache> getRegionCache() { 20 | throw new AssertionError(); 21 | } 22 | //#endif 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/PositionedSoundAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraft.client.audio.PositionedSound; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(PositionedSound.class) 8 | public interface PositionedSoundAccessor { 9 | @Accessor("volume") 10 | float getVolumeField(); 11 | 12 | @Accessor 13 | void setVolume(float volume); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/RegistrySimpleAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraft.util.RegistrySimple; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | import java.util.Map; 8 | 9 | @Mixin(RegistrySimple.class) 10 | public interface RegistrySimpleAccessor { 11 | @Accessor("registryObjects") 12 | Map getRegistryObjects(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/RenderManagerAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraft.client.renderer.entity.RenderManager; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(RenderManager.class) 8 | public interface RenderManagerAccessor { 9 | @Accessor 10 | double getRenderPosX(); 11 | 12 | @Accessor 13 | double getRenderPosY(); 14 | 15 | @Accessor 16 | double getRenderPosZ(); 17 | 18 | @Accessor 19 | boolean isRenderOutlines(); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/ResourcePackRepositoryAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraft.client.resources.ResourcePackRepository; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import org.spongepowered.asm.mixin.gen.Invoker; 7 | 8 | import java.io.File; 9 | import java.util.List; 10 | 11 | @Mixin(ResourcePackRepository.class) 12 | public interface ResourcePackRepositoryAccessor { 13 | @Invoker 14 | List invokeGetResourcePackFiles(); 15 | 16 | @Accessor 17 | void setRepositoryEntriesAll(List entries); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/SoundHandlerAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraft.client.audio.SoundHandler; 4 | import net.minecraft.client.audio.SoundManager; 5 | import net.minecraft.client.audio.SoundRegistry; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Accessor; 8 | 9 | @Mixin(SoundHandler.class) 10 | public interface SoundHandlerAccessor { 11 | @Accessor 12 | SoundRegistry getSndRegistry(); 13 | 14 | @Accessor 15 | SoundManager getSndManager(); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/SoundManagerAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraft.client.audio.SoundCategory; 4 | import net.minecraft.client.audio.SoundManager; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Invoker; 7 | 8 | @Mixin(SoundManager.class) 9 | public interface SoundManagerAccessor { 10 | @Invoker 11 | //#if MC < 11200 12 | float invokeGetSoundCategoryVolume(SoundCategory category); 13 | //#else 14 | //$$ float invokeGetVolume(SoundCategory category); 15 | //#endif 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/SoundRegistryAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraft.client.audio.SoundEventAccessorComposite; 4 | import net.minecraft.client.audio.SoundRegistry; 5 | import net.minecraft.util.ResourceLocation; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Accessor; 8 | 9 | import java.util.Map; 10 | 11 | @Mixin(SoundRegistry.class) 12 | public interface SoundRegistryAccessor { 13 | @Accessor 14 | Map getSoundRegistry(); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/WorldRendererAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors; 2 | 3 | import net.minecraft.client.renderer.WorldRenderer; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(WorldRenderer.class) 8 | public interface WorldRendererAccessor { 9 | @Accessor("isDrawing") 10 | boolean isDrawing(); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/optifine/ConfigAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors.optifine; 2 | 3 | import org.spongepowered.asm.mixin.Dynamic; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.Pseudo; 6 | import org.spongepowered.asm.mixin.gen.Invoker; 7 | 8 | @Pseudo 9 | @Mixin(targets = "Config") 10 | public interface ConfigAccessor { 11 | @Dynamic("OptiFine") 12 | @Invoker(remap = false) 13 | static boolean invokeIsCustomColors() { 14 | throw new AssertionError("Mixin did not inject"); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/accessors/optifine/CustomColorsAccessor.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.accessors.optifine; 2 | 3 | import org.spongepowered.asm.mixin.Dynamic; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.Pseudo; 6 | import org.spongepowered.asm.mixin.gen.Invoker; 7 | 8 | @Pseudo 9 | @Mixin(targets = "net.optifine.CustomColors") 10 | public interface CustomColorsAccessor { 11 | @Dynamic("OptiFine") 12 | @Invoker(remap = false) 13 | public static int invokeGetTextColor(int index, int color) { 14 | throw new AssertionError("Mixin failed to inject into OptiFine"); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/BlockFluidRendererMixin_FixStitching.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.renderer.BlockFluidRenderer; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.Constant; 6 | import org.spongepowered.asm.mixin.injection.ModifyConstant; 7 | 8 | @Mixin(BlockFluidRenderer.class) 9 | public class BlockFluidRendererMixin_FixStitching { 10 | @ModifyConstant(method = "renderFluid", constant = @Constant(floatValue = 0.001F)) 11 | private float patcher$fixFluidStitching(float original) { 12 | return 0.0F; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/EntityLivingBaseMixin_MouseDelayFix.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.entity.EntityPlayerSP; 4 | import net.minecraft.entity.Entity; 5 | import net.minecraft.entity.EntityLivingBase; 6 | import net.minecraft.util.Vec3; 7 | import net.minecraft.world.World; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 12 | 13 | @Mixin(EntityLivingBase.class) 14 | public abstract class EntityLivingBaseMixin_MouseDelayFix extends Entity { 15 | public EntityLivingBaseMixin_MouseDelayFix(World worldIn) { 16 | super(worldIn); 17 | } 18 | 19 | //#if MC==10809 20 | @SuppressWarnings("ConstantConditions") 21 | @Inject(method = "getLook", at = @At("HEAD"), cancellable = true) 22 | private void patcher$mouseDelayFix(float partialTicks, CallbackInfoReturnable cir) { 23 | if ((EntityLivingBase) (Object) this instanceof EntityPlayerSP) { 24 | cir.setReturnValue(super.getLook(partialTicks)); 25 | } 26 | } 27 | //#endif 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/EntityMixin_FixedBrightness.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.entity.Entity; 4 | import net.minecraft.util.BlockPos; 5 | import net.minecraft.world.World; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Redirect; 9 | 10 | @Mixin(Entity.class) 11 | public abstract class EntityMixin_FixedBrightness { 12 | //#if MC==10809 13 | @Redirect(method = "getBrightnessForRender", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;isBlockLoaded(Lnet/minecraft/util/BlockPos;)Z")) 14 | public boolean patcher$alwaysReturnTrue(World world, BlockPos pos) { 15 | return true; 16 | } 17 | //#endif 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/EntityMixin_SprintParticles.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.entity.Entity; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.Shadow; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(Entity.class) 11 | public class EntityMixin_SprintParticles { 12 | 13 | @Shadow public boolean onGround; 14 | 15 | @Inject(method = "spawnRunningParticles", at = @At("HEAD"), cancellable = true) 16 | private void patcher$checkGroundState(CallbackInfo ci) { 17 | if (!this.onGround) ci.cancel(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/EntityRendererMixin_AdjustEyeHeightLighting.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.renderer.EntityRenderer; 5 | import net.minecraft.util.BlockPos; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Shadow; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.ModifyArg; 10 | 11 | @Mixin(EntityRenderer.class) 12 | public class EntityRendererMixin_AdjustEyeHeightLighting { 13 | 14 | //#if MC==10809 15 | @Shadow 16 | private Minecraft mc; 17 | 18 | @ModifyArg(method = "updateRenderer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/multiplayer/WorldClient;getLightBrightness(Lnet/minecraft/util/BlockPos;)F")) 19 | private BlockPos patcher$accountForEyes(BlockPos par1) { 20 | return new BlockPos(mc.getRenderViewEntity().getPositionEyes(1.0F)); 21 | } 22 | //#endif 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/EntityRendererMixin_SpectatorShader.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.renderer.EntityRenderer; 5 | import net.minecraft.util.ResourceLocation; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Shadow; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Redirect; 10 | 11 | @Mixin(EntityRenderer.class) 12 | public abstract class EntityRendererMixin_SpectatorShader { 13 | @Shadow 14 | private Minecraft mc; 15 | 16 | @Shadow 17 | public abstract void loadShader(ResourceLocation resourceLocationIn); 18 | 19 | @Redirect( 20 | method = "loadEntityShader", 21 | at = @At( 22 | value = "INVOKE", 23 | target = "Lnet/minecraft/client/renderer/EntityRenderer;loadShader(Lnet/minecraft/util/ResourceLocation;)V" 24 | ) 25 | ) 26 | public void patcher$fixSpectatorShader(EntityRenderer entityRenderer, ResourceLocation resourceLocationIn) { 27 | if (mc.gameSettings.thirdPersonView == 0) loadShader(resourceLocationIn); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/EntityXPOrbMixin_AdjustHeight.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.entity.item.EntityXPOrb; 4 | import net.minecraft.entity.player.EntityPlayer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Redirect; 8 | 9 | @Mixin(EntityXPOrb.class) 10 | public class EntityXPOrbMixin_AdjustHeight { 11 | //#if MC==10809 12 | @Redirect(method = "onUpdate", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/EntityPlayer;getEyeHeight()F")) 13 | private float patcher$lowerHeight(EntityPlayer entityPlayer) { 14 | return (float) (entityPlayer.getEyeHeight() / 2.0D); 15 | } 16 | //#endif 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/FontRendererMixin_ResetStyles.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.gui.FontRenderer; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.Shadow; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 9 | 10 | @Mixin(FontRenderer.class) 11 | public abstract class FontRendererMixin_ResetStyles { 12 | 13 | @Shadow protected abstract void resetStyles(); 14 | 15 | @Inject(method = "drawString(Ljava/lang/String;FFIZ)I", 16 | at = @At( 17 | value = "INVOKE", target = "Lnet/minecraft/client/gui/FontRenderer;renderString(Ljava/lang/String;FFIZ)I", 18 | ordinal = 0, shift = At.Shift.AFTER 19 | ) 20 | ) 21 | private void patcher$resetStyle(CallbackInfoReturnable ci) { 22 | this.resetStyles(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/GuiContainerMixin_SplitRemnants.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.gui.GuiScreen; 4 | import net.minecraft.client.gui.inventory.GuiContainer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.Shadow; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(GuiContainer.class) 12 | public abstract class GuiContainerMixin_SplitRemnants extends GuiScreen { 13 | 14 | //#if MC==10809 15 | @Shadow private int dragSplittingButton; 16 | @Shadow private int dragSplittingRemnant; 17 | 18 | @Inject(method = "updateDragSplitting", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;copy()Lnet/minecraft/item/ItemStack;"), cancellable = true) 19 | private void patcher$fixRemnants(CallbackInfo ci) { 20 | if (this.dragSplittingButton == 2) { 21 | this.dragSplittingRemnant = mc.thePlayer.inventory.getItemStack().getMaxStackSize(); 22 | ci.cancel(); 23 | } 24 | } 25 | //#endif 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/GuiGameOverMixin_ResolveButtonClick.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.gui.GuiGameOver; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.Shadow; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(GuiGameOver.class) 11 | public class GuiGameOverMixin_ResolveButtonClick { 12 | //#if MC==10809 13 | @Shadow private int enableButtonsTimer; 14 | 15 | @Inject(method = "initGui", at = @At("HEAD")) 16 | private void patcher$allowClickable(CallbackInfo ci) { 17 | this.enableButtonsTimer = 0; 18 | } 19 | //#endif 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/GuiIngameForgeMixin_HotbarAlpha.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.renderer.GlStateManager; 4 | import net.minecraftforge.client.GuiIngameForge; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(GuiIngameForge.class) 11 | public class GuiIngameForgeMixin_HotbarAlpha { 12 | @Inject(method = "renderExperience", at = @At("HEAD"), remap = false) 13 | private void patcher$enableExperienceAlpha(int filled, int top, CallbackInfo ci) { 14 | GlStateManager.enableAlpha(); 15 | } 16 | 17 | @Inject(method = "renderExperience", at = @At("RETURN"), remap = false) 18 | private void patcher$disableExperienceAlpha(int filled, int top, CallbackInfo ci) { 19 | GlStateManager.disableAlpha(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/GuiIngameMixin_RemoveSpectatorPumpkinOverlay.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.gui.GuiIngame; 5 | import net.minecraft.client.gui.ScaledResolution; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(GuiIngame.class) 12 | public class GuiIngameMixin_RemoveSpectatorPumpkinOverlay { 13 | @Inject(method = "renderPumpkinOverlay", at = @At("HEAD"), cancellable = true) 14 | private void patcher$removeSpectatorPumpkinOverlay(ScaledResolution scaledRes, CallbackInfo ci) { 15 | if (Minecraft.getMinecraft().thePlayer.isSpectator()) ci.cancel(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/GuiIngameMixin_ScoreboardTextTransparency.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.gui.GuiIngame; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.Constant; 6 | import org.spongepowered.asm.mixin.injection.ModifyConstant; 7 | 8 | @Mixin(GuiIngame.class) 9 | public class GuiIngameMixin_ScoreboardTextTransparency { 10 | @ModifyConstant(method = "renderScoreboard", constant = @Constant(intValue = 553648127)) 11 | private int patcher$fixTextBlending(int original) { 12 | return -1; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/GuiLanguageMixin_ResetUnicodeFont.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.gui.GuiLanguage; 4 | import net.minecraft.client.gui.GuiScreen; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | 7 | @Mixin(GuiLanguage.class) 8 | public class GuiLanguageMixin_ResetUnicodeFont extends GuiScreen { 9 | 10 | @Override 11 | public void onGuiClosed() { 12 | mc.ingameGUI.getChatGUI().refreshChat(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/GuiNewChatMixin_NullChatLineFix.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.gui.ChatLine; 4 | import net.minecraft.client.gui.GuiNewChat; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Redirect; 8 | 9 | @Mixin(GuiNewChat.class) 10 | public class GuiNewChatMixin_NullChatLineFix { 11 | @Redirect(method = "deleteChatLine", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/ChatLine;getChatLineID()I")) 12 | private int patcher$checkIfChatLineIsNull(ChatLine instance) { 13 | if (instance == null) return -1; 14 | return instance.getChatLineID(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/GuiNewChat_RemoveChatLimit.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.gui.GuiNewChat; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.Constant; 7 | import org.spongepowered.asm.mixin.injection.ModifyConstant; 8 | 9 | @Mixin(GuiNewChat.class) 10 | public class GuiNewChat_RemoveChatLimit { 11 | @ModifyConstant(method = "setChatLine", constant = @Constant(intValue = 100)) 12 | private int patcher$removeChatLimit(int original) { 13 | if (PatcherConfig.removeChatMessageLimit) return Integer.MAX_VALUE; 14 | return original; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/GuiOptionsMixin_SaveSettings.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.gui.GuiOptions; 4 | import net.minecraft.client.gui.GuiScreen; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | 7 | @Mixin(GuiOptions.class) 8 | public class GuiOptionsMixin_SaveSettings extends GuiScreen { 9 | @Override 10 | public void onGuiClosed() { 11 | mc.gameSettings.saveOptions(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/GuiScreenAddServerMixin_RemoveSpaces.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.gui.GuiScreenAddServer; 4 | import net.minecraft.client.gui.GuiTextField; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Redirect; 8 | 9 | @Mixin(GuiScreenAddServer.class) 10 | public class GuiScreenAddServerMixin_RemoveSpaces { 11 | @Redirect(method = "actionPerformed", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiTextField;getText()Ljava/lang/String;")) 12 | private String patcher$removeSpaces(GuiTextField guiTextField) { 13 | return guiTextField.getText().trim(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/GuiScreenBookMixin_AddBackground.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.gui.GuiScreen; 5 | import net.minecraft.client.gui.GuiScreenBook; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(GuiScreenBook.class) 12 | public class GuiScreenBookMixin_AddBackground extends GuiScreen { 13 | @Inject(method = "drawScreen", at = @At("HEAD")) 14 | private void patcher$addBackground(int mouseX, int mouseY, float partialTicks, CallbackInfo ci) { 15 | if (PatcherConfig.bookBackground) this.drawWorldBackground(1); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/GuiScreenBookMixin_ResolveRenderLayer.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.gui.GuiScreen; 4 | import net.minecraft.client.gui.GuiScreenBook; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(GuiScreenBook.class) 11 | public abstract class GuiScreenBookMixin_ResolveRenderLayer extends GuiScreen { 12 | 13 | @Inject(method = "drawScreen", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiScreenBook;handleComponentHover(Lnet/minecraft/util/IChatComponent;II)V")) 14 | private void patcher$callSuper(int mouseX, int mouseY, float partialTicks, CallbackInfo ci) { 15 | super.drawScreen(mouseX, mouseY, partialTicks); 16 | } 17 | 18 | @Inject(method = "drawScreen", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiScreenBook;handleComponentHover(Lnet/minecraft/util/IChatComponent;II)V", shift = At.Shift.AFTER), cancellable = true) 19 | private void patcher$cancelFurtherRendering(int mouseX, int mouseY, float partialTicks, CallbackInfo ci) { 20 | ci.cancel(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/GuiScreenMixin_FixWindowsIME.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.gui.GuiScreen; 4 | import org.lwjgl.input.Keyboard; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Redirect; 8 | 9 | @Mixin(GuiScreen.class) 10 | public class GuiScreenMixin_FixWindowsIME { 11 | //#if MC==10809 12 | @Redirect(method = "handleKeyboardInput", at = @At(value = "INVOKE", target = "Lorg/lwjgl/input/Keyboard;getEventKeyState()Z", remap = false)) 13 | private boolean patcher$checkCharacter() { 14 | return Keyboard.getEventKey() == 0 && Keyboard.getEventCharacter() >= ' ' || Keyboard.getEventKeyState(); 15 | } 16 | //#endif 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/GuiScreenResourcePacksMixin_ChangeTextPosition.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.gui.GuiScreenResourcePacks; 4 | import net.minecraftforge.fml.common.Loader; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.Constant; 7 | import org.spongepowered.asm.mixin.injection.ModifyConstant; 8 | 9 | @Mixin(GuiScreenResourcePacks.class) 10 | public class GuiScreenResourcePacksMixin_ChangeTextPosition { 11 | @ModifyConstant(method = "drawScreen", constant = @Constant(intValue = 77)) 12 | private int patcher$moveInformationText(int original) { 13 | return !Loader.isModLoaded("ResourcePackOrganizer") ? 102 : original; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/GuiScreenResourcePacksMixin_FixOpenPackFolder.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import cc.polyfrost.oneconfig.libs.universal.UDesktop; 4 | import net.minecraft.client.Minecraft; 5 | import net.minecraft.client.gui.GuiScreenResourcePacks; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(GuiScreenResourcePacks.class) 12 | public class GuiScreenResourcePacksMixin_FixOpenPackFolder { 13 | 14 | @Inject( 15 | method = "actionPerformed", 16 | at = 17 | @At( 18 | value = "INVOKE", 19 | target = "Lnet/minecraft/client/resources/ResourcePackRepository;getDirResourcepacks()Ljava/io/File;", 20 | shift = At.Shift.AFTER 21 | ), 22 | cancellable = true 23 | ) 24 | private void patcher$fixFolderOpening(CallbackInfo ci) { 25 | if (UDesktop.open(Minecraft.getMinecraft().getResourcePackRepository().getDirResourcepacks())) { 26 | ci.cancel(); 27 | } 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/GuiScreenServerListMixin_RemoveSpaces.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.gui.GuiScreenServerList; 4 | import net.minecraft.client.gui.GuiTextField; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Redirect; 8 | 9 | @Mixin(GuiScreenServerList.class) 10 | public class GuiScreenServerListMixin_RemoveSpaces { 11 | @Redirect(method = "actionPerformed", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiTextField;getText()Ljava/lang/String;")) 12 | private String patcher$removeSpaces(GuiTextField guiTextField) { 13 | return guiTextField.getText().trim(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/GuiVideoSettingsMixin_MipmapSlider.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import club.sk1er.patcher.ducks.GameSettingsExt; 4 | import net.minecraft.client.gui.GuiScreen; 5 | import net.minecraft.client.gui.GuiVideoSettings; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | 8 | @Mixin(GuiVideoSettings.class) 9 | public abstract class GuiVideoSettingsMixin_MipmapSlider extends GuiScreen { 10 | //#if MC==10809 11 | @Override 12 | public void onGuiClosed() { 13 | super.onGuiClosed(); 14 | ((GameSettingsExt) mc.gameSettings).patcher$onSettingsGuiClosed(); 15 | } 16 | //#endif 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/LayerArrowMixin_FixedBrightness.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.renderer.entity.layers.LayerArrow; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Redirect; 7 | 8 | @Mixin(LayerArrow.class) 9 | public class LayerArrowMixin_FixedBrightness { 10 | 11 | @Redirect(method = "doRenderLayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/RenderHelper;disableStandardItemLighting()V")) 12 | private void patcher$removeDisable() { 13 | // no-op 14 | } 15 | 16 | @Redirect(method = "doRenderLayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/RenderHelper;enableStandardItemLighting()V")) 17 | private void patcher$removeEnable() { 18 | // no-op 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/LayerCreeperChargeMixin_FixDepth.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.renderer.entity.layers.LayerCreeperCharge; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.ModifyArg; 7 | import org.spongepowered.asm.mixin.injection.Slice; 8 | 9 | @Mixin(LayerCreeperCharge.class) 10 | public class LayerCreeperChargeMixin_FixDepth { 11 | @ModifyArg( 12 | method = "doRenderLayer(Lnet/minecraft/entity/monster/EntityCreeper;FFFFFFF)V", 13 | slice = @Slice( 14 | from = @At( 15 | value = "INVOKE", 16 | target = "Lnet/minecraft/client/model/ModelCreeper;render(Lnet/minecraft/entity/Entity;FFFFFF)V" 17 | ) 18 | ), 19 | at = @At( 20 | value = "INVOKE", 21 | target = "Lnet/minecraft/client/renderer/GlStateManager;depthMask(Z)V" 22 | ) 23 | ) 24 | private boolean patcher$fixDepth(boolean original) { 25 | return true; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/LayerSpiderEyesMixin_FixDepth.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.renderer.GlStateManager; 4 | import net.minecraft.client.renderer.entity.layers.LayerSpiderEyes; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(LayerSpiderEyes.class) 11 | public class LayerSpiderEyesMixin_FixDepth { 12 | @Inject(method = "doRenderLayer(Lnet/minecraft/entity/monster/EntitySpider;FFFFFFF)V", at = @At("TAIL")) 13 | private void patcher$fixDepth(CallbackInfo ci) { 14 | GlStateManager.depthMask(true); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/LayerWitherAuraMixin_FixDepth.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.renderer.GlStateManager; 4 | import net.minecraft.client.renderer.entity.layers.LayerWitherAura; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(LayerWitherAura.class) 11 | public class LayerWitherAuraMixin_FixDepth { 12 | @Inject(method = "doRenderLayer(Lnet/minecraft/entity/boss/EntityWither;FFFFFFF)V", at = @At("TAIL")) 13 | private void patcher$fixDepth(CallbackInfo ci) { 14 | GlStateManager.depthMask(true); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/MinecraftMixin_DisplayScreen.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.gui.GuiScreen; 5 | import net.minecraft.client.gui.GuiScreenWorking; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.ModifyArg; 9 | 10 | @Mixin(Minecraft.class) 11 | public class MinecraftMixin_DisplayScreen { 12 | //#if MC==10809 13 | @ModifyArg(method = "launchIntegratedServer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;displayGuiScreen(Lnet/minecraft/client/gui/GuiScreen;)V", ordinal = 1)) 14 | private GuiScreen patcher$displayWorkingScreen(GuiScreen original) { 15 | return new GuiScreenWorking(); 16 | } 17 | //#endif 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/MinecraftMixin_FixScreenState.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import org.apache.commons.lang3.SystemUtils; 5 | import org.lwjgl.opengl.Display; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Shadow; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | 12 | @Mixin(Minecraft.class) 13 | public class MinecraftMixin_FixScreenState { 14 | 15 | //#if MC==10809 16 | @Shadow 17 | private boolean fullscreen; 18 | 19 | @Inject(method = "toggleFullscreen", at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/Display;setFullscreen(Z)V", remap = false)) 20 | private void patcher$resolveScreenState(CallbackInfo ci) { 21 | if (!this.fullscreen && SystemUtils.IS_OS_WINDOWS) { 22 | Display.setResizable(false); 23 | Display.setResizable(true); 24 | } 25 | } 26 | //#endif 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/MinecraftMixin_ForeignKeyboards.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import org.lwjgl.input.Keyboard; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Redirect; 8 | 9 | @Mixin(Minecraft.class) 10 | public class MinecraftMixin_ForeignKeyboards { 11 | //#if MC==10809 12 | @Redirect(method = "dispatchKeypresses", at = @At(value = "INVOKE", target = "Lorg/lwjgl/input/Keyboard;getEventCharacter()C", remap = false)) 13 | private char patcher$resolveForeignKeyboards() { 14 | return (char) (Keyboard.getEventCharacter() + 256); 15 | } 16 | //#endif 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/MinecraftMixin_PersistentShaders.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.Minecraft; 5 | import net.minecraft.client.renderer.EntityRenderer; 6 | import net.minecraft.entity.Entity; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Redirect; 10 | 11 | @Mixin(Minecraft.class) 12 | public class MinecraftMixin_PersistentShaders { 13 | @Redirect( 14 | //#if MC==10809 15 | method = "runTick", 16 | //#else 17 | //$$ method = "processKeyBinds", 18 | //#endif 19 | at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/EntityRenderer;loadEntityShader(Lnet/minecraft/entity/Entity;)V") 20 | ) 21 | private void patcher$keepShadersOnPerspectiveChange(EntityRenderer entityRenderer, Entity entityIn) { 22 | if (!PatcherConfig.keepShadersOnPerspectiveChange) { 23 | entityRenderer.loadEntityShader(entityIn); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/RenderPlayerMixin_ArmPosition.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.model.ModelPlayer; 4 | import net.minecraft.client.renderer.entity.RenderPlayer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.Redirect; 9 | 10 | @Mixin(RenderPlayer.class) 11 | public class RenderPlayerMixin_ArmPosition { 12 | @Redirect(method = "renderRightArm", at = @At(value = "FIELD", target = "Lnet/minecraft/client/model/ModelPlayer;isSneak:Z", ordinal = 0)) 13 | private void patcher$resetArmState(ModelPlayer modelPlayer, boolean value) { 14 | modelPlayer.isRiding = modelPlayer.isSneak = false; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/SoundManagerMixin_LogSpam.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.audio.SoundManager; 4 | import org.apache.logging.log4j.Logger; 5 | import org.apache.logging.log4j.Marker; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Redirect; 9 | import org.spongepowered.asm.mixin.injection.Slice; 10 | 11 | @Mixin(SoundManager.class) 12 | public class SoundManagerMixin_LogSpam { 13 | @Redirect( 14 | method = "playSound", 15 | slice = @Slice(from = @At(value = "CONSTANT", args = "stringValue=Unable to play unknown soundEvent: {}", ordinal = 0)), 16 | at = @At(value = "INVOKE", target = "Lorg/apache/logging/log4j/Logger;warn(Lorg/apache/logging/log4j/Marker;Ljava/lang/String;[Ljava/lang/Object;)V", ordinal = 0, remap = false) 17 | ) 18 | private void patcher$silenceWarning(Logger instance, Marker marker, String s, Object[] objects) { 19 | // No-op 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/TileEntityBannerRendererMixin_BannerAnimation.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.renderer.tileentity.TileEntityBannerRenderer; 4 | import net.minecraft.world.World; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Redirect; 8 | 9 | @Mixin(TileEntityBannerRenderer.class) 10 | public class TileEntityBannerRendererMixin_BannerAnimation { 11 | 12 | private final String patcher$renderTileEntityAtDesc = 13 | //#if MC==10809 14 | "renderTileEntityAt(Lnet/minecraft/tileentity/TileEntityBanner;DDDFI)V"; 15 | //#else 16 | //$$ "render(Lnet/minecraft/tileentity/TileEntityBanner;DDDFIF)V"; 17 | //#endif 18 | 19 | @Redirect(method = patcher$renderTileEntityAtDesc, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;getTotalWorldTime()J")) 20 | private long patcher$resolveOverflow(World world) { 21 | return world.getTotalWorldTime() % 100L; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/TileEntityRendererDispatcherMixin_EnableLighting.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.renderer.RenderHelper; 4 | import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(TileEntityRendererDispatcher.class) 11 | public class TileEntityRendererDispatcherMixin_EnableLighting { 12 | //#if MC==10809 13 | @Inject(method = "renderTileEntity", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;getCombinedLight(Lnet/minecraft/util/BlockPos;I)I")) 14 | private void patcher$enableLighting(CallbackInfo ci) { 15 | RenderHelper.enableStandardItemLighting(); 16 | } 17 | //#endif 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/TileEntitySkullRendererMixin_EnableBlending.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.renderer.GlStateManager; 4 | import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer; 5 | import org.lwjgl.opengl.GL11; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(TileEntitySkullRenderer.class) 12 | public class TileEntitySkullRendererMixin_EnableBlending { 13 | 14 | //#if MC==10809 15 | @Inject(method = "renderSkull", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelBase;render(Lnet/minecraft/entity/Entity;FFFFFF)V")) 16 | private void patcher$enableBlending(CallbackInfo ci) { 17 | GlStateManager.enableBlend(); 18 | GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); 19 | } 20 | //#endif 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/UtilMixin_StopLogSpam.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.util.Util; 4 | import org.apache.logging.log4j.Logger; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 9 | 10 | import java.util.concurrent.FutureTask; 11 | 12 | @Mixin(Util.class) 13 | public class UtilMixin_StopLogSpam { 14 | 15 | @Inject(method = "runTask", at = @At(value = "INVOKE", target = "Lorg/apache/logging/log4j/Logger;fatal(Ljava/lang/String;Ljava/lang/Throwable;)V", remap = false), cancellable = true, remap = true) 16 | private static void patcher$stopLogSpam(FutureTask task, Logger logger, CallbackInfoReturnable cir) { 17 | cir.setReturnValue(null); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/VertexBufferMixin_ResolveLockups.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.client.renderer.vertex.VertexBuffer; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.Shadow; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | import java.nio.ByteBuffer; 11 | 12 | @Mixin(VertexBuffer.class) 13 | public abstract class VertexBufferMixin_ResolveLockups { 14 | @Shadow private int glBufferId; 15 | 16 | // inject at INVOKE rather than HEAD as OptiFine changes this method for its Render Regions option 17 | @Inject(method = "bufferData", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/vertex/VertexBuffer;bindBuffer()V"), cancellable = true) 18 | private void patcher$ignoreRemovedBuffers(ByteBuffer byteBuffer, CallbackInfo ci) { 19 | if (this.glBufferId == -1) { 20 | ci.cancel(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/WorldMixin_SkyHeight.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes; 2 | 3 | import net.minecraft.world.World; 4 | import net.minecraft.world.WorldProvider; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Redirect; 8 | 9 | @Mixin(World.class) 10 | public class WorldMixin_SkyHeight { 11 | @Redirect(method = "getHorizon", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/WorldProvider;getHorizon()D", remap = false)) 12 | private double patcher$alwaysZero(WorldProvider worldProvider) { 13 | return 0.0D; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/crashes/GameSettingsMixin_ResolveCrash.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes.crashes; 2 | 3 | import net.minecraft.client.settings.GameSettings; 4 | import net.minecraft.client.settings.KeyBinding; 5 | import org.lwjgl.input.Keyboard; 6 | import org.lwjgl.input.Mouse; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.Overwrite; 9 | 10 | @Mixin(GameSettings.class) 11 | public class GameSettingsMixin_ResolveCrash { 12 | 13 | //#if MC==10809 14 | /** 15 | * @author asbyth 16 | * @reason Resolve Chat Key bound to a unicode char causing crashes while creative inventory is opened (MC-102867) 17 | */ 18 | @Overwrite 19 | public static boolean isKeyDown(KeyBinding key) { 20 | int keyCode = key.getKeyCode(); 21 | if (keyCode != 0 && keyCode < 256) { 22 | return keyCode < 0 ? Mouse.isButtonDown(keyCode + 100) : Keyboard.isKeyDown(keyCode); 23 | } else { 24 | return false; 25 | } 26 | } 27 | //#endif 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/crashes/GuiScreenMixin_ResolveCrash.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes.crashes; 2 | 3 | import club.sk1er.patcher.screen.ResolutionHelper; 4 | import net.minecraft.client.Minecraft; 5 | import net.minecraft.client.gui.GuiScreen; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Shadow; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | 12 | @Mixin(GuiScreen.class) 13 | public class GuiScreenMixin_ResolveCrash { 14 | 15 | @Shadow public Minecraft mc; 16 | 17 | @SuppressWarnings({"ConstantConditions", "RedundantCast"}) 18 | @Inject(method = "handleInput", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiScreen;handleKeyboardInput()V"), cancellable = true) 19 | private void patcher$checkScreen(CallbackInfo ci) { 20 | if ((GuiScreen) (Object) this != this.mc.currentScreen) { 21 | ResolutionHelper.setScaleOverride(-1); 22 | ci.cancel(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/crashes/NBTTagCompoundMixin_FailFast.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes.crashes; 2 | 3 | import net.minecraft.nbt.NBTBase; 4 | import net.minecraft.nbt.NBTTagCompound; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(NBTTagCompound.class) 11 | public class NBTTagCompoundMixin_FailFast { 12 | 13 | @Inject(method = "setTag", at = @At("HEAD")) 14 | private void patcher$failFast(String key, NBTBase value, CallbackInfo ci) { 15 | if (value == null) throw new IllegalArgumentException("Invalid null NBT value with key " + key); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/crashes/ResourcePackRepositoryMixin_ResolveCrash.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes.crashes; 2 | 3 | import net.minecraft.client.resources.ResourcePackRepository; 4 | import org.spongepowered.asm.mixin.Final; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.Shadow; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | import java.io.File; 12 | 13 | @Mixin(ResourcePackRepository.class) 14 | public class ResourcePackRepositoryMixin_ResolveCrash { 15 | 16 | @Shadow @Final private File dirServerResourcepacks; 17 | 18 | @SuppressWarnings("ResultOfMethodCallIgnored") 19 | @Inject(method = "deleteOldServerResourcesPacks", at = @At("HEAD")) 20 | private void patcher$createDirectory(CallbackInfo ci) { 21 | if (!this.dirServerResourcepacks.exists()) { 22 | this.dirServerResourcepacks.mkdirs(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/crashes/ServerListEntryNormalMixin_ResolveCrash.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes.crashes; 2 | 3 | import club.sk1er.patcher.Patcher; 4 | import net.minecraft.client.gui.ServerListEntryNormal; 5 | import net.minecraft.client.multiplayer.ServerData; 6 | import org.spongepowered.asm.mixin.Final; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.Shadow; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Redirect; 11 | 12 | @Mixin(ServerListEntryNormal.class) 13 | public abstract class ServerListEntryNormalMixin_ResolveCrash { 14 | 15 | @Shadow protected abstract void prepareServerIcon(); 16 | @Shadow @Final private ServerData server; 17 | 18 | @Redirect(method = "drawEntry", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/ServerListEntryNormal;prepareServerIcon()V")) 19 | private void patcher$resolveCrash(ServerListEntryNormal serverListEntryNormal) { 20 | try { 21 | prepareServerIcon(); 22 | } catch (Exception e) { 23 | Patcher.instance.getLogger().error("Failed to prepare server icon, setting to default.", e); 24 | server.setBase64EncodedIconData(null); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/forge/BlockChestMixin_VanillaSlabChests.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes.forge; 2 | 3 | import club.sk1er.patcher.ducks.BlockExt; 4 | import net.minecraft.block.BlockChest; 5 | import net.minecraft.util.BlockPos; 6 | import net.minecraft.util.EnumFacing; 7 | import net.minecraft.world.World; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Redirect; 11 | 12 | @Mixin(BlockChest.class) 13 | public class BlockChestMixin_VanillaSlabChests { 14 | //#if MC<11200 15 | @Redirect(method = "isBelowSolidBlock", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;isSideSolid(Lnet/minecraft/util/BlockPos;Lnet/minecraft/util/EnumFacing;Z)Z", remap = false), remap = true) 16 | public boolean patcher$isBelowSolidBlock(World instance, BlockPos blockPos, EnumFacing enumFacing, boolean b) { 17 | return ((BlockExt) instance.getBlockState(blockPos).getBlock()).patcher$doesSideBlockChestOpening(instance, blockPos, enumFacing); 18 | } 19 | //#endif 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/gui/GuiScreenBookMixin.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes.gui; 2 | 3 | import net.minecraft.client.gui.GuiScreenBook; 4 | import net.minecraft.client.renderer.GlStateManager; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(GuiScreenBook.class) 11 | public class GuiScreenBookMixin { 12 | 13 | @Inject(method = "drawScreen", at = @At(value = "HEAD")) 14 | private void alpha(int mouseX, int mouseY, float partialTicks, CallbackInfo ci) { 15 | GlStateManager.enableBlend(); 16 | GlStateManager.enableAlpha(); 17 | GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); 18 | } 19 | 20 | @Inject(method = "drawScreen", at = @At(value = "TAIL")) 21 | private void end(int mouseX, int mouseY, float partialTicks, CallbackInfo ci) { 22 | GlStateManager.disableAlpha(); 23 | GlStateManager.disableBlend(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/levelhead/AboveHeadRender_ReFixNametagPerspective.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes.levelhead; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.settings.GameSettings; 5 | import org.spongepowered.asm.mixin.Dynamic; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Pseudo; 8 | import org.spongepowered.asm.mixin.injection.ModifyArg; 9 | 10 | @Pseudo 11 | @Mixin(targets = "club.sk1er.mods.levelhead.render.AboveHeadRender", remap = false) 12 | public class AboveHeadRender_ReFixNametagPerspective { 13 | 14 | @Dynamic("Levelhead") 15 | @ModifyArg(method = "renderName", at = @org.spongepowered.asm.mixin.injection.At(value = "INVOKE", target = "Lgg/essential/universal/UGraphics$GL;rotate(FFFF)V", ordinal = 1), index = 0, remap = false) 16 | private float patcher$fixNametagPerspective(float f) { 17 | GameSettings gameSettings = Minecraft.getMinecraft().gameSettings; 18 | if (gameSettings != null && gameSettings.thirdPersonView == 2) { 19 | return -f; 20 | } 21 | return f; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/modelfixes/ModelSkeletonMixin_FixedHeldItemTransformations.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes.modelfixes; 2 | 3 | import net.minecraft.client.model.ModelBiped; 4 | import net.minecraft.client.model.ModelSkeleton; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | 7 | @Mixin(ModelSkeleton.class) 8 | public class ModelSkeletonMixin_FixedHeldItemTransformations extends ModelBiped { 9 | 10 | //#if MC==10809 11 | @Override 12 | public void postRenderArm(float scale) { 13 | this.bipedRightArm.rotationPointX++; 14 | this.bipedRightArm.postRender(scale); 15 | this.bipedRightArm.rotationPointX--; 16 | } 17 | //#endif 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/modelfixes/ModelVillagerMixin_ResolveRobeHeight.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes.modelfixes; 2 | 3 | import net.minecraft.client.model.ModelVillager; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.Constant; 6 | import org.spongepowered.asm.mixin.injection.ModifyConstant; 7 | 8 | @Mixin(ModelVillager.class) 9 | public class ModelVillagerMixin_ResolveRobeHeight { 10 | 11 | @ModifyConstant(method = "(FFII)V", constant = @Constant(intValue = 18)) 12 | private int patcher$changeTextureHeight(int original) { 13 | return 20; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/mousebindfix/GuiContainerMixin_MouseBindFixThatLabyBreaks.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes.mousebindfix; 2 | 3 | import net.minecraft.client.gui.inventory.GuiContainer; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.Shadow; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | // Labymod breaks this, don't apply when they're present 11 | @Mixin(GuiContainer.class) 12 | public abstract class GuiContainerMixin_MouseBindFixThatLabyBreaks { 13 | @Shadow 14 | protected abstract boolean checkHotbarKeys(int keyCode); 15 | 16 | @Inject(method = "mouseClicked", at = @At("TAIL")) 17 | private void patcher$checkHotbarClicks(int mouseX, int mouseY, int mouseButton, CallbackInfo ci) { 18 | checkHotbarKeys(mouseButton - 100); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/network/LazyLoadBaseMixin_RaceCondition.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes.network; 2 | 3 | import net.minecraft.util.LazyLoadBase; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.Overwrite; 6 | import org.spongepowered.asm.mixin.Shadow; 7 | 8 | @Mixin(LazyLoadBase.class) 9 | public abstract class LazyLoadBaseMixin_RaceCondition { 10 | @Shadow private boolean isLoaded; 11 | 12 | @Shadow private T value; 13 | 14 | @Shadow protected abstract T load(); 15 | 16 | /** 17 | * @author LlamaLad7 18 | * @reason Fix race condition 19 | */ 20 | @Overwrite 21 | public T getValue() { 22 | //noinspection DoubleCheckedLocking 23 | if (!this.isLoaded) { 24 | synchronized (this) { 25 | if (!this.isLoaded) { 26 | this.value = this.load(); 27 | this.isLoaded = true; 28 | } 29 | } 30 | } 31 | 32 | return this.value; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/network/NetHandlerPlayClientMixin_ResourceExploitFix.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes.network; 2 | 3 | //#if MC==10809 4 | import club.sk1er.patcher.config.PatcherConfig; 5 | import club.sk1er.patcher.hooks.NetHandlerPlayClientHook; 6 | import net.minecraft.network.play.server.S48PacketResourcePackSend; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | //#endif 11 | import net.minecraft.client.network.NetHandlerPlayClient; 12 | import org.spongepowered.asm.mixin.Mixin; 13 | 14 | @Mixin(NetHandlerPlayClient.class) 15 | public class NetHandlerPlayClientMixin_ResourceExploitFix { 16 | //#if MC==10809 17 | @Inject(method = "handleResourcePack", at = @At("HEAD"), cancellable = true) 18 | private void patcher$resourceExploitFix(S48PacketResourcePackSend packetIn, CallbackInfo ci) { 19 | if (PatcherConfig.resourceExploitFix && !NetHandlerPlayClientHook.validateResourcePackUrl(packetIn)) { 20 | ci.cancel(); 21 | } 22 | } 23 | //#endif 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/network/NetHandlerPlayClientMixin_SignChatSpam.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes.network; 2 | 3 | import net.minecraft.client.entity.EntityPlayerSP; 4 | import net.minecraft.client.network.NetHandlerPlayClient; 5 | import net.minecraft.util.IChatComponent; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Redirect; 9 | import org.spongepowered.asm.mixin.injection.Slice; 10 | 11 | @Mixin(NetHandlerPlayClient.class) 12 | public class NetHandlerPlayClientMixin_SignChatSpam { 13 | //#if MC==10809 14 | @Redirect( 15 | method = "handleUpdateSign", 16 | slice = @Slice(from = @At(value = "CONSTANT", args = "stringValue=Unable to locate sign at ", ordinal = 0)), 17 | at = @At(value = "INVOKE", target = "Lnet/minecraft/client/entity/EntityPlayerSP;addChatMessage(Lnet/minecraft/util/IChatComponent;)V", ordinal = 0) 18 | ) 19 | private void patcher$removeDebugMessage(EntityPlayerSP instance, IChatComponent component) { 20 | // No-op 21 | } 22 | //#endif 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/network/ServerAddressMixin_ResolveCrash.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes.network; 2 | 3 | import net.minecraft.client.multiplayer.ServerAddress; 4 | import org.spongepowered.asm.mixin.Final; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.Overwrite; 7 | import org.spongepowered.asm.mixin.Shadow; 8 | 9 | import java.net.IDN; 10 | 11 | @Mixin(ServerAddress.class) 12 | public class ServerAddressMixin_ResolveCrash { 13 | @Shadow @Final private String ipAddress; 14 | 15 | //#if MC==10809 16 | /** 17 | * @author LlamaLad7 18 | * @reason Fix crash - MC-89698 19 | */ 20 | @Overwrite 21 | public String getIP() { 22 | try { 23 | return IDN.toASCII(this.ipAddress); 24 | } catch (IllegalArgumentException e) { 25 | return ""; 26 | } 27 | } 28 | //#endif 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/network/packet/EntityPacketsMixin_ResolveNpe.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes.network.packet; 2 | 3 | import net.minecraft.entity.Entity; 4 | import net.minecraft.network.play.server.S14PacketEntity; 5 | import net.minecraft.network.play.server.S19PacketEntityHeadLook; 6 | import net.minecraft.network.play.server.S19PacketEntityStatus; 7 | import net.minecraft.world.World; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 12 | 13 | @Mixin({S14PacketEntity.class, S19PacketEntityHeadLook.class, S19PacketEntityStatus.class}) 14 | public class EntityPacketsMixin_ResolveNpe { 15 | @SuppressWarnings("UnresolvedMixinReference") 16 | @Inject( 17 | method = {"getEntity", "func_149065_a", "func_149381_a", "func_149161_a"}, 18 | at = @At("HEAD"), 19 | cancellable = true, 20 | remap = false 21 | ) 22 | private void patcher$addNullCheck(World worldIn, CallbackInfoReturnable cir) { 23 | if (worldIn == null) { 24 | cir.setReturnValue(null); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/render/entity/RenderArrowMixin_AlphaFix.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes.render.entity; 2 | 3 | import net.minecraft.client.renderer.GlStateManager; 4 | import net.minecraft.client.renderer.entity.RenderArrow; 5 | import net.minecraft.entity.projectile.EntityArrow; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(RenderArrow.class) 12 | public class RenderArrowMixin_AlphaFix { 13 | 14 | @Inject(method = "doRender(Lnet/minecraft/entity/projectile/EntityArrow;DDDFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;translate(FFF)V")) 15 | private void alphaFix(EntityArrow entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { 16 | GlStateManager.enableAlpha(); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/render/entity/RenderFishMixin_AlphaFix.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes.render.entity; 2 | 3 | import net.minecraft.client.renderer.GlStateManager; 4 | import net.minecraft.client.renderer.entity.RenderFish; 5 | import net.minecraft.entity.projectile.EntityFishHook; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(RenderFish.class) 12 | public class RenderFishMixin_AlphaFix { 13 | 14 | @Inject(method = "doRender(Lnet/minecraft/entity/projectile/EntityFishHook;DDDFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;translate(FFF)V")) 15 | private void alphaFix(EntityFishHook entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { 16 | GlStateManager.enableAlpha(); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/render/entity/RenderMixin_FireLayerFix.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes.render.entity; 2 | 3 | import net.minecraft.client.renderer.GlStateManager; 4 | import net.minecraft.client.renderer.entity.Render; 5 | import net.minecraft.entity.Entity; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(Render.class) 12 | public class RenderMixin_FireLayerFix { 13 | 14 | @Inject(method = "renderEntityOnFire", at = @At("HEAD")) 15 | private void fix(Entity entity, double x, double y, double z, float partialTicks, CallbackInfo ci) { 16 | GlStateManager.enableBlend(); 17 | GlStateManager.blendFunc(770, 771); 18 | GlStateManager.enableAlpha(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/bugfixes/render/item/ItemStackMixin_HexColorTooltip.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.bugfixes.render.item; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Redirect; 7 | 8 | @Mixin(ItemStack.class) 9 | public class ItemStackMixin_HexColorTooltip { 10 | //#if MC==10809 11 | @Redirect( 12 | method = "getTooltip", 13 | at = @At(value = "INVOKE", target = "Ljava/lang/Integer;toHexString(I)Ljava/lang/String;") 14 | ) 15 | private String patcher$fixHexColorString(int i) { 16 | return String.format("%06X", i); 17 | } 18 | //#endif 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/ArmorStandRendererMixin_HideNametag.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.Minecraft; 5 | import net.minecraft.client.renderer.entity.ArmorStandRenderer; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 10 | 11 | @Mixin(ArmorStandRenderer.class) 12 | public class ArmorStandRendererMixin_HideNametag { 13 | @Inject(method = "canRenderName(Lnet/minecraft/entity/item/EntityArmorStand;)Z", at = @At("HEAD"), cancellable = true) 14 | private void patcher$hideNametag(CallbackInfoReturnable cir) { 15 | if (PatcherConfig.betterHideGui && Minecraft.getMinecraft().gameSettings.hideGUI) { 16 | cir.setReturnValue(false); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/ChunkRenderDispatcherMixin_LimitUpdates.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.renderer.chunk.ChunkCompileTaskGenerator; 5 | import net.minecraft.client.renderer.chunk.ChunkRenderDispatcher; 6 | import net.minecraft.client.renderer.chunk.RenderChunk; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 11 | 12 | @Mixin(ChunkRenderDispatcher.class) 13 | public class ChunkRenderDispatcherMixin_LimitUpdates { 14 | @SuppressWarnings("BusyWait") 15 | @Inject(method = "getNextChunkUpdate", at = @At("HEAD")) 16 | private void patcher$limitChunkUpdates(CallbackInfoReturnable cir) throws InterruptedException { 17 | while (PatcherConfig.limitChunks && RenderChunk.renderChunksUpdated >= PatcherConfig.chunkUpdateLimit) { 18 | Thread.sleep(50L); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/EnchantmentMixin_RomanNumerals.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import club.sk1er.patcher.util.RomanNumerals; 5 | import net.minecraft.enchantment.Enchantment; 6 | import net.minecraft.util.StatCollector; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.Shadow; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 12 | 13 | @Mixin(Enchantment.class) 14 | public abstract class EnchantmentMixin_RomanNumerals { 15 | 16 | @Shadow 17 | public abstract String getName(); 18 | 19 | @Inject(method = "getTranslatedName", at = @At("HEAD"), cancellable = true) 20 | private void patcher$modifyRomanNumerals(int level, CallbackInfoReturnable cir) { 21 | String translation = StatCollector.translateToLocal(this.getName()) + " "; 22 | if (PatcherConfig.numericalEnchants) { 23 | cir.setReturnValue(translation + level); 24 | } else if (PatcherConfig.betterRomanNumerals) { 25 | cir.setReturnValue(translation + RomanNumerals.toRoman(level)); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/EntityFXMixin_TrackCullState.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.ducks.EntityFXExt; 4 | import net.minecraft.client.particle.EntityFX; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.Unique; 7 | 8 | @Mixin(EntityFX.class) 9 | public class EntityFXMixin_TrackCullState implements EntityFXExt { 10 | 11 | @Unique 12 | private float patcher$cullState; 13 | 14 | @Override 15 | public void patcher$setCullState(float cullState) { 16 | this.patcher$cullState = cullState; 17 | } 18 | 19 | @Override 20 | public float patcher$getCullState() { 21 | return this.patcher$cullState; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/EntityMixin_NaturalCapes.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import net.minecraft.entity.Entity; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 8 | 9 | @Mixin(Entity.class) 10 | public abstract class EntityMixin_NaturalCapes { 11 | @Inject(method="setPositionAndRotation", at=@At("HEAD")) 12 | protected void patcher$overrideMethod(double x, double y, double z, float yaw, float pitch, CallbackInfo ci){ 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/EntityPlayerSPMixin_NauseaEffect.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import com.mojang.authlib.GameProfile; 5 | import net.minecraft.client.entity.AbstractClientPlayer; 6 | import net.minecraft.client.entity.EntityPlayerSP; 7 | import net.minecraft.potion.Potion; 8 | import net.minecraft.world.World; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.Shadow; 11 | 12 | @Mixin(EntityPlayerSP.class) 13 | public class EntityPlayerSPMixin_NauseaEffect extends AbstractClientPlayer { 14 | public EntityPlayerSPMixin_NauseaEffect(World worldIn, GameProfile playerProfile) { 15 | super(worldIn, playerProfile); 16 | } 17 | 18 | //#if MC==10809 19 | @Shadow public float timeInPortal; 20 | @Shadow public float prevTimeInPortal; 21 | 22 | // @Override 23 | // public void removePotionEffectClient(int potionId) { 24 | // if (PatcherConfig.nauseaEffect && potionId == Potion.confusion.id) { 25 | // this.timeInPortal = 0.0f; 26 | // this.prevTimeInPortal = 0.0f; 27 | // } 28 | // 29 | // super.removePotionEffectClient(potionId); 30 | // } 31 | //#endif 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/EntityRendererMixin_CameraPerspective.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.multiplayer.WorldClient; 5 | import net.minecraft.client.renderer.EntityRenderer; 6 | import net.minecraft.util.MovingObjectPosition; 7 | import net.minecraft.util.Vec3; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Redirect; 11 | 12 | @Mixin(EntityRenderer.class) 13 | public class EntityRendererMixin_CameraPerspective { 14 | 15 | @Redirect(method = "orientCamera", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/multiplayer/WorldClient;rayTraceBlocks(Lnet/minecraft/util/Vec3;Lnet/minecraft/util/Vec3;)Lnet/minecraft/util/MovingObjectPosition;")) 16 | private MovingObjectPosition patcher$changeBlockingType(WorldClient instance, Vec3 from, Vec3 to) { 17 | return PatcherConfig.betterCamera 18 | ? instance.rayTraceBlocks(from, to, false, true, true) 19 | : instance.rayTraceBlocks(from, to); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/EntityRendererMixin_Distortion.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.renderer.EntityRenderer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.*; 7 | 8 | @Mixin(EntityRenderer.class) 9 | public class EntityRendererMixin_Distortion { 10 | 11 | @ModifyArg(method = "setupCameraTransform", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;scale(FFF)V"), index = 0) 12 | private float level(float value) { 13 | return 1 + (value - 1) * PatcherConfig.distortionEffect / 100f; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/EntityRendererMixin_Fog.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.renderer.EntityRenderer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.*; 7 | 8 | @Mixin(EntityRenderer.class) 9 | public class EntityRendererMixin_Fog { 10 | 11 | @ModifyConstant(method = "setupFog", constant = @Constant(floatValue = 0.01f)) 12 | private float waterBreathing(float constant) { 13 | return constant * Math.min(1f, PatcherConfig.waterDensity / 100f); 14 | } 15 | 16 | @ModifyConstant(method = "setupFog", constant = @Constant(floatValue = 0.1f, ordinal = 2)) 17 | private float water(float constant) { 18 | return constant * PatcherConfig.waterDensity / 100f; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/GuiAchievementMixin_CancelRender.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.gui.achievement.GuiAchievement; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(GuiAchievement.class) 11 | public class GuiAchievementMixin_CancelRender { 12 | 13 | @Inject(method = "updateAchievementWindow", at = @At("HEAD"), cancellable = true) 14 | private void patcher$cancelRendering(CallbackInfo ci) { 15 | if (PatcherConfig.disableAchievements) ci.cancel(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/GuiChatMixin_ExtendedChatLength.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.asm.render.screen.GuiChatTransformer; 4 | import club.sk1er.patcher.config.PatcherConfig; 5 | import net.minecraft.client.gui.GuiChat; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.Constant; 8 | import org.spongepowered.asm.mixin.injection.ModifyConstant; 9 | 10 | @Mixin(GuiChat.class) 11 | public class GuiChatMixin_ExtendedChatLength { 12 | //#if MC==10809 13 | @ModifyConstant(method = "initGui", constant = @Constant(intValue = 100)) 14 | private int patcher$useExtendedChatLength(int original) { 15 | return PatcherConfig.extendedChatLength ? GuiChatTransformer.maxChatLength : original; 16 | } 17 | //#endif 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/GuiChatMixin_SafeChatClicksHistory.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.gui.Gui; 5 | import net.minecraft.client.gui.GuiChat; 6 | import net.minecraft.client.gui.GuiScreen; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.ModifyArg; 10 | 11 | @Mixin(GuiScreen.class) 12 | public abstract class GuiChatMixin_SafeChatClicksHistory extends Gui { 13 | 14 | @ModifyArg(method = "handleComponentClick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiScreen;sendChatMessage(Ljava/lang/String;Z)V"), index = 1) 15 | public boolean patcher$handleComponentClick(boolean addToChat) { 16 | 17 | return addToChat || (PatcherConfig.safeChatClicksHistory && ((Object) this) instanceof GuiChat); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/GuiContainerMixin_ClickOutOfContainers.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.gui.inventory.GuiContainer; 5 | import net.minecraft.client.settings.GameSettings; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Redirect; 9 | 10 | @Mixin(GuiContainer.class) 11 | public class GuiContainerMixin_ClickOutOfContainers { 12 | @Redirect(method = "mouseClicked", at = @At(value = "FIELD", target = "Lnet/minecraft/client/settings/GameSettings;touchscreen:Z", ordinal = 0)) 13 | private boolean patcher$checkSetting(GameSettings instance) { 14 | return PatcherConfig.clickOutOfContainers || instance.touchscreen; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/GuiContainerMixin_DropModifierKey.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.Patcher; 4 | import net.minecraft.client.gui.GuiScreen; 5 | import net.minecraft.client.gui.inventory.GuiContainer; 6 | import net.minecraft.client.settings.GameSettings; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Redirect; 10 | 11 | @Mixin(GuiContainer.class) 12 | public class GuiContainerMixin_DropModifierKey { 13 | @Redirect(method = "keyTyped", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/inventory/GuiContainer;isCtrlKeyDown()Z")) 14 | private boolean patcher$useModifierKey() { 15 | return GuiScreen.isCtrlKeyDown() || GameSettings.isKeyDown(Patcher.instance.getDropModifier()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/GuiModListMixin_RemoveDummyPatcherMod.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import net.minecraftforge.fml.client.GuiModList; 4 | import net.minecraftforge.fml.common.ModContainer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.Shadow; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | import java.util.ArrayList; 12 | import java.util.Objects; 13 | 14 | @Mixin(GuiModList.class) 15 | public class GuiModListMixin_RemoveDummyPatcherMod { 16 | 17 | @Shadow(remap = false) 18 | private ArrayList mods; 19 | 20 | @Inject(method = "", at = @At("RETURN")) 21 | private void patcher$removeDummyPatcherMod(CallbackInfo ci) { 22 | this.mods.removeIf(modInfo -> Objects.equals(modInfo.getModId(), "patcher")); 23 | } 24 | 25 | @Inject(method = "reloadMods", at = @At("RETURN"), remap = false) 26 | private void patcher$reloadMods(CallbackInfo ci) { 27 | patcher$removeDummyPatcherMod(ci); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/GuiScreenServerListMixin_FakeServerListDirectConnect.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.screen.FakeMultiplayerMenu; 4 | import net.minecraft.client.gui.GuiButton; 5 | import net.minecraft.client.gui.GuiScreen; 6 | import net.minecraft.client.gui.GuiScreenServerList; 7 | import org.spongepowered.asm.mixin.Final; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.Shadow; 10 | import org.spongepowered.asm.mixin.injection.At; 11 | import org.spongepowered.asm.mixin.injection.Inject; 12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 13 | 14 | @Mixin(GuiScreenServerList.class) 15 | public class GuiScreenServerListMixin_FakeServerListDirectConnect { 16 | @Shadow @Final private GuiScreen field_146303_a; 17 | 18 | @Inject(method = "actionPerformed", at = @At("HEAD")) 19 | private void patcher$disconnectIfNecessary(GuiButton button, CallbackInfo ci) { 20 | if (button.enabled && button.id == 0 && this.field_146303_a instanceof FakeMultiplayerMenu) { 21 | FakeMultiplayerMenu parentScreen = (FakeMultiplayerMenu) this.field_146303_a; 22 | parentScreen.performDisconnection(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/ImageBufferDownload_EarsMod.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import net.minecraft.client.renderer.ImageBufferDownload; 4 | import org.spongepowered.asm.mixin.Dynamic; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Redirect; 8 | 9 | import java.awt.image.BufferedImage; 10 | 11 | @Mixin(ImageBufferDownload.class) 12 | public class ImageBufferDownload_EarsMod { 13 | 14 | @Dynamic("Ears Mod") 15 | @Redirect(method = "parseUserSkin", at = @At(value = "INVOKE", target = "Lcom/unascribed/ears/Ears;preprocessSkin(Lnet/minecraft/client/renderer/ImageBufferDownload;Ljava/awt/image/BufferedImage;Ljava/awt/image/BufferedImage;)V", remap = false), remap = true) 16 | private void preprocessSkin(ImageBufferDownload subject, BufferedImage rawImg, BufferedImage img) { 17 | // this will never work because the way they find the locals is really really fragile and doesn't work with this mixin 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/LayerArrowMixin_CancelRender.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.renderer.entity.layers.LayerArrow; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(LayerArrow.class) 11 | public class LayerArrowMixin_CancelRender { 12 | @Inject(method = "doRenderLayer", at = @At("HEAD"), cancellable = true) 13 | private void patcher$cancelRendering(CallbackInfo ci) { 14 | if (PatcherConfig.disableAttachedArrows) { 15 | ci.cancel(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/LayerWitherAuraMixin_DisableWhenInvisible.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.renderer.entity.layers.LayerWitherAura; 5 | import net.minecraft.entity.boss.EntityWither; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(LayerWitherAura.class) 12 | public class LayerWitherAuraMixin_DisableWhenInvisible { 13 | @Inject(method = "doRenderLayer(Lnet/minecraft/entity/boss/EntityWither;FFFFFFF)V", at = @At("HEAD"), cancellable = true) 14 | private void patcher$hideAuraWhenWitherIsInvisible(EntityWither entityWither, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale, CallbackInfo ci) { 15 | if (PatcherConfig.hideAuraOnInvisibleWither && entityWither.isInvisible()) { 16 | ci.cancel(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/MinecraftMixin_BetterKeybindHandling.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import club.sk1er.patcher.hooks.MinecraftHook; 5 | import net.minecraft.client.Minecraft; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(Minecraft.class) 12 | public class MinecraftMixin_BetterKeybindHandling { 13 | //#if MC==10809 14 | @Inject(method = "setIngameFocus", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/MouseHelper;grabMouseCursor()V")) 15 | private void patcher$makeKeysReRegister(CallbackInfo ci) { 16 | if (PatcherConfig.newKeybindHandling && !Minecraft.isRunningOnMac) { 17 | MinecraftHook.updateKeyBindState(); 18 | } 19 | } 20 | //#endif 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/MinecraftMixin_KeepChatMessages.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.gui.GuiNewChat; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Redirect; 8 | 9 | @Mixin(Minecraft.class) 10 | public class MinecraftMixin_KeepChatMessages { 11 | 12 | private final String patcher$clearChatMessagesTarget = 13 | //#if MC==10809 14 | "Lnet/minecraft/client/gui/GuiNewChat;clearChatMessages()V"; 15 | //#else 16 | //$$ "Lnet/minecraft/client/gui/GuiNewChat;clearChatMessages(Z)V"; 17 | //#endif 18 | 19 | // this is so ugly : ( 20 | @Redirect(method = "displayGuiScreen", at = @At(value = "INVOKE", target = patcher$clearChatMessagesTarget)) 21 | private void patcher$keepChatMessages(GuiNewChat instance 22 | //#if MC==11202 23 | //$$ , boolean clearSentMessages 24 | //#endif 25 | ) { 26 | // No-op 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/MinecraftMixin_Metrics.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.hooks.MinecraftHook; 4 | import club.sk1er.patcher.screen.render.overlay.metrics.MetricsData; 5 | import net.minecraft.client.Minecraft; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.ModifyArg; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | 12 | @Mixin(Minecraft.class) 13 | public class MinecraftMixin_Metrics { 14 | @Inject(method = "", at = @At("RETURN")) 15 | private void patcher$createMetricsData(CallbackInfo ci) { 16 | MinecraftHook.metricsData = new MetricsData(); 17 | } 18 | 19 | @ModifyArg( 20 | method = "runGameLoop", 21 | at = @At(value = "INVOKE", target = "Lnet/minecraft/util/FrameTimer;addFrame(J)V") 22 | ) 23 | private long patcher$pushMetricsSample(long time) { 24 | MinecraftHook.metricsData.pushSample(time); 25 | return time; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/MinecraftMixin_SeparateResources.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.Minecraft; 5 | import net.minecraft.client.audio.SoundHandler; 6 | import net.minecraft.client.resources.IReloadableResourceManager; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.Shadow; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Redirect; 11 | 12 | @Mixin(Minecraft.class) 13 | public abstract class MinecraftMixin_SeparateResources { 14 | 15 | //#if MC==10809 16 | @Shadow private SoundHandler mcSoundHandler; 17 | @Shadow private IReloadableResourceManager mcResourceManager; 18 | @Shadow public abstract void refreshResources(); 19 | 20 | @Redirect(method = "runTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;refreshResources()V", ordinal = 0)) 21 | private void patcher$separateSoundReloading(Minecraft minecraft) { 22 | if (PatcherConfig.separateResourceLoading) { 23 | mcSoundHandler.onResourceManagerReload(mcResourceManager); 24 | } else { 25 | refreshResources(); 26 | } 27 | } 28 | //#endif 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/MinecraftMixin_WindowedFullscreen.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.hooks.MinecraftHook; 4 | import net.minecraft.client.Minecraft; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(Minecraft.class) 11 | public class MinecraftMixin_WindowedFullscreen { 12 | @Inject(method = "toggleFullscreen", at = @At("HEAD"), cancellable = true) 13 | private void patcher$windowedFullscreen(CallbackInfo ci) { 14 | if (MinecraftHook.fullscreen()) ci.cancel(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/MinecraftServerMixin_Metrics.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.hooks.MinecraftServerHook; 4 | import club.sk1er.patcher.screen.render.overlay.metrics.MetricsData; 5 | import net.minecraft.server.MinecraftServer; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.Redirect; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | 12 | @Mixin(MinecraftServer.class) 13 | public class MinecraftServerMixin_Metrics { 14 | @Inject(method = "*", at = @At("RETURN")) 15 | private void patcher$createMetricsData(CallbackInfo ci) { 16 | MinecraftServerHook.metricsData = new MetricsData(); 17 | } 18 | 19 | @Redirect( 20 | method = "tick", 21 | at = @At(value = "FIELD", target = "Lnet/minecraft/server/MinecraftServer;tickTimeArray:[J", args = "array=set") 22 | ) 23 | private void patcher$pushMetricsSample(long[] array, int index, long value) { 24 | array[index] = value; 25 | MinecraftServerHook.metricsData.pushSample(value); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/RenderArrowMixin_CancelRender.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.hooks.RenderArrowHook; 4 | import net.minecraft.client.renderer.entity.RenderArrow; 5 | import net.minecraft.entity.projectile.EntityArrow; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(RenderArrow.class) 12 | public class RenderArrowMixin_CancelRender { 13 | @Inject(method = "doRender(Lnet/minecraft/entity/projectile/EntityArrow;DDDFF)V", at = @At("HEAD"), cancellable = true) 14 | private void patcher$cancelRendering(EntityArrow entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { 15 | if (RenderArrowHook.cancelRendering(entity)) { // can't use accessors in mixins in 0.7.11, so use a hook instead 16 | ci.cancel(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/RenderEntityItemMixin_StaticItems.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.renderer.entity.RenderEntityItem; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 9 | 10 | @Mixin(RenderEntityItem.class) 11 | public class RenderEntityItemMixin_StaticItems { 12 | @Inject(method = "shouldBob", at = @At("HEAD"), cancellable = true, remap = false) 13 | private void patcher$checkOption(CallbackInfoReturnable cir) { 14 | cir.setReturnValue(!PatcherConfig.staticItems); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/RenderEntityItemMixin_UnstackedItems.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.renderer.entity.RenderEntityItem; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 9 | 10 | @Mixin(RenderEntityItem.class) 11 | public class RenderEntityItemMixin_UnstackedItems { 12 | @Inject(method = "func_177078_a", at = @At("HEAD"), cancellable = true) 13 | private void patcher$changeStackType(CallbackInfoReturnable cir) { 14 | if (PatcherConfig.unstackedItems) { 15 | cir.setReturnValue(1); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/RenderFallingBlockMixin_CancelRender.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.renderer.entity.RenderFallingBlock; 5 | import net.minecraft.entity.item.EntityFallingBlock; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(RenderFallingBlock.class) 12 | public class RenderFallingBlockMixin_CancelRender { 13 | @Inject(method = "doRender(Lnet/minecraft/entity/item/EntityFallingBlock;DDDFF)V", at = @At("HEAD"), cancellable = true) 14 | private void patcher$cancelRendering(EntityFallingBlock entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { 15 | if (PatcherConfig.disableFallingBlocks) ci.cancel(); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/RenderFishMixin_CleanProjectiles.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.renderer.entity.RenderFish; 5 | import net.minecraft.entity.projectile.EntityFishHook; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(RenderFish.class) 12 | public class RenderFishMixin_CleanProjectiles { 13 | 14 | @Inject(method = "doRender(Lnet/minecraft/entity/projectile/EntityFishHook;DDDFF)V", at = @At("HEAD"), cancellable = true) 15 | public void patcher$cleanProjectiles(EntityFishHook entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { 16 | if (PatcherConfig.cleanProjectiles && entity.ticksExisted < 2) ci.cancel(); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/RenderLightningBoltMixin_CancelRender.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.renderer.entity.RenderLightningBolt; 5 | import net.minecraft.entity.effect.EntityLightningBolt; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(RenderLightningBolt.class) 12 | public class RenderLightningBoltMixin_CancelRender { 13 | @Inject(method = "doRender(Lnet/minecraft/entity/effect/EntityLightningBolt;DDDFF)V", at = @At("HEAD"), cancellable = true) 14 | private void patcher$cancelLightningBoltRender(CallbackInfo ci) { 15 | if (PatcherConfig.disableLightningBolts) ci.cancel(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/RenderManagerMixin_CancelArrowRender.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.hooks.RenderArrowHook; 4 | import net.minecraft.client.renderer.entity.RenderManager; 5 | import net.minecraft.entity.Entity; 6 | import net.minecraft.entity.projectile.EntityArrow; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | 12 | @Mixin(RenderManager.class) 13 | public class RenderManagerMixin_CancelArrowRender { 14 | @Inject(method = "renderDebugBoundingBox", at = @At("HEAD"), cancellable = true) 15 | public void patcher$cancelArrowBoundingBoxRendering(Entity entityIn, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { 16 | if (entityIn instanceof EntityArrow && RenderArrowHook.cancelRendering((EntityArrow) entityIn)) { 17 | ci.cancel(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/RenderSnowballMixin_CleanProjectiles.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.renderer.entity.RenderSnowball; 5 | import net.minecraft.entity.Entity; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(RenderSnowball.class) 12 | public class RenderSnowballMixin_CleanProjectiles { 13 | 14 | @Inject(method = "doRender", at = @At("HEAD"), cancellable = true) 15 | public void patcher$cleanProjectiles(T entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { 16 | if (PatcherConfig.cleanProjectiles && entity.ticksExisted < 2) ci.cancel(); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/TileEntityEnchantmentTableRendererMixin_CancelRender.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.renderer.tileentity.TileEntityEnchantmentTableRenderer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(TileEntityEnchantmentTableRenderer.class) 11 | public class TileEntityEnchantmentTableRendererMixin_CancelRender { 12 | 13 | private final String patcher$renderTileEntityAtDesc = 14 | //#if MC==10809 15 | "renderTileEntityAt(Lnet/minecraft/tileentity/TileEntityEnchantmentTable;DDDFI)V"; 16 | //#else 17 | //$$ "render(Lnet/minecraft/tileentity/TileEntityEnchantmentTable;DDDFIF)V"; 18 | //#endif 19 | 20 | @Inject(method = patcher$renderTileEntityAtDesc, at = @At("HEAD"), cancellable = true) 21 | private void patcher$cancelRendering(CallbackInfo ci) { 22 | if (PatcherConfig.disableEnchantmentBooks) { 23 | ci.cancel(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/TileEntityEndPortalRendererMixins_CancelRender.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.renderer.tileentity.TileEntityEndPortalRenderer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(TileEntityEndPortalRenderer.class) 11 | public class TileEntityEndPortalRendererMixins_CancelRender { 12 | 13 | private final String patcher$renderTileEntityAtDesc = 14 | //#if MC==10809 15 | "renderTileEntityAt(Lnet/minecraft/tileentity/TileEntityEndPortal;DDDFI)V"; 16 | //#else 17 | //$$ "render(Lnet/minecraft/tileentity/TileEntityEndPortal;DDDFIF)V"; 18 | //#endif 19 | 20 | @Inject(method = patcher$renderTileEntityAtDesc, at = @At("HEAD"), cancellable = true) 21 | private void patcher$cancelRendering(CallbackInfo ci) { 22 | if (PatcherConfig.disableEndPortals) { 23 | ci.cancel(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/TileEntityMixin_RenderDistance.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.tileentity.TileEntity; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 9 | 10 | @Mixin(TileEntity.class) 11 | public class TileEntityMixin_RenderDistance { 12 | @Inject(method = "getMaxRenderDistanceSquared", at = @At("HEAD"), cancellable = true) 13 | private void patcher$renderDistance(CallbackInfoReturnable cir) { 14 | if (PatcherConfig.entityRenderDistanceToggle) { 15 | cir.setReturnValue(Math.pow(Math.min(PatcherConfig.tileEntityRenderDistance, PatcherConfig.entityRenderDistance), 2)); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/TileEntitySkullRendererMixin_CancelRender.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(TileEntitySkullRenderer.class) 11 | public class TileEntitySkullRendererMixin_CancelRender { 12 | 13 | private final String patcher$renderTileEntityAtDesc = 14 | //#if MC==10809 15 | "renderTileEntityAt(Lnet/minecraft/tileentity/TileEntitySkull;DDDFI)V"; 16 | //#else 17 | //$$ "render(Lnet/minecraft/tileentity/TileEntitySkull;DDDFIF)V"; 18 | //#endif 19 | 20 | @Inject(method = patcher$renderTileEntityAtDesc, at = @At("HEAD"), cancellable = true) 21 | private void patcher$cancelRendering(CallbackInfo ci) { 22 | if (PatcherConfig.disableSkulls) { 23 | ci.cancel(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/containeropacity/GuiChestMixin_ContainerOpacity.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features.containeropacity; 2 | 3 | import club.sk1er.patcher.hooks.ContainerOpacityHook; 4 | import net.minecraft.client.gui.inventory.GuiChest; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(GuiChest.class) 11 | public class GuiChestMixin_ContainerOpacity { 12 | @Inject(method = "drawGuiContainerBackgroundLayer", at = @At(value = "INVOKE", 13 | target = "Lnet/minecraft/client/gui/inventory/GuiChest;drawTexturedModalRect(IIIIII)V", ordinal = 0)) 14 | private void patcher$beginContainerOpacity(CallbackInfo ci) { 15 | ContainerOpacityHook.beginTransparency(); 16 | } 17 | 18 | @Inject(method = "drawGuiContainerBackgroundLayer", at = @At(value = "INVOKE", 19 | target = "Lnet/minecraft/client/gui/inventory/GuiChest;drawTexturedModalRect(IIIIII)V", ordinal = 1, shift = At.Shift.AFTER)) 20 | private void patcher$endContainerOpacity(CallbackInfo ci) { 21 | ContainerOpacityHook.endTransparency(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/containeropacity/GuiInventoryMixin_ContainerOpacity.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features.containeropacity; 2 | 3 | import club.sk1er.patcher.hooks.ContainerOpacityHook; 4 | import net.minecraft.client.gui.inventory.GuiInventory; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(GuiInventory.class) 11 | public class GuiInventoryMixin_ContainerOpacity { 12 | @Inject(method = "drawGuiContainerBackgroundLayer", at = @At(value = "INVOKE", 13 | target = "Lnet/minecraft/client/gui/inventory/GuiInventory;drawTexturedModalRect(IIIIII)V")) 14 | private void patcher$beginContainerOpacity(CallbackInfo ci) { 15 | ContainerOpacityHook.beginTransparency(); 16 | } 17 | 18 | @Inject(method = "drawGuiContainerBackgroundLayer", at = @At(value = "INVOKE", 19 | target = "Lnet/minecraft/client/gui/inventory/GuiInventory;drawTexturedModalRect(IIIIII)V", shift = At.Shift.AFTER)) 20 | private void patcher$endContainerOpacity(CallbackInfo ci) { 21 | ContainerOpacityHook.endTransparency(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/cropheight/BlockMixin_CropHitbox.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features.cropheight; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.util.AxisAlignedBB; 5 | import net.minecraft.util.BlockPos; 6 | import net.minecraft.util.MovingObjectPosition; 7 | import net.minecraft.util.Vec3; 8 | import net.minecraft.world.World; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.injection.At; 11 | import org.spongepowered.asm.mixin.injection.Inject; 12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 13 | 14 | @Mixin(Block.class) 15 | public class BlockMixin_CropHitbox { 16 | //#if MC==10809 17 | 18 | @Inject(method = "getSelectedBoundingBox", at = @At("HEAD")) 19 | public void getSelectedBoundingBox(World worldIn, BlockPos pos, CallbackInfoReturnable cir) { 20 | 21 | } 22 | 23 | @Inject(method = "collisionRayTrace", at = @At("HEAD")) 24 | public void collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end, CallbackInfoReturnable cir) { 25 | 26 | } 27 | //#endif 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/disableenchantglint/LayerArmorBaseMixin_DisableEnchantGlint.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features.disableenchantglint; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.renderer.entity.layers.LayerArmorBase; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(LayerArmorBase.class) 11 | public class LayerArmorBaseMixin_DisableEnchantGlint { 12 | @Inject(method = "renderGlint", at = @At("HEAD"), cancellable = true) 13 | //#if MC==10809 14 | private void patcher$disableEnchantGlint(CallbackInfo ci) { 15 | //#else 16 | //$$ private static void patcher$disableEnchantGlint(CallbackInfo ci) { 17 | //#endif 18 | if (PatcherConfig.disableEnchantmentGlint) ci.cancel(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/disableenchantglint/RenderItemMixin_DisableEnchantGlint.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features.disableenchantglint; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.renderer.entity.RenderItem; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(RenderItem.class) 11 | public class RenderItemMixin_DisableEnchantGlint { 12 | @Inject(method = "renderEffect", at = @At("HEAD"), cancellable = true) 13 | private void patcher$disableEnchantGlint(CallbackInfo ci) { 14 | if (PatcherConfig.disableEnchantmentGlint) ci.cancel(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/fullbright/ChunkMixin_Fullbright.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features.fullbright; 2 | 3 | import club.sk1er.patcher.util.world.render.FullbrightTicker; 4 | import net.minecraft.world.chunk.Chunk; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 9 | 10 | @Mixin(Chunk.class) 11 | public class ChunkMixin_Fullbright { 12 | @Inject(method = {"getLightFor", "getLightSubtracted"}, at = @At("HEAD"), cancellable = true) 13 | private void patcher$fullbright(CallbackInfoReturnable cir) { 14 | if (FullbrightTicker.isFullbright()) { 15 | cir.setReturnValue(15); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/invscale/ScaledResolutionMixin_InventoryScale.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features.invscale; 2 | 3 | import club.sk1er.patcher.screen.ResolutionHelper; 4 | import net.minecraft.client.gui.ScaledResolution; 5 | import net.minecraft.client.settings.GameSettings; 6 | import org.objectweb.asm.Opcodes; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Redirect; 10 | 11 | @Mixin(ScaledResolution.class) 12 | public class ScaledResolutionMixin_InventoryScale { 13 | @Redirect(method = "", at = @At(value = "FIELD", target = "Lnet/minecraft/client/settings/GameSettings;guiScale:I", opcode = Opcodes.GETFIELD)) 14 | private int patcher$modifyScale(GameSettings gameSettings) { 15 | int scale = ResolutionHelper.getScaleOverride(); 16 | return scale >= 0 ? scale : gameSettings.guiScale; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/lefthand/ItemRendererMixin_LeftHandedness.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features.lefthand; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.renderer.ItemRenderer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.Constant; 7 | import org.spongepowered.asm.mixin.injection.ModifyConstant; 8 | 9 | @Mixin(ItemRenderer.class) 10 | public class ItemRendererMixin_LeftHandedness { 11 | //#if MC==10809 12 | @ModifyConstant(method = "rotateWithPlayerRotations", constant = @Constant(floatValue = 1f, ordinal = 1)) 13 | private float leftHandRotate(float constant) { 14 | return PatcherConfig.leftHandInFirstPerson ? -constant : constant; 15 | } 16 | //#endif 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/lefthand/RenderFishMixin_LeftHandedness.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features.lefthand; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.renderer.entity.RenderFish; 5 | import net.minecraft.util.Vec3; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.ModifyVariable; 9 | 10 | @Mixin(RenderFish.class) 11 | public class RenderFishMixin_LeftHandedness { 12 | //#if MC==10809 13 | @ModifyVariable(method = "doRender(Lnet/minecraft/entity/projectile/EntityFishHook;DDDFF)V", at = @At(value = "STORE", ordinal = 0)) 14 | private Vec3 patcher$flipFishingLine(Vec3 original) { 15 | if (PatcherConfig.leftHandInFirstPerson) { 16 | return new Vec3(-original.xCoord, original.yCoord, original.zCoord); 17 | } 18 | return original; 19 | } 20 | //#endif 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/network/NetHandlerPlayClientMixin_ChatDelay.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features.network; 2 | 3 | import club.sk1er.patcher.hooks.GuiNewChatHook; 4 | import net.minecraft.client.gui.GuiNewChat; 5 | import net.minecraft.client.network.NetHandlerPlayClient; 6 | import net.minecraft.network.play.server.S02PacketChat; 7 | import net.minecraft.util.IChatComponent; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Redirect; 11 | 12 | @Mixin(NetHandlerPlayClient.class) 13 | public class NetHandlerPlayClientMixin_ChatDelay { 14 | @Redirect( 15 | method = "handleChat", 16 | at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiNewChat;printChatMessage(Lnet/minecraft/util/IChatComponent;)V") 17 | ) 18 | private void patcher$handleChatDelay(GuiNewChat instance, IChatComponent message, S02PacketChat packetIn) { 19 | GuiNewChatHook.processChatMessage(packetIn, message); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/network/packet/C01PacketChatMessageMixin_ExtendedChatLength.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features.network.packet; 2 | 3 | import club.sk1er.patcher.asm.render.screen.GuiChatTransformer; 4 | import club.sk1er.patcher.config.PatcherConfig; 5 | import net.minecraft.network.play.client.C01PacketChatMessage; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.Constant; 8 | import org.spongepowered.asm.mixin.injection.ModifyConstant; 9 | 10 | @Mixin(C01PacketChatMessage.class) 11 | public class C01PacketChatMessageMixin_ExtendedChatLength { 12 | //#if MC==10809 13 | @ModifyConstant(method = {"(Ljava/lang/String;)V", "readPacketData"}, constant = @Constant(intValue = 100)) 14 | private int patcher$useExtendedChatLength(int original) { 15 | return PatcherConfig.extendedChatLength ? GuiChatTransformer.maxChatLength : original; 16 | } 17 | //#endif 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/network/packet/S2EPacketCloseWindowMixin_NoCloseMyChat.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features.network.packet; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.gui.GuiChat; 5 | import net.minecraft.network.play.INetHandlerPlayClient; 6 | import net.minecraft.network.play.server.S2EPacketCloseWindow; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | 12 | @Mixin(S2EPacketCloseWindow.class) 13 | public class S2EPacketCloseWindowMixin_NoCloseMyChat { 14 | @Inject(method = "processPacket(Lnet/minecraft/network/play/INetHandlerPlayClient;)V", at = @At("HEAD"), cancellable = true) 15 | private void patcher$noCloseMyChat(INetHandlerPlayClient handler, CallbackInfo ci) { 16 | if (Minecraft.getMinecraft().currentScreen instanceof GuiChat) { 17 | ci.cancel(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/optifine/GuiOverlayDebugMixin_SimplifyFpsCounter.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features.optifine; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.gui.GuiOverlayDebug; 5 | import org.spongepowered.asm.mixin.Dynamic; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.ModifyArg; 9 | 10 | @Mixin(GuiOverlayDebug.class) 11 | public class GuiOverlayDebugMixin_SimplifyFpsCounter { 12 | @Dynamic("OptiFine") 13 | @ModifyArg(method = "call", at = @At(value = "INVOKE", target = "Ljava/lang/StringBuffer;insert(ILjava/lang/String;)Ljava/lang/StringBuffer;", remap = false)) 14 | private String patcher$simplifyFpsCounter(String original) { 15 | return original.startsWith("/") && PatcherConfig.normalFpsCounter ? "" : original; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/optifine/GuiOverlayDebugMixin_VanillaMetricsRenderer.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features.optifine; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.gui.GuiOverlayDebug; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.Shadow; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Redirect; 9 | 10 | @Mixin(GuiOverlayDebug.class) 11 | public abstract class GuiOverlayDebugMixin_VanillaMetricsRenderer { 12 | 13 | @Shadow 14 | protected abstract void renderLagometer(); 15 | 16 | @Redirect(method = "renderDebugInfo", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiOverlayDebug;renderLagometer()V")) 17 | private void patcher$useVanillaMetricsRenderer(GuiOverlayDebug instance) { 18 | if (!PatcherConfig.useVanillaMetricsRenderer) { 19 | this.renderLagometer(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/features/render/item/ItemRendererMixin_RemoveWaterOverlay.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.features.render.item; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.renderer.ItemRenderer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(ItemRenderer.class) 11 | public class ItemRendererMixin_RemoveWaterOverlay { 12 | @Inject(method = "renderWaterOverlayTexture", at = @At("HEAD"), cancellable = true) 13 | private void patcher$removeWaterOverlay(CallbackInfo ci) { 14 | if (PatcherConfig.removeWaterOverlay) { 15 | ci.cancel(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/AnvilChunkLoaderMixin_UnclosedStream.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | import net.minecraft.nbt.CompressedStreamTools; 4 | import net.minecraft.nbt.NBTTagCompound; 5 | import net.minecraft.world.chunk.storage.AnvilChunkLoader; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Redirect; 9 | 10 | import java.io.DataInputStream; 11 | import java.io.IOException; 12 | 13 | @Mixin(AnvilChunkLoader.class) 14 | public class AnvilChunkLoaderMixin_UnclosedStream { 15 | // Local Capture misses this variable, so we have to resort to a Redirect. 16 | @Redirect( 17 | method = "loadChunk__Async", 18 | at = @At(value = "INVOKE", target = "Lnet/minecraft/nbt/CompressedStreamTools;read(Ljava/io/DataInputStream;)Lnet/minecraft/nbt/NBTTagCompound;") 19 | ) 20 | private NBTTagCompound patcher$closeStream(DataInputStream stream) throws IOException { 21 | NBTTagCompound result = CompressedStreamTools.read(stream); 22 | stream.close(); 23 | return result; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/BlockRedstoneTorchMixin_MemoryLeak.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | import net.minecraft.block.BlockRedstoneTorch; 4 | import net.minecraft.world.World; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.Shadow; 7 | 8 | import java.util.List; 9 | import java.util.Map; 10 | import java.util.WeakHashMap; 11 | 12 | @Mixin(BlockRedstoneTorch.class) 13 | public class BlockRedstoneTorchMixin_MemoryLeak { 14 | //#if MC==10809 15 | @Shadow private static Map> toggles = new WeakHashMap<>(); 16 | //#endif 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/ChunkMixin_Optimization.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | import club.sk1er.patcher.hooks.ChunkHook; 4 | import net.minecraft.block.state.IBlockState; 5 | import net.minecraft.util.BlockPos; 6 | import net.minecraft.world.chunk.Chunk; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.Overwrite; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.ModifyArg; 11 | 12 | @Mixin(Chunk.class) 13 | public class ChunkMixin_Optimization { 14 | @ModifyArg( 15 | method = "setBlockState", 16 | at = @At(value = "INVOKE", target = "Lnet/minecraft/world/chunk/Chunk;relightBlock(III)V", ordinal = 0), 17 | index = 1 18 | ) 19 | private int patcher$subtractOneFromY(int y) { 20 | return y - 1; 21 | } 22 | 23 | /** 24 | * @author LlamaLad7 25 | * @reason Optimization 26 | */ 27 | @Overwrite 28 | public IBlockState getBlockState(BlockPos pos) { 29 | return ChunkHook.getBlockState((Chunk) (Object) this, pos); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/ChunkMixin_TileEntityUnload.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | import club.sk1er.patcher.ducks.WorldExt; 4 | import com.google.common.collect.Iterators; 5 | import net.minecraft.world.World; 6 | import net.minecraft.world.chunk.Chunk; 7 | import org.spongepowered.asm.mixin.Final; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.Shadow; 10 | import org.spongepowered.asm.mixin.injection.At; 11 | import org.spongepowered.asm.mixin.injection.Redirect; 12 | 13 | import java.util.Collection; 14 | import java.util.Iterator; 15 | 16 | @Mixin(Chunk.class) 17 | public class ChunkMixin_TileEntityUnload { 18 | //#if MC==10809 19 | @Shadow 20 | @Final 21 | private World worldObj; 22 | 23 | @Redirect(method = "onChunkUnload", at = @At(value = "INVOKE", target = "Ljava/util/Collection;iterator()Ljava/util/Iterator;", ordinal = 0)) 24 | private Iterator patcher$unloadTileEntity(Collection instance) { 25 | ((WorldExt) this.worldObj).patcher$markTileEntitiesInChunkForRemoval((Chunk)(Object)this); 26 | return Iterators.emptyIterator(); 27 | } 28 | //#endif 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/EntityMixin_Capability.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | import net.minecraft.entity.Entity; 4 | import net.minecraft.util.EnumFacing; 5 | import net.minecraftforge.common.capabilities.Capability; 6 | import net.minecraftforge.common.capabilities.CapabilityDispatcher; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.Overwrite; 9 | import org.spongepowered.asm.mixin.Shadow; 10 | 11 | @Mixin(Entity.class) 12 | public class EntityMixin_Capability { 13 | 14 | //#if MC==10809 15 | @Shadow(remap = false) private CapabilityDispatcher capabilities; 16 | 17 | /** 18 | * @author asbyth 19 | * @reason Faster capability check 20 | */ 21 | @Overwrite(remap = false) 22 | public boolean hasCapability(Capability capability, EnumFacing direction) { 23 | return this.capabilities != null && this.capabilities.hasCapability(capability, direction); 24 | } 25 | //#endif 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/EntityOtherPlayerMPMixin_UselessAnimations.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | import net.minecraft.client.entity.EntityOtherPlayerMP; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 8 | 9 | @Mixin(EntityOtherPlayerMP.class) 10 | public class EntityOtherPlayerMPMixin_UselessAnimations { 11 | @Inject(method = "onLivingUpdate", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/entity/EntityOtherPlayerMP;updateArmSwingProgress()V", shift = At.Shift.AFTER), cancellable = true) 12 | private void patcher$removeUselessAnimations(CallbackInfo ci) { 13 | ci.cancel(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/EntityRendererMixin_CancelLightmapBuild.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.renderer.EntityRenderer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.Unique; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(EntityRenderer.class) 12 | public class EntityRendererMixin_CancelLightmapBuild { 13 | 14 | @Unique 15 | private boolean patcher$createdLightmap; 16 | 17 | @Inject(method = "updateLightmap", at = @At("HEAD"), cancellable = true) 18 | private void patcher$cancelLightmapBuild(CallbackInfo ci) { 19 | if (PatcherConfig.fullbright && this.patcher$createdLightmap) { 20 | ci.cancel(); 21 | } 22 | } 23 | 24 | @Inject(method = "updateLightmap", at = @At(value = "INVOKE", target = "Lnet/minecraft/profiler/Profiler;endSection()V")) 25 | private void patcher$setCreatedLightmap(CallbackInfo ci) { 26 | this.patcher$createdLightmap = true; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/EntityRendererMixin_SkipTwitchRendering.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | import net.minecraft.client.renderer.EntityRenderer; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 8 | 9 | @Mixin(EntityRenderer.class) 10 | public class EntityRendererMixin_SkipTwitchRendering { 11 | //#if MC==10809 12 | @Inject(method = "renderStreamIndicator", at = @At("HEAD"), cancellable = true) 13 | private void patcher$cancelStreamIndicator(CallbackInfo ci) { 14 | ci.cancel(); 15 | } 16 | //#endif 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/GameRulesValueMixin_Optimization.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.Shadow; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 8 | 9 | import java.util.Objects; 10 | 11 | @Mixin(targets = "net.minecraft.world.GameRules$Value") 12 | public class GameRulesValueMixin_Optimization { 13 | @Shadow private String valueString; 14 | 15 | @Inject(method = "setValue(Ljava/lang/String;)V", at = @At("HEAD"), cancellable = true) 16 | private void patcher$cancelIfUnchanged(String value, CallbackInfo ci) { 17 | if (Objects.equals(this.valueString, value)) { 18 | ci.cancel(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/LoadingScreenRendererMixin_SkipProgress.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.LoadingScreenRenderer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(LoadingScreenRenderer.class) 11 | public class LoadingScreenRendererMixin_SkipProgress { 12 | @Inject(method = "setLoadingProgress", at = @At("HEAD"), cancellable = true) 13 | private void patcher$skipProgress(int progress, CallbackInfo ci) { 14 | if (progress < 0 || PatcherConfig.optimizedWorldSwapping) { 15 | ci.cancel(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/MinecraftMixin_OptimizedWorldSwapping.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.Minecraft; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Redirect; 8 | 9 | @Mixin(Minecraft.class) 10 | public class MinecraftMixin_OptimizedWorldSwapping { 11 | @Redirect( 12 | method = "loadWorld(Lnet/minecraft/client/multiplayer/WorldClient;Ljava/lang/String;)V", 13 | at = @At(value = "INVOKE", target = "Ljava/lang/System;gc()V") 14 | ) 15 | private void patcher$optimizedWorldSwapping() { 16 | if (!PatcherConfig.optimizedWorldSwapping) { 17 | System.gc(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/MinecraftMixin_SkipTwitchStuff.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | //#if MC==10809 4 | import net.minecraft.client.stream.IStream; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Redirect; 7 | //#endif 8 | import net.minecraft.client.Minecraft; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | 11 | @Mixin(Minecraft.class) 12 | public class MinecraftMixin_SkipTwitchStuff { 13 | //#if MC==10809 14 | @Redirect( 15 | method = "runGameLoop", 16 | at = @At(value = "INVOKE", target = "Lnet/minecraft/client/stream/IStream;func_152935_j()V") 17 | ) 18 | private void patcher$skipTwitchCode1(IStream instance) { 19 | // No-op 20 | } 21 | 22 | @Redirect( 23 | method = "runGameLoop", 24 | at = @At(value = "INVOKE", target = "Lnet/minecraft/client/stream/IStream;func_152922_k()V") 25 | ) 26 | private void patcher$skipTwitchCode2(IStream instance) { 27 | // No-op 28 | } 29 | //#endif 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/MinecraftMixin_ToggleGLErrorChecking.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.Shadow; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(Minecraft.class) 11 | public class MinecraftMixin_ToggleGLErrorChecking { 12 | 13 | @Shadow private boolean enableGLErrorChecking; 14 | 15 | @Inject(method = "startGame", at = @At("TAIL")) 16 | private void patcher$disableGlErrorChecking(CallbackInfo ci) { 17 | this.enableGLErrorChecking = false; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/MinecraftServerMixin_MemoryLeak.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | import io.netty.buffer.ByteBuf; 4 | import net.minecraft.server.MinecraftServer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.ModifyVariable; 8 | 9 | @Mixin(MinecraftServer.class) 10 | public class MinecraftServerMixin_MemoryLeak { 11 | @ModifyVariable( 12 | method = "addFaviconToStatusResponse", 13 | at = @At(value = "INVOKE", target = "Lnet/minecraft/network/ServerStatusResponse;setFavicon(Ljava/lang/String;)V", shift = At.Shift.AFTER), 14 | ordinal = 1 15 | ) 16 | private ByteBuf patcher$releaseByteBuf(ByteBuf buf1) { 17 | buf1.release(); 18 | return buf1; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/NBTTagStringMixin_DataCache.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | import net.minecraft.nbt.NBTTagString; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.Overwrite; 6 | import org.spongepowered.asm.mixin.Shadow; 7 | import org.spongepowered.asm.mixin.Unique; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | 12 | @Mixin(NBTTagString.class) 13 | public class NBTTagStringMixin_DataCache { 14 | 15 | @Shadow private String data; 16 | @Unique private String patcher$dataCache; 17 | 18 | @Inject(method = "read", at = @At("HEAD")) 19 | private void patcher$emptyDataCache(CallbackInfo ci) { 20 | this.patcher$dataCache = null; 21 | } 22 | 23 | /** 24 | * @author asbyth 25 | * @reason Utilize data cache 26 | */ 27 | @Overwrite(remap = false) 28 | public String toString() { 29 | if (this.patcher$dataCache == null) { 30 | this.patcher$dataCache = "\"" + this.data.replace("\"", "\\\"") + "\""; 31 | } 32 | 33 | return this.patcher$dataCache; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/NetHandlerPlayClientMixin_InstantDimensionSwapping.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | import net.minecraft.client.gui.GuiScreen; 4 | import net.minecraft.client.network.NetHandlerPlayClient; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.ModifyArg; 8 | 9 | @Mixin(NetHandlerPlayClient.class) 10 | public class NetHandlerPlayClientMixin_InstantDimensionSwapping { 11 | @ModifyArg( 12 | method = {"handleJoinGame", "handleRespawn"}, 13 | at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;displayGuiScreen(Lnet/minecraft/client/gui/GuiScreen;)V") 14 | ) 15 | private GuiScreen patcher$skipTerrainScreen(GuiScreen original) { 16 | return null; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/NodeProcessorMixin_MemoryLeak.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | import net.minecraft.world.IBlockAccess; 4 | import org.spongepowered.asm.mixin.Shadow; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 8 | import net.minecraft.world.pathfinder.NodeProcessor; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | 11 | @Mixin(NodeProcessor.class) 12 | public class NodeProcessorMixin_MemoryLeak { 13 | 14 | //#if MC==10809 15 | @Shadow protected IBlockAccess blockaccess; 16 | 17 | @Inject(method = "postProcess", at = @At("HEAD")) 18 | private void patcher$cleanupBlockAccess(CallbackInfo ci) { 19 | this.blockaccess = null; 20 | } 21 | //#endif 22 | } 23 | 24 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/RenderEntityItemMixin_EntityCulling.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | import club.sk1er.patcher.util.world.render.culling.EntityCulling; 4 | import net.minecraft.client.renderer.entity.RenderEntityItem; 5 | import net.minecraft.entity.item.EntityItem; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(RenderEntityItem.class) 12 | public class RenderEntityItemMixin_EntityCulling { 13 | @Inject(method = "doRender(Lnet/minecraft/entity/item/EntityItem;DDDFF)V", at = @At("HEAD"), cancellable = true) 14 | private void patcher$checkRenderState(EntityItem entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { 15 | if (EntityCulling.renderItem(entity)) { 16 | ci.cancel(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/RenderGlobalMixin_LimitVisGraphScan.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | import club.sk1er.patcher.ducks.VisGraphExt; 4 | import net.minecraft.client.renderer.RenderGlobal; 5 | import net.minecraft.client.renderer.chunk.VisGraph; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.ModifyVariable; 9 | 10 | @Mixin(RenderGlobal.class) 11 | public class RenderGlobalMixin_LimitVisGraphScan { 12 | @ModifyVariable(method = "getVisibleFacings", name = "visgraph", at = @At(value = "STORE", ordinal = 0)) 13 | private VisGraph patcher$setLimitScan(VisGraph visgraph) { 14 | ((VisGraphExt) visgraph).patcher$setLimitScan(true); 15 | return visgraph; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/ResourcePackRepositoryMixin_FasterSearching.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import club.sk1er.patcher.hooks.ResourcePackRepositoryHook; 5 | import net.minecraft.client.resources.ResourcePackRepository; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(ResourcePackRepository.class) 12 | public class ResourcePackRepositoryMixin_FasterSearching { 13 | 14 | @Inject(method = "updateRepositoryEntriesAll", at = @At("HEAD"), cancellable = true) 15 | private void patcher$searchUsingSet(CallbackInfo ci) { 16 | if (PatcherConfig.labyModMoment) { 17 | // todo: move this hook into this class 18 | // the funky "repository.new Entry(file)" line has me stumped 19 | ResourcePackRepositoryHook.updateRepositoryEntriesAll((ResourcePackRepository) (Object) this); 20 | ci.cancel(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/TextureManagerMixin_MemoryLeak.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | import net.minecraft.client.renderer.texture.ITextureObject; 4 | import net.minecraft.client.renderer.texture.TextureManager; 5 | import net.minecraft.util.ResourceLocation; 6 | import org.spongepowered.asm.mixin.Final; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.Shadow; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 12 | 13 | import java.util.Map; 14 | 15 | @Mixin(TextureManager.class) 16 | public class TextureManagerMixin_MemoryLeak { 17 | //#if MC==10809 18 | @Shadow 19 | @Final 20 | private Map mapTextureObjects; 21 | 22 | @Inject(method = "deleteTexture", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/texture/TextureUtil;deleteTexture(I)V", shift = At.Shift.BEFORE)) 23 | private void patcher$removeEntry(ResourceLocation textureLocation, CallbackInfo ci) { 24 | this.mapTextureObjects.remove(textureLocation); 25 | } 26 | //#endif 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/TileEntityRendererDispatcherMixin_RemoveInvalidEntities.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; 4 | import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; 5 | import net.minecraft.tileentity.TileEntity; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Overwrite; 8 | import org.spongepowered.asm.mixin.Shadow; 9 | 10 | @Mixin(value = TileEntityRendererDispatcher.class, priority = 100) 11 | public abstract class TileEntityRendererDispatcherMixin_RemoveInvalidEntities { 12 | 13 | //#if MC==10809 14 | @Shadow 15 | public abstract TileEntitySpecialRenderer getSpecialRendererByClass(Class teClass); 16 | 17 | /** 18 | * @author MicrocontrollersDev and Wyvest 19 | * @reason Remove invalid tile entities from being rendered 20 | */ 21 | @Overwrite 22 | public TileEntitySpecialRenderer getSpecialRenderer(TileEntity tileEntityIn) { 23 | return tileEntityIn != null && !tileEntityIn.isInvalid() ? this.getSpecialRendererByClass(tileEntityIn.getClass()) : null; 24 | } 25 | //#endif 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/WorldClientMixin_AnimationTick.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.client.multiplayer.WorldClient; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.Constant; 7 | import org.spongepowered.asm.mixin.injection.ModifyConstant; 8 | 9 | @Mixin(WorldClient.class) 10 | public class WorldClientMixin_AnimationTick { 11 | @ModifyConstant(method = "doVoidFogParticles", constant = @Constant(intValue = 1000)) 12 | private int patcher$lowerTickCount(int original) { 13 | return PatcherConfig.lowAnimationTick ? 100 : original; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/forge/FluidRegistryMixin_Optimization.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance.forge; 2 | 3 | import net.minecraftforge.fluids.Fluid; 4 | import net.minecraftforge.fluids.FluidRegistry; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.Overwrite; 7 | import org.spongepowered.asm.mixin.Shadow; 8 | 9 | import java.util.Collections; 10 | import java.util.Set; 11 | 12 | @Mixin(FluidRegistry.class) 13 | public class FluidRegistryMixin_Optimization { 14 | //#if MC==10809 15 | @Shadow(remap = false) static Set bucketFluids; 16 | 17 | /** 18 | * @author LlamaLad7 19 | * @reason Avoid making a copy of the set. 20 | */ 21 | @Overwrite(remap = false) 22 | public static Set getBucketFluids() { 23 | return Collections.unmodifiableSet(bucketFluids); 24 | } 25 | //#endif 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/forge/ForgeBlockStateV1Mixin_OptimizeTransforms.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance.forge; 2 | 3 | import club.sk1er.patcher.hooks.TRSRTransformationHook; 4 | //#if MC==10809 5 | import net.minecraft.client.resources.model.ModelRotation; 6 | //#endif 7 | import net.minecraftforge.client.model.ForgeBlockStateV1; 8 | //#if MC==10809 9 | import net.minecraftforge.client.model.TRSRTransformation; 10 | //#endif 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Redirect; 14 | 15 | @Mixin(value = ForgeBlockStateV1.Variant.Deserializer.class, remap = false) 16 | public class ForgeBlockStateV1Mixin_OptimizeTransforms { 17 | //#if MC==10809 18 | @Redirect(method = "deserialize(Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lnet/minecraftforge/client/model/ForgeBlockStateV1$Variant;", at = @At(value = "NEW", target = "net/minecraftforge/client/model/TRSRTransformation")) 19 | private TRSRTransformation patcher$from(ModelRotation rotation) { 20 | return TRSRTransformationHook.from(rotation); 21 | } 22 | //#endif 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/forge/ForgeHooksClientMixin_OptimizeTransforms.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance.forge; 2 | 3 | import club.sk1er.patcher.hooks.TRSRTransformationHook; 4 | import net.minecraft.client.renderer.block.model.ItemTransformVec3f; 5 | import net.minecraftforge.client.ForgeHooksClient; 6 | //#if MC==10809 7 | import net.minecraftforge.client.model.TRSRTransformation; 8 | //#endif 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.injection.At; 11 | import org.spongepowered.asm.mixin.injection.Redirect; 12 | 13 | @Mixin(value = ForgeHooksClient.class, remap = false) 14 | public abstract class ForgeHooksClientMixin_OptimizeTransforms { 15 | //#if MC==10809 16 | @SuppressWarnings("deprecation") 17 | @Redirect(method = "applyTransform(Lnet/minecraft/client/renderer/block/model/ItemTransformVec3f;Lcom/google/common/base/Optional;)Lcom/google/common/base/Optional;", at = @At(value = "NEW", target = "net/minecraftforge/client/model/TRSRTransformation")) 18 | private static TRSRTransformation patcher$from(ItemTransformVec3f transform) { 19 | return TRSRTransformationHook.from(transform); 20 | } 21 | //#endif 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/forge/ModDiscovererMixin_Logging.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance.forge; 2 | 3 | import club.sk1er.patcher.util.forge.EntrypointCaching; 4 | import net.minecraftforge.fml.common.ModContainer; 5 | import net.minecraftforge.fml.common.discovery.ModDiscoverer; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Unique; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 11 | 12 | import java.util.List; 13 | 14 | @Mixin(value = ModDiscoverer.class, remap = false) 15 | public class ModDiscovererMixin_Logging { 16 | @Unique 17 | private long patcher$time; 18 | 19 | @Inject(method = "identifyMods", at = @At("HEAD")) 20 | private void patcher$logStart(CallbackInfoReturnable> cir) { 21 | patcher$time = System.currentTimeMillis(); 22 | } 23 | 24 | @Inject(method = "identifyMods", at = @At("TAIL")) 25 | private void patcher$logEnd(CallbackInfoReturnable> cir) { 26 | EntrypointCaching.INSTANCE.logger.info("ModDiscoverer.identifyMods took " + (System.currentTimeMillis() - patcher$time) + "ms"); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/forge/OBJModelMixin_UnclosedStreams.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance.forge; 2 | 3 | import net.minecraft.client.resources.IResourceManager; 4 | import net.minecraft.util.ResourceLocation; 5 | import net.minecraftforge.client.model.obj.OBJModel; 6 | import org.apache.commons.io.IOUtils; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.Shadow; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 12 | 13 | import java.io.BufferedReader; 14 | import java.io.InputStreamReader; 15 | 16 | @Mixin(value = OBJModel.MaterialLibrary.class, remap = false) 17 | public class OBJModelMixin_UnclosedStreams { 18 | //#if MC==10809 19 | @Shadow 20 | private BufferedReader mtlReader; 21 | @Shadow 22 | private InputStreamReader mtlStream; 23 | 24 | @Inject(method = "parseMaterials", at = @At("TAIL")) 25 | private void patcher$fixMemoryLeak(IResourceManager manager, String path, ResourceLocation from, CallbackInfo ci) { 26 | IOUtils.closeQuietly(this.mtlReader); 27 | IOUtils.closeQuietly(this.mtlStream); 28 | } 29 | //#endif 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/hudcaching/FramebufferMixin_HUDCaching.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance.hudcaching; 2 | 3 | import club.sk1er.patcher.screen.render.caching.HUDCaching; 4 | import net.minecraft.client.Minecraft; 5 | import net.minecraft.client.shader.Framebuffer; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(Framebuffer.class) 12 | public class FramebufferMixin_HUDCaching { 13 | 14 | @Inject(method = "bindFramebuffer", at = @At("HEAD"), cancellable = true) 15 | public void patcher$bindHUDCachingBuffer(boolean viewport, CallbackInfo ci) { 16 | final Framebuffer framebuffer = (Framebuffer) (Object) this; 17 | if (HUDCaching.renderingCacheOverride && framebuffer == Minecraft.getMinecraft().getFramebuffer()) { 18 | HUDCaching.hudFramebuffer.bindFramebuffer(viewport); 19 | //HUDCaching.screenFramebuffer.bindFramebuffer(viewport); 20 | ci.cancel(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/network/packet/C17PacketCustomPayloadMixin_MemoryLeak.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance.network.packet; 2 | 3 | import net.minecraft.network.PacketBuffer; 4 | import net.minecraft.network.play.INetHandlerPlayServer; 5 | import net.minecraft.network.play.client.C17PacketCustomPayload; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Shadow; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | 12 | @Mixin(C17PacketCustomPayload.class) 13 | public class C17PacketCustomPayloadMixin_MemoryLeak { 14 | //#if MC==10809 15 | @Shadow private PacketBuffer data; 16 | 17 | @Inject(method = "processPacket(Lnet/minecraft/network/play/INetHandlerPlayServer;)V", at = @At("TAIL")) 18 | private void patcher$releaseData(INetHandlerPlayServer handler, CallbackInfo ci) { 19 | if (this.data != null) { 20 | this.data.release(); 21 | } 22 | } 23 | //#endif 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/network/packet/S3FPacketCustomPayloadMixin_MemoryLeak.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance.network.packet; 2 | 3 | import net.minecraft.network.PacketBuffer; 4 | import net.minecraft.network.play.INetHandlerPlayClient; 5 | import net.minecraft.network.play.server.S3FPacketCustomPayload; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Shadow; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | 12 | @Mixin(S3FPacketCustomPayload.class) 13 | public class S3FPacketCustomPayloadMixin_MemoryLeak { 14 | //#if MC==10809 15 | @Shadow private PacketBuffer data; 16 | 17 | @Inject(method = "processPacket(Lnet/minecraft/network/play/INetHandlerPlayClient;)V", at = @At("TAIL")) 18 | private void patcher$releaseData(INetHandlerPlayClient handler, CallbackInfo ci) { 19 | if (this.data != null) { 20 | this.data.release(); 21 | } 22 | } 23 | //#endif 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/mixins/performance/optifine/MathHelperMixin_OFFastMath.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.mixins.performance.optifine; 2 | 3 | import me.jellysquid.mods.lithium.common.util.math.CompactSineLUT; 4 | import net.minecraft.util.MathHelper; 5 | import org.spongepowered.asm.mixin.*; 6 | 7 | @Mixin(MathHelper.class) 8 | public class MathHelperMixin_OFFastMath { 9 | 10 | @Dynamic("OptiFine") 11 | @Shadow(remap = false) 12 | private static float[] SIN_TABLE_FAST; 13 | 14 | @Dynamic("OptiFine") 15 | @Shadow(remap = false) 16 | private static float radToIndex; 17 | 18 | @Dynamic("OptiFine") 19 | @Shadow(remap = false) 20 | public static boolean fastMath; 21 | 22 | /** 23 | * @author Wyvest 24 | * @reason Use a compact LUT for sine calculations 25 | */ 26 | @Overwrite 27 | public static float sin(float f) { 28 | return fastMath ? SIN_TABLE_FAST[(int)(f * radToIndex) & 4095] : CompactSineLUT.sin(f); 29 | } 30 | 31 | /** 32 | * @author Wyvest 33 | * @reason Use a compact LUT for cosine calculations 34 | */ 35 | @Overwrite 36 | public static float cos(float f) { 37 | return fastMath ? SIN_TABLE_FAST[(int)(f * radToIndex + 1024.0F) & 4095] : CompactSineLUT.cos(f); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/optifine/OptiFineFontRendererHandler.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.optifine; 2 | 3 | import club.sk1er.patcher.Patcher; 4 | import club.sk1er.patcher.mixins.accessors.optifine.ConfigAccessor; 5 | import club.sk1er.patcher.mixins.accessors.optifine.CustomColorsAccessor; 6 | import club.sk1er.patcher.tweaker.ClassTransformer; 7 | 8 | public class OptiFineFontRendererHandler { 9 | private static boolean caughtError = false; 10 | public static int getTextColor(int index, int originalColor) { 11 | if (caughtError) return originalColor; 12 | try { 13 | if (ClassTransformer.optifineVersion.equals("NONE")) { 14 | return originalColor; 15 | } 16 | if (ConfigAccessor.invokeIsCustomColors()) { 17 | return CustomColorsAccessor.invokeGetTextColor(index, originalColor); 18 | } 19 | return originalColor; 20 | } catch (Throwable t) { 21 | caughtError = true; 22 | Patcher.instance.getLogger().error("Unable to get OptiFine's Custom Color", t); 23 | return originalColor; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/optifine/OptiFineGenerations.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.optifine; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.util.HashSet; 6 | import java.util.Set; 7 | 8 | public class OptiFineGenerations { 9 | @SerializedName("iGeneration") 10 | private final Set iGeneration = new HashSet<>(1); 11 | 12 | @SerializedName("lGeneration") 13 | private final Set lGeneration = new HashSet<>(2); 14 | 15 | @SerializedName("mGeneration") 16 | private final Set mGeneration = new HashSet<>(); 17 | 18 | // 1.12 19 | @SerializedName("gGeneration") 20 | private final Set gGeneration = new HashSet<>(); 21 | 22 | @SerializedName("futureGeneration") 23 | private final Set futureGeneration = new HashSet<>(); 24 | 25 | public Set getIGeneration() { 26 | return iGeneration; 27 | } 28 | 29 | public Set getLGeneration() { 30 | return lGeneration; 31 | } 32 | 33 | public Set getMGeneration() { 34 | return mGeneration; 35 | } 36 | 37 | public Set getGGeneration() { 38 | return gGeneration; 39 | } 40 | 41 | public Set getFutureGeneration() { 42 | return futureGeneration; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/screen/FakeMultiplayerMenu.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.screen; 2 | 3 | import club.sk1er.patcher.mixins.accessors.GuiMultiplayerAccessor; 4 | import net.minecraft.client.gui.GuiMainMenu; 5 | import net.minecraft.client.gui.GuiMultiplayer; 6 | import net.minecraft.client.gui.GuiScreen; 7 | 8 | public class FakeMultiplayerMenu extends GuiMultiplayer { 9 | public FakeMultiplayerMenu(GuiScreen parentScreen) { 10 | super(parentScreen); 11 | } 12 | 13 | @Override 14 | public void connectToSelected() { 15 | this.performDisconnection(); 16 | super.connectToSelected(); 17 | } 18 | 19 | public void performDisconnection() { 20 | if (this.mc.theWorld != null) { 21 | this.mc.theWorld.sendQuittingDisconnectingPacket(); 22 | this.mc.loadWorld(null); 23 | this.mc.displayGuiScreen(null); 24 | ((GuiMultiplayerAccessor) this).setParentScreen(new GuiMultiplayer(new GuiMainMenu())); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/screen/ResolutionHelper.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.screen; 2 | 3 | public class ResolutionHelper { 4 | private static int currentScaleOverride = -1; 5 | private static int scaleOverride = -1; 6 | 7 | public static int getCurrentScaleOverride() { 8 | return currentScaleOverride; 9 | } 10 | 11 | public static void setCurrentScaleOverride(int currentScaleOverride) { 12 | ResolutionHelper.currentScaleOverride = currentScaleOverride; 13 | } 14 | 15 | public static int getScaleOverride() { 16 | return scaleOverride; 17 | } 18 | 19 | public static void setScaleOverride(int scaleOverride) { 20 | ResolutionHelper.scaleOverride = scaleOverride; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/screen/render/title/TitleFix.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.screen.render.title; 2 | 3 | import club.sk1er.patcher.mixins.accessors.GuiIngameAccessor; 4 | import net.minecraft.client.Minecraft; 5 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 6 | import net.minecraftforge.fml.common.network.FMLNetworkEvent; 7 | 8 | public class TitleFix { 9 | 10 | @SubscribeEvent 11 | public void disconnectEvent(FMLNetworkEvent.ClientDisconnectionFromServerEvent event) { 12 | GuiIngameAccessor gui = (GuiIngameAccessor) Minecraft.getMinecraft().ingameGUI; 13 | 14 | // these are never cleared when logging out of a server while displaying a title or subtitle, 15 | // so clear these if they're not already cleared when leaving the server. 16 | if (!gui.getDisplayedTitle().isEmpty()) gui.setDisplayedTitle(""); 17 | if (!gui.getDisplayedSubTitle().isEmpty()) gui.setDisplayedSubTitle(""); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/tweaker/PatcherClassWriter.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.tweaker; 2 | 3 | import org.objectweb.asm.ClassReader; 4 | import org.objectweb.asm.ClassWriter; 5 | import org.spongepowered.asm.mixin.transformer.ClassInfo; 6 | 7 | public class PatcherClassWriter extends ClassWriter { 8 | public PatcherClassWriter(int flags) { 9 | super(flags); 10 | } 11 | 12 | public PatcherClassWriter(ClassReader classReader, int flags) { 13 | super(classReader, flags); 14 | } 15 | 16 | @Override 17 | protected String getCommonSuperClass(String type1, String type2) { 18 | return ClassInfo.getCommonSuperClass(type1, type2).getName(); 19 | } 20 | } -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/tweaker/other/ModTweaker.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.tweaker.other; 2 | 3 | import net.minecraftforge.common.ForgeVersion; 4 | import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; 5 | 6 | import java.util.Map; 7 | 8 | @IFMLLoadingPlugin.SortingIndex(1001) 9 | @IFMLLoadingPlugin.MCVersion(ForgeVersion.mcVersion) 10 | @SuppressWarnings("unused") 11 | public class ModTweaker implements IFMLLoadingPlugin { 12 | 13 | @Override 14 | public String[] getASMTransformerClass() { 15 | return new String[]{ModClassTransformer.class.getName()}; 16 | } 17 | 18 | @Override 19 | public String getModContainerClass() { 20 | return null; 21 | } 22 | 23 | @Override 24 | public String getSetupClass() { 25 | return null; 26 | } 27 | 28 | @Override 29 | public void injectData(Map data) { 30 | } 31 | 32 | @Override 33 | public String getAccessTransformerClass() { 34 | return null; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/util/animation/EaseOutQuart.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.util.animation; 2 | 3 | import cc.polyfrost.oneconfig.gui.animations.Animation; 4 | import net.minecraft.client.Minecraft; 5 | 6 | public class EaseOutQuart extends Animation { 7 | 8 | public long startTime; 9 | 10 | public EaseOutQuart(float duration, float start, float end, boolean reverse) { 11 | super(duration, start, end, reverse); 12 | startTime = Minecraft.getSystemTime(); 13 | } 14 | 15 | @Override 16 | public float get() { 17 | timePassed = (float) (Minecraft.getSystemTime() - startTime); 18 | if (timePassed >= duration) return start + change; 19 | return animate(timePassed / duration) * change + start; 20 | } 21 | 22 | @Override 23 | protected float animate(float x) { 24 | return -1 * (x - 1) * (x - 1) * (x - 1) * (x - 1) + 1; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/util/chat/ChatComponentIgnored.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.util.chat; 2 | 3 | import net.minecraft.util.ChatComponentText; 4 | 5 | public class ChatComponentIgnored extends ChatComponentText { 6 | public ChatComponentIgnored(String msg) { 7 | super(msg); 8 | } 9 | 10 | @Override 11 | public int hashCode() { 12 | return 0; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/util/enhancement/Enhancement.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.util.enhancement; 2 | 3 | import java.util.concurrent.LinkedBlockingQueue; 4 | import java.util.concurrent.ThreadPoolExecutor; 5 | import java.util.concurrent.TimeUnit; 6 | import java.util.concurrent.atomic.AtomicInteger; 7 | 8 | public interface Enhancement { 9 | 10 | AtomicInteger counter = new AtomicInteger(0); 11 | ThreadPoolExecutor POOL = new ThreadPoolExecutor(50, 50, 12 | 0L, TimeUnit.SECONDS, 13 | new LinkedBlockingQueue<>(), 14 | r -> new Thread(r, String.format("Patcher Concurrency Thread %s", counter.incrementAndGet()))); 15 | 16 | String getName(); 17 | 18 | default void tick() { 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/util/enhancement/EnhancementManager.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.util.enhancement; 2 | 3 | import club.sk1er.patcher.util.enhancement.text.EnhancedFontRenderer; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | public class EnhancementManager { 9 | 10 | private static final EnhancementManager instance = new EnhancementManager(); 11 | private final Map, Enhancement> enhancementMap = new HashMap<>(); 12 | 13 | public EnhancementManager() { 14 | enhancementMap.put(EnhancedFontRenderer.class, new EnhancedFontRenderer()); 15 | } 16 | 17 | public void tick() { 18 | for (Map.Entry, Enhancement> entry : enhancementMap.entrySet()) { 19 | entry.getValue().tick(); 20 | } 21 | } 22 | 23 | @SuppressWarnings("unchecked") 24 | public T getEnhancement(Class enhancement) { 25 | return (T) enhancementMap.get(enhancement); 26 | } 27 | 28 | public static EnhancementManager getInstance() { 29 | return instance; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/util/enhancement/ReloadListener.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.util.enhancement; 2 | 3 | import club.sk1er.patcher.hooks.FontRendererHook; 4 | import club.sk1er.patcher.util.enhancement.text.EnhancedFontRenderer; 5 | import net.minecraft.client.resources.IResourceManager; 6 | import net.minecraft.client.resources.IResourceManagerReloadListener; 7 | 8 | public class ReloadListener implements IResourceManagerReloadListener { 9 | @Override 10 | public void onResourceManagerReload(IResourceManager resourceManager) { 11 | for (EnhancedFontRenderer enhancedFontRenderer : EnhancedFontRenderer.getInstances()) { 12 | enhancedFontRenderer.invalidateAll(); 13 | } 14 | 15 | FontRendererHook.forceRefresh = true; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/util/enhancement/hash/StringHash.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.util.enhancement.hash; 2 | 3 | import club.sk1er.patcher.util.enhancement.hash.impl.AbstractHash; 4 | 5 | public class StringHash extends AbstractHash { 6 | public StringHash(String text, float red, float green, float blue, float alpha, boolean shadow) { 7 | super(text, red, green, blue, alpha, shadow); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/util/keybind/FunctionKeyChanger.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.util.keybind; 2 | 3 | import net.minecraft.client.settings.KeyBinding; 4 | import org.lwjgl.input.Keyboard; 5 | 6 | public class FunctionKeyChanger { 7 | public static class KeybindHideScreen extends KeyBinding { 8 | public KeybindHideScreen() { 9 | super("Hide Screen", Keyboard.KEY_F1, "Patcher"); 10 | } 11 | } 12 | 13 | public static class KeybindCustomDebug extends KeyBinding { 14 | public KeybindCustomDebug() { 15 | super("Custom F3", Keyboard.KEY_F3, "Patcher"); 16 | } 17 | } 18 | 19 | public static class KeybindClearShaders extends KeyBinding { 20 | public KeybindClearShaders() { 21 | super("Clear Vanilla Shaders", Keyboard.KEY_F4, "Patcher"); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/util/keybind/KeycodeHelper.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.util.keybind; 2 | 3 | @SuppressWarnings("unused") 4 | public class KeycodeHelper { 5 | public static final int lessThanKeycode = 0xE0; // 224 seems to be an unassigned keycode, this needs to be < 256 since WindowsKeyboard:146 would otherwise decline the keycode 6 | public static final String lessThanName = "Foreign key"; 7 | 8 | public static int extraVirtualKeysWindows(int originalCode) { 9 | if (originalCode == 0xE2) return lessThanKeycode; // VK_OEM_102 10 | return originalCode; 11 | } 12 | 13 | public static String getKeyName(int key) { 14 | if (key == lessThanKeycode) return lessThanName; 15 | return null; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/util/world/render/FullbrightTicker.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.util.world.render; 2 | 3 | import club.sk1er.patcher.config.PatcherConfig; 4 | import net.minecraft.server.MinecraftServer; 5 | 6 | //#if MC==11202 7 | //$$ import net.minecraft.client.Minecraft; 8 | //$$ import net.minecraft.server.integrated.IntegratedServer; 9 | //#endif 10 | 11 | public class FullbrightTicker { 12 | 13 | public static boolean isFullbright() { 14 | //#if MC==10809 15 | MinecraftServer server = MinecraftServer.getServer(); 16 | //#else 17 | //$$ IntegratedServer server = Minecraft.getMinecraft().getIntegratedServer(); 18 | //#endif 19 | if (server != null && server.isCallingFromMinecraftThread()) { 20 | return false; 21 | } 22 | 23 | return PatcherConfig.fullbright; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/club/sk1er/patcher/util/world/render/culling/ParticleCulling.java: -------------------------------------------------------------------------------- 1 | package club.sk1er.patcher.util.world.render.culling; 2 | 3 | import club.sk1er.patcher.ducks.EntityFXExt; 4 | import net.minecraft.client.particle.EntityFX; 5 | import net.minecraft.client.renderer.culling.ICamera; 6 | 7 | public class ParticleCulling { 8 | 9 | public static ICamera camera; 10 | 11 | public static boolean shouldRender(EntityFX entityFX) { 12 | return entityFX != null && (camera == null || ((EntityFXExt) entityFX).patcher$getCullState() > -1); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/me/jellysquid/mods/hydrogen/common/dedup/IdentifierCaches.java: -------------------------------------------------------------------------------- 1 | package me.jellysquid.mods.hydrogen.common.dedup; 2 | 3 | public class IdentifierCaches { 4 | public static final DeduplicationCache NAMESPACES = new DeduplicationCache<>(); 5 | public static final DeduplicationCache PATH = new DeduplicationCache<>(); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/patcher/font_glyph_data.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Polyfrost/PolyPatcher/20fb4b2fb97974b3d522d91315c503c0a5e8e2de/src/main/resources/assets/patcher/font_glyph_data.bin -------------------------------------------------------------------------------- /src/main/resources/mcmod.info: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "modid": "${id}", 4 | "name": "${name}", 5 | "description": "A Forge mod full of Vanilla bug fixes, Quality of Life improvements, and performance enhancements.", 6 | "version": "${version}", 7 | "mcversion": "${mcVersionStr}", 8 | "url": "https://modrinth.com/mod/patcher", 9 | "updateUrl": "", 10 | "authorList": [ 11 | "Polyfrost", 12 | "Sk1er LLC" 13 | ], 14 | "credits": "prplz, 2pi, UserTeemu, DJtheRedstoner", 15 | "logoFile": "patcher.png", 16 | "screenshots": [], 17 | "dependencies": [] 18 | } 19 | ] 20 | -------------------------------------------------------------------------------- /src/main/resources/patcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Polyfrost/PolyPatcher/20fb4b2fb97974b3d522d91315c503c0a5e8e2de/src/main/resources/patcher.png -------------------------------------------------------------------------------- /src/main/resources/patcher.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/main/resources/patcher112_at.cfg: -------------------------------------------------------------------------------- 1 | # GlStateManager 2 | public net.minecraft.client.renderer.GlStateManager$Color 3 | public net.minecraft.client.renderer.GlStateManager$TextureState 4 | 5 | # ResourcePackRepository 6 | public net.minecraft.client.resources.ResourcePackRepository$Entry (Lnet/minecraft/client/resources/ResourcePackRepository;Ljava/io/File;)V # constructor 7 | 8 | # BannerTextures$CacheEntry 9 | public net.minecraft.client.renderer.BannerTextures$CacheEntry 10 | public net.minecraft.client.renderer.BannerTextures$CacheEntry ()V # constructor 11 | 12 | # BlockRedstoneTorch 13 | public net.minecraft.block.BlockRedstoneTorch$Toggle -------------------------------------------------------------------------------- /src/main/resources/patcher18_at.cfg: -------------------------------------------------------------------------------- 1 | # GlStateManager 2 | public net.minecraft.client.renderer.GlStateManager$Color 3 | public net.minecraft.client.renderer.GlStateManager$TextureState 4 | 5 | # ResourcePackRepository 6 | public net.minecraft.client.resources.ResourcePackRepository$Entry (Lnet/minecraft/client/resources/ResourcePackRepository;Ljava/io/File;)V # constructor 7 | 8 | # TileEntityBannerRenderer 9 | public net.minecraft.client.renderer.tileentity.TileEntityBannerRenderer$TimedBannerTexture 10 | public net.minecraft.client.renderer.tileentity.TileEntityBannerRenderer$TimedBannerTexture ()V # constructor 11 | 12 | # BlockRedstoneTorch 13 | public net.minecraft.block.BlockRedstoneTorch$Toggle 14 | 15 | # EnchantmentHelper 16 | public net.minecraft.enchantment.EnchantmentHelper$DamageIterator 17 | public net.minecraft.enchantment.EnchantmentHelper$HurtIterator 18 | public net.minecraft.enchantment.EnchantmentHelper$ModifierDamage 19 | public net.minecraft.enchantment.EnchantmentHelper$ModifierLiving -------------------------------------------------------------------------------- /versions/mainProject: -------------------------------------------------------------------------------- 1 | 1.8.9-forge --------------------------------------------------------------------------------