diff --git a/changes.md b/changes.md new file mode 100644 index 0000000..ef2f418 --- /dev/null +++ b/changes.md @@ -0,0 +1,7 @@ +# Changes + +10/03/2025 +- added Glowood Logs/planks/leaves/sapling and functional tree data-thing. +- That's kinda it? Basics for adding more items/blocks are being worked on. I think next order of business is finishing up the basic blocks and then working on either items or entity blocks like the furnace or crafting table. + +Also decide if armour trims should be a thing, and if so what palettes to use. Also move the paintings off of the old b1.7.3 format art blob into separate sprites(?), and add the mobs. After adding proper world gen for tree and ores do dark wheat and food stuffs I guess diff --git a/src/main/generated/assets/nethercraft-classic/blockstates/glowood_leaves.json b/src/main/generated/assets/nethercraft-classic/blockstates/glowood_leaves.json new file mode 100644 index 0000000..c1c0fb3 --- /dev/null +++ b/src/main/generated/assets/nethercraft-classic/blockstates/glowood_leaves.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "nethercraft-classic:block/glowood_leaves" + } + } +} \ No newline at end of file diff --git a/src/main/generated/assets/nethercraft-classic/blockstates/glowood_log.json b/src/main/generated/assets/nethercraft-classic/blockstates/glowood_log.json new file mode 100644 index 0000000..73c9d6d --- /dev/null +++ b/src/main/generated/assets/nethercraft-classic/blockstates/glowood_log.json @@ -0,0 +1,16 @@ +{ + "variants": { + "axis=x": { + "model": "nethercraft-classic:block/glowood_log_horizontal", + "x": 90, + "y": 90 + }, + "axis=y": { + "model": "nethercraft-classic:block/glowood_log" + }, + "axis=z": { + "model": "nethercraft-classic:block/glowood_log_horizontal", + "x": 90 + } + } +} \ No newline at end of file diff --git a/src/main/generated/assets/nethercraft-classic/blockstates/glowood_sapling.json b/src/main/generated/assets/nethercraft-classic/blockstates/glowood_sapling.json new file mode 100644 index 0000000..bd32c01 --- /dev/null +++ b/src/main/generated/assets/nethercraft-classic/blockstates/glowood_sapling.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "nethercraft-classic:block/glowood_sapling" + } + } +} \ No newline at end of file diff --git a/src/main/generated/assets/nethercraft-classic/models/block/glowood_leaves.json b/src/main/generated/assets/nethercraft-classic/models/block/glowood_leaves.json new file mode 100644 index 0000000..2f0e106 --- /dev/null +++ b/src/main/generated/assets/nethercraft-classic/models/block/glowood_leaves.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/leaves", + "textures": { + "all": "nethercraft-classic:block/glowood_leaves" + } +} \ No newline at end of file diff --git a/src/main/generated/assets/nethercraft-classic/models/block/glowood_log.json b/src/main/generated/assets/nethercraft-classic/models/block/glowood_log.json new file mode 100644 index 0000000..89552f5 --- /dev/null +++ b/src/main/generated/assets/nethercraft-classic/models/block/glowood_log.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column", + "textures": { + "end": "nethercraft-classic:block/glowood_log_top", + "side": "nethercraft-classic:block/glowood_log" + } +} \ No newline at end of file diff --git a/src/main/generated/assets/nethercraft-classic/models/block/glowood_log_horizontal.json b/src/main/generated/assets/nethercraft-classic/models/block/glowood_log_horizontal.json new file mode 100644 index 0000000..67327e4 --- /dev/null +++ b/src/main/generated/assets/nethercraft-classic/models/block/glowood_log_horizontal.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column_horizontal", + "textures": { + "end": "nethercraft-classic:block/glowood_log_top", + "side": "nethercraft-classic:block/glowood_log" + } +} \ No newline at end of file diff --git a/src/main/generated/assets/nethercraft-classic/models/block/glowood_sapling.json b/src/main/generated/assets/nethercraft-classic/models/block/glowood_sapling.json new file mode 100644 index 0000000..135ac3a --- /dev/null +++ b/src/main/generated/assets/nethercraft-classic/models/block/glowood_sapling.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "nethercraft-classic:block/glowood_sapling" + } +} \ No newline at end of file diff --git a/src/main/generated/assets/nethercraft-classic/models/item/glowood_leaves.json b/src/main/generated/assets/nethercraft-classic/models/item/glowood_leaves.json new file mode 100644 index 0000000..cee9427 --- /dev/null +++ b/src/main/generated/assets/nethercraft-classic/models/item/glowood_leaves.json @@ -0,0 +1,3 @@ +{ + "parent": "nethercraft-classic:block/glowood_leaves" +} \ No newline at end of file diff --git a/src/main/generated/assets/nethercraft-classic/models/item/glowood_log.json b/src/main/generated/assets/nethercraft-classic/models/item/glowood_log.json new file mode 100644 index 0000000..76eb9b4 --- /dev/null +++ b/src/main/generated/assets/nethercraft-classic/models/item/glowood_log.json @@ -0,0 +1,3 @@ +{ + "parent": "nethercraft-classic:block/glowood_log" +} \ No newline at end of file diff --git a/src/main/generated/assets/nethercraft-classic/models/item/glowood_sapling.json b/src/main/generated/assets/nethercraft-classic/models/item/glowood_sapling.json new file mode 100644 index 0000000..15f3dbc --- /dev/null +++ b/src/main/generated/assets/nethercraft-classic/models/item/glowood_sapling.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "nethercraft-classic:item/glowood_sapling" + } +} \ No newline at end of file diff --git a/src/main/generated/data/minecraft/tags/block/leaves.json b/src/main/generated/data/minecraft/tags/block/leaves.json new file mode 100644 index 0000000..ec5fd34 --- /dev/null +++ b/src/main/generated/data/minecraft/tags/block/leaves.json @@ -0,0 +1,5 @@ +{ + "values": [ + "nethercraft-classic:glowood_leaves" + ] +} \ No newline at end of file diff --git a/src/main/generated/data/minecraft/tags/block/logs.json b/src/main/generated/data/minecraft/tags/block/logs.json new file mode 100644 index 0000000..6d2554e --- /dev/null +++ b/src/main/generated/data/minecraft/tags/block/logs.json @@ -0,0 +1,5 @@ +{ + "values": [ + "nethercraft-classic:glowood_log" + ] +} \ No newline at end of file diff --git a/src/main/generated/data/minecraft/tags/item/leaves.json b/src/main/generated/data/minecraft/tags/item/leaves.json new file mode 100644 index 0000000..ec5fd34 --- /dev/null +++ b/src/main/generated/data/minecraft/tags/item/leaves.json @@ -0,0 +1,5 @@ +{ + "values": [ + "nethercraft-classic:glowood_leaves" + ] +} \ No newline at end of file diff --git a/src/main/generated/data/minecraft/tags/item/logs.json b/src/main/generated/data/minecraft/tags/item/logs.json new file mode 100644 index 0000000..6d2554e --- /dev/null +++ b/src/main/generated/data/minecraft/tags/item/logs.json @@ -0,0 +1,5 @@ +{ + "values": [ + "nethercraft-classic:glowood_log" + ] +} \ No newline at end of file diff --git a/src/main/generated/data/minecraft/tags/item/planks.json b/src/main/generated/data/minecraft/tags/item/planks.json new file mode 100644 index 0000000..9f04bf5 --- /dev/null +++ b/src/main/generated/data/minecraft/tags/item/planks.json @@ -0,0 +1,5 @@ +{ + "values": [ + "nethercraft-classic:glowood_planks" + ] +} \ No newline at end of file diff --git a/src/main/generated/data/nethercraft-classic/loot_table/blocks/glowood_leaves.json b/src/main/generated/data/nethercraft-classic/loot_table/blocks/glowood_leaves.json new file mode 100644 index 0000000..d4b1eaa --- /dev/null +++ b/src/main/generated/data/nethercraft-classic/loot_table/blocks/glowood_leaves.json @@ -0,0 +1,132 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "conditions": [ + { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "items": "minecraft:shears" + } + }, + { + "condition": "minecraft:match_tool", + "predicate": { + "predicates": { + "minecraft:enchantments": [ + { + "enchantments": "minecraft:silk_touch", + "levels": { + "min": 1 + } + } + ] + } + } + } + ] + } + ], + "name": "nethercraft-classic:glowood_leaves" + }, + { + "type": "minecraft:item", + "conditions": [ + { + "condition": "minecraft:survives_explosion" + }, + { + "chances": [ + 0.0625 + ], + "condition": "minecraft:table_bonus", + "enchantment": "minecraft:fortune" + } + ], + "name": "nethercraft-classic:glowood_sapling" + } + ] + } + ], + "rolls": 1.0 + }, + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "items": "minecraft:shears" + } + }, + { + "condition": "minecraft:match_tool", + "predicate": { + "predicates": { + "minecraft:enchantments": [ + { + "enchantments": "minecraft:silk_touch", + "levels": { + "min": 1 + } + } + ] + } + } + } + ] + } + } + ], + "entries": [ + { + "type": "minecraft:item", + "conditions": [ + { + "chances": [ + 0.02, + 0.022222223, + 0.025, + 0.033333335, + 0.1 + ], + "condition": "minecraft:table_bonus", + "enchantment": "minecraft:fortune" + } + ], + "functions": [ + { + "add": false, + "count": { + "type": "minecraft:uniform", + "max": 2.0, + "min": 1.0 + }, + "function": "minecraft:set_count" + }, + { + "function": "minecraft:explosion_decay" + } + ], + "name": "minecraft:stick" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/main/generated/data/nethercraft-classic/loot_table/blocks/glowood_log.json b/src/main/generated/data/nethercraft-classic/loot_table/blocks/glowood_log.json new file mode 100644 index 0000000..c12eb70 --- /dev/null +++ b/src/main/generated/data/nethercraft-classic/loot_table/blocks/glowood_log.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "nethercraft-classic:glowood_log" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/main/generated/data/nethercraft-classic/loot_table/blocks/glowood_sapling.json b/src/main/generated/data/nethercraft-classic/loot_table/blocks/glowood_sapling.json new file mode 100644 index 0000000..85693f3 --- /dev/null +++ b/src/main/generated/data/nethercraft-classic/loot_table/blocks/glowood_sapling.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "nethercraft-classic:glowood_sapling" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/main/generated/data/nethercraft-classic/worldgen/configured_feature/glowood.json b/src/main/generated/data/nethercraft-classic/worldgen/configured_feature/glowood.json new file mode 100644 index 0000000..f22e115 --- /dev/null +++ b/src/main/generated/data/nethercraft-classic/worldgen/configured_feature/glowood.json @@ -0,0 +1,52 @@ +{ + "type": "minecraft:tree", + "config": { + "decorators": [], + "dirt_provider": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "minecraft:netherrack" + } + }, + "foliage_placer": { + "type": "minecraft:blob_foliage_placer", + "height": 3, + "offset": 0, + "radius": 2 + }, + "foliage_provider": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "nethercraft-classic:glowood_leaves", + "Properties": { + "distance": "7", + "persistent": "false", + "waterlogged": "false" + } + } + }, + "force_dirt": false, + "ignore_vines": false, + "minimum_size": { + "type": "minecraft:two_layers_feature_size", + "limit": 1, + "lower_size": 0, + "upper_size": 1 + }, + "trunk_placer": { + "type": "minecraft:straight_trunk_placer", + "base_height": 4, + "height_rand_a": 2, + "height_rand_b": 0 + }, + "trunk_provider": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "nethercraft-classic:glowood_log", + "Properties": { + "axis": "y" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/java/xyz/ibatv/nethercraft/NethercraftClassic.java b/src/main/java/xyz/ibatv/nethercraft/NethercraftClassic.java index ed9d6af..485db3a 100644 --- a/src/main/java/xyz/ibatv/nethercraft/NethercraftClassic.java +++ b/src/main/java/xyz/ibatv/nethercraft/NethercraftClassic.java @@ -7,6 +7,7 @@ import org.slf4j.LoggerFactory; import xyz.ibatv.nethercraft.block.ModBlocks; import xyz.ibatv.nethercraft.item.ModItemGroups; import xyz.ibatv.nethercraft.item.ModItems; +import xyz.ibatv.nethercraft.world.gen.ModWorldGeneration; public class NethercraftClassic implements ModInitializer { public static final String MOD_ID = "nethercraft-classic"; @@ -29,5 +30,10 @@ public class NethercraftClassic implements ModInitializer { ModItems.registerModItems(); ModBlocks.registerModBlocks(); + + + ModWorldGeneration.generateModWorldGen(); + + } } \ No newline at end of file diff --git a/src/main/java/xyz/ibatv/nethercraft/NethercraftClassicClient.java b/src/main/java/xyz/ibatv/nethercraft/NethercraftClassicClient.java new file mode 100644 index 0000000..83ec5c2 --- /dev/null +++ b/src/main/java/xyz/ibatv/nethercraft/NethercraftClassicClient.java @@ -0,0 +1,13 @@ +package xyz.ibatv.nethercraft; + +import net.fabricmc.api.ClientModInitializer; +import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; +import net.minecraft.client.render.RenderLayer; +import xyz.ibatv.nethercraft.block.ModBlocks; + +public class NethercraftClassicClient implements ClientModInitializer { + @Override + public void onInitializeClient() { + BlockRenderLayerMap.INSTANCE.putBlock(ModBlocks.GLOWOOD_SAPLING, RenderLayer.getCutout()); + } +} diff --git a/src/main/java/xyz/ibatv/nethercraft/NethercraftClassicDataGenerator.java b/src/main/java/xyz/ibatv/nethercraft/NethercraftClassicDataGenerator.java index 5d2bbc7..7c87184 100644 --- a/src/main/java/xyz/ibatv/nethercraft/NethercraftClassicDataGenerator.java +++ b/src/main/java/xyz/ibatv/nethercraft/NethercraftClassicDataGenerator.java @@ -2,7 +2,11 @@ package xyz.ibatv.nethercraft; import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint; import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; +import net.minecraft.registry.RegistryBuilder; +import net.minecraft.registry.RegistryKeys; import xyz.ibatv.nethercraft.datagen.*; +import xyz.ibatv.nethercraft.world.ModConfiguredFeatures; +import xyz.ibatv.nethercraft.world.ModPlacedFeatures; public class NethercraftClassicDataGenerator implements DataGeneratorEntrypoint { @Override @@ -14,5 +18,13 @@ public class NethercraftClassicDataGenerator implements DataGeneratorEntrypoint pack.addProvider(ModLootTableProvider::new); pack.addProvider(ModModelProvider::new); pack.addProvider(ModRecipeProvider::new); + pack.addProvider(ModRegistryDataGenerator::new); + } + + + @Override + public void buildRegistry(RegistryBuilder registryBuilder) { + registryBuilder.addRegistry(RegistryKeys.CONFIGURED_FEATURE, ModConfiguredFeatures::bootstrap); + registryBuilder.addRegistry(RegistryKeys.PLACED_FEATURE, ModPlacedFeatures::bootstrap); } } diff --git a/src/main/java/xyz/ibatv/nethercraft/block/ModBlocks.java b/src/main/java/xyz/ibatv/nethercraft/block/ModBlocks.java index 7d037af..69e75b9 100644 --- a/src/main/java/xyz/ibatv/nethercraft/block/ModBlocks.java +++ b/src/main/java/xyz/ibatv/nethercraft/block/ModBlocks.java @@ -1,19 +1,33 @@ package xyz.ibatv.nethercraft.block; -import net.minecraft.block.AbstractBlock; -import net.minecraft.block.Block; +import net.minecraft.block.*; import net.minecraft.item.BlockItem; import net.minecraft.item.Item; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; -import net.minecraft.sound.BlockSoundGroup; import net.minecraft.util.Identifier; import xyz.ibatv.nethercraft.NethercraftClassic; +import xyz.ibatv.nethercraft.block.custom.ModSaplingBlock; +import xyz.ibatv.nethercraft.world.tree.ModSaplingGenerators; public class ModBlocks { + public static final Block GLOWOOD_LOG = registerBlock("glowood_log", + new PillarBlock(AbstractBlock.Settings.copy(Blocks.OAK_LOG))); + public static final Block GLOWOOD_PLANKS = registerBlock("glowood_planks", - new Block(AbstractBlock.Settings.create().strength(4f).requiresTool().sounds(BlockSoundGroup.WOOD))); + new Block(AbstractBlock.Settings.copy(Blocks.OAK_PLANKS))); + public static final Block GLOWOOD_LEAVES = registerBlock("glowood_leaves", + new LeavesBlock(AbstractBlock.Settings.copy(Blocks.OAK_LEAVES))); + + public static final Block GLOWOOD_SAPLING = registerBlock("glowood_sapling", + new ModSaplingBlock(ModSaplingGenerators.GLOWOOD, AbstractBlock.Settings.copy(Blocks.OAK_SAPLING), Blocks.NETHERRACK)); + + //public static final Block GLOWOOD_SAPLING = registerBlock("glowood_sapling", + // new SaplingBlock(ModSaplingGenerators.GLOWOOD, AbstractBlock.Settings.copy(Blocks.OAK_SAPLING))); + + + private static Block registerBlockWithoutBlockItem(String name, Block block){ return Registry.register(Registries.BLOCK, Identifier.of(NethercraftClassic.MOD_ID, name), block); diff --git a/src/main/java/xyz/ibatv/nethercraft/block/custom/ModSaplingBlock.java b/src/main/java/xyz/ibatv/nethercraft/block/custom/ModSaplingBlock.java new file mode 100644 index 0000000..3b56660 --- /dev/null +++ b/src/main/java/xyz/ibatv/nethercraft/block/custom/ModSaplingBlock.java @@ -0,0 +1,23 @@ +package xyz.ibatv.nethercraft.block.custom; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.SaplingBlock; +import net.minecraft.block.SaplingGenerator; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.BlockView; + +public class ModSaplingBlock extends SaplingBlock { + private final Block blockToPlaceOn; + + + public ModSaplingBlock(SaplingGenerator generator, Settings settings, Block block) { + super(generator, settings); + this.blockToPlaceOn = block; + } + + @Override + protected boolean canPlantOnTop(BlockState floor, BlockView world, BlockPos pos) { + return floor.isOf(this.blockToPlaceOn); + } +} diff --git a/src/main/java/xyz/ibatv/nethercraft/datagen/ModBlockTagProvider.java b/src/main/java/xyz/ibatv/nethercraft/datagen/ModBlockTagProvider.java index 3b10fa1..33d976a 100644 --- a/src/main/java/xyz/ibatv/nethercraft/datagen/ModBlockTagProvider.java +++ b/src/main/java/xyz/ibatv/nethercraft/datagen/ModBlockTagProvider.java @@ -4,6 +4,7 @@ import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; import net.minecraft.registry.RegistryWrapper; import net.minecraft.registry.tag.BlockTags; +import net.minecraft.registry.tag.ItemTags; import xyz.ibatv.nethercraft.block.ModBlocks; import java.util.concurrent.CompletableFuture; @@ -24,5 +25,12 @@ public class ModBlockTagProvider extends FabricTagProvider.BlockTagProvider { //getOrCreateTagBuilder(BlockTags.NEEDS_IRON_TOOL) // .add(ModBlocks.PROSPERITY_GEMSTONE_BLOCK) + + + getOrCreateTagBuilder(BlockTags.LOGS) + .add(ModBlocks.GLOWOOD_LOG); + + getOrCreateTagBuilder(BlockTags.LEAVES) + .add(ModBlocks.GLOWOOD_LEAVES); } } diff --git a/src/main/java/xyz/ibatv/nethercraft/datagen/ModItemTagProvider.java b/src/main/java/xyz/ibatv/nethercraft/datagen/ModItemTagProvider.java index cb557c4..65440be 100644 --- a/src/main/java/xyz/ibatv/nethercraft/datagen/ModItemTagProvider.java +++ b/src/main/java/xyz/ibatv/nethercraft/datagen/ModItemTagProvider.java @@ -3,6 +3,8 @@ package xyz.ibatv.nethercraft.datagen; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; +import net.minecraft.registry.tag.ItemTags; +import xyz.ibatv.nethercraft.block.ModBlocks; import xyz.ibatv.nethercraft.item.ModItems; //import xyz.ibatv.nethercraft.util.ModTags; import net.minecraft.item.Items; @@ -23,5 +25,15 @@ public class ModItemTagProvider extends FabricTagProvider.ItemTagProvider { // .add(Items.COAL) // .add(Items.STICK) // .add(Items.APPLE); + + + getOrCreateTagBuilder(ItemTags.LOGS) + .add(ModBlocks.GLOWOOD_LOG.asItem()); + + getOrCreateTagBuilder(ItemTags.PLANKS) + .add(ModBlocks.GLOWOOD_PLANKS.asItem()); + + getOrCreateTagBuilder(ItemTags.LEAVES) + .add(ModBlocks.GLOWOOD_LEAVES.asItem()); } } diff --git a/src/main/java/xyz/ibatv/nethercraft/datagen/ModLootTableProvider.java b/src/main/java/xyz/ibatv/nethercraft/datagen/ModLootTableProvider.java index 31c1e46..808e5ec 100644 --- a/src/main/java/xyz/ibatv/nethercraft/datagen/ModLootTableProvider.java +++ b/src/main/java/xyz/ibatv/nethercraft/datagen/ModLootTableProvider.java @@ -30,7 +30,11 @@ public class ModLootTableProvider extends FabricBlockLootTableProvider { @Override public void generate() { + addDrop(ModBlocks.GLOWOOD_LOG); addDrop(ModBlocks.GLOWOOD_PLANKS); + addDrop(ModBlocks.GLOWOOD_SAPLING); + + addDrop(ModBlocks.GLOWOOD_LEAVES, leavesDrops(ModBlocks.GLOWOOD_LEAVES, ModBlocks.GLOWOOD_SAPLING, 0.0625f)); //addDrop(ModBlocks.PROSPERITY_ORE, multipleOreDrops(ModBlocks.PROSPERITY_ORE, ModItems.PROSPERITY_SHARD, 1, 4)); //addDrop(ModBlocks.INFERIUM_ORE, multipleOreDrops(ModBlocks.INFERIUM_ORE, ModItems.INFERIUM_ESSENCE, 2, 4)); diff --git a/src/main/java/xyz/ibatv/nethercraft/datagen/ModModelProvider.java b/src/main/java/xyz/ibatv/nethercraft/datagen/ModModelProvider.java index d0e09e2..4333b75 100644 --- a/src/main/java/xyz/ibatv/nethercraft/datagen/ModModelProvider.java +++ b/src/main/java/xyz/ibatv/nethercraft/datagen/ModModelProvider.java @@ -2,6 +2,7 @@ package xyz.ibatv.nethercraft.datagen; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.fabricmc.fabric.api.datagen.v1.provider.FabricModelProvider; +import net.minecraft.data.client.TexturedModel; import xyz.ibatv.nethercraft.block.ModBlocks; import xyz.ibatv.nethercraft.item.ModItems; import net.minecraft.data.client.BlockStateModelGenerator; @@ -15,7 +16,11 @@ public class ModModelProvider extends FabricModelProvider { @Override public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGenerator) { + blockStateModelGenerator.registerLog(ModBlocks.GLOWOOD_LOG).log(ModBlocks.GLOWOOD_LOG); + blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.GLOWOOD_PLANKS); + blockStateModelGenerator.registerSingleton(ModBlocks.GLOWOOD_LEAVES, TexturedModel.LEAVES); + blockStateModelGenerator.registerTintableCrossBlockState(ModBlocks.GLOWOOD_SAPLING, BlockStateModelGenerator.TintType.NOT_TINTED); } @Override diff --git a/src/main/java/xyz/ibatv/nethercraft/datagen/ModRegistryDataGenerator.java b/src/main/java/xyz/ibatv/nethercraft/datagen/ModRegistryDataGenerator.java new file mode 100644 index 0000000..1ff943c --- /dev/null +++ b/src/main/java/xyz/ibatv/nethercraft/datagen/ModRegistryDataGenerator.java @@ -0,0 +1,25 @@ +package xyz.ibatv.nethercraft.datagen; + +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricDynamicRegistryProvider; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.RegistryWrapper; + +import java.util.concurrent.CompletableFuture; + +public class ModRegistryDataGenerator extends FabricDynamicRegistryProvider { + public ModRegistryDataGenerator(FabricDataOutput output, CompletableFuture registriesFuture) { + super(output, registriesFuture); + } + + @Override + protected void configure(RegistryWrapper.WrapperLookup registries, Entries entries) { + entries.addAll(registries.getWrapperOrThrow(RegistryKeys.CONFIGURED_FEATURE)); + entries.addAll(registries.getWrapperOrThrow(RegistryKeys.PLACED_FEATURE)); + } + + @Override + public String getName() { + return ""; + } +} \ No newline at end of file diff --git a/src/main/java/xyz/ibatv/nethercraft/item/ModItemGroups.java b/src/main/java/xyz/ibatv/nethercraft/item/ModItemGroups.java index 1900db3..312c134 100644 --- a/src/main/java/xyz/ibatv/nethercraft/item/ModItemGroups.java +++ b/src/main/java/xyz/ibatv/nethercraft/item/ModItemGroups.java @@ -18,7 +18,10 @@ public class ModItemGroups { .displayName(Text.translatable("itemgroup.nethercraft.nethercraft_group")) .entries((displayContext, entries) -> { //Blocks + entries.add(ModBlocks.GLOWOOD_LOG); + entries.add(ModBlocks.GLOWOOD_LEAVES); entries.add(ModBlocks.GLOWOOD_PLANKS); + entries.add(ModBlocks.GLOWOOD_SAPLING); //Items entries.add(ModItems.NETHERSTICK); }).build()); diff --git a/src/main/java/xyz/ibatv/nethercraft/world/ModConfiguredFeatures.java b/src/main/java/xyz/ibatv/nethercraft/world/ModConfiguredFeatures.java new file mode 100644 index 0000000..ae4caa0 --- /dev/null +++ b/src/main/java/xyz/ibatv/nethercraft/world/ModConfiguredFeatures.java @@ -0,0 +1,45 @@ +package xyz.ibatv.nethercraft.world; + +import net.minecraft.block.Blocks; +import net.minecraft.registry.Registerable; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.intprovider.ConstantIntProvider; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.FeatureConfig; +import net.minecraft.world.gen.feature.TreeFeatureConfig; +import net.minecraft.world.gen.feature.size.TwoLayersFeatureSize; +import net.minecraft.world.gen.foliage.BlobFoliagePlacer; +import net.minecraft.world.gen.stateprovider.BlockStateProvider; +import net.minecraft.world.gen.trunk.StraightTrunkPlacer; +import xyz.ibatv.nethercraft.NethercraftClassic; +import xyz.ibatv.nethercraft.block.ModBlocks; + +public class ModConfiguredFeatures { + // CF > PF > WG + + public static final RegistryKey> GLOWOOD_KEY = registerKey("glowood"); + + public static void bootstrap(Registerable> context) { + + register(context, GLOWOOD_KEY, Feature.TREE, new TreeFeatureConfig.Builder( + BlockStateProvider.of(ModBlocks.GLOWOOD_LOG), + new StraightTrunkPlacer(4,2,0), + + BlockStateProvider.of(ModBlocks.GLOWOOD_LEAVES), + new BlobFoliagePlacer(ConstantIntProvider.create(2), ConstantIntProvider.create(0), 3), + + new TwoLayersFeatureSize(1, 0, 1)).dirtProvider(BlockStateProvider.of(Blocks.NETHERRACK)).build()); + } + + public static RegistryKey> registerKey(String name) { + return RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, Identifier.of(NethercraftClassic.MOD_ID, name)); + } + + private static > void register(Registerable> context, + RegistryKey> key, F feature, FC configuration) { + context.register(key, new ConfiguredFeature<>(feature, configuration)); + } +} \ No newline at end of file diff --git a/src/main/java/xyz/ibatv/nethercraft/world/ModPlacedFeatures.java b/src/main/java/xyz/ibatv/nethercraft/world/ModPlacedFeatures.java new file mode 100644 index 0000000..b8c30e2 --- /dev/null +++ b/src/main/java/xyz/ibatv/nethercraft/world/ModPlacedFeatures.java @@ -0,0 +1,38 @@ +package xyz.ibatv.nethercraft.world; + +import net.minecraft.registry.Registerable; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.entry.RegistryEntry; +import net.minecraft.util.Identifier; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.FeatureConfig; +import net.minecraft.world.gen.feature.PlacedFeature; +import net.minecraft.world.gen.placementmodifier.PlacementModifier; +import xyz.ibatv.nethercraft.NethercraftClassic; + +import java.util.List; + +public class ModPlacedFeatures { + + public static void bootstrap(Registerable context) { + var configuredFeatures = context.getRegistryLookup(RegistryKeys.CONFIGURED_FEATURE); + + } + + public static RegistryKey registerKey(String name) { + return RegistryKey.of(RegistryKeys.PLACED_FEATURE, Identifier.of(NethercraftClassic.MOD_ID, name)); + } + + private static void register(Registerable context, RegistryKey key, RegistryEntry> configuration, + List modifiers) { + context.register(key, new PlacedFeature(configuration, List.copyOf(modifiers))); + } + + private static > void register(Registerable context, RegistryKey key, + RegistryEntry> configuration, + PlacementModifier... modifiers) { + register(context, key, configuration, List.of(modifiers)); + } +} diff --git a/src/main/java/xyz/ibatv/nethercraft/world/gen/ModWorldGeneration.java b/src/main/java/xyz/ibatv/nethercraft/world/gen/ModWorldGeneration.java new file mode 100644 index 0000000..5546943 --- /dev/null +++ b/src/main/java/xyz/ibatv/nethercraft/world/gen/ModWorldGeneration.java @@ -0,0 +1,8 @@ +package xyz.ibatv.nethercraft.world.gen; + +public class ModWorldGeneration { + public static void generateModWorldGen() { + + + } +} diff --git a/src/main/java/xyz/ibatv/nethercraft/world/tree/ModSaplingGenerators.java b/src/main/java/xyz/ibatv/nethercraft/world/tree/ModSaplingGenerators.java new file mode 100644 index 0000000..9289f30 --- /dev/null +++ b/src/main/java/xyz/ibatv/nethercraft/world/tree/ModSaplingGenerators.java @@ -0,0 +1,12 @@ +package xyz.ibatv.nethercraft.world.tree; + +import net.minecraft.block.SaplingGenerator; +import xyz.ibatv.nethercraft.NethercraftClassic; +import xyz.ibatv.nethercraft.world.ModConfiguredFeatures; + +import java.util.Optional; + +public class ModSaplingGenerators { + public static final SaplingGenerator GLOWOOD = new SaplingGenerator(NethercraftClassic.MOD_ID + ":glowood", + Optional.empty(), Optional.of(ModConfiguredFeatures.GLOWOOD_KEY), Optional.empty()); +} diff --git a/src/main/resources/assets/nethercraft-classic/lang/en_us.json b/src/main/resources/assets/nethercraft-classic/lang/en_us.json index 986e33d..8c1c600 100644 --- a/src/main/resources/assets/nethercraft-classic/lang/en_us.json +++ b/src/main/resources/assets/nethercraft-classic/lang/en_us.json @@ -4,5 +4,8 @@ "item.nethercraft-classic.netherstick": "Netherstick", - "block.nethercraft-classic.glowood_planks": "Glowood Planks" + "block.nethercraft-classic.glowood_log": "Glowood Log", + "block.nethercraft-classic.glowood_leaves": "Glowood Leaves", + "block.nethercraft-classic.glowood_planks": "Glowood Planks", + "block.nethercraft-classic.glowood_sapling": "Glowood Sapling" } diff --git a/src/main/resources/assets/nethercraft-classic/textures/block/glowsapling.png b/src/main/resources/assets/nethercraft-classic/textures/block/glowood_sapling.png similarity index 100% rename from src/main/resources/assets/nethercraft-classic/textures/block/glowsapling.png rename to src/main/resources/assets/nethercraft-classic/textures/block/glowood_sapling.png diff --git a/src/main/resources/assets/nethercraft-classic/textures/item/glowood_sapling.png b/src/main/resources/assets/nethercraft-classic/textures/item/glowood_sapling.png new file mode 100644 index 0000000..ead4502 Binary files /dev/null and b/src/main/resources/assets/nethercraft-classic/textures/item/glowood_sapling.png differ diff --git a/src/main/resources/assets/nethercraft-classic/textures/art/ne.png b/src/main/resources/assets/nethercraft-classic/textures/painting/ne.png similarity index 100% rename from src/main/resources/assets/nethercraft-classic/textures/art/ne.png rename to src/main/resources/assets/nethercraft-classic/textures/painting/ne.png diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 25dd05c..331d694 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -21,6 +21,9 @@ ], "fabric-datagen": [ "xyz.ibatv.nethercraft.NethercraftClassicDataGenerator" + ], + "client": [ + "xyz.ibatv.nethercraft.NethercraftClassicClient" ] }, "mixins": [