diff --git a/README.md b/README.md index 95c6688..f62afdf 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ While Templates itself adds a handful of common shapes, it's also not too hard f Todo move this into the main readme section +COOL RIVULET is by mev , this is the most important block in the mod & perhaps the most important block in any mod ever since `incorporeal:clearly` + ## Todo * More templates !! diff --git a/build.gradle b/build.gradle index 965758a..4b5ef1b 100755 --- a/build.gradle +++ b/build.gradle @@ -30,7 +30,7 @@ if(rootProject.file("private.gradle").exists()) { //Publishing details archivesBaseName = "templates" group = "io.github.cottonmc" -version = "2.0.2+1.20.1" +version = "2.0.3+1.20.1" repositories { mavenCentral() diff --git a/src/main/java/io/github/cottonmc/templates/Templates.java b/src/main/java/io/github/cottonmc/templates/Templates.java index 1a220b3..d615d48 100644 --- a/src/main/java/io/github/cottonmc/templates/Templates.java +++ b/src/main/java/io/github/cottonmc/templates/Templates.java @@ -7,6 +7,7 @@ import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder; import net.minecraft.block.*; import net.minecraft.block.entity.BlockEntityType; +import net.minecraft.client.item.TooltipContext; import net.minecraft.item.BlockItem; import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; @@ -14,10 +15,14 @@ import net.minecraft.item.ItemStack; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; import net.minecraft.text.Text; +import net.minecraft.util.Formatting; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; +import net.minecraft.world.BlockView; import net.minecraft.world.World; +import org.jetbrains.annotations.Nullable; +import java.util.List; import java.util.function.BiConsumer; public class Templates implements ModInitializer { @@ -49,6 +54,13 @@ public class Templates implements ModInitializer { //corner slopes //quarter slabs???? + public static final Block COOL_RIVULET = Registry.register(Registries.BLOCK, id("cool_rivulet"), new GlazedTerracottaBlock(AbstractBlock.Settings.create().hardness(0.2f)) { + @Override + public void appendTooltip(ItemStack stack, @Nullable BlockView world, List tooltip, TooltipContext eggbals) { + tooltip.add(Text.translatable("block.templates.cool_rivulet").formatted(Formatting.GRAY)); + } + }); //Very good + //for addon devs: it's fine to make your own block entity type instead of gluing additional blocks to this one public static final BlockEntityType TEMPLATE_BLOCK_ENTITY = Registry.register( Registries.BLOCK_ENTITY_TYPE, id("slope"), @@ -106,6 +118,8 @@ public class Templates implements ModInitializer { Registry.register(Registries.ITEM, id("trapdoor") , new BlockItem(TRAPDOOR, new Item.Settings())); Registry.register(Registries.ITEM, id("wall") , new BlockItem(WALL, new Item.Settings())); Registry.register(Registries.ITEM, id("slope") , new BlockItem(SLOPE, new Item.Settings())); + + Registry.register(Registries.ITEM, id("cool_rivulet") , new BlockItem(COOL_RIVULET, new Item.Settings())); //Very good } public static Identifier id(String path) { @@ -140,5 +154,7 @@ public class Templates implements ModInitializer { e.add(CANDLE); e.add(SLOPE); + + e.add(COOL_RIVULET); //Very good } } diff --git a/src/main/resources/assets/templates/blockstates/cool_rivulet.json b/src/main/resources/assets/templates/blockstates/cool_rivulet.json new file mode 100644 index 0000000..9081177 --- /dev/null +++ b/src/main/resources/assets/templates/blockstates/cool_rivulet.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=east": { + "model": "templates:block/cool_rivulet", + "y": 270 + }, + "facing=north": { + "model": "templates:block/cool_rivulet", + "y": 180 + }, + "facing=south": { + "model": "templates:block/cool_rivulet" + }, + "facing=west": { + "model": "templates:block/cool_rivulet", + "y": 90 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/templates/lang/en_us.json b/src/main/resources/assets/templates/lang/en_us.json index b9606c7..cd7f119 100644 --- a/src/main/resources/assets/templates/lang/en_us.json +++ b/src/main/resources/assets/templates/lang/en_us.json @@ -18,5 +18,7 @@ "block.templates.slab": "Slab Template", "block.templates.stairs": "Stairs Template", "block.templates.trapdoor": "Trapdoor Template", - "block.templates.wall": "Wall Template" + "block.templates.wall": "Wall Template", + + "block.templates.cool_rivulet": "cool rivulet" } \ No newline at end of file diff --git a/src/main/resources/assets/templates/models/block/cool_rivulet.json b/src/main/resources/assets/templates/models/block/cool_rivulet.json new file mode 100644 index 0000000..774c143 --- /dev/null +++ b/src/main/resources/assets/templates/models/block/cool_rivulet.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "templates:block/cool_rivulet" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/templates/models/item/cool_rivulet.json b/src/main/resources/assets/templates/models/item/cool_rivulet.json new file mode 100644 index 0000000..a6ef2fe --- /dev/null +++ b/src/main/resources/assets/templates/models/item/cool_rivulet.json @@ -0,0 +1,3 @@ +{ + "parent": "templates:block/cool_rivulet" +} \ No newline at end of file diff --git a/src/main/resources/assets/templates/textures/block/cool_rivulet.png b/src/main/resources/assets/templates/textures/block/cool_rivulet.png new file mode 100644 index 0000000..d29410d Binary files /dev/null and b/src/main/resources/assets/templates/textures/block/cool_rivulet.png differ diff --git a/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json index f8fedd4..872a5d8 100644 --- a/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json +++ b/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json @@ -2,6 +2,7 @@ "replace": false, "values": [ "templates:iron_door", - "templates:iron_trapdoor" + "templates:iron_trapdoor", + "templates:cool_rivulet" ] } \ No newline at end of file diff --git a/src/main/resources/data/templates/loot_tables/blocks/cool_rivulet.json b/src/main/resources/data/templates/loot_tables/blocks/cool_rivulet.json new file mode 100644 index 0000000..19aee8a --- /dev/null +++ b/src/main/resources/data/templates/loot_tables/blocks/cool_rivulet.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "templates:cool_rivulet" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index a82e878..b5d3c20 100755 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -7,7 +7,8 @@ "authors": [ "quaternary", "LemmaEOF", - "Grondag" + "Grondag", + "mevvern" ], "contact": { "homepage": "https://highlysuspect.agency/",