1.16.2-pre1

This commit is contained in:
gnembon committed 2020-07-29 17:28:15 -03:00
1 parent 28857815e0
commit bab49be81e
10 files changed
+29 -22

No files matched your search

+2 -2
View File
@@ -4,8 +4,8 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/use
# or better: https://modmuss50.me/fabric.html
minecraft_version=20w30a
yarn_mappings=20w30a+build.26
minecraft_version=1.16.2-pre1
yarn_mappings=1.16.2-pre1+build.1
loader_version=0.9.0+build.204
# Mod Properties
@@ -140,7 +140,7 @@ public class FeatureGenerator
private static ConfiguredStructureFeature<?, ?> getDefaultFeature(StructureFeature<?> structure, ServerWorld world, BlockPos pos, boolean tryHard)
{
ConfiguredStructureFeature<?, ?> configuredFeature = world.getBiome(pos).method_28405(structure.configure(null));
ConfiguredStructureFeature<?, ?> configuredFeature = world.getBiome(pos).method_30970().method_30978(structure.configure(null));
if (configuredFeature.config != null || !tryHard) return configuredFeature;
return BuiltinRegistries.CONFIGURED_STRUCTURE_FEATURE.getEntries().stream().
filter(cS -> cS.getValue().feature == structure).
@@ -159,7 +159,7 @@ public class FeatureGenerator
ChunkRandom chunkRandom = new ChunkRandom();
ChunkPos chunkPos = new ChunkPos(pos);
Biome biome = biomeAccess.getBiome(new BlockPos(chunkPos.getStartX() + 9, 0, chunkPos.getStartZ() + 9));
ConfiguredStructureFeature<?, ?> configuredFeature = biome.method_28405(structure.configure(null));
ConfiguredStructureFeature<?, ?> configuredFeature = biome.method_30970().method_30978(structure.configure(null));
if (configuredFeature == null || configuredFeature.config == null) return null;
ChunkPos chunkPos2 = structure.getStartChunk(params, seed, chunkRandom, chunkPos.x, chunkPos.z); //find some chunk I guess
if (chunkPos.x == chunkPos2.x && chunkPos.z == chunkPos2.z && ((StructureFeatureInterface)structure).shouldStartPublicAt(generator, generator.getBiomeSource(), seed, chunkRandom, chunkPos.x, chunkPos.z, biome, chunkPos, configuredFeature.config)) // should start at
@@ -7,6 +7,7 @@ import com.mojang.serialization.Codec;
import net.minecraft.class_5434;
import net.minecraft.entity.EntityType;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.SpawnSettings;
import net.minecraft.world.gen.feature.BastionRemnantFeature;
import net.minecraft.world.gen.feature.StructurePoolFeatureConfig;
@@ -18,10 +19,10 @@ import java.util.List;
@Mixin(BastionRemnantFeature.class)
public abstract class BastionRemnantFeatureMixin extends class_5434
{
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),
new Biome.SpawnEntry(EntityType.HOGLIN, 2, 1, 2)
private static final List<SpawnSettings.SpawnEntry> spawnList = Lists.newArrayList(
new SpawnSettings.SpawnEntry(EntityType.PIGLIN_BRUTE, 5, 1, 2),
new SpawnSettings.SpawnEntry(EntityType.PIGLIN, 10, 2, 4),
new SpawnSettings.SpawnEntry(EntityType.HOGLIN, 2, 1, 2)
);
public BastionRemnantFeatureMixin(Codec<StructurePoolFeatureConfig> codec, int i, boolean bl, boolean bl2)
@@ -30,7 +31,7 @@ public abstract class BastionRemnantFeatureMixin extends class_5434
}
@Override
public List<Biome.SpawnEntry> getMonsterSpawns()
public List<SpawnSettings.SpawnEntry> getMonsterSpawns()
{
if (CarpetSettings.piglinsSpawningInBastions)
return spawnList;
@@ -7,6 +7,7 @@ import com.mojang.serialization.Codec;
import net.minecraft.entity.EntityType;
import net.minecraft.world.biome.Biome;
//import net.minecraft.world.gen.feature.AbstractTempleFeature;
import net.minecraft.world.biome.SpawnSettings;
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import net.minecraft.world.gen.feature.DesertPyramidFeature;
import net.minecraft.world.gen.feature.StructureFeature;
@@ -19,11 +20,11 @@ import java.util.List;
@Mixin(DesertPyramidFeature.class)
public abstract class DesertPyramidFeatureMixin extends StructureFeature<DefaultFeatureConfig>
{
private static final List<Biome.SpawnEntry> MONSTER_SPAWNS;
private static final List<SpawnSettings.SpawnEntry> MONSTER_SPAWNS;
static
{
MONSTER_SPAWNS = Lists.newArrayList(new Biome.SpawnEntry(EntityType.HUSK, 1, 1, 1));
MONSTER_SPAWNS = Lists.newArrayList(new SpawnSettings.SpawnEntry(EntityType.HUSK, 1, 1, 1));
}
public DesertPyramidFeatureMixin(Codec<DefaultFeatureConfig> codec)
@@ -33,7 +34,7 @@ public abstract class DesertPyramidFeatureMixin extends StructureFeature<Default
@Override
public List<Biome.SpawnEntry> getMonsterSpawns()
public List<SpawnSettings.SpawnEntry> getMonsterSpawns()
{
if (CarpetSettings.huskSpawningInTemples)
{
@@ -6,6 +6,7 @@ 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.biome.SpawnSettings;
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import net.minecraft.world.gen.feature.EndCityFeature;
import net.minecraft.world.gen.feature.StructureFeature;
@@ -18,7 +19,7 @@ import java.util.List;
@Mixin(EndCityFeature.class)
public abstract class EndCityFeatureMixin extends StructureFeature<DefaultFeatureConfig>
{
private static final List<Biome.SpawnEntry> spawnList = Lists.newArrayList(new Biome.SpawnEntry(EntityType.SHULKER, 10, 4, 4));
private static final List<SpawnSettings.SpawnEntry> spawnList = Lists.newArrayList(new SpawnSettings.SpawnEntry(EntityType.SHULKER, 10, 4, 4));
public EndCityFeatureMixin(Codec<DefaultFeatureConfig> codec)
{
@@ -26,7 +27,7 @@ public abstract class EndCityFeatureMixin extends StructureFeature<DefaultFeatur
}
@Override
public List<Biome.SpawnEntry> getMonsterSpawns()
public List<SpawnSettings.SpawnEntry> getMonsterSpawns()
{
if (CarpetSettings.shulkerSpawningInEndCities)
return spawnList;
@@ -6,6 +6,7 @@ import net.minecraft.entity.SpawnGroup;
import net.minecraft.util.math.BlockPos;
//import net.minecraft.world.WorldAccess;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.SpawnSettings;
import net.minecraft.world.biome.source.BiomeSource;
import net.minecraft.world.gen.StructureAccessor;
import net.minecraft.world.gen.chunk.ChunkGenerator;
@@ -29,7 +30,7 @@ public abstract class FlatChunkGeneratorMixin extends ChunkGenerator
}
@Override
public List<Biome.SpawnEntry> getEntitySpawnList(Biome biome, StructureAccessor accessor, SpawnGroup group, BlockPos pos)
public List<SpawnSettings.SpawnEntry> getEntitySpawnList(Biome biome, StructureAccessor accessor, SpawnGroup group, BlockPos pos)
{
if (CarpetSettings.flatWorldStructureSpawning)
{
@@ -46,7 +46,7 @@ public class SpawnHelperMixin
@Shadow @Final private static SpawnGroup[] SPAWNABLE_GROUPS;
@Redirect(method = "canSpawn(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/SpawnGroup;Lnet/minecraft/world/gen/StructureAccessor;Lnet/minecraft/world/gen/chunk/ChunkGenerator;Lnet/minecraft/world/biome/Biome$SpawnEntry;Lnet/minecraft/util/math/BlockPos$Mutable;D)Z", at = @At(
@Redirect(method = "canSpawn(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/SpawnGroup;Lnet/minecraft/world/gen/StructureAccessor;Lnet/minecraft/world/gen/chunk/ChunkGenerator;Lnet/minecraft/world/biome/SpawnSettings$SpawnEntry;Lnet/minecraft/util/math/BlockPos$Mutable;D)Z", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/server/world/ServerWorld;doesNotCollide(Lnet/minecraft/util/math/Box;)Z"
))
@@ -4,6 +4,7 @@ import carpet.CarpetSettings;
import net.minecraft.entity.SpawnGroup;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.SpawnSettings;
import net.minecraft.world.biome.source.BiomeSource;
import net.minecraft.world.gen.StructureAccessor;
import net.minecraft.world.gen.chunk.ChunkGenerator;
@@ -28,7 +29,7 @@ public abstract class SurfaceChunkGenerator_husksSpawnMixin extends ChunkGenerat
}
@Inject(method = "getEntitySpawnList", at = @At("HEAD"), cancellable = true)
private void isInsidePyramid(Biome biome, StructureAccessor accessor, SpawnGroup group, BlockPos pos, CallbackInfoReturnable<List<Biome.SpawnEntry>> cir)
private void isInsidePyramid(Biome biome, StructureAccessor accessor, SpawnGroup group, BlockPos pos, CallbackInfoReturnable<List<SpawnSettings.SpawnEntry>> cir)
{
if (CarpetSettings.huskSpawningInTemples && group == SpawnGroup.MONSTER)
{
@@ -17,6 +17,7 @@ import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.SpawnHelper;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.SpawnSettings;
import java.util.ArrayList;
import java.util.List;
@@ -34,7 +35,7 @@ public class PerimeterDiagnostics
samples = new ArrayList<>();
}
}
private Biome.SpawnEntry sle;
private SpawnSettings.SpawnEntry sle;
private ServerWorld worldServer;
private SpawnGroup ctype;
private MobEntity el;
@@ -161,7 +162,7 @@ public class PerimeterDiagnostics
if (sle == null || !worldServer.getChunkManager().getChunkGenerator().getEntitySpawnList(worldServer.getBiome(pos), worldServer.getStructureAccessor(), ctype, pos).contains(sle))
{
sle = null;
for (Biome.SpawnEntry sle: worldServer.getChunkManager().getChunkGenerator().getEntitySpawnList(worldServer.getBiome(pos), worldServer.getStructureAccessor(), ctype, pos))
for (SpawnSettings.SpawnEntry sle: worldServer.getChunkManager().getChunkGenerator().getEntitySpawnList(worldServer.getBiome(pos), worldServer.getStructureAccessor(), ctype, pos))
{
if (el.getType() == sle.type)
{
@@ -25,6 +25,7 @@ import net.minecraft.world.Heightmap;
import net.minecraft.world.SpawnHelper;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.SpawnSettings;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.gen.StructureAccessor;
import net.minecraft.world.gen.chunk.ChunkGenerator;
@@ -415,7 +416,7 @@ public class SpawnReporter
}
// yeeted from SpawnHelper - temporary fix
private static List<Biome.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() : chunkGenerator.getEntitySpawnList(biome != null ? biome : serverWorld.getBiome(blockPos), structureAccessor, spawnGroup, blockPos);
}
@@ -432,10 +433,10 @@ public class SpawnReporter
for (SpawnGroup enumcreaturetype : SpawnGroup.values())
{
String type_code = String.format("%s", enumcreaturetype).substring(0, 3);
List<Biome.SpawnEntry> lst = method_29950(worldIn, worldIn.getStructureAccessor(), worldIn.getChunkManager().getChunkGenerator(), enumcreaturetype, pos, worldIn.getBiome(pos) );// ((ChunkGenerator)worldIn.getChunkManager().getChunkGenerator()).getEntitySpawnList(, worldIn.getStructureAccessor(), enumcreaturetype, pos);
List<SpawnSettings.SpawnEntry> lst = method_29950(worldIn, worldIn.getStructureAccessor(), worldIn.getChunkManager().getChunkGenerator(), enumcreaturetype, pos, worldIn.getBiome(pos) );// ((ChunkGenerator)worldIn.getChunkManager().getChunkGenerator()).getEntitySpawnList(, worldIn.getStructureAccessor(), enumcreaturetype, pos);
if (lst != null && !lst.isEmpty())
{
for (Biome.SpawnEntry spawnEntry : lst)
for (SpawnSettings.SpawnEntry spawnEntry : lst)
{
if (SpawnRestriction.getLocation(spawnEntry.type)==null)
continue; // vanilla bug