diff options
Diffstat (limited to 'src/main/java/gtPlusPlus/core/item')
24 files changed, 0 insertions, 1544 deletions
diff --git a/src/main/java/gtPlusPlus/core/item/ModItems.java b/src/main/java/gtPlusPlus/core/item/ModItems.java index dd07d2b138..060285f551 100644 --- a/src/main/java/gtPlusPlus/core/item/ModItems.java +++ b/src/main/java/gtPlusPlus/core/item/ModItems.java @@ -113,13 +113,11 @@ import gtPlusPlus.core.material.nuclear.NUCLIDE; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.data.StringUtils; -import gtPlusPlus.core.util.debug.DEBUG_INIT; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.MaterialUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.everglades.GTplusplus_Everglades; -import gtPlusPlus.preloader.CORE_Preloader; import gtPlusPlus.xmod.cofh.HANDLER_COFH; import gtPlusPlus.xmod.eio.material.MaterialEIO; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; @@ -429,11 +427,6 @@ public final class ModItems { itemDummyResearch = new ItemDummyResearch(); itemCustomSpawnEgg = new ItemCustomSpawnEgg(); - // Debug Loading - if (CORE_Preloader.DEBUG_MODE) { - DEBUG_INIT.registerItems(); - } - itemDebugAreaClear = new ItemAreaClear(); // Register meta item, because we need them for everything. @@ -1025,9 +1018,6 @@ public final class ModItems { toolGregtechPump.registerPumpType(2, "Super Hand Pump", 128000, 2); toolGregtechPump.registerPumpType(3, "Ultimate Hand Pump", 512000, 3); - // Create Multi-tools - // ItemsMultiTools.load(); - // Xp Fluids - Dev if (!FluidRegistry.isFluidRegistered("mobessence")) { FluidUtils.generateFluidNoPrefix("mobessence", "mobessence", 0, new short[] { 125, 175, 125, 100 }); @@ -1153,11 +1143,6 @@ public final class ModItems { itemDetCable.setTextureName("string"); itemBomb = new ItemThrowableBomb(); - // Only used for debugging. - /* - * if (CORE.DEVENV) { new ConnectedBlockFinder(); } - */ - // Misc Items @SuppressWarnings("unused") Item tI; diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemBrain.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemBrain.java deleted file mode 100644 index cdf98b9547..0000000000 --- a/src/main/java/gtPlusPlus/core/item/base/BaseItemBrain.java +++ /dev/null @@ -1,94 +0,0 @@ -package gtPlusPlus.core.item.base; - -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/* - * Key Point: You can access the NBT compound data from the Item class (in those methods that pass an ItemStack), but - * the NBT compound can only be set on an ItemStack. The steps to add NBT data to an ItemStack: Create or otherwise get - * an ItemStack of the desired item Create an NBTTagCompound and fill it with the appropriate data Call - * ItemStack#setTagCompound() method to set it. - */ - -public class BaseItemBrain extends Item { - - // This is an array of all the types I am going to be adding. - String[] brainTypes = { "dead", "preserved", "fresh", "tasty" }; - - // This method allows us to have different language translation keys for - // each item we add. - @Override - public String getUnlocalizedName(final ItemStack stack) { - // This makes sure that the stack has a tag compound. This is how data - // is stored on items. - if (stack.hasTagCompound()) { - // This is the object holding all of the item data. - final NBTTagCompound itemData = stack.getTagCompound(); - // This checks to see if the item has data stored under the - // brainType key. - if (itemData.hasKey("brainType")) { - // This retrieves data from the brainType key and uses it in - // the return value - return "item." + itemData.getString("brainType"); - } - } - // This will be used if the item is obtained without nbt data on it. - return "item.nullBrain"; - } - - // This is a fun method which allows us to run some code when our item is - // shown in a creative tab. I am going to use it to add all the brain - // types. - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Override - @SideOnly(Side.CLIENT) - public void getSubItems(final Item item, final CreativeTabs tab, final List itemList) { - // This creates a loop with a counter. It will go through once for - // every listing in brainTypes, and gives us a number associated - // with each listing. - for (int pos = 0; pos < this.brainTypes.length; pos++) { - // This creates a new ItemStack instance. The item parameter - // supplied is this item. - final ItemStack brainStack = new ItemStack(item); - // By default, a new ItemStack does not have any nbt compound data. - // We need to give it some. - brainStack.setTagCompound(new NBTTagCompound()); - // Now we set the type of the item, brainType is the key, and - // brainTypes[pos] is grabbing a - // entry from the brainTypes array. - brainStack.getTagCompound().setString("brainType", this.brainTypes[pos]); - // And this adds it to the itemList, which is a list of all items - // in the creative tab. - itemList.add(brainStack); - } - } - - // This code will allow us to tell the items apart in game. You can change - @SuppressWarnings({ "rawtypes", "unchecked" }) - // texture based on nbt data, but I won't be covering that. - @Override - @SideOnly(Side.CLIENT) - public void addInformation(final ItemStack stack, final EntityPlayer player, final List tooltip, - final boolean isAdvanced) { - if (stack.hasTagCompound() && stack.getTagCompound().hasKey("brainType")) { - // StatCollector is a class which allows us to handle string - // language translation. This requires that you fill out the - // translation in you language class. - tooltip.add( - StatCollector.translateToLocal( - "tooltip.yourmod." + stack.getTagCompound().getString("brainType") + ".desc")); - } else // If the brain does not have valid tag data, a default message - { - tooltip.add(StatCollector.translateToLocal("tooltip.yourmod.nullbrain.desc")); - } - } -} diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemGeneric.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemGeneric.java deleted file mode 100644 index eb75c1fe5d..0000000000 --- a/src/main/java/gtPlusPlus/core/item/base/BaseItemGeneric.java +++ /dev/null @@ -1,27 +0,0 @@ -package gtPlusPlus.core.item.base; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -public class BaseItemGeneric extends Item { - - public BaseItemGeneric(final String unlocalizedName, final CreativeTabs c, final int stackSize, final int maxDmg) { - this.setUnlocalizedName(GTPlusPlus.ID + "_" + unlocalizedName); - this.setTextureName(GTPlusPlus.ID + ":" + unlocalizedName); - this.setCreativeTab(c); - this.setMaxStackSize(stackSize); - this.setMaxDamage(maxDmg); - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { - super.addInformation(stack, aPlayer, list, bool); - } -} diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemLoot.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemLoot.java deleted file mode 100644 index 5f4795689d..0000000000 --- a/src/main/java/gtPlusPlus/core/item/base/BaseItemLoot.java +++ /dev/null @@ -1,105 +0,0 @@ -package gtPlusPlus.core.item.base; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import gregtech.api.enums.Materials; -import gtPlusPlus.api.enums.Quality; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.minecraft.ItemUtils; - -public class BaseItemLoot extends Item { - - private final String materialName; - private final String unlocalName; - private final LootTypes lootTypes; - private Quality lootQuality; - private final Materials lootMaterial; - - public BaseItemLoot(final LootTypes lootType, final Materials material) { - this.lootTypes = lootType; - this.lootMaterial = material; - this.materialName = material.mDefaultLocalName; - this.unlocalName = "item" + lootType.LOOT_TYPE + this.materialName; - this.setUnlocalizedName(this.unlocalName); - this.setMaxStackSize(1); - this.setTextureName(GTPlusPlus.ID + ":" + "item" + lootType.LOOT_TYPE); - } - - public ItemStack generateLootStack() { - this.lootQuality = Quality.getRandomQuality(); - return ItemUtils.getSimpleStack(this, 1); - } - - @Override - public String getItemStackDisplayName(final ItemStack p_77653_1_) { - return (this.materialName + this.lootTypes.DISPLAY_SUFFIX); - } - - public final String getMaterialName() { - return this.materialName; - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { - list.add(this.lootQuality.getQuality()); - - /* - * if (componentMaterial.isRadioactive){ list.add(CORE.GT_Tooltip_Radioactive.get()); } - */ - - super.addInformation(stack, aPlayer, list, bool); - } - - @Override - public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) { - final short[] temp = this.lootMaterial.mRGBa; - return Utils.rgbtoHexValue(temp[0], temp[1], temp[2]); - } - - @Override - public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, - final boolean p_77663_5_) { - // EntityUtils.applyRadiationDamageToEntity(lootQuality.vRadioationLevel, world, entityHolding); - } - - public static enum LootTypes { - - Sword("Sword", " Longsword", "sword"), - Shortsword("Sword", " Short Blade", "blade"), - Helmet("Helmet", " Medium Helm", "helmet"), - Chestplate("Platebody", " Chestplate", "platebody"), - Leggings("Platelegs", " Platelegs", "platelegs"), - Boots("Boots", " Boots", "boots"); - - private String LOOT_TYPE; - private String DISPLAY_SUFFIX; - private String OREDICT_NAME; - - private LootTypes(final String LocalName, final String DisplayName, final String OreDictName) { - this.LOOT_TYPE = LocalName; - this.DISPLAY_SUFFIX = DisplayName; - this.OREDICT_NAME = OreDictName; - } - - public String getLootType() { - return this.LOOT_TYPE; - } - - public String getName() { - return this.DISPLAY_SUFFIX; - } - - public String getOreDictName() { - return this.OREDICT_NAME; - } - } -} diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemWithCharge.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemWithCharge.java deleted file mode 100644 index a056b57852..0000000000 --- a/src/main/java/gtPlusPlus/core/item/base/BaseItemWithCharge.java +++ /dev/null @@ -1,67 +0,0 @@ -package gtPlusPlus.core.item.base; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; - -import gtPlusPlus.core.creative.AddToCreativeTab; - -public class BaseItemWithCharge extends Item { - - public int int_Charge = 0; - public int int_Max_Charge = 0; - - public BaseItemWithCharge(final String unlocalizedName, final int constructor_Charge, - final int constructor_Max_Charge) { - this.setUnlocalizedName(unlocalizedName); - this.setTextureName(GTPlusPlus.ID + ":" + unlocalizedName); - this.setMaxStackSize(1); - this.setCreativeTab(AddToCreativeTab.tabMachines); - this.int_Charge = constructor_Charge; - this.int_Max_Charge = constructor_Max_Charge; - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Override - public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { - int NBT_Charge = this.int_Charge; - int NBT_Max_Charge = this.int_Max_Charge; - if (stack.stackTagCompound != null) { - NBT_Charge = stack.stackTagCompound.getInteger("charge_Current"); - NBT_Max_Charge = stack.stackTagCompound.getInteger("charge_Max"); - final String tempX = String.valueOf(NBT_Charge); - final String tempY = String.valueOf(NBT_Max_Charge); - final String formattedX = EnumChatFormatting.RED + tempX + EnumChatFormatting.GRAY; - final String formattedY = EnumChatFormatting.DARK_RED + tempY + EnumChatFormatting.GRAY; - list.add(EnumChatFormatting.GRAY + "Charge:" + formattedX + "/" + formattedY + "."); - super.addInformation(stack, aPlayer, list, bool); - } - } - - // Ticking and NBT Handling - /* - * Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and - * update it's contents. public int fuelRemaining = 0; public int maximumFuel = 0; public String fuelType = ""; - * public float heat = 0; public float maxHeat = 5000; - */ - @Override - public void onCreated(final ItemStack itemStack, final World world, final EntityPlayer player) {} - - @Override - public void onUpdate(final ItemStack itemStack, final World par2World, final Entity par3Entity, final int par4, - final boolean par5) {} - - @Override - public ItemStack onItemRightClick(final ItemStack itemStack, final World world, final EntityPlayer par3Entity) { - itemStack.stackTagCompound = new NBTTagCompound(); - return super.onItemRightClick(itemStack, world, par3Entity); - } -} diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/OilChem.java b/src/main/java/gtPlusPlus/core/item/chemistry/OilChem.java deleted file mode 100644 index b3c0842327..0000000000 --- a/src/main/java/gtPlusPlus/core/item/chemistry/OilChem.java +++ /dev/null @@ -1,35 +0,0 @@ -package gtPlusPlus.core.item.chemistry; - -import gtPlusPlus.api.objects.minecraft.ItemPackage; - -public class OilChem extends ItemPackage { - - /** - * Fluids - */ - - /** - * Items - */ - @Override - public void items() {} - - @Override - public void blocks() { - // None yet - } - - @Override - public void fluids() {} - - @Override - public String errorMessage() { - return "Failed to generate recipes for OilChem."; - } - - @Override - public boolean generateRecipes() { - - return true; - } -} diff --git a/src/main/java/gtPlusPlus/core/item/effects/RarityEffect.java b/src/main/java/gtPlusPlus/core/item/effects/RarityEffect.java deleted file mode 100644 index ac51c20a18..0000000000 --- a/src/main/java/gtPlusPlus/core/item/effects/RarityEffect.java +++ /dev/null @@ -1,37 +0,0 @@ -package gtPlusPlus.core.item.effects; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/* - * This determines the name colour. EnumRarity can be: EnumRarity.common - the standard white colour. - * EnumRarity.uncommon - a yellow colour. EnumRarity.rare - a light blue colour. This is used for enchanted items. - * EnumRarity.epic - the purple colour used on the Golden Apple. - * @SideOnly is an FML annotation. It marks the method below it for existing only on one side. Possible values are: - * Side.CLIENT is probably the most common one. This marks the method as existing only on the client side. Side.SERVER - * marks the method as existing only on the server side. - */ - -public class RarityEffect extends Item { - - public RarityEffect(final int par1) { - super(); - this.setCreativeTab(CreativeTabs.tabMaterials); - } - - @Override - @SideOnly(Side.CLIENT) - public EnumRarity getRarity(final ItemStack par1ItemStack) { - return EnumRarity.common; - } - - @Override - public boolean hasEffect(final ItemStack par1ItemStack) { - return true; - } -} diff --git a/src/main/java/gtPlusPlus/core/item/effects/RarityEpic.java b/src/main/java/gtPlusPlus/core/item/effects/RarityEpic.java deleted file mode 100644 index a8081615d7..0000000000 --- a/src/main/java/gtPlusPlus/core/item/effects/RarityEpic.java +++ /dev/null @@ -1,28 +0,0 @@ -package gtPlusPlus.core.item.effects; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RarityEpic extends Item { - - public RarityEpic(final int par1) { - super(); - this.setCreativeTab(CreativeTabs.tabMaterials); - } - - @Override - @SideOnly(Side.CLIENT) - public EnumRarity getRarity(final ItemStack par1ItemStack) { - return EnumRarity.epic; - } - - @Override - public boolean hasEffect(final ItemStack par1ItemStack) { - return true; - } -} diff --git a/src/main/java/gtPlusPlus/core/item/effects/RarityRare.java b/src/main/java/gtPlusPlus/core/item/effects/RarityRare.java deleted file mode 100644 index e448cfafe7..0000000000 --- a/src/main/java/gtPlusPlus/core/item/effects/RarityRare.java +++ /dev/null @@ -1,28 +0,0 @@ -package gtPlusPlus.core.item.effects; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RarityRare extends Item { - - public RarityRare() { - super(); - this.setCreativeTab(CreativeTabs.tabMaterials); - } - - @Override - @SideOnly(Side.CLIENT) - public EnumRarity getRarity(final ItemStack par1ItemStack) { - return EnumRarity.rare; - } - - @Override - public boolean hasEffect(final ItemStack par1ItemStack) { - return true; - } -} diff --git a/src/main/java/gtPlusPlus/core/item/effects/RarityUncommon.java b/src/main/java/gtPlusPlus/core/item/effects/RarityUncommon.java deleted file mode 100644 index 89764a718f..0000000000 --- a/src/main/java/gtPlusPlus/core/item/effects/RarityUncommon.java +++ /dev/null @@ -1,22 +0,0 @@ -package gtPlusPlus.core.item.effects; - -import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RarityUncommon extends Item { - - @Override - @SideOnly(Side.CLIENT) - public EnumRarity getRarity(final ItemStack par1ItemStack) { - return EnumRarity.uncommon; - } - - @Override - public boolean hasEffect(final ItemStack par1ItemStack) { - return true; - } -} diff --git a/src/main/java/gtPlusPlus/core/item/general/BedLocator_Base.java b/src/main/java/gtPlusPlus/core/item/general/BedLocator_Base.java deleted file mode 100644 index 099347eb76..0000000000 --- a/src/main/java/gtPlusPlus/core/item/general/BedLocator_Base.java +++ /dev/null @@ -1,95 +0,0 @@ -package gtPlusPlus.core.item.general; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; - -import gtPlusPlus.core.creative.AddToCreativeTab; - -public class BedLocator_Base extends Item { - - public int bed_X = 0; - public int bed_Y = 0; - public int bed_Z = 0; - - public BedLocator_Base(final String unlocalizedName) { - this.setUnlocalizedName(unlocalizedName); - this.setTextureName(GTPlusPlus.ID + ":" + unlocalizedName); - this.setMaxStackSize(1); - this.setCreativeTab(AddToCreativeTab.tabMachines); - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { - - int NBT_X = this.bed_X; - int NBT_Y = this.bed_Y; - int NBT_Z = this.bed_Z; - - if (stack.stackTagCompound != null) { - NBT_X = stack.stackTagCompound.getInteger("pos_x"); - NBT_Y = stack.stackTagCompound.getInteger("pos_y"); - NBT_Z = stack.stackTagCompound.getInteger("pos_z"); - - final String tempX = String.valueOf(NBT_X); - final String tempY = String.valueOf(NBT_Y); - final String tempZ = String.valueOf(NBT_Z); - final String formattedX = EnumChatFormatting.DARK_RED + tempX + EnumChatFormatting.GRAY; - final String formattedY = EnumChatFormatting.RED + tempY + EnumChatFormatting.GRAY; - final String formattedZ = EnumChatFormatting.RED + tempZ + EnumChatFormatting.GRAY; - - list.add(EnumChatFormatting.GRAY + "X: " + formattedX + "."); - list.add(EnumChatFormatting.GRAY + "Y: " + formattedY + "."); - list.add(EnumChatFormatting.GRAY + "Z: " + formattedZ + "."); - super.addInformation(stack, aPlayer, list, bool); - } - } - - // Ticking and NBT Handling - /* - * Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and - * update it's contents. public int fuelRemaining = 0; public int maximumFuel = 0; public String fuelType = ""; - * public float heat = 0; public float maxHeat = 5000; - */ - @Override - public void onCreated(final ItemStack itemStack, final World world, final EntityPlayer player) { - itemStack.stackTagCompound = new NBTTagCompound(); - this.bed_X = 0; - this.bed_Y = 0; - this.bed_Z = 0; - itemStack.stackTagCompound.setInteger("pos_x", this.bed_X); - itemStack.stackTagCompound.setInteger("pos_y", this.bed_Y); - itemStack.stackTagCompound.setInteger("pos_z", this.bed_Z); - } - - @Override - public void onUpdate(final ItemStack itemStack, final World par2World, final Entity par3Entity, final int par4, - final boolean par5) {} - - @Override - public ItemStack onItemRightClick(final ItemStack itemStack, final World world, final EntityPlayer par3Entity) { - itemStack.stackTagCompound = new NBTTagCompound(); - if (par3Entity.getBedLocation() != null) { - this.bed_X = par3Entity.getBedLocation().posX; - this.bed_Y = par3Entity.getBedLocation().posY; - this.bed_Z = par3Entity.getBedLocation().posZ; - } else { - this.bed_X = 0; - this.bed_Y = 0; - this.bed_Z = 0; - } - itemStack.stackTagCompound.setInteger("pos_x", this.bed_X); - itemStack.stackTagCompound.setInteger("pos_y", this.bed_Y); - itemStack.stackTagCompound.setInteger("pos_z", this.bed_Z); - return super.onItemRightClick(itemStack, world, par3Entity); - } -} diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemCreativeTab.java b/src/main/java/gtPlusPlus/core/item/general/ItemCreativeTab.java deleted file mode 100644 index 6decd29b06..0000000000 --- a/src/main/java/gtPlusPlus/core/item/general/ItemCreativeTab.java +++ /dev/null @@ -1,60 +0,0 @@ -package gtPlusPlus.core.item.general; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; - -import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.GregTech_API; - -public class ItemCreativeTab extends Item { - - public IIcon[] icons = new IIcon[10]; - - public ItemCreativeTab() { - super(); - this.setHasSubtypes(true); - String unlocalizedName = "itemCreativeTabs"; - this.setUnlocalizedName(unlocalizedName); - this.setCreativeTab(GregTech_API.TAB_GREGTECH); - GameRegistry.registerItem(this, unlocalizedName); - } - - @Override - public void registerIcons(IIconRegister reg) { - this.icons[0] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_0"); - this.icons[1] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_1"); - this.icons[2] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_2"); - this.icons[3] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_3"); - this.icons[4] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_4"); - this.icons[5] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_5"); - this.icons[6] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_6"); - this.icons[7] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_7"); - this.icons[8] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_8"); - this.icons[9] = reg.registerIcon(GTPlusPlus.ID + ":" + "controlcore/Core_9"); - } - - @Override - public IIcon getIconFromDamage(int meta) { - return this.icons[meta]; - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { - for (int i = 0; i < 10; i++) { - list.add(new ItemStack(item, 1, i)); - } - } - - @Override - public String getUnlocalizedName(ItemStack stack) { - return this.getUnlocalizedName() + "_" + stack.getItemDamage(); - } -} diff --git a/src/main/java/gtPlusPlus/core/item/general/NuclearFuelRodBase.java b/src/main/java/gtPlusPlus/core/item/general/NuclearFuelRodBase.java deleted file mode 100644 index 92a5fafe20..0000000000 --- a/src/main/java/gtPlusPlus/core/item/general/NuclearFuelRodBase.java +++ /dev/null @@ -1,188 +0,0 @@ -package gtPlusPlus.core.item.general; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.player.FillBucketEvent; - -import cpw.mods.fml.common.eventhandler.Event; - -public class NuclearFuelRodBase extends Item { - - /** field for checking if the bucket has been filled. */ - private final Block isFull; - - public NuclearFuelRodBase(final Block p_i45331_1_) { - this.maxStackSize = 1; - this.isFull = p_i45331_1_; - this.setCreativeTab(CreativeTabs.tabMisc); - } - - /** - * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer - */ - @Override - public ItemStack onItemRightClick(final ItemStack p_77659_1_, final World p_77659_2_, - final EntityPlayer p_77659_3_) { - final boolean flag = this.isFull == Blocks.air; - final MovingObjectPosition movingobjectposition = this - .getMovingObjectPositionFromPlayer(p_77659_2_, p_77659_3_, flag); - - if (movingobjectposition == null) { - return p_77659_1_; - } - final FillBucketEvent event = new FillBucketEvent(p_77659_3_, p_77659_1_, p_77659_2_, movingobjectposition); - if (MinecraftForge.EVENT_BUS.post(event)) { - return p_77659_1_; - } - - if (event.getResult() == Event.Result.ALLOW) { - if (p_77659_3_.capabilities.isCreativeMode) { - return p_77659_1_; - } - - if (--p_77659_1_.stackSize <= 0) { - return event.result; - } - |
