Rename fungus growth enum given the rule is no longer about a fix
This commit is contained in:
2 files changed
+5
-5
No files matched your search
@@ -1144,7 +1144,7 @@ public class CarpetSettings
|
|||||||
)
|
)
|
||||||
public static boolean tickSyncedWorldBorders = false;
|
public static boolean tickSyncedWorldBorders = false;
|
||||||
|
|
||||||
public enum FungusFixMode {
|
public enum FungusGrowthMode {
|
||||||
FALSE, RANDOM, ALL;
|
FALSE, RANDOM, ALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1154,5 +1154,5 @@ public class CarpetSettings
|
|||||||
extra = {"Setting to 'all' will make all nether fungi grow into 3x3 trees", "Setting to 'random' will make 6% of all nether fungi grow into 3x3 trees", "(this being consistent with worldgen)"},
|
extra = {"Setting to 'all' will make all nether fungi grow into 3x3 trees", "Setting to 'random' will make 6% of all nether fungi grow into 3x3 trees", "(this being consistent with worldgen)"},
|
||||||
category = {SURVIVAL, FEATURE}
|
category = {SURVIVAL, FEATURE}
|
||||||
)
|
)
|
||||||
public static FungusFixMode thickFungusGrowth = FungusFixMode.FALSE;
|
public static FungusGrowthMode thickFungusGrowth = FungusGrowthMode.FALSE;
|
||||||
}
|
}
|
||||||
@@ -9,7 +9,7 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||||||
import org.spongepowered.asm.mixin.injection.ModifyArgs;
|
import org.spongepowered.asm.mixin.injection.ModifyArgs;
|
||||||
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
|
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
|
||||||
|
|
||||||
import static carpet.CarpetSettings.FungusFixMode.*;
|
import static carpet.CarpetSettings.FungusGrowthMode.*;
|
||||||
|
|
||||||
@Mixin(HugeFungusFeature.class)
|
@Mixin(HugeFungusFeature.class)
|
||||||
public class HugeFungusFeatureMixin {
|
public class HugeFungusFeatureMixin {
|
||||||
@@ -17,8 +17,8 @@ public class HugeFungusFeatureMixin {
|
|||||||
private void mixin(Args args) {
|
private void mixin(Args args) {
|
||||||
boolean natural = !((HugeFungusConfiguration) args.get(2)).planted;
|
boolean natural = !((HugeFungusConfiguration) args.get(2)).planted;
|
||||||
args.set(5, natural && ((boolean) args.get(5)) ||
|
args.set(5, natural && ((boolean) args.get(5)) ||
|
||||||
!natural && (CarpetSettings.thickFungusGrowth.equals(ALL) ||
|
!natural && (CarpetSettings.thickFungusGrowth == ALL ||
|
||||||
CarpetSettings.thickFungusGrowth.equals(RANDOM) && ((RandomSource) args.get(1)).nextFloat() < 0.06F)
|
CarpetSettings.thickFungusGrowth == RANDOM && ((RandomSource) args.get(1)).nextFloat() < 0.06F)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user