diff --git a/MC1.20.6/src/main/java/observer/nelle/roses_mod/RosesModClient.java b/MC1.20.6/src/main/java/observer/nelle/roses_mod/RosesModClient.java new file mode 100644 index 0000000..7288b0a --- /dev/null +++ b/MC1.20.6/src/main/java/observer/nelle/roses_mod/RosesModClient.java @@ -0,0 +1,16 @@ +package observer.nelle.roses_mod; + +import net.fabricmc.api.ClientModInitializer; +import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; +import net.minecraft.client.render.RenderLayer; + +public class RosesModClient implements ClientModInitializer { + @Override + public void onInitializeClient() { + BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), RosesBlocks.INSTANCE.getCyanRoseBush()); + BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), RosesBlocks.INSTANCE.getCyanRoseFlower()); + BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), RosesBlocks.INSTANCE.getPottedCyan()); + BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), RosesBlocks.INSTANCE.getPottedRose()); + BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), RosesBlocks.INSTANCE.getRoseFlower()); + } +} diff --git a/MC1.20.6/src/main/kotlin/observer/nelle/roses_mod/RosesBlocks.kt b/MC1.20.6/src/main/kotlin/observer/nelle/roses_mod/RosesBlocks.kt index 1960bbb..d8f8422 100644 --- a/MC1.20.6/src/main/kotlin/observer/nelle/roses_mod/RosesBlocks.kt +++ b/MC1.20.6/src/main/kotlin/observer/nelle/roses_mod/RosesBlocks.kt @@ -7,10 +7,7 @@ package observer.nelle.roses_mod -import net.minecraft.block.AbstractBlock -import net.minecraft.block.Block -import net.minecraft.block.Blocks -import net.minecraft.block.FlowerBlock +import net.minecraft.block.* import net.minecraft.entity.effect.StatusEffects import net.minecraft.item.BlockItem import net.minecraft.item.Item @@ -18,7 +15,7 @@ import net.minecraft.registry.Registries import net.minecraft.registry.Registry import net.minecraft.util.Identifier -class RosesBlocks { +object RosesBlocks { val roseFlower: Block? = register( FlowerBlock( @@ -29,6 +26,42 @@ class RosesBlocks { "rose_flower", true, ) + val pottedRose: Block? = + register( + FlowerPotBlock( + roseFlower, + AbstractBlock.Settings.copy(Blocks.POTTED_POPPY), + ), + "potted_rose", + true, + ) + val cyanRoseFlower: Block? = + register( + FlowerBlock( + StatusEffects.INSTANT_HEALTH, + 6F, + AbstractBlock.Settings.copy(Blocks.POPPY), + ), + "cyan_rose", + true, + ) + val pottedCyan: Block? = + register( + FlowerPotBlock( + cyanRoseFlower, + AbstractBlock.Settings.copy(Blocks.POTTED_POPPY), + ), + "potted_cyan", + true, + ) + val cyanRoseBush: Block? = + register( + TallPlantBlock( + AbstractBlock.Settings.copy(Blocks.LARGE_FERN), + ), + "cyan_rose_bush", + true, + ) fun register( block: Block?, diff --git a/MC1.20.6/src/main/kotlin/observer/nelle/roses_mod/RosesMod.kt b/MC1.20.6/src/main/kotlin/observer/nelle/roses_mod/RosesMod.kt index 97d2584..29520c3 100644 --- a/MC1.20.6/src/main/kotlin/observer/nelle/roses_mod/RosesMod.kt +++ b/MC1.20.6/src/main/kotlin/observer/nelle/roses_mod/RosesMod.kt @@ -25,6 +25,6 @@ class roses_mod : ModInitializer { * - creative tabs * */ - RosesBlocks() + RosesBlocks } } diff --git a/MC1.20.6/src/main/kotlin/observer/nelle/roses_mod/client/RosesModClient.kt b/MC1.20.6/src/main/kotlin/observer/nelle/roses_mod/client/RosesModClient.kt deleted file mode 100644 index b1f5a13..0000000 --- a/MC1.20.6/src/main/kotlin/observer/nelle/roses_mod/client/RosesModClient.kt +++ /dev/null @@ -1,14 +0,0 @@ -@file:Suppress("ktlint:standard:filename", "ktlint:standard:package-name", "ktlint:standard:class-naming") - -package observer.nelle.roses_mod.client - -import net.fabricmc.api.ClientModInitializer -import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap -import net.minecraft.client.render.RenderLayer -import observer.nelle.roses_mod.RosesBlocks - -class RosesModClient : ClientModInitializer { - override fun onInitializeClient() { - BlockRenderLayerMap.INSTANCE.putBlock(RosesBlocks().roseFlower, RenderLayer.getCutout()) - } -} diff --git a/MC1.20.6/src/main/resources/fabric.mod.json b/MC1.20.6/src/main/resources/fabric.mod.json index 4fb9c11..994dcdb 100644 --- a/MC1.20.6/src/main/resources/fabric.mod.json +++ b/MC1.20.6/src/main/resources/fabric.mod.json @@ -20,7 +20,7 @@ "environment": "*", "entrypoints": { "client": [ - "observer.nelle.roses_mod.client.RosesModClient" + "observer.nelle.roses_mod.RosesModClient" ], "main": ["observer.nelle.roses_mod.roses_mod"] }, diff --git a/README.md b/README.md index 195d77c..37c8109 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,4 @@ Features: - 2x2 Roses in a crafting table will output a rose bush - Cyan Flowers - Bees can pollinate all flowers +