-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHugeFungusFeatureMixin.java
More file actions
36 lines (29 loc) · 1.85 KB
/
Copy pathHugeFungusFeatureMixin.java
File metadata and controls
36 lines (29 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package net.fabricmc.example.rtf.mixin;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.gen.feature.HugeFungusFeature;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(HugeFungusFeature.class)
class HugeFungusFeatureMixin {
private static final float NEW_TALL_FUNGUS_CHANCE = 0.40F;
@ModifyArg(method = "generate", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/random/Random;nextInt(I)I"))
private int increaseTallFungusChance(int bound) {
return (int) (1 / NEW_TALL_FUNGUS_CHANCE);
}
@ModifyArg(method = "generateHat", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/gen/feature/HugeFungusFeature;placeHatBlock(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/random/Random;Lnet/minecraft/world/gen/feature/HugeFungusFeatureConfig;Lnet/minecraft/util/math/BlockPos$Mutable;FFF)V")
, index = 4)
private float increaseFungusShroomBloat(float decorationChance) {
return 0;
}
@ModifyArg(method = "generateHat", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/gen/feature/HugeFungusFeature;placeHatBlock(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/random/Random;Lnet/minecraft/world/gen/feature/HugeFungusFeatureConfig;Lnet/minecraft/util/math/BlockPos$Mutable;FFF)V")
, index = 5)
private float increaseFungusWartBloat(float generationChance) {
return 1; // change around the shroom and wart bloat values to vary what you see, note shrooms generate 'on top' of shrooms
}
@Redirect(method = "placeWithOptionalVines", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/random/Random;nextFloat()F"))
private float maxVRM(Random instance) {
return 0.0F; // change to 0.15 or above for a 0% chance of any vines.
}
}