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

5th Batch of Tweaks #368

Merged
merged 4 commits into from
Feb 3, 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
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,16 @@ All changes are toggleable via config files.
* **Lightning Fire Ticks:** Sets the duration in ticks lightning bolts set entities on fire
* **No Lightning Fire:** Disables the creation of fire around lightning strikes
* **No Lightning Flash:** Disables the flashing of skybox and ground brightness on lightning strikes
* **No Lightning Item Destruction:** Prevents lightning bolts from destroying items
* **Linear XP Amount:** Sets the amount of XP needed for each level, effectively removing the increasing level scaling
* **Load Sounds:** Plays sounds when the game or the world are loaded
* **Mending Overpowered:** If mending fix is enabled, repairs entire damaged inventory with XP
* **Mending:** Only repairs damaged equipment with XP
* **Mob Despawn Improvement:** Mobs carrying picked up items will drop their equipment and despawn properly
* **More Banner Layers:** Sets the amount of applicable pattern layers for banners
* **Mute Advancement Errors:** Silences advancement errors
* **Mute Ore Dictionary Errors:** Silences ore dictionary errors
* **Mute Texture Map Errors:** Silences texture map errors
* **No Attack Cooldown:** Disables the 1.9 combat update attack cooldown
* **No Crafting Repair:** Disables crafting recipes for repairing tools
* **No Golems:** Disables the manual creation of golems and withers
Expand Down Expand Up @@ -184,7 +188,6 @@ All changes are toggleable via config files.
* **Soulbound Vexes:** Summoned vexes will also die when their summoner is killed
* **Spawn Caps:** Sets maximum spawning limits for different entity types
* **Super Hot Torch:** Enables one-time ignition of entities by hitting them with a torch
* **Suppress Ore Dictionary Errors:** Suppresses Forge's broken ore dictionary errors
* **Stronghold Replacement:** Replaces stronghold generation with a safer variant
* **Swing Through Grass:** Allows hitting entities through grass instead of breaking it
* **Tidy Chunk:** Tidies newly generated chunks by removing scattered item entities
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,11 @@ public static class LightningCategory
@Config.Name("No Lightning Flash")
@Config.Comment("Disables the flashing of skybox and ground brightness on lightning bolt strikes")
public boolean utLightningFlashToggle = false;

@Config.RequiresMcRestart
@Config.Name("No Lightning Item Destruction")
@Config.Comment("Prevents lightning bolts from destroying items")
public boolean utLightningItemDestructionToggle = false;
}

public static class LoadSoundsCategory
Expand Down Expand Up @@ -1626,17 +1631,27 @@ public static class PerformanceCategory
"May have side effects such as slower chunk generation"
})
public boolean utWorldLoadingToggle = false;

@Config.RequiresMcRestart
@Config.Name("Mute Advancement Errors")
@Config.Comment("Silences advancement errors")
public boolean utAdvancementCheckToggle = false;

@Config.RequiresMcRestart
@Config.Name("Mute Ore Dictionary Errors")
@Config.Comment("Silences ore dictionary errors")
public boolean utOreDictionaryCheckToggle = false;

@Config.RequiresMcRestart
@Config.Name("Mute Texture Map Errors")
@Config.Comment("Silences texture map errors")
public boolean utTextureMapCheckToggle = false;

@Config.RequiresMcRestart
@Config.Name("No Redstone Lighting")
@Config.Comment("Disables lighting of active redstone, repeaters, and comparators to improve performance")
public boolean utRedstoneLightingToggle = false;

@Config.RequiresMcRestart
@Config.Name("Suppress Ore Dictionary Errors")
@Config.Comment("Suppresses Forge's broken ore dictionary errors")
public boolean utOreDictionaryCheckToggle = false;

@Config.RequiresMcRestart
@Config.Name("Uncap FPS")
@Config.Comment("Removes the hardcoded 30 FPS limit in screens like the main menu")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,14 @@ public List<String> getMixinConfigs()
configs.add("mixins.tweaks.misc.xp.linear.json");
configs.add("mixins.tweaks.misc.xp.smelting.json");
configs.add("mixins.tweaks.misc.recipebook.server.json");
configs.add("mixins.tweaks.performance.advancementcheck.json");
configs.add("mixins.tweaks.performance.autosave.json");
configs.add("mixins.tweaks.performance.craftingcache.json");
configs.add("mixins.tweaks.performance.dyeblending.json");
configs.add("mixins.tweaks.performance.oredictionarycheck.json");
configs.add("mixins.tweaks.performance.prefixcheck.json");
configs.add("mixins.tweaks.performance.redstone.json");
configs.add("mixins.tweaks.performance.texturemapcheck.json");
configs.add("mixins.tweaks.world.chunks.gen.json");
configs.add("mixins.tweaks.world.loading.server.json");
configs.add("mixins.tweaks.world.sealevel.json");
Expand Down Expand Up @@ -494,6 +496,8 @@ public boolean shouldMixinConfigQueue(String mixinConfig)
return UTConfigTweaks.MISC.utRecipeBookToggle;
case "mixins.tweaks.misc.xp.smelting.json":
return UTConfigTweaks.MISC.utSmeltingXPToggle;
case "mixins.tweaks.performance.advancementcheck.json":
return UTConfigTweaks.PERFORMANCE.utAdvancementCheckToggle;
case "mixins.tweaks.performance.autosave.json":
return UTConfigTweaks.PERFORMANCE.utAutoSaveInterval != 900;
case "mixins.tweaks.performance.craftingcache.json":
Expand All @@ -506,6 +510,8 @@ public boolean shouldMixinConfigQueue(String mixinConfig)
return UTConfigTweaks.PERFORMANCE.utPrefixCheckToggle;
case "mixins.tweaks.performance.redstone.json":
return UTConfigTweaks.PERFORMANCE.utRedstoneLightingToggle;
case "mixins.tweaks.performance.texturemapcheck.json":
return UTConfigTweaks.PERFORMANCE.utTextureMapCheckToggle;
case "mixins.tweaks.world.chunks.gen.json":
return UTConfigTweaks.WORLD.CHUNK_GEN_LIMIT.utChunkGenLimitToggle;
case "mixins.tweaks.world.loading.server.json":
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package mod.acgaming.universaltweaks.tweaks.misc.lightning.damage;

import net.minecraft.entity.item.EntityItem;
import net.minecraftforge.event.entity.EntityStruckByLightningEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

import mod.acgaming.universaltweaks.UniversalTweaks;
import mod.acgaming.universaltweaks.config.UTConfigTweaks;
import mod.acgaming.universaltweaks.config.UTConfigGeneral;

@Mod.EventBusSubscriber(modid = UniversalTweaks.MODID)
public class UTLightningItemDestruction
{
@SubscribeEvent
public static void onLightningStrike(EntityStruckByLightningEvent event)
{
if (event.getEntity() instanceof EntityItem && UTConfigTweaks.MISC.LIGHTNING.utLightningItemDestructionToggle)
{
if (UTConfigGeneral.DEBUG.utDebugToggle) UniversalTweaks.LOGGER.debug("UTLightningItemDestruction ::: Lightning strike event");
event.setCanceled(true);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package mod.acgaming.universaltweaks.tweaks.performance.advancementcheck.mixin;

import mod.acgaming.universaltweaks.config.UTConfigTweaks;
import net.minecraft.advancements.AdvancementManager;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

import com.llamalad7.mixinextras.injector.WrapWithCondition;

// Courtesy of fonnymunkey
@Mixin(AdvancementManager.class)
public abstract class UTAdvancementManagerMixin
{
@WrapWithCondition(
method = "loadCustomAdvancements",
at = @At(value = "INVOKE", target = "Lorg/apache/logging/log4j/Logger;error(Ljava/lang/String;)V",
remap = false)
)
public boolean utLoadCustomAdvancements0(Logger instance, String s)
{
return !UTConfigTweaks.PERFORMANCE.utAdvancementCheckToggle;
}

@WrapWithCondition(
method = "loadCustomAdvancements",
at = @At(value = "INVOKE", target = "Lorg/apache/logging/log4j/Logger;error(Ljava/lang/String;Ljava/lang/Throwable;)V",
remap = false)
)
public boolean utLoadCustomAdvancements1(Logger instance, String s, Throwable throwable)
{
return !UTConfigTweaks.PERFORMANCE.utAdvancementCheckToggle;
}

@WrapWithCondition(
method = "loadBuiltInAdvancements",
at = @At(value = "INVOKE", target = "Lorg/apache/logging/log4j/Logger;error(Ljava/lang/String;)V",
remap = false)
)
public boolean utLoadBuiltInAdvanacements0(Logger instance, String s)
{
return !UTConfigTweaks.PERFORMANCE.utAdvancementCheckToggle;
}

@WrapWithCondition(
method = "loadBuiltInAdvancements",
at = @At(value = "INVOKE", target = "Lorg/apache/logging/log4j/Logger;error(Ljava/lang/String;Ljava/lang/Throwable;)V",
remap = false)
)
public boolean utLoadBuiltInAdvanacements1(Logger instance, String s, Throwable throwable)
{
return !UTConfigTweaks.PERFORMANCE.utAdvancementCheckToggle;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package mod.acgaming.universaltweaks.tweaks.performance.advancementcheck.mixin;

import mod.acgaming.universaltweaks.config.UTConfigTweaks;
import net.minecraftforge.common.ForgeHooks;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

import com.llamalad7.mixinextras.injector.WrapWithCondition;

// Courtesy of fonnymunkey
@Mixin(ForgeHooks.class)
public abstract class UTForgeHooksMixin
{
@WrapWithCondition(
method = "lambda$loadAdvancements$0",
at = @At(value = "INVOKE", target = "Lorg/apache/logging/log4j/Logger;error(Ljava/lang/String;Ljava/lang/Throwable;)V"),
remap = false
)
private static boolean utLoadAdvancements(Logger instance, String s, Throwable throwable)
{
return !UTConfigTweaks.PERFORMANCE.utAdvancementCheckToggle;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package mod.acgaming.universaltweaks.tweaks.performance.texturemapcheck.mixin;

import mod.acgaming.universaltweaks.config.UTConfigTweaks;
import net.minecraft.client.renderer.texture.TextureMap;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

import com.llamalad7.mixinextras.injector.WrapWithCondition;

// Courtesy of Elephant_1214
@Mixin(value = TextureMap.class, priority = 500)
public class UTTextureMapCheckMixin
{
@WrapWithCondition(
method = "*", at = @At(value = "INVOKE", target = "Lorg/apache/logging/log4j/Logger;error(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V", remap = false),
require = 0
)
private boolean utCheckTexMap(Logger instance, String message, Object p0, Object p1)
{
return !UTConfigTweaks.PERFORMANCE.utTextureMapCheckToggle;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public static List<String> obsoleteModsMessage()
if (Loader.isModLoaded("movingquickly") && UTConfigTweaks.ENTITIES.PLAYER_SPEED.utPlayerSpeedToggle) messages.add("MovingQuickly");
if (Loader.isModLoaded("mtqfix") && UTConfigTweaks.ENTITIES.PLAYER_SPEED.utPlayerSpeedToggle) messages.add("MTQFix");
if (Loader.isModLoaded("mup")) messages.add("MUP / EigenCraft Unofficial Patch");
if (Loader.isModLoaded("muteuselesslogs") && (UTConfigTweaks.PERFORMANCE.utPrefixCheckToggle || UTConfigTweaks.PERFORMANCE.utTextureMapCheckToggle)) messages.add("Mute Useless Logs");
if (Loader.isModLoaded("naturallychargedcreepers") && UTConfigTweaks.ENTITIES.utCreeperChargedChance > 0) messages.add("Naturally Charged Creepers");
if (Loader.isModLoaded("nanfix") && UTConfigBugfixes.ENTITIES.utEntityNaNToggle) messages.add("NaN Entity Health Fix");
if (Loader.isModLoaded("nanpolice") && UTConfigBugfixes.ENTITIES.utEntityNaNToggle) messages.add("NaNPolice");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"package": "mod.acgaming.universaltweaks.tweaks.performance.advancementcheck.mixin",
"refmap": "universaltweaks.refmap.json",
"minVersion": "0.8",
"compatibilityLevel": "JAVA_8",
"mixins": ["UTAdvancementManagerMixin", "UTForgeHooksMixin"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"package": "mod.acgaming.universaltweaks.tweaks.performance.texturemapcheck.mixin",
"refmap": "universaltweaks.refmap.json",
"minVersion": "0.8",
"compatibilityLevel": "JAVA_8",
"mixins": ["UTTextureMapCheckMixin"]
}
Loading