Skip to content

Commit

Permalink
Implement status message height tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ACGaming committed Aug 6, 2023
1 parent 28ffbc3 commit 92c9bca
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ All changes are toggleable via the config file.
* **No Saddled Wandering:** Stops horses wandering around when saddled
* **No Smelting XP:** Disables the experience reward when smelting items in furnaces
* **Offhand Improvement:** Prevents placing offhand blocks when blocks or food are held in the mainhand
* **Overlay Message Height:** Sets the Y value of the overlay message (action bar), displayed for playing records etc.
* **Pickup Notification:** Displays highly configurable notifications when the player obtains or loses items
* **Player Speed:** Enables the modification of base and maximum player speeds along with fixing 'Player moved too quickly' messages
* **Rabbit Killer Spawning:** Configurable chance for rabbits to spawn as the killer bunny variant
Expand All @@ -155,6 +156,7 @@ All changes are toggleable via the config file.
* **Remove Recipe Book:** Removes the recipe book button from GUIs
* **Remove Snooper:** Forcefully turns off the snooper and hides the snooper settings button from the options menu
* **Sea Level:** Sets the default height of the overworld's sea level
* **Selected Item Tooltip Height:** Sets the Y value of the selected item tooltip, displayed when held items are changed
* **Shield Parry:** Allows parrying of projectiles with shields
* **Skip Credits:** Skips the credits screen after the player goes through the end podium portal
* **Skip Missing Registry Entries Screen:** Automatically confirms the 'Missing Registry Entries' screen on world load
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/mod/acgaming/universaltweaks/config/UTConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -1385,6 +1385,15 @@ public static class TweaksMiscCategory
@Config.Comment("Prevents placing offhand blocks when blocks or food are held in the mainhand")
public boolean utOffhandToggle = true;

@Config.RequiresMcRestart
@Config.Name("Overlay Message Height")
@Config.Comment
({
"Sets the Y value of the overlay message (action bar), displayed for playing records etc.",
"-4 for vanilla default"
})
public int utOverlayMessageHeight = -4;

@Config.RequiresMcRestart
@Config.Name("Remove Realms Button")
@Config.Comment
Expand All @@ -1404,6 +1413,15 @@ public static class TweaksMiscCategory
@Config.Comment("Forcefully turns off the snooper and hides the snooper settings button from the options menu")
public boolean utSnooperToggle = true;

@Config.RequiresMcRestart
@Config.Name("Selected Item Tooltip Height")
@Config.Comment
({
"Sets the Y value of the selected item tooltip, displayed when held items are changed",
"59 for vanilla default"
})
public int utSelectedItemTooltipHeight = 59;

@Config.RequiresMcRestart
@Config.Name("Skip Credits")
@Config.Comment("Skips the credits screen after the player goes through the end podium portal")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ public List<String> getMixinConfigs()
configs.add("mixins.tweaks.misc.commands.seed.json");
configs.add("mixins.tweaks.misc.credits.json");
configs.add("mixins.tweaks.misc.difficulty.client.json");
configs.add("mixins.tweaks.misc.gui.overlaymessage.json");
configs.add("mixins.tweaks.misc.gui.selecteditemtooltip.json");
configs.add("mixins.tweaks.misc.lightning.flash.json");
configs.add("mixins.tweaks.misc.music.json");
configs.add("mixins.tweaks.misc.narrator.json");
Expand Down Expand Up @@ -255,6 +257,10 @@ public boolean shouldMixinConfigQueue(String mixinConfig)
return UTConfig.TWEAKS_MISC.utCopyWorldSeedToggle;
case "mixins.tweaks.misc.credits.json":
return UTConfig.TWEAKS_MISC.utSkipCreditsToggle;
case "mixins.tweaks.misc.gui.overlaymessage.json":
return UTConfig.TWEAKS_MISC.utOverlayMessageHeight != -4;
case "mixins.tweaks.misc.gui.selecteditemtooltip.json":
return UTConfig.TWEAKS_MISC.utSelectedItemTooltipHeight != 59;
case "mixins.tweaks.misc.lightning.flash.json":
return UTConfig.TWEAKS_MISC.LIGHTNING.utLightningFlashToggle;
case "mixins.tweaks.misc.music.json":
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package mod.acgaming.universaltweaks.tweaks.misc.gui.mixin;

import net.minecraftforge.client.GuiIngameForge;

import mod.acgaming.universaltweaks.config.UTConfig;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(value = GuiIngameForge.class, remap = false)
public class UTOverlayMessageForgeMixin
{
@ModifyConstant(method = "renderRecordOverlay", constant = @Constant(intValue = -4))
public int utOverlayMessageHeight(int constant)
{
return UTConfig.TWEAKS_MISC.utOverlayMessageHeight;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package mod.acgaming.universaltweaks.tweaks.misc.gui.mixin;

import net.minecraft.client.gui.GuiIngame;

import mod.acgaming.universaltweaks.config.UTConfig;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(GuiIngame.class)
public class UTOverlayMessageMixin
{
@ModifyConstant(method = "renderGameOverlay", constant = @Constant(intValue = -4))
public int utOverlayMessageHeight(int constant)
{
return UTConfig.TWEAKS_MISC.utOverlayMessageHeight;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package mod.acgaming.universaltweaks.tweaks.misc.gui.mixin;

import net.minecraftforge.client.GuiIngameForge;

import mod.acgaming.universaltweaks.config.UTConfig;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(value = GuiIngameForge.class, remap = false)
public class UTSelectedItemTooltipForgeMixin
{
@ModifyConstant(method = "renderToolHighlight", constant = @Constant(intValue = 59))
public int utSelectedItemTooltipHeight(int constant)
{
return UTConfig.TWEAKS_MISC.utSelectedItemTooltipHeight;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package mod.acgaming.universaltweaks.tweaks.misc.gui.mixin;

import net.minecraft.client.gui.GuiIngame;

import mod.acgaming.universaltweaks.config.UTConfig;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@Mixin(GuiIngame.class)
public class UTSelectedItemTooltipMixin
{
@ModifyConstant(method = "renderSelectedItem", constant = @Constant(intValue = 59))
public int utSelectedItemTooltipHeight(int constant)
{
return UTConfig.TWEAKS_MISC.utSelectedItemTooltipHeight;
}
}
7 changes: 7 additions & 0 deletions src/main/resources/mixins.tweaks.misc.gui.overlaymessage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"package": "mod.acgaming.universaltweaks.tweaks.misc.gui.mixin",
"refmap": "universaltweaks.refmap.json",
"minVersion": "0.8",
"compatibilityLevel": "JAVA_8",
"client": ["UTOverlayMessageForgeMixin", "UTOverlayMessageMixin"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"package": "mod.acgaming.universaltweaks.tweaks.misc.gui.mixin",
"refmap": "universaltweaks.refmap.json",
"minVersion": "0.8",
"compatibilityLevel": "JAVA_8",
"client": ["UTSelectedItemTooltipForgeMixin", "UTSelectedItemTooltipMixin"]
}

0 comments on commit 92c9bca

Please sign in to comment.