Skip to content

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Mar 27, 2024
2 parents 9cc6ed8 + 4ce6e19 commit cf3159f
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
16 changes: 15 additions & 1 deletion src/main/java/club/sk1er/patcher/config/PatcherConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/mixins.patcher.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit cf3159f

Please sign in to comment.