Item unification

This commit is contained in:
ACGaming 2020-08-15 10:26:38 +02:00
parent f5fe64a499
commit b230653e94
6 changed files with 28 additions and 54 deletions

View file

@ -7,13 +7,13 @@ import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class ItemRAM extends Item
public class ItemBase extends Item
{
public ItemRAM()
public ItemBase(String name, CreativeTabs tab)
{
setRegistryName("ram");
setUnlocalizedName(Spackenmobs.MODID + ".ram");
setCreativeTab(CreativeTabs.MISC);
setRegistryName(name);
setUnlocalizedName(Spackenmobs.MODID + "." + name);
setCreativeTab(tab);
}
@SideOnly(Side.CLIENT)

View file

@ -0,0 +1,13 @@
package mod.acgaming.spackenmobs.items;
import net.minecraft.potion.Potion;
public class ItemPotion extends Potion
{
public ItemPotion(String name, boolean isBadPotion, int color, int iconIndexX, int iconIndexY)
{
super(isBadPotion, color);
setPotionName("effect." + name);
setIconIndex(iconIndexX, iconIndexY);
setRegistryName(name);
}
}

View file

@ -1,22 +0,0 @@
package mod.acgaming.spackenmobs.items;
import mod.acgaming.spackenmobs.Spackenmobs;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.ItemCarrotOnAStick;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class ItemRAMOnAStick extends ItemCarrotOnAStick
{
public ItemRAMOnAStick()
{
setRegistryName("ram_on_a_stick");
setUnlocalizedName(Spackenmobs.MODID + ".ram_on_a_stick");
}
@SideOnly(Side.CLIENT)
public void initModel()
{
ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory"));
}
}

View file

@ -1,24 +0,0 @@
package mod.acgaming.spackenmobs.items;
import mod.acgaming.spackenmobs.Spackenmobs;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class ItemSurstroemming extends Item
{
public ItemSurstroemming()
{
setRegistryName("surstroemming");
setUnlocalizedName(Spackenmobs.MODID + ".surstroemming");
setCreativeTab(CreativeTabs.MISC);
}
@SideOnly(Side.CLIENT)
public void initModel()
{
ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory"));
}
}

View file

@ -1,12 +1,13 @@
package mod.acgaming.spackenmobs.misc;
import mod.acgaming.spackenmobs.Spackenmobs;
import mod.acgaming.spackenmobs.items.ItemBase;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder;
@ObjectHolder(Spackenmobs.MODID)
public class ModItems
{
public static final Item RAM = null;
public static final Item RAM_ON_A_STICK = null;
public static final Item SURSTROEMMING = null;
public static final Item RAM = new ItemBase("ram", Spackenmobs.SPACKENMOBS_TAB);
public static final Item RAM_ON_A_STICK = new ItemBase("ram_on_a_stick", Spackenmobs.SPACKENMOBS_TAB);
public static final Item SURSTROEMMING = new ItemBase("surstroemming", Spackenmobs.SPACKENMOBS_TAB);
}

View file

@ -0,0 +1,6 @@
package mod.acgaming.spackenmobs.misc;
public class ModPotions
{
}