diff --git a/README.md b/README.md new file mode 100644 index 0000000..7797a13 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +![Available for Fabric](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/compact/supported/fabric_vector.svg) + +***Rounded*** is a Vanilla+ mod which aims to round out (pun intended) the features of the base game. + +The initial release of the mod is version 1.0.0, titled **Round of Applause**. It was made for [ModFest: Carnival](https://modfest.net/carnival). + +## Features +- **Treated Planks**, made with some planks and a honeycomb, which mobs won't walk over; +- The **Trough**, which given some grain heals nearby animals and helps baby animals grow; +- **Lustershrooms**, found in swamps, old growth taigas, groves and (in greater quantities) in dark forests, can be grown with bonemeal and have their cap harvested to create **Luster Clusters**, which provide enchanting power. + +More features will be added in future versions of the mod! \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index d86c4d9..dbe524c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ yarn_mappings=1.21+build.2 loader_version=0.15.11 # Mod Properties -mod_version=1.0.4 +mod_version=1.1.0 maven_group=com.lumiscosity.rounded archives_base_name=rounded diff --git a/src/client/resources/assets/rounded/blockstates/bladderwrack.json b/src/client/resources/assets/rounded/blockstates/bladderwrack.json new file mode 100644 index 0000000..f9a708a --- /dev/null +++ b/src/client/resources/assets/rounded/blockstates/bladderwrack.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "rounded:block/bladderwrack" + } + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/blockstates/bladderwrack_block.json b/src/client/resources/assets/rounded/blockstates/bladderwrack_block.json new file mode 100644 index 0000000..8807452 --- /dev/null +++ b/src/client/resources/assets/rounded/blockstates/bladderwrack_block.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "rounded:block/bladderwrack_block" + } + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/blockstates/bladderwrack_wall.json b/src/client/resources/assets/rounded/blockstates/bladderwrack_wall.json new file mode 100644 index 0000000..6b49177 --- /dev/null +++ b/src/client/resources/assets/rounded/blockstates/bladderwrack_wall.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=east": { + "model": "rounded:block/bladderwrack_wall", + "y": 90 + }, + "facing=north": { + "model": "rounded:block/bladderwrack_wall" + }, + "facing=south": { + "model": "rounded:block/bladderwrack_wall", + "y": 180 + }, + "facing=west": { + "model": "rounded:block/bladderwrack_wall", + "y": 270 + } + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/blockstates/chiseled_prismarine_bricks.json b/src/client/resources/assets/rounded/blockstates/chiseled_prismarine_bricks.json new file mode 100644 index 0000000..e8c661d --- /dev/null +++ b/src/client/resources/assets/rounded/blockstates/chiseled_prismarine_bricks.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "rounded:block/chiseled_prismarine_bricks" + } + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/blockstates/dead_bladderwrack.json b/src/client/resources/assets/rounded/blockstates/dead_bladderwrack.json new file mode 100644 index 0000000..9a5b47d --- /dev/null +++ b/src/client/resources/assets/rounded/blockstates/dead_bladderwrack.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "rounded:block/dead_bladderwrack" + } + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/blockstates/dead_bladderwrack_wall.json b/src/client/resources/assets/rounded/blockstates/dead_bladderwrack_wall.json new file mode 100644 index 0000000..1c5d5be --- /dev/null +++ b/src/client/resources/assets/rounded/blockstates/dead_bladderwrack_wall.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=east": { + "model": "rounded:block/dead_bladderwrack_wall", + "y": 90 + }, + "facing=north": { + "model": "rounded:block/dead_bladderwrack_wall" + }, + "facing=south": { + "model": "rounded:block/dead_bladderwrack_wall", + "y": 180 + }, + "facing=west": { + "model": "rounded:block/dead_bladderwrack_wall", + "y": 270 + } + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/blockstates/prismarine_lantern.json b/src/client/resources/assets/rounded/blockstates/prismarine_lantern.json new file mode 100644 index 0000000..44b2dbb --- /dev/null +++ b/src/client/resources/assets/rounded/blockstates/prismarine_lantern.json @@ -0,0 +1,10 @@ +{ + "variants": { + "hanging=false": { + "model": "rounded:block/prismarine_lantern" + }, + "hanging=true": { + "model": "rounded:block/prismarine_lantern_hanging" + } + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/blockstates/smooth_prismarine.json b/src/client/resources/assets/rounded/blockstates/smooth_prismarine.json new file mode 100644 index 0000000..f62acb0 --- /dev/null +++ b/src/client/resources/assets/rounded/blockstates/smooth_prismarine.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "rounded:block/smooth_prismarine" + } + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/blockstates/smooth_prismarine_slab.json b/src/client/resources/assets/rounded/blockstates/smooth_prismarine_slab.json new file mode 100644 index 0000000..d226959 --- /dev/null +++ b/src/client/resources/assets/rounded/blockstates/smooth_prismarine_slab.json @@ -0,0 +1,13 @@ +{ + "variants": { + "type=bottom": { + "model": "rounded:block/smooth_prismarine_slab" + }, + "type=double": { + "model": "rounded:block/smooth_prismarine" + }, + "type=top": { + "model": "rounded:block/smooth_prismarine_slab_top" + } + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/lang/en_us.json b/src/client/resources/assets/rounded/lang/en_us.json index d6589a7..3465aa8 100644 --- a/src/client/resources/assets/rounded/lang/en_us.json +++ b/src/client/resources/assets/rounded/lang/en_us.json @@ -14,11 +14,24 @@ "block.rounded.lustershroom_block": "Lustershroom Block", "block.rounded.luster_cluster": "Luster Cluster", "block.rounded.trough": "Trough", + "block.rounded.smooth_prismarine": "Smooth Prismarine", + "block.rounded.smooth_prismarine_slab": "Smooth Prismarine Slab", + "block.rounded.chiseled_prismarine_bricks": "Chiseled Prismarine Bricks", + "block.rounded.prismarine_lantern": "Prismarine Lantern", + "block.rounded.dead_bladderwrack": "Dead Bladderwrack", + "block.rounded.bladderwrack": "Bladderwrack", + "block.rounded.bladderwrack_block": "Bladderwrack Block", + "block.rounded.moisture_detector": "Moisture Detector", "subtitles.rounded.block.trough_fill": "Trough filled", "subtitles.rounded.block.trough_consume": "Trough consumed", "subtitles.rounded.block.trough_rustle": "Feed rustles", - "tag.worldgen.biome.rounded.has_lustershrooms": "Has Lustershrooms", - "tag.worldgen.biome.rounded.has_more_lustershrooms": "Has more Lustershrooms", + "tag.worldgen.biome.rounded.has_lustershrooms": "Has lustershrooms", + "tag.worldgen.biome.rounded.has_more_lustershrooms": "Has more lustershrooms", + "tag.worldgen.biome.rounded.has_smooth_basalt_sea_rocks": "Has Smooth Basalt sea rocks", + "tag.worldgen.biome.rounded.has_andesite_sea_rocks": "Has andesite sea rocks", + "tag.worldgen.biome.rounded.has_diorite_sea_rocks": "Has diorite sea rocks", + "tag.worldgen.biome.rounded.has_sea_copper_deposits": "Has sea copper deposits", + "tag.worldgen.biome.rounded.has_bladderwrack": "Has bladderwrack", "tag.item.rounded.trough_feed": "Trough Feed", "tag.item.rounded.treated_planks": "Treated Planks", "tag.item.c.grain": "Grain", diff --git a/src/client/resources/assets/rounded/models/block/bladderwrack.json b/src/client/resources/assets/rounded/models/block/bladderwrack.json new file mode 100644 index 0000000..029c304 --- /dev/null +++ b/src/client/resources/assets/rounded/models/block/bladderwrack.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/coral_fan", + "textures": { + "fan": "rounded:block/bladderwrack" + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/models/block/bladderwrack_block.json b/src/client/resources/assets/rounded/models/block/bladderwrack_block.json new file mode 100644 index 0000000..d607121 --- /dev/null +++ b/src/client/resources/assets/rounded/models/block/bladderwrack_block.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "rounded:block/bladderwrack_block" + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/models/block/bladderwrack_wall.json b/src/client/resources/assets/rounded/models/block/bladderwrack_wall.json new file mode 100644 index 0000000..182b29d --- /dev/null +++ b/src/client/resources/assets/rounded/models/block/bladderwrack_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/coral_wall_fan", + "textures": { + "fan": "rounded:block/bladderwrack" + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/models/block/chiseled_prismarine_bricks.json b/src/client/resources/assets/rounded/models/block/chiseled_prismarine_bricks.json new file mode 100644 index 0000000..fcdf31c --- /dev/null +++ b/src/client/resources/assets/rounded/models/block/chiseled_prismarine_bricks.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column", + "textures": { + "end": "minecraft:block/prismarine_bricks", + "side": "rounded:block/chiseled_prismarine_bricks" + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/models/block/dead_bladderwrack.json b/src/client/resources/assets/rounded/models/block/dead_bladderwrack.json new file mode 100644 index 0000000..b0fd4ad --- /dev/null +++ b/src/client/resources/assets/rounded/models/block/dead_bladderwrack.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/coral_fan", + "textures": { + "fan": "rounded:block/dead_bladderwrack" + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/models/block/dead_bladderwrack_wall.json b/src/client/resources/assets/rounded/models/block/dead_bladderwrack_wall.json new file mode 100644 index 0000000..752ede3 --- /dev/null +++ b/src/client/resources/assets/rounded/models/block/dead_bladderwrack_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/coral_wall_fan", + "textures": { + "fan": "rounded:block/dead_bladderwrack" + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/models/block/prismarine_lantern.json b/src/client/resources/assets/rounded/models/block/prismarine_lantern.json new file mode 100644 index 0000000..5ca349d --- /dev/null +++ b/src/client/resources/assets/rounded/models/block/prismarine_lantern.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/template_lantern", + "textures": { + "lantern": "rounded:block/prismarine_lantern" + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/models/block/prismarine_lantern_hanging.json b/src/client/resources/assets/rounded/models/block/prismarine_lantern_hanging.json new file mode 100644 index 0000000..f67c827 --- /dev/null +++ b/src/client/resources/assets/rounded/models/block/prismarine_lantern_hanging.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/template_hanging_lantern", + "textures": { + "lantern": "rounded:block/prismarine_lantern" + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/models/block/smooth_prismarine.json b/src/client/resources/assets/rounded/models/block/smooth_prismarine.json new file mode 100644 index 0000000..5f5ca9d --- /dev/null +++ b/src/client/resources/assets/rounded/models/block/smooth_prismarine.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "rounded:block/smooth_prismarine" + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/models/block/smooth_prismarine_slab.json b/src/client/resources/assets/rounded/models/block/smooth_prismarine_slab.json new file mode 100644 index 0000000..6264b33 --- /dev/null +++ b/src/client/resources/assets/rounded/models/block/smooth_prismarine_slab.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/slab", + "textures": { + "bottom": "rounded:block/smooth_prismarine", + "side": "rounded:block/smooth_prismarine_slab_side", + "top": "rounded:block/smooth_prismarine" + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/models/block/smooth_prismarine_slab_double.json b/src/client/resources/assets/rounded/models/block/smooth_prismarine_slab_double.json new file mode 100644 index 0000000..14a6e7c --- /dev/null +++ b/src/client/resources/assets/rounded/models/block/smooth_prismarine_slab_double.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:block/cube_column", + "textures": { + "end": "rounded:block/smooth_prismarine", + "side": "rounded:block/smooth_prismarine_slab_side" + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/models/block/smooth_prismarine_slab_top.json b/src/client/resources/assets/rounded/models/block/smooth_prismarine_slab_top.json new file mode 100644 index 0000000..ce454a6 --- /dev/null +++ b/src/client/resources/assets/rounded/models/block/smooth_prismarine_slab_top.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/slab_top", + "textures": { + "bottom": "rounded:block/smooth_prismarine", + "side": "rounded:block/smooth_prismarine_slab_side", + "top": "rounded:block/smooth_prismarine" + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/models/item/bladderwrack.json b/src/client/resources/assets/rounded/models/item/bladderwrack.json new file mode 100644 index 0000000..d281122 --- /dev/null +++ b/src/client/resources/assets/rounded/models/item/bladderwrack.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "rounded:block/bladderwrack" + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/models/item/bladderwrack_block.json b/src/client/resources/assets/rounded/models/item/bladderwrack_block.json new file mode 100644 index 0000000..c44afe3 --- /dev/null +++ b/src/client/resources/assets/rounded/models/item/bladderwrack_block.json @@ -0,0 +1,3 @@ +{ + "parent": "rounded:block/bladderwrack_block" +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/models/item/chiseled_prismarine_bricks.json b/src/client/resources/assets/rounded/models/item/chiseled_prismarine_bricks.json new file mode 100644 index 0000000..05bbfa8 --- /dev/null +++ b/src/client/resources/assets/rounded/models/item/chiseled_prismarine_bricks.json @@ -0,0 +1,3 @@ +{ + "parent": "rounded:block/chiseled_prismarine_bricks" +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/models/item/dead_bladderwrack.json b/src/client/resources/assets/rounded/models/item/dead_bladderwrack.json new file mode 100644 index 0000000..5467d35 --- /dev/null +++ b/src/client/resources/assets/rounded/models/item/dead_bladderwrack.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "rounded:block/dead_bladderwrack" + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/models/item/moisture_detector.json b/src/client/resources/assets/rounded/models/item/moisture_detector.json new file mode 100644 index 0000000..3aa521c --- /dev/null +++ b/src/client/resources/assets/rounded/models/item/moisture_detector.json @@ -0,0 +1,3 @@ +{ + "parent": "rounded:block/moisture_detector" +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/models/item/prismarine_lantern.json b/src/client/resources/assets/rounded/models/item/prismarine_lantern.json new file mode 100644 index 0000000..52b64f1 --- /dev/null +++ b/src/client/resources/assets/rounded/models/item/prismarine_lantern.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "rounded:item/prismarine_lantern" + } +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/models/item/smooth_prismarine.json b/src/client/resources/assets/rounded/models/item/smooth_prismarine.json new file mode 100644 index 0000000..d031b23 --- /dev/null +++ b/src/client/resources/assets/rounded/models/item/smooth_prismarine.json @@ -0,0 +1,3 @@ +{ + "parent": "rounded:block/smooth_prismarine" +} \ No newline at end of file diff --git a/src/client/resources/assets/rounded/models/item/smooth_prismarine_slab.json b/src/client/resources/assets/rounded/models/item/smooth_prismarine_slab.json new file mode 100644 index 0000000..6ea0b84 --- /dev/null +++ b/src/client/resources/assets/rounded/models/item/smooth_prismarine_slab.json @@ -0,0 +1,3 @@ +{ + "parent": "rounded:block/smooth_prismarine_slab" +} \ No newline at end of file diff --git a/src/main/java/com/lumiscosity/rounded/RegisterMisc.java b/src/main/java/com/lumiscosity/rounded/RegisterMisc.java new file mode 100644 index 0000000..c3c116f --- /dev/null +++ b/src/main/java/com/lumiscosity/rounded/RegisterMisc.java @@ -0,0 +1,19 @@ +package com.lumiscosity.rounded; + +import net.fabricmc.fabric.api.loot.v2.LootTableEvents; +import net.minecraft.loot.LootPool; +import net.minecraft.loot.LootTables; +import net.minecraft.loot.entry.ItemEntry; + +import static com.lumiscosity.rounded.blocks.RegisterBlocks.BLADDERWRACK_ITEM; + +public class RegisterMisc { + public static void initMisc() { + LootTableEvents.MODIFY.register((key, tableBuilder, source) -> { + if (LootTables.FISHING_JUNK_GAMEPLAY.equals(key)) { + LootPool.Builder poolBuilder = LootPool.builder().with(ItemEntry.builder(BLADDERWRACK_ITEM).weight(10)); + tableBuilder.pool(poolBuilder); + } + }); + } +} diff --git a/src/main/java/com/lumiscosity/rounded/Rounded.java b/src/main/java/com/lumiscosity/rounded/Rounded.java index 8ecc777..4b13405 100644 --- a/src/main/java/com/lumiscosity/rounded/Rounded.java +++ b/src/main/java/com/lumiscosity/rounded/Rounded.java @@ -4,6 +4,7 @@ import com.lumiscosity.rounded.compat.*; import com.lumiscosity.rounded.misc.RegisterSounds; import com.lumiscosity.rounded.misc.RegisterTrades; +import com.lumiscosity.rounded.worldgen.RegisterFeatures; import net.fabricmc.api.ModInitializer; import net.fabricmc.loader.api.FabricLoader; @@ -16,9 +17,11 @@ public class Rounded implements ModInitializer { @Override public void onInitialize() { + RegisterFeatures.initFeatures(); RegisterBlocks.initBlocks(); RegisterSounds.initSounds(); RegisterTrades.initTrades(); + RegisterMisc.initMisc(); if (FabricLoader.getInstance().isModLoaded("extravaganza")) { ExtravaganzaCompat.register(); diff --git a/src/main/java/com/lumiscosity/rounded/blocks/RegisterBlocks.java b/src/main/java/com/lumiscosity/rounded/blocks/RegisterBlocks.java index a7504ee..d36e0c1 100644 --- a/src/main/java/com/lumiscosity/rounded/blocks/RegisterBlocks.java +++ b/src/main/java/com/lumiscosity/rounded/blocks/RegisterBlocks.java @@ -1,9 +1,7 @@ package com.lumiscosity.rounded.blocks; -import com.lumiscosity.rounded.worldgen.HugeLustershroomFeature; -import net.fabricmc.fabric.api.biome.v1.BiomeModifications; -import net.fabricmc.fabric.api.biome.v1.BiomeSelectors; import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; +import net.fabricmc.fabric.api.registry.CompostingChanceRegistry; import net.fabricmc.fabric.api.registry.LandPathNodeTypesRegistry; import net.minecraft.block.*; import net.minecraft.block.enums.NoteBlockInstrument; @@ -12,21 +10,18 @@ import net.minecraft.item.BlockItem; import net.minecraft.item.Item; import net.minecraft.item.ItemGroups; -import net.minecraft.item.Items; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; import net.minecraft.registry.RegistryKey; import net.minecraft.registry.RegistryKeys; -import net.minecraft.registry.tag.TagKey; import net.minecraft.sound.BlockSoundGroup; import net.minecraft.util.Identifier; -import net.minecraft.world.gen.GenerationStep; -import net.minecraft.world.gen.feature.*; import static com.lumiscosity.rounded.Rounded.MOD_ID; public class RegisterBlocks { + // Vanilla treated planks public static final Block TREATED_OAK_PLANKS = new TreatedPlank( AbstractBlock.Settings.create().mapColor(MapColor.OAK_TAN).instrument(NoteBlockInstrument.BASS).strength(2.0F, 3.0F).sounds(BlockSoundGroup.WOOD).burnable() ); @@ -98,13 +93,7 @@ public class RegisterBlocks { public static final Item TREATED_CRIMSON_PLANKS_ITEM = new BlockItem(TREATED_CRIMSON_PLANKS, new Item.Settings()); public static final Item TREATED_WARPED_PLANKS_ITEM = new BlockItem(TREATED_WARPED_PLANKS, new Item.Settings()); - - - // no time for good coding practices! get this thing over here - public static final Feature HUGE_LUSTERSHROOM = register_feature( - "huge_lustershroom", new HugeLustershroomFeature(HugeMushroomFeatureConfig.CODEC) - ); - + // Lustershroom and related blocks public static final Block LUSTERSHROOM_PLANT = new LustershroomPlant( RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, Identifier.of(MOD_ID, "huge_lustershroom")), AbstractBlock.Settings.create() @@ -130,10 +119,61 @@ public class RegisterBlocks { ); public static final BlockItem LUSTER_CLUSTER_ITEM = new BlockItem(LUSTER_CLUSTER, new Item.Settings()); + // Trough public static final Block TROUGH = new TroughBlock( AbstractBlock.Settings.create().mapColor(MapColor.OAK_TAN).instrument(NoteBlockInstrument.BASS).strength(0.6F).sounds(BlockSoundGroup.WOOD).burnable().ticksRandomly() ); - public static final Item TROUGH_ITEM = new BlockItem(TROUGH, new Item.Settings()); + public static final BlockItem TROUGH_ITEM = new BlockItem(TROUGH, new Item.Settings()); + + // Smooth Prismarine + public static final Block SMOOTH_PRISMARINE = new Block( + AbstractBlock.Settings.create().mapColor(MapColor.DIAMOND_BLUE).instrument(NoteBlockInstrument.BASEDRUM).requiresTool().strength(1.5F, 6.0F) + ); + public static final Block SMOOTH_PRISMARINE_SLAB = new SlabBlock( + AbstractBlock.Settings.create().mapColor(MapColor.DIAMOND_BLUE).instrument(NoteBlockInstrument.BASEDRUM).requiresTool().strength(1.5F, 6.0F) + ); + public static final BlockItem SMOOTH_PRISMARINE_ITEM= new BlockItem(SMOOTH_PRISMARINE, new Item.Settings()); + public static final BlockItem SMOOTH_PRISMARINE_SLAB_ITEM= new BlockItem(SMOOTH_PRISMARINE_SLAB, new Item.Settings()); + + // Chiseled Prismarine Bricks + public static final Block CHISELED_PRISMARINE_BRICKS = new Block( + AbstractBlock.Settings.create().mapColor(MapColor.DIAMOND_BLUE).instrument(NoteBlockInstrument.BASEDRUM).requiresTool().strength(1.5F, 6.0F) + ); + public static final BlockItem CHISELED_PRISMARINE_BRICKS_ITEM= new BlockItem(CHISELED_PRISMARINE_BRICKS, new Item.Settings()); + + // Prismarine Lantern + public static final Block PRISMARINE_LANTERN = new LanternBlock( + AbstractBlock.Settings.create() + .mapColor(MapColor.IRON_GRAY) + .solid() + .requiresTool() + .strength(3.5F) + .sounds(BlockSoundGroup.LANTERN) + .luminance(state -> 15) + .nonOpaque() + .pistonBehavior(PistonBehavior.DESTROY) + ); + public static final BlockItem PRISMARINE_LANTERN_ITEM = new BlockItem(PRISMARINE_LANTERN, new Item.Settings()); + + // Bladderwrack and related blocks + public static final Block DEAD_BLADDERWRACK = new DeadCoralFanBlock( + AbstractBlock.Settings.create().mapColor(MapColor.TERRACOTTA_BROWN).solid().instrument(NoteBlockInstrument.BASEDRUM).requiresTool().noCollision().breakInstantly() + ); + public static final Block BLADDERWRACK = new CoralFanBlock( + DEAD_BLADDERWRACK, + AbstractBlock.Settings.create() + .mapColor(MapColor.DIRT_BROWN) + .noCollision() + .breakInstantly() + .sounds(BlockSoundGroup.WET_GRASS) + .pistonBehavior(PistonBehavior.DESTROY) + ); + public static final Block BLADDERWRACK_BLOCK = new Block(AbstractBlock.Settings.create().mapColor(MapColor.GREEN).strength(0.5F, 2.5F).sounds(BlockSoundGroup.GRASS)); + public static final BlockItem DEAD_BLADDERWRACK_ITEM = new BlockItem(DEAD_BLADDERWRACK, new Item.Settings()); + public static final BlockItem BLADDERWRACK_ITEM = new BlockItem(BLADDERWRACK, new Item.Settings()); + public static final BlockItem BLADDERWRACK_BLOCK_ITEM = new BlockItem(BLADDERWRACK_BLOCK, new Item.Settings()); + + public static void initBlocks() { register_treated_plank("treated_oak_planks", TREATED_OAK_PLANKS, TREATED_OAK_PLANKS_ITEM, "minecraft", "oak"); @@ -166,16 +206,38 @@ public static void initBlocks() { content.addAfter(Registries.BLOCK.get(Identifier.of("minecraft", "composter")), TROUGH_ITEM); }); - BiomeModifications.addFeature( - BiomeSelectors.tag(TagKey.of(RegistryKeys.BIOME, Identifier.of(MOD_ID, "has_lustershrooms"))), - GenerationStep.Feature.VEGETAL_DECORATION, - RegistryKey.of(RegistryKeys.PLACED_FEATURE, Identifier.of(MOD_ID, "lustershroom")) - ); - BiomeModifications.addFeature( - BiomeSelectors.tag(TagKey.of(RegistryKeys.BIOME, Identifier.of(MOD_ID, "has_more_lustershrooms"))), - GenerationStep.Feature.VEGETAL_DECORATION, - RegistryKey.of(RegistryKeys.PLACED_FEATURE, Identifier.of(MOD_ID, "lustershroom_extra")) - ); + register_block("smooth_prismarine", SMOOTH_PRISMARINE, SMOOTH_PRISMARINE_ITEM); + register_block("smooth_prismarine_slab", SMOOTH_PRISMARINE_SLAB, SMOOTH_PRISMARINE_SLAB_ITEM); + ItemGroupEvents.modifyEntriesEvent(ItemGroups.BUILDING_BLOCKS).register(content -> { + content.addAfter(Registries.BLOCK.get(Identifier.of("minecraft", "prismarine_slab")), SMOOTH_PRISMARINE_ITEM); + }); + ItemGroupEvents.modifyEntriesEvent(ItemGroups.BUILDING_BLOCKS).register(content -> { + content.addAfter(Registries.BLOCK.get(Identifier.of(MOD_ID, "smooth_prismarine")), SMOOTH_PRISMARINE_SLAB_ITEM); + }); + + register_block("chiseled_prismarine_bricks", CHISELED_PRISMARINE_BRICKS, CHISELED_PRISMARINE_BRICKS_ITEM); + ItemGroupEvents.modifyEntriesEvent(ItemGroups.BUILDING_BLOCKS).register(content -> { + content.addAfter(Registries.BLOCK.get(Identifier.of("minecraft", "prismarine_brick_slab")), CHISELED_PRISMARINE_BRICKS_ITEM); + }); + + register_block("prismarine_lantern", PRISMARINE_LANTERN, PRISMARINE_LANTERN_ITEM); + ItemGroupEvents.modifyEntriesEvent(ItemGroups.FUNCTIONAL).register(content -> { + content.addAfter(Registries.BLOCK.get(Identifier.of("minecraft", "soul_lantern")), PRISMARINE_LANTERN_ITEM); + }); + + register_block("dead_bladderwrack", DEAD_BLADDERWRACK, DEAD_BLADDERWRACK_ITEM); + register_block("bladderwrack", BLADDERWRACK, BLADDERWRACK_ITEM); + register_block("bladderwrack_block", BLADDERWRACK_BLOCK, BLADDERWRACK_BLOCK_ITEM); + ItemGroupEvents.modifyEntriesEvent(ItemGroups.NATURAL).register(content -> { + content.addAfter(Registries.BLOCK.get(Identifier.of("minecraft", "dead_horn_coral_fan")), DEAD_BLADDERWRACK_ITEM); + }); + ItemGroupEvents.modifyEntriesEvent(ItemGroups.NATURAL).register(content -> { + content.addAfter(Registries.BLOCK.get(Identifier.of("minecraft", "horn_coral_fan")), BLADDERWRACK_ITEM); + }); + ItemGroupEvents.modifyEntriesEvent(ItemGroups.NATURAL).register(content -> { + content.addAfter(Registries.BLOCK.get(Identifier.of("minecraft", "dried_kelp_block")), BLADDERWRACK_BLOCK_ITEM); + }); + CompostingChanceRegistry.INSTANCE.add(BLADDERWRACK_ITEM, 0.3f); } public static void register_treated_plank(String name, Block block, Item item, String source_mod, String plank_type) { @@ -190,8 +252,4 @@ private static void register_block(String name, Block block, Item item) { Registry.register(Registries.BLOCK, Identifier.of(MOD_ID, name), block); Registry.register(Registries.ITEM, Identifier.of(MOD_ID, name), item); } - - private static > F register_feature(String name, F feature) { - return Registry.register(Registries.FEATURE, Identifier.of(MOD_ID, name), feature); - } } \ No newline at end of file diff --git a/src/main/java/com/lumiscosity/rounded/misc/RegisterTrades.java b/src/main/java/com/lumiscosity/rounded/misc/RegisterTrades.java index 55613fa..3e9054e 100644 --- a/src/main/java/com/lumiscosity/rounded/misc/RegisterTrades.java +++ b/src/main/java/com/lumiscosity/rounded/misc/RegisterTrades.java @@ -9,6 +9,7 @@ public static void initTrades() { TradeOfferHelper.registerWanderingTraderOffers(1, factories -> { new TradeOffers.SellItemFactory(RegisterBlocks.LUSTERSHROON_PLANT_ITEM, 1, 1, 12, 1); + new TradeOffers.SellItemFactory(RegisterBlocks.BLADDERWRACK_ITEM, 1, 6, 12, 1); }); } } diff --git a/src/main/java/com/lumiscosity/rounded/worldgen/RegisterFeatures.java b/src/main/java/com/lumiscosity/rounded/worldgen/RegisterFeatures.java new file mode 100644 index 0000000..abe3036 --- /dev/null +++ b/src/main/java/com/lumiscosity/rounded/worldgen/RegisterFeatures.java @@ -0,0 +1,46 @@ +package com.lumiscosity.rounded.worldgen; + +import net.fabricmc.fabric.api.biome.v1.BiomeModifications; +import net.fabricmc.fabric.api.biome.v1.BiomeSelectors; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.tag.TagKey; +import net.minecraft.util.Identifier; +import net.minecraft.world.gen.GenerationStep; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.FeatureConfig; +import net.minecraft.world.gen.feature.HugeMushroomFeatureConfig; + +import static com.lumiscosity.rounded.Rounded.MOD_ID; + +public class RegisterFeatures { + public static void initFeatures() { + // Lustershroom patch and Huge Lustershroom + register_feature("huge_lustershroom", new HugeLustershroomFeature(HugeMushroomFeatureConfig.CODEC)); + BiomeModifications.addFeature( + BiomeSelectors.tag(TagKey.of(RegistryKeys.BIOME, Identifier.of(MOD_ID, "has_lustershrooms"))), + GenerationStep.Feature.VEGETAL_DECORATION, + RegistryKey.of(RegistryKeys.PLACED_FEATURE, Identifier.of(MOD_ID, "lustershroom")) + ); + BiomeModifications.addFeature( + BiomeSelectors.tag(TagKey.of(RegistryKeys.BIOME, Identifier.of(MOD_ID, "has_more_lustershrooms"))), + GenerationStep.Feature.VEGETAL_DECORATION, + RegistryKey.of(RegistryKeys.PLACED_FEATURE, Identifier.of(MOD_ID, "lustershroom_extra")) + ); + + // Bladderwrack + BiomeModifications.addFeature( + BiomeSelectors.tag(TagKey.of(RegistryKeys.BIOME, Identifier.of(MOD_ID, "has_bladderwrack"))), + GenerationStep.Feature.VEGETAL_DECORATION, + RegistryKey.of(RegistryKeys.PLACED_FEATURE, Identifier.of(MOD_ID, "bladderwrack")) + ); + + // Ocean floor rocks + } + + private static > F register_feature(String name, F feature) { + return Registry.register(Registries.FEATURE, Identifier.of(MOD_ID, name), feature); + } +} diff --git a/src/main/resources/data/rounded/tags/worldgen/biome/has_andesite_sea_rocks.json b/src/main/resources/data/rounded/tags/worldgen/biome/has_andesite_sea_rocks.json new file mode 100644 index 0000000..7c7a5f5 --- /dev/null +++ b/src/main/resources/data/rounded/tags/worldgen/biome/has_andesite_sea_rocks.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "minecraft:ocean", + "minecraft:deep_ocean" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/rounded/tags/worldgen/biome/has_bladderwrack.json b/src/main/resources/data/rounded/tags/worldgen/biome/has_bladderwrack.json new file mode 100644 index 0000000..cb9e333 --- /dev/null +++ b/src/main/resources/data/rounded/tags/worldgen/biome/has_bladderwrack.json @@ -0,0 +1,8 @@ +{ + "replace": false, + "values": [ + "minecraft:cold_ocean", + "minecraft:ocean", + "minecraft:lukewarm_ocean" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/rounded/tags/worldgen/biome/has_diorite_sea_rocks.json b/src/main/resources/data/rounded/tags/worldgen/biome/has_diorite_sea_rocks.json new file mode 100644 index 0000000..c020a5d --- /dev/null +++ b/src/main/resources/data/rounded/tags/worldgen/biome/has_diorite_sea_rocks.json @@ -0,0 +1,8 @@ +{ + "replace": false, + "values": [ + "minecraft:lukewarm_ocean", + "minecraft:deep_lukewarm_ocean", + "minecraft:warm_ocean" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/rounded/tags/worldgen/biome/has_smooth_basalt_sea_rocks.json b/src/main/resources/data/rounded/tags/worldgen/biome/has_smooth_basalt_sea_rocks.json new file mode 100644 index 0000000..2871d9e --- /dev/null +++ b/src/main/resources/data/rounded/tags/worldgen/biome/has_smooth_basalt_sea_rocks.json @@ -0,0 +1,9 @@ +{ + "replace": false, + "values": [ + "minecraft:frozen_ocean", + "minecraft:deep_frozen_ocean", + "minecraft:cold_ocean", + "minecraft:deep_cold_ocean" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/rounded/worldgen/configured_feature/patch_bladderwrack.json b/src/main/resources/data/rounded/worldgen/configured_feature/patch_bladderwrack.json new file mode 100644 index 0000000..ade40ae --- /dev/null +++ b/src/main/resources/data/rounded/worldgen/configured_feature/patch_bladderwrack.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:random_patch", + "config": { + "feature": { + "feature": { + "type": "minecraft:simple_block", + "config": { + "to_place": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "rounded:bladderwrack" + } + } + } + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:water" + } + } + ] + }, + "tries": 96, + "xz_spread": 7, + "y_spread": 3 + } +} \ No newline at end of file diff --git a/src/main/resources/data/rounded/worldgen/placed_feature/bladderwrack.json b/src/main/resources/data/rounded/worldgen/placed_feature/bladderwrack.json new file mode 100644 index 0000000..baff878 --- /dev/null +++ b/src/main/resources/data/rounded/worldgen/placed_feature/bladderwrack.json @@ -0,0 +1,19 @@ +{ + "feature": "rounded:patch_bladderwrack", + "placement": [ + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:heightmap", + "heightmap": "OCEAN_FLOOR_WG" + }, + { + "type": "surface_water_depth_filter", + "max_water_depth": 9 + }, + { + "type": "minecraft:biome" + } + ] +} \ No newline at end of file