Skip to content

Commit

Permalink
Aprendendo a colocar itens no minecraft
Browse files Browse the repository at this point in the history
  • Loading branch information
Jauzimm committed Oct 20, 2024
1 parent 8cd7272 commit f5fbd52
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/john/mod/PrimeiroMod.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package john.mod;

import john.mod.item.ModItems;
import net.fabricmc.api.ModInitializer;

import org.slf4j.Logger;
Expand All @@ -11,6 +12,6 @@ public class PrimeiroMod implements ModInitializer {

@Override
public void onInitialize() {

ModItems.registerModItems();
}
}
27 changes: 27 additions & 0 deletions src/main/java/john/mod/item/ModItems.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package john.mod.item;

import john.mod.PrimeiroMod;
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 PINK_GARNET = registerItem("pink_garnet", new Item(new Item.Settings()));
public static final Item RAW_PINK_GARNET = registerItem("raw_pink_garnet", new Item(new Item.Settings())); //REPLICAR PRA CRIAR NOVOS ITEMS

private static Item registerItem(String name, Item item) {
return Registry.register(Registries.ITEM, Identifier.of(PrimeiroMod.MOD_ID, name), item);
}

public static void registerModItems() {
PrimeiroMod.LOGGER.info("Registering Mod Items for " + PrimeiroMod.MOD_ID);

ItemGroupEvents.modifyEntriesEvent(ItemGroups.INGREDIENTS).register(fabricItemGroupEntries -> {
fabricItemGroupEntries.add(PINK_GARNET);
fabricItemGroupEntries.add(RAW_PINK_GARNET); //REPLICAR PRA CRIAR NOVOS ITEMS
});
}
}
5 changes: 5 additions & 0 deletions src/main/resources/assets/primeiro-mod/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"item.primeiro-mod.pink_garnet": "Pink Garnet",
"item.primeiro-mod.raw_pink_garnet": "Raw Pink Garnet",
"item.primeiro-mod.yan": "Yan"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "primeiro-mod:item/pink_garnet"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "primeiro-mod:item/raw_pink_garnet"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f5fbd52

Please sign in to comment.