Biome, Structure and Feature fixes

This commit is contained in:
Frank 2022-04-03 23:45:18 +02:00
parent bcde62209b
commit 1cdbcacd7b
45 changed files with 112 additions and 99 deletions

View file

@ -3,6 +3,7 @@ package ru.betterend.registry;
import com.google.common.collect.Lists;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import net.minecraft.core.Holder;
import net.minecraft.core.Registry;
import net.minecraft.data.BuiltinRegistries;
import net.minecraft.resources.ResourceLocation;
@ -304,15 +305,21 @@ public class EndFeatures {
private static BCLFeature registerLayer(String name, Block block, float radius, int minY, int maxY, int count) {
OreLayerFeature layer = new OreLayerFeature(block.defaultBlockState(), radius, minY, maxY);
PlacedFeature configured = layer.configured(FeatureConfiguration.NONE).placed(new PlacementModifier[]{CountPlacement.of(count)});
return new BCLFeature(BetterEnd.makeID(name), layer, GenerationStep.Decoration.UNDERGROUND_ORES, configured);
//PlacedFeature configured = layer.configured(FeatureConfiguration.NONE).placed(new PlacementModifier[]{CountPlacement.of(count)});
// return new BCLFeature(BetterEnd.makeID(name), layer, GenerationStep.Decoration.UNDERGROUND_ORES, configured);
return BCLFeatureBuilder
.start(BetterEnd.makeID(name), layer)
.decoration( GenerationStep.Decoration.UNDERGROUND_ORES)
.modifier(CountPlacement.of(count))
.build();
}
private static BCLFeature registerLayer(String name, StoneMaterial material, float radius, int minY, int maxY, int count) {
return registerLayer(name, material.stone, radius, minY, maxY, count);
}
public static void addBiomeFeatures(ResourceLocation id, Biome biome) {
public static void addBiomeFeatures(ResourceLocation id, Holder<Biome> biome) {
BiomeAPI.addBiomeFeature(biome, FLAVOLITE_LAYER);
BiomeAPI.addBiomeFeature(biome, THALLASIUM_ORE);
BiomeAPI.addBiomeFeature(biome, ENDER_ORE);
@ -345,7 +352,12 @@ public class EndFeatures {
if (BuiltinRegistries.PLACED_FEATURE.containsKey(id)) {
PlacedFeature placed = BuiltinRegistries.PLACED_FEATURE.get(id);
Feature<?> feature = Registry.FEATURE.get(id);
return new BCLFeature(id, feature, Decoration.SURFACE_STRUCTURES, placed);
//return new BCLFeature(id, feature, Decoration.SURFACE_STRUCTURES, placed);
return BCLFeatureBuilder
.start(id, feature)
.decoration(Decoration.SURFACE_STRUCTURES)
.modifier(placed.placement())
.build(placed.feature().value().config());
}
String path = "/data/" + ns + "/structures/biome/" + nm + "/";

View file

@ -1,11 +1,13 @@
package ru.betterend.registry;
import net.minecraft.core.Holder;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceType;
import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.api.tag.TagAPI;
import ru.bclib.world.structures.BCLStructureFeature;
import ru.betterend.BetterEnd;
import ru.betterend.world.structures.features.EternalPortalStructure;
@ -86,9 +88,9 @@ public class EndStructures {
return Registry.register(Registry.STRUCTURE_PIECE, BetterEnd.makeID(id), pieceType);
}
public static void addBiomeStructures(ResourceLocation biomeID, Biome biome) {
public static void addBiomeStructures(ResourceLocation biomeID, Holder<Biome> biome) {
if (!biomeID.getPath().contains("mountain") && !biomeID.getPath().contains("lake")) {
BiomeAPI.addBiomeStructure(BiomeAPI.getBiomeKey(biome), ETERNAL_PORTAL);
TagAPI.addBiomeTag(ETERNAL_PORTAL.biomeTag, biome.value());
}
}
}

View file

@ -108,6 +108,7 @@ public class EndTags {
ITEM_HAMMERS.add(item);
}
});
ToolManagerImpl.tag(CommonItemTags.HAMMERS).register(new ModdedToolsVanillaBlocksToolHandler(ITEM_HAMMERS));
TagAPI.addBlockTag(
@ -128,9 +129,9 @@ public class EndTags {
);
TagAPI.addItemTag(NamedCommonItemTags.IRON_INGOTS, EndBlocks.THALLASIUM.ingot);
TagAPI.addItemTag(ALLOYING_IRON.getName(), Items.IRON_ORE, Items.DEEPSLATE_IRON_ORE, Items.RAW_IRON);
TagAPI.addItemTag(ALLOYING_GOLD.getName(), Items.GOLD_ORE, Items.DEEPSLATE_GOLD_ORE, Items.RAW_GOLD);
TagAPI.addItemTag(ALLOYING_COPPER.getName(), Items.COPPER_ORE, Items.DEEPSLATE_COPPER_ORE, Items.RAW_COPPER);
TagAPI.addItemTag(ALLOYING_IRON, Items.IRON_ORE, Items.DEEPSLATE_IRON_ORE, Items.RAW_IRON);
TagAPI.addItemTag(ALLOYING_GOLD, Items.GOLD_ORE, Items.DEEPSLATE_GOLD_ORE, Items.RAW_GOLD);
TagAPI.addItemTag(ALLOYING_COPPER, Items.COPPER_ORE, Items.DEEPSLATE_COPPER_ORE, Items.RAW_COPPER);
}
public static void addEndGround(Block bl){