diff --git a/src/main/java/de/slpnetwork/brewcraft/Brewcraft.java b/src/main/java/de/slpnetwork/brewcraft/Brewcraft.java index 16dcfb3..ca8cc2c 100644 --- a/src/main/java/de/slpnetwork/brewcraft/Brewcraft.java +++ b/src/main/java/de/slpnetwork/brewcraft/Brewcraft.java @@ -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 diff --git a/src/main/java/de/slpnetwork/brewcraft/item/ModCreativeModeTabs.java b/src/main/java/de/slpnetwork/brewcraft/item/ModCreativeModeTabs.java new file mode 100644 index 0000000..6e780b0 --- /dev/null +++ b/src/main/java/de/slpnetwork/brewcraft/item/ModCreativeModeTabs.java @@ -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 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 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); + } +} diff --git a/src/main/java/de/slpnetwork/brewcraft/item/ModItems.java b/src/main/java/de/slpnetwork/brewcraft/item/ModItems.java new file mode 100644 index 0000000..4036b3c --- /dev/null +++ b/src/main/java/de/slpnetwork/brewcraft/item/ModItems.java @@ -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 ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Brewcraft.MODID); + + public static final RegistryObject Saphire = ITEMS.register("sapphire", () -> new Item(new Item.Properties())); + public static final RegistryObject Yeast = ITEMS.register("yeast", () -> new Item(new Item.Properties())); + public static final RegistryObject Cider_Yeast = ITEMS.register("cider-yeast", () -> new Item(new Item.Properties())); + public static final RegistryObject Hop = ITEMS.register("hop", () -> new Item(new Item.Properties())); + public static final RegistryObject Rice = ITEMS.register("rice", () -> new Item(new Item.Properties())); + public static final RegistryObject Grape = ITEMS.register("grape", () -> new Item(new Item.Properties())); + public static final RegistryObject Barley = ITEMS.register("barley", () -> new Item(new Item.Properties())); + public static final RegistryObject Malt = ITEMS.register("malt", () -> new Item(new Item.Properties())); + public static final RegistryObject Barley_Malt = ITEMS.register("barley_malt", () -> new Item(new Item.Properties())); + public static final RegistryObject Heater_Body = ITEMS.register("heater_body", () -> new Item(new Item.Properties())); + public static final RegistryObject Heater_Element = ITEMS.register("heater_element", () -> new Item(new Item.Properties())); + public static final RegistryObject Mashine_Body = ITEMS.register("mashine_body", () -> new Item(new Item.Properties())); + public static final RegistryObject Milling_Stone = ITEMS.register("milling_stone", () -> new Item(new Item.Properties())); + public static final RegistryObject Pressed_Iron = ITEMS.register("pressed_iron", () -> new Item(new Item.Properties())); + public static final RegistryObject 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); + } +} diff --git a/src/main/resources/assets/brewcraft/lang/en_us.json b/src/main/resources/assets/brewcraft/lang/en_us.json new file mode 100644 index 0000000..1922933 --- /dev/null +++ b/src/main/resources/assets/brewcraft/lang/en_us.json @@ -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" +} \ No newline at end of file diff --git a/src/main/resources/assets/brewcraft/models/item/barley.json b/src/main/resources/assets/brewcraft/models/item/barley.json new file mode 100644 index 0000000..2d8c579 --- /dev/null +++ b/src/main/resources/assets/brewcraft/models/item/barley.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "brewcraft:item/barley" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/brewcraft/models/item/barley_malt.json b/src/main/resources/assets/brewcraft/models/item/barley_malt.json new file mode 100644 index 0000000..5cabb63 --- /dev/null +++ b/src/main/resources/assets/brewcraft/models/item/barley_malt.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "brewcraft:item/barley_malt" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/brewcraft/models/item/cider-yeast.json b/src/main/resources/assets/brewcraft/models/item/cider-yeast.json new file mode 100644 index 0000000..3af0f66 --- /dev/null +++ b/src/main/resources/assets/brewcraft/models/item/cider-yeast.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "brewcraft:item/cider-yeast" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/brewcraft/models/item/grape.json b/src/main/resources/assets/brewcraft/models/item/grape.json new file mode 100644 index 0000000..f51dc8e --- /dev/null +++ b/src/main/resources/assets/brewcraft/models/item/grape.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "brewcraft:item/grape" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/brewcraft/models/item/heater_body.json b/src/main/resources/assets/brewcraft/models/item/heater_body.json new file mode 100644 index 0000000..22eed2b --- /dev/null +++ b/src/main/resources/assets/brewcraft/models/item/heater_body.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "brewcraft:item/heater_body" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/brewcraft/models/item/heater_element.json b/src/main/resources/assets/brewcraft/models/item/heater_element.json new file mode 100644 index 0000000..c0237dc --- /dev/null +++ b/src/main/resources/assets/brewcraft/models/item/heater_element.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "brewcraft:item/heater_element" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/brewcraft/models/item/hop.json b/src/main/resources/assets/brewcraft/models/item/hop.json new file mode 100644 index 0000000..e35ffaa --- /dev/null +++ b/src/main/resources/assets/brewcraft/models/item/hop.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "brewcraft:item/hop" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/brewcraft/models/item/malt.json b/src/main/resources/assets/brewcraft/models/item/malt.json new file mode 100644 index 0000000..ba4b402 --- /dev/null +++ b/src/main/resources/assets/brewcraft/models/item/malt.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "brewcraft:item/malt" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/brewcraft/models/item/mashine_body.json b/src/main/resources/assets/brewcraft/models/item/mashine_body.json new file mode 100644 index 0000000..ae38ebc --- /dev/null +++ b/src/main/resources/assets/brewcraft/models/item/mashine_body.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "brewcraft:item/mashine_body" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/brewcraft/models/item/milling_stone.json b/src/main/resources/assets/brewcraft/models/item/milling_stone.json new file mode 100644 index 0000000..10c223e --- /dev/null +++ b/src/main/resources/assets/brewcraft/models/item/milling_stone.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "brewcraft:item/milling_stone" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/brewcraft/models/item/pressed_iron.json b/src/main/resources/assets/brewcraft/models/item/pressed_iron.json new file mode 100644 index 0000000..1726751 --- /dev/null +++ b/src/main/resources/assets/brewcraft/models/item/pressed_iron.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "brewcraft:item/pressed_iron" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/brewcraft/models/item/pressure_body.json b/src/main/resources/assets/brewcraft/models/item/pressure_body.json new file mode 100644 index 0000000..e578356 --- /dev/null +++ b/src/main/resources/assets/brewcraft/models/item/pressure_body.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "brewcraft:item/pressure_body" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/brewcraft/models/item/rice.json b/src/main/resources/assets/brewcraft/models/item/rice.json new file mode 100644 index 0000000..3fe3099 --- /dev/null +++ b/src/main/resources/assets/brewcraft/models/item/rice.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "brewcraft:item/rice" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/brewcraft/models/item/sapphire.json b/src/main/resources/assets/brewcraft/models/item/sapphire.json new file mode 100644 index 0000000..fbcdcbc --- /dev/null +++ b/src/main/resources/assets/brewcraft/models/item/sapphire.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "brewcraft:item/sapphire" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/brewcraft/models/item/yeast.json b/src/main/resources/assets/brewcraft/models/item/yeast.json new file mode 100644 index 0000000..2f8b80d --- /dev/null +++ b/src/main/resources/assets/brewcraft/models/item/yeast.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "brewcraft:item/yeast" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/brewcraft/textures/item/barley.png b/src/main/resources/assets/brewcraft/textures/item/barley.png new file mode 100644 index 0000000..1b4b86b Binary files /dev/null and b/src/main/resources/assets/brewcraft/textures/item/barley.png differ diff --git a/src/main/resources/assets/brewcraft/textures/item/barley_malt.png b/src/main/resources/assets/brewcraft/textures/item/barley_malt.png new file mode 100644 index 0000000..bfa0ac3 Binary files /dev/null and b/src/main/resources/assets/brewcraft/textures/item/barley_malt.png differ diff --git a/src/main/resources/assets/brewcraft/textures/item/cider-yeast.png b/src/main/resources/assets/brewcraft/textures/item/cider-yeast.png new file mode 100644 index 0000000..d163624 Binary files /dev/null and b/src/main/resources/assets/brewcraft/textures/item/cider-yeast.png differ diff --git a/src/main/resources/assets/brewcraft/textures/item/grape.png b/src/main/resources/assets/brewcraft/textures/item/grape.png new file mode 100644 index 0000000..0997380 Binary files /dev/null and b/src/main/resources/assets/brewcraft/textures/item/grape.png differ diff --git a/src/main/resources/assets/brewcraft/textures/item/heater_body.png b/src/main/resources/assets/brewcraft/textures/item/heater_body.png new file mode 100644 index 0000000..de00fbf Binary files /dev/null and b/src/main/resources/assets/brewcraft/textures/item/heater_body.png differ diff --git a/src/main/resources/assets/brewcraft/textures/item/heater_element.png b/src/main/resources/assets/brewcraft/textures/item/heater_element.png new file mode 100644 index 0000000..a935853 Binary files /dev/null and b/src/main/resources/assets/brewcraft/textures/item/heater_element.png differ diff --git a/src/main/resources/assets/brewcraft/textures/item/hop.png b/src/main/resources/assets/brewcraft/textures/item/hop.png new file mode 100644 index 0000000..85a0429 Binary files /dev/null and b/src/main/resources/assets/brewcraft/textures/item/hop.png differ diff --git a/src/main/resources/assets/brewcraft/textures/item/malt.png b/src/main/resources/assets/brewcraft/textures/item/malt.png new file mode 100644 index 0000000..4f220eb Binary files /dev/null and b/src/main/resources/assets/brewcraft/textures/item/malt.png differ diff --git a/src/main/resources/assets/brewcraft/textures/item/mashine_body.png b/src/main/resources/assets/brewcraft/textures/item/mashine_body.png new file mode 100644 index 0000000..245d6d9 Binary files /dev/null and b/src/main/resources/assets/brewcraft/textures/item/mashine_body.png differ diff --git a/src/main/resources/assets/brewcraft/textures/item/milling_stone.png b/src/main/resources/assets/brewcraft/textures/item/milling_stone.png new file mode 100644 index 0000000..e36a9d2 Binary files /dev/null and b/src/main/resources/assets/brewcraft/textures/item/milling_stone.png differ diff --git a/src/main/resources/assets/brewcraft/textures/item/pressed_iron.png b/src/main/resources/assets/brewcraft/textures/item/pressed_iron.png new file mode 100644 index 0000000..46f0987 Binary files /dev/null and b/src/main/resources/assets/brewcraft/textures/item/pressed_iron.png differ diff --git a/src/main/resources/assets/brewcraft/textures/item/pressure_body.png b/src/main/resources/assets/brewcraft/textures/item/pressure_body.png new file mode 100644 index 0000000..bc28815 Binary files /dev/null and b/src/main/resources/assets/brewcraft/textures/item/pressure_body.png differ diff --git a/src/main/resources/assets/brewcraft/textures/item/rice.png b/src/main/resources/assets/brewcraft/textures/item/rice.png new file mode 100644 index 0000000..c11b34b Binary files /dev/null and b/src/main/resources/assets/brewcraft/textures/item/rice.png differ diff --git a/src/main/resources/assets/brewcraft/textures/item/sapphire.png b/src/main/resources/assets/brewcraft/textures/item/sapphire.png new file mode 100644 index 0000000..54bfb78 Binary files /dev/null and b/src/main/resources/assets/brewcraft/textures/item/sapphire.png differ diff --git a/src/main/resources/assets/brewcraft/textures/item/yeast.png b/src/main/resources/assets/brewcraft/textures/item/yeast.png new file mode 100644 index 0000000..9437b41 Binary files /dev/null and b/src/main/resources/assets/brewcraft/textures/item/yeast.png differ diff --git a/tex/barley.psd b/tex/barley.psd new file mode 100644 index 0000000..5d655d5 Binary files /dev/null and b/tex/barley.psd differ diff --git a/tex/barley_malt.psd b/tex/barley_malt.psd new file mode 100644 index 0000000..e58cad3 Binary files /dev/null and b/tex/barley_malt.psd differ diff --git a/tex/cider_yeast.psd b/tex/cider_yeast.psd new file mode 100644 index 0000000..7f550c6 Binary files /dev/null and b/tex/cider_yeast.psd differ diff --git a/tex/compressed_iron.psd b/tex/compressed_iron.psd new file mode 100644 index 0000000..d1a173a Binary files /dev/null and b/tex/compressed_iron.psd differ diff --git a/tex/grape.psd b/tex/grape.psd new file mode 100644 index 0000000..6ee6462 Binary files /dev/null and b/tex/grape.psd differ diff --git a/tex/heater_body.psd b/tex/heater_body.psd new file mode 100644 index 0000000..1dd1b40 Binary files /dev/null and b/tex/heater_body.psd differ diff --git a/tex/heater_element.psd b/tex/heater_element.psd new file mode 100644 index 0000000..91b11ba Binary files /dev/null and b/tex/heater_element.psd differ diff --git a/tex/hop.psd b/tex/hop.psd new file mode 100644 index 0000000..70710b9 Binary files /dev/null and b/tex/hop.psd differ diff --git a/tex/malt.psd b/tex/malt.psd new file mode 100644 index 0000000..f179b4f Binary files /dev/null and b/tex/malt.psd differ diff --git a/tex/mashine_body.psd b/tex/mashine_body.psd new file mode 100644 index 0000000..f6cc5a5 Binary files /dev/null and b/tex/mashine_body.psd differ diff --git a/tex/milling_stone.psd b/tex/milling_stone.psd new file mode 100644 index 0000000..6cf901e Binary files /dev/null and b/tex/milling_stone.psd differ diff --git a/tex/pressure_body.psd b/tex/pressure_body.psd new file mode 100644 index 0000000..dc737c8 Binary files /dev/null and b/tex/pressure_body.psd differ diff --git a/tex/rice.psd b/tex/rice.psd new file mode 100644 index 0000000..4f61725 Binary files /dev/null and b/tex/rice.psd differ