This commit is contained in:
gnembon committed 2021-04-07 19:05:45 -03:00
1 parent 8054e0336d
commit 75a823f994
8 files changed
+20 -20

No files matched your search

+2 -2
View File
@@ -5,9 +5,9 @@ org.gradle.jvmargs=-Xmx1G
# check these on https://fabricmc.net/use # check these on https://fabricmc.net/use
# or better: https://modmuss50.me/fabric.html # or better: https://modmuss50.me/fabric.html
minecraft_version=21w13a minecraft_version=21w13a
yarn_mappings=21w13a+build.55 yarn_mappings=21w13a+build.59
loader_version=0.11.3 loader_version=0.11.3
fabric_version=0.32.6+1.17 fabric_version=0.32.7+1.17
# Mod Properties # Mod Properties
mod_version = 1.4.30 mod_version = 1.4.30
@@ -4,8 +4,8 @@ import carpet.CarpetSettings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.mojang.serialization.Codec; import com.mojang.serialization.Codec;
import net.minecraft.class_6012;
import net.minecraft.entity.EntityType; import net.minecraft.entity.EntityType;
import net.minecraft.util.collection.Pool;
import net.minecraft.world.MobSpawnerLogic; import net.minecraft.world.MobSpawnerLogic;
import net.minecraft.world.biome.SpawnSettings; import net.minecraft.world.biome.SpawnSettings;
import net.minecraft.world.gen.feature.BastionRemnantFeature; import net.minecraft.world.gen.feature.BastionRemnantFeature;
@@ -20,7 +20,7 @@ import java.util.List;
@Mixin(BastionRemnantFeature.class) @Mixin(BastionRemnantFeature.class)
public abstract class BastionRemnantFeatureMixin extends JigsawFeature public abstract class BastionRemnantFeatureMixin extends JigsawFeature
{ {
private static final class_6012<SpawnSettings.SpawnEntry> spawnList = class_6012.method_34989( private static final Pool<SpawnSettings.SpawnEntry> spawnList = Pool.of(
new SpawnSettings.SpawnEntry(EntityType.PIGLIN_BRUTE, 5, 1, 2), new SpawnSettings.SpawnEntry(EntityType.PIGLIN_BRUTE, 5, 1, 2),
new SpawnSettings.SpawnEntry(EntityType.PIGLIN, 10, 2, 4), new SpawnSettings.SpawnEntry(EntityType.PIGLIN, 10, 2, 4),
new SpawnSettings.SpawnEntry(EntityType.HOGLIN, 2, 1, 2) new SpawnSettings.SpawnEntry(EntityType.HOGLIN, 2, 1, 2)
@@ -32,7 +32,7 @@ public abstract class BastionRemnantFeatureMixin extends JigsawFeature
} }
@Override @Override
public class_6012<SpawnSettings.SpawnEntry> getMonsterSpawns() public Pool<SpawnSettings.SpawnEntry> getMonsterSpawns()
{ {
if (CarpetSettings.piglinsSpawningInBastions) if (CarpetSettings.piglinsSpawningInBastions)
return spawnList; return spawnList;
@@ -3,8 +3,8 @@ package carpet.mixins;
import carpet.CarpetSettings; import carpet.CarpetSettings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.mojang.serialization.Codec; import com.mojang.serialization.Codec;
import net.minecraft.class_6012;
import net.minecraft.entity.EntityType; import net.minecraft.entity.EntityType;
import net.minecraft.util.collection.Pool;
import net.minecraft.world.biome.SpawnSettings; import net.minecraft.world.biome.SpawnSettings;
import net.minecraft.world.gen.feature.DefaultFeatureConfig; import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import net.minecraft.world.gen.feature.DesertPyramidFeature; import net.minecraft.world.gen.feature.DesertPyramidFeature;
@@ -17,11 +17,11 @@ import java.util.List;
@Mixin(DesertPyramidFeature.class) @Mixin(DesertPyramidFeature.class)
public abstract class DesertPyramidFeatureMixin extends StructureFeature<DefaultFeatureConfig> public abstract class DesertPyramidFeatureMixin extends StructureFeature<DefaultFeatureConfig>
{ {
private static final class_6012<SpawnSettings.SpawnEntry> MONSTER_SPAWNS; private static final Pool<SpawnSettings.SpawnEntry> MONSTER_SPAWNS;
static static
{ {
MONSTER_SPAWNS = class_6012.method_34989(new SpawnSettings.SpawnEntry(EntityType.HUSK, 1, 1, 1)); MONSTER_SPAWNS = Pool.of(new SpawnSettings.SpawnEntry(EntityType.HUSK, 1, 1, 1));
} }
public DesertPyramidFeatureMixin(Codec<DefaultFeatureConfig> codec) public DesertPyramidFeatureMixin(Codec<DefaultFeatureConfig> codec)
@@ -31,7 +31,7 @@ public abstract class DesertPyramidFeatureMixin extends StructureFeature<Default
@Override @Override
public class_6012<SpawnSettings.SpawnEntry> getMonsterSpawns() public Pool<SpawnSettings.SpawnEntry> getMonsterSpawns()
{ {
if (CarpetSettings.huskSpawningInTemples) if (CarpetSettings.huskSpawningInTemples)
{ {
@@ -3,8 +3,8 @@ package carpet.mixins;
import carpet.CarpetSettings; import carpet.CarpetSettings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.mojang.serialization.Codec; import com.mojang.serialization.Codec;
import net.minecraft.class_6012;
import net.minecraft.entity.EntityType; import net.minecraft.entity.EntityType;
import net.minecraft.util.collection.Pool;
import net.minecraft.world.biome.SpawnSettings; import net.minecraft.world.biome.SpawnSettings;
import net.minecraft.world.gen.feature.DefaultFeatureConfig; import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import net.minecraft.world.gen.feature.EndCityFeature; import net.minecraft.world.gen.feature.EndCityFeature;
@@ -17,7 +17,7 @@ import java.util.List;
@Mixin(EndCityFeature.class) @Mixin(EndCityFeature.class)
public abstract class EndCityFeatureMixin extends StructureFeature<DefaultFeatureConfig> public abstract class EndCityFeatureMixin extends StructureFeature<DefaultFeatureConfig>
{ {
private static final class_6012<SpawnSettings.SpawnEntry> spawnList = class_6012.method_34989(new SpawnSettings.SpawnEntry(EntityType.SHULKER, 10, 4, 4)); private static final Pool<SpawnSettings.SpawnEntry> spawnList = Pool.of(new SpawnSettings.SpawnEntry(EntityType.SHULKER, 10, 4, 4));
public EndCityFeatureMixin(Codec<DefaultFeatureConfig> codec) public EndCityFeatureMixin(Codec<DefaultFeatureConfig> codec)
{ {
@@ -25,7 +25,7 @@ public abstract class EndCityFeatureMixin extends StructureFeature<DefaultFeatur
} }
@Override @Override
public class_6012<SpawnSettings.SpawnEntry> getMonsterSpawns() public Pool<SpawnSettings.SpawnEntry> getMonsterSpawns()
{ {
if (CarpetSettings.shulkerSpawningInEndCities) if (CarpetSettings.shulkerSpawningInEndCities)
return spawnList; return spawnList;
@@ -1,8 +1,8 @@
package carpet.mixins; package carpet.mixins;
import carpet.CarpetSettings; import carpet.CarpetSettings;
import net.minecraft.class_6012;
import net.minecraft.entity.SpawnGroup; import net.minecraft.entity.SpawnGroup;
import net.minecraft.util.collection.Pool;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.SpawnSettings; import net.minecraft.world.biome.SpawnSettings;
@@ -26,7 +26,7 @@ public abstract class FlatChunkGeneratorMixin extends ChunkGenerator
} }
@Override @Override
public class_6012<SpawnSettings.SpawnEntry> getEntitySpawnList(Biome biome, StructureAccessor accessor, SpawnGroup group, BlockPos pos) public Pool<SpawnSettings.SpawnEntry> getEntitySpawnList(Biome biome, StructureAccessor accessor, SpawnGroup group, BlockPos pos)
{ {
if (CarpetSettings.flatWorldStructureSpawning) if (CarpetSettings.flatWorldStructureSpawning)
{ {
@@ -1,8 +1,8 @@
package carpet.mixins; package carpet.mixins;
import carpet.CarpetSettings; import carpet.CarpetSettings;
import net.minecraft.class_6012;
import net.minecraft.entity.SpawnGroup; import net.minecraft.entity.SpawnGroup;
import net.minecraft.util.collection.Pool;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.SpawnSettings; import net.minecraft.world.biome.SpawnSettings;
@@ -30,7 +30,7 @@ public abstract class NoiseChunkGenerator_husksSpawnMixin extends ChunkGenerator
} }
@Inject(method = "getEntitySpawnList", at = @At("HEAD"), cancellable = true) @Inject(method = "getEntitySpawnList", at = @At("HEAD"), cancellable = true)
private void isInsidePyramid(Biome biome, StructureAccessor accessor, SpawnGroup group, BlockPos pos, CallbackInfoReturnable<class_6012<SpawnSettings.SpawnEntry>> cir) private void isInsidePyramid(Biome biome, StructureAccessor accessor, SpawnGroup group, BlockPos pos, CallbackInfoReturnable<Pool<SpawnSettings.SpawnEntry>> cir)
{ {
if (CarpetSettings.huskSpawningInTemples && group == SpawnGroup.MONSTER) if (CarpetSettings.huskSpawningInTemples && group == SpawnGroup.MONSTER)
{ {
@@ -159,10 +159,10 @@ public class PerimeterDiagnostics
private boolean check_entity_spawn(BlockPos pos) private boolean check_entity_spawn(BlockPos pos)
{ {
if (sle == null || !worldServer.getChunkManager().getChunkGenerator().getEntitySpawnList(worldServer.getBiome(pos), worldServer.getStructureAccessor(), ctype, pos).method_34994().contains(sle)) if (sle == null || !worldServer.getChunkManager().getChunkGenerator().getEntitySpawnList(worldServer.getBiome(pos), worldServer.getStructureAccessor(), ctype, pos).getEntries().contains(sle))
{ {
sle = null; sle = null;
for (SpawnSettings.SpawnEntry sle: worldServer.getChunkManager().getChunkGenerator().getEntitySpawnList(worldServer.getBiome(pos), worldServer.getStructureAccessor(), ctype, pos).method_34994()) for (SpawnSettings.SpawnEntry sle: worldServer.getChunkManager().getChunkGenerator().getEntitySpawnList(worldServer.getBiome(pos), worldServer.getStructureAccessor(), ctype, pos).getEntries())
{ {
if (el.getType() == sle.type) if (el.getType() == sle.type)
{ {
@@ -170,7 +170,7 @@ public class PerimeterDiagnostics
break; break;
} }
} }
if (sle == null || !worldServer.getChunkManager().getChunkGenerator().getEntitySpawnList(worldServer.getBiome(pos), worldServer.getStructureAccessor(), ctype, pos).method_34994().contains(sle)) if (sle == null || !worldServer.getChunkManager().getChunkGenerator().getEntitySpawnList(worldServer.getBiome(pos), worldServer.getStructureAccessor(), ctype, pos).getEntries().contains(sle))
{ {
return false; return false;
} }
@@ -420,7 +420,7 @@ public class SpawnReporter
// yeeted from SpawnHelper - temporary fix // yeeted from SpawnHelper - temporary fix
private static List<SpawnSettings.SpawnEntry> method_29950(ServerWorld serverWorld, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, SpawnGroup spawnGroup, BlockPos blockPos, /*@Nullable*/ Biome biome) { private static List<SpawnSettings.SpawnEntry> method_29950(ServerWorld serverWorld, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, SpawnGroup spawnGroup, BlockPos blockPos, /*@Nullable*/ Biome biome) {
return spawnGroup == SpawnGroup.MONSTER && serverWorld.getBlockState(blockPos.down()).getBlock() == Blocks.NETHER_BRICKS && structureAccessor.getStructureAt(blockPos, false, StructureFeature.FORTRESS).hasChildren() ? StructureFeature.FORTRESS.getMonsterSpawns().method_34994() : chunkGenerator.getEntitySpawnList(biome != null ? biome : serverWorld.getBiome(blockPos), structureAccessor, spawnGroup, blockPos).method_34994(); return spawnGroup == SpawnGroup.MONSTER && serverWorld.getBlockState(blockPos.down()).getBlock() == Blocks.NETHER_BRICKS && structureAccessor.getStructureAt(blockPos, false, StructureFeature.FORTRESS).hasChildren() ? StructureFeature.FORTRESS.getMonsterSpawns().getEntries() : chunkGenerator.getEntitySpawnList(biome != null ? biome : serverWorld.getBiome(blockPos), structureAccessor, spawnGroup, blockPos).getEntries();
} }
public static List<BaseText> report(BlockPos pos, ServerWorld worldIn) public static List<BaseText> report(BlockPos pos, ServerWorld worldIn)