added items

This commit is contained in:
steev 2023-11-05 00:09:27 +01:00
parent 8a42516565
commit 5c6cbb7403
47 changed files with 207 additions and 0 deletions

View File

@ -1,6 +1,9 @@
package de.slpnetwork.brewcraft;
import com.mojang.logging.LogUtils;
import de.slpnetwork.brewcraft.item.ModCreativeModeTabs;
import de.slpnetwork.brewcraft.item.ModItems;
import net.minecraft.world.item.CreativeModeTabs;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;
@ -29,6 +32,9 @@ public class Brewcraft
{
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
ModItems.register(modEventBus);
ModCreativeModeTabs.register(modEventBus);
// Register the commonSetup method for modloading
modEventBus.addListener(this::commonSetup);
@ -46,6 +52,9 @@ public class Brewcraft
// Add the example block item to the building blocks tab
private void addCreative(BuildCreativeModeTabContentsEvent event)
{
if(event.getTabKey() == CreativeModeTabs.INGREDIENTS) {
event.accept(ModItems.Saphire);
}
}
// You can use SubscribeEvent and let the Event Bus discover methods to call

View File

@ -0,0 +1,50 @@
package de.slpnetwork.brewcraft.item;
import de.slpnetwork.brewcraft.Brewcraft;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.RegistryObject;
/**
* used to register Creative Tabs
*/
public class ModCreativeModeTabs {
public static final DeferredRegister<CreativeModeTab> CREATIVE_MODE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, Brewcraft.MODID);
/**
* constructs the creative mode tab and adds items to it
*/
public static final RegistryObject<CreativeModeTab> BREWCRAFT_TAB = CREATIVE_MODE_TABS.register("brewcraft_tab",
() -> CreativeModeTab.builder().icon(
() -> new ItemStack(ModItems.Hop.get()))
.title(Component.translatable("creativetab.brewcraft_tab"))
.displayItems((pParameters, pOutput) -> {
pOutput.accept(ModItems.Barley_Malt.get());
pOutput.accept(ModItems.Malt.get());
pOutput.accept(ModItems.Yeast.get());
pOutput.accept(ModItems.Cider_Yeast.get());
pOutput.accept(ModItems.Rice.get());
pOutput.accept(ModItems.Hop.get());
pOutput.accept(ModItems.Grape.get());
pOutput.accept(ModItems.Barley.get());
pOutput.accept(ModItems.Heater_Body.get());
pOutput.accept(ModItems.Heater_Element.get());
pOutput.accept(ModItems.Mashine_Body.get());
pOutput.accept(ModItems.Milling_Stone.get());
pOutput.accept(ModItems.Pressed_Iron.get());
pOutput.accept(ModItems.Pressure_Body.get());
})
.build());
/***
* registers the deferredregister
* @param eventBus the mods eventbus
*/
public static void register(IEventBus eventBus) {
CREATIVE_MODE_TABS.register(eventBus);
}
}

View File

@ -0,0 +1,39 @@
package de.slpnetwork.brewcraft.item;
import de.slpnetwork.brewcraft.Brewcraft;
import net.minecraft.world.item.Item;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
/**
* used to register items
*/
public class ModItems {
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Brewcraft.MODID);
public static final RegistryObject<Item> Saphire = ITEMS.register("sapphire", () -> new Item(new Item.Properties()));
public static final RegistryObject<Item> Yeast = ITEMS.register("yeast", () -> new Item(new Item.Properties()));
public static final RegistryObject<Item> Cider_Yeast = ITEMS.register("cider-yeast", () -> new Item(new Item.Properties()));
public static final RegistryObject<Item> Hop = ITEMS.register("hop", () -> new Item(new Item.Properties()));
public static final RegistryObject<Item> Rice = ITEMS.register("rice", () -> new Item(new Item.Properties()));
public static final RegistryObject<Item> Grape = ITEMS.register("grape", () -> new Item(new Item.Properties()));
public static final RegistryObject<Item> Barley = ITEMS.register("barley", () -> new Item(new Item.Properties()));
public static final RegistryObject<Item> Malt = ITEMS.register("malt", () -> new Item(new Item.Properties()));
public static final RegistryObject<Item> Barley_Malt = ITEMS.register("barley_malt", () -> new Item(new Item.Properties()));
public static final RegistryObject<Item> Heater_Body = ITEMS.register("heater_body", () -> new Item(new Item.Properties()));
public static final RegistryObject<Item> Heater_Element = ITEMS.register("heater_element", () -> new Item(new Item.Properties()));
public static final RegistryObject<Item> Mashine_Body = ITEMS.register("mashine_body", () -> new Item(new Item.Properties()));
public static final RegistryObject<Item> Milling_Stone = ITEMS.register("milling_stone", () -> new Item(new Item.Properties()));
public static final RegistryObject<Item> Pressed_Iron = ITEMS.register("pressed_iron", () -> new Item(new Item.Properties()));
public static final RegistryObject<Item> Pressure_Body = ITEMS.register("pressure_body", () -> new Item(new Item.Properties()));
/***
* registers the deferredregister
* @param eventBus the mods eventbus
*/
public static void register(IEventBus eventBus) {
ITEMS.register(eventBus);
}
}

View File

@ -0,0 +1,19 @@
{
"item.brewcraft.sapphire": "Saphire",
"item.brewcraft.yeast": "Yeast",
"item.brewcraft.cider-yeast": "Cider Yeast",
"item.brewcraft.hop": "Hop",
"item.brewcraft.rice": "Rice",
"item.brewcraft.grape": "Grape",
"item.brewcraft.barley": "Barley",
"item.brewcraft.barley_malt": "Barley Malt",
"item.brewcraft.malt": "Malt",
"item.brewcraft.heater_body": "Heater Body",
"item.brewcraft.heater_element": "Heater Element",
"item.brewcraft.heater_element": "Mashine Body",
"item.brewcraft.milling_stone": "Milling Stone",
"item.brewcraft.pressed_iron": "Pressed Iron",
"item.brewcraft.pressure_body": "Pressure Body",
"creativetab.brewcraft_tab": "Brewcraft"
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "brewcraft:item/barley"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "brewcraft:item/barley_malt"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "brewcraft:item/cider-yeast"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "brewcraft:item/grape"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "brewcraft:item/heater_body"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "brewcraft:item/heater_element"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "brewcraft:item/hop"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "brewcraft:item/malt"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "brewcraft:item/mashine_body"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "brewcraft:item/milling_stone"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "brewcraft:item/pressed_iron"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "brewcraft:item/pressure_body"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "brewcraft:item/rice"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "brewcraft:item/sapphire"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "brewcraft:item/yeast"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 443 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

BIN
tex/barley.psd Normal file

Binary file not shown.

BIN
tex/barley_malt.psd Normal file

Binary file not shown.

BIN
tex/cider_yeast.psd Normal file

Binary file not shown.

BIN
tex/compressed_iron.psd Normal file

Binary file not shown.

BIN
tex/grape.psd Normal file

Binary file not shown.

BIN
tex/heater_body.psd Normal file

Binary file not shown.

BIN
tex/heater_element.psd Normal file

Binary file not shown.

BIN
tex/hop.psd Normal file

Binary file not shown.

BIN
tex/malt.psd Normal file

Binary file not shown.

BIN
tex/mashine_body.psd Normal file

Binary file not shown.

BIN
tex/milling_stone.psd Normal file

Binary file not shown.

BIN
tex/pressure_body.psd Normal file

Binary file not shown.

BIN
tex/rice.psd Normal file

Binary file not shown.