Chisel Start

This commit is contained in:
mDiyo 2013-04-27 01:06:09 -07:00
parent 4c8b172068
commit 0080dd934a
107 changed files with 812 additions and 577 deletions

View File

@ -1,10 +1,12 @@
package mods.tinker.common; package mods.tinker.common;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import mods.tinker.tconstruct.library.ToolCore;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
@ -157,4 +159,9 @@ public abstract class ToolMod
} }
} }
} }
public boolean validType(ToolCore tool)
{
return true;
}
} }

View File

@ -127,6 +127,14 @@ Other liquid removal objects will work, but are frowned upon. An example picture
</item> </item>
</page> </page>
<page type="sidebar">
<text>Blank casts are made by pouring aluminum brass or gold into an empty casting table.</text>
<item>
<text>Blank Cast</text>
<icon>blankcast</icon>
</item>
</page>
<page type="crafting"> <page type="crafting">
<text>Grout</text> <text>Grout</text>
<recipe> <recipe>

View File

@ -28,7 +28,7 @@ import cpw.mods.fml.common.registry.VillagerRegistry;
* @dependencies: IC2 API, EBXL API * @dependencies: IC2 API, EBXL API
*/ */
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.2.dev1", dependencies = "required-after:Forge@[7.7.1.659,)") @Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.2.dev23", dependencies = "required-after:Forge@[7.7.1.659,)")
@NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.TPacketHandler.class) @NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.TPacketHandler.class)
public class TConstruct public class TConstruct
{ {

View File

@ -16,6 +16,7 @@ import mods.tinker.tconstruct.blocks.StoneTorch;
import mods.tinker.tconstruct.blocks.TConstructBlock; import mods.tinker.tconstruct.blocks.TConstructBlock;
import mods.tinker.tconstruct.blocks.TMetalBlock; import mods.tinker.tconstruct.blocks.TMetalBlock;
import mods.tinker.tconstruct.blocks.ToolStationBlock; import mods.tinker.tconstruct.blocks.ToolStationBlock;
import mods.tinker.tconstruct.blocks.infiblocks.SpeedBlock;
import mods.tinker.tconstruct.crafting.LiquidBlockCasting; import mods.tinker.tconstruct.crafting.LiquidBlockCasting;
import mods.tinker.tconstruct.crafting.LiquidCasting; import mods.tinker.tconstruct.crafting.LiquidCasting;
import mods.tinker.tconstruct.crafting.PatternBuilder; import mods.tinker.tconstruct.crafting.PatternBuilder;
@ -44,6 +45,7 @@ import mods.tinker.tconstruct.items.blocks.OreberryBushItem;
import mods.tinker.tconstruct.items.blocks.OreberryBushSecondItem; import mods.tinker.tconstruct.items.blocks.OreberryBushSecondItem;
import mods.tinker.tconstruct.items.blocks.SearedTableItemBlock; import mods.tinker.tconstruct.items.blocks.SearedTableItemBlock;
import mods.tinker.tconstruct.items.blocks.SmelteryItemBlock; import mods.tinker.tconstruct.items.blocks.SmelteryItemBlock;
import mods.tinker.tconstruct.items.blocks.SpeedBlockItem;
import mods.tinker.tconstruct.items.blocks.ToolStationItemBlock; import mods.tinker.tconstruct.items.blocks.ToolStationItemBlock;
import mods.tinker.tconstruct.library.TConstructRegistry; import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.library.ToolCore; import mods.tinker.tconstruct.library.ToolCore;
@ -275,7 +277,7 @@ public class TContent implements IFuelHandler
String[] metalTypes = new String[] { "compressed_cobalt", "compressed_ardite", "compressed_manyullyn", "compressed_copper", "compressed_bronze", "compressed_tin", "compressed_aluminum", String[] metalTypes = new String[] { "compressed_cobalt", "compressed_ardite", "compressed_manyullyn", "compressed_copper", "compressed_bronze", "compressed_tin", "compressed_aluminum",
"compressed_alubrass", "compressed_alumite", "compressed_steel" }; "compressed_alubrass", "compressed_alumite", "compressed_steel" };
metalBlock = new TMetalBlock(PHConstruct.metalBlock, Material.iron, 10.0F, metalTypes); metalBlock = new TMetalBlock(PHConstruct.metalBlock, Material.iron, 10.0F, metalTypes).setUnlocalizedName("tconstruct.metalblock");
metalBlock.stepSound = Block.soundMetalFootstep; metalBlock.stepSound = Block.soundMetalFootstep;
GameRegistry.registerBlock(metalBlock, MetalItemBlock.class, "MetalBlock"); GameRegistry.registerBlock(metalBlock, MetalItemBlock.class, "MetalBlock");
@ -322,7 +324,7 @@ public class TContent implements IFuelHandler
GameRegistry.registerBlock(oreBerrySecond, OreberryBushSecondItem.class, "ore.berries.two"); GameRegistry.registerBlock(oreBerrySecond, OreberryBushSecondItem.class, "ore.berries.two");
String[] oreTypes = new String[] { "nether_slag", "nether_cobalt", "nether_ardite", "ore_copper", "ore_tin", "ore_aluminum", "ore_slag" }; String[] oreTypes = new String[] { "nether_slag", "nether_cobalt", "nether_ardite", "ore_copper", "ore_tin", "ore_aluminum", "ore_slag" };
oreSlag = new MetalOre(PHConstruct.oreSlag, Material.iron, 10.0F, oreTypes); oreSlag = new MetalOre(PHConstruct.oreSlag, Material.iron, 10.0F, oreTypes).setUnlocalizedName("tconstruct.stoneore");
GameRegistry.registerBlock(oreSlag, MetalOreItemBlock.class, "SearedBrick"); GameRegistry.registerBlock(oreSlag, MetalOreItemBlock.class, "SearedBrick");
MinecraftForge.setBlockHarvestLevel(oreSlag, 1, "pickaxe", 4); MinecraftForge.setBlockHarvestLevel(oreSlag, 1, "pickaxe", 4);
MinecraftForge.setBlockHarvestLevel(oreSlag, 2, "pickaxe", 4); MinecraftForge.setBlockHarvestLevel(oreSlag, 2, "pickaxe", 4);
@ -330,7 +332,7 @@ public class TContent implements IFuelHandler
MinecraftForge.setBlockHarvestLevel(oreSlag, 4, "pickaxe", 1); MinecraftForge.setBlockHarvestLevel(oreSlag, 4, "pickaxe", 1);
MinecraftForge.setBlockHarvestLevel(oreSlag, 5, "pickaxe", 1); MinecraftForge.setBlockHarvestLevel(oreSlag, 5, "pickaxe", 1);
oreGravel = new GravelOre(PHConstruct.oreGravel).setUnlocalizedName("GravelOre"); oreGravel = new GravelOre(PHConstruct.oreGravel).setUnlocalizedName("GravelOre").setUnlocalizedName("tconstruct.gravelore");
GameRegistry.registerBlock(oreGravel, GravelOreItem.class, "GravelOre"); GameRegistry.registerBlock(oreGravel, GravelOreItem.class, "GravelOre");
MinecraftForge.setBlockHarvestLevel(oreGravel, 0, "shovel", 1); MinecraftForge.setBlockHarvestLevel(oreGravel, 0, "shovel", 1);
@ -340,8 +342,8 @@ public class TContent implements IFuelHandler
MinecraftForge.setBlockHarvestLevel(oreGravel, 4, "shovel", 1); MinecraftForge.setBlockHarvestLevel(oreGravel, 4, "shovel", 1);
MinecraftForge.setBlockHarvestLevel(oreGravel, 5, "shovel", 4); MinecraftForge.setBlockHarvestLevel(oreGravel, 5, "shovel", 4);
/*speedBlock = new SpeedBlock(PHConstruct.speedBlock).setUnlocalizedName("SpeedBlock"); speedBlock = new SpeedBlock(PHConstruct.speedBlock).setUnlocalizedName("SpeedBlock");
GameRegistry.registerBlock(speedBlock, SpeedBlockItem.class, "SpeedBlock");*/ GameRegistry.registerBlock(speedBlock, SpeedBlockItem.class, "SpeedBlock");
/*redstoneBallRepeater = new RedstoneBallRepeater(PHConstruct.redstoneBallRepeater, false).setUnlocalizedName("decoration.redstoneballrepeater"); /*redstoneBallRepeater = new RedstoneBallRepeater(PHConstruct.redstoneBallRepeater, false).setUnlocalizedName("decoration.redstoneballrepeater");
GameRegistry.registerBlock(redstoneBallRepeater, "decoration.redstoneballrepeater"); GameRegistry.registerBlock(redstoneBallRepeater, "decoration.redstoneballrepeater");
@ -688,6 +690,8 @@ public class TContent implements IFuelHandler
lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 8), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 10), null, true, 100); //alumite lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 8), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 10), null, true, 100); //alumite
lbc.addBlockCastingRecipe(new ItemStack(Block.obsidian), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 11), null, true, 100);// obsidian lbc.addBlockCastingRecipe(new ItemStack(Block.obsidian), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 11), null, true, 100);// obsidian
lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 9), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 12), null, true, 100); //steel lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 9), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 12), null, true, 100); //steel
lbc.addBlockCastingRecipe(new ItemStack(speedBlock, 1, 0), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue / 9, 3), new ItemStack(Block.gravel), true, 100); //steel
} }
//WeakReference<ToolCore> tool = new WeakReference<ToolCore>(null); //WeakReference<ToolCore> tool = new WeakReference<ToolCore>(null);
@ -944,15 +948,15 @@ public class TContent implements IFuelHandler
{ {
ItemStack ironpick = ToolBuilder.instance.buildTool(new ItemStack(TContent.pickaxeHead, 1, 6), new ItemStack(TContent.toolRod, 1, 2), new ItemStack(TContent.binding, 1, 6), ""); ItemStack ironpick = ToolBuilder.instance.buildTool(new ItemStack(TContent.pickaxeHead, 1, 6), new ItemStack(TContent.toolRod, 1, 2), new ItemStack(TContent.binding, 1, 6), "");
/* IC2 */ /* IC2 */
ItemStack reBattery = ic2.api.Items.getItem("reBattery"); ItemStack reBattery = ic2.api.item.Items.getItem("reBattery");
if (reBattery != null) if (reBattery != null)
modE.batteries.add(reBattery); modE.batteries.add(reBattery);
ItemStack chargedReBattery = ic2.api.Items.getItem("chargedReBattery"); ItemStack chargedReBattery = ic2.api.item.Items.getItem("chargedReBattery");
if (chargedReBattery != null) if (chargedReBattery != null)
{ {
modE.batteries.add(chargedReBattery); modE.batteries.add(chargedReBattery);
} }
ItemStack electronicCircuit = ic2.api.Items.getItem("electronicCircuit"); ItemStack electronicCircuit = ic2.api.item.Items.getItem("electronicCircuit");
if (electronicCircuit != null) if (electronicCircuit != null)
modE.circuits.add(electronicCircuit); modE.circuits.add(electronicCircuit);

View File

@ -258,7 +258,7 @@ public class OreberryBush extends BlockLeavesBase implements IPlantable
return; return;
} }
if (random1.nextInt(12) == 0)// && world.getBlockLightValue(x, y, z) <= 8) if (random1.nextInt(20) == 0)// && world.getBlockLightValue(x, y, z) <= 8)
{ {
int meta = world.getBlockMetadata(x, y, z); int meta = world.getBlockMetadata(x, y, z);
if (world.getFullBlockLightValue(x, y, z) < 13) if (world.getFullBlockLightValue(x, y, z) < 13)

View File

@ -416,11 +416,11 @@ public class TProxyClient extends TProxyCommon
{ {
TConstructClientRegistry.addMaterialRenderMapping(partIter, "tinker", partTypes[partIter], true); TConstructClientRegistry.addMaterialRenderMapping(partIter, "tinker", partTypes[partIter], true);
} }
for (int effectIter = 0; effectIter < 2; effectIter++) for (int effectIter = 0; effectIter < 3; effectIter++)
{ {
TConstructClientRegistry.addEffectRenderMapping(effectIter, "tinker", effectTypes[effectIter], true); TConstructClientRegistry.addEffectRenderMapping(effectIter, "tinker", effectTypes[effectIter], true);
} }
for (int effectIter = 3; effectIter < effectTypes.length; effectIter++) for (int effectIter = 4; effectIter < effectTypes.length; effectIter++)
{ {
TConstructClientRegistry.addEffectRenderMapping(effectIter, "tinker", effectTypes[effectIter], true); TConstructClientRegistry.addEffectRenderMapping(effectIter, "tinker", effectTypes[effectIter], true);
} }

View File

@ -348,7 +348,7 @@ public class SearedRender implements ISimpleBlockRenderingHandler
CastingBasinLogic logic = (CastingBasinLogic) world.getBlockTileEntity(x, y, z); CastingBasinLogic logic = (CastingBasinLogic) world.getBlockTileEntity(x, y, z);
if (logic.liquid != null) if (logic.liquid != null)
{ {
float height = logic.getLiquidAmount() / (logic.getCapacity() * 1.03F) * 0.6875F; float height = logic.getLiquidAmount() / (logic.getCapacity() * 1.05F) * 0.6875F;
renderer.setRenderBounds(0.0625F, 0.25f, 0.0625F, 0.9375F, 0.25f + height, 0.9375F); renderer.setRenderBounds(0.0625F, 0.25f, 0.0625F, 0.9375F, 0.25f + height, 0.9375F);
if (logic.liquid.itemID < 4096) //Block if (logic.liquid.itemID < 4096) //Block
{ {

View File

@ -90,6 +90,8 @@ public class DaggerRender extends Render
{ {
this.renderDroppedItem(rotator, icon, b0, par9, 1.0F, 1.0F, 1.0F); this.renderDroppedItem(rotator, icon, b0, par9, 1.0F, 1.0F, 1.0F);
} }
GL11.glScalef(1.005f, 1.005f, 1.005f);
//GL11.glTranslatef(0F, -0.0025F, 0.0F);
} }
} }
else else

View File

@ -457,8 +457,8 @@ public class RotatingBase extends Entity
rotationYaw = data.readFloat(); rotationYaw = data.readFloat();
NBTTagCompound compound = new NBTTagCompound(); NBTTagCompound compound = new NBTTagCompound();
NBTTagCompound toolTag = new NBTTagCompound(); NBTTagCompound toolTag = new NBTTagCompound();
toolTag.setInteger("RenderHead", data.readInt());
toolTag.setInteger("RenderHandle", data.readInt()); toolTag.setInteger("RenderHandle", data.readInt());
toolTag.setInteger("RenderHead", data.readInt());
toolTag.setInteger("RenderAccessory", data.readInt()); toolTag.setInteger("RenderAccessory", data.readInt());
switch (data.readInt()) switch (data.readInt())
{ {

View File

@ -1,7 +1,7 @@
package mods.tinker.tconstruct.library; package mods.tinker.tconstruct.library;
import ic2.api.ICustomElectricItem; import ic2.api.item.ICustomElectricItem;
import ic2.api.IElectricItem; import ic2.api.item.IElectricItem;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
@ -9,7 +9,6 @@ import java.util.Random;
import mods.tinker.common.PiercingEntityDamage; import mods.tinker.common.PiercingEntityDamage;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.enchantment.EnchantmentThorns; import net.minecraft.enchantment.EnchantmentThorns;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@ -26,13 +25,11 @@ import net.minecraft.stats.AchievementList;
import net.minecraft.stats.StatList; import net.minecraft.stats.StatList;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.Event.Result; import net.minecraftforge.event.Event.Result;
import net.minecraftforge.event.entity.player.UseHoeEvent; import net.minecraftforge.event.entity.player.UseHoeEvent;
import cpw.mods.fml.client.FMLClientHandler;
public class AbilityHelper public class AbilityHelper
{ {

View File

@ -33,6 +33,8 @@ public abstract class DualHarvestTool extends HarvestTool
int bID = player.worldObj.getBlockId(x, y, z); int bID = player.worldObj.getBlockId(x, y, z);
int meta = world.getBlockMetadata(x, y, z); int meta = world.getBlockMetadata(x, y, z);
Block block = Block.blocksList[bID]; Block block = Block.blocksList[bID];
if (block == null || bID < 1)
return false;
int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType());
int shlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getSecondHarvestType()); int shlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getSecondHarvestType());
@ -137,6 +139,12 @@ public abstract class DualHarvestTool extends HarvestTool
return false; return false;
} }
@Override
public String[] toolCategories()
{
return new String[] { "harvest", "dualharvest" };
}
protected abstract Material[] getEffectiveSecondaryMaterials(); protected abstract Material[] getEffectiveSecondaryMaterials();
protected abstract String getSecondHarvestType(); protected abstract String getSecondHarvestType();
} }

View File

@ -33,6 +33,8 @@ public abstract class HarvestTool extends ToolCore
int bID = player.worldObj.getBlockId(x, y, z); int bID = player.worldObj.getBlockId(x, y, z);
int meta = world.getBlockMetadata(x, y, z); int meta = world.getBlockMetadata(x, y, z);
Block block = Block.blocksList[bID]; Block block = Block.blocksList[bID];
if (block == null || bID < 1)
return false;
int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType());
if (hlvl <= tags.getInteger("HarvestLevel")) if (hlvl <= tags.getInteger("HarvestLevel"))
@ -121,6 +123,12 @@ public abstract class HarvestTool extends ToolCore
return false; return false;
} }
@Override
public String[] toolCategories()
{
return new String[] { "harvest" };
}
protected abstract Material[] getEffectiveMaterials (); protected abstract Material[] getEffectiveMaterials ();
protected abstract String getHarvestType (); protected abstract String getHarvestType ();

View File

@ -1,7 +1,7 @@
package mods.tinker.tconstruct.library; package mods.tinker.tconstruct.library;
import ic2.api.IBoxable; import ic2.api.item.IBoxable;
import ic2.api.ICustomElectricItem; import ic2.api.item.ICustomElectricItem;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
@ -426,10 +426,10 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
return ret; return ret;
} }
/* Creative mode tools */
static String[] toolMaterialNames = { "Wooden ", "Stone ", "Iron ", "Flint ", "Cactus ", "Bone ", "Obsidian ", "Nethrrack ", "Slime ", "Paper ", "Cobalt ", "Ardite ", "Manyullyn ", "Copper ", static String[] toolMaterialNames = { "Wooden ", "Stone ", "Iron ", "Flint ", "Cactus ", "Bone ", "Obsidian ", "Nethrrack ", "Slime ", "Paper ", "Cobalt ", "Ardite ", "Manyullyn ", "Copper ",
"Bronze ", "Alumite ", "Steel ", "Slime " }; "Bronze ", "Alumite ", "Steel ", "Slime " };
/* Creative mode tools */
public void getSubItems (int id, CreativeTabs tab, List list) public void getSubItems (int id, CreativeTabs tab, List list)
{ {
for (int i = 0; i < 18; i++) for (int i = 0; i < 18; i++)
@ -451,6 +451,8 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
return TConstructRegistry.toolRod; return TConstructRegistry.toolRod;
} }
/* Updating */
public void onUpdate (ItemStack stack, World world, Entity entity, int par4, boolean par5) public void onUpdate (ItemStack stack, World world, Entity entity, int par4, boolean par5)
{ {
if (!world.isRemote && entity instanceof EntityLiving) if (!world.isRemote && entity instanceof EntityLiving)
@ -469,6 +471,11 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
} }
/* Tool uses */ /* Tool uses */
//Types
public abstract String[] toolCategories();
//Mining
@Override @Override
public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPlayer player) public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPlayer player)
{ {
@ -507,12 +514,6 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
return AbilityHelper.onBlockChanged(itemstack, world, bID, x, y, z, player, random); return AbilityHelper.onBlockChanged(itemstack, world, bID, x, y, z, player, random);
} }
@Override
public boolean hitEntity (ItemStack stack, EntityLiving mob, EntityLiving player)
{
return true;
}
@Override @Override
public float getStrVsBlock (ItemStack stack, Block block, int meta) public float getStrVsBlock (ItemStack stack, Block block, int meta)
{ {
@ -522,24 +523,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
return 1f; return 1f;
} }
//Vanilla repairs // Attacking
public boolean isItemTool (ItemStack par1ItemStack)
{
return false;
}
@Override
public boolean getIsRepairable (ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return false;
}
public boolean isRepairable()
{
return false;
}
/* Attacking */
@Override @Override
public boolean onLeftClickEntity (ItemStack stack, EntityPlayer player, Entity entity) public boolean onLeftClickEntity (ItemStack stack, EntityPlayer player, Entity entity)
{ {
@ -547,12 +531,13 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
return true; return true;
} }
public boolean pierceArmor () @Override
public boolean hitEntity (ItemStack stack, EntityLiving mob, EntityLiving player)
{ {
return false; return true;
} }
public boolean rangedTool () public boolean pierceArmor ()
{ {
return false; return false;
} }
@ -567,23 +552,11 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
return this.damageVsEntity; return this.damageVsEntity;
} }
/* Enchanting */
public int getItemEnchantability ()
{
return 0;
}
//Changes how much durability the base tool has //Changes how much durability the base tool has
public float getDurabilityModifier () public float getDurabilityModifier ()
{ {
return 1f; return 1f;
} }
public boolean isFull3D ()
{
return true;
}
/* /*
* IC2 Support * IC2 Support
* Every tool can be an electric tool if you modify it right * Every tool can be an electric tool if you modify it right
@ -725,4 +698,32 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
{ {
return false; return false;
} }
//Vanilla overrides
public boolean isItemTool (ItemStack par1ItemStack)
{
return false;
}
@Override
public boolean getIsRepairable (ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return false;
}
public boolean isRepairable()
{
return false;
}
public int getItemEnchantability ()
{
return 0;
}
public boolean isFull3D ()
{
return true;
}
} }

View File

@ -92,12 +92,19 @@ public abstract class Weapon extends ToolCore
return 1; return 1;
} }
@Override
public boolean onLeftClickEntity (ItemStack stack, EntityPlayer player, Entity entity) public boolean onLeftClickEntity (ItemStack stack, EntityPlayer player, Entity entity)
{ {
TContent.modL.midStreamModify(stack); TContent.modL.midStreamModify(stack);
return super.onLeftClickEntity(stack, player, entity); return super.onLeftClickEntity(stack, player, entity);
} }
@Override
public String[] toolCategories()
{
return new String[] { "weapon", "melee" };
}
public static Material[] web = new Material[] { Material.web }; public static Material[] web = new Material[] { Material.web };
public static Material[] none = new Material[0]; public static Material[] none = new Material[0];
} }

View File

@ -19,8 +19,7 @@ import net.minecraftforge.liquids.ILiquidTank;
import net.minecraftforge.liquids.ITankContainer; import net.minecraftforge.liquids.ITankContainer;
import net.minecraftforge.liquids.LiquidStack; import net.minecraftforge.liquids.LiquidStack;
public class CastingBasinLogic extends InventoryLogic public class CastingBasinLogic extends InventoryLogic implements ILiquidTank, ITankContainer, ISidedInventory
implements ILiquidTank, ITankContainer, ISidedInventory
{ {
public LiquidStack liquid; public LiquidStack liquid;
int castingDelay = 0; int castingDelay = 0;
@ -143,14 +142,14 @@ public class CastingBasinLogic extends InventoryLogic
} }
@Override @Override
public void onInventoryChanged() public void onInventoryChanged ()
{ {
super.onInventoryChanged(); super.onInventoryChanged();
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
needsUpdate = true; needsUpdate = true;
} }
public ItemStack decrStackSize(int slot, int quantity) public ItemStack decrStackSize (int slot, int quantity)
{ {
ItemStack stack = super.decrStackSize(slot, quantity); ItemStack stack = super.decrStackSize(slot, quantity);
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
@ -209,7 +208,7 @@ public class CastingBasinLogic extends InventoryLogic
return this; return this;
} }
public int getLiquidAmount() public int getLiquidAmount ()
{ {
return liquid.amount - renderOffset; return liquid.amount - renderOffset;
} }
@ -304,27 +303,23 @@ public class CastingBasinLogic extends InventoryLogic
} }
@Override @Override
public int[] getSizeInventorySide (int var1) public int[] getSizeInventorySide (int side) //getValidSlotsForSide
{ {
return new int[] {1, 1, 1, 1, 1, 1, 1}; if (side == 0)
return new int[] { 1 };
else
return new int[] { 0 };
} }
@Override @Override
public boolean func_102007_a (int i, ItemStack itemstack, int j) public boolean func_102007_a (int slot, ItemStack itemstack, int side)
{ {
if (j == 0)
return false;
else
return true; return true;
} }
@Override @Override
public boolean func_102008_b (int i, ItemStack itemstack, int j) public boolean func_102008_b (int slot, ItemStack itemstack, int side)
{ {
/*if (j == 0)
return false;
else
return true;*/
return true; return true;
} }

View File

@ -19,8 +19,7 @@ import net.minecraftforge.liquids.ILiquidTank;
import net.minecraftforge.liquids.ITankContainer; import net.minecraftforge.liquids.ITankContainer;
import net.minecraftforge.liquids.LiquidStack; import net.minecraftforge.liquids.LiquidStack;
public class CastingTableLogic extends InventoryLogic public class CastingTableLogic extends InventoryLogic implements ILiquidTank, ITankContainer, ISidedInventory
implements ILiquidTank, ITankContainer, ISidedInventory
{ {
public LiquidStack liquid; public LiquidStack liquid;
int castingDelay = 0; int castingDelay = 0;
@ -143,14 +142,14 @@ public class CastingTableLogic extends InventoryLogic
} }
@Override @Override
public void onInventoryChanged() public void onInventoryChanged ()
{ {
super.onInventoryChanged(); super.onInventoryChanged();
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
needsUpdate = true; needsUpdate = true;
} }
public ItemStack decrStackSize(int slot, int quantity) public ItemStack decrStackSize (int slot, int quantity)
{ {
ItemStack stack = super.decrStackSize(slot, quantity); ItemStack stack = super.decrStackSize(slot, quantity);
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
@ -209,7 +208,7 @@ public class CastingTableLogic extends InventoryLogic
return this; return this;
} }
public int getLiquidAmount() public int getLiquidAmount ()
{ {
return liquid.amount - renderOffset; return liquid.amount - renderOffset;
} }
@ -304,27 +303,23 @@ public class CastingTableLogic extends InventoryLogic
} }
@Override @Override
public int[] getSizeInventorySide (int var1) public int[] getSizeInventorySide (int side)
{ {
return new int[] {1, 1, 1, 1, 1, 1, 1}; if (side == 0)
return new int[] { 1 };
else
return new int[] { 0 };
} }
@Override @Override
public boolean func_102007_a (int i, ItemStack itemstack, int j) public boolean func_102007_a (int i, ItemStack itemstack, int j)
{ {
if (j == 0)
return false;
else
return true; return true;
} }
@Override @Override
public boolean func_102008_b (int i, ItemStack itemstack, int j) public boolean func_102008_b (int i, ItemStack itemstack, int j)
{ {
/*if (j == 0)
return false;
else
return true;*/
return true; return true;
} }

View File

@ -333,7 +333,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
return false; return false;
currentLiquid += liquid.amount; currentLiquid += liquid.amount;
System.out.println("Current liquid: "+currentLiquid); //System.out.println("Current liquid: "+currentLiquid);
boolean added = false; boolean added = false;
for (int i = 0; i < moltenMetal.size(); i++) for (int i = 0; i < moltenMetal.size(); i++)
{ {

View File

@ -1,5 +1,8 @@
package mods.tinker.tconstruct.modifiers; package mods.tinker.tconstruct.modifiers;
import java.util.Arrays;
import java.util.List;
import mods.tinker.common.ToolMod; import mods.tinker.common.ToolMod;
import mods.tinker.tconstruct.library.ToolCore; import mods.tinker.tconstruct.library.ToolCore;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -48,7 +51,7 @@ public class ModAttack extends ToolMod
{ {
int amount = 24; int amount = 24;
ToolCore toolItem = (ToolCore) tool.getItem(); ToolCore toolItem = (ToolCore) tool.getItem();
if (toolItem.pierceArmor() || toolItem.rangedTool()) if (toolItem.pierceArmor() || !validType(toolItem))
amount = 36; amount = 36;
int[] keyPair = tags.getIntArray(key); int[] keyPair = tags.getIntArray(key);
@ -103,4 +106,10 @@ public class ModAttack extends ToolMod
String modName = "\u00a7f"+guiType+" ("+keys[0]+"/"+keys[1]+")"; String modName = "\u00a7f"+guiType+" ("+keys[0]+"/"+keys[1]+")";
tags.setString(tip, modName); tags.setString(tip, modName);
} }
public boolean validType(ToolCore tool)
{
List list = Arrays.asList(tool.toolCategories());
return list.contains("throwing");
}
} }

View File

@ -1,6 +1,10 @@
package mods.tinker.tconstruct.modifiers; package mods.tinker.tconstruct.modifiers;
import java.util.Arrays;
import java.util.List;
import mods.tinker.common.ToolMod; import mods.tinker.common.ToolMod;
import mods.tinker.tconstruct.library.ToolCore;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
@ -21,6 +25,9 @@ public class ModBlaze extends ToolMod
@Override @Override
protected boolean canModify (ItemStack tool, ItemStack[] input) protected boolean canModify (ItemStack tool, ItemStack[] input)
{ {
ToolCore toolItem = (ToolCore) tool.getItem();
if (!validType(toolItem))
return false;
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
if (!tags.hasKey(key)) if (!tags.hasKey(key))
@ -86,4 +93,10 @@ public class ModBlaze extends ToolMod
String modName = "\u00a76Blaze ("+keys[0]+"/"+keys[1]+")"; String modName = "\u00a76Blaze ("+keys[0]+"/"+keys[1]+")";
tags.setString(tip, modName); tags.setString(tip, modName);
} }
public boolean validType(ToolCore tool)
{
List list = Arrays.asList(tool.toolCategories());
return list.contains("melee") || list.contains("ammo");
}
} }

View File

@ -1,6 +1,6 @@
package mods.tinker.tconstruct.modifiers; package mods.tinker.tconstruct.modifiers;
import ic2.api.IElectricItem; import ic2.api.item.IElectricItem;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -1,9 +1,12 @@
package mods.tinker.tconstruct.modifiers; package mods.tinker.tconstruct.modifiers;
import java.util.Arrays;
import java.util.Iterator; import java.util.Iterator;
import java.util.List;
import java.util.Map; import java.util.Map;
import mods.tinker.common.ToolMod; import mods.tinker.common.ToolMod;
import mods.tinker.tconstruct.library.ToolCore;
import mods.tinker.tconstruct.library.Weapon; import mods.tinker.tconstruct.library.Weapon;
import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.EnchantmentHelper;
@ -27,6 +30,10 @@ public class ModLapis extends ToolMod
@Override @Override
protected boolean canModify (ItemStack tool, ItemStack[] input) protected boolean canModify (ItemStack tool, ItemStack[] input)
{ {
ToolCore toolItem = (ToolCore) tool.getItem();
if (!validType(toolItem))
return false;
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
if (!tags.hasKey(key)) if (!tags.hasKey(key))
return tags.getInteger("Modifiers") > 0; return tags.getInteger("Modifiers") > 0;
@ -186,4 +193,10 @@ public class ModLapis extends ToolMod
String modName = "\u00a79Lapis (" + keys[0] + "/" + max + ")"; String modName = "\u00a79Lapis (" + keys[0] + "/" + max + ")";
tags.setString(tip, modName); tags.setString(tip, modName);
} }
public boolean validType(ToolCore tool)
{
List list = Arrays.asList(tool.toolCategories());
return list.contains("weapon") || list.contains("harvest");
}
} }

View File

@ -1,6 +1,10 @@
package mods.tinker.tconstruct.modifiers; package mods.tinker.tconstruct.modifiers;
import java.util.Arrays;
import java.util.List;
import mods.tinker.common.ToolMod; import mods.tinker.common.ToolMod;
import mods.tinker.tconstruct.library.ToolCore;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
@ -21,6 +25,9 @@ public class ModRedstone extends ToolMod
@Override @Override
protected boolean canModify (ItemStack tool, ItemStack[] input) protected boolean canModify (ItemStack tool, ItemStack[] input)
{ {
ToolCore toolItem = (ToolCore) tool.getItem();
if (!validType(toolItem))
return false;
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
if (!tags.hasKey(key)) if (!tags.hasKey(key))
@ -92,4 +99,10 @@ public class ModRedstone extends ToolMod
String modName = "\u00a74Redstone ("+keys[0]+"/"+keys[1]+")"; String modName = "\u00a74Redstone ("+keys[0]+"/"+keys[1]+")";
tags.setString(tip, modName); tags.setString(tip, modName);
} }
public boolean validType(ToolCore tool)
{
List list = Arrays.asList(tool.toolCategories());
return list.contains("harvest");
}
} }

View File

@ -0,0 +1,90 @@
package mods.tinker.tconstruct.tools;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mods.tinker.tconstruct.TContent;
import mods.tinker.tconstruct.library.ToolCore;
import net.minecraft.item.Item;
public class Chisel extends ToolCore
{
public Chisel(int id)
{
super(id, 0);
}
@Override
public int getHeadType ()
{
return 1;
}
@SideOnly(Side.CLIENT)
@Override
public int getRenderPasses (int metadata)
{
return 8;
}
@Override
public int getPartAmount()
{
return 2;
}
@Override
public void registerPartPaths (int index, String[] location)
{
headStrings.put(index, location[0]);
brokenHeadStrings.put(index, location[1]);
handleStrings.put(index, location[2]);
}
@Override
public String getIconSuffix (int partType)
{
switch (partType)
{
case 0:
return "_chisel_head";
case 1:
return "_chisel_head_broken";
case 2:
return "_chisel_handle";
default:
return "";
}
}
@Override
public String getEffectSuffix ()
{
return "_chisel_effect";
}
@Override
public String getDefaultFolder ()
{
return "chisel";
}
@Override
protected Item getHeadItem ()
{
return TContent.chiselHead;
}
@Override
protected Item getAccessoryItem ()
{
// TODO Auto-generated method stub
return null;
}
@Override
public String[] toolCategories ()
{
return new String[] { "utility" };
}
}

View File

@ -36,6 +36,12 @@ public class Dagger extends Weapon
return itemstack; return itemstack;
} }
@Override
public String[] toolCategories()
{
return new String[] { "weapon", "melee", "throwing" };
}
public EnumAction getItemUseAction(ItemStack par1ItemStack) public EnumAction getItemUseAction(ItemStack par1ItemStack)
{ {
return EnumAction.bow; return EnumAction.bow;

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 274 B

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Some files were not shown because too many files have changed in this diff Show More