Skip to content

Commit

Permalink
Merge pull request #491 from WaitingIdly/particle-queue
Browse files Browse the repository at this point in the history
Customize Particle Limit
  • Loading branch information
ACGaming authored Jun 16, 2024
2 parents 123050f + a5efd5f commit 331f89c
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ All changes are toggleable via config files.
* **Offhand Improvement:** Prevents placing offhand blocks when blocks or food are held in the mainhand
* **Overhaul Beacon:** Change how beacon construct and range apply per level
* **Overlay Message Height:** Sets the Y value of the overlay message (action bar), displayed for playing records etc.
* **Particle Limit:** Limits particles to a set amount. Should not be set too low, as it will cause particles to appear for a single tick before vanishing
* **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
* **Prevent Observer Activating on Placement:** Controls if the observer activates itself on the first tick when it is placed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1489,6 +1489,16 @@ public static class MiscCategory
@Config.Comment("Disables potion effect particles emitting from yourself")
public boolean utPoVEffectParticles = false;

@Config.RequiresMcRestart
@Config.Name("Particle Limit")
@Config.Comment
({
"Limits particles to a set amount. Should not be set too low, as it will cause particles to appear for a single tick before vanishing",
"Vanilla default is 16384",
"Less than or equal to 0 is set to the default"
})
public int utParticleLimit = -1;

@Config.RequiresMcRestart
@Config.Name("No Smelting XP")
@Config.Comment("Disables the experience reward when smelting items in furnaces")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ public class UTLoadingPlugin implements IFMLLoadingPlugin, IEarlyMixinLoader
put("mixins.tweaks.misc.gui.potionduration.json", () -> UTConfigTweaks.MISC.utPotionDurationToggle);
put("mixins.tweaks.misc.gui.selecteditemtooltip.json", () -> UTConfigTweaks.MISC.utSelectedItemTooltipHeight != 59);
put("mixins.tweaks.misc.gui.textshadow.json", () -> UTConfigTweaks.MISC.utDisableTextShadow);
put("mixins.tweaks.misc.particlelimit.json", () -> UTConfigTweaks.MISC.utParticleLimit > 0);
put("mixins.tweaks.misc.lightning.flash.json", () -> UTConfigTweaks.MISC.LIGHTNING.utLightningFlashToggle);
put("mixins.tweaks.misc.mainmenu.json", () -> UTConfigTweaks.MISC.utReturnToMainMenu);
put("mixins.tweaks.misc.music.json", () -> UTConfigTweaks.MISC.utInfiniteMusicToggle);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package mod.acgaming.universaltweaks.tweaks.misc.particlelimit.mixin;

import net.minecraft.client.particle.ParticleManager;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

import mod.acgaming.universaltweaks.config.UTConfigTweaks;

// Courtesy of WaitingIdly
@Mixin(ParticleManager.class)
public class UTParticleManagerMixin
{
@ModifyConstant(method = "updateEffects", constant = @Constant(intValue = 16384))
public int utRenderParticles(int original)
{
if (UTConfigTweaks.MISC.utParticleLimit <= 0) return original;
return UTConfigTweaks.MISC.utParticleLimit;
}
}
7 changes: 7 additions & 0 deletions src/main/resources/mixins.tweaks.misc.particlelimit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"package": "mod.acgaming.universaltweaks.tweaks.misc.particlelimit.mixin",
"refmap": "universaltweaks.refmap.json",
"minVersion": "0.8",
"compatibilityLevel": "JAVA_8",
"client": ["UTParticleManagerMixin"]
}

0 comments on commit 331f89c

Please sign in to comment.