diff --git a/gradle.properties b/gradle.properties index c284e21aa..269e3fdbe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ mod_id=patcher # betas will be "1.x.x+beta-y" / "1.x.x+branch_beta-y" # rcs will be 1.x.x+rc-y # extra branches will be 1.x.x+branch-y -mod_version=1.8.8+beta-1 +mod_version=1.8.9+beta-1 # Sets the name of the jar file that you put in your 'mods' folder. mod_archives_name=Patcher (OneConfig) diff --git a/src/main/java/club/sk1er/patcher/config/PatcherConfig.java b/src/main/java/club/sk1er/patcher/config/PatcherConfig.java index 055dc2fa3..db8d38f75 100644 --- a/src/main/java/club/sk1er/patcher/config/PatcherConfig.java +++ b/src/main/java/club/sk1er/patcher/config/PatcherConfig.java @@ -593,6 +593,13 @@ public class PatcherConfig extends Config { ) public static boolean removeViewBobbing; + @Switch( + name = "Remove Vertical Bobbing", + description = "While using View Bobbing, remove the vertical bobbing like in 1.14+.", + category = "Miscellaneous", subcategory = "General" + ) + public static boolean removeVerticalViewBobbing; + @Switch( name = "Remove Map Bobbing", description = "While using View Bobbing, remove the hand bobbing when holding a map.", @@ -1241,9 +1248,16 @@ public static int getInventoryScale() { ) public static boolean safeChatClicks; + @Switch( + name = "Safe Chat Clicks History", + description = "Adds commands sent from clicking chat messages to the chat history.", + category = "Screens", subcategory = "Chat" + ) + public static boolean safeChatClicksHistory; + @Switch( name = "Smart Disconnect", - description = "Choose between disconnecting or relogging when clicking the disconnect button.", + description = "Choose between disconnecting or relogging when clicking the disconnect button.\n§eOnly works on Multiplayer servers.", category = "Screens", subcategory = "General" ) public static boolean smartDisconnect; diff --git a/src/main/java/club/sk1er/patcher/mixins/features/EntityRendererMixin_ViewBobbing.java b/src/main/java/club/sk1er/patcher/mixins/features/EntityRendererMixin_ViewBobbing.java index 1d04589fe..c2b2b032f 100644 --- a/src/main/java/club/sk1er/patcher/mixins/features/EntityRendererMixin_ViewBobbing.java +++ b/src/main/java/club/sk1er/patcher/mixins/features/EntityRendererMixin_ViewBobbing.java @@ -2,6 +2,7 @@ import club.sk1er.patcher.config.PatcherConfig; import club.sk1er.patcher.hooks.EntityRendererHook; +import gg.essential.lib.mixinextras.injector.WrapWithCondition; import net.minecraft.client.renderer.EntityRenderer; import net.minecraft.client.settings.GameSettings; import org.spongepowered.asm.mixin.Dynamic; @@ -25,4 +26,9 @@ public class EntityRendererMixin_ViewBobbing { private boolean patcher$viewBobbing(GameSettings instance) { return instance.viewBobbing && !PatcherConfig.removeViewBobbing; } + + @WrapWithCondition(method = "setupViewBobbing", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;rotate(FFFF)V", ordinal = 2)) + public boolean patcher$verticalViewBobbing(float angle, float x, float y, float z) { + return !PatcherConfig.removeVerticalViewBobbing; + } } diff --git a/src/main/java/club/sk1er/patcher/mixins/features/GuiChatMixin_SafeChatClicksHistory.java b/src/main/java/club/sk1er/patcher/mixins/features/GuiChatMixin_SafeChatClicksHistory.java new file mode 100644 index 000000000..89bbadc51 --- /dev/null +++ b/src/main/java/club/sk1er/patcher/mixins/features/GuiChatMixin_SafeChatClicksHistory.java @@ -0,0 +1,19 @@ +package club.sk1er.patcher.mixins.features; + +import club.sk1er.patcher.config.PatcherConfig; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.client.gui.GuiScreen; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.ModifyArg; + +@Mixin(GuiScreen.class) +public abstract class GuiChatMixin_SafeChatClicksHistory extends Gui { + + @ModifyArg(method = "handleComponentClick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiScreen;sendChatMessage(Ljava/lang/String;Z)V"), index = 1) + public boolean patcher$handleComponentClick(boolean addToChat) { + + return addToChat || (PatcherConfig.safeChatClicksHistory && ((Object) this) instanceof GuiChat); + } +} diff --git a/src/main/java/club/sk1er/patcher/screen/render/overlay/ImagePreview.java b/src/main/java/club/sk1er/patcher/screen/render/overlay/ImagePreview.java index 22a2f919f..b52cd4a00 100644 --- a/src/main/java/club/sk1er/patcher/screen/render/overlay/ImagePreview.java +++ b/src/main/java/club/sk1er/patcher/screen/render/overlay/ImagePreview.java @@ -74,6 +74,7 @@ private void handle(String value) { if (!found) return; } catch (MalformedURLException e) { + Patcher.instance.getLogger().error("Error during url lookup: " + value, e); return; } } diff --git a/src/main/resources/mixins.patcher.json b/src/main/resources/mixins.patcher.json index 3bec62132..0855307fc 100644 --- a/src/main/resources/mixins.patcher.json +++ b/src/main/resources/mixins.patcher.json @@ -133,6 +133,7 @@ "features.FontRenderMixin_ShadowTypes", "features.GuiAchievementMixin_CancelRender", "features.GuiChatMixin_ExtendedChatLength", + "features.GuiChatMixin_SafeChatClicksHistory", "features.GuiContainerMixin_ClickOutOfContainers", "features.GuiContainerMixin_DropModifierKey", "features.GuiIngameForgeMixin_ActionbarText",