Cyan Flowers & Creative Tab

This commit is contained in:
nelle 2023-01-07 05:59:58 -07:00
parent 9d5def8db9
commit ff97cd3776
11 changed files with 62 additions and 20 deletions

View file

@ -3,7 +3,7 @@ org.gradle.jvmargs = -Xmx1G
org.gradle.parallel = true
# Mod Properties
version = 1.0.1
version = 2.0.0
maven_group = xyz.limepot
archives_base_name = roses_mod

View file

@ -1,11 +1,13 @@
package xyz.limepot.roses_mod;
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.fabricmc.fabric.api.loot.v2.LootTableEvents;
import net.minecraft.block.*;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemGroups;
import net.minecraft.item.Items;
import net.minecraft.loot.LootPool;
import net.minecraft.loot.entry.ItemEntry;
@ -23,8 +25,13 @@ public class RosesMod implements ModInitializer {
public static final String MOD_ID = "roses_mod";
public static final Logger LOGGER = LoggerFactory.getLogger("Roses Mod");
//ROSE
public static final Block ROSE_FLOWER = new FlowerBlock(StatusEffects.HASTE, 8, QuiltBlockSettings.copyOf(Blocks.POPPY).nonOpaque());
public static final Block POTTED_ROSE = new FlowerPotBlock(ROSE_FLOWER, QuiltBlockSettings.copyOf(Blocks.POTTED_POPPY));
//Cyan Rose
public static final Block CYAN_ROSE = new FlowerBlock(StatusEffects.NAUSEA, 8, QuiltBlockSettings.copyOf(Blocks.POPPY).nonOpaque());
public static final Block POTTED_CYAN = new FlowerPotBlock(CYAN_ROSE, QuiltBlockSettings.copyOf(Blocks.POTTED_POPPY));
@Override
public void onInitialize(ModContainer mod) {
@ -33,10 +40,24 @@ public class RosesMod implements ModInitializer {
//TODO: ADD ITEMS TO CREATIVE TABS
//ROSE FLOWER
Registry.register(Registries.BLOCK, new Identifier(MOD_ID, "rose_flower"), ROSE_FLOWER);
Registry.register(Registries.ITEM, new Identifier(MOD_ID, "rose_flower"), new BlockItem(ROSE_FLOWER, new QuiltItemSettings()));
//POTTED ROSE FLOWER
Registry.register(Registries.BLOCK, new Identifier(MOD_ID, "potted_rose"), POTTED_ROSE);
Registry.register(Registries.BLOCK, new Identifier(MOD_ID, "rose_flower"), ROSE_FLOWER);
Registry.register(Registries.ITEM, new Identifier(MOD_ID, "rose_flower"), new BlockItem(ROSE_FLOWER, new QuiltItemSettings()));
//POTTED ROSE FLOWER
Registry.register(Registries.BLOCK, new Identifier(MOD_ID, "potted_rose"), POTTED_ROSE);
//CYAN ROSE
Registry.register(Registries.BLOCK, new Identifier(MOD_ID, "cyan_rose"), CYAN_ROSE);
Registry.register(Registries.ITEM, new Identifier(MOD_ID, "cyan_rose"), new BlockItem(CYAN_ROSE, new QuiltItemSettings()));
//POTTED CYAN ROSE
Registry.register(Registries.BLOCK, new Identifier(MOD_ID, "potted_cyan"), POTTED_CYAN);
//CREATIVE TABS
ItemGroupEvents.modifyEntriesEvent(ItemGroups.NATURAL).register(content -> {
content.addAfter(Items.POPPY, ROSE_FLOWER);
});
ItemGroupEvents.modifyEntriesEvent(ItemGroups.NATURAL).register(content -> {
content.addAfter(Items.BLUE_ORCHID, CYAN_ROSE);
});
//LOOT TABLES

View file

@ -8,7 +8,12 @@ import org.quiltmc.qsl.base.api.entrypoint.client.ClientModInitializer;
public class RosesModClient implements ClientModInitializer {
public void onInitializeClient(ModContainer mod) {
//ROSE FLOWER
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), RosesMod.POTTED_ROSE);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), RosesMod.ROSE_FLOWER);
//CYAN ROSE
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), RosesMod.POTTED_CYAN);
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), RosesMod.CYAN_ROSE);
}
}

View file

@ -0,0 +1,5 @@
{
"variants": {
"": { "model": "roses_mod:block/cyan_rose"}
}
}

View file

@ -0,0 +1,5 @@
{
"variants": {
"": { "model": "roses_mod:block/potted_cyan"}
}
}

View file

@ -1,4 +1,6 @@
{
"block.roses_mod.rose_flower": "Rose",
"block.roses_mod.potted_rose": "Potted Rose"
"block.roses_mod.potted_rose": "Potted Rose",
"block.roses_mod.cyan_rose": "Cyan Rose",
"block.roses_mod.potted_cyan": "Potted Cyan Rose"
}

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cross",
"textures": {
"cross": "roses_mod:block/cyan_rose"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:block/flower_pot_cross",
"textures": {
"plant": "roses_mod:block/cyan_rose"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "roses_mod:block/cyan_rose"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

View file

@ -1,14 +0,0 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 2,
"entries": [
{
"type": "minecraft:item",
"name": "roses_mod:rose_flower"
}
]
}
]
}