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

Disable Rain Particles #519

Merged
merged 1 commit into from
Jul 15, 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 @@ -147,6 +147,7 @@ All changes are toggleable via config files.
* **Disable Hotbar Scroll Wrapping:** Disables using the scroll wheel to change hotbar slots wrapping
* **Disable Mob Spawner Entity Render:** Disables rendering an entity inside of Mob Spawners
* **Disable Narrator:** Disables the narrator functionality entirely
* **Disable Rain Particles:** Prevents Rain and Snow Particles from rendering when Raining or Thundering
* **Disable Glint Overlay on Enchantment Books:** Disables the glint overlay on enchantment books
* **Disable Glint Overlay on Potions:** Disables the glint overlay on potions
* **Disable Sleeping:** Disables skipping night by using a bed while making it still able to set spawn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2045,6 +2045,11 @@ public static class PerformanceCategory
@Config.Comment("Improves rendering performance by disabling rendering the entity inside mob spawners")
public boolean utDisableMobSpawnerRendering = false;

@Config.RequiresMcRestart
@Config.Name("Disable Rain Particles")
@Config.Comment("Prevents Rain and Snow Particles from rendering when Raining or Thundering")
public boolean utDisableRainParticles = false;

@Config.RequiresMcRestart
@Config.Name("Faster Background Startup")
@Config.Comment("Fixes slow background startup edge case caused by checking tooltips during the loading process")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ public class UTLoadingPlugin implements IFMLLoadingPlugin, IEarlyMixinLoader
put("mixins.tweaks.performance.mobspawnerrender.json", () -> UTConfigTweaks.PERFORMANCE.utDisableMobSpawnerRendering);
put("mixins.tweaks.performance.resourcemanager.json", () -> UTConfigTweaks.PERFORMANCE.utCheckAnimatedModelsToggle);
put("mixins.tweaks.performance.texturemapcheck.json", () -> UTConfigTweaks.PERFORMANCE.utTextureMapCheckToggle);
put("mixins.tweaks.performance.weathereffects.json", () -> UTConfigTweaks.PERFORMANCE.utDisableRainParticles);
put("mixins.tweaks.world.loading.client.json", () -> UTConfigTweaks.PERFORMANCE.utWorldLoadingToggle);
put("mixins.tweaks.world.voidfog.json", () -> UTConfigTweaks.WORLD.VOID_FOG.utVoidFogToggle);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package mod.acgaming.universaltweaks.tweaks.performance.weathereffects.mixin;

import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.util.EnumParticleTypes;

import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

import mod.acgaming.universaltweaks.config.UTConfigTweaks;

@Mixin(EntityRenderer.class)
public abstract class UTEntityRendererMixin
{
@WrapWithCondition(method = "addRainParticles", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/multiplayer/WorldClient;spawnParticle(Lnet/minecraft/util/EnumParticleTypes;DDDDDD[I)V"))
private boolean utDisableRainParticles(WorldClient world, EnumParticleTypes particleType, double xCoord, double yCoord, double zCoord, double xSpeed, double ySpeed, double zSpeed, int... parameters)
{
return !UTConfigTweaks.PERFORMANCE.utDisableRainParticles;
}

@WrapOperation(method = "renderRainSnow", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/multiplayer/WorldClient;getRainStrength(F)F"))
private float utRemoveRainBounce(WorldClient world, float partialTicks, Operation<Float> original)
{
if (!UTConfigTweaks.PERFORMANCE.utDisableRainParticles) return original.call(world, partialTicks);
return 0f;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"package": "mod.acgaming.universaltweaks.tweaks.performance.weathereffects.mixin",
"refmap": "universaltweaks.refmap.json",
"minVersion": "0.8",
"compatibilityLevel": "JAVA_8",
"client": ["UTEntityRendererMixin"]
}
Loading