Skip to content

Commit

Permalink
Merge pull request #519 from WaitingIdly/rain-removal
Browse files Browse the repository at this point in the history
Disable Rain Particles
  • Loading branch information
ACGaming authored Jul 15, 2024
2 parents 716cf4f + 5ce754f commit abed9a5
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 0 deletions.
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"]
}

0 comments on commit abed9a5

Please sign in to comment.