Skip to content

Commit

Permalink
Create item and item model
Browse files Browse the repository at this point in the history
  • Loading branch information
Griefed committed Nov 11, 2023
1 parent 2d0ae45 commit 52a42df
Show file tree
Hide file tree
Showing 12 changed files with 1,381 additions and 1 deletion.
3 changes: 3 additions & 0 deletions common/src/main/java/de/griefed/addemall/CommonClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import de.griefed.addemall.block.GeneratedModBlocks;
import de.griefed.addemall.item.GeneratedModItems;
import de.griefed.addemall.item.ModItems;
import de.griefed.addemall.platform.Services;
import net.minecraft.network.chat.Component;
import net.minecraft.world.food.FoodProperties;
Expand Down Expand Up @@ -36,6 +37,8 @@ public static void init() {
GeneratedModBlocks.loadClass();
GeneratedModItems.loadClass();
/*###GENERATED CODE - DO NOT EDIT - MANUALLY EDITED CODE WILL BE LOST###*/

ModItems.loadClass();
}

public static void onItemTooltip(ItemStack stack, TooltipFlag context, List<Component> tooltip) {
Expand Down
18 changes: 18 additions & 0 deletions common/src/main/java/de/griefed/addemall/item/BlockTool.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package de.griefed.addemall.item;

import de.griefed.addemall.platform.Services;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.PickaxeItem;
import net.minecraft.world.item.Tier;
import net.minecraft.world.item.Tiers;

public class BlockTool extends PickaxeItem {

public BlockTool() {
this(Tiers.NETHERITE, 12, 8f, new Item.Properties().tab(Services.PLATFORM.getCreativeTab()));
}

private BlockTool(Tier $$0, int $$1, float $$2, Properties $$3) {
super($$0, $$1, $$2, $$3);
}
}
21 changes: 21 additions & 0 deletions common/src/main/java/de/griefed/addemall/item/ModItems.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package de.griefed.addemall.item;

import de.griefed.addemall.Constants;
import de.griefed.addemall.platform.Services;
import de.griefed.addemall.registry.RegistrationProvider;
import de.griefed.addemall.registry.RegistryObject;
import net.minecraft.core.Registry;
import net.minecraft.world.item.*;

public class ModItems {
public static final RegistrationProvider<Item> ITEMS = RegistrationProvider.get(Registry.ITEM_REGISTRY, Constants.MOD_ID);

public static final RegistryObject<Item> BLOCK_TOOL = ITEMS.register("block_tool", BlockTool::new);

private static Item.Properties itemBuilder() {
return new Item.Properties().tab(Services.PLATFORM.getCreativeTab());
}

// Called in the mod initializer / constructor in order to make sure that items are registered
public static void loadClass() {}
}
3 changes: 2 additions & 1 deletion common/src/main/resources/assets/addemall/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -504,5 +504,6 @@
"item.addemall.generated.stone.stone_tiles_3_stairs": "Stone Tiles 3 Stairs",
"block.addemall.generated.stone.stone_tiles_3_stairs": "Stone Tiles 3 Stairs",
"DO.NOT.EDIT.MANUALLY.END": "END",
"itemGroup.addemall.tab": "AddEmAll"
"itemGroup.addemall.tab": "AddEmAll",
"item.addemall.block_tool": "Block Tool"
}
Loading

0 comments on commit 52a42df

Please sign in to comment.