added items
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
39
src/main/java/de/slpnetwork/brewcraft/item/ModItems.java
Normal 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);
|
||||
}
|
||||
}
|
19
src/main/resources/assets/brewcraft/lang/en_us.json
Normal 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"
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "brewcraft:item/barley"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "brewcraft:item/barley_malt"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "brewcraft:item/cider-yeast"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "brewcraft:item/grape"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "brewcraft:item/heater_body"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "brewcraft:item/heater_element"
|
||||
}
|
||||
}
|
6
src/main/resources/assets/brewcraft/models/item/hop.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "brewcraft:item/hop"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "brewcraft:item/malt"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "brewcraft:item/mashine_body"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "brewcraft:item/milling_stone"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "brewcraft:item/pressed_iron"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "brewcraft:item/pressure_body"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "brewcraft:item/rice"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "brewcraft:item/sapphire"
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "brewcraft:item/yeast"
|
||||
}
|
||||
}
|
BIN
src/main/resources/assets/brewcraft/textures/item/barley.png
Normal file
After Width: | Height: | Size: 425 B |
After Width: | Height: | Size: 442 B |
After Width: | Height: | Size: 360 B |
BIN
src/main/resources/assets/brewcraft/textures/item/grape.png
Normal file
After Width: | Height: | Size: 374 B |
After Width: | Height: | Size: 443 B |
After Width: | Height: | Size: 432 B |
BIN
src/main/resources/assets/brewcraft/textures/item/hop.png
Normal file
After Width: | Height: | Size: 544 B |
BIN
src/main/resources/assets/brewcraft/textures/item/malt.png
Normal file
After Width: | Height: | Size: 464 B |
After Width: | Height: | Size: 317 B |
After Width: | Height: | Size: 425 B |
After Width: | Height: | Size: 299 B |
After Width: | Height: | Size: 295 B |
BIN
src/main/resources/assets/brewcraft/textures/item/rice.png
Normal file
After Width: | Height: | Size: 477 B |
BIN
src/main/resources/assets/brewcraft/textures/item/sapphire.png
Normal file
After Width: | Height: | Size: 392 B |
BIN
src/main/resources/assets/brewcraft/textures/item/yeast.png
Normal file
After Width: | Height: | Size: 364 B |