patching what mojang patched
This commit is contained in:
1 parent
b8cf551df9
commit
136b2dca67
1 file changed
+9
-1
@@ -5,6 +5,7 @@ import carpet.mixins.WeightedPickerEntryMixin;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2LongMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.SpawnGroup;
|
||||
import net.minecraft.entity.EntityType;
|
||||
@@ -25,7 +26,9 @@ import net.minecraft.world.SpawnHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.gen.StructureAccessor;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.feature.StructureFeature;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -411,6 +414,11 @@ public class SpawnReporter
|
||||
entity.remove();
|
||||
}
|
||||
|
||||
// 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) {
|
||||
return spawnGroup == SpawnGroup.MONSTER && serverWorld.getBlockState(blockPos.down()).getBlock() == Blocks.NETHER_BRICKS && structureAccessor.method_28388(blockPos, false, StructureFeature.FORTRESS).hasChildren() ? StructureFeature.FORTRESS.getMonsterSpawns() : chunkGenerator.getEntitySpawnList(biome != null ? biome : serverWorld.getBiome(blockPos), structureAccessor, spawnGroup, blockPos);
|
||||
}
|
||||
|
||||
public static List<BaseText> report(BlockPos pos, ServerWorld worldIn)
|
||||
{
|
||||
List<BaseText> rep = new ArrayList<>();
|
||||
@@ -424,7 +432,7 @@ public class SpawnReporter
|
||||
for (SpawnGroup enumcreaturetype : SpawnGroup.values())
|
||||
{
|
||||
String type_code = String.format("%s", enumcreaturetype).substring(0, 3);
|
||||
List<Biome.SpawnEntry> lst = ((ChunkGenerator)worldIn.getChunkManager().getChunkGenerator()).getEntitySpawnList(worldIn.getBiome(pos), worldIn.getStructureAccessor(), enumcreaturetype, pos);
|
||||
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);
|
||||
if (lst != null && !lst.isEmpty())
|
||||
{
|
||||
for (Biome.SpawnEntry spawnEntry : lst)
|
||||
|
||||
Reference in new issue
Block a user