From 3a0f27cfd2e5e104e7bec965f488622c57bdaf0b Mon Sep 17 00:00:00 2001 From: Pilzinsel64 Date: Fri, 1 Mar 2024 19:10:48 +0100 Subject: [PATCH] use bone as item --- .../de/pilz/customnpcsadvanced/CommonProxy.java | 1 - .../pilz/customnpcsadvanced/ItemRegistry.java | 17 ----------------- .../feature/TileEntityNpcManager.java | 4 ++-- 3 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 src/main/java/de/pilz/customnpcsadvanced/ItemRegistry.java diff --git a/src/main/java/de/pilz/customnpcsadvanced/CommonProxy.java b/src/main/java/de/pilz/customnpcsadvanced/CommonProxy.java index e63edae..1211b11 100644 --- a/src/main/java/de/pilz/customnpcsadvanced/CommonProxy.java +++ b/src/main/java/de/pilz/customnpcsadvanced/CommonProxy.java @@ -21,7 +21,6 @@ public class CommonProxy implements IGuiHandler { public void preInit(FMLPreInitializationEvent event) { Config.init(); CustomNpcPlusExtras.LOG.info("I am Custom NPC+ Extras at version " + Tags.VERSION); - ItemRegistry.register(); } // load "Do your mod setup. Build whatever data structures you care about. Register recipes." (Remove if not needed) diff --git a/src/main/java/de/pilz/customnpcsadvanced/ItemRegistry.java b/src/main/java/de/pilz/customnpcsadvanced/ItemRegistry.java deleted file mode 100644 index 700fafd..0000000 --- a/src/main/java/de/pilz/customnpcsadvanced/ItemRegistry.java +++ /dev/null @@ -1,17 +0,0 @@ -package de.pilz.customnpcsadvanced; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class ItemRegistry { - - public static final Item itemWandAdv = new Item().setUnlocalizedName("wandAdv") - .setTextureName("wood_hoe") - .setCreativeTab(CreativeTabs.tabAllSearch); - - public static void register() { - GameRegistry.registerItem(itemWandAdv, "wandAdv"); - } -} diff --git a/src/main/java/de/pilz/customnpcsadvanced/feature/TileEntityNpcManager.java b/src/main/java/de/pilz/customnpcsadvanced/feature/TileEntityNpcManager.java index 28b895d..bc96fe8 100644 --- a/src/main/java/de/pilz/customnpcsadvanced/feature/TileEntityNpcManager.java +++ b/src/main/java/de/pilz/customnpcsadvanced/feature/TileEntityNpcManager.java @@ -2,6 +2,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; @@ -11,7 +12,6 @@ import cpw.mods.fml.common.eventhandler.Event.Result; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import de.pilz.customnpcsadvanced.ItemRegistry; import de.pilz.customnpcsadvanced.api.ITileEntityNpcManager; import de.pilz.customnpcsadvanced.api.TileEntityNpc; import de.pilz.customnpcsadvanced.api.data.TileEntityNpcData; @@ -47,7 +47,7 @@ public void onPlayerInteract(PlayerInteractEvent event) { ItemStack heldItem = player.getHeldItem(); if (tile != null) { - if (heldItem != null && heldItem.getItem() == ItemRegistry.itemWandAdv + if (heldItem != null && heldItem.getItem() == Items.bone && (!ConfigMain.OpsOnly || NoppesUtilServer.isOp(player))) { TileEntityNpcData npcData = TileEntityNpcManager.Instance.getNpcData(tile, true); TileEntityNpc npc = new TileEntityNpc(event.world, npcData);