seems to be working fine, but trees and other decorations received massive bureaucratic payload
This commit is contained in:
1 parent
dee3363a0d
commit
3b6c1d045e
2 files changed
+14
-10
No files matched your search
@@ -2,10 +2,10 @@ package carpet.helpers;
|
||||
|
||||
import carpet.settings.CarpetSettings;
|
||||
import carpet.fakes.StructureFeatureInterface;
|
||||
import com.google.common.collect.Sets;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.Biomes;
|
||||
import net.minecraft.world.biome.source.BiomeSource;
|
||||
@@ -22,6 +22,7 @@ import net.minecraft.world.gen.feature.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class FeatureGenerator
|
||||
{
|
||||
@@ -48,8 +49,8 @@ public class FeatureGenerator
|
||||
|
||||
private static Thing spawnCustomStructure(StructureFeature structure, FeatureConfig conf, Biome biome)
|
||||
{
|
||||
if (1+2==3)
|
||||
throw new RuntimeException("rebuild me");
|
||||
//if (1+2==3)
|
||||
// throw new RuntimeException("rebuild me");
|
||||
return (w, p) -> {
|
||||
ChunkGenerator chunkgen = new OverworldChunkGenerator(w, w.method_14178().getChunkGenerator().getBiomeSource(), new OverworldChunkGeneratorConfig()) // BiomeSourceType.VANILLA_LAYERED.applyConfig((BiomeSourceType.VANILLA_LAYERED.getConfig())), ChunkGeneratorType.SURFACE.createSettings())
|
||||
{
|
||||
@@ -64,11 +65,17 @@ public class FeatureGenerator
|
||||
{
|
||||
return new VanillaLayeredBiomeSource(new VanillaLayeredBiomeSourceConfig(w.getLevelProperties()))
|
||||
{
|
||||
// // // @Override
|
||||
public Biome getBiome(int i, int j, int k)
|
||||
@Override
|
||||
public Biome getStoredBiome(int i, int j, int k)
|
||||
{
|
||||
return biome;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Biome> getBiomesInArea(int int_1, int int_2, int int_3, int int_4)
|
||||
{
|
||||
return Sets.newHashSet(biome);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
@@ -84,6 +91,7 @@ public class FeatureGenerator
|
||||
return featureMap.get(name).plop(world, pos);
|
||||
return null;
|
||||
}
|
||||
public static void noop() {System.out.println("boo");}
|
||||
|
||||
private static Map<String, Thing> featureMap = new HashMap<String, Thing>() {{
|
||||
|
||||
|
||||
@@ -102,10 +102,6 @@ public abstract class StructureFeatureMixin implements StructureFeatureInterface
|
||||
|
||||
private StructureStart forceStructureStart(IWorld worldIn, ChunkGenerator <? extends ChunkGeneratorConfig > generator, Random rand, long packedChunkPos)
|
||||
{
|
||||
if (2+1==3)
|
||||
{
|
||||
throw new RuntimeException("reimplement it");
|
||||
}
|
||||
ChunkPos chunkpos = new ChunkPos(packedChunkPos);
|
||||
StructureStart structurestart;
|
||||
|
||||
@@ -120,7 +116,7 @@ public abstract class StructureFeatureMixin implements StructureFeatureInterface
|
||||
return structurestart;
|
||||
}
|
||||
}
|
||||
Biome biome_1 = Biomes.PLAINS;// generator.getBiomeSource().getBiome((chunkpos.getStartX() + 9) >> 2, 0, (chunkpos.getStartZ() + 9) >> 2 );
|
||||
Biome biome_1 = generator.getBiomeSource().getStoredBiome((chunkpos.getStartX() + 9) >> 2, 0, (chunkpos.getStartZ() + 9) >> 2 );
|
||||
StructureStart structurestart1 = getStructureStartFactory().create((StructureFeature)(Object)this, chunkpos.x, chunkpos.z, BlockBox.empty(),0,generator.getSeed());
|
||||
structurestart1.initialize(generator, ((ServerWorld)worldIn).getStructureManager() , chunkpos.x, chunkpos.z, biome_1);
|
||||
structurestart = structurestart1.hasChildren() ? structurestart1 : StructureStart.DEFAULT;
|
||||
|
||||
Reference in new issue
Block a user