Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downgrade Potion Recipes Log Level #561

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ All changes are toggleable via config files.
* **Fix Deep Dark Stats:** Fixes Mob Attack and Health Statistics being repeatedly doubled
* **Mutable Machine Block Drops:** Fixes Machine Block drops being immutable, causing a crash on attempting to remove entries from the list.
* **Creative Mill Harvestability:** Fixes the Creative Mill Generator not respecting the Creative Block Breaking config
* **Downgrade Potion Recipes Log Level:** Downgrades the message when creating a potion recipe from info to a debug
* **Forestry**
* **Arborist Villager Trades:** Adds custom emerald to germling trades to the arborist villager
* **Disable Bee Damage Armor Bypass:** Disables damage caused by bees bypassing player armor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,11 @@ public static class ExtraUtilitiesCategory
@Config.Name("Mutable Machine Block Drops")
@Config.Comment("Fixes Machine Block drops being immutable, causing a crash on attempting to remove entries from the list")
public boolean utMutableBlockDrops = true;

@Config.RequiresMcRestart
@Config.Name("Downgrade Potion Recipes Log Level")
@Config.Comment("Downgrades the message when creating a potion recipe from info to a debug")
public boolean utDowngradePotionLogging = true;
}

public static class ForestryCategory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public class UTMixinLoader implements ILateMixinLoader
put("mixins.mods.extrautilities.deepdarkstats.json", () -> loaded("extrautils2") && UTConfigMods.EXTRA_UTILITIES.utDeepDarkStats);
put("mixins.mods.extrautilities.dupes.json", () -> loaded("extrautils2") && UTConfigMods.EXTRA_UTILITIES.utDuplicationFixesToggle);
put("mixins.mods.extrautilities.mutabledrops.json", () -> loaded("extrautils2") && UTConfigMods.EXTRA_UTILITIES.utMutableBlockDrops);
put("mixins.mods.extrautilities.potionlogging.json", () -> loaded("extrautils2") && UTConfigMods.EXTRA_UTILITIES.utDowngradePotionLogging);
put("mixins.mods.extrautilities.radar.json", () -> loaded("extrautils2") && UTConfigMods.EXTRA_UTILITIES.utCatchRadarException);
put("mixins.mods.forestry.cocoa.json", () -> loaded("forestry") && UTConfigMods.FORESTRY.utFOCocoaBeansToggle);
put("mixins.mods.forestry.dupes.json", () -> loaded("forestry") && UTConfigMods.FORESTRY.utDuplicationFixesToggle);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package mod.acgaming.universaltweaks.mods.extrautilities.potionlogging.mixin;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.rwtema.extrautils2.utils.LogHelper;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

import mod.acgaming.universaltweaks.config.UTConfigMods;

// Courtesy of WaitingIdly
@Mixin(targets = "com.rwtema.extrautils2.machine.BrewingEnergyRecipe", remap = false)
public abstract class UTBrewingEnergyRecipeMixin
{
@WrapOperation(method = "checkTypes", at = @At(value = "INVOKE", target = "Lcom/rwtema/extrautils2/utils/LogHelper;info(Ljava/lang/Object;[Ljava/lang/Object;)V"))
private static void utDowngradePotionLogging(Object info, Object[] info2, Operation<Void> original)
{
if (!UTConfigMods.EXTRA_UTILITIES.utDowngradePotionLogging) original.call(info, info2);
else LogHelper.fine(info, info2);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"package": "mod.acgaming.universaltweaks.mods.extrautilities.potionlogging.mixin",
"refmap": "universaltweaks.refmap.json",
"minVersion": "0.8",
"compatibilityLevel": "JAVA_8",
"mixins": ["UTBrewingEnergyRecipeMixin"]
}