26.3-snap-2
This commit is contained in:
1 parent
9241a6a127
commit
73fc5f1d13
20 files changed
+73
-130
No files matched your search
@@ -2,23 +2,32 @@ package carpet.mixins;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.level.levelgen.feature.HugeFungusConfiguration;
|
||||
import net.minecraft.world.level.levelgen.feature.HugeFungusFeature;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyArgs;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
|
||||
|
||||
import static carpet.CarpetSettings.FungusGrowthMode.*;
|
||||
|
||||
@Mixin(HugeFungusFeature.class)
|
||||
public class HugeFungusFeatureMixin {
|
||||
@ModifyArgs(method = "place", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/levelgen/feature/HugeFungusFeature;placeStem(Lnet/minecraft/world/level/WorldGenLevel;Lnet/minecraft/util/RandomSource;Lnet/minecraft/world/level/levelgen/feature/HugeFungusConfiguration;Lnet/minecraft/core/BlockPos;IZ)V"))
|
||||
@Inject( method = "planted", at = @At("HEAD"), cancellable = true)
|
||||
private void planted(CallbackInfoReturnable<Boolean> cir) {
|
||||
if (CarpetSettings.thickFungusGrowth == ALL) {
|
||||
cir.setReturnValue(true);
|
||||
}
|
||||
}
|
||||
|
||||
/*@ModifyArgs(method = "place", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/levelgen/feature/HugeFungusFeature;placeStem(Lnet/minecraft/world/level/WorldGenLevel;Lnet/minecraft/util/RandomSource;Lnet/minecraft/world/level/levelgen/feature/HugeFungusConfiguration;Lnet/minecraft/core/BlockPos;IZ)V"))
|
||||
private void mixin(Args args) {
|
||||
boolean natural = !((HugeFungusConfiguration) args.get(2)).planted;
|
||||
args.set(5, natural && ((boolean) args.get(5)) ||
|
||||
!natural && (CarpetSettings.thickFungusGrowth == ALL ||
|
||||
CarpetSettings.thickFungusGrowth == RANDOM && ((RandomSource) args.get(1)).nextFloat() < 0.06F)
|
||||
);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
Reference in new issue
Block a user