Continue mapping migration

This commit is contained in:
Aleksey 2021-04-12 21:38:22 +03:00
parent 99ade39404
commit f03fd03bd0
499 changed files with 12567 additions and 12723 deletions

View file

@ -2,13 +2,12 @@ package ru.betterend.registry;
import java.util.Collection;
import java.util.function.Supplier;
import net.minecraft.structure.StructurePieceType;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.gen.GenerationStep.Feature;
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature;
import net.minecraft.world.level.levelgen.feature.StructurePieceType;
import ru.betterend.BetterEnd;
import ru.betterend.world.structures.EndStructureFeature;
import ru.betterend.world.structures.features.EternalPortalStructure;
@ -30,43 +29,30 @@ public class EndStructures {
public static final StructurePieceType MOUNTAIN_PIECE = register("mountain_piece", CrystalMountainPiece::new);
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 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 GiantMossyGlowshroomStructure(), Feature.SURFACE_STRUCTURES, 16, 8);
public static final EndStructureFeature MEGALAKE = new EndStructureFeature("megalake", new MegaLakeStructure(),
Feature.RAW_GENERATION, 4, 1);
public static final EndStructureFeature MEGALAKE_SMALL = new EndStructureFeature("megalake_small",
new MegaLakeSmallStructure(), Feature.RAW_GENERATION, 4, 1);
public static final EndStructureFeature MOUNTAIN = new EndStructureFeature("mountain", new MountainStructure(),
Feature.RAW_GENERATION, 3, 2);
public static final EndStructureFeature PAINTED_MOUNTAIN = new EndStructureFeature("painted_mountain",
new PaintedMountainStructure(), Feature.RAW_GENERATION, 3, 2);
public static final EndStructureFeature ETERNAL_PORTAL = new EndStructureFeature("eternal_portal",
new EternalPortalStructure(), Feature.SURFACE_STRUCTURES, 16, 6);
public static final EndStructureFeature GIANT_ICE_STAR = new EndStructureFeature("giant_ice_star",
new GiantIceStarStructure(), Feature.SURFACE_STRUCTURES, 16, 8);
public static void register() {
}
public static final EndStructureFeature GIANT_MOSSY_GLOWSHROOM = new EndStructureFeature("giant_mossy_glowshroom", new GiantMossyGlowshroomStructure(), Decoration.SURFACE_STRUCTURES, 16, 8);
public static final EndStructureFeature MEGALAKE = new EndStructureFeature("megalake", new MegaLakeStructure(), Decoration.RAW_GENERATION, 4, 1);
public static final EndStructureFeature MEGALAKE_SMALL = new EndStructureFeature("megalake_small", new MegaLakeSmallStructure(), Decoration.RAW_GENERATION, 4, 1);
public static final EndStructureFeature MOUNTAIN = new EndStructureFeature("mountain", new MountainStructure(), Decoration.RAW_GENERATION, 3, 2);
public static final EndStructureFeature PAINTED_MOUNTAIN = new EndStructureFeature("painted_mountain", new PaintedMountainStructure(), Decoration.RAW_GENERATION, 3, 2);
public static final EndStructureFeature ETERNAL_PORTAL = new EndStructureFeature("eternal_portal", new EternalPortalStructure(), Decoration.SURFACE_STRUCTURES, 16, 6);
public static final EndStructureFeature GIANT_ICE_STAR = new EndStructureFeature("giant_ice_star", new GiantIceStarStructure(), Decoration.SURFACE_STRUCTURES, 16, 8);
public static void register() {}
private static StructurePieceType register(String id, StructurePieceType pieceType) {
return Registry.register(Registry.STRUCTURE_PIECE, BetterEnd.makeID(id), pieceType);
}
public static void registerBiomeStructures(ResourceLocation id, Biome biome,
Collection<Supplier<ConfiguredStructureFeature<?, ?>>> structures) {
public static void registerBiomeStructures(ResourceLocation id, Biome biome, Collection<Supplier<ConfiguredStructureFeature<?, ?>>> structures) {
if (!id.getPath().contains("mountain") && !id.getPath().contains("lake")) {
addStructure(ETERNAL_PORTAL, structures);
}
}
private static void addStructure(EndStructureFeature feature,
Collection<Supplier<ConfiguredStructureFeature<?, ?>>> structures) {
structures.add(() -> {
return feature.getFeatureConfigured();
});
private static void addStructure(EndStructureFeature feature, Collection<Supplier<ConfiguredStructureFeature<?, ?>>> structures) {
structures.add(() -> { return feature.getFeatureConfigured(); });
}
}