mirror of
https://github.com/TeamMidnightDust/ThisRocks.git
synced 2025-12-15 10:45:10 +01:00
Improve feature generation
This commit is contained in:
@@ -73,14 +73,11 @@
|
||||
"rocks.midnightconfig.enablePolymerMode": "Aktiviere Polymer-Modus",
|
||||
"rocks.midnightconfig.enablePolymerMode.tooltip": "Erlaubt der Mod, komplett serverseitig zu funktionieren, wenn Polymer und FactoryTools installiert sind",
|
||||
"rocks.midnightconfig.geyserLevitation": "Geysir Schwebeeffekt",
|
||||
"rocks.midnightconfig.misc": "§aMiscellaneous Spawn Count",
|
||||
"rocks.midnightconfig.needs_restart": "§cStarte das Spiel neu, nachdem du Änderungen vorgenommen hast!",
|
||||
"rocks.midnightconfig.needs_restart1": "§cStarte das Spiel neu, nachdem du Änderungen vorgenommen hast!",
|
||||
"rocks.midnightconfig.needs_restart2": "§cStarte das Spiel neu, nachdem du Änderungen vorgenommen hast!",
|
||||
"rocks.midnightconfig.netherGeyserDamage": "Nether Geysir Schaden",
|
||||
"rocks.midnightconfig.polymerViewDistance": "Polymer-Sichtweite",
|
||||
"rocks.midnightconfig.rocks": "§aRock Spawn Count",
|
||||
"rocks.midnightconfig.sticks": "§aStick Spawn Count",
|
||||
"rocks.midnightconfig.title": "This Rocks! Config",
|
||||
"rocks.midnightconfig.underwaterSeashell": "Unterwasser-Muschel",
|
||||
"rocks.midnightconfig.underwaterStarfish": "Unterwasser-Seestern"
|
||||
|
||||
@@ -73,14 +73,11 @@
|
||||
"rocks.midnightconfig.enablePolymerMode": "Enable Polymer Mode",
|
||||
"rocks.midnightconfig.enablePolymerMode.tooltip": "Allows the mod to work fully server-sided when used in combination with Polymer and FactoryTools",
|
||||
"rocks.midnightconfig.geyserLevitation": "Geyser Levitation",
|
||||
"rocks.midnightconfig.misc": "§aMiscellaneous Spawn Count",
|
||||
"rocks.midnightconfig.needs_restart": "§cRestart the game after changing options here!",
|
||||
"rocks.midnightconfig.needs_restart1": "§cRestart the game after changing options here!",
|
||||
"rocks.midnightconfig.needs_restart2": "§cRestart the game after changing options here!",
|
||||
"rocks.midnightconfig.netherGeyserDamage": "Nether Geyser Damage",
|
||||
"rocks.midnightconfig.polymerViewDistance": "Polymer View Distance",
|
||||
"rocks.midnightconfig.rocks": "§aRock Spawn Count",
|
||||
"rocks.midnightconfig.sticks": "§aStick Spawn Count",
|
||||
"rocks.midnightconfig.title": "This Rocks! Config",
|
||||
"rocks.midnightconfig.underwaterSeashell": "Underwater Seashell",
|
||||
"rocks.midnightconfig.underwaterStarfish": "Underwater Starfish"
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"type": "minecraft:simple_block",
|
||||
"config": {
|
||||
"to_place": {
|
||||
"type": "minecraft:weighted_state_provider",
|
||||
"entries": [
|
||||
{
|
||||
"data": {
|
||||
"Name": "rocks:pale_oak_stick",
|
||||
"Properties": {
|
||||
"variation": "small",
|
||||
"waterlogged": "false"
|
||||
}
|
||||
},
|
||||
"weight": 7
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"Name": "rocks:pale_oak_stick",
|
||||
"Properties": {
|
||||
"variation": "medium",
|
||||
"waterlogged": "false"
|
||||
}
|
||||
},
|
||||
"weight": 5
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"Name": "rocks:pale_oak_stick",
|
||||
"Properties": {
|
||||
"variation": "large",
|
||||
"waterlogged": "false"
|
||||
}
|
||||
},
|
||||
"weight": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"type": "minecraft:simple_block",
|
||||
"config": {
|
||||
"to_place": {
|
||||
"type": "minecraft:weighted_state_provider",
|
||||
"entries": [
|
||||
{
|
||||
"data": {
|
||||
"Name": "rocks:pinecone"
|
||||
},
|
||||
"weight": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,12 +33,6 @@
|
||||
}
|
||||
},
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"Name": "rocks:pinecone"
|
||||
},
|
||||
"weight": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"feature": {
|
||||
"type": "minecraft:simple_block",
|
||||
"config": {
|
||||
"to_place": {
|
||||
"type": "minecraft:weighted_state_provider",
|
||||
"entries": [
|
||||
{
|
||||
"data": {
|
||||
"Name": "rocks:pale_oak_stick",
|
||||
"Properties": {
|
||||
"variation": "small",
|
||||
"waterlogged": "false"
|
||||
}
|
||||
},
|
||||
"weight": 7
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"Name": "rocks:pale_oak_stick",
|
||||
"Properties": {
|
||||
"variation": "medium",
|
||||
"waterlogged": "false"
|
||||
}
|
||||
},
|
||||
"weight": 5
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"Name": "rocks:pale_oak_stick",
|
||||
"Properties": {
|
||||
"variation": "large",
|
||||
"waterlogged": "false"
|
||||
}
|
||||
},
|
||||
"weight": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"placement": [
|
||||
{
|
||||
"type": "minecraft:count",
|
||||
"count": 20
|
||||
},
|
||||
{
|
||||
"type": "minecraft:rarity_filter",
|
||||
"chance": 1
|
||||
},
|
||||
{
|
||||
"type": "minecraft:in_square"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:heightmap",
|
||||
"heightmap": "WORLD_SURFACE_WG"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:biome"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:block_predicate_filter",
|
||||
"predicate": {
|
||||
"type": "minecraft:all_of",
|
||||
"predicates": [
|
||||
{
|
||||
"type": "minecraft:matching_blocks",
|
||||
"blocks": "minecraft:air"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:matching_blocks",
|
||||
"blocks": [
|
||||
"minecraft:grass_block",
|
||||
"minecraft:pale_moss_block"
|
||||
],
|
||||
"offset": [
|
||||
0,
|
||||
-1,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"feature": {
|
||||
"type": "minecraft:simple_block",
|
||||
"config": {
|
||||
"to_place": {
|
||||
"type": "minecraft:weighted_state_provider",
|
||||
"entries": [
|
||||
{
|
||||
"data": {
|
||||
"Name": "rocks:pinecone"
|
||||
},
|
||||
"weight": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"placement": [
|
||||
{
|
||||
"type": "minecraft:count",
|
||||
"count": 1
|
||||
},
|
||||
{
|
||||
"type": "minecraft:rarity_filter",
|
||||
"chance": 5
|
||||
},
|
||||
{
|
||||
"type": "minecraft:in_square"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:heightmap",
|
||||
"heightmap": "WORLD_SURFACE_WG"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:biome"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:block_predicate_filter",
|
||||
"predicate": {
|
||||
"type": "minecraft:all_of",
|
||||
"predicates": [
|
||||
{
|
||||
"type": "minecraft:matching_blocks",
|
||||
"blocks": "minecraft:air"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:matching_blocks",
|
||||
"blocks": [
|
||||
"minecraft:grass_block",
|
||||
"minecraft:podzol",
|
||||
"minecraft:cobblestone",
|
||||
"minecraft:mossy_cobblestone"
|
||||
],
|
||||
"offset": [
|
||||
0,
|
||||
-1,
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -34,12 +34,6 @@
|
||||
}
|
||||
},
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"Name": "rocks:pinecone"
|
||||
},
|
||||
"weight": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ public class RocksDataGen implements DataGeneratorEntrypoint {
|
||||
public void buildRegistry(RegistryBuilder registryBuilder) {
|
||||
registryBuilder.addRegistry(RegistryKeys.CONFIGURED_FEATURE, RockFeatures::initConfigured);
|
||||
registryBuilder.addRegistry(RegistryKeys.PLACED_FEATURE, RockFeatures::initPlaced);
|
||||
StickFeatures.initFeatures();
|
||||
registryBuilder.addRegistry(RegistryKeys.CONFIGURED_FEATURE, StickFeatures::initConfigured);
|
||||
registryBuilder.addRegistry(RegistryKeys.PLACED_FEATURE, StickFeatures::initPlaced);
|
||||
registryBuilder.addRegistry(RegistryKeys.CONFIGURED_FEATURE, NetherFeatures::initConfigured);
|
||||
|
||||
@@ -10,6 +10,7 @@ import eu.midnightdust.motschen.rocks.blockstates.StickVariation;
|
||||
import eu.midnightdust.motschen.rocks.config.RocksConfig;
|
||||
import eu.midnightdust.motschen.rocks.networking.HelloPayload;
|
||||
import eu.midnightdust.motschen.rocks.util.RockType;
|
||||
import eu.midnightdust.motschen.rocks.util.StickType;
|
||||
import eu.midnightdust.motschen.rocks.util.polymer.PolyUtil;
|
||||
import eu.midnightdust.motschen.rocks.world.*;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
@@ -18,7 +19,6 @@ import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry;
|
||||
import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;
|
||||
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.WoodType;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -51,7 +51,7 @@ public class RocksMain implements ModInitializer {
|
||||
public static final EnumProperty<StarfishVariation> STARFISH_VARIATION = EnumProperty.of("variation", StarfishVariation.class);
|
||||
|
||||
public static Map<RockType, Rock> rocksByType = new HashMap<>();
|
||||
public static Map<WoodType, Stick> sticksByType = new HashMap<>();
|
||||
public static Map<StickType, Stick> sticksByType = new HashMap<>();
|
||||
public static Map<RockType, Item> splittersByType = new HashMap<>();
|
||||
|
||||
public static final Identifier PINECONE = id("pinecone");
|
||||
@@ -93,8 +93,8 @@ public class RocksMain implements ModInitializer {
|
||||
if (type != RockType.GRAVEL)
|
||||
splittersByType.put(type, registerItem(id(type.getSplitterName()), simpleItem(id(type.getSplitterName()))));
|
||||
}
|
||||
for (WoodType type : WoodType.stream().toList()) {
|
||||
Identifier id = id(type.name()+"_stick");
|
||||
for (StickType type : StickType.values()) {
|
||||
Identifier id = id(type.getName()+"_stick");
|
||||
sticksByType.put(type, registerBlockWithItem(id, polymerMode ? newStickPolymer(id) : new Stick(id)));
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import eu.pb4.polymer.virtualentity.api.attachment.BlockAwareAttachment;
|
||||
import eu.pb4.polymer.virtualentity.api.attachment.HolderAttachment;
|
||||
import eu.pb4.polymer.virtualentity.api.elements.ItemDisplayElement;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.WoodType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RotationAxis;
|
||||
@@ -19,10 +18,10 @@ import java.util.Map;
|
||||
|
||||
public class ItemDisplayStickModel extends ConditionalBlockModel {
|
||||
private final ItemDisplayElement main;
|
||||
public static Map<WoodType, ItemStack[]> models = new HashMap<>();
|
||||
public static Map<StickType, ItemStack[]> models = new HashMap<>();
|
||||
|
||||
public static void initModels() {
|
||||
for (WoodType type : WoodType.stream().toList()) {
|
||||
for (StickType type : StickType.values()) {
|
||||
var stacks = new ItemStack[3];
|
||||
stacks[0] = ItemDisplayElementUtil.getModel(RocksMain.id("block/small_"+type.name()+"_stick"));
|
||||
stacks[1] = ItemDisplayElementUtil.getModel(RocksMain.id("block/medium_"+type.name()+"_stick"));
|
||||
|
||||
@@ -26,6 +26,7 @@ public class RocksConfig extends MidnightConfig {
|
||||
@Entry(category = sticks, name = "block.rocks.acacia_stick") public static boolean acaciaStick = true;
|
||||
@Entry(category = sticks, name = "block.rocks.jungle_stick") public static boolean jungleStick = true;
|
||||
@Entry(category = sticks, name = "block.rocks.dark_oak_stick") public static boolean darkOakStick = true;
|
||||
@Entry(category = sticks, name = "block.rocks.pale_oak_stick") public static boolean paleOakStick = true;
|
||||
@Entry(category = sticks, name = "block.rocks.mangrove_stick") public static boolean mangroveStick = true;
|
||||
@Entry(category = sticks, name = "block.rocks.cherry_stick") public static boolean cherryStick = true;
|
||||
@Entry(category = sticks, name = "block.rocks.bamboo_stick") public static boolean bambooStick = true;
|
||||
|
||||
@@ -6,7 +6,6 @@ import eu.midnightdust.motschen.rocks.util.StickType;
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricLanguageProvider;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.WoodType;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.RegistryWrapper;
|
||||
@@ -71,11 +70,11 @@ public abstract class Language extends FabricLanguageProvider {
|
||||
translationBuilder.add(splitter, baseTranslation+splitterWord);
|
||||
}
|
||||
}
|
||||
for (WoodType type : WoodType.stream().toList()) {
|
||||
Block block = Registries.BLOCK.get(RocksMain.id(type.name()+"_stick"));
|
||||
if (StickType.getBaseBlock(type) instanceof Block logBlock &&
|
||||
Registries.BLOCK.get(Identifier.ofVanilla(type.name()+"_planks")) instanceof Block plankBlock &&
|
||||
Registries.BLOCK.get(Identifier.ofVanilla(type.name()+"_stairs")) instanceof Block stairBlock) {
|
||||
for (StickType type : StickType.values()) {
|
||||
Block block = Registries.BLOCK.get(RocksMain.id(type.getName()+"_stick"));
|
||||
if (type.getBaseBlock() instanceof Block logBlock &&
|
||||
Registries.BLOCK.get(Identifier.ofVanilla(type.getName()+"_planks")) instanceof Block plankBlock &&
|
||||
Registries.BLOCK.get(Identifier.ofVanilla(type.getName()+"_stairs")) instanceof Block stairBlock) {
|
||||
String logTranslation = langHelper.translate(logBlock.getTranslationKey());
|
||||
String plankTranslation = langHelper.translate(plankBlock.getTranslationKey());
|
||||
String stairTranslation = langHelper.translate(stairBlock.getTranslationKey());
|
||||
|
||||
@@ -7,10 +7,8 @@ import eu.midnightdust.motschen.rocks.util.StickType;
|
||||
import net.fabricmc.fabric.api.client.datagen.v1.provider.FabricModelProvider;
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.WoodType;
|
||||
import net.minecraft.client.data.*;
|
||||
import net.minecraft.client.render.item.model.ItemModel;
|
||||
import net.minecraft.client.render.item.model.SelectItemModel;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.util.Identifier;
|
||||
@@ -38,9 +36,9 @@ public class Models extends FabricModelProvider {
|
||||
Block block = Registries.BLOCK.get(RocksMain.id(type.getName()));
|
||||
RockModel.registerBlockModel(bsModelGenerator, block, type.getStoneBlock());
|
||||
}
|
||||
for (WoodType type : WoodType.stream().toList()) {
|
||||
Block block = Registries.BLOCK.get(RocksMain.id(type.name()+"_stick"));
|
||||
StickModel.registerBlockModel(bsModelGenerator, block, StickType.getBaseBlock(type));
|
||||
for (StickType type : StickType.values()) {
|
||||
Block block = Registries.BLOCK.get(RocksMain.id(type.getName()+"_stick"));
|
||||
StickModel.registerBlockModel(bsModelGenerator, block, type.getBaseBlock());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,9 +53,9 @@ public class Models extends FabricModelProvider {
|
||||
registerParentedItemModel(itemModelGenerator, splitter, getItemId("splitter_base"), type.getStoneBlock());
|
||||
}
|
||||
}
|
||||
for (WoodType type : WoodType.stream().toList()) {
|
||||
Item item = Registries.ITEM.get(RocksMain.id(type.name()+"_stick"));
|
||||
registerParentedItemModel(itemModelGenerator, item, getItemId("stick_base"), StickType.getBaseBlock(type));
|
||||
for (StickType type : StickType.values()) {
|
||||
Item item = Registries.ITEM.get(RocksMain.id(type.getName()+"_stick"));
|
||||
registerParentedItemModel(itemModelGenerator, item, getItemId("stick_base"), type.getBaseBlock());
|
||||
}
|
||||
itemModelGenerator.register(RocksMain.Geyser.asItem());
|
||||
itemModelGenerator.register(RocksMain.NetherGeyser.asItem());
|
||||
|
||||
@@ -1,28 +1,49 @@
|
||||
package eu.midnightdust.motschen.rocks.util;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.WoodType;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class StickType {
|
||||
public static WoodType fromBlockName(String name) {
|
||||
return WoodType.stream().filter(woodType -> Objects.equals(woodType.name(), name
|
||||
.replace("block.rocks.", "").replace("_stick", "")
|
||||
)).findFirst().orElse(WoodType.OAK);
|
||||
import static eu.midnightdust.motschen.rocks.RocksMain.id;
|
||||
|
||||
public enum StickType {
|
||||
OAK("oak", Blocks.OAK_LOG), SPRUCE("spruce", Blocks.SPRUCE_LOG), BIRCH("birch", Blocks.BIRCH_LOG),
|
||||
JUNGLE("jungle", Blocks.JUNGLE_LOG), ACACIA("acacia", Blocks.ACACIA_LOG), DARK_OAK("dark_oak", Blocks.DARK_OAK_LOG),
|
||||
CHERRY("cherry", Blocks.CHERRY_LOG), MANGROVE("mangrove", Blocks.MANGROVE_LOG), PALE_OAK("pale_oak", Blocks.PALE_OAK_LOG),
|
||||
|
||||
BAMBOO("bamboo", Blocks.BAMBOO_BLOCK), WARPED("warped", Blocks.WARPED_STEM), CRIMSON("crimson", Blocks.CRIMSON_STEM);
|
||||
|
||||
private final String name;
|
||||
private final Block baseBlock;
|
||||
|
||||
StickType(String name, Block baseBlock) {
|
||||
this.name = name;
|
||||
this.baseBlock = baseBlock;
|
||||
}
|
||||
public static Block getBaseBlock(WoodType woodType) {
|
||||
String logName = woodType.name() + "_";
|
||||
if (woodType.soundType() == BlockSoundGroup.NETHER_WOOD) logName += "stem";
|
||||
else if (woodType.soundType() == BlockSoundGroup.BAMBOO_WOOD) logName += "block";
|
||||
else logName += "log";
|
||||
|
||||
if (Registries.BLOCK.containsId(Identifier.ofVanilla(logName))) {
|
||||
return Registries.BLOCK.get(Identifier.ofVanilla(logName));
|
||||
}
|
||||
return null;
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
public Block getBaseBlock() {
|
||||
return baseBlock;
|
||||
}
|
||||
|
||||
public Identifier[] getVariations() {
|
||||
var variations = new Identifier[3];
|
||||
variations[0] = id("small_"+name);
|
||||
variations[1] = id("medium_"+name);
|
||||
variations[2] = id("large_"+name);
|
||||
return variations;
|
||||
}
|
||||
|
||||
public static StickType fromBlockName(String name) {
|
||||
return Arrays.stream(values()).filter(type -> name
|
||||
.replace("block.rocks.", "")
|
||||
.replace("small_", "")
|
||||
.replace("medium_", "")
|
||||
.replace("large_", "")
|
||||
.equals(type.getName())).findFirst().orElse(StickType.OAK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,11 +58,13 @@ public class FeatureInjector {
|
||||
String name = ctx.getBiomeKey().getValue().toString();
|
||||
return name.contains("minecraft:wooded_mountains") || ctx.hasTag(BiomeTags.IS_TAIGA);});
|
||||
if (RocksConfig.spruceStick) BiomeModifications.addFeature(spruce_sticks, GenerationStep.Feature.TOP_LAYER_MODIFICATION, getKey("spruce_stick"));
|
||||
if (RocksConfig.pinecone) BiomeModifications.addFeature(spruce_sticks, GenerationStep.Feature.TOP_LAYER_MODIFICATION, getKey("pinecone"));
|
||||
|
||||
if (RocksConfig.acaciaStick) BiomeModifications.addFeature(ctx -> ctx.hasTag(BiomeTags.VILLAGE_SAVANNA_HAS_STRUCTURE), GenerationStep.Feature.TOP_LAYER_MODIFICATION, getKey("acacia_stick"));
|
||||
|
||||
if (RocksConfig.jungleStick) BiomeModifications.addFeature(ctx -> ctx.hasTag(BiomeTags.IS_JUNGLE), GenerationStep.Feature.TOP_LAYER_MODIFICATION, getKey("jungle_stick"));
|
||||
if (RocksConfig.bambooStick) BiomeModifications.addFeature(ctx -> ctx.hasTag(BiomeTags.IS_JUNGLE), GenerationStep.Feature.TOP_LAYER_MODIFICATION, getKey("bamboo_stick"));
|
||||
if (RocksConfig.paleOakStick) BiomeModifications.addFeature(ctx -> ctx.getBiomeKey().equals(BiomeKeys.PALE_GARDEN), GenerationStep.Feature.TOP_LAYER_MODIFICATION, getKey("pale_oak_stick"));
|
||||
|
||||
Predicate<BiomeSelectionContext> dark_oak_sticks = (ctx -> {
|
||||
String name = ctx.getBiomeKey().getValue().toString();
|
||||
|
||||
@@ -22,9 +22,6 @@ import java.util.List;
|
||||
import static eu.midnightdust.motschen.rocks.util.RegistryUtil.register;
|
||||
|
||||
public class MiscFeatures {
|
||||
public static List<PlacementModifier> placementModifiers = List.of(RarityFilterPlacementModifier.of(1),
|
||||
SquarePlacementModifier.of(), PlacedFeatures.WORLD_SURFACE_WG_HEIGHTMAP, BiomePlacementModifier.of());
|
||||
|
||||
private static final ConfiguredFeature<?, ?> SEASHELL_FEATURE = new ConfiguredFeature<>(Feature.SIMPLE_BLOCK, new SimpleBlockFeatureConfig(
|
||||
new WeightedBlockStateProvider(DataPool.<BlockState>builder()
|
||||
.add(RocksMain.Seashell.getDefaultState().with(RocksMain.SEASHELL_VARIATION,SeashellVariation.YELLOW), 7)
|
||||
@@ -37,6 +34,10 @@ public class MiscFeatures {
|
||||
.add(RocksMain.Starfish.getDefaultState().with(RocksMain.STARFISH_VARIATION,StarfishVariation.PINK), 6)
|
||||
.add(RocksMain.Starfish.getDefaultState().with(RocksMain.STARFISH_VARIATION,StarfishVariation.ORANGE), 7).build()))
|
||||
);
|
||||
public static ConfiguredFeature<?, ?> PINECONE_FEATURE = new ConfiguredFeature<>(Feature.SIMPLE_BLOCK, new SimpleBlockFeatureConfig(
|
||||
new WeightedBlockStateProvider(DataPool.<BlockState>builder()
|
||||
.add(RocksMain.Pinecone.getDefaultState(), 1).build()))
|
||||
);
|
||||
|
||||
public static ConfiguredFeature<?, ?> UNDERWATER_STARFISH_FEATURE = new ConfiguredFeature<>(FeatureRegistry.UNDERWATER_STARFISH_FEATURE, new ProbabilityConfig(1));
|
||||
public static ConfiguredFeature<?, ?> UNDERWATER_SEASHELL_FEATURE = new ConfiguredFeature<>(FeatureRegistry.UNDERWATER_SEASHELL_FEATURE, new ProbabilityConfig(1));
|
||||
@@ -44,6 +45,7 @@ public class MiscFeatures {
|
||||
|
||||
public static PlacedFeature SEASHELL_PLACED_FEATURE = new PlacedFeature(RegistryEntry.of(SEASHELL_FEATURE), List.of(CountPlacementModifier.of(1), RarityFilterPlacementModifier.of(1), SquarePlacementModifier.of(), PlacedFeatures.WORLD_SURFACE_WG_HEIGHTMAP, BiomePlacementModifier.of(), BlockFilterPlacementModifier.of(BlockPredicate.bothOf(BlockPredicate.IS_AIR, BlockPredicate.matchingBlocks(new Vec3i(0, -1, 0), ImmutableList.of(Blocks.SAND, Blocks.SANDSTONE, Blocks.RED_SAND, Blocks.RED_SANDSTONE))))));
|
||||
public static PlacedFeature STARFISH_PLACED_FEATURE = new PlacedFeature(RegistryEntry.of(STARFISH_FEATURE), List.of(CountPlacementModifier.of(1), RarityFilterPlacementModifier.of(1), SquarePlacementModifier.of(), PlacedFeatures.WORLD_SURFACE_WG_HEIGHTMAP, BiomePlacementModifier.of(), BlockFilterPlacementModifier.of(BlockPredicate.bothOf(BlockPredicate.IS_AIR, BlockPredicate.matchingBlocks(new Vec3i(0, -1, 0), ImmutableList.of(Blocks.SAND, Blocks.SANDSTONE, Blocks.RED_SAND, Blocks.RED_SANDSTONE))))));
|
||||
public static PlacedFeature PINECONE_PLACED_FEATURE = new PlacedFeature(RegistryEntry.of(PINECONE_FEATURE), StickFeatures.getModifiers(1, 5, Blocks.GRASS_BLOCK, Blocks.PODZOL, Blocks.COBBLESTONE, Blocks.MOSSY_COBBLESTONE));
|
||||
public static PlacedFeature UNDERWATER_SEASHELL_PLACED_FEATURE = new PlacedFeature(RegistryEntry.of(UNDERWATER_SEASHELL_FEATURE), List.of(CountPlacementModifier.of(3), RarityFilterPlacementModifier.of(1), SquarePlacementModifier.of(), PlacedFeatures.WORLD_SURFACE_WG_HEIGHTMAP, BiomePlacementModifier.of()));
|
||||
public static PlacedFeature UNDERWATER_STARFISH_PLACED_FEATURE = new PlacedFeature(RegistryEntry.of(UNDERWATER_STARFISH_FEATURE), List.of(CountPlacementModifier.of(3), RarityFilterPlacementModifier.of(1), SquarePlacementModifier.of(), PlacedFeatures.WORLD_SURFACE_WG_HEIGHTMAP, BiomePlacementModifier.of()));
|
||||
public static PlacedFeature SNOWY_GEYSER_PLACED_FEATURE = new PlacedFeature(RegistryEntry.of(SNOWY_GEYSER_FEATURE), List.of(CountPlacementModifier.of(3), RarityFilterPlacementModifier.of(1), SquarePlacementModifier.of(), PlacedFeatures.WORLD_SURFACE_WG_HEIGHTMAP, BiomePlacementModifier.of()));
|
||||
@@ -51,6 +53,7 @@ public class MiscFeatures {
|
||||
public static void initConfigured(Registerable<ConfiguredFeature<?, ?>> context) {
|
||||
register(context, "seashell", SEASHELL_FEATURE);
|
||||
register(context, "starfish", STARFISH_FEATURE);
|
||||
register(context, "pinecone", PINECONE_FEATURE);
|
||||
register(context, "underwater_seashell", UNDERWATER_SEASHELL_FEATURE);
|
||||
register(context, "underwater_starfish", UNDERWATER_STARFISH_FEATURE);
|
||||
register(context, "snowy_geyser", SNOWY_GEYSER_FEATURE);
|
||||
@@ -58,6 +61,7 @@ public class MiscFeatures {
|
||||
public static void initPlaced(Registerable<PlacedFeature> context) {
|
||||
register(context, "seashell", SEASHELL_PLACED_FEATURE);
|
||||
register(context, "starfish", STARFISH_PLACED_FEATURE);
|
||||
register(context, "pinecone", PINECONE_PLACED_FEATURE);
|
||||
register(context, "underwater_seashell", UNDERWATER_SEASHELL_PLACED_FEATURE);
|
||||
register(context, "underwater_starfish", UNDERWATER_STARFISH_PLACED_FEATURE);
|
||||
register(context, "snowy_geyser", SNOWY_GEYSER_PLACED_FEATURE);
|
||||
|
||||
@@ -49,40 +49,22 @@ public class NetherFeatures {
|
||||
public static ConfiguredFeature<?, ?> NETHER_GEYSER_FEATURE = new ConfiguredFeature<>(Feature.SIMPLE_BLOCK, new SimpleBlockFeatureConfig(
|
||||
new WeightedBlockStateProvider(DataPool.<BlockState>builder().add(RocksMain.NetherGeyser.getDefaultState(), 1)))
|
||||
);
|
||||
public static ConfiguredFeature<?, ?> WARPED_STICK_FEATURE = new ConfiguredFeature<>(Feature.SIMPLE_BLOCK,new SimpleBlockFeatureConfig(
|
||||
new WeightedBlockStateProvider(DataPool.<BlockState>builder()
|
||||
.add(sticksByType.get(WoodType.WARPED).getDefaultState().with(RocksMain.STICK_VARIATION, StickVariation.SMALL), 7)
|
||||
.add(sticksByType.get(WoodType.WARPED).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.MEDIUM), 5)
|
||||
.add(sticksByType.get(WoodType.WARPED).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.LARGE), 1).build()))
|
||||
);
|
||||
public static ConfiguredFeature<?, ?> CRIMSON_STICK_FEATURE = new ConfiguredFeature<>(Feature.SIMPLE_BLOCK, new SimpleBlockFeatureConfig(
|
||||
new WeightedBlockStateProvider(DataPool.<BlockState>builder()
|
||||
.add(sticksByType.get(WoodType.CRIMSON).getDefaultState().with(RocksMain.STICK_VARIATION, StickVariation.SMALL), 7)
|
||||
.add(sticksByType.get(WoodType.CRIMSON).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.MEDIUM), 5)
|
||||
.add(sticksByType.get(WoodType.CRIMSON).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.LARGE), 1).build()))
|
||||
);
|
||||
|
||||
public static PlacedFeature NETHERRACK_ROCK_PLACED_FEATURE = new PlacedFeature(RegistryEntry.of(NETHERRACK_ROCK_FEATURE), List.of(CountPlacementModifier.of(90), RarityFilterPlacementModifier.of(1), SquarePlacementModifier.of(), PlacedFeatures.BOTTOM_TO_TOP_RANGE, BiomePlacementModifier.of(), BlockFilterPlacementModifier.of(BlockPredicate .bothOf(BlockPredicate.IS_AIR, BlockPredicate.matchingBlocks(new Vec3i(0, -1, 0), ImmutableList.of(Blocks.NETHERRACK,Blocks.WARPED_NYLIUM,Blocks.CRIMSON_NYLIUM))))));
|
||||
public static PlacedFeature SOUL_SOIL_ROCK_PLACED_FEATURE = new PlacedFeature(RegistryEntry.of(SOUL_SOIL_ROCK_FEATURE), List.of(CountPlacementModifier.of(60), RarityFilterPlacementModifier.of(1), SquarePlacementModifier.of(), PlacedFeatures.BOTTOM_TO_TOP_RANGE, BiomePlacementModifier.of(), BlockFilterPlacementModifier.of(BlockPredicate.bothOf(BlockPredicate.IS_AIR, BlockPredicate.matchingBlocks(new Vec3i(0, -1, 0), ImmutableList.of(Blocks.SOUL_SOIL,Blocks.SOUL_SAND))))));
|
||||
public static PlacedFeature NETHER_GRAVEL_ROCK_PLACED_FEATURE = new PlacedFeature(RegistryEntry.of(NETHER_GRAVEL_ROCK_FEATURE), List.of(CountPlacementModifier.of(30), RarityFilterPlacementModifier.of(1), SquarePlacementModifier.of(), PlacedFeatures.BOTTOM_TO_TOP_RANGE, BiomePlacementModifier.of(), BlockFilterPlacementModifier.of(BlockPredicate.bothOf(BlockPredicate.IS_AIR, BlockPredicate.matchingBlocks(new Vec3i(0, -1, 0), ImmutableList.of(Blocks.GRAVEL))))));
|
||||
public static PlacedFeature NETHER_GEYSER_PLACED_FEATURE = new PlacedFeature(RegistryEntry.of(NETHER_GEYSER_FEATURE), List.of(CountPlacementModifier.of(15), RarityFilterPlacementModifier.of(1), SquarePlacementModifier.of(), PlacedFeatures.BOTTOM_TO_TOP_RANGE, BiomePlacementModifier.of(), BlockFilterPlacementModifier.of(BlockPredicate.bothOf(BlockPredicate.IS_AIR, BlockPredicate.matchingBlocks(new Vec3i(0, -1, 0), ImmutableList.of(Blocks.NETHERRACK))))));
|
||||
public static PlacedFeature WARPED_STICK_PLACED_FEATURE = new PlacedFeature(RegistryEntry.of(WARPED_STICK_FEATURE), List.of(CountPlacementModifier.of(90), RarityFilterPlacementModifier.of(1), SquarePlacementModifier.of(), PlacedFeatures.BOTTOM_TO_TOP_RANGE, BiomePlacementModifier.of(), BlockFilterPlacementModifier.of(BlockPredicate.bothOf(BlockPredicate.IS_AIR, BlockPredicate.matchingBlocks(new Vec3i(0, -1, 0), ImmutableList.of(Blocks.WARPED_NYLIUM))))));
|
||||
public static PlacedFeature CRIMSON_STICK_PLACED_FEATURE = new PlacedFeature(RegistryEntry.of(CRIMSON_STICK_FEATURE), List.of(CountPlacementModifier.of(90), RarityFilterPlacementModifier.of(1), SquarePlacementModifier.of(), PlacedFeatures.BOTTOM_TO_TOP_RANGE, BiomePlacementModifier.of(), BlockFilterPlacementModifier.of(BlockPredicate.bothOf(BlockPredicate.IS_AIR, BlockPredicate.matchingBlocks(new Vec3i(0, -1, 0), ImmutableList.of(Blocks.CRIMSON_NYLIUM))))));
|
||||
|
||||
public static void initConfigured(Registerable<ConfiguredFeature<?, ?>> context) {
|
||||
register(context, "netherrack_rock", NETHERRACK_ROCK_FEATURE);
|
||||
register(context, "soul_soil_rock", SOUL_SOIL_ROCK_FEATURE);
|
||||
register(context, "nether_gravel_rock", NETHER_GRAVEL_ROCK_FEATURE);
|
||||
register(context, "nether_geyser", NETHER_GEYSER_FEATURE);
|
||||
register(context, "warped_stick", WARPED_STICK_FEATURE);
|
||||
register(context, "crimson_stick", CRIMSON_STICK_FEATURE);
|
||||
}
|
||||
public static void initPlaced(Registerable<PlacedFeature> context) {
|
||||
register(context, "netherrack_rock", NETHERRACK_ROCK_PLACED_FEATURE);
|
||||
register(context, "soul_soil_rock", SOUL_SOIL_ROCK_PLACED_FEATURE);
|
||||
register(context, "nether_gravel_rock", NETHER_GRAVEL_ROCK_PLACED_FEATURE);
|
||||
register(context, "nether_geyser", NETHER_GEYSER_PLACED_FEATURE);
|
||||
register(context, "warped_stick", WARPED_STICK_PLACED_FEATURE);
|
||||
register(context, "crimson_stick", CRIMSON_STICK_PLACED_FEATURE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package eu.midnightdust.motschen.rocks.world.configured_feature;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import eu.midnightdust.motschen.rocks.RocksMain;
|
||||
import eu.midnightdust.motschen.rocks.blockstates.StickVariation;
|
||||
import eu.midnightdust.motschen.rocks.util.StickType;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.WoodType;
|
||||
import net.minecraft.registry.Registerable;
|
||||
import net.minecraft.registry.entry.RegistryEntry;
|
||||
import net.minecraft.util.collection.DataPool;
|
||||
@@ -15,99 +14,57 @@ import net.minecraft.world.gen.feature.*;
|
||||
import net.minecraft.world.gen.placementmodifier.*;
|
||||
import net.minecraft.world.gen.stateprovider.WeightedBlockStateProvider;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static eu.midnightdust.motschen.rocks.RocksMain.STICK_VARIATION;
|
||||
import static eu.midnightdust.motschen.rocks.RocksMain.sticksByType;
|
||||
import static eu.midnightdust.motschen.rocks.util.RegistryUtil.register;
|
||||
|
||||
public class StickFeatures {
|
||||
public static ConfiguredFeature<?, ?> OAK_STICK_FEATURE = new ConfiguredFeature<>(Feature.SIMPLE_BLOCK, new SimpleBlockFeatureConfig(
|
||||
new WeightedBlockStateProvider(DataPool.<BlockState>builder()
|
||||
.add(sticksByType.get(WoodType.OAK).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.SMALL), 7)
|
||||
.add(sticksByType.get(WoodType.OAK).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.MEDIUM), 5)
|
||||
.add(sticksByType.get(WoodType.OAK).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.LARGE), 1).build()))
|
||||
);
|
||||
public static ConfiguredFeature<?, ?> SPRUCE_STICK_FEATURE = new ConfiguredFeature<>(Feature.SIMPLE_BLOCK, new SimpleBlockFeatureConfig(
|
||||
new WeightedBlockStateProvider(DataPool.<BlockState>builder()
|
||||
.add(sticksByType.get(WoodType.SPRUCE).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.SMALL), 7)
|
||||
.add(sticksByType.get(WoodType.SPRUCE).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.MEDIUM), 5)
|
||||
.add(sticksByType.get(WoodType.SPRUCE).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.LARGE), 1)
|
||||
.add(RocksMain.Pinecone.getDefaultState(), 1).build()))
|
||||
);
|
||||
public static ConfiguredFeature<?, ?> BIRCH_STICK_FEATURE = new ConfiguredFeature<>(Feature.SIMPLE_BLOCK, new SimpleBlockFeatureConfig(
|
||||
new WeightedBlockStateProvider(DataPool.<BlockState>builder()
|
||||
.add(sticksByType.get(WoodType.BIRCH).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.SMALL), 7)
|
||||
.add(sticksByType.get(WoodType.BIRCH).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.MEDIUM), 5)
|
||||
.add(sticksByType.get(WoodType.BIRCH).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.LARGE), 1).build()))
|
||||
);
|
||||
public static ConfiguredFeature<?, ?> ACACIA_STICK_FEATURE = new ConfiguredFeature<>(Feature.SIMPLE_BLOCK, new SimpleBlockFeatureConfig(
|
||||
new WeightedBlockStateProvider(DataPool.<BlockState>builder()
|
||||
.add(sticksByType.get(WoodType.ACACIA).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.SMALL), 7)
|
||||
.add(sticksByType.get(WoodType.ACACIA).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.MEDIUM), 5)
|
||||
.add(sticksByType.get(WoodType.ACACIA).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.LARGE), 1).build()))
|
||||
);
|
||||
public static ConfiguredFeature<?, ?> JUNGLE_STICK_FEATURE = new ConfiguredFeature<>(Feature.SIMPLE_BLOCK, new SimpleBlockFeatureConfig(
|
||||
new WeightedBlockStateProvider(DataPool.<BlockState>builder()
|
||||
.add(sticksByType.get(WoodType.JUNGLE).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.SMALL), 7)
|
||||
.add(sticksByType.get(WoodType.JUNGLE).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.MEDIUM), 5)
|
||||
.add(sticksByType.get(WoodType.JUNGLE).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.LARGE), 1).build()))
|
||||
);
|
||||
public static ConfiguredFeature<?, ?> DARK_OAK_STICK_FEATURE = new ConfiguredFeature<>(Feature.SIMPLE_BLOCK, new SimpleBlockFeatureConfig(
|
||||
new WeightedBlockStateProvider(DataPool.<BlockState>builder()
|
||||
.add(sticksByType.get(WoodType.DARK_OAK).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.SMALL), 7)
|
||||
.add(sticksByType.get(WoodType.DARK_OAK).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.MEDIUM), 5)
|
||||
.add(sticksByType.get(WoodType.DARK_OAK).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.LARGE), 1).build()))
|
||||
);
|
||||
public static ConfiguredFeature<?, ?> MANGROVE_STICK_FEATURE = new ConfiguredFeature<>(Feature.SIMPLE_BLOCK, new SimpleBlockFeatureConfig(
|
||||
new WeightedBlockStateProvider(DataPool.<BlockState>builder()
|
||||
.add(sticksByType.get(WoodType.MANGROVE).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.SMALL), 7)
|
||||
.add(sticksByType.get(WoodType.MANGROVE).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.MEDIUM), 5)
|
||||
.add(sticksByType.get(WoodType.MANGROVE).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.LARGE), 1).build()))
|
||||
);
|
||||
public static ConfiguredFeature<?, ?> CHERRY_STICK_FEATURE = new ConfiguredFeature<>(Feature.SIMPLE_BLOCK, new SimpleBlockFeatureConfig(
|
||||
new WeightedBlockStateProvider(DataPool.<BlockState>builder()
|
||||
.add(sticksByType.get(WoodType.CHERRY).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.SMALL), 7)
|
||||
.add(sticksByType.get(WoodType.CHERRY).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.MEDIUM), 5)
|
||||
.add(sticksByType.get(WoodType.CHERRY).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.LARGE), 1).build()))
|
||||
);
|
||||
public static ConfiguredFeature<?, ?> BAMBOO_STICK_FEATURE = new ConfiguredFeature<>(Feature.SIMPLE_BLOCK, new SimpleBlockFeatureConfig(
|
||||
new WeightedBlockStateProvider(DataPool.<BlockState>builder()
|
||||
.add(sticksByType.get(WoodType.BAMBOO).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.SMALL), 7)
|
||||
.add(sticksByType.get(WoodType.BAMBOO).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.MEDIUM), 5)
|
||||
.add(sticksByType.get(WoodType.BAMBOO).getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.LARGE), 1).build()))
|
||||
);
|
||||
private static final Map<StickType, ConfiguredFeature<?, ?>> CONFIGURED_FEATURES = new HashMap<>();
|
||||
|
||||
public static final List<PlacementModifier> modifiers = List.of(CountPlacementModifier.of(3), RarityFilterPlacementModifier.of(1), SquarePlacementModifier.of(), PlacedFeatures.WORLD_SURFACE_WG_HEIGHTMAP, BiomePlacementModifier.of(), BlockFilterPlacementModifier.of(BlockPredicate.bothOf(BlockPredicate.IS_AIR, BlockPredicate.matchingBlocks(new Vec3i(0, -1, 0), ImmutableList.of(Blocks.GRASS_BLOCK, Blocks.MUD, Blocks.PODZOL)))));
|
||||
public static PlacedFeature OAK_STICK_PLACED_FEATURE = new PlacedFeature(RegistryEntry.of(OAK_STICK_FEATURE), modifiers);
|
||||
public static PlacedFeature SPRUCE_STICK_PLACED_FEATURE = new PlacedFeature(RegistryEntry.of(SPRUCE_STICK_FEATURE), modifiers);
|
||||
public static PlacedFeature BIRCH_STICK_PLACED_FEATURE = new PlacedFeature(RegistryEntry.of(BIRCH_STICK_FEATURE), modifiers);
|
||||
public static PlacedFeature ACACIA_STICK_PLACED_FEATURE = new PlacedFeature(RegistryEntry.of(ACACIA_STICK_FEATURE), modifiers);
|
||||
public static PlacedFeature JUNGLE_STICK_PLACED_FEATURE = new PlacedFeature(RegistryEntry.of(JUNGLE_STICK_FEATURE), modifiers);
|
||||
public static PlacedFeature DARK_OAK_STICK_PLACED_FEATURE = new PlacedFeature(RegistryEntry.of(DARK_OAK_STICK_FEATURE), modifiers);
|
||||
public static PlacedFeature CHERRY_STICK_PLACED_FEATURE = new PlacedFeature(RegistryEntry.of(CHERRY_STICK_FEATURE), modifiers);
|
||||
public static PlacedFeature MANGROVE_STICK_PLACED_FEATURE = new PlacedFeature(RegistryEntry.of(MANGROVE_STICK_FEATURE), modifiers);
|
||||
public static PlacedFeature BAMBOO_STICK_PLACED_FEATURE = new PlacedFeature(RegistryEntry.of(BAMBOO_STICK_FEATURE), modifiers);
|
||||
public static List<PlacementModifier> getModifiers(int count, int rarity, Block... groundBlocks) {
|
||||
return List.of(CountPlacementModifier.of(count), RarityFilterPlacementModifier.of(rarity),
|
||||
SquarePlacementModifier.of(), PlacedFeatures.WORLD_SURFACE_WG_HEIGHTMAP, BiomePlacementModifier.of(),
|
||||
BlockFilterPlacementModifier.of(BlockPredicate.bothOf(BlockPredicate.IS_AIR, BlockPredicate.matchingBlocks(new Vec3i(0, -1, 0),
|
||||
groundBlocks))));
|
||||
}
|
||||
public static List<PlacementModifier> getNetherModifiers(int count, int rarity, Block... groundBlocks) {
|
||||
return List.of(CountPlacementModifier.of(count), RarityFilterPlacementModifier.of(rarity),
|
||||
SquarePlacementModifier.of(), PlacedFeatures.BOTTOM_TO_TOP_RANGE, BiomePlacementModifier.of(),
|
||||
BlockFilterPlacementModifier.of(BlockPredicate.bothOf(BlockPredicate.IS_AIR, BlockPredicate.matchingBlocks(new Vec3i(0, -1, 0),
|
||||
groundBlocks))));
|
||||
}
|
||||
|
||||
public static void initFeatures() {
|
||||
for (StickType type : StickType.values()) {
|
||||
ConfiguredFeature<?, ?> STICK_FEATURE = new ConfiguredFeature<>(Feature.SIMPLE_BLOCK, new SimpleBlockFeatureConfig(
|
||||
new WeightedBlockStateProvider(DataPool.<BlockState>builder()
|
||||
.add(sticksByType.get(type).getDefaultState().with(STICK_VARIATION, StickVariation.SMALL), 7)
|
||||
.add(sticksByType.get(type).getDefaultState().with(STICK_VARIATION, StickVariation.MEDIUM), 5)
|
||||
.add(sticksByType.get(type).getDefaultState().with(STICK_VARIATION, StickVariation.LARGE), 1).build()))
|
||||
);
|
||||
CONFIGURED_FEATURES.put(type, STICK_FEATURE);
|
||||
}
|
||||
}
|
||||
|
||||
public static void initConfigured(Registerable<ConfiguredFeature<?, ?>> context) {
|
||||
register(context, "oak_stick", OAK_STICK_FEATURE);
|
||||
register(context, "spruce_stick", SPRUCE_STICK_FEATURE);
|
||||
register(context, "birch_stick", BIRCH_STICK_FEATURE);
|
||||
register(context, "acacia_stick", ACACIA_STICK_FEATURE);
|
||||
register(context, "jungle_stick", JUNGLE_STICK_FEATURE);
|
||||
register(context, "dark_oak_stick", DARK_OAK_STICK_FEATURE);
|
||||
register(context, "cherry_stick", CHERRY_STICK_FEATURE);
|
||||
register(context, "mangrove_stick", MANGROVE_STICK_FEATURE);
|
||||
register(context, "bamboo_stick", BAMBOO_STICK_FEATURE);
|
||||
for (StickType type : StickType.values()) {
|
||||
register(context, type.getName()+"_stick", CONFIGURED_FEATURES.get(type));
|
||||
}
|
||||
}
|
||||
|
||||
public static void initPlaced(Registerable<PlacedFeature> context) {
|
||||
register(context, "oak_stick", OAK_STICK_PLACED_FEATURE);
|
||||
register(context, "spruce_stick", SPRUCE_STICK_PLACED_FEATURE);
|
||||
register(context, "birch_stick", BIRCH_STICK_PLACED_FEATURE);
|
||||
register(context, "acacia_stick", ACACIA_STICK_PLACED_FEATURE);
|
||||
register(context, "jungle_stick", JUNGLE_STICK_PLACED_FEATURE);
|
||||
register(context, "dark_oak_stick", DARK_OAK_STICK_PLACED_FEATURE);
|
||||
register(context, "cherry_stick", CHERRY_STICK_PLACED_FEATURE);
|
||||
register(context, "mangrove_stick", MANGROVE_STICK_PLACED_FEATURE);
|
||||
register(context, "bamboo_stick", BAMBOO_STICK_PLACED_FEATURE);
|
||||
for (StickType type : StickType.values()) {
|
||||
PlacedFeature STICK_PLACED_FEATURE = switch (type) {
|
||||
case CRIMSON -> new PlacedFeature(RegistryEntry.of(CONFIGURED_FEATURES.get(type)), getNetherModifiers(90, 1, Blocks.CRIMSON_NYLIUM));
|
||||
case WARPED -> new PlacedFeature(RegistryEntry.of(CONFIGURED_FEATURES.get(type)), getNetherModifiers(90, 1, Blocks.WARPED_NYLIUM));
|
||||
case PALE_OAK -> new PlacedFeature(RegistryEntry.of(CONFIGURED_FEATURES.get(type)), getModifiers(20, 1, Blocks.GRASS_BLOCK, Blocks.PALE_MOSS_BLOCK));
|
||||
default -> new PlacedFeature(RegistryEntry.of(CONFIGURED_FEATURES.get(type)), getModifiers(3, 1, Blocks.GRASS_BLOCK, Blocks.MUD, Blocks.PODZOL));
|
||||
};
|
||||
register(context, type.getName() + "_stick", STICK_PLACED_FEATURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user