Skip to content

Commit

Permalink
Added PlutoSteel Ingot
Browse files Browse the repository at this point in the history
Preparing to get new items and recipies made.
  • Loading branch information
darkwolfie37 committed Jan 29, 2024
1 parent a0344c9 commit 116d889
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 14 deletions.
21 changes: 7 additions & 14 deletions src/main/java/com/darkwolfie/silentvalkyrie/Main.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
package com.darkwolfie.silentvalkyrie;

import com.darkwolfie.silentvalkyrie.item.ModItems;
import com.mojang.logging.LogUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.food.FoodProperties;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.CreativeModeTabs;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.material.MapColor;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;
Expand All @@ -24,18 +17,13 @@
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import org.slf4j.Logger;

// The value here should match an entry in the META-INF/mods.toml file
@Mod(Main.MODID)
public class Main {

// Define mod id in a common place for everything to reference
public static final String MODID = "silentvalkyrie";
// Directly reference a slf4j logger
public static final Logger LOGGER = LogUtils.getLogger();

public Main() {
Expand All @@ -44,6 +32,7 @@ public Main() {
// Register the commonSetup method for modloading
modEventBus.addListener(this::commonSetup);

ModItems.register(modEventBus);

// Register ourselves for server and other game events we are interested in
MinecraftForge.EVENT_BUS.register(this);
Expand Down Expand Up @@ -71,13 +60,17 @@ private void commonSetup(final FMLCommonSetupEvent event) {
// Add the example block item to the building blocks tab
private void addCreative(BuildCreativeModeTabContentsEvent event)
{

if(event.getTabKey() == CreativeModeTabs.INGREDIENTS)
{
event.accept(ModItems.PlutoSteel);
}
}
// You can use SubscribeEvent and let the Event Bus discover methods to call
@SubscribeEvent
public void onServerStarting(ServerStartingEvent event) {
// Do something when the server starts
LOGGER.info("HELLO from server starting");
var weird = event.getServer().getCommands();
}

// You can use EventBusSubscriber to automatically register all static methods in the class annotated with @SubscribeEvent
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/com/darkwolfie/silentvalkyrie/item/ModItems.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.darkwolfie.silentvalkyrie.item;

import com.darkwolfie.silentvalkyrie.Main;
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;

public class ModItems {
public static final DeferredRegister<Item> Items =
DeferredRegister.create(ForgeRegistries.ITEMS, Main.MODID);

public static final RegistryObject<Item> PlutoSteel = Items.register("plutosteel",
() -> new Item(new Item.Properties()));

public static void register(IEventBus eventBus){
Items.register(eventBus);
}
}
3 changes: 3 additions & 0 deletions src/main/resources/assets/silentvalkyrie/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"item.silentvalkyrie.plutosteel": "PlutoSteel"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "silentvalkyrie:item/plutosteel"
}
}

0 comments on commit 116d889

Please sign in to comment.