Skip to content

Commit

Permalink
use mantle's craftingItem
Browse files Browse the repository at this point in the history
  • Loading branch information
progwml6 committed Dec 19, 2013
1 parent 51e0833 commit 4822020
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 90 deletions.
37 changes: 25 additions & 12 deletions src/main/java/tconstruct/common/TContent.java
@@ -1,15 +1,17 @@
package tconstruct.common;

import mantle.items.abstracts.CraftingItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import tconstruct.library.armor.EnumArmorPart;
import tconstruct.library.crafting.ToolBuilder;

import cpw.mods.fml.common.*;
import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.registry.*;

import java.lang.reflect.Field;
import java.util.*;

import net.minecraft.block.*;
import net.minecraft.block.material.*;
import net.minecraft.creativetab.CreativeTabs;
Expand Down Expand Up @@ -370,8 +372,13 @@ void registerBlocks ()
TRepo.pigIronFluid = FluidRegistry.getFluid("pigiron.molten");
else
TRepo.pigIronFluid.setDensity(3000).setViscosity(6000).setTemperature(1300);
TRepo.fluids = new Fluid[]{TRepo.moltenIronFluid, TRepo.moltenGoldFluid, TRepo.moltenCopperFluid, TRepo.moltenTinFluid, TRepo.moltenAluminumFluid, TRepo.moltenCobaltFluid, TRepo.moltenArditeFluid, TRepo.moltenBronzeFluid, TRepo.moltenAlubrassFluid, TRepo.moltenManyullynFluid, TRepo.moltenAlumiteFluid, TRepo.moltenObsidianFluid, TRepo.moltenSteelFluid, TRepo.moltenGlassFluid, TRepo.moltenStoneFluid, TRepo.moltenEmeraldFluid, TRepo.bloodFluid, TRepo.moltenNickelFluid, TRepo.moltenLeadFluid, TRepo.moltenSilverFluid, TRepo.moltenShinyFluid, TRepo.moltenInvarFluid, TRepo.moltenElectrumFluid, TRepo.moltenEnderFluid, TRepo.blueSlimeFluid, TRepo.glueFluid, TRepo.pigIronFluid};
TRepo.fluidBlocks = new Block[]{TRepo.moltenIron, TRepo.moltenGold, TRepo.moltenCopper, TRepo.moltenTin, TRepo.moltenAluminum, TRepo.moltenCobalt, TRepo.moltenArdite, TRepo.moltenBronze, TRepo.moltenAlubrass, TRepo.moltenManyullyn, TRepo.moltenAlumite, TRepo.moltenObsidian, TRepo.moltenSteel, TRepo.moltenGlass, TRepo.moltenStone, TRepo.moltenEmerald, TRepo.blood, TRepo.moltenNickel, TRepo.moltenLead, TRepo.moltenSilver, TRepo.moltenShiny, TRepo.moltenInvar, TRepo.moltenElectrum, TRepo.moltenEnder, TRepo.slimePool, TRepo.glueFluidBlock};
TRepo.fluids = new Fluid[] { TRepo.moltenIronFluid, TRepo.moltenGoldFluid, TRepo.moltenCopperFluid, TRepo.moltenTinFluid, TRepo.moltenAluminumFluid, TRepo.moltenCobaltFluid,
TRepo.moltenArditeFluid, TRepo.moltenBronzeFluid, TRepo.moltenAlubrassFluid, TRepo.moltenManyullynFluid, TRepo.moltenAlumiteFluid, TRepo.moltenObsidianFluid, TRepo.moltenSteelFluid,
TRepo.moltenGlassFluid, TRepo.moltenStoneFluid, TRepo.moltenEmeraldFluid, TRepo.bloodFluid, TRepo.moltenNickelFluid, TRepo.moltenLeadFluid, TRepo.moltenSilverFluid,
TRepo.moltenShinyFluid, TRepo.moltenInvarFluid, TRepo.moltenElectrumFluid, TRepo.moltenEnderFluid, TRepo.blueSlimeFluid, TRepo.glueFluid, TRepo.pigIronFluid };
TRepo.fluidBlocks = new Block[] { TRepo.moltenIron, TRepo.moltenGold, TRepo.moltenCopper, TRepo.moltenTin, TRepo.moltenAluminum, TRepo.moltenCobalt, TRepo.moltenArdite, TRepo.moltenBronze,
TRepo.moltenAlubrass, TRepo.moltenManyullyn, TRepo.moltenAlumite, TRepo.moltenObsidian, TRepo.moltenSteel, TRepo.moltenGlass, TRepo.moltenStone, TRepo.moltenEmerald, TRepo.blood,
TRepo.moltenNickel, TRepo.moltenLead, TRepo.moltenSilver, TRepo.moltenShiny, TRepo.moltenInvar, TRepo.moltenElectrum, TRepo.moltenEnder, TRepo.slimePool, TRepo.glueFluidBlock };
//Slime Islands
TRepo.slimeGel = new SlimeGel(PHConstruct.slimeGel).setStepSound(TRepo.slimeStep).setLightOpacity(0).setUnlocalizedName("slime.gel");
TRepo.slimeGrass = new SlimeGrass(PHConstruct.slimeGrass).setStepSound(Block.soundGrassFootstep).setLightOpacity(0).setUnlocalizedName("slime.grass");
Expand All @@ -381,7 +388,6 @@ void registerBlocks ()
TRepo.slimeChannel = new ConveyorBase(PHConstruct.slimeChannel, Material.water, "greencurrent").setHardness(0.3f).setStepSound(TRepo.slimeStep).setUnlocalizedName("slime.channel");
TRepo.bloodChannel = new ConveyorBase(PHConstruct.bloodChannel, Material.water, "liquid_cow").setHardness(0.3f).setStepSound(TRepo.slimeStep).setUnlocalizedName("blood.channel");
TRepo.slimePad = new SlimePad(PHConstruct.slimePad, Material.cloth).setStepSound(TRepo.slimeStep).setHardness(0.3f).setUnlocalizedName("slime.pad");


//Decoration
TRepo.stoneTorch = new StoneTorch(PHConstruct.stoneTorch).setUnlocalizedName("decoration.stonetorch");
Expand Down Expand Up @@ -433,7 +439,7 @@ void registerItems ()
TRepo.titleIcon = new TitleIcon(PHConstruct.uselessItem).setUnlocalizedName("tconstruct.titleicon");
GameRegistry.registerItem(TRepo.titleIcon, "titleIcon");
String[] blanks = new String[] { "blank_pattern", "blank_cast", "blank_cast" };
TRepo.blankPattern = new CraftingItem(PHConstruct.blankPattern, blanks, blanks, "materials/").setUnlocalizedName("tconstruct.Pattern");
TRepo.blankPattern = new CraftingItem(PHConstruct.blankPattern, blanks, blanks, "materials/", "tinker", TConstructRegistry.materialTab).setUnlocalizedName("tconstruct.Pattern");
GameRegistry.registerItem(TRepo.blankPattern, "blankPattern");

TRepo.materials = new MaterialItem(PHConstruct.materials).setUnlocalizedName("tconstruct.Materials");
Expand Down Expand Up @@ -830,13 +836,20 @@ public void addAchievements ()

achievements.put("tconstruct.beginner", new Achievement(2741, "tconstruct.beginner", 0, 0, TRepo.manualBook, null).setIndependent().registerAchievement());
achievements.put("tconstruct.pattern", new Achievement(2742, "tconstruct.pattern", 2, 1, TRepo.blankPattern, achievements.get("tconstruct.beginner")).registerAchievement());
achievements.put("tconstruct.tinkerer", new Achievement(2743, "tconstruct.tinkerer", 2, 2, new ItemStack(TRepo.titleIcon, 1, 4096), achievements.get("tconstruct.pattern")).registerAchievement());
achievements.put("tconstruct.preparedFight", new Achievement(2744, "tconstruct.preparedFight", 1, 3, new ItemStack(TRepo.titleIcon, 1, 4097), achievements.get("tconstruct.tinkerer")).registerAchievement());
achievements.put("tconstruct.proTinkerer", new Achievement(2745, "tconstruct.proTinkerer", 4, 4, new ItemStack(TRepo.titleIcon, 1, 4098), achievements.get("tconstruct.tinkerer")).setSpecial().registerAchievement());
achievements.put("tconstruct.tinkerer",
new Achievement(2743, "tconstruct.tinkerer", 2, 2, new ItemStack(TRepo.titleIcon, 1, 4096), achievements.get("tconstruct.pattern")).registerAchievement());
achievements.put("tconstruct.preparedFight",
new Achievement(2744, "tconstruct.preparedFight", 1, 3, new ItemStack(TRepo.titleIcon, 1, 4097), achievements.get("tconstruct.tinkerer")).registerAchievement());
achievements.put("tconstruct.proTinkerer", new Achievement(2745, "tconstruct.proTinkerer", 4, 4, new ItemStack(TRepo.titleIcon, 1, 4098), achievements.get("tconstruct.tinkerer")).setSpecial()
.registerAchievement());
achievements.put("tconstruct.smelteryMaker", new Achievement(2746, "tconstruct.smelteryMaker", -2, -1, TRepo.smeltery, achievements.get("tconstruct.beginner")).registerAchievement());
achievements.put("tconstruct.enemySlayer", new Achievement(2747, "tconstruct.enemySlayer", 0, 5, new ItemStack(TRepo.titleIcon, 1, 4099), achievements.get("tconstruct.preparedFight")).registerAchievement());
achievements.put("tconstruct.dualConvenience", new Achievement(2748, "tconstruct.dualConvenience", 0, 7, new ItemStack(TRepo.titleIcon, 1, 4100), achievements.get("tconstruct.enemySlayer")).setSpecial().registerAchievement());
achievements.put("tconstruct.doingItWrong", new Achievement(2749, "tconstruct.doingItWrong", -2, -3, new ItemStack(TRepo.manualBook, 1, 2), achievements.get("tconstruct.smelteryMaker")).registerAchievement());
achievements.put("tconstruct.betterCrafting", new Achievement(2750, "tconstruct.betterCrafting", -2, 2, TRepo.craftingStationWood, achievements.get("tconstruct.beginner")).registerAchievement());
achievements.put("tconstruct.enemySlayer",
new Achievement(2747, "tconstruct.enemySlayer", 0, 5, new ItemStack(TRepo.titleIcon, 1, 4099), achievements.get("tconstruct.preparedFight")).registerAchievement());
achievements.put("tconstruct.dualConvenience", new Achievement(2748, "tconstruct.dualConvenience", 0, 7, new ItemStack(TRepo.titleIcon, 1, 4100), achievements.get("tconstruct.enemySlayer"))
.setSpecial().registerAchievement());
achievements.put("tconstruct.doingItWrong",
new Achievement(2749, "tconstruct.doingItWrong", -2, -3, new ItemStack(TRepo.manualBook, 1, 2), achievements.get("tconstruct.smelteryMaker")).registerAchievement());
achievements.put("tconstruct.betterCrafting",
new Achievement(2750, "tconstruct.betterCrafting", -2, 2, TRepo.craftingStationWood, achievements.get("tconstruct.beginner")).registerAchievement());
}
}
6 changes: 3 additions & 3 deletions src/main/java/tconstruct/items/ArmorPattern.java
Expand Up @@ -3,9 +3,9 @@
import java.util.List;

import cpw.mods.fml.relauncher.*;

import tconstruct.library.ItemBlocklike;

import tconstruct.library.TConstructRegistry;
import mantle.items.abstracts.CraftingItem;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
Expand All @@ -18,7 +18,7 @@ public class ArmorPattern extends CraftingItem implements ItemBlocklike

public ArmorPattern(int id, String patternType, String folder)
{
super(id, patternName, getPatternNames(patternType), folder);
super(id, patternName, getPatternNames(patternType), folder, "tinker", TConstructRegistry.materialTab);
this.setHasSubtypes(true);
this.setMaxDamage(0);
this.setContainerItem(this);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/tconstruct/items/Bowstring.java
Expand Up @@ -3,18 +3,18 @@
import java.util.List;

import cpw.mods.fml.common.Loader;
import tconstruct.common.TContent;
import tconstruct.common.TRepo;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.util.IToolPart;
import mantle.items.abstracts.CraftingItem;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;

public class Bowstring extends CraftingItem implements IToolPart
{
public Bowstring(int id)
{
super(id, toolMaterialNames, buildTextureNames("_bowstring"), "parts/");
super(id, toolMaterialNames, buildTextureNames("_bowstring"), "parts/", "tinker", TConstructRegistry.materialTab);
this.setHasSubtypes(true);
this.setMaxDamage(0);
}
Expand Down
38 changes: 0 additions & 38 deletions src/main/java/tconstruct/items/CraftingItem.java

This file was deleted.

4 changes: 3 additions & 1 deletion src/main/java/tconstruct/items/Fletching.java
@@ -1,13 +1,15 @@
package tconstruct.items;

import tconstruct.library.TConstructRegistry;
import tconstruct.library.util.IToolPart;
import mantle.items.abstracts.CraftingItem;
import net.minecraft.item.ItemStack;

public class Fletching extends CraftingItem implements IToolPart
{
public Fletching(int id)
{
super(id, toolMaterialNames, buildTextureNames("_fletching"), "parts/");
super(id, toolMaterialNames, buildTextureNames("_fletching"), "parts/", "tinker", TConstructRegistry.materialTab);
this.setHasSubtypes(true);
this.setMaxDamage(0);
}
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/tconstruct/items/Manual.java
@@ -1,11 +1,12 @@
package tconstruct.items;

import tconstruct.achievements.TAchievements;
import tconstruct.library.TConstructRegistry;

import java.util.List;

import tconstruct.TConstruct;

import mantle.items.abstracts.CraftingItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
Expand All @@ -20,14 +21,14 @@ public class Manual extends CraftingItem

public Manual(int id)
{
super(id, name, textureName, "");
super(id, name, textureName, "", "tinker", TConstructRegistry.materialTab);
setUnlocalizedName("tconstruct.manual");
}

@Override
public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player)
{
player.addStat(TAchievements.achievements.get("tconstruct.beginner"), 1);
player.addStat(TAchievements.achievements.get("tconstruct.beginner"), 1);
player.openGui(TConstruct.instance, mantle.client.MProxyClient.manualGuiID, world, 0, 0, 0);
/*Side side = FMLCommonHandler.instance().getEffectiveSide();
if (side.isClient())
Expand All @@ -41,13 +42,13 @@ public void addInformation (ItemStack stack, EntityPlayer player, List list, boo
switch (stack.getItemDamage())
{
case 0:
list.add("\u00a7o"+StatCollector.translateToLocal("manual1.tooltip"));
list.add("\u00a7o" + StatCollector.translateToLocal("manual1.tooltip"));
break;
case 1:
list.add("\u00a7o"+StatCollector.translateToLocal("manual2.tooltip"));
list.add("\u00a7o" + StatCollector.translateToLocal("manual2.tooltip"));
break;
case 2:
list.add("\u00a7o"+StatCollector.translateToLocal("manual3.tooltip"));
list.add("\u00a7o" + StatCollector.translateToLocal("manual3.tooltip"));
break;
}
}
Expand Down
12 changes: 7 additions & 5 deletions src/main/java/tconstruct/items/MaterialItem.java
@@ -1,11 +1,14 @@
package tconstruct.items;

import tconstruct.library.TConstructRegistry;
import mantle.items.abstracts.CraftingItem;

public class MaterialItem extends CraftingItem
{

public MaterialItem(int id)
{
super(id, materialNames, getTextures(), "materials/");
super(id, materialNames, getTextures(), "materials/", "tinker", TConstructRegistry.materialTab);
}

private static String[] getTextures ()
Expand All @@ -21,11 +24,10 @@ private static String[] getTextures ()
return names;
}


static String[] materialNames = new String[] { "PaperStack", "SlimeCrystal", "SearedBrick", "CobaltIngot", "ArditeIngot", "ManyullynIngot", "Mossball", "LavaCrystal", "NecroticBone",
"CopperIngot", "TinIngot", "AluminumIngot", "RawAluminum", "BronzeIngot", "AluBrassIngot", "AlumiteIngot", "SteelIngot", "BlueSlimeCrystal", "ObsidianIngot", "IronNugget", "CopperNugget", "TinNugget",
"AluminumNugget", "EssenceCrystal", "AluBrassNugget", "SilkyCloth", "SilkyJewel", "ObsidianNugget", "CobaltNugget", "ArditeNugget", "ManyullynNugget", "BronzeNugget", "AlumiteNugget",
"SteelNugget", "PigIronIngot", "PigIronNugget", "GlueBall", "SearedBrick" };
"CopperIngot", "TinIngot", "AluminumIngot", "RawAluminum", "BronzeIngot", "AluBrassIngot", "AlumiteIngot", "SteelIngot", "BlueSlimeCrystal", "ObsidianIngot", "IronNugget", "CopperNugget",
"TinNugget", "AluminumNugget", "EssenceCrystal", "AluBrassNugget", "SilkyCloth", "SilkyJewel", "ObsidianNugget", "CobaltNugget", "ArditeNugget", "ManyullynNugget", "BronzeNugget",
"AlumiteNugget", "SteelNugget", "PigIronIngot", "PigIronNugget", "GlueBall", "SearedBrick" };

static String[] craftingTextures = new String[] { "paperstack", "slimecrystal", "searedbrick", "cobaltingot", "arditeingot", "manyullyningot", "mossball", "lavacrystal", "necroticbone",
"copperingot", "tiningot", "aluminumingot", "aluminumraw", "bronzeingot", "alubrassingot", "alumiteingot", "steelingot", "blueslimecrystal", "obsidianingot", "nugget_iron",
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/tconstruct/items/OreBerries.java
Expand Up @@ -2,6 +2,8 @@

import java.util.List;

import tconstruct.library.TConstructRegistry;
import mantle.items.abstracts.CraftingItem;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityXPOrb;
import net.minecraft.entity.player.EntityPlayer;
Expand All @@ -18,7 +20,7 @@ public class OreBerries extends CraftingItem

public OreBerries(int id)
{
super(id, names, tex, "oreberries/");
super(id, names, tex, "oreberries/", "tinker", TConstructRegistry.materialTab);
}

@Override
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/tconstruct/items/Pattern.java
@@ -1,7 +1,10 @@
package tconstruct.items;

import cpw.mods.fml.relauncher.*;

import java.util.List;

import mantle.items.abstracts.CraftingItem;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
Expand All @@ -16,10 +19,10 @@ public Pattern(int id, String patternType, String folder)
{
this(id, patternName, getPatternNames(patternType), folder);
}

public Pattern(int id, String[] names, String[] patternTypes, String folder)
{
super(id, names, patternTypes, folder);
super(id, names, patternTypes, folder, "tinker", TConstructRegistry.materialTab);
this.setHasSubtypes(true);
this.setMaxDamage(0);
this.setContainerItem(this);
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/tconstruct/items/ToolPart.java
Expand Up @@ -2,11 +2,13 @@

import java.util.List;

import mantle.items.abstracts.CraftingItem;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import tconstruct.common.TContent;
import tconstruct.common.TRepo;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.util.IToolPart;

public class ToolPart extends CraftingItem implements IToolPart
Expand All @@ -15,7 +17,7 @@ public class ToolPart extends CraftingItem implements IToolPart

public ToolPart(int id, String textureType, String name)
{
super(id, toolMaterialNames, buildTextureNames(textureType), "parts/");
super(id, toolMaterialNames, buildTextureNames(textureType), "parts/", "tinker", TConstructRegistry.materialTab);
this.setHasSubtypes(true);
this.setMaxDamage(0);
this.partName = name;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/tconstruct/items/armor/HeartCanister.java
Expand Up @@ -3,10 +3,10 @@
import java.util.List;

import tconstruct.TConstruct;
import tconstruct.items.CraftingItem;
import tconstruct.library.TConstructRegistry;
import tconstruct.util.player.ArmorExtended;
import tconstruct.util.player.TPlayerStats;

import mantle.items.abstracts.CraftingItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
Expand All @@ -19,7 +19,7 @@ public class HeartCanister extends CraftingItem

public HeartCanister(int id)
{
super(id, new String[] { "empty", "miniheart.red", "heart" }, new String[] { "canister_empty", "miniheart_red", "canister_heart" }, "");
super(id, new String[] { "empty", "miniheart.red", "heart" }, new String[] { "canister_empty", "miniheart_red", "canister_heart" }, "", "tinker", TConstructRegistry.materialTab );
this.setMaxStackSize(10);
}

Expand Down

0 comments on commit 4822020

Please sign in to comment.