Skip to content

Commit

Permalink
Implement Anvil XP Level Cap tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
ACGaming committed Dec 12, 2024
1 parent c45e5d0 commit e4135cb
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ All changes are toggleable via config files.
* **AI Improvements:** Replaces/removes entity AI for improved server performance
* **Always Eat:** Allows the consumption of food at any time, regardless of the hunger bar
* **Always Return to Main Menu:** Always returns the player to the main menu when quitting the game
* **Anvil XP Level Cap:** Sets the experience level cap for anvil recipes
* **Armed Armor Stands:** Enables arms for armor stands by default
* **Armor Curve:** Adjusts the armor scaling and degradation formulae for mobs and players
* **Attributes:** Sets custom ranges for entity attributes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ public enum EnumBeacon

public static class BlocksCategory
{
@Config.LangKey("cfg.universaltweaks.tweaks.blocks.anvil")
@Config.Name("Anvil")
public final AnvilCategory ANVIL = new AnvilCategory();

@Config.LangKey("cfg.universaltweaks.tweaks.blocks.betterplacement")
@Config.Name("Better Placement")
public final BetterPlacementCategory BETTER_PLACEMENT = new BetterPlacementCategory();
Expand Down Expand Up @@ -218,6 +222,14 @@ public static class BlocksCategory
})
public int utVineSize = 0;

public static class AnvilCategory
{
@Config.RequiresMcRestart
@Config.Name("Anvil XP Level Cap")
@Config.Comment("Sets the experience level cap for anvil recipes")
public int utAnvilXPLevelCap = 40;
}

public static class BetterPlacementCategory
{
@Config.RequiresMcRestart
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package mod.acgaming.universaltweaks.tweaks.blocks.anvil.mixin;

import net.minecraft.inventory.ContainerRepair;

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

@Mixin(ContainerRepair.class)
public abstract class UTContainerRepairMixin
{
@ModifyConstant(method = "updateRepairOutput", constant = @Constant(intValue = 40))
private int utContainerRepair(int constant)
{
return UTConfigTweaks.BLOCKS.ANVIL.utAnvilXPLevelCap;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package mod.acgaming.universaltweaks.tweaks.blocks.anvil.mixin;

import net.minecraft.client.gui.GuiRepair;

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

@Mixin(GuiRepair.class)
public abstract class UTGuiRepairMixin
{
@ModifyConstant(method = "drawGuiContainerForegroundLayer", constant = @Constant(intValue = 40))
private int utGuiRepair(int constant)
{
return UTConfigTweaks.BLOCKS.ANVIL.utAnvilXPLevelCap;
}
}
1 change: 1 addition & 0 deletions src/main/resources/assets/universaltweaks/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ cfg.universaltweaks.modintegration.tr=Tech Reborn
cfg.universaltweaks.modintegration.woot=Woot
cfg.universaltweaks.modintegration=Mod Integration

cfg.universaltweaks.tweaks.blocks.anvil=Anvil
cfg.universaltweaks.tweaks.blocks.betterplacement=Better Placement
cfg.universaltweaks.tweaks.blocks.blockdispenser=Block Dispenser
cfg.universaltweaks.tweaks.blocks.breakablebedrock=Breakable Bedrock
Expand Down

0 comments on commit e4135cb

Please sign in to comment.