-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #519 from WaitingIdly/rain-removal
Disable Rain Particles
- Loading branch information
Showing
5 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...gaming/universaltweaks/tweaks/performance/weathereffects/mixin/UTEntityRendererMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/resources/mixins.tweaks.performance.weathereffects.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
} |