Code style changes, entities fixes

This commit is contained in:
paulevsGitch 2021-07-08 00:21:47 +03:00
parent 9d604b2d25
commit 44962e18b6
377 changed files with 5038 additions and 4914 deletions

View file

@ -1,8 +1,5 @@
package ru.betterend.registry;
import java.util.Collection;
import java.util.function.Supplier;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.biome.Biome;
@ -25,6 +22,9 @@ import ru.betterend.world.structures.piece.NBTPiece;
import ru.betterend.world.structures.piece.PaintedMountainPiece;
import ru.betterend.world.structures.piece.VoxelPiece;
import java.util.Collection;
import java.util.function.Supplier;
public class EndStructures {
public static final StructurePieceType VOXEL_PIECE = register("voxel", VoxelPiece::new);
public static final StructurePieceType MOUNTAIN_PIECE = register("mountain_piece", CrystalMountainPiece::new);
@ -32,7 +32,7 @@ public class EndStructures {
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 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);
@ -40,20 +40,23 @@ public class EndStructures {
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() {}
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) {
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(); });
structures.add(() -> {
return feature.getFeatureConfigured();
});
}
}