Portals as structure feature
This commit is contained in:
parent
97eacdff1c
commit
40f8342732
7 changed files with 190 additions and 84 deletions
|
@ -11,6 +11,7 @@ import net.minecraft.world.gen.GenerationStep.Feature;
|
|||
import net.minecraft.world.gen.feature.ConfiguredStructureFeature;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.world.structures.EndStructureFeature;
|
||||
import ru.betterend.world.structures.features.StructureEternalPortal;
|
||||
import ru.betterend.world.structures.features.StructureGiantMossyGlowshroom;
|
||||
import ru.betterend.world.structures.features.StructureMegaLake;
|
||||
import ru.betterend.world.structures.features.StructureMountain;
|
||||
|
@ -18,6 +19,7 @@ import ru.betterend.world.structures.features.StructurePaintedMountain;
|
|||
import ru.betterend.world.structures.piece.CavePiece;
|
||||
import ru.betterend.world.structures.piece.LakePiece;
|
||||
import ru.betterend.world.structures.piece.MountainPiece;
|
||||
import ru.betterend.world.structures.piece.NBTPiece;
|
||||
import ru.betterend.world.structures.piece.PaintedMountainPiece;
|
||||
import ru.betterend.world.structures.piece.VoxelPiece;
|
||||
|
||||
|
@ -27,11 +29,13 @@ public class EndStructures {
|
|||
public static final StructurePieceType CAVE_PIECE = register("cave_piece", CavePiece::new);
|
||||
public static final StructurePieceType LAKE_PIECE = register("lake_piece", LakePiece::new);
|
||||
public static final StructurePieceType PAINTED_MOUNTAIN_PIECE = register("painted_mountain_piece", PaintedMountainPiece::new);
|
||||
public static final StructurePieceType NBT_PIECE = register("nbt_piece", NBTPiece::new);
|
||||
|
||||
public static final EndStructureFeature GIANT_MOSSY_GLOWSHROOM = new EndStructureFeature("giant_mossy_glowshroom", new StructureGiantMossyGlowshroom(), Feature.SURFACE_STRUCTURES, 16, 8);
|
||||
public static final EndStructureFeature MEGALAKE = new EndStructureFeature("megalake", new StructureMegaLake(), Feature.RAW_GENERATION, 4, 1);
|
||||
public static final EndStructureFeature MOUNTAIN = new EndStructureFeature("mountain", new StructureMountain(), Feature.RAW_GENERATION, 3, 2);
|
||||
public static final EndStructureFeature PAINTED_MOUNTAIN = new EndStructureFeature("painted_mountain", new StructurePaintedMountain(), Feature.RAW_GENERATION, 3, 2);
|
||||
public static final EndStructureFeature ETERNAL_PORTAL = new EndStructureFeature("eternal_portal", new StructureEternalPortal(), Feature.SURFACE_STRUCTURES, 16, 6);
|
||||
|
||||
public static void register() {}
|
||||
|
||||
|
@ -40,15 +44,12 @@ public class EndStructures {
|
|||
}
|
||||
|
||||
public static void registerBiomeStructures(Identifier id, Biome biome, Collection<Supplier<ConfiguredStructureFeature<?, ?>>> structures) {
|
||||
/*if (id.getNamespace().equals("minecraft")) {
|
||||
if (id.getPath().equals("end_highlands")) {
|
||||
structures.clear();
|
||||
addStructure(MOUNTAIN, structures);
|
||||
}
|
||||
}*/
|
||||
if (!id.getPath().contains("mountain")) {
|
||||
addStructure(ETERNAL_PORTAL, structures);
|
||||
}
|
||||
}
|
||||
|
||||
protected static void addStructure(EndStructureFeature feature, Collection<Supplier<ConfiguredStructureFeature<?, ?>>> collection) {
|
||||
collection.add(() -> { return feature.getFeatureConfigured(); });
|
||||
private static void addStructure(EndStructureFeature feature, Collection<Supplier<ConfiguredStructureFeature<?, ?>>> structures) {
|
||||
structures.add(() -> { return feature.getFeatureConfigured(); });
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue