This commit is contained in:
gnembon committed 2020-05-13 16:58:12 -03:00
1 parent 903fe1e31a
commit dfd88b7142
23 files changed
+86 -100

No files matched your search

@@ -9,6 +9,7 @@ import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.source.BiomeSource;
import net.minecraft.world.gen.StructureAccessor;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.chunk.ChunkGeneratorConfig;
import net.minecraft.world.gen.chunk.FlatChunkGenerator;
import net.minecraft.world.gen.chunk.FlatChunkGeneratorConfig;
import net.minecraft.world.gen.feature.Feature;
@@ -17,19 +18,19 @@ import org.spongepowered.asm.mixin.Mixin;
import java.util.List;
@Mixin(FlatChunkGenerator.class)
public abstract class FlatChunkGeneratorMixin extends ChunkGenerator<FlatChunkGeneratorConfig>
public abstract class FlatChunkGeneratorMixin extends ChunkGenerator
{
public FlatChunkGeneratorMixin(IWorld iWorld, BiomeSource biome, FlatChunkGeneratorConfig chunkGeneratorConfig)
public FlatChunkGeneratorMixin(BiomeSource biomeSource, ChunkGeneratorConfig chunkGeneratorConfig)
{
super(iWorld, biome, chunkGeneratorConfig);
super(biomeSource, chunkGeneratorConfig);
}
@Override
public List<Biome.SpawnEntry> getEntitySpawnList(StructureAccessor arg, SpawnGroup category, BlockPos pos)
public List<Biome.SpawnEntry> getEntitySpawnList(Biome biome, StructureAccessor structureAccessor, SpawnGroup category, BlockPos blockPos)
{
if (CarpetSettings.flatWorldStructureSpawning)
{
if (Feature.SWAMP_HUT.method_14029(this.world, arg, pos))
if (Feature.SWAMP_HUT.isApproximatelyInsideStructure(structureAccessor, blockPos))
{
if (category == SpawnGroup.MONSTER)
{
@@ -43,37 +44,32 @@ public abstract class FlatChunkGeneratorMixin extends ChunkGenerator<FlatChunkGe
}
else if (category == SpawnGroup.MONSTER)
{
if (Feature.PILLAGER_OUTPOST.isApproximatelyInsideStructure(this.world, arg, pos))
if (Feature.PILLAGER_OUTPOST.isApproximatelyInsideStructure(structureAccessor, blockPos))
{
return Feature.PILLAGER_OUTPOST.getMonsterSpawns();
}
if (CarpetSettings.huskSpawningInTemples)
{
if (Feature.DESERT_PYRAMID.isApproximatelyInsideStructure(this.world, arg, pos))
if (Feature.DESERT_PYRAMID.isApproximatelyInsideStructure(structureAccessor, blockPos))
{
return Feature.DESERT_PYRAMID.getMonsterSpawns();
}
}
if (Feature.OCEAN_MONUMENT.isApproximatelyInsideStructure(this.world, arg, pos))
if (Feature.OCEAN_MONUMENT.isApproximatelyInsideStructure(structureAccessor, blockPos))
{
return Feature.OCEAN_MONUMENT.getMonsterSpawns();
}
if (Feature.NETHER_BRIDGE.isInsideStructure(this.world, arg, pos))
{
return Feature.NETHER_BRIDGE.getMonsterSpawns();
}
if (Feature.NETHER_BRIDGE.isApproximatelyInsideStructure(this.world, arg, pos) && this.world.getBlockState(pos.down(1)).getBlock() == Blocks.NETHER_BRICKS)
if (Feature.NETHER_BRIDGE.isInsideStructure(structureAccessor, blockPos))
{
return Feature.NETHER_BRIDGE.getMonsterSpawns();
}
if (CarpetSettings.shulkerSpawningInEndCities)
{
if (Feature.END_CITY.isInsideStructure(this.world, arg, pos))
if (Feature.END_CITY.isInsideStructure(structureAccessor, blockPos))
{
return Feature.END_CITY.getMonsterSpawns();
}
@@ -81,6 +77,6 @@ public abstract class FlatChunkGeneratorMixin extends ChunkGenerator<FlatChunkGe
}
}
return super.getEntitySpawnList(arg, category, pos);
return super.getEntitySpawnList(biome, structureAccessor, category, blockPos);
}
}