tools 1
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// 1.21 2024-12-30T14:50:30.74861 Recipes
|
||||
// 1.21 2024-12-30T15:05:08.206774 Recipes
|
||||
39a320d3e238f524a92dae1eaa1c60d0e45ba296 data/nuggetmod/advancement/recipes/misc/nugget.json
|
||||
8160ae7d8117c0cc293fcd40e22d1072c16ca478 data/nuggetmod/advancement/recipes/misc/nugget_block.json
|
||||
ebf761f6dad07dac9f3ac9f8732d291cf7930611 data/nuggetmod/advancement/recipes/misc/nugget_from_blasting_nugget_deepslate_ore.json
|
||||
@@ -7,6 +7,8 @@ e10188670de3a7a815f73a66fc5f4e92a648b51e data/nuggetmod/advancement/recipes/misc
|
||||
16fc56222bdb61afa3618038ee189f405fd20922 data/nuggetmod/advancement/recipes/misc/nugget_from_smelting_nugget_deepslate_ore.json
|
||||
7b9dcb92c1af9c1982292c1efd6b4fb27513b3f5 data/nuggetmod/advancement/recipes/misc/nugget_from_smelting_nugget_ore.json
|
||||
762af010e4f2c6dbf4b54f5f7c4575f28b47c524 data/nuggetmod/advancement/recipes/misc/nugget_from_smelting_raw_nugget.json
|
||||
59e41b4b30c51f225ccb673f401839ec7e77fe20 data/nuggetmod/advancement/recipes/misc/raw_nugget.json
|
||||
0eac4876a225ba434ebefcecb2d9a3d5b1af5cc3 data/nuggetmod/advancement/recipes/misc/raw_nugget_block.json
|
||||
46cf496588958f9727af31d89b8adfa56f319b32 data/nuggetmod/recipe/nugget.json
|
||||
a616003c555df86443a939fff05be631f005b5e7 data/nuggetmod/recipe/nugget_block.json
|
||||
7cb0715c46c01f7dd8802b3cd8302c20ccb281cf data/nuggetmod/recipe/nugget_from_blasting_nugget_deepslate_ore.json
|
||||
@@ -15,3 +17,5 @@ a616003c555df86443a939fff05be631f005b5e7 data/nuggetmod/recipe/nugget_block.json
|
||||
61bc79a197aa3f00ccdbc3a573c1dc90bbb380e1 data/nuggetmod/recipe/nugget_from_smelting_nugget_deepslate_ore.json
|
||||
da4d3a890cd2a10ef6502861f80d89da01c38533 data/nuggetmod/recipe/nugget_from_smelting_nugget_ore.json
|
||||
b7053163e6e237928a9de0b5dfe921883a6e6b5c data/nuggetmod/recipe/nugget_from_smelting_raw_nugget.json
|
||||
c30c2ad83bc1c296f619a1d111eb11aff1155f0b data/nuggetmod/recipe/raw_nugget.json
|
||||
0a4297bae4d63ee5ba5092d4000e888112186293 data/nuggetmod/recipe/raw_nugget_block.json
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"parent": "minecraft:recipes/root",
|
||||
"criteria": {
|
||||
"has_raw_nugget_block": {
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"items": "nuggetmod:raw_nugget_block"
|
||||
}
|
||||
]
|
||||
},
|
||||
"trigger": "minecraft:inventory_changed"
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"conditions": {
|
||||
"recipe": "nuggetmod:raw_nugget"
|
||||
},
|
||||
"trigger": "minecraft:recipe_unlocked"
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[
|
||||
"has_the_recipe",
|
||||
"has_raw_nugget_block"
|
||||
]
|
||||
],
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"nuggetmod:raw_nugget"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"parent": "minecraft:recipes/root",
|
||||
"criteria": {
|
||||
"has_raw_nugget": {
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"items": "nuggetmod:raw_nugget"
|
||||
}
|
||||
]
|
||||
},
|
||||
"trigger": "minecraft:inventory_changed"
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"conditions": {
|
||||
"recipe": "nuggetmod:raw_nugget_block"
|
||||
},
|
||||
"trigger": "minecraft:recipe_unlocked"
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[
|
||||
"has_the_recipe",
|
||||
"has_raw_nugget"
|
||||
]
|
||||
],
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"nuggetmod:raw_nugget_block"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"category": "misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "nuggetmod:raw_nugget_block"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"count": 9,
|
||||
"id": "nuggetmod:raw_nugget"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "misc",
|
||||
"key": {
|
||||
"A": {
|
||||
"item": "nuggetmod:raw_nugget"
|
||||
}
|
||||
},
|
||||
"pattern": [
|
||||
"AAA",
|
||||
"AAA",
|
||||
"AAA"
|
||||
],
|
||||
"result": {
|
||||
"count": 1,
|
||||
"id": "nuggetmod:raw_nugget_block"
|
||||
}
|
||||
}
|
||||
@@ -4,10 +4,12 @@ import xyz.sillyangel.nugget.NuggetMod;
|
||||
import xyz.sillyangel.nugget.block.ModBlocks;
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraftforge.common.data.BlockTagsProvider;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import xyz.sillyangel.nugget.util.ModTags;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
@@ -24,10 +26,17 @@ public class ModBlockTagProvider extends BlockTagsProvider {
|
||||
.add(ModBlocks.NUGGET_ORE.get())
|
||||
.add(ModBlocks.NUGGET_DEEPSLATE_ORE.get());
|
||||
|
||||
tag(BlockTags.NEEDS_IRON_TOOL)
|
||||
.add(ModBlocks.NUGGET_DEEPSLATE_ORE.get());
|
||||
|
||||
tag(BlockTags.NEEDS_DIAMOND_TOOL)
|
||||
tag(BlockTags.NEEDS_STONE_TOOL)
|
||||
.add(ModBlocks.NUGGET_DEEPSLATE_ORE.get())
|
||||
.add(ModBlocks.RAW_NUGGET_BLOCK.get());
|
||||
|
||||
// tag(BlockTags.NEEDS_STONE_TOOL)
|
||||
tag(ModTags.Blocks.NEEDS_NUGGET_TOOL)
|
||||
.add(ModBlocks.RAW_NUGGET_BLOCK.get())
|
||||
.addTag(BlockTags.NEEDS_DIAMOND_TOOL);
|
||||
|
||||
tag(ModTags.Blocks.INCORRECT_FOR_NUGGET_TOOL)
|
||||
.addTag(BlockTags.INCORRECT_FOR_DIAMOND_TOOL)
|
||||
.remove(ModTags.Blocks.NEEDS_NUGGET_TOOL);
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,14 @@ package xyz.sillyangel.nugget.datagen;
|
||||
import xyz.sillyangel.nugget.NuggetMod;
|
||||
import xyz.sillyangel.nugget.item.ModItems;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraftforge.client.model.generators.ItemModelBuilder;
|
||||
import net.minecraftforge.client.model.generators.ItemModelProvider;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
public class ModItemModelProvider extends ItemModelProvider {
|
||||
public ModItemModelProvider(PackOutput output, ExistingFileHelper existingFileHelper) {
|
||||
@@ -15,5 +21,41 @@ public class ModItemModelProvider extends ItemModelProvider {
|
||||
protected void registerModels() {
|
||||
basicItem(ModItems.NUGGET.get());
|
||||
basicItem(ModItems.RAW_NUGGET.get());
|
||||
|
||||
handheldItem(ModItems.NUGGET_SWORD);
|
||||
handheldItem(ModItems.NUGGET_PICKAXE);
|
||||
handheldItem(ModItems.NUGGET_SHOVEL);
|
||||
handheldItem(ModItems.NUGGET_AXE);
|
||||
handheldItem(ModItems.NUGGET_HOE);
|
||||
}
|
||||
|
||||
private ItemModelBuilder handheldItem(RegistryObject<Item> item) {
|
||||
return withExistingParent(item.getId().getPath(),
|
||||
ResourceLocation.parse("item/handheld")).texture("layer0",
|
||||
ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID,"item/" + item.getId().getPath()));
|
||||
}
|
||||
|
||||
public void buttonItem(RegistryObject<? extends Block> block, RegistryObject<Block> baseBlock) {
|
||||
this.withExistingParent(ForgeRegistries.BLOCKS.getKey(block.get()).getPath(), mcLoc("block/button_inventory"))
|
||||
.texture("texture", ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID,
|
||||
"block/" + ForgeRegistries.BLOCKS.getKey(baseBlock.get()).getPath()));
|
||||
}
|
||||
|
||||
public void fenceItem(RegistryObject<? extends Block> block, RegistryObject<Block> baseBlock) {
|
||||
this.withExistingParent(ForgeRegistries.BLOCKS.getKey(block.get()).getPath(), mcLoc("block/fence_inventory"))
|
||||
.texture("texture", ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID,
|
||||
"block/" + ForgeRegistries.BLOCKS.getKey(baseBlock.get()).getPath()));
|
||||
}
|
||||
|
||||
public void wallItem(RegistryObject<? extends Block> block, RegistryObject<Block> baseBlock) {
|
||||
this.withExistingParent(ForgeRegistries.BLOCKS.getKey(block.get()).getPath(), mcLoc("block/wall_inventory"))
|
||||
.texture("wall", ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID,
|
||||
"block/" + ForgeRegistries.BLOCKS.getKey(baseBlock.get()).getPath()));
|
||||
}
|
||||
|
||||
private ItemModelBuilder simpleBlockItem(RegistryObject<? extends Block> item) {
|
||||
return withExistingParent(item.getId().getPath(),
|
||||
ResourceLocation.parse("item/generated")).texture("layer0",
|
||||
ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID,"item/" + item.getId().getPath()));
|
||||
}
|
||||
}
|
||||
@@ -34,8 +34,24 @@ public class ModRecipeProvider extends RecipeProvider implements IConditionBuild
|
||||
.requires(ModBlocks.NUGGET_BLOCK.get())
|
||||
.unlockedBy(getHasName(ModBlocks.NUGGET_BLOCK.get()), has(ModBlocks.NUGGET_BLOCK.get())).save(pRecipeOutput);
|
||||
|
||||
// RAW NUGGET
|
||||
|
||||
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModBlocks.RAW_NUGGET_BLOCK.get())
|
||||
.pattern("AAA")
|
||||
.pattern("AAA")
|
||||
.pattern("AAA")
|
||||
.define('A', ModItems.RAW_NUGGET.get())
|
||||
.unlockedBy(getHasName(ModItems.RAW_NUGGET.get()), has(ModItems.RAW_NUGGET.get())).save(pRecipeOutput);
|
||||
|
||||
ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.RAW_NUGGET.get(), 9)
|
||||
.requires(ModBlocks.RAW_NUGGET_BLOCK.get())
|
||||
.unlockedBy(getHasName(ModBlocks.RAW_NUGGET_BLOCK.get()), has(ModBlocks.RAW_NUGGET_BLOCK.get())).save(pRecipeOutput);
|
||||
|
||||
|
||||
oreSmelting(pRecipeOutput, NUGGET_SMELTABLES, RecipeCategory.MISC, ModItems.NUGGET.get(), 0.25f, 200, "nugget");
|
||||
oreBlasting(pRecipeOutput, NUGGET_SMELTABLES, RecipeCategory.MISC, ModItems.NUGGET.get(), 0.25f, 100, "nugget");
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected static void oreSmelting(RecipeOutput recipeOutput, List<ItemLike> pIngredients, RecipeCategory pCategory, ItemLike pResult,
|
||||
|
||||
@@ -21,6 +21,12 @@ public class ModCreativeModeTabs {
|
||||
output.accept(ModItems.NUGGET.get());
|
||||
output.accept(ModItems.RAW_NUGGET.get());
|
||||
|
||||
output.accept(ModItems.NUGGET_SWORD.get());
|
||||
output.accept(ModItems.NUGGET_PICKAXE.get());
|
||||
output.accept(ModItems.NUGGET_SHOVEL.get());
|
||||
output.accept(ModItems.NUGGET_AXE.get());
|
||||
output.accept(ModItems.NUGGET_HOE.get());
|
||||
|
||||
}).build());
|
||||
|
||||
public static final RegistryObject<CreativeModeTab> NUGGET_BLOCKS_TAB = CREATIVE_MODE_TABS.register("nuggetmod_blocks_tab",
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
package xyz.sillyangel.nugget.item;
|
||||
|
||||
import xyz.sillyangel.nugget.NuggetMod;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
import net.minecraft.world.item.*;
|
||||
import java.util.List;
|
||||
|
||||
public class ModItems {
|
||||
@@ -28,7 +25,21 @@ public class ModItems {
|
||||
public static final RegistryObject<Item> RAW_NUGGET = ITEMS.register("raw_nugget",
|
||||
() -> new Item(new Item.Properties()));
|
||||
|
||||
|
||||
public static final RegistryObject<Item> NUGGET_SWORD = ITEMS.register("nugget_sword",
|
||||
() -> new SwordItem(ModToolTiers.NUGGET, new Item.Properties()
|
||||
.attributes(SwordItem.createAttributes(ModToolTiers.NUGGET, 3, -2.4f))));
|
||||
public static final RegistryObject<Item> NUGGET_PICKAXE = ITEMS.register("nugget_pickaxe",
|
||||
() -> new PickaxeItem(ModToolTiers.NUGGET, new Item.Properties()
|
||||
.attributes(PickaxeItem.createAttributes(ModToolTiers.NUGGET, 1, -2.8f))));
|
||||
public static final RegistryObject<Item> NUGGET_SHOVEL = ITEMS.register("nugget_shovel",
|
||||
() -> new ShovelItem(ModToolTiers.NUGGET, new Item.Properties()
|
||||
.attributes(ShovelItem.createAttributes(ModToolTiers.NUGGET, 1.5f, -3.0f))));
|
||||
public static final RegistryObject<Item> NUGGET_AXE = ITEMS.register("nugget_axe",
|
||||
() -> new AxeItem(ModToolTiers.NUGGET, new Item.Properties()
|
||||
.attributes(AxeItem.createAttributes(ModToolTiers.NUGGET, 6, -3.2f))));
|
||||
public static final RegistryObject<Item> NUGGET_HOE = ITEMS.register("nugget_hoe",
|
||||
() -> new HoeItem(ModToolTiers.NUGGET, new Item.Properties()
|
||||
.attributes(HoeItem.createAttributes(ModToolTiers.NUGGET, 0, -3.0f))));
|
||||
|
||||
public static void register(IEventBus eventBus) {
|
||||
ITEMS.register(eventBus);
|
||||
|
||||
12
src/main/java/xyz/sillyangel/nugget/item/ModToolTiers.java
Normal file
12
src/main/java/xyz/sillyangel/nugget/item/ModToolTiers.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package xyz.sillyangel.nugget.item;
|
||||
|
||||
import net.minecraft.world.item.Tier;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraftforge.common.ForgeTier;
|
||||
import xyz.sillyangel.nugget.util.ModTags;
|
||||
|
||||
public class ModToolTiers {
|
||||
public static final Tier NUGGET = new ForgeTier(1500, 4.5f, 3.5f, 25,
|
||||
ModTags.Blocks.NEEDS_NUGGET_TOOL, () -> Ingredient.of(ModItems.NUGGET.get()),
|
||||
ModTags.Blocks.INCORRECT_FOR_NUGGET_TOOL);
|
||||
}
|
||||
@@ -10,6 +10,8 @@ import net.minecraft.world.level.block.Block;
|
||||
|
||||
public class ModTags {
|
||||
public static class Blocks {
|
||||
public static final TagKey<Block> NEEDS_NUGGET_TOOL = createTag("needs_nugget_tool");
|
||||
public static final TagKey<Block> INCORRECT_FOR_NUGGET_TOOL = createTag("incorrect_for_nugget_tool");
|
||||
|
||||
private static TagKey<Block> createTag(String name) {
|
||||
return BlockTags.create(ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, name));
|
||||
|
||||
Reference in New Issue
Block a user