-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7358b83
commit a74d771
Showing
5 changed files
with
58 additions
and
9 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/main/java/net/skywalker8510/pocketsand/Item/ModItems.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package net.skywalker8510.pocketsand.Item; | ||
|
||
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroupEntries; | ||
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; | ||
import net.skywalker8510.pocketsand.PocketSand; | ||
|
||
public class ModItems { | ||
|
||
public static final Item POCKET_SAND = registerItem("pocket_sand", new Item(new Item.Settings())); | ||
|
||
private static void addItemsToIngredientItemGroup(FabricItemGroupEntries entries) { | ||
entries.add(POCKET_SAND); | ||
} | ||
|
||
public static Item registerItem(String name, Item item) { | ||
return Registry.register(Registries.ITEM, new Identifier(PocketSand.MOD_ID, name), item); | ||
} | ||
public static void registerModItems() { | ||
PocketSand.LOGGER.info("Registering Mod Items for " + PocketSand.MOD_ID); | ||
|
||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.INGREDIENTS).register(ModItems::addItemsToIngredientItemGroup); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"item.pocketsand.pocket_sand": "Pocket Sand" | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/pocketsand/models/item/pocket_sand.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "pocketsand:item/pocket_sand" | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/resources/data/pocketsand/recipies/sand_from_pocket_sand.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"type": "minecraft:crafting_shaped", | ||
"pattern": [ | ||
"###", | ||
"###", | ||
"###" | ||
], | ||
"key": { | ||
"#": { | ||
"item": "pocketsand.pocket_sand" | ||
} | ||
}, | ||
"result": { | ||
"item": "minecraft:sand", | ||
"count": 1 | ||
} | ||
} |