added some stuff
This commit is contained in:
34
src/main/java/com/vaporvee/testmod/ModItems.java
Normal file
34
src/main/java/com/vaporvee/testmod/ModItems.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package com.vaporvee.testmod;
|
||||
|
||||
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;
|
||||
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemGroups;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class ModItems {
|
||||
public static Item register(Item item, String id) {
|
||||
return Registry.register(Registries.ITEM, Identifier.of(TestMod.MOD_ID, id), item);
|
||||
}
|
||||
public static final Item CRAZY_ITEM = register(new Item(new Item.Settings()), "crazy_item");
|
||||
public static final Item ICON = register(new Item(new Item.Settings()), "icon");
|
||||
|
||||
public static final RegistryKey<ItemGroup> CUSTOM_ITEM_GROUP_KEY = RegistryKey.of(Registries.ITEM_GROUP.getKey(), Identifier.of(TestMod.MOD_ID,"test_items"));
|
||||
public static final ItemGroup CUSTOM_ITEM_GROUP = FabricItemGroup.builder()
|
||||
.icon(() -> new ItemStack(ModItems.ICON))
|
||||
.displayName(Text.translatable("itemGroup.testmod"))
|
||||
.build();
|
||||
public static void initialize() {
|
||||
Registry.register(Registries.ITEM_GROUP, CUSTOM_ITEM_GROUP_KEY, CUSTOM_ITEM_GROUP);
|
||||
ItemGroupEvents.modifyEntriesEvent(CUSTOM_ITEM_GROUP_KEY).register(itemGroup -> {
|
||||
itemGroup.add(ModItems.CRAZY_ITEM);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
@@ -15,10 +15,8 @@ public class TestMod implements ModInitializer {
|
||||
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
// This code runs as soon as Minecraft is in a mod-load-ready state.
|
||||
// However, some things (like resources) may still be uninitialized.
|
||||
// Proceed with mild caution.
|
||||
|
||||
LOGGER.info("Hello Fabric world!");
|
||||
LOGGER.info("TestMod initializing...");
|
||||
ModItems.initialize();
|
||||
LOGGER.info("TestMod initialized!");
|
||||
}
|
||||
}
|
4
src/main/resources/assets/testmod/lang/en_us.json
Normal file
4
src/main/resources/assets/testmod/lang/en_us.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"item.testmod.crazy_item" : "CRAZY ITEM WOW!",
|
||||
"itemGroup.testmod": "Test Mod"
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures" : {
|
||||
"layer0": "testmod:item/crazy_item"
|
||||
}
|
||||
}
|
6
src/main/resources/assets/testmod/models/item/icon.json
Normal file
6
src/main/resources/assets/testmod/models/item/icon.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures" : {
|
||||
"layer0": "testmod:item/icon"
|
||||
}
|
||||
}
|
BIN
src/main/resources/assets/testmod/textures/item/crazy_item.png
Normal file
BIN
src/main/resources/assets/testmod/textures/item/crazy_item.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 329 B |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
37
src/main/resources/data/testmod/recipe/crazy_item.json
Normal file
37
src/main/resources/data/testmod/recipe/crazy_item.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:amethyst_shard"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:glowstone_dust"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:amethyst_shard"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:glowstone_dust"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:redstone"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:glowstone_dust"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:amethyst_shard"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:glowstone_dust"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:amethyst_shard"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"id": "testmod:crazy_item",
|
||||
"count": 16
|
||||
},
|
||||
"group": "stuff"
|
||||
}
|
@@ -2,17 +2,17 @@
|
||||
"schemaVersion": 1,
|
||||
"id": "testmod",
|
||||
"version": "${version}",
|
||||
"name": "TestMod",
|
||||
"description": "This is an example description! Tell everyone what your mod is about!",
|
||||
"name": "Test Mod",
|
||||
"description": "My first Mod!",
|
||||
"authors": [
|
||||
"Me!"
|
||||
"vaporvee"
|
||||
],
|
||||
"contact": {
|
||||
"homepage": "https://fabricmc.net/",
|
||||
"sources": "https://github.com/FabricMC/fabric-example-mod"
|
||||
"homepage": "https://vaporvee.com",
|
||||
"sources": "https://github.com/vaporvee/TestMod"
|
||||
},
|
||||
"license": "CC0-1.0",
|
||||
"icon": "assets/testmod/icon.png",
|
||||
"icon": "assets/testmod/textures/item/icon.png",
|
||||
"environment": "*",
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
|
Reference in New Issue
Block a user