Skip to content

Commit

Permalink
Merge pull request #359 from IcarussOne/main
Browse files Browse the repository at this point in the history
3rd Batch of Tweaks
  • Loading branch information
ACGaming authored Jan 15, 2024
2 parents 7288052 + 1f949d7 commit 2466487
Show file tree
Hide file tree
Showing 13 changed files with 153 additions and 6 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ All changes are toggleable via config files.
* **Packet Size:** Increases the packet size limit to account for large packets in modded environments
* **Particle Spawning:** Fixes various particle types not showing up on the client
* **Piston Progress:** Properly saves the last state of pistons to tags
* **Portal Duplication Fix:** Fixes duplication issues that can occur when entities travel through portals
* **Portal Traveling Dupe:** Fixes duplication issues that can occur when entities travel through portals
* **Shear Mooshroom Dupe:** Fixes a duplication exploit connected to shearing mooshrooms
* **Skeleton Aim:** Fixes skeletons not looking at their targets when strafing
* **Sleep Resets Weather:** Fixes sleeping always resetting rain and thunder times
Expand Down Expand Up @@ -130,6 +130,7 @@ All changes are toggleable via config files.
* **Hardcore Buckets:** Prevents placing of liquid source blocks in the world
* **Horizontal Collision Damage:** Applies horizontal collision damage to the player akin to elytra collision
* **Husk & Stray Spawning:** Lets husks and strays spawn underground like regular zombies and skeletons
* **Improved Entity Tracker Warning:** Provides more information to addPacket removed entity warnings
* **Incurable Potions:** Excludes potion effects from being curable with curative items like buckets of milk
* **Infinite Music:** Lets background music play continuously without delays
* **Item Entities:** Enables the modification of item entity properties
Expand All @@ -151,6 +152,7 @@ All changes are toggleable via config files.
* **No Leftover Breath Bottles:** Disables dragon's breath from leaving off empty bottles when a stack is brewed with
* **No Night Vision Flash:** Disables the flashing effect when the night vision potion effect is about to run out
* **No Potion Shift:** Disables the inventory shift when potion effects are active
* **No Portal Spawning:** Prevents zombie pigmen spawning from nether portals
* **No Redstone Lighting:** Disables lighting of active redstone, repeaters, and comparators to improve performance
* **No Saddled Wandering:** Stops horses wandering around when saddled
* **No Smelting XP:** Disables the experience reward when smelting items in furnaces
Expand All @@ -176,6 +178,7 @@ 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 @@ -13,12 +13,12 @@

// Courtesy of fonnymunkey
@Mod.EventBusSubscriber(modid = UniversalTweaks.MODID)
public class UTPortalDuplicationFix
public class UTPortalTravelingDupe
{
@SubscribeEvent
public static void dimensionChangeEvent(EntityTravelToDimensionEvent event)
{
if (event.getEntity().world.isRemote || !UTConfigBugfixes.WORLD.utPortalDuplicationFixToggle) return;
if (event.getEntity().world.isRemote || !UTConfigBugfixes.WORLD.utPortalTravelingDupeToggle) return;
if (event.getEntity() instanceof EntityLiving && !(event.getEntity() instanceof EntityPlayer))
{
EntityLiving entity = (EntityLiving) event.getEntity();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,9 @@ public static class WorldCategory
public boolean utFrustumCullingToggle = true;

@Config.RequiresMcRestart
@Config.Name("Portal Duplication Fix")
@Config.Name("Portal Traveling Dupe")
@Config.Comment("Fixes duplication issues that can occur when entities travel through portals")
public boolean utPortalDuplicationFixToggle = true;
public boolean utPortalTravelingDupeToggle = true;

@Config.RequiresMcRestart
@Config.Name("Tile Entity Map")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,11 @@ public static class EntitiesCategory
@Config.Comment("Mobs carrying picked up items will drop their equipment and despawn properly")
public boolean utMobDespawnToggle = true;

@Config.RequiresMcRestart
@Config.Name("No Portal Spawning")
@Config.Comment("Prevents zombie pigmen spawning from nether portals")
public boolean utPortalSpawningToggle = false;

@Config.RequiresMcRestart
@Config.Name("No Saddled Wandering")
@Config.Comment("Stops horses wandering around when saddled")
Expand Down Expand Up @@ -1014,6 +1019,10 @@ public static class ItemEntitiesCategory
@Config.Name("[16] Clear Despawn: Urgent Flashing")
@Config.Comment("Makes item entities flash faster as they get closer to despawning")
public boolean utIEClearDespawnUrgentToggle = true;

@Config.Name("[17] Slowed Movement")
@Config.Comment("Slows how often item entities update their position to improve performance")
public boolean utIEUpdateToggle = true;
}

public static class MendingCategory
Expand Down Expand Up @@ -1197,6 +1206,11 @@ public static class MiscCategory
@Config.Comment("Disables the experience reward when smelting items in furnaces")
public boolean utSmeltingXPToggle = false;

@Config.RequiresMcRestart
@Config.Name("Improved Entity Tracker Warning")
@Config.Comment("Provides more information to addPacket removed entity warnings")
public boolean utImprovedEntityTrackerToggle = true;

@Config.Name("Offhand Improvement")
@Config.Comment("Prevents placing offhand blocks when blocks or food are held in the mainhand")
public boolean utOffhandToggle = true;
Expand Down Expand Up @@ -1608,6 +1622,11 @@ public static class PerformanceCategory
@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 @@ -203,6 +203,7 @@ public List<String> getMixinConfigs()
configs.add("mixins.tweaks.entities.spawning.creeper.confetti.json");
configs.add("mixins.tweaks.entities.spawning.golem.json");
configs.add("mixins.tweaks.entities.spawning.husk.json");
configs.add("mixins.tweaks.entities.spawning.portal.json");
configs.add("mixins.tweaks.entities.spawning.stray.json");
configs.add("mixins.tweaks.entities.speed.boat.json");
configs.add("mixins.tweaks.entities.speed.player.json");
Expand All @@ -217,6 +218,7 @@ public List<String> getMixinConfigs()
configs.add("mixins.tweaks.items.xpbottle.json");
configs.add("mixins.tweaks.misc.armorcurve.json");
configs.add("mixins.tweaks.misc.bannerlayers.json");
configs.add("mixins.tweaks.misc.console.addpacket.json");
configs.add("mixins.tweaks.misc.incurablepotions.json");
configs.add("mixins.tweaks.misc.lightning.damage.json");
configs.add("mixins.tweaks.misc.lightning.fire.json");
Expand All @@ -227,6 +229,7 @@ public List<String> getMixinConfigs()
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.world.chunks.gen.json");
Expand Down Expand Up @@ -424,6 +427,8 @@ public boolean shouldMixinConfigQueue(String mixinConfig)
case "mixins.tweaks.entities.spawning.husk.json":
case "mixins.tweaks.entities.spawning.stray.json":
return UTConfigTweaks.ENTITIES.utHuskStraySpawningToggle;
case "mixins.tweaks.entities.spawning.portal.json":
return UTConfigTweaks.ENTITIES.utPortalSpawningToggle;
case "mixins.tweaks.entities.speed.boat.json":
return UTConfigTweaks.ENTITIES.utBoatSpeed != 0.04D;
case "mixins.tweaks.entities.speed.player.json":
Expand All @@ -450,6 +455,8 @@ public boolean shouldMixinConfigQueue(String mixinConfig)
return UTConfigTweaks.MISC.utBannerLayers != 6;
case "mixins.tweaks.misc.buttons.snooper.server.json":
return UTConfigTweaks.MISC.utSnooperToggle;
case "mixins.tweaks.misc.console.addpacket.json":
return UTConfigTweaks.MISC.utImprovedEntityTrackerToggle;
case "mixins.tweaks.misc.lightning.damage.json":
return UTConfigTweaks.MISC.LIGHTNING.utLightningDamage != 5.0D || UTConfigTweaks.MISC.LIGHTNING.utLightningFireTicks != 8;
case "mixins.tweaks.misc.lightning.fire.json":
Expand All @@ -470,6 +477,8 @@ public boolean shouldMixinConfigQueue(String mixinConfig)
return UTConfigTweaks.PERFORMANCE.utCraftingCacheToggle;
case "mixins.tweaks.performance.dyeblending.json":
return UTConfigTweaks.PERFORMANCE.utDyeBlendingToggle;
case "mixins.tweaks.performance.oredictionarycheck.json":
return UTConfigTweaks.PERFORMANCE.utOreDictionaryCheckToggle;
case "mixins.tweaks.performance.prefixcheck.json":
return UTConfigTweaks.PERFORMANCE.utPrefixCheckToggle;
case "mixins.tweaks.performance.redstone.json":
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package mod.acgaming.universaltweaks.tweaks.entities.spawning.portal.mixin;

import java.util.Random;

import mod.acgaming.universaltweaks.UniversalTweaks;
import mod.acgaming.universaltweaks.config.UTConfigTweaks;
import net.minecraft.block.BlockPortal;
import net.minecraft.block.state.IBlockState;
import net.minecraft.network.NetHandlerPlayServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

// Courtesy of fonnymunkey
@Mixin(BlockPortal.class)
public abstract class UTPortalMixin
{
@Inject(
method = "updateTick",
at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BlockBreakable;updateTick(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/state/IBlockState;Ljava/util/Random;)V", shift = At.Shift.AFTER),
cancellable = true
)
public void utPortalUpdateTick(World worldIn, BlockPos pos, IBlockState state, Random rand, CallbackInfo ci)
{
if (UTConfigTweaks.ENTITIES.utPortalSpawningToggle) ci.cancel();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package mod.acgaming.universaltweaks.tweaks.items.itementities.mixin;

import net.minecraft.entity.Entity;
import net.minecraft.entity.MoverType;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
Expand All @@ -15,6 +16,7 @@
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

Expand Down Expand Up @@ -156,4 +158,12 @@ public void utIECombinationCombine(EntityItem other, CallbackInfoReturnable<Bool
if (stack.getCount() >= stack.getMaxStackSize()) cir.setReturnValue(false);
}
}

// Courtesy of fonnymunkey
@Redirect(method = "onUpdate", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/item/EntityItem;move(Lnet/minecraft/entity/MoverType;DDD)V"))
public boolean utIEOnUpdate(EntityItem instance, MoverType moverType, double dx, double dy, double dz)
{
// Run on odd ticks to not skip the '% 25' check
return UTConfigTweaks.ITEMS.ITEM_ENTITIES.utIEUpdateToggle && instance.ticksExisted % 2 != 0;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package mod.acgaming.universaltweaks.tweaks.misc.console.addpacket.mixin;

import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityTrackerEntry;

import mod.acgaming.universaltweaks.UniversalTweaks;
import mod.acgaming.universaltweaks.config.UTConfigGeneral;
import mod.acgaming.universaltweaks.config.UTConfigTweaks;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

// Courtesy of fonnymunkey
@Mixin(EntityTrackerEntry.class)
public abstract class UTEntityTrackerEntryMixin
{
@Shadow @Final private Entity trackedEntity;

@Redirect(method = "createSpawnPacket", at = @At(value = "INVOKE", target = "Lorg/apache/logging/log4j/Logger;warn(Ljava/lang/String;)V", remap = false))
public void utCreateSpawnPacket(Logger instance, String s)
{
instance.warn(s + ", name: " + this.trackedEntity.getName() + " pos: {x:" + this.trackedEntity.posX + ",y:" + this.trackedEntity.posY + ",z:" + this.trackedEntity.posZ + "}");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package mod.acgaming.universaltweaks.tweaks.performance.oredictionarycheck.mixin;

import mod.acgaming.universaltweaks.UniversalTweaks;
import mod.acgaming.universaltweaks.config.UTConfigTweaks;
import net.minecraftforge.oredict.OreDictionary;
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 fonnymunkey
@Mixin(OreDictionary.class)
public abstract class UTOreDictionaryCheckMixin
{
@WrapWithCondition(
method = "registerOreImpl",
at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/common/FMLLog;bigWarning(Ljava/lang/String;[Ljava/lang/Object;)V"),
remap = false
)
private static boolean utCheckOreDictionary(String i, Object[] format)
{
return !UTConfigTweaks.PERFORMANCE.utOreDictionaryCheckToggle;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ public static List<String> obsoleteModsMessage()
if (Loader.isModLoaded("blockoverlayfix") && UTConfigBugfixes.BLOCKS.BLOCK_OVERLAY.utBlockOverlayToggle) messages.add("Block Overlay Fix");
if (Loader.isModLoaded("bottomsugarcanharvest") && UTConfigTweaks.BLOCKS.utSugarCaneSize != 3) messages.add("Bottom Sugar Cane Harvest");
if (Loader.isModLoaded("bowinfinityfix") && UTConfigTweaks.ITEMS.utBowInfinityToggle) messages.add("Bow Infinity Fix");
if (Loader.isModLoaded("breedablekillerrabbit") && UTConfigTweaks.ENTITIES.utRabbitKillerChance > 0.0D) messages.add("Breedable Killer Rabbit");
if (Loader.isModLoaded("burnbabyburn") && UTConfigTweaks.ENTITIES.utBurningBabyZombiesToggle) messages.add("BurnBabyBurn");
if (Loader.isModLoaded("chickensshed") && UTConfigTweaks.ENTITIES.CHICKEN_SHEDDING.utChickenSheddingToggle) messages.add("ChickensShed");
if (Loader.isModLoaded("cie") && UTConfigTweaks.ITEMS.ITEM_ENTITIES.utItemEntitiesToggle) messages.add("Configurable Item Entities (CIE)");
if (Loader.isModLoaded("classiccombat") && UTConfigTweaks.ITEMS.ATTACK_COOLDOWN.utAttackCooldownToggle) messages.add("Classic Combat");
if (Loader.isModLoaded("cleardespawn") && UTConfigTweaks.ITEMS.ITEM_ENTITIES.utIEClearDespawnToggle) messages.add("Clear Despawn");
if (Loader.isModLoaded("collisiondamage") && UTConfigTweaks.ENTITIES.COLLISION_DAMAGE.utCollisionDamageToggle) messages.add("Collision Damage");
if (Loader.isModLoaded("configurablecane") && UTConfigTweaks.BLOCKS.utSugarCaneSize != 3) messages.add("Configurable Cane");
if (Loader.isModLoaded("configurabledespawntimer") && UTConfigTweaks.ITEMS.ITEM_ENTITIES.utItemEntitiesToggle) messages.add("Configurable Despawn Timer");
if (Loader.isModLoaded("continousmusic") && UTConfigTweaks.MISC.utInfiniteMusicToggle) messages.add("Infinite Music");
if (Loader.isModLoaded("creeperconfetti") && UTConfigTweaks.ENTITIES.CREEPER_CONFETTI.utCreeperConfettiChance > 0) messages.add("Creeper Confetti");
if (Loader.isModLoaded("damagetilt") && UTConfigTweaks.MISC.utDamageTiltToggle) messages.add("Damage Tilt");
Expand All @@ -67,6 +69,7 @@ public static List<String> obsoleteModsMessage()
if (Loader.isModLoaded("givemebackmyhp") && UTConfigBugfixes.ENTITIES.utMaxHealthToggle) messages.add("Give Me Back My HP");
if (Loader.isModLoaded("gottagofast") && UTConfigTweaks.ENTITIES.PLAYER_SPEED.utPlayerSpeedToggle) messages.add("Gotta Go Fast");
if (Loader.isModLoaded("helpfixer") && UTConfigBugfixes.MISC.utHelpToggle) messages.add("HelpFixer");
if (Loader.isModLoaded("hiddenrecipebook") && UTConfigTweaks.MISC.utRecipeBookToggle) messages.add("Hidden Recipe Book");
if (Loader.isModLoaded("horsefallfix") && UTConfigBugfixes.ENTITIES.utHorseFallingToggle) messages.add("HorseFallFix");
if (Loader.isModLoaded("horsestandstill") && UTConfigTweaks.ENTITIES.utSaddledWanderingToggle) messages.add("Stupid Horse Stand Still");
if (Loader.isModLoaded("ikwid") && UTConfigTweaks.MISC.TOAST_CONTROL.utToastControlTutorialToggle) messages.add("I Know What I'm Doing");
Expand All @@ -93,7 +96,7 @@ public static List<String> obsoleteModsMessage()
if (Loader.isModLoaded("parry") && UTConfigTweaks.ITEMS.PARRY.utParryToggle) messages.add("Shield Parry");
if (Loader.isModLoaded("pathundergates") && UTConfigTweaks.BLOCKS.utLenientPathsToggle) messages.add("Path Under Gates");
if (Loader.isModLoaded("pickupnotifier") && UTConfigTweaks.MISC.PICKUP_NOTIFICATION.utPickupNotificationToggle) messages.add("Pick Up Notifier");
if (Loader.isModLoaded("portaldupebegone") && UTConfigBugfixes.WORLD.utPortalDuplicationFixToggle) messages.add("PortalDupeBegone");
if (Loader.isModLoaded("portaldupebegone") && UTConfigBugfixes.WORLD.utPortalTravelingDupeToggle) messages.add("PortalDupeBegone");
if (Loader.isModLoaded("preventghost") && UTConfigBugfixes.BLOCKS.utMiningGlitchToggle) messages.add("Prevent Ghost Blocks");
if (Loader.isModLoaded("quickleafdecay") && UTConfigTweaks.BLOCKS.utLeafDecayToggle) messages.add("Quick Leaf Decay");
if (Loader.isModLoaded("rallyhealth") && UTConfigTweaks.ENTITIES.RALLY_HEALTH.utRallyHealthToggle) messages.add("Rally Health");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"package": "mod.acgaming.universaltweaks.tweaks.entities.spawning.portal.mixin",
"refmap": "universaltweaks.refmap.json",
"minVersion": "0.8",
"compatibilityLevel": "JAVA_8",
"mixins": ["UTPortalMixin"]
}
7 changes: 7 additions & 0 deletions src/main/resources/mixins.tweaks.misc.console.addpacket.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"package": "mod.acgaming.universaltweaks.tweaks.misc.console.addpacket.mixin",
"refmap": "universaltweaks.refmap.json",
"minVersion": "0.8",
"compatibilityLevel": "JAVA_8",
"client": ["UTEntityTrackerEntryMixin"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"package": "mod.acgaming.universaltweaks.tweaks.performance.oredictionarycheck.mixin",
"refmap": "universaltweaks.refmap.json",
"minVersion": "0.8",
"compatibilityLevel": "JAVA_8",
"mixins": ["UTOreDictionaryCheckMixin"]
}

0 comments on commit 2466487

Please sign in to comment.