-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve various Ashy Shoals performance issues. (#163)
- Allow Ashy Shoals in dimensions besides vanilla Nether - Add config option to limit ash particle probability
- Loading branch information
1 parent
902190a
commit 04f3e92
Showing
6 changed files
with
99 additions
and
24 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
client/src/main/java/com/terraformersmc/cinderscapes/mixin/MixinBiomeParticleConfig.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,31 @@ | ||
package com.terraformersmc.cinderscapes.mixin; | ||
|
||
import com.terraformersmc.cinderscapes.Cinderscapes; | ||
import com.terraformersmc.cinderscapes.config.CinderscapesConfig; | ||
import net.minecraft.particle.ParticleEffect; | ||
import net.minecraft.world.biome.BiomeParticleConfig; | ||
import org.spongepowered.asm.mixin.*; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
import org.spongepowered.asm.mixin.injection.callback.LocalCapture; | ||
|
||
@Mixin(BiomeParticleConfig.class) | ||
public class MixinBiomeParticleConfig { | ||
@Shadow | ||
@Mutable | ||
@Final | ||
private float probability; | ||
|
||
@Unique | ||
private static final float ASH_PARTICLE_LIMIT = 0.125f; | ||
|
||
@Inject(method = "<init>", at = @At("TAIL"), locals = LocalCapture.NO_CAPTURE) | ||
private void cinderscapes$configurableAshParticle(ParticleEffect particle, float probability, CallbackInfo ci) { | ||
if (CinderscapesConfig.INSTANCE.limitAshParticles && probability > ASH_PARTICLE_LIMIT) { | ||
Cinderscapes.LOGGER.info("Limiting ash particle probability from {} to {}", probability, ASH_PARTICLE_LIMIT); | ||
|
||
this.probability = ASH_PARTICLE_LIMIT; | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
] | ||
}, | ||
"mixins": [ | ||
"mixins.cinderscapes-client.json" | ||
], | ||
"custom": { | ||
"modmenu": { | ||
|
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,11 @@ | ||
{ | ||
"required": true, | ||
"package": "com.terraformersmc.cinderscapes.mixin", | ||
"compatibilityLevel": "JAVA_17", | ||
"client": [ | ||
"MixinBiomeParticleConfig" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
} | ||
} |
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