Skip to content

Commit ea2ce6b

Browse files
author
flatkat
committed
-Partially added the rose (WIP)
1 parent 1ee31c5 commit ea2ce6b

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
package net.flatkat.ancient_forgotten;
22

33
import net.fabricmc.api.ClientModInitializer;
4+
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
5+
import net.flatkat.ancient_forgotten.block.ModBlocks;
6+
import net.minecraft.client.render.RenderLayer;
47

58
public class AncientAndForgottenClient implements ClientModInitializer {
69

710
@Override
811
public void onInitializeClient() {
12+
BlockRenderLayerMap.INSTANCE.putBlock(ModBlocks.ROSE, RenderLayer.getCutout());
13+
BlockRenderLayerMap.INSTANCE.putBlock(ModBlocks.POTTED_ROSE, RenderLayer.getCutout());
914

1015
}
1116
}

src/main/java/net/flatkat/ancient_forgotten/block/ModBlocks.java

+8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
import net.flatkat.ancient_forgotten.AncientAndForgotten;
66
import net.minecraft.block.Block;
77
import net.minecraft.block.Blocks;
8+
import net.minecraft.block.FlowerBlock;
9+
import net.minecraft.block.FlowerPotBlock;
10+
import net.minecraft.entity.effect.StatusEffects;
811
import net.minecraft.item.BlockItem;
912
import net.minecraft.item.Item;
1013
import net.minecraft.registry.Registries;
@@ -15,6 +18,11 @@ public class ModBlocks {
1518
public static final Block UNKNOWN_BLOCK = registerBlock("unknown_block",
1619
new Block(FabricBlockSettings.copyOf(Blocks.DIRT)));
1720

21+
public static final Block ROSE = registerBlock("rose",
22+
new FlowerBlock(StatusEffects.SPEED, 5, FabricBlockSettings.copyOf(Blocks.POPPY).nonOpaque().noCollision()));
23+
public static final Block POTTED_ROSE = Registry.register(Registries.BLOCK, new Identifier(AncientAndForgotten.MOD_ID, "potted_rose"),
24+
new FlowerPotBlock(ROSE, FabricBlockSettings.copyOf(Blocks.POTTED_POPPY).nonOpaque()));
25+
1826
private static Block registerBlock(String name, Block block){
1927
registerBlockItem(name, block);
2028
return Registry.register(Registries.BLOCK, new Identifier(AncientAndForgotten.MOD_ID, name), block);

src/main/java/net/flatkat/ancient_forgotten/item/ModItemGroups.java

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public class ModItemGroups {
1717
.icon(() -> new ItemStack(ModItems.RUBY)).entries((displayContext, entries) -> {
1818
entries.add(ModItems.RUBY);
1919
entries.add(ModBlocks.UNKNOWN_BLOCK);
20+
entries.add(ModBlocks.ROSE);
2021
}).build());
2122

2223

src/main/resources/assets/ancient_forgotten/lang/en_us.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
"item.ancient_forgotten.ruby": "Ruby",
44
"block.ancient_forgotten.unknown_block": "Unknown",
5-
"itemgroup.ancient_forgotten": "Ancient and Forgotten"
5+
"itemgroup.ancient_forgotten": "Ancient and Forgotten",
66

7+
"block.ancient_forgotten.rose": "Rose"
78

89

910
}
Loading

0 commit comments

Comments
 (0)