mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 03:49:29 +00:00
Reorganize folders for modules
This commit is contained in:
1 parent
2c14f315de
commit
e2f0558b6f
370 files changed
+4274
-4788
No files matched your search
@@ -1,62 +0,0 @@
|
||||
package tconstruct.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.items.abstracts.CraftingItem;
|
||||
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 tconstruct.library.ItemBlocklike;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ArmorPattern extends CraftingItem implements ItemBlocklike
|
||||
{
|
||||
|
||||
private IIcon baseIcon;
|
||||
|
||||
public ArmorPattern(int id, String patternType, String folder)
|
||||
{
|
||||
super(patternName, getPatternNames(patternType), folder, "tinker", TConstructRegistry.materialTab);
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxDamage(0);
|
||||
this.setContainerItem(this);
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
protected static String[] getPatternNames (String partType)
|
||||
{
|
||||
String[] names = new String[patternName.length];
|
||||
for (int i = 0; i < patternName.length; i++)
|
||||
names[i] = partType + patternName[i];
|
||||
return names;
|
||||
}
|
||||
|
||||
public IIcon getBaseIcon ()
|
||||
{
|
||||
return baseIcon;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons (IIconRegister iconRegister)
|
||||
{
|
||||
super.registerIcons(iconRegister);
|
||||
baseIcon = iconRegister.registerIcon("tinker:" + folder + "armor_cast");
|
||||
}
|
||||
|
||||
private static final String[] patternName = new String[] { "helmet", "chestplate", "leggings", "boots" };
|
||||
|
||||
@Override
|
||||
public void getSubItems (Item block, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int i = 0; i < patternName.length; i++)
|
||||
{
|
||||
list.add(new ItemStack(block, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
package tconstruct.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.items.abstracts.CraftingItem;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.util.IToolPart;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
|
||||
public class Bowstring extends CraftingItem implements IToolPart
|
||||
{
|
||||
public Bowstring()
|
||||
{
|
||||
super(toolMaterialNames, buildTextureNames("_bowstring"), "parts/", "tinker", TConstructRegistry.materialTab);
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxDamage(0);
|
||||
}
|
||||
|
||||
private static String[] buildTextureNames (String textureType)
|
||||
{
|
||||
String[] names = new String[toolMaterialNames.length];
|
||||
for (int i = 0; i < toolMaterialNames.length; i++)
|
||||
{
|
||||
if (toolTextureNames[i].equals(""))
|
||||
names[i] = "";
|
||||
else
|
||||
names[i] = toolTextureNames[i] + textureType;
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
public static final String[] toolMaterialNames = new String[] { "string", "enchantedfabric", "flamestring" };
|
||||
|
||||
public static final String[] toolTextureNames = new String[] { "string", "magicfabric", "flamestring" };
|
||||
|
||||
@Override
|
||||
public int getMaterialID (ItemStack stack)
|
||||
{
|
||||
return stack.getItemDamage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems (Item b, CreativeTabs tab, List list)
|
||||
{
|
||||
list.add(new ItemStack(b, 1, 0));
|
||||
if (TRepo.thaumcraftAvailable)
|
||||
list.add(new ItemStack(b, 1, 1));
|
||||
if (Loader.isModLoaded("Natura"))
|
||||
list.add(new ItemStack(b, 1, 2));
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
package tconstruct.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
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 tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.ToolBuilder;
|
||||
import tconstruct.library.crafting.ToolRecipe;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class CreativeModifier extends Item
|
||||
{
|
||||
|
||||
public CreativeModifier()
|
||||
{
|
||||
super();
|
||||
this.setCreativeTab(TConstructRegistry.materialTab);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
/**
|
||||
* returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
|
||||
*/
|
||||
@Override
|
||||
public void getSubItems (Item par1, CreativeTabs par2CreativeTabs, List par3List)
|
||||
{
|
||||
par3List.add(new ItemStack(par1, 1, 0));
|
||||
|
||||
for (ToolRecipe recipe : ToolBuilder.instance.combos)
|
||||
{
|
||||
ToolCore tool = recipe.getType();
|
||||
ItemStack item = new ItemStack(par1, 1, 0);
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setString("TargetLock", tool.getToolName());
|
||||
|
||||
item.setTagCompound(compound);
|
||||
par3List.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons (IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("tinker:skull_char_gold");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
if (stack.hasTagCompound())
|
||||
{
|
||||
String targetLock = "None";
|
||||
targetLock = stack.getTagCompound().getString("TargetLock");
|
||||
list.add(StatCollector.translateToLocal("creativeModLock.tooltip") + targetLock);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
package tconstruct.items;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class DiamondApple extends ItemFood
|
||||
{
|
||||
public IIcon[] icons;
|
||||
public String[] textureNames = new String[] { "food/apple_diamond" };
|
||||
public String[] itemNames = new String[] { "apple.diamond" };
|
||||
|
||||
public DiamondApple()
|
||||
{
|
||||
super(4, 2.0F, false);
|
||||
setHasSubtypes(true);
|
||||
setMaxDamage(0);
|
||||
this.setAlwaysEdible();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFoodEaten (ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
int duration = 0;
|
||||
PotionEffect potion;
|
||||
|
||||
potion = player.getActivePotionEffect(Potion.resistance);
|
||||
if (potion != null)
|
||||
duration = potion.getDuration();
|
||||
player.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, duration + 60 * 40, 4));
|
||||
|
||||
potion = player.getActivePotionEffect(Potion.resistance);
|
||||
if (potion != null)
|
||||
duration = potion.getDuration();
|
||||
player.addPotionEffect(new PotionEffect(Potion.resistance.id, duration + 60 * 20, 0));
|
||||
|
||||
potion = player.getActivePotionEffect(Potion.digSpeed);
|
||||
if (potion != null)
|
||||
duration = potion.getDuration();
|
||||
player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, duration + 60 * 20, 0));
|
||||
|
||||
potion = player.getActivePotionEffect(Potion.damageBoost);
|
||||
if (potion != null)
|
||||
duration = potion.getDuration();
|
||||
player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, duration + 60 * 20, 0));
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public IIcon getIconFromDamage (int meta)
|
||||
{
|
||||
return icons[meta];
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons (IIconRegister iconRegister)
|
||||
{
|
||||
this.icons = new IIcon[textureNames.length];
|
||||
|
||||
for (int i = 0; i < this.icons.length; ++i)
|
||||
{
|
||||
this.icons[i] = iconRegister.registerIcon("tinker:" + textureNames[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/* Name override */
|
||||
@Override
|
||||
public String getUnlocalizedName (ItemStack itemstack)
|
||||
{
|
||||
return (new StringBuilder()).append("item.food.").append(itemNames[itemstack.getItemDamage()]).toString();
|
||||
}
|
||||
}
|
||||
@@ -1,191 +0,0 @@
|
||||
package tconstruct.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.world.WorldHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBucket;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.BlockFluidFinite;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.common.TRepo;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class FilledBucket extends ItemBucket
|
||||
{
|
||||
|
||||
public FilledBucket(Block b)
|
||||
{
|
||||
super(b);
|
||||
// setTextureFile(TRepo.craftingTexture);
|
||||
// setIconIndex(224);
|
||||
setUnlocalizedName("tconstruct.bucket");
|
||||
setContainerItem(Items.bucket);
|
||||
this.setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
float var4 = 1.0F;
|
||||
double trueX = player.prevPosX + (player.posX - player.prevPosX) * (double) var4;
|
||||
double trueY = player.prevPosY + (player.posY - player.prevPosY) * (double) var4 + 1.62D - (double) player.yOffset;
|
||||
double trueZ = player.prevPosZ + (player.posZ - player.prevPosZ) * (double) var4;
|
||||
boolean wannabeFull = false;
|
||||
MovingObjectPosition position = this.getMovingObjectPositionFromPlayer(world, player, wannabeFull);
|
||||
|
||||
if (position == null)
|
||||
{
|
||||
return stack;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* FillBucketEvent event = new FillBucketEvent(player, stack, world,
|
||||
* position); if (MinecraftForge.EVENT_BUS.post(event)) { return
|
||||
* stack; }
|
||||
*
|
||||
* if (event.getResult() == Event.Result.ALLOW) { if
|
||||
* (player.capabilities.isCreativeMode) { return stack; }
|
||||
*
|
||||
* if (--stack.stackSize <= 0) { return event.result; }
|
||||
*
|
||||
* if (!player.inventory.addItemStackToInventory(event.result)) {
|
||||
* player.dropPlayerItem(event.result); }
|
||||
*
|
||||
* return stack; }
|
||||
*/
|
||||
|
||||
if (position.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
int clickX = position.blockX;
|
||||
int clickY = position.blockY;
|
||||
int clickZ = position.blockZ;
|
||||
|
||||
if (!world.canMineBlock(player, clickX, clickY, clickZ))
|
||||
{
|
||||
return stack;
|
||||
}
|
||||
|
||||
if (position.sideHit == 0)
|
||||
{
|
||||
--clickY;
|
||||
}
|
||||
|
||||
if (position.sideHit == 1)
|
||||
{
|
||||
++clickY;
|
||||
}
|
||||
|
||||
if (position.sideHit == 2)
|
||||
{
|
||||
--clickZ;
|
||||
}
|
||||
|
||||
if (position.sideHit == 3)
|
||||
{
|
||||
++clickZ;
|
||||
}
|
||||
|
||||
if (position.sideHit == 4)
|
||||
{
|
||||
--clickX;
|
||||
}
|
||||
|
||||
if (position.sideHit == 5)
|
||||
{
|
||||
++clickX;
|
||||
}
|
||||
|
||||
if (!player.canPlayerEdit(clickX, clickY, clickZ, position.sideHit, stack))
|
||||
{
|
||||
return stack;
|
||||
}
|
||||
|
||||
if (this.tryPlaceContainedLiquid(world, clickX, clickY, clickZ, stack.getItemDamage()) && !player.capabilities.isCreativeMode)
|
||||
{
|
||||
return new ItemStack(Items.bucket);
|
||||
}
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean tryPlaceContainedLiquid (World world, int clickX, int clickY, int clickZ, int type)
|
||||
{
|
||||
if (!WorldHelper.isAirBlock(world, clickX, clickY, clickZ) && world.getBlock(clickX, clickY, clickZ).getMaterial().isSolid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
int metadata = 0;
|
||||
if (TRepo.fluidBlocks[type] instanceof BlockFluidFinite)
|
||||
metadata = 7;
|
||||
|
||||
world.setBlock(clickX, clickY, clickZ, TRepo.fluidBlocks[type], metadata, 3); // TODO: Merge liquids
|
||||
}
|
||||
catch (ArrayIndexOutOfBoundsException ex)
|
||||
{
|
||||
TConstruct.logger.warn("AIOBE occured when placing bucket into world; " + ex);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems (Item b, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int i = 0; i < icons.length; i++)
|
||||
list.add(new ItemStack(b, 1, i));
|
||||
}
|
||||
|
||||
public IIcon[] icons;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage (int meta)
|
||||
{
|
||||
return icons[meta];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons (IIconRegister iconRegister)
|
||||
{
|
||||
this.icons = new IIcon[textureNames.length];
|
||||
|
||||
for (int i = 0; i < this.icons.length; ++i)
|
||||
{
|
||||
this.icons[i] = iconRegister.registerIcon("tinker:materials/bucket_" + textureNames[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName (ItemStack stack)
|
||||
{
|
||||
int arr = MathHelper.clamp_int(stack.getItemDamage(), 0, materialNames.length);
|
||||
return getUnlocalizedName() + "." + materialNames[arr];
|
||||
}
|
||||
|
||||
public static final String[] materialNames = new String[] { "Iron", "Gold", "Copper", "Tin", "Aluminum", "Cobalt", "Ardite", "Bronze", "AluBrass", "Manyullyn", "Alumite", "Obsidian", "Steel",
|
||||
"Glass", "Stone", "Villager", "Cow", "Nickel", "Lead", "Silver", "Shiny", "Invar", "Electrum", "Ender", "Slime", "Glue", "PigIron" };
|
||||
|
||||
public static final String[] textureNames = new String[] { "iron", "gold", "copper", "tin", "aluminum", "cobalt", "ardite", "bronze", "alubrass", "manyullyn", "alumite", "obsidian", "steel",
|
||||
"glass", "stone", "emerald", "blood", "nickel", "lead", "silver", "shiny", "invar", "electrum", "ender", "slime", "glue", "pigiron" };
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package tconstruct.items;
|
||||
|
||||
import mantle.items.abstracts.CraftingItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.util.IToolPart;
|
||||
|
||||
public class Fletching extends CraftingItem implements IToolPart
|
||||
{
|
||||
public Fletching()
|
||||
{
|
||||
super(toolMaterialNames, buildTextureNames("_fletching"), "parts/", "tinker", TConstructRegistry.materialTab);
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxDamage(0);
|
||||
}
|
||||
|
||||
private static String[] buildTextureNames (String textureType)
|
||||
{
|
||||
String[] names = new String[toolMaterialNames.length];
|
||||
for (int i = 0; i < toolMaterialNames.length; i++)
|
||||
{
|
||||
if (toolTextureNames[i].equals(""))
|
||||
names[i] = "";
|
||||
else
|
||||
names[i] = toolTextureNames[i] + textureType;
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
public static final String[] toolMaterialNames = new String[] { "feather", "leaf", "slime", "blueslime" };
|
||||
|
||||
public static final String[] toolTextureNames = new String[] { "feather", "leaf", "slime", "blueslime" };
|
||||
|
||||
@Override
|
||||
public int getMaterialID (ItemStack stack)
|
||||
{
|
||||
return stack.getItemDamage();
|
||||
}
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
package tconstruct.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class GoldenHead extends ItemFood
|
||||
{
|
||||
public GoldenHead(int par2, float par3, boolean par4)
|
||||
{
|
||||
super(par2, par3, par4);
|
||||
this.setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean hasEffect (ItemStack par1ItemStack)
|
||||
{
|
||||
return par1ItemStack.getItemDamage() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
/**
|
||||
* Return an item rarity from EnumRarity
|
||||
*/
|
||||
public EnumRarity getRarity (ItemStack par1ItemStack)
|
||||
{
|
||||
return par1ItemStack.getItemDamage() == 0 ? EnumRarity.rare : EnumRarity.epic;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFoodEaten (ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (par1ItemStack.getItemDamage() > 0)
|
||||
{
|
||||
if (!par2World.isRemote)
|
||||
{
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.regeneration.id, 600, 3));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.resistance.id, 6000, 0));
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 6000, 0));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
super.onFoodEaten(par1ItemStack, par2World, par3EntityPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
/**
|
||||
* returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
|
||||
*/
|
||||
public void getSubItems (Item b, CreativeTabs par2CreativeTabs, List par3List)
|
||||
{
|
||||
par3List.add(new ItemStack(b, 1, 0));
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons (IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("tinker:skull_char_gold");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
list.add("\u00a75\u00a7o" + StatCollector.translateToLocal("goldenhead1.tooltip"));
|
||||
list.add("\u00a75\u00a7o" + StatCollector.translateToLocal("goldenhead2.tooltip"));
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
package tconstruct.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class Jerky extends SpecialFood
|
||||
{
|
||||
public static String[] textureNames = new String[] { "beef", "chicken", "pork", "mutton", "fish", "monster", "blueslime", "blood" };
|
||||
public static String[] itemNames = new String[] { "jerky.beef", "jerky.chicken", "jerky.pig", "jerky.sheep", "jerky.fish", "jerky.zombie", "jerky.blueslime", "jerky.blood" };
|
||||
public static int[] hunger = new int[] { 8, 6, 8, 6, 5, 4, 6, 4 };
|
||||
public static float[] saturation = new float[] { 1.0f, 0.8f, 1.0f, 0.8f, 0.8f, 0.4f, 1.0f, 0.4f };
|
||||
public static int[] overhaulHunger = new int[] { 1, 1, 1, 1, 1, 1, 1, 1 };
|
||||
|
||||
public Jerky(boolean hungerOverhaul)
|
||||
{
|
||||
super(hungerOverhaul ? overhaulHunger : hunger, saturation, itemNames, textureNames);
|
||||
this.setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons (IIconRegister iconRegister)
|
||||
{
|
||||
this.icons = new IIcon[iconNames.length];
|
||||
|
||||
for (int i = 0; i < this.icons.length; ++i)
|
||||
{
|
||||
this.icons[i] = iconRegister.registerIcon("tinker:food/jerky_" + iconNames[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName (ItemStack stack)
|
||||
{
|
||||
int arr = MathHelper.clamp_int(stack.getItemDamage(), 0, unlocalizedNames.length);
|
||||
return "item.tconstruct." + unlocalizedNames[arr];
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFoodEaten (ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
if (stack.getItemDamage() == 7)
|
||||
{
|
||||
int duration = 0;
|
||||
PotionEffect potion = player.getActivePotionEffect(Potion.field_76434_w);
|
||||
if (potion != null)
|
||||
duration = potion.getDuration();
|
||||
player.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, duration + 20 * 60, 1));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
int type = stack.getItemDamage();
|
||||
switch (type)
|
||||
{
|
||||
case 6:
|
||||
list.add("\u00a7b" + StatCollector.translateToLocal("strangefood5.tooltip"));
|
||||
break;
|
||||
case 7:
|
||||
list.add("\u00a74" + StatCollector.translateToLocal("strangefood6.tooltip"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
package tconstruct.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.books.BookData;
|
||||
import mantle.client.gui.GuiManual;
|
||||
import mantle.items.abstracts.CraftingItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.achievements.TAchievements;
|
||||
import tconstruct.client.TProxyClient;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class Manual extends CraftingItem
|
||||
{
|
||||
static String[] name = new String[] { "beginner", "toolstation", "smeltery", "diary" };
|
||||
static String[] textureName = new String[] { "tinkerbook_diary", "tinkerbook_toolstation", "tinkerbook_smeltery", "tinkerbook_blue" };
|
||||
|
||||
public Manual()
|
||||
{
|
||||
super(name, textureName, "", "tinker", TConstructRegistry.materialTab);
|
||||
setUnlocalizedName("tconstruct.manual");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
player.addStat(TAchievements.achievements.get("tconstruct:beginner"), 1);
|
||||
Side side = FMLCommonHandler.instance().getEffectiveSide();
|
||||
player.openGui(TConstruct.instance, mantle.client.MProxyClient.manualGuiID, world, 0, 0, 0);
|
||||
FMLClientHandler.instance().displayGuiScreen(player, new GuiManual(stack, getData(stack)));
|
||||
return stack;
|
||||
}
|
||||
|
||||
private BookData getData (ItemStack stack)
|
||||
{
|
||||
switch (stack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
return TProxyClient.manualData.beginner;
|
||||
case 1:
|
||||
return TProxyClient.manualData.toolStation;
|
||||
case 2:
|
||||
return TProxyClient.manualData.smeltery;
|
||||
default:
|
||||
return TProxyClient.manualData.diary;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
switch (stack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
list.add("\u00a7o" + StatCollector.translateToLocal("manual1.tooltip"));
|
||||
break;
|
||||
case 1:
|
||||
list.add("\u00a7o" + StatCollector.translateToLocal("manual2.tooltip"));
|
||||
break;
|
||||
case 2:
|
||||
list.add("\u00a7o" + StatCollector.translateToLocal("manual3.tooltip"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package tconstruct.items;
|
||||
|
||||
import mantle.books.BookData;
|
||||
import mantle.books.BookDataStore;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import tconstruct.client.TProxyClient;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
public class ManualInfo
|
||||
{
|
||||
// static String[] name = new String[] { "beginner", "toolstation", "smeltery", "diary" };
|
||||
// static String[] textureName = new String[] { "tinkerbook_diary", "tinkerbook_toolstation", "tinkerbook_smeltery", "tinkerbook_blue" };
|
||||
|
||||
BookData beginner = new BookData();
|
||||
BookData toolStation = new BookData();
|
||||
BookData smeltery = new BookData();
|
||||
BookData diary = new BookData();
|
||||
|
||||
/* diary = readManual("/assets/tinker/manuals/diary.xml", dbFactory);
|
||||
volume1 = readManual("/assets/tinker/manuals/firstday.xml", dbFactory);
|
||||
volume2 = readManual("/assets/tinker/manuals/materials.xml", dbFactory);
|
||||
smelter = readManual("/assets/tinker/manuals/smeltery.xml", dbFactory);*/
|
||||
|
||||
public ManualInfo()
|
||||
{
|
||||
Side side = FMLCommonHandler.instance().getEffectiveSide();
|
||||
beginner = initManual(beginner, "tconstruct.manual.beginner", "\u00a7o" + StatCollector.translateToLocal("manual1.tooltip"), side == Side.CLIENT ? TProxyClient.volume1 : null,
|
||||
"tinker:tinkerbook_diary");
|
||||
toolStation = initManual(toolStation, "tconstruct.manual.toolstation", "\u00a7o" + StatCollector.translateToLocal("manual2.tooltip"), side == Side.CLIENT ? TProxyClient.volume2 : null,
|
||||
"tinker:tinkerbook_toolstation");
|
||||
smeltery = initManual(smeltery, "tconstruct.manual.smeltery", "\u00a7o" + StatCollector.translateToLocal("manual3.tooltip"), side == Side.CLIENT ? TProxyClient.smelter : null,
|
||||
"tinker:tinkerbook_smeltery");
|
||||
diary = initManual(diary, "tconstruct.manual.diary", "\u00a7o" + StatCollector.translateToLocal("manual4.tooltip"), side == Side.CLIENT ? TProxyClient.diary : null, "tinker:tinkerbook_blue");
|
||||
|
||||
}
|
||||
|
||||
public BookData initManual (BookData data, String unlocName, String toolTip, Document xmlDoc, String itemImage)
|
||||
{
|
||||
//proxy.readManuals();
|
||||
data.unlocalizedName = unlocName;
|
||||
data.toolTip = unlocName;
|
||||
data.modID = "TConstruct";
|
||||
data.itemImage = new ResourceLocation(data.modID, itemImage);
|
||||
data.doc = xmlDoc;
|
||||
BookDataStore.addBook(data);
|
||||
return data;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package tconstruct.items;
|
||||
|
||||
import mantle.items.abstracts.CraftingItem;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
|
||||
public class MaterialItem extends CraftingItem
|
||||
{
|
||||
|
||||
public MaterialItem()
|
||||
{
|
||||
super(materialNames, getTextures(), "materials/", "tinker", TConstructRegistry.materialTab);
|
||||
}
|
||||
|
||||
private static String[] getTextures ()
|
||||
{
|
||||
String[] names = new String[craftingTextures.length];
|
||||
for (int i = 0; i < craftingTextures.length; i++)
|
||||
{
|
||||
if (craftingTextures[i].equals(""))
|
||||
names[i] = "";
|
||||
else
|
||||
names[i] = "material_" + craftingTextures[i];
|
||||
}
|
||||
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", "ArditeDust", "CobaltDust", "AluminumDust", "ManyullynDust", "AluBrassDust" };
|
||||
|
||||
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",
|
||||
"nugget_copper", "nugget_tin", "nugget_aluminum", "", "nugget_alubrass", "silkycloth", "silkyjewel", "nugget_obsidian", "nugget_cobalt", "nugget_ardite", "nugget_manyullyn",
|
||||
"nugget_bronze", "nugget_alumite", "nugget_steel", "pigironingot", "nugget_pigiron", "glueball", "searedbrick_nether", "ardite_dust", "cobalt_dust", "aluminium_dust", "manyullyn_dust",
|
||||
"alubrass_dust" };
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package tconstruct.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class MetalPattern extends Pattern
|
||||
{
|
||||
|
||||
public MetalPattern(String patternType, String folder)
|
||||
{
|
||||
super(patternName, getPatternNames(patternType), folder);
|
||||
}
|
||||
|
||||
protected static String[] getPatternNames (String partType)
|
||||
{
|
||||
String[] names = new String[patternName.length];
|
||||
for (int i = 0; i < patternName.length; i++)
|
||||
if (!(patternName[i].equals("")))
|
||||
names[i] = partType + patternName[i];
|
||||
else
|
||||
names[i] = "";
|
||||
return names;
|
||||
}
|
||||
|
||||
private static final String[] patternName = new String[] { "ingot", "rod", "pickaxe", "shovel", "axe", "swordblade", "largeguard", "mediumguard", "crossbar", "binding", "frypan", "sign",
|
||||
"knifeblade", "chisel", "largerod", "toughbinding", "largeplate", "broadaxe", "scythe", "excavator", "largeblade", "hammerhead", "fullguard", "", "", "arrowhead", "gem" };
|
||||
|
||||
@Override
|
||||
public void getSubItems (Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_)
|
||||
{
|
||||
for (int i = 0; i < patternName.length; i++)
|
||||
if (!(patternName[i].equals("")))
|
||||
p_150895_3_.add(new ItemStack(p_150895_1_, 1, i));
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
package tconstruct.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.items.abstracts.CraftingItem;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityXPOrb;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class OreBerries extends CraftingItem
|
||||
{
|
||||
static String[] names = new String[] { "iron", "gold", "copper", "tin", "aluminum", "essence" };
|
||||
static String[] tex = new String[] { "oreberry_iron", "oreberry_gold", "oreberry_copper", "oreberry_tin", "oreberry_aluminum", "oreberry_essence" };
|
||||
|
||||
public OreBerries()
|
||||
{
|
||||
super(names, tex, "oreberries/", "tinker", TConstructRegistry.materialTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
switch (stack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
list.add(StatCollector.translateToLocal("oreberries1.tooltip"));
|
||||
break;
|
||||
case 1:
|
||||
list.add(StatCollector.translateToLocal("oreberries2.tooltip"));
|
||||
break;
|
||||
case 2:
|
||||
list.add(StatCollector.translateToLocal("oreberries3.tooltip"));
|
||||
break;
|
||||
case 3:
|
||||
list.add(StatCollector.translateToLocal("oreberries4.tooltip"));
|
||||
break;
|
||||
case 4:
|
||||
list.add(StatCollector.translateToLocal("oreberries5.tooltip"));
|
||||
break;
|
||||
case 5:
|
||||
list.add(StatCollector.translateToLocal("oreberries6.tooltip"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
if (stack.getItemDamage() == 5)
|
||||
{
|
||||
EntityXPOrb entity = new EntityXPOrb(world, player.posX, player.posY + 1, player.posZ, itemRand.nextInt(14) + 6);
|
||||
spawnEntity(player.posX, player.posY + 1, player.posZ, entity, world, player);
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
stack.stackSize--;
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
public static void spawnEntity (double x, double y, double z, Entity entity, World world, EntityPlayer player)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
world.spawnEntityInWorld(entity);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,151 +0,0 @@
|
||||
package tconstruct.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.items.abstracts.CraftingItem;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.PatternBuilder.MaterialSet;
|
||||
import tconstruct.library.util.IPattern;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class Pattern extends CraftingItem implements IPattern
|
||||
{
|
||||
public Pattern(String patternType, String folder)
|
||||
{
|
||||
this(patternName, getPatternNames(patternType), folder);
|
||||
}
|
||||
|
||||
public Pattern(String[] names, String[] patternTypes, String folder)
|
||||
{
|
||||
super(names, patternTypes, folder, "tinker", TConstructRegistry.materialTab);
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxDamage(0);
|
||||
this.setContainerItem(this);
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
protected static String[] getPatternNames (String partType)
|
||||
{
|
||||
String[] names = new String[patternName.length];
|
||||
for (int i = 0; i < patternName.length; i++)
|
||||
names[i] = partType + patternName[i];
|
||||
return names;
|
||||
}
|
||||
|
||||
private static final String[] patternName = new String[] { "ingot", "rod", "pickaxe", "shovel", "axe", "swordblade", "largeguard", "mediumguard", "crossbar", "binding", "frypan", "sign",
|
||||
"knifeblade", "chisel", "largerod", "toughbinding", "largeplate", "broadaxe", "scythe", "excavator", "largeblade", "hammerhead", "fullguard", "bowstring", "fletching", "arrowhead" };
|
||||
|
||||
@Override
|
||||
public void getSubItems (Item b, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int i = 1; i < patternName.length; i++)
|
||||
{
|
||||
// if (i != 23)
|
||||
list.add(new ItemStack(b, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getContainerItem (ItemStack stack)
|
||||
{
|
||||
if (stack.stackSize <= 0)
|
||||
return null;
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid (ItemStack stack)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Tags and information about the pattern */
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
float cost = getPatternCost(stack) / 2f;
|
||||
if (cost > 0)
|
||||
{
|
||||
if (cost - (int) cost < 0.1)
|
||||
list.add(StatCollector.translateToLocal("pattern1.tooltip") + (int) cost);
|
||||
else
|
||||
list.add(StatCollector.translateToLocal("pattern2.tooltip") + cost);
|
||||
}
|
||||
}
|
||||
|
||||
// 2 for full material, 1 for half.
|
||||
@Override
|
||||
public int getPatternCost (ItemStack pattern)
|
||||
{
|
||||
switch (pattern.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
return 2;
|
||||
case 1:
|
||||
return 1;
|
||||
case 2:
|
||||
return 2;
|
||||
case 3:
|
||||
return 2;
|
||||
case 4:
|
||||
return 2;
|
||||
case 5:
|
||||
return 2;
|
||||
case 6:
|
||||
return 1;
|
||||
case 7:
|
||||
return 1;
|
||||
case 8:
|
||||
return 1;
|
||||
case 9:
|
||||
return 1;
|
||||
case 10:
|
||||
return 2;
|
||||
case 11:
|
||||
return 2;
|
||||
case 12:
|
||||
return 1;
|
||||
case 13:
|
||||
return 1;
|
||||
case 14:
|
||||
return 6;
|
||||
case 15:
|
||||
return 6;
|
||||
case 16:
|
||||
return 16;
|
||||
case 17:
|
||||
return 16;
|
||||
case 18:
|
||||
return 16;
|
||||
case 19:
|
||||
return 16;
|
||||
case 20:
|
||||
return 16;
|
||||
case 21:
|
||||
return 16;
|
||||
case 22:
|
||||
return 6;
|
||||
case 23:
|
||||
return 6;
|
||||
case 24:
|
||||
return 2;
|
||||
case 25:
|
||||
return 2;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPatternOutput (ItemStack stack, ItemStack input, MaterialSet set)
|
||||
{
|
||||
return TConstructRegistry.getPartMapping((Item) this, stack.getItemDamage(), set.materialID);
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
package tconstruct.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SpecialFood extends ItemFood
|
||||
{
|
||||
int[] hunger;
|
||||
float[] saturation;
|
||||
String[] unlocalizedNames;
|
||||
String[] iconNames;
|
||||
IIcon[] icons;
|
||||
|
||||
public SpecialFood(int[] hunger, float[] saturation, String[] textureNames, String[] iconNames)
|
||||
{
|
||||
super(0, 0, false);
|
||||
this.hunger = hunger;
|
||||
this.saturation = saturation;
|
||||
this.unlocalizedNames = textureNames;
|
||||
this.iconNames = iconNames;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onEaten (ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
stack.stackSize--;
|
||||
int damage = stack.getItemDamage();
|
||||
player.getFoodStats().addStats(hunger[damage], saturation[damage]);
|
||||
world.playSoundAtEntity(player, "random.burp", 0.5F, world.rand.nextFloat() * 0.1F + 0.9F);
|
||||
this.onFoodEaten(stack, world, player);
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage (int meta)
|
||||
{
|
||||
return icons[0];
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons (IIconRegister iconRegister)
|
||||
{
|
||||
this.icons = new IIcon[iconNames.length];
|
||||
|
||||
for (int i = 0; i < this.icons.length; ++i)
|
||||
{
|
||||
this.icons[i] = iconRegister.registerIcon("tinker:" + iconNames[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName (ItemStack stack)
|
||||
{
|
||||
int arr = MathHelper.clamp_int(stack.getItemDamage(), 0, unlocalizedNames.length);
|
||||
return getUnlocalizedName() + "." + unlocalizedNames[arr];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems (Item b, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int i = 0; i < unlocalizedNames.length; i++)
|
||||
list.add(new ItemStack(b, 1, i));
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package tconstruct.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class StrangeFood extends SpecialFood
|
||||
{
|
||||
public StrangeFood()
|
||||
{
|
||||
super(new int[] { 2, 2 }, new float[] { 1f, 1f }, new String[] { "edibleslime", "edibleblood", "bacon" }, new String[] { "food/edibleslime", "food/edibleblood", "food/bacon" });
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFoodEaten (ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
if (stack.getItemDamage() == 1)
|
||||
player.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, 20 * 15, 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
int type = stack.getItemDamage();
|
||||
switch (type)
|
||||
{
|
||||
case 0:
|
||||
list.add("\u00a7b\u00a7o" + StatCollector.translateToLocal("strangefood1.tooltip"));
|
||||
list.add("\u00a7b\u00a7o" + StatCollector.translateToLocal("strangefood2.tooltip"));
|
||||
break;
|
||||
case 1:
|
||||
list.add("\u00a74\u00a7o" + StatCollector.translateToLocal("strangefood3.tooltip"));
|
||||
list.add("\u00a74\u00a7o" + StatCollector.translateToLocal("strangefood4.tooltip"));
|
||||
break;
|
||||
case 2:
|
||||
list.add("\u00a7c" + StatCollector.translateToLocal("strangefood7.tooltip"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,228 +0,0 @@
|
||||
package tconstruct.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.IEntityLivingData;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Facing;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.client.TProxyClient;
|
||||
import tconstruct.entity.BlueSlime;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class TitleIcon extends Item
|
||||
{
|
||||
int[] primaryColor = { 0x66BBE8, 0x66BBE8 };
|
||||
int[] secondaryColor = { 0x1567BF, 0xFFEC6E };
|
||||
String[] mobNames = { "TConstruct.EdibleSlime", "TConstruct.KingSlime" };
|
||||
|
||||
String[] achievementIconNames = new String[] { "tinkerer", "preparedFight", "proTinkerer", "enemySlayer", "dualConvenience" };
|
||||
IIcon[] achievementIcons = new IIcon[achievementIconNames.length];
|
||||
|
||||
public TitleIcon()
|
||||
{
|
||||
super();
|
||||
this.setCreativeTab(CreativeTabs.tabMisc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons (IIconRegister iconRegister)
|
||||
{
|
||||
ToolCore.blankSprite = iconRegister.registerIcon("tinker:blanksprite");
|
||||
TProxyClient.metalBall = iconRegister.registerIcon("tinker:metalball");
|
||||
itemIcon = iconRegister.registerIcon("tinker:tparts");
|
||||
for (int i = 0; i < achievementIcons.length; i++)
|
||||
{
|
||||
achievementIcons[i] = iconRegister.registerIcon("tinker:achievementIcons/" + (i < achievementIconNames.length ? achievementIconNames[i] : ""));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses ()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamageForRenderPass (int par1, int par2)
|
||||
{
|
||||
if (par1 == 255)
|
||||
return itemIcon;
|
||||
if (par1 >= 4096)
|
||||
{
|
||||
return getIconFromDamage(par1);
|
||||
}
|
||||
return new ItemStack(Blocks.mob_spawner).getItem().getIconFromDamageForRenderPass(par1, par2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage (int par1)
|
||||
{
|
||||
if (par1 >= 4096)
|
||||
{
|
||||
int index = par1 - 4096;
|
||||
if (index < achievementIcons.length)
|
||||
{
|
||||
return achievementIcons[index];
|
||||
}
|
||||
}
|
||||
// Not returning null to prevent crashes
|
||||
return itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName (ItemStack par1ItemStack)
|
||||
{
|
||||
String s = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim();
|
||||
String s1 = mobNames[par1ItemStack.getItemDamage()];
|
||||
|
||||
if (s1 != null)
|
||||
{
|
||||
s = s + " " + StatCollector.translateToLocal("entity." + s1 + ".name");
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems (Item b, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int i = 0; i < mobNames.length; i++)
|
||||
list.add(new ItemStack(b, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getColorFromItemStack (ItemStack stack, int pass)
|
||||
{
|
||||
int damage = stack.getItemDamage();
|
||||
if (damage == 255)
|
||||
return 0xffffff;
|
||||
if (damage >= 4096)
|
||||
return 0xffffff;
|
||||
return pass == 0 ? primaryColor[damage] : secondaryColor[damage];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int posX, int posY, int posZ, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
Block b = world.getBlock(posX, posY, posZ);
|
||||
posX += Facing.offsetsXForSide[par7];
|
||||
posY += Facing.offsetsYForSide[par7];
|
||||
posZ += Facing.offsetsZForSide[par7];
|
||||
double d0 = 0.0D;
|
||||
|
||||
if (par7 == 1 && b != null && b.getRenderType() == 11)
|
||||
{
|
||||
d0 = 0.5D;
|
||||
}
|
||||
|
||||
int damage = stack.getItemDamage();
|
||||
switch (damage)
|
||||
{
|
||||
case 0:
|
||||
spawnEntity(posX, posY, posZ, new BlueSlime(world), world, player);
|
||||
break;
|
||||
case 1:
|
||||
spawnBossSlime(posX, posY, posZ, new BlueSlime(world), world, player);
|
||||
break;
|
||||
}
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
--stack.stackSize;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static EntityLiving activateSpawnEgg (ItemStack stack, World world, double posX, double posY, double posZ, int par7)
|
||||
{
|
||||
Block b = world.getBlock((int) posX, (int) posY, (int) posZ);
|
||||
posX += Facing.offsetsXForSide[par7];
|
||||
posY += Facing.offsetsYForSide[par7];
|
||||
posZ += Facing.offsetsZForSide[par7];
|
||||
double d0 = 0.0D;
|
||||
|
||||
if (par7 == 1 && b != null && b.getRenderType() == 11)
|
||||
{
|
||||
d0 = 0.5D;
|
||||
}
|
||||
|
||||
int damage = stack.getItemDamage();
|
||||
EntityLiving entity = null;
|
||||
switch (damage)
|
||||
{
|
||||
case 0:
|
||||
entity = new BlueSlime(world);
|
||||
spawnEntity(posX, posY, posZ, entity, world);
|
||||
break;
|
||||
case 1:
|
||||
entity = new BlueSlime(world);
|
||||
spawnBossSlime(posX, posY, posZ, new BlueSlime(world), world);
|
||||
break;
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
public static void spawnEntity (double x, double y, double z, Entity entity, World world)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
entity.setPosition(x, y, z);
|
||||
((EntityLiving) entity).onSpawnWithEgg((IEntityLivingData) null);
|
||||
world.spawnEntityInWorld(entity);
|
||||
}
|
||||
}
|
||||
|
||||
public static void spawnEntity (double x, double y, double z, Entity entity, World world, EntityPlayer player)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
entity.setPosition(x, y, z);
|
||||
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT)
|
||||
entity.setAngles(player.cameraYaw, player.cameraYaw);
|
||||
((EntityLiving) entity).onSpawnWithEgg((IEntityLivingData) null);
|
||||
world.spawnEntityInWorld(entity);
|
||||
}
|
||||
}
|
||||
|
||||
public static void spawnBossSlime (double x, double y, double z, BlueSlime entity, World world, EntityPlayer player)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
entity.setPosition(x, y, z);
|
||||
entity.setSlimeSize(8);
|
||||
entity.onSpawnWithEgg((IEntityLivingData) null);
|
||||
world.spawnEntityInWorld(entity);
|
||||
}
|
||||
}
|
||||
|
||||
public static void spawnBossSlime (double x, double y, double z, BlueSlime entity, World world)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
entity.setPosition(x, y, z);
|
||||
entity.setSlimeSize(8);
|
||||
entity.onSpawnWithEgg((IEntityLivingData) null);
|
||||
world.spawnEntityInWorld(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
package tconstruct.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.items.abstracts.CraftingItem;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.util.IToolPart;
|
||||
|
||||
public class ToolPart extends CraftingItem implements IToolPart
|
||||
{
|
||||
public String partName;
|
||||
|
||||
public ToolPart(String textureType, String name)
|
||||
{
|
||||
super(toolMaterialNames, buildTextureNames(textureType), "parts/", "tinker", TConstructRegistry.materialTab);
|
||||
this.setCreativeTab(TConstructRegistry.partTab);
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxDamage(0);
|
||||
this.partName = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName (ItemStack par1ItemStack)
|
||||
{
|
||||
String material = StatCollector.translateToLocal("parttype." + toolTextureNames[par1ItemStack.getItemDamage()]);
|
||||
String name = StatCollector.translateToLocal("toolpart." + partName);
|
||||
name = name.replaceAll("%%material", material);
|
||||
|
||||
return name;
|
||||
|
||||
/*
|
||||
* StringBuilder builder = new StringBuilder();
|
||||
* builder.append(StatCollector.translateToLocal("parttype." +
|
||||
* toolTextureNames
|
||||
* [par1ItemStack.getItemDamage()])).append(" ").append(StatCollector
|
||||
* .translateToLocal("toolpart." + partName)); return
|
||||
* builder.toString(); -- String s = ("" +
|
||||
* StatCollector.translateToLocal("toolpart."+partName)).trim(); String
|
||||
* s1 = toolMaterialNames[par1ItemStack.getItemDamage()];
|
||||
*
|
||||
* if (s1 != null) { s = s + " " + StatCollector.translateToLocal(s1); }
|
||||
*
|
||||
* return s;
|
||||
*/
|
||||
}
|
||||
|
||||
private static String[] buildTextureNames (String textureType)
|
||||
{
|
||||
String[] names = new String[toolMaterialNames.length];
|
||||
for (int i = 0; i < toolMaterialNames.length; i++)
|
||||
{
|
||||
if (toolTextureNames[i].equals(""))
|
||||
names[i] = "";
|
||||
else
|
||||
names[i] = toolTextureNames[i] + textureType;
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
public static final String[] toolMaterialNames = new String[] { "Wood", "Stone", "Iron", "Flint", "Cactus", "Bone", "Obsidian", "Netherrack", "Slime", "Paper", "Cobalt", "Ardite", "Manyullyn",
|
||||
"Copper", "Bronze", "Alumite", "Steel", "Blue Slime", "Pig Iron", "", "", "", "", "", "", "", "", "", "", "", "", "Thaumium" };
|
||||
|
||||
public static final String[] toolTextureNames = new String[] { "wood", "stone", "iron", "flint", "cactus", "bone", "obsidian", "netherrack", "slime", "paper", "cobalt", "ardite", "manyullyn",
|
||||
"copper", "bronze", "alumite", "steel", "blueslime", "pigiron", "", "", "", "", "", "", "", "", "", "", "", "", "thaumium" };
|
||||
|
||||
@Override
|
||||
public void getSubItems (Item b, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int i = 0; i < 19; i++)
|
||||
list.add(new ItemStack(b, 1, i));
|
||||
|
||||
if (TRepo.thaumcraftAvailable)
|
||||
list.add(new ItemStack(b, 1, 31));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaterialID (ItemStack stack)
|
||||
{
|
||||
return stack.getItemDamage();
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package tconstruct.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class ToolPartHidden extends ToolPart
|
||||
{
|
||||
|
||||
public ToolPartHidden(String textureType, String name)
|
||||
{
|
||||
super(textureType, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems (Item id, CreativeTabs tab, List list)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
package tconstruct.items;
|
||||
|
||||
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 tconstruct.common.TRepo;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ToolShard extends ToolPart
|
||||
{
|
||||
|
||||
public ToolShard(String tex)
|
||||
{
|
||||
super(tex, "ToolShard");
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxDamage(0);
|
||||
}
|
||||
|
||||
private static String[] buildTextureNames (String textureType)
|
||||
{
|
||||
String[] names = new String[toolMaterialNames.length];
|
||||
for (int i = 0; i < toolMaterialNames.length; i++)
|
||||
{
|
||||
if (!toolTextureNames[i].equals(""))
|
||||
names[i] = toolTextureNames[i] + textureType;
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons (IIconRegister iconRegister)
|
||||
{
|
||||
this.icons = new IIcon[textureNames.length];
|
||||
|
||||
for (int i = 0; i < 5; ++i)
|
||||
{
|
||||
this.icons[i] = iconRegister.registerIcon("tinker:" + folder + textureNames[i]);
|
||||
}
|
||||
icons[5] = icons[4];
|
||||
for (int i = 6; i < 9; ++i)
|
||||
{
|
||||
this.icons[i] = iconRegister.registerIcon("tinker:" + folder + textureNames[i]);
|
||||
}
|
||||
icons[9] = icons[8];
|
||||
for (int i = 10; i < icons.length; ++i)
|
||||
{
|
||||
if (!toolTextureNames[i].equals(""))
|
||||
this.icons[i] = iconRegister.registerIcon("tinker:" + folder + textureNames[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems (Item b, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int i = 1; i < 5; i++)
|
||||
list.add(new ItemStack(b, 1, i));
|
||||
for (int i = 6; i < 9; i++)
|
||||
list.add(new ItemStack(b, 1, i));
|
||||
for (int i = 10; i < 19; i++)
|
||||
list.add(new ItemStack(b, 1, i));
|
||||
|
||||
if (TRepo.thaumcraftAvailable)
|
||||
list.add(new ItemStack(b, 1, 31));
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package tconstruct.items.armor;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ArmorBasic extends ItemArmor
|
||||
{
|
||||
|
||||
public String textureName;
|
||||
|
||||
public ArmorBasic(ArmorMaterial par2EnumArmorMaterial, int par3, String textureName)
|
||||
{
|
||||
super(par2EnumArmorMaterial, 0, par3);
|
||||
this.textureName = textureName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons (IIconRegister par1IconRegister)
|
||||
{
|
||||
this.itemIcon = par1IconRegister.registerIcon("tinker:armor/" + textureName + "_"
|
||||
+ (this.armorType == 0 ? "helmet" : this.armorType == 1 ? "chestplate" : this.armorType == 2 ? "leggings" : this.armorType == 3 ? "boots" : "helmet"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture (ItemStack stack, Entity entity, int slot, String type)
|
||||
{
|
||||
int suffix = this.armorType == 2 ? 2 : 1;
|
||||
return "tinker:textures/armor/" + textureName + "_" + suffix + ".png";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package tconstruct.items.armor;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.armor.ArmorCore;
|
||||
import tconstruct.library.armor.EnumArmorPart;
|
||||
|
||||
public class ArmorStandard extends ArmorCore
|
||||
{
|
||||
|
||||
public ArmorStandard(int baseProtection, EnumArmorPart armorPart)
|
||||
{
|
||||
super(baseProtection, armorPart);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons (IIconRegister par1IconRegister)
|
||||
{
|
||||
this.itemIcon = par1IconRegister.registerIcon("tinker:armor/wood_helmet");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture (ItemStack stack, Entity entity, int slot, String layer)
|
||||
{
|
||||
int suffix = this.armorType == 2 ? 2 : 1;
|
||||
return "tinker:textures/armor/wood_" + suffix + ".png";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
package tconstruct.items.armor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.armor.ArmorCore;
|
||||
import tconstruct.library.armor.EnumArmorPart;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ExoArmor extends ArmorCore
|
||||
{
|
||||
String textureName;
|
||||
|
||||
public ExoArmor(EnumArmorPart part, String texture)
|
||||
{
|
||||
super(0, part);
|
||||
this.textureName = texture;
|
||||
this.setCreativeTab(TConstructRegistry.materialTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons (IIconRegister par1IconRegister)
|
||||
{
|
||||
this.itemIcon = par1IconRegister.registerIcon("tinker:armor/" + textureName + "_"
|
||||
+ (this.armorType == 0 ? "helmet" : this.armorType == 1 ? "chestplate" : this.armorType == 2 ? "leggings" : this.armorType == 3 ? "boots" : "helmet"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture (ItemStack stack, Entity entity, int slot, String layer)
|
||||
{
|
||||
int suffix = this.armorType == 2 ? 2 : 1;
|
||||
return "tinker:textures/armor/" + textureName + "_" + suffix + ".png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void damageArmor (EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot)
|
||||
{
|
||||
// Deimplemented for now
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems (Item b, CreativeTabs par2CreativeTabs, List par3List)
|
||||
{
|
||||
ItemStack armor = new ItemStack(b, 1, 0);
|
||||
NBTTagCompound baseTag = new NBTTagCompound();
|
||||
NBTTagList list = new NBTTagList();
|
||||
|
||||
NBTTagCompound armorTag = new NBTTagCompound();
|
||||
armorTag.setInteger("Modifiers", 30);
|
||||
baseTag.setTag(SET_NAME, armorTag);
|
||||
|
||||
armor.setTagCompound(baseTag);
|
||||
par3List.add(armor);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
if (!stack.hasTagCompound())
|
||||
return;
|
||||
NBTTagCompound tags = stack.getTagCompound().getCompoundTag(SET_NAME);
|
||||
double protection = tags.getDouble("protection");
|
||||
if (protection > 0)
|
||||
list.add("\u00a7aProtection: " + protection + "%");
|
||||
boolean displayToolTips = true;
|
||||
int tipNum = 0;
|
||||
while (displayToolTips)
|
||||
{
|
||||
tipNum++;
|
||||
String tooltip = "Tooltip" + tipNum;
|
||||
if (tags.hasKey(tooltip))
|
||||
{
|
||||
String tipName = tags.getString(tooltip);
|
||||
if (!tipName.equals(""))
|
||||
list.add(tipName);
|
||||
}
|
||||
else
|
||||
displayToolTips = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package tconstruct.items.armor;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
|
||||
public class Glove extends Item
|
||||
{
|
||||
public Glove()
|
||||
{
|
||||
super();
|
||||
this.setCreativeTab(TConstructRegistry.materialTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons (IIconRegister iconRegister)
|
||||
{
|
||||
itemIcon = iconRegister.registerIcon("tinker:armor/dirthand");
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
package tconstruct.items.armor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.items.abstracts.CraftingItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.armor.IHealthAccessory;
|
||||
import tconstruct.util.player.ArmorExtended;
|
||||
import tconstruct.util.player.TPlayerStats;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class HeartCanister extends CraftingItem implements IHealthAccessory
|
||||
{
|
||||
|
||||
public HeartCanister()
|
||||
{
|
||||
super(new String[] { "empty", "miniheart.red", "red", "miniheart.yellow", "yellow", "miniheart.green", "green" }, new String[] { "canister_empty", "miniheart_red", "canister_red",
|
||||
"miniheart_yellow", "canister_yellow", "miniheart_green", "canister_green" }, "", "tinker", TConstructRegistry.materialTab);
|
||||
this.setMaxStackSize(10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
int meta = stack.getItemDamage();
|
||||
if (meta == 1 || meta == 3 || meta == 5)
|
||||
{
|
||||
player.setItemInUse(stack, this.getMaxItemUseDuration(stack));
|
||||
}
|
||||
if (!world.isRemote && meta == 2)
|
||||
{
|
||||
TPlayerStats stats = TPlayerStats.get(player);
|
||||
if (stats != null)
|
||||
{
|
||||
ArmorExtended armor = stats.armor;
|
||||
ItemStack slotStack = armor.getStackInSlot(6);
|
||||
if (slotStack == null)// || slotStack.getItem() == this)
|
||||
{
|
||||
armor.setInventorySlotContents(6, new ItemStack(this, 1, 2));
|
||||
stack.stackSize--;
|
||||
}
|
||||
else if (slotStack.getItem() == this && slotStack.stackSize < this.maxStackSize)
|
||||
{
|
||||
slotStack.stackSize++;
|
||||
stack.stackSize--;
|
||||
}
|
||||
armor.recalculateHealth(player, stats);
|
||||
}
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onEaten (ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
int meta = stack.getItemDamage();
|
||||
--stack.stackSize;
|
||||
player.heal((meta + 1) * 10);
|
||||
world.playSoundAtEntity(player, "random.burp", 0.5F, world.rand.nextFloat() * 0.1F + 0.9F);
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumAction getItemUseAction (ItemStack par1ItemStack)
|
||||
{
|
||||
return EnumAction.eat;
|
||||
}
|
||||
|
||||
public int getMaxItemUseDuration (ItemStack par1ItemStack)
|
||||
{
|
||||
return 32;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
int meta = stack.getItemDamage();
|
||||
if (meta == 0 || meta % 2 == 1)
|
||||
list.add(StatCollector.translateToLocal("item.crafting.tooltip"));
|
||||
else
|
||||
{
|
||||
list.add(StatCollector.translateToLocal("item.accessory.tooltip"));
|
||||
list.add(StatCollector.translateToLocal("canister.tooltip"));
|
||||
}
|
||||
|
||||
switch (meta)
|
||||
{
|
||||
case 1:
|
||||
list.add(StatCollector.translateToLocal("canister.red.tooltip1"));
|
||||
list.add(StatCollector.translateToLocal("canister.red.tooltip2"));
|
||||
break;
|
||||
case 2:
|
||||
list.add(StatCollector.translateToLocal("canister.green.tooltip1"));
|
||||
list.add(StatCollector.translateToLocal("canister.green.tooltip2"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEquipItem (ItemStack item, int slot)
|
||||
{
|
||||
int type = item.getItemDamage();
|
||||
return ((type == 2 && slot == 6) || (type == 4 && slot == 5) || (type == 6 && slot == 4));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHealthBoost (ItemStack item)
|
||||
{
|
||||
return item.stackSize * 2;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package tconstruct.items.armor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.items.abstracts.CraftingItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class Knapsack extends CraftingItem
|
||||
{
|
||||
|
||||
public Knapsack()
|
||||
{
|
||||
super(new String[] { "knapsack" }, new String[] { "knapsack" }, "armor/", "tinker", TConstructRegistry.materialTab);
|
||||
this.setMaxStackSize(10);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
switch (stack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
list.add(StatCollector.translateToLocal("knapsack.tooltip"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO feel fix this so that stuff ticks in backpacks
|
||||
/*
|
||||
* @Override public void onArmorTickUpdate (World world, EntityPlayer
|
||||
* player, ItemStack itemStack) { TPlayerStats stats =
|
||||
* TConstruct.playerTracker.getPlayerStats(player.getDisplayName());
|
||||
* KnapsackInventory inv = stats.knapsack;
|
||||
*
|
||||
* if (stats != null && inv != null) { for (int i = 0; i <
|
||||
* inv.getSizeInventory(); i++) { if (inv.getStackInSlot(i) != null) {
|
||||
* inv.getStackInSlot(i).getItem().onUpdate(inv.getStackInSlot(i),
|
||||
* player.worldObj, player, i, false); } } } }
|
||||
*/
|
||||
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
package tconstruct.items.armor;
|
||||
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class TArmorBase extends ItemArmor
|
||||
// implements ISpecialArmor
|
||||
{
|
||||
IIcon[] icons;
|
||||
String[] iconNames = { "wood_boots" };
|
||||
|
||||
// static Minecraft mc = Minecraft.getMinecraft();
|
||||
// private ModelBiped modelArmor;
|
||||
|
||||
public TArmorBase(int armorSlot)
|
||||
{
|
||||
super(ArmorMaterial.CLOTH, 0, armorSlot);
|
||||
this.maxStackSize = 1;
|
||||
this.setMaxDamage(100);
|
||||
setNoRepair();
|
||||
canRepair = false;
|
||||
this.setCreativeTab(CreativeTabs.tabMisc);
|
||||
// this.modelArmor = new ModelBiped(0.75F);
|
||||
// this.setCreativeTab(TConstructRegistry.toolTab);
|
||||
}
|
||||
|
||||
public void onArmorTickUpdate (World world, EntityPlayer player, ItemStack itemStack)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by RenderBiped and RenderPlayer to determine the armor texture
|
||||
* that should be use for the currently equiped item. This will only be
|
||||
* called on instances of ItemArmor.
|
||||
*
|
||||
* Returning null from this function will use the default value.
|
||||
*
|
||||
* @param stack
|
||||
* ItemStack for the equpt armor
|
||||
* @param entity
|
||||
* The entity wearing the armor
|
||||
* @param slot
|
||||
* The slot the armor is in
|
||||
* @param layer
|
||||
* The render layer, either 1 or 2, 2 is only used for CLOTH
|
||||
* armor by default
|
||||
* @return Path of texture to bind, or null to use default
|
||||
*/
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getArmorTexture (ItemStack stack, Entity entity, int slot, String layer)
|
||||
{
|
||||
return "/mods/tinker/textures/armor/wood_1.png";
|
||||
}
|
||||
|
||||
/**
|
||||
* Override this method to have an item handle its own armor rendering.
|
||||
*
|
||||
* @param entityLiving
|
||||
* The entity wearing the armor
|
||||
* @param itemStack
|
||||
* The itemStack to render the model of
|
||||
* @param armorSlot
|
||||
* 0=head, 1=torso, 2=legs, 3=feet
|
||||
*
|
||||
* @return A ModelBiped to render instead of the default
|
||||
*/
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelBiped getArmorModel (EntityLivingBase par1EntityLiving, ItemStack itemStack, int armorSlot)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses ()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public IIcon getIconFromDamage (int meta)
|
||||
{
|
||||
return icons[0];
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons (IIconRegister iconRegister)
|
||||
{
|
||||
this.icons = new IIcon[iconNames.length];
|
||||
|
||||
for (int i = 0; i < this.icons.length; ++i)
|
||||
{
|
||||
this.icons[i] = iconRegister.registerIcon("tinker:armor/" + iconNames[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* @Override public ArmorProperties getProperties (EntityLiving player,
|
||||
* ItemStack armor, DamageSource source, double damage, int slot) { // TODO
|
||||
* Auto-generated method stub return null; }
|
||||
*
|
||||
* @Override public int getArmorDisplay (EntityPlayer player, ItemStack
|
||||
* armor, int slot) { // TODO Auto-generated method stub return 0; }
|
||||
*
|
||||
* @Override public void damageArmor (EntityLiving entity, ItemStack stack,
|
||||
* DamageSource source, int damage, int slot) { // TODO Auto-generated
|
||||
* method stub
|
||||
*
|
||||
* }
|
||||
*/
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BarricadeItem extends ItemBlock
|
||||
{
|
||||
private Block b;
|
||||
|
||||
public BarricadeItem(Block b)
|
||||
{
|
||||
super(b);
|
||||
this.b = b;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
list.add(StatCollector.translateToLocal("barricade.tooltip"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
Block b = world.getBlock(x, y, z);
|
||||
|
||||
if (b == Blocks.snow && (world.getBlockMetadata(x, y, z) & 7) < 1)
|
||||
{
|
||||
side = 1;
|
||||
}
|
||||
else if (b != Blocks.vine && b != Blocks.tallgrass && b != Blocks.deadbush && (b == null || !b.canPlaceBlockAt(world, x, y, z)))
|
||||
{
|
||||
if (side == 0)
|
||||
{
|
||||
--y;
|
||||
}
|
||||
|
||||
if (side == 1)
|
||||
{
|
||||
++y;
|
||||
}
|
||||
|
||||
if (side == 2)
|
||||
{
|
||||
--z;
|
||||
}
|
||||
|
||||
if (side == 3)
|
||||
{
|
||||
++z;
|
||||
}
|
||||
|
||||
if (side == 4)
|
||||
{
|
||||
--x;
|
||||
}
|
||||
|
||||
if (side == 5)
|
||||
{
|
||||
++x;
|
||||
}
|
||||
}
|
||||
|
||||
if (stack.stackSize == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (!player.canPlayerEdit(x, y, z, side, stack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (y == 255 && this.b.getMaterial().isSolid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (world.canPlaceEntityOnSide(this.b, x, y, z, false, side, player, stack))
|
||||
{
|
||||
Block block = this.b;
|
||||
// int meta = this.getMetadata(stack.getItemDamage());
|
||||
int rotation = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||
int meta = rotation * 4;
|
||||
int metadata = this.b.onBlockPlaced(world, x, y, z, side, hitX, hitY, hitZ, meta);
|
||||
|
||||
if (placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata))
|
||||
{
|
||||
world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), block.stepSound.soundName, (block.stepSound.getVolume() + 1.0F) / 2.0F,
|
||||
block.stepSound.getPitch() * 0.8F);
|
||||
--stack.stackSize;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class CastingChannelItem extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "Channel" };
|
||||
|
||||
public CastingChannelItem(Block b)
|
||||
{
|
||||
super(b, "Smeltery", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class CraftedSoilItemBlock extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "Slime", "Grout", "BlueSlime", "GraveyardSoil", "ConsecratedSoil", "blue", "dirt", "Grout" };
|
||||
|
||||
public CraftedSoilItemBlock(Block b)
|
||||
{
|
||||
super(b, "CraftedSoil", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName (ItemStack itemstack)
|
||||
{
|
||||
int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, this.blockTypes.length - 1);
|
||||
if (pos <= 4)
|
||||
return super.getUnlocalizedName(itemstack);
|
||||
return (new StringBuilder()).append("block.slime.soil.").append(this.blockTypes[pos]).toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
switch (stack.getItemDamage())
|
||||
{
|
||||
case 3:
|
||||
list.add(StatCollector.translateToLocal("craftedsoil1.tooltip"));
|
||||
break;
|
||||
case 4:
|
||||
list.add(StatCollector.translateToLocal("craftedsoil2.tooltip"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
public class CraftingSlabItemBlock extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "tile.CraftingStation", "Crafter", "Parts", "PatternShaper", "PatternChest", "tile.ToolForge" };
|
||||
|
||||
public CraftingSlabItemBlock(Block b)
|
||||
{
|
||||
super(b, "ToolStation", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName (ItemStack itemstack)
|
||||
{
|
||||
int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, this.blockTypes.length - 1);
|
||||
if (pos == 0 || pos == 5)
|
||||
{
|
||||
return this.blockTypes[pos];
|
||||
}
|
||||
return super.getUnlocalizedName(itemstack);
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class GlassBlockItem extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "pure" };// , "soul",
|
||||
// "soul.pure" };
|
||||
|
||||
public GlassBlockItem(Block b)
|
||||
{
|
||||
super(b, "block.glass", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
if (stack.hasTagCompound() && stack.getItemDamage() == 0)
|
||||
{
|
||||
NBTTagCompound contentTags = stack.getTagCompound().getCompoundTag("Contents");
|
||||
if (contentTags != null)
|
||||
{
|
||||
ItemStack contents = ItemStack.loadItemStackFromNBT(contentTags);
|
||||
if (contents != null)
|
||||
{
|
||||
list.add("Inventory: " + contents.getDisplayName());
|
||||
list.add("Amount: " + contents.stackSize);
|
||||
}
|
||||
}
|
||||
NBTTagCompound camoTag = stack.getTagCompound().getCompoundTag("Camoflauge");
|
||||
if (camoTag != null)
|
||||
{
|
||||
ItemStack camo = ItemStack.loadItemStackFromNBT(camoTag);
|
||||
if (camo != null)
|
||||
list.add("Camoflauge: " + camo.getDisplayName());
|
||||
}
|
||||
|
||||
if (stack.getTagCompound().hasKey("Placement"))
|
||||
{
|
||||
String string = getDirectionString(stack.getTagCompound().getByte("Placement"));
|
||||
list.add("Placement Direction: " + string);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String getDirectionString (byte key)
|
||||
{
|
||||
if (key == 0)
|
||||
return ("Up");
|
||||
if (key == 1)
|
||||
return ("Right");
|
||||
if (key == 2)
|
||||
return ("Down");
|
||||
|
||||
return "Left";
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class GlassPaneItem extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "pure", "soul", "soul.pure" };
|
||||
|
||||
public GlassPaneItem(Block b)
|
||||
{
|
||||
super(b, "block.glass", "pane", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class GravelOreItem extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "iron", "gold", "copper", "tin", "aluminum", "cobalt" };
|
||||
|
||||
public GravelOreItem(Block b)
|
||||
{
|
||||
super(b, "block.ore.gravel", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,157 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class HamboneItemBlock extends ItemBlock
|
||||
{
|
||||
public HamboneItemBlock(Block b)
|
||||
{
|
||||
super(b);
|
||||
itemUseDuration = 32;
|
||||
if (Loader.isModLoaded("HungerOverhaul"))
|
||||
{
|
||||
healAmount = 8;
|
||||
saturationModifier = 0.8f;
|
||||
}
|
||||
else
|
||||
{
|
||||
healAmount = 20;
|
||||
saturationModifier = 3.0f;
|
||||
}
|
||||
isWolfsFavoriteMeat = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
list.add("\u00A74" + StatCollector.translateToLocal("hambone1.tooltip"));
|
||||
list.add(StatCollector.translateToLocal("hambone2.tooltip"));
|
||||
}
|
||||
|
||||
/** Number of ticks to run while 'EnumAction'ing until result. */
|
||||
public final int itemUseDuration;
|
||||
|
||||
/** The amount this food item heals the player. */
|
||||
private final int healAmount;
|
||||
private final float saturationModifier;
|
||||
|
||||
/** Whether wolves like this food (true for raw and cooked porkchop). */
|
||||
private final boolean isWolfsFavoriteMeat;
|
||||
|
||||
/**
|
||||
* If this field is true, the food can be consumed even if the player don't
|
||||
* need to eat.
|
||||
*/
|
||||
private boolean alwaysEdible;
|
||||
|
||||
/**
|
||||
* represents the potion effect that will occurr upon eating this food. Set
|
||||
* by setPotionEffect
|
||||
*/
|
||||
private int potionId;
|
||||
|
||||
/** set by setPotionEffect */
|
||||
private int potionDuration;
|
||||
|
||||
/** set by setPotionEffect */
|
||||
private int potionAmplifier;
|
||||
|
||||
/** probably of the set potion effect occurring */
|
||||
private float potionEffectProbability;
|
||||
|
||||
/*
|
||||
* public ItemFood(int par1, int par2, float par3, boolean par4) {
|
||||
* super(par1); this.itemUseDuration = 32; this.healAmount = par2;
|
||||
* this.isWolfsFavoriteMeat = par4; this.saturationModifier = par3;
|
||||
* this.setCreativeTab(CreativeTabs.tabFood); }
|
||||
*
|
||||
* public ItemFood(int par1, int par2, boolean par3) { this(par1, par2,
|
||||
* 0.6F, par3); }
|
||||
*/
|
||||
|
||||
@Override
|
||||
public ItemStack onEaten (ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
--par1ItemStack.stackSize;
|
||||
par3EntityPlayer.getFoodStats().addStats(getHealAmount(), getSaturationModifier());
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "random.burp", 0.5F, par2World.rand.nextFloat() * 0.1F + 0.9F);
|
||||
this.onFoodEaten(par1ItemStack, par2World, par3EntityPlayer);
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
protected void onFoodEaten (ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (!par2World.isRemote && this.potionId > 0 && par2World.rand.nextFloat() < this.potionEffectProbability)
|
||||
{
|
||||
par3EntityPlayer.addPotionEffect(new PotionEffect(this.potionId, this.potionDuration * 20, this.potionAmplifier));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* How long it takes to use or consume an item
|
||||
*/
|
||||
@Override
|
||||
public int getMaxItemUseDuration (ItemStack par1ItemStack)
|
||||
{
|
||||
return 32;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the action that specifies what animation to play when the items
|
||||
* is being used
|
||||
*/
|
||||
@Override
|
||||
public EnumAction getItemUseAction (ItemStack par1ItemStack)
|
||||
{
|
||||
return EnumAction.eat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called whenever this item is equipped and the right mouse button is
|
||||
* pressed. Args: itemStack, world, entityPlayer
|
||||
*/
|
||||
@Override
|
||||
public ItemStack onItemRightClick (ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (par3EntityPlayer.canEat(this.alwaysEdible))
|
||||
{
|
||||
par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
public int getHealAmount ()
|
||||
{
|
||||
return this.healAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the saturationModifier of the ItemFood
|
||||
*/
|
||||
public float getSaturationModifier ()
|
||||
{
|
||||
return this.saturationModifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether wolves like this food (true for raw and cooked porkchop).
|
||||
*/
|
||||
public boolean isWolfsFavoriteMeat ()
|
||||
{
|
||||
return this.isWolfsFavoriteMeat;
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.blocks.logic.TileEntityLandmine;
|
||||
import tconstruct.common.TRepo;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fuj1n
|
||||
*
|
||||
*/
|
||||
public class ItemBlockLandmine extends ItemBlock
|
||||
{
|
||||
|
||||
public ItemBlockLandmine(Block b)
|
||||
{
|
||||
super(b);
|
||||
this.setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
String interaction = null;
|
||||
|
||||
switch (par1ItemStack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
interaction = StatCollector.translateToLocal("landmine1.tooltip");
|
||||
break;
|
||||
case 1:
|
||||
interaction = StatCollector.translateToLocal("landmine2.tooltip");
|
||||
break;
|
||||
case 2:
|
||||
interaction = StatCollector.translateToLocal("landmine3.tooltip");
|
||||
break;
|
||||
default:
|
||||
interaction = StatCollector.translateToLocal("landmine4.tooltip");
|
||||
break;
|
||||
}
|
||||
|
||||
par3List.add(StatCollector.translateToLocal("landmine5.tooltip") + interaction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata (int par1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean placeBlockAt (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata)
|
||||
{
|
||||
if (!world.setBlock(x, y, z, TRepo.landmine, metadata, 3))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (world.getBlock(x, y, z) == TRepo.landmine)
|
||||
{
|
||||
TRepo.landmine.onBlockPlacedBy(world, x, y, z, player, stack);
|
||||
|
||||
TileEntityLandmine te = (TileEntityLandmine) world.getTileEntity(x, y, z);
|
||||
if (te == null)
|
||||
{
|
||||
te = (TileEntityLandmine) TRepo.landmine.createTileEntity(world, metadata);
|
||||
}
|
||||
|
||||
te.triggerType = stack.getItemDamage();
|
||||
world.setTileEntity(x, y, z, te);
|
||||
|
||||
TRepo.landmine.onPostBlockPlaced(world, x, y, z, metadata);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static Random getRandom ()
|
||||
{
|
||||
return itemRand;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public class LavaTankItemBlock extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "Tank", "Gague", "Window" };
|
||||
|
||||
public LavaTankItemBlock(Block b)
|
||||
{
|
||||
super(b, "LavaTank", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
if (stack.hasTagCompound())
|
||||
{
|
||||
NBTTagCompound liquidTag = stack.getTagCompound().getCompoundTag("Fluid");
|
||||
if (liquidTag != null)
|
||||
{
|
||||
list.add(StatCollector.translateToLocal("searedtank1.tooltip") + " " + StatCollector.translateToLocal(liquidTag.getString("FluidName")));
|
||||
list.add(liquidTag.getInteger("Amount") + " mB");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
list.add(StatCollector.translateToLocal("searedtank2.tooltip"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
|
||||
public class MetadataItemBlock extends ItemBlock
|
||||
{
|
||||
public MetadataItemBlock(Block b)
|
||||
{
|
||||
super(b);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata (int meta)
|
||||
{
|
||||
return meta;
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public class MetalItemBlock extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "Cobalt", "Ardite", "Manyullyn", "Copper", "Bronze", "Tin", "Aluminum", "AlBrass", "Alumite", "Steel", "Ender" };
|
||||
|
||||
public MetalItemBlock(Block b)
|
||||
{
|
||||
super(b, "StorageMetals", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
list.add(StatCollector.translateToLocal("metalblock.tooltip"));
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class MetalOreItemBlock extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "NetherSlag", "Cobalt", "Ardite", "Copper", "Tin", "Aluminum", "Slag" };
|
||||
|
||||
public MetalOreItemBlock(Block b)
|
||||
{
|
||||
super(b, "MetalOre", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
if (stack.hasTagCompound())
|
||||
{
|
||||
NBTTagCompound liquidTag = stack.getTagCompound().getCompoundTag("Liquid");
|
||||
if (liquidTag != null)
|
||||
{
|
||||
list.add("Contains " + liquidTag.getString("LiquidName"));
|
||||
list.add(liquidTag.getInteger("Amount") + " mB");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class MultiBrickFancyItem extends MultiItemBlock
|
||||
{
|
||||
static String blockTypes[] = { "obsidian", "sandstone", "netherrack", "stone.refined", "iron", "gold", "lapis", "diamond", "redstone", "bone", "slime", "blueslime", "endstone", "obsidian.ingot",
|
||||
"stone", "stone.road" };
|
||||
|
||||
public MultiBrickFancyItem(Block b)
|
||||
{
|
||||
super(b, "block.fancybrick", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
switch (stack.getItemDamage())
|
||||
{
|
||||
case 5:
|
||||
case 6:
|
||||
list.add(StatCollector.translateToLocal("fancybrick1.tooltip"));
|
||||
break;
|
||||
case 7:
|
||||
list.add(StatCollector.translateToLocal("fancybrick2.tooltip"));
|
||||
break;
|
||||
case 8:
|
||||
list.add(StatCollector.translateToLocal("fancybrick3.tooltip"));
|
||||
list.add(StatCollector.translateToLocal("fancybrick4.tooltip"));
|
||||
break;
|
||||
case 10:
|
||||
case 11:
|
||||
list.add(StatCollector.translateToLocal("fancybrick5.tooltip"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class MultiBrickItem extends MultiItemBlock
|
||||
{
|
||||
static String blockTypes[] = { "obsidian", "sandstone", "netherrack", "stone.refined", "iron", "gold", "lapis", "diamond", "redstone", "bone", "slime", "blueslime", "endstone", "obsidian.ingot",
|
||||
"stone.road", "stone.refined.road" };
|
||||
|
||||
public MultiBrickItem(Block b)
|
||||
{
|
||||
super(b, "block.brick", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
switch (stack.getItemDamage())
|
||||
{
|
||||
case 5:
|
||||
case 6:
|
||||
list.add(StatCollector.translateToLocal("brick1.tooltip"));
|
||||
break;
|
||||
case 7:
|
||||
list.add(StatCollector.translateToLocal("brick2.tooltip"));
|
||||
break;
|
||||
case 8:
|
||||
list.add(StatCollector.translateToLocal("brick3.tooltip"));
|
||||
list.add(StatCollector.translateToLocal("brick4.tooltip"));
|
||||
break;
|
||||
case 10:
|
||||
case 11:
|
||||
list.add(StatCollector.translateToLocal("brick5.tooltip"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import mantle.world.WorldHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import tconstruct.common.TRepo;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class OreberryBushItem extends MultiItemBlock
|
||||
{
|
||||
public Block blockB;
|
||||
public static final String blockTypes[] = { "iron", "gold", "copper", "tin", "iron", "gold", "copper", "tin", "iron", "gold", "copper", "tin", "iron", "gold", "copper", "tin" };
|
||||
|
||||
public OreberryBushItem(Block b)
|
||||
{
|
||||
super(b, "block.oreberry", blockTypes);
|
||||
blockB = b;
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata (int meta)
|
||||
{
|
||||
return meta % 4;
|
||||
}
|
||||
|
||||
/* Place bushes on dirt, grass, or other bushes only */
|
||||
@Override
|
||||
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float par8, float par9, float par10)
|
||||
{
|
||||
if (side != 1)
|
||||
return false;
|
||||
|
||||
else if (player.canPlayerEdit(x, y, z, side, stack) && player.canPlayerEdit(x, y + 1, z, side, stack))
|
||||
{
|
||||
Block block = world.getBlock(x, y, z);
|
||||
|
||||
if (block != null && block.canSustainPlant(world, x, y, z, ForgeDirection.UP, (IPlantable) TRepo.oreBerry) && WorldHelper.isAirBlock(world, x, y + 1, z))
|
||||
{
|
||||
world.setBlock(x, y + 1, z, blockB, stack.getItemDamage() % 4, 3);
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
stack.stackSize--;
|
||||
if (!world.isRemote)
|
||||
world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block));
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
switch (stack.getItemDamage() % 4)
|
||||
{
|
||||
case 0:
|
||||
list.add(StatCollector.translateToLocal("oreberrybush1.tooltip"));
|
||||
break;
|
||||
case 1:
|
||||
list.add(StatCollector.translateToLocal("oreberrybush2.tooltip"));
|
||||
break;
|
||||
case 2:
|
||||
list.add(StatCollector.translateToLocal("oreberrybush3.tooltip"));
|
||||
break;
|
||||
case 3:
|
||||
list.add(StatCollector.translateToLocal("oreberrybush4.tooltip"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import mantle.world.WorldHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import tconstruct.common.TRepo;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class OreberryBushSecondItem extends MultiItemBlock
|
||||
{
|
||||
public Block blockB;
|
||||
public static final String blockTypes[] = { "aluminum", "essence", "", "", "aluminum", "essence", "", "", "aluminum", "essence", "", "", "aluminum", "essence", "", "" };
|
||||
|
||||
public OreberryBushSecondItem(Block b)
|
||||
{
|
||||
super(b, "block.oreberry", blockTypes);
|
||||
blockB = b;
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata (int meta)
|
||||
{
|
||||
return meta % 4;
|
||||
}
|
||||
|
||||
/* Place bushes on dirt, grass, or other bushes only */
|
||||
@Override
|
||||
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (side != 1)
|
||||
return false;
|
||||
|
||||
int meta = stack.getItemDamage();
|
||||
if (meta % 4 != 1 && world.getFullBlockLightValue(x, y + 1, z) >= 13)
|
||||
return false;
|
||||
|
||||
else if (player.canPlayerEdit(x, y, z, side, stack) && player.canPlayerEdit(x, y + 1, z, side, stack))
|
||||
{
|
||||
Block block = world.getBlock(x, y, z);
|
||||
|
||||
if (block != null && block.canSustainPlant(world, x, y, z, ForgeDirection.UP, (IPlantable) TRepo.oreBerrySecond) && WorldHelper.isAirBlock(world, x, y + 1, z))
|
||||
{
|
||||
world.setBlock(x, y + 1, z, blockB, stack.getItemDamage() % 4, 3);
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
stack.stackSize--;
|
||||
if (!world.isRemote)
|
||||
world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block));
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
switch (stack.getItemDamage() % 4)
|
||||
{
|
||||
case 0:
|
||||
list.add(StatCollector.translateToLocal("oreberrybush5.tooltip"));
|
||||
break;
|
||||
case 1:
|
||||
list.add(StatCollector.translateToLocal("oreberrybush6.tooltip"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class SearedSlabItem extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "brick", "stone", "cobble", "paver", "road", "fancy", "square", "creeper" };
|
||||
|
||||
public SearedSlabItem(Block b)
|
||||
{
|
||||
super(b, "block.searedstone.slab", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class SearedTableItemBlock extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "Table", "Faucet", "Basin" };
|
||||
|
||||
public SearedTableItemBlock(Block b)
|
||||
{
|
||||
super(b, "SearedBlock", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class SlimeGelItemBlock extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "blue", "green", "purple", "magma", "yellow", "red", "metal" };
|
||||
|
||||
public SlimeGelItemBlock(Block b)
|
||||
{
|
||||
super(b, "block.slime.congealed", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class SlimeGrassItemBlock extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "blue", "dirt" };
|
||||
|
||||
public SlimeGrassItemBlock(Block b)
|
||||
{
|
||||
super(b, "block.slime.grass", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class SlimeLeavesItemBlock extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "blue" };
|
||||
|
||||
public SlimeLeavesItemBlock(Block b)
|
||||
{
|
||||
super(b, "block.slime.leaves", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class SlimeSaplingItemBlock extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "bluegreen" };
|
||||
|
||||
public SlimeSaplingItemBlock(Block b)
|
||||
{
|
||||
super(b, "block.slime.sapling", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import tconstruct.common.TRepo;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SlimeTallGrassItem extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "tallgrass", "tallgrass.fern" };
|
||||
|
||||
public SlimeTallGrassItem(Block b)
|
||||
{
|
||||
super(b, "block.slime", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage (int meta)
|
||||
{
|
||||
int arr = MathHelper.clamp_int(meta, 0, this.blockTypes.length);
|
||||
return TRepo.slimeTallGrass.getIcon(0, arr);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SmelteryItemBlock extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "Controller", "Drain", "Brick", "Furnace", "Stone", "Cobblestone", "Paver", "Brick.Cracked", "Road", "Brick.Fancy", "Brick.Square" };
|
||||
|
||||
public SmelteryItemBlock(Block b)
|
||||
{
|
||||
super(b, "Smeltery", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
switch (stack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
list.add(StatCollector.translateToLocal("smeltery.controller.tooltip"));
|
||||
break;
|
||||
case 1:
|
||||
list.add(StatCollector.translateToLocal("smeltery.drain.tooltip1"));
|
||||
list.add(StatCollector.translateToLocal("smeltery.drain.tooltip2"));
|
||||
break;
|
||||
case 3:
|
||||
list.add(StatCollector.translateToLocal("smeltery.furnace.tooltip"));
|
||||
break;
|
||||
default:
|
||||
list.add(StatCollector.translateToLocal("smeltery.brick.tooltip1"));
|
||||
list.add(StatCollector.translateToLocal("smeltery.brick.tooltip2"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SoilSlabItem extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "grass", "dirt", "mycelium", "slime", "grout", "blueslime", "graveyardsoil", "consecratedsoil" };
|
||||
|
||||
public SoilSlabItem(Block b)
|
||||
{
|
||||
super(b, "block.soil.slab", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
switch (stack.getItemDamage())
|
||||
{
|
||||
case 3:
|
||||
list.add(StatCollector.translateToLocal("craftedsoil.slab1.tooltip"));
|
||||
break;
|
||||
case 4:
|
||||
list.add(StatCollector.translateToLocal("craftedsoil.slab2.tooltip"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public class SpeedBlockItem extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "brownstone.rough", "brownstone.rough.road", "brownstone.smooth", "brownstone.smooth.brick", "brownstone.smooth.road", "brownstone.smooth.fancy",
|
||||
"brownstone.smooth.chiseled" };
|
||||
|
||||
public SpeedBlockItem(Block b)
|
||||
{
|
||||
super(b, "block", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
int metadata = stack.getItemDamage();
|
||||
if (metadata == 1 || metadata == 4)
|
||||
list.add(StatCollector.translateToLocal("speedblock1.tooltip"));
|
||||
else
|
||||
list.add(StatCollector.translateToLocal("speedblock2.tooltip"));
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public class SpeedSlabItem extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "brownstone.rough", "brownstone.rough.road", "brownstone.smooth", "brownstone.smooth.brick", "brownstone.smooth.road", "brownstone.smooth.fancy",
|
||||
"brownstone.smooth.chiseled" };
|
||||
|
||||
public SpeedSlabItem(Block b)
|
||||
{
|
||||
super(b, "block", "slab", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
int metadata = stack.getItemDamage() % 8;
|
||||
if (metadata == 1 || metadata == 4)
|
||||
list.add(StatCollector.translateToLocal("speedblock1.tooltip"));
|
||||
else
|
||||
list.add(StatCollector.translateToLocal("speedblock2.tooltip"));
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class StainedGlassClearItem extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "white", "orange", "magenta", "lightblue", "yellow", "lime", "pink", "gray", "lightgray", "cyan", "purple", "blue", "brown", "green", "red", "black" };
|
||||
|
||||
public StainedGlassClearItem(Block b)
|
||||
{
|
||||
super(b, "block.stainedglass", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class StainedGlassClearPaneItem extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "white", "orange", "magenta", "lightblue", "yellow", "lime", "pink", "gray", "lightgray", "cyan", "purple", "blue", "brown", "green", "red", "black" };
|
||||
|
||||
public StainedGlassClearPaneItem(Block b)
|
||||
{
|
||||
super(b, "block.stainedglass", "pane", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class ToolStationItemBlock extends MultiItemBlock
|
||||
{
|
||||
public static final String blockTypes[] = { "Crafter", "Parts", "Parts", "Parts", "Parts", "PatternChest", "PatternChest", "PatternChest", "PatternChest", "PatternChest", "PatternShaper",
|
||||
"PatternShaper", "PatternShaper", "PatternShaper", "CastingTable" };
|
||||
|
||||
public ToolStationItemBlock(Block b)
|
||||
{
|
||||
super(b, "ToolStation", blockTypes);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemDye;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
|
||||
public class WoolSlab1Item extends MultiItemBlock
|
||||
{
|
||||
Block block;
|
||||
|
||||
public WoolSlab1Item(Block b)
|
||||
{
|
||||
super(b, "", "slab", ItemDye.field_150923_a);
|
||||
this.setSpecialIndex(7, 15);
|
||||
this.block = b;
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName (ItemStack par1ItemStack)
|
||||
{
|
||||
int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, 7);
|
||||
return super.getUnlocalizedName() + "." + ItemDye.field_150923_a[7 - i] + ".slab";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
Block b = world.getBlock(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
int trueMeta = meta % 8;
|
||||
boolean flag = (b) != null;
|
||||
|
||||
if ((side == 1 && flag || side == 0 && !flag) && b == this.block && trueMeta == stack.getItemDamage())
|
||||
{
|
||||
if (world.setBlock(x, y, z, Blocks.wool, trueMeta, 3))
|
||||
{
|
||||
world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), this.block.stepSound.soundName,
|
||||
(this.block.stepSound.getVolume() + 1.0F) / 2.0F, this.block.stepSound.getPitch() * 0.8F);
|
||||
--stack.stackSize;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return super.onItemUse(stack, player, world, x, y, z, side, hitX, hitY, hitZ);
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemDye;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
|
||||
public class WoolSlab2Item extends MultiItemBlock
|
||||
{
|
||||
Block block;
|
||||
|
||||
public WoolSlab2Item(Block b)
|
||||
{
|
||||
super(b, "", "slab", ItemDye.field_150923_a);
|
||||
this.setSpecialIndex(0, 7);
|
||||
this.block = b;
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata (int meta)
|
||||
{
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName (ItemStack par1ItemStack)
|
||||
{
|
||||
int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 7, 15);
|
||||
return super.getUnlocalizedName() + "." + ItemDye.field_150923_a[15 - i] + ".slab";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
Block block = world.getBlock(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
int trueMeta = meta % 8;
|
||||
boolean flag = (block) != null;
|
||||
|
||||
if ((side == 1 && flag || side == 0 && !flag) && block == this.block && trueMeta == stack.getItemDamage())
|
||||
{
|
||||
if (world.setBlock(x, y, z, Blocks.wool, trueMeta + 8, 3))
|
||||
{
|
||||
world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), this.block.stepSound.soundName,
|
||||
(this.block.stepSound.getVolume() + 1.0F) / 2.0F, this.block.stepSound.getPitch() * 0.8F);
|
||||
--stack.stackSize;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return super.onItemUse(stack, player, world, x, y, z, side, hitX, hitY, hitZ);
|
||||
}
|
||||
}
|
||||
@@ -10,9 +10,9 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.crafting.ToolBuilder;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -73,13 +73,13 @@ public class Arrow extends ToolCore
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
{
|
||||
return TRepo.arrowhead;
|
||||
return TinkerTools.arrowhead;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getAccessoryItem ()
|
||||
{
|
||||
return TRepo.fletching;
|
||||
return TinkerTools.fletching;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -105,7 +105,7 @@ public class Arrow extends ToolCore
|
||||
ItemStack tool = ToolBuilder.instance.buildTool(new ItemStack(getHeadItem(), 1, 3), new ItemStack(getHandleItem(), 1, 0), accessoryStack, extraStack, "");
|
||||
if (tool == null)
|
||||
{
|
||||
if (!TRepo.supressMissingToolLogs)
|
||||
if (!TinkerTools.supressMissingToolLogs)
|
||||
{
|
||||
TConstruct.logger.warn("Creative builder failed tool for Vanilla style" + this.getToolName());
|
||||
TConstruct.logger.warn("Make sure you do not have item ID conflicts");
|
||||
@@ -128,9 +128,9 @@ public class Arrow extends ToolCore
|
||||
|
||||
if (tool == null)
|
||||
{
|
||||
if (!TRepo.supressMissingToolLogs)
|
||||
if (!TinkerTools.supressMissingToolLogs)
|
||||
{
|
||||
if (!TRepo.supressMissingToolLogs)
|
||||
if (!TinkerTools.supressMissingToolLogs)
|
||||
{
|
||||
TConstruct.logger.warn("Creative builder failed tool for Vanilla style" + this.getToolName());
|
||||
TConstruct.logger.warn("Make sure you do not have item ID conflicts");
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package tconstruct.items.tools;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.tools.Weapon;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -61,7 +61,7 @@ public class BattleSign extends Weapon
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
{
|
||||
return TRepo.signHead;
|
||||
return TinkerTools.signHead;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,11 +15,11 @@ import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.ActiveToolMod;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.library.tools.HarvestTool;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -57,25 +57,25 @@ public class Battleaxe extends HarvestTool
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
{
|
||||
return TRepo.broadAxeHead;
|
||||
return TinkerTools.broadAxeHead;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getHandleItem ()
|
||||
{
|
||||
return TRepo.toughRod;
|
||||
return TinkerTools.toughRod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getAccessoryItem ()
|
||||
{
|
||||
return TRepo.broadAxeHead;
|
||||
return TinkerTools.broadAxeHead;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getExtraItem ()
|
||||
{
|
||||
return TRepo.toughBinding;
|
||||
return TinkerTools.toughBinding;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,11 +22,11 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
|
||||
import net.minecraftforge.event.entity.player.ArrowNockEvent;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.entity.projectile.ArrowEntity;
|
||||
import tconstruct.library.crafting.ToolBuilder;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.tools.entity.ArrowEntity;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -65,7 +65,7 @@ public abstract class BowBase extends ToolCore
|
||||
time = event.charge;
|
||||
|
||||
boolean creative = player.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0;
|
||||
int slotID = getInventorySlotContainItem(TRepo.arrow, player.inventory);
|
||||
int slotID = getInventorySlotContainItem(TinkerTools.arrow, player.inventory);
|
||||
int arrowID = getInventorySlotContainItem(Items.arrow, player.inventory);
|
||||
int arrowState = 0;
|
||||
ItemStack tinkerArrow = null;
|
||||
@@ -151,7 +151,7 @@ public abstract class BowBase extends ToolCore
|
||||
// if (tinkerArrow != null)
|
||||
if (slotID != -1 && (arrowID == -1 || slotID < arrowID))
|
||||
{
|
||||
player.inventory.consumeInventoryItem(TRepo.arrow);
|
||||
player.inventory.consumeInventoryItem(TinkerTools.arrow);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -222,7 +222,7 @@ public abstract class BowBase extends ToolCore
|
||||
return event.result;
|
||||
}
|
||||
|
||||
if (player.capabilities.isCreativeMode || player.inventory.hasItemStack(new ItemStack(Items.arrow)) || player.inventory.hasItemStack(new ItemStack(TRepo.arrow)))
|
||||
if (player.capabilities.isCreativeMode || player.inventory.hasItemStack(new ItemStack(Items.arrow)) || player.inventory.hasItemStack(new ItemStack(TinkerTools.arrow)))
|
||||
{
|
||||
player.setItemInUse(stack, this.getMaxItemUseDuration(stack));
|
||||
}
|
||||
@@ -773,7 +773,7 @@ public abstract class BowBase extends ToolCore
|
||||
ItemStack tool = ToolBuilder.instance.buildTool(new ItemStack(getHeadItem(), 1, id), new ItemStack(getHandleItem(), 1, 0), accessoryStack, extraStack, name + getToolName());
|
||||
if (tool == null)
|
||||
{
|
||||
if (!TRepo.supressMissingToolLogs)
|
||||
if (!TinkerTools.supressMissingToolLogs)
|
||||
{
|
||||
TConstruct.logger.warn("Creative builder failed tool for " + name + this.getToolName());
|
||||
TConstruct.logger.warn("Make sure you do not have item ID conflicts");
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package tconstruct.items.tools;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.tools.Weapon;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
|
||||
public class Broadsword extends Weapon
|
||||
{
|
||||
@@ -15,13 +15,13 @@ public class Broadsword extends Weapon
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
{
|
||||
return TRepo.swordBlade;
|
||||
return TinkerTools.swordBlade;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getAccessoryItem ()
|
||||
{
|
||||
return TRepo.wideGuard;
|
||||
return TinkerTools.wideGuard;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,10 +12,10 @@ import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.crafting.Detailing.DetailInput;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -213,7 +213,7 @@ public class Chisel extends ToolCore
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
{
|
||||
return TRepo.chiselHead;
|
||||
return TinkerTools.chiselHead;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -7,9 +7,9 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.library.tools.Weapon;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -25,25 +25,25 @@ public class Cleaver extends Weapon
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
{
|
||||
return TRepo.largeSwordBlade;
|
||||
return TinkerTools.largeSwordBlade;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getHandleItem ()
|
||||
{
|
||||
return TRepo.toughRod;
|
||||
return TinkerTools.toughRod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getAccessoryItem ()
|
||||
{
|
||||
return TRepo.largePlate;
|
||||
return TinkerTools.largePlate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getExtraItem ()
|
||||
{
|
||||
return TRepo.toughRod;
|
||||
return TinkerTools.toughRod;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package tconstruct.items.tools;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.tools.Weapon;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
|
||||
public class Cutlass extends Weapon
|
||||
{
|
||||
@@ -15,13 +15,13 @@ public class Cutlass extends Weapon
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
{
|
||||
return TRepo.swordBlade;
|
||||
return TinkerTools.swordBlade;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getAccessoryItem ()
|
||||
{
|
||||
return TRepo.fullGuard;
|
||||
return TinkerTools.fullGuard;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,9 +5,9 @@ import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.entity.projectile.DaggerEntity;
|
||||
import tconstruct.library.tools.Weapon;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.tools.entity.DaggerEntity;
|
||||
|
||||
public class Dagger extends Weapon
|
||||
{
|
||||
@@ -101,12 +101,12 @@ public class Dagger extends Weapon
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
{
|
||||
return TRepo.knifeBlade;
|
||||
return TinkerTools.knifeBlade;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getAccessoryItem ()
|
||||
{
|
||||
return TRepo.crossbar;
|
||||
return TinkerTools.crossbar;
|
||||
}
|
||||
}
|
||||
@@ -9,11 +9,11 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.ActiveToolMod;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.library.tools.HarvestTool;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -42,25 +42,25 @@ public class Excavator extends HarvestTool
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
{
|
||||
return TRepo.excavatorHead;
|
||||
return TinkerTools.excavatorHead;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getHandleItem ()
|
||||
{
|
||||
return TRepo.toughRod;
|
||||
return TinkerTools.toughRod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getAccessoryItem ()
|
||||
{
|
||||
return TRepo.largePlate;
|
||||
return TinkerTools.largePlate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getExtraItem ()
|
||||
{
|
||||
return TRepo.toughBinding;
|
||||
return TinkerTools.toughBinding;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,11 +12,11 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.blocks.logic.EquipLogic;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.crafting.ToolBuilder;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.library.tools.Weapon;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.tools.logic.EquipLogic;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -125,14 +125,14 @@ public class FryingPan extends Weapon
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (!TRepo.heldItemBlock.canPlaceBlockAt(world, x, y, z))
|
||||
else if (!TinkerTools.heldItemBlock.canPlaceBlockAt(world, x, y, z))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
world.setBlock(x, y, z, TRepo.heldItemBlock, 0, 3);
|
||||
TRepo.heldItemBlock.onBlockPlacedBy(world, x, y, z, player, stack);
|
||||
world.setBlock(x, y, z, TinkerTools.heldItemBlock, 0, 3);
|
||||
TinkerTools.heldItemBlock.onBlockPlacedBy(world, x, y, z, player, stack);
|
||||
world.playSoundEffect(x, y, z, "tinker:frypan_hit", 1.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 0.65F);
|
||||
|
||||
EquipLogic logic = (EquipLogic) world.getTileEntity(x, y, z);
|
||||
@@ -147,7 +147,7 @@ public class FryingPan extends Weapon
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
{
|
||||
return TRepo.frypanHead;
|
||||
return TinkerTools.frypanHead;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,12 +14,12 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.ActiveToolMod;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.ToolBuilder;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.library.tools.HarvestTool;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -73,25 +73,25 @@ public class Hammer extends HarvestTool
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
{
|
||||
return TRepo.hammerHead;
|
||||
return TinkerTools.hammerHead;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getHandleItem ()
|
||||
{
|
||||
return TRepo.toughRod;
|
||||
return TinkerTools.toughRod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getAccessoryItem ()
|
||||
{
|
||||
return TRepo.largePlate;
|
||||
return TinkerTools.largePlate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getExtraItem ()
|
||||
{
|
||||
return TRepo.largePlate;
|
||||
return TinkerTools.largePlate;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,9 +6,9 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.library.tools.HarvestTool;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -50,7 +50,7 @@ public class Hatchet extends HarvestTool
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
{
|
||||
return TRepo.hatchetHead;
|
||||
return TinkerTools.hatchetHead;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,8 +8,8 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.tools.Weapon;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -102,13 +102,13 @@ public class Longsword extends Weapon
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
{
|
||||
return TRepo.swordBlade;
|
||||
return TinkerTools.swordBlade;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getAccessoryItem ()
|
||||
{
|
||||
return TRepo.handGuard;
|
||||
return TinkerTools.handGuard;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,11 +9,11 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.ActiveToolMod;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.library.tools.HarvestTool;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -324,25 +324,25 @@ public class LumberAxe extends HarvestTool
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
{
|
||||
return TRepo.broadAxeHead;
|
||||
return TinkerTools.broadAxeHead;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getHandleItem ()
|
||||
{
|
||||
return TRepo.toughRod;
|
||||
return TinkerTools.toughRod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getAccessoryItem ()
|
||||
{
|
||||
return TRepo.largePlate;
|
||||
return TinkerTools.largePlate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getExtraItem ()
|
||||
{
|
||||
return TRepo.toughBinding;
|
||||
return TinkerTools.toughBinding;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -9,10 +9,10 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.crafting.ToolBuilder;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.library.tools.DualHarvestTool;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
|
||||
public class Mattock extends DualHarvestTool
|
||||
@@ -59,13 +59,13 @@ public class Mattock extends DualHarvestTool
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
{
|
||||
return TRepo.hatchetHead;
|
||||
return TinkerTools.hatchetHead;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getAccessoryItem ()
|
||||
{
|
||||
return TRepo.shovelHead;
|
||||
return TinkerTools.shovelHead;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -128,7 +128,7 @@ public class Mattock extends DualHarvestTool
|
||||
ItemStack tool = ToolBuilder.instance.buildTool(new ItemStack(getHeadItem(), 1, id), new ItemStack(getHandleItem(), 1, id), accessoryStack, extraStack, name + getToolName());
|
||||
if (tool == null)
|
||||
{
|
||||
if (!TRepo.supressMissingToolLogs)
|
||||
if (!TinkerTools.supressMissingToolLogs)
|
||||
{
|
||||
TConstruct.logger.warn("Creative builder failed tool for " + name + this.getToolName());
|
||||
TConstruct.logger.warn("Make sure you do not have item ID conflicts");
|
||||
|
||||
@@ -2,8 +2,8 @@ package tconstruct.items.tools;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.Item;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.tools.HarvestTool;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
|
||||
public class Pickaxe extends HarvestTool
|
||||
{
|
||||
@@ -30,13 +30,13 @@ public class Pickaxe extends HarvestTool
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
{
|
||||
return TRepo.pickaxeHead;
|
||||
return TinkerTools.pickaxeHead;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getAccessoryItem ()
|
||||
{
|
||||
return TRepo.binding;
|
||||
return TinkerTools.binding;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,7 +15,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.entity.projectile.LaunchedPotion;
|
||||
import tconstruct.tools.entity.LaunchedPotion;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.tools.Weapon;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
|
||||
public class Rapier extends Weapon
|
||||
{
|
||||
@@ -75,13 +75,13 @@ public class Rapier extends Weapon
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
{
|
||||
return TRepo.swordBlade;
|
||||
return TinkerTools.swordBlade;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getAccessoryItem ()
|
||||
{
|
||||
return TRepo.crossbar;
|
||||
return TinkerTools.crossbar;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,11 +19,11 @@ import net.minecraft.stats.StatList;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IShearable;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.ActiveToolMod;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.library.tools.Weapon;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -52,25 +52,25 @@ public class Scythe extends Weapon
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
{
|
||||
return TRepo.scytheBlade;
|
||||
return TinkerTools.scytheBlade;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getHandleItem ()
|
||||
{
|
||||
return TRepo.toughRod;
|
||||
return TinkerTools.toughRod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getAccessoryItem ()
|
||||
{
|
||||
return TRepo.toughBinding;
|
||||
return TinkerTools.toughBinding;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getExtraItem ()
|
||||
{
|
||||
return TRepo.toughRod;
|
||||
return TinkerTools.toughRod;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -10,7 +10,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -55,19 +55,19 @@ public class Shortbow extends BowBase
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
{
|
||||
return TRepo.toolRod;
|
||||
return TinkerTools.toolRod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getHandleItem ()
|
||||
{
|
||||
return TRepo.bowstring;
|
||||
return TinkerTools.bowstring;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getAccessoryItem ()
|
||||
{
|
||||
return TRepo.toolRod;
|
||||
return TinkerTools.toolRod;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,8 +2,8 @@ package tconstruct.items.tools;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.Item;
|
||||
import tconstruct.common.TRepo;
|
||||
import tconstruct.library.tools.HarvestTool;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -32,7 +32,7 @@ public class Shovel extends HarvestTool
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
{
|
||||
return TRepo.shovelHead;
|
||||
return TinkerTools.shovelHead;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user