Add the rule bruteSpawningInBationRemnants

This commit is contained in:
eatmyvenom committed 2020-07-02 22:35:26 -07:00
1 parent 03061ba114
commit 753d262f6e
3 files changed
+38

No files matched your search

+3
View File
@@ -214,6 +214,9 @@ public class CarpetSettings
@Rule( desc = "Shulkers will respawn in end cities", category = FEATURE )
public static boolean shulkerSpawningInEndCities = false;
@Rule( desc = "Piglin brutes will respawn in bastion remnants", category = FEATURE )
public static boolean bruteSpawningInBastionRemnants = false;
@Rule(desc = "Entities pushed or moved into unloaded chunks no longer disappear", category = {EXPERIMENTAL, BUGFIX})
public static boolean unloadedEntityFix = false;
@@ -0,0 +1,34 @@
package carpet.mixins;
import carpet.CarpetSettings;
import com.google.common.collect.Lists;
import com.mojang.serialization.Codec;
import net.minecraft.entity.EntityType;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.feature.BastionRemnantFeature;
import net.minecraft.world.gen.feature.BastionRemnantFeatureConfig;
import net.minecraft.world.gen.feature.StructureFeature;
import org.spongepowered.asm.mixin.Mixin;
import java.util.Collections;
import java.util.List;
@Mixin(BastionRemnantFeature.class)
public abstract class BastionRemnantFeatureMixin extends StructureFeature<BastionRemnantFeatureConfig> {
private static final List<Biome.SpawnEntry> spawnList = Lists.newArrayList(new Biome.SpawnEntry(EntityType.PIGLIN_BRUTE, 5, 1, 2), new Biome.SpawnEntry(EntityType.PIGLIN, 10, 2, 4));
public BastionRemnantFeatureMixin(Codec<BastionRemnantFeatureConfig> codec) {
super(codec);
}
@Override
public List<Biome.SpawnEntry> getMonsterSpawns()
{
if (CarpetSettings.bruteSpawningInBastionRemnants)
return spawnList;
return Collections.emptyList();
}
}