Added Items and Block
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
package com.acethewildfire.acesbs;
|
package com.acethewildfire.acesbs;
|
||||||
|
|
||||||
|
import com.acethewildfire.acesbs.block.ModBlocks;
|
||||||
|
import com.acethewildfire.acesbs.item.ModItemGroups;
|
||||||
|
import com.acethewildfire.acesbs.item.ModItems;
|
||||||
import net.fabricmc.api.ModInitializer;
|
import net.fabricmc.api.ModInitializer;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -19,6 +22,9 @@ public class AcesBravoSierra implements ModInitializer {
|
|||||||
// However, some things (like resources) may still be uninitialized.
|
// However, some things (like resources) may still be uninitialized.
|
||||||
// Proceed with mild caution.
|
// Proceed with mild caution.
|
||||||
|
|
||||||
LOGGER.info("Hello Fabric world!");
|
LOGGER.info("You would not believe the kind of day I am having...");
|
||||||
|
ModItemGroups.registerItemGroups();
|
||||||
|
ModItems.registerModItems();
|
||||||
|
ModBlocks.registerModBlocks();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.acethewildfire.acesbs.block;
|
||||||
|
|
||||||
|
import com.acethewildfire.acesbs.AcesBravoSierra;
|
||||||
|
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
|
||||||
|
import net.minecraft.block.AbstractBlock;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.item.BlockItem;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemGroup;
|
||||||
|
import net.minecraft.item.ItemGroups;
|
||||||
|
import net.minecraft.registry.Registries;
|
||||||
|
import net.minecraft.registry.Registry;
|
||||||
|
import net.minecraft.sound.BlockSoundGroup;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
|
public class ModBlocks {
|
||||||
|
|
||||||
|
public static final Block ENTROPY_BLOCK = registerBlock("entropy_block",
|
||||||
|
new Block(AbstractBlock.Settings.create()
|
||||||
|
.strength(4f)
|
||||||
|
.requiresTool()
|
||||||
|
.sounds(BlockSoundGroup.ANCIENT_DEBRIS)));
|
||||||
|
|
||||||
|
private static Block registerBlock(String name, Block block){
|
||||||
|
registerBlockItem(name, block);
|
||||||
|
return Registry.register(Registries.BLOCK, Identifier.of(AcesBravoSierra.MOD_ID, name), block);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void registerBlockItem(String name, Block block){
|
||||||
|
Registry.register(Registries.ITEM, Identifier.of(AcesBravoSierra.MOD_ID, name),
|
||||||
|
new BlockItem(block, new Item.Settings()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerModBlocks(){
|
||||||
|
AcesBravoSierra.LOGGER.info("Registering Mod Blocks for " + AcesBravoSierra.MOD_ID);
|
||||||
|
|
||||||
|
// ItemGroupEvents.modifyEntriesEvent(ItemGroups.BUILDING_BLOCKS).register(fabricItemGroupEntries -> {
|
||||||
|
// fabricItemGroupEntries.add(ENTROPY_BLOCK);
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.acethewildfire.acesbs.item;
|
||||||
|
|
||||||
|
import com.acethewildfire.acesbs.AcesBravoSierra;
|
||||||
|
import com.acethewildfire.acesbs.block.ModBlocks;
|
||||||
|
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;
|
||||||
|
import net.minecraft.item.ItemGroup;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.registry.Registries;
|
||||||
|
import net.minecraft.registry.Registry;
|
||||||
|
import net.minecraft.text.Text;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
|
public class ModItemGroups {
|
||||||
|
public static final ItemGroup ACES_BS = Registry.register(Registries.ITEM_GROUP,
|
||||||
|
Identifier.of(AcesBravoSierra.MOD_ID, "main"),
|
||||||
|
FabricItemGroup.builder()
|
||||||
|
.icon(() -> new ItemStack(ModItems.ORACLE_LEMON))
|
||||||
|
.displayName(Text.translatable("itemgroup.acesbs.main"))
|
||||||
|
.entries((displayContext, entries) -> {
|
||||||
|
entries.add(ModItems.ORACLE_LEMON);
|
||||||
|
entries.add(ModBlocks.ENTROPY_BLOCK);
|
||||||
|
})
|
||||||
|
.build());
|
||||||
|
|
||||||
|
|
||||||
|
public static void registerItemGroups() {
|
||||||
|
AcesBravoSierra.LOGGER.info("Registering Item Groups for " + AcesBravoSierra.MOD_ID);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.acethewildfire.acesbs.item;
|
||||||
|
|
||||||
|
import com.acethewildfire.acesbs.AcesBravoSierra;
|
||||||
|
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemGroups;
|
||||||
|
import net.minecraft.registry.Registries;
|
||||||
|
import net.minecraft.registry.Registry;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
|
public class ModItems {
|
||||||
|
|
||||||
|
public static final Item ORACLE_LEMON = registerItem("oracle_lemon", new Item(new Item.Settings()));
|
||||||
|
|
||||||
|
private static Item registerItem(String name, Item item){
|
||||||
|
return Registry.register(Registries.ITEM, Identifier.of(AcesBravoSierra.MOD_ID, name), item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerModItems() {
|
||||||
|
AcesBravoSierra.LOGGER.info("Registering Mod Items for " + AcesBravoSierra.MOD_ID);
|
||||||
|
|
||||||
|
// ItemGroupEvents.modifyEntriesEvent(ItemGroups.INGREDIENTS).register(fabricItemGroupEntries -> {
|
||||||
|
// fabricItemGroupEntries.add(ORACLE_LEMON);
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"": {
|
||||||
|
"model": "acesbs:block/entropy_block"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 25 KiB |
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"item.acesbs.oracle_lemon": "Oracle Lemon",
|
||||||
|
"block.acesbs.entropy_block": "Block of Entropy",
|
||||||
|
"itemgroup.acesbs.main": "Ace's BS"
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
{
|
||||||
|
"credit": "Made by AceTheWildfire with Blockbench",
|
||||||
|
"texture_size": [64, 64],
|
||||||
|
"textures": {
|
||||||
|
"1": "acesbs:block/entropy_block"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"from": [0, 0, 0],
|
||||||
|
"to": [16, 16, 16],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0, 8]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [0, 0, 4, 4], "texture": "#1"},
|
||||||
|
"east": {"uv": [0, 4, 4, 8], "texture": "#1"},
|
||||||
|
"south": {"uv": [4, 0, 8, 4], "texture": "#1"},
|
||||||
|
"west": {"uv": [4, 4, 8, 8], "texture": "#1"},
|
||||||
|
"up": {"uv": [4, 12, 0, 8], "texture": "#1"},
|
||||||
|
"down": {"uv": [12, 0, 8, 4], "texture": "#1"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"display": {
|
||||||
|
"thirdperson_righthand": {
|
||||||
|
"rotation": [75, 45, 0],
|
||||||
|
"translation": [0, 2.5, 0],
|
||||||
|
"scale": [0.375, 0.375, 0.375]
|
||||||
|
},
|
||||||
|
"thirdperson_lefthand": {
|
||||||
|
"rotation": [75, 45, 0],
|
||||||
|
"translation": [0, 2.5, 0],
|
||||||
|
"scale": [0.375, 0.375, 0.375]
|
||||||
|
},
|
||||||
|
"firstperson_righthand": {
|
||||||
|
"rotation": [0, 45, 0],
|
||||||
|
"scale": [0.4, 0.4, 0.4]
|
||||||
|
},
|
||||||
|
"firstperson_lefthand": {
|
||||||
|
"rotation": [0, 225, 0],
|
||||||
|
"scale": [0.4, 0.4, 0.4]
|
||||||
|
},
|
||||||
|
"ground": {
|
||||||
|
"translation": [0, 3, 0],
|
||||||
|
"scale": [0.25, 0.25, 0.25]
|
||||||
|
},
|
||||||
|
"gui": {
|
||||||
|
"rotation": [30, 225, 0],
|
||||||
|
"scale": [0.625, 0.625, 0.625]
|
||||||
|
},
|
||||||
|
"head": {
|
||||||
|
"translation": [0, 3.25, -5.5],
|
||||||
|
"scale": [0.25, 0.25, 0.25]
|
||||||
|
},
|
||||||
|
"fixed": {
|
||||||
|
"scale": [0.5, 0.5, 0.5]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"parent": "acesbs:block/entropy_block"
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parent": "minecraft:item/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "acesbs:item/oracle_lemon"
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 8.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.6 KiB |
Reference in New Issue
Block a user