Bricks, Library updates, and tweaks all around

master
mDiyo 2013-06-19 18:58:37 -07:00
parent d3cfea578f
commit 9c81ebbac6
87 changed files with 1791 additions and 1082 deletions

View File

@ -72,6 +72,23 @@
<entry key="block.brick.endstone.name">Endstone Brick</entry>
<entry key="block.brick.obsidian.ingot.name">Obsidian Brick</entry>
<entry key="block.fancybrick.obsidian.name">Obsidian Fancy Brick</entry>
<entry key="block.fancybrick.sandstone.name">Sandstone Fancy Brick</entry>
<entry key="block.fancybrick.netherrack.name">Netherrack Fancy Brick</entry>
<entry key="block.fancybrick.iron.name">Iron Fancy Brick</entry>
<entry key="block.fancybrick.gold.name">Gold Fancy Brick</entry>
<entry key="block.fancybrick.diamond.name">Diamond Fancy Brick</entry>
<entry key="block.fancybrick.lapis.name">Lapis Fancy Brick</entry>
<entry key="block.fancybrick.stone.refined.name">Refined Stone Fancy Brick</entry>
<entry key="block.fancybrick.redstone.name">Redstone Fancy Brick</entry>
<entry key="block.fancybrick.bone.name">Bone Fancy Brick</entry>
<entry key="block.fancybrick.slime.name">Slime Fancy Brick</entry>
<entry key="block.fancybrick.blueslime.name">Slime Fancy Brick</entry>
<entry key="block.fancybrick.endstone.name">Endstone Fancy Brick</entry>
<entry key="block.fancybrick.obsidian.ingot.name">Obsidian Fancy Brick</entry>
<entry key="block.fancybrick.stone.road.name">Stone Road</entry>
<entry key="block.fancybrick.stone.name">Stone Fancy Brick</entry>
<entry key="item.oreberry.iron.name">Iron Oreberry</entry>
<entry key="item.oreberry.gold.name">Gold Oreberry</entry>
<entry key="item.oreberry.copper.name">Copper Oreberry</entry>
@ -129,6 +146,7 @@
<entry key="tile.decoration.stonetorch.name">Torch</entry>
<entry key="item.tconstruct.storage.knapsack.name">Knapsack</entry>
<entry key="item.tconstruct.blankpattern.pattern.name">Blank Pattern</entry>
<entry key="item.tconstruct.blankpattern.cast.name">Blank Cast</entry>
@ -149,10 +167,6 @@
<entry key="item.tconstruct.bucket.Alumite.name">Liquid Alumite Bucket</entry>
<entry key="item.tconstruct.bucket.Obsidian.name">Liquid Obsidian Bucket</entry>
<entry key="item.tconstruct.bucket.Steel.name">Liquid Steel Bucket</entry>
<entry key="item.tconstruct.bucket.Manganese.name">Liquid Manganese Bucket</entry>
<entry key="item.tconstruct.bucket.Heptazion.name">Liquid Heptazion Bucket</entry>
<entry key="item.tconstruct.bucket.DSteel.name">Liquid Damascus Steel Bucket</entry>
<entry key="item.tconstruct.bucket.Angmallen.name">Liquid Angmallen Bucket</entry>
<entry key="LiquidMetal.Iron.name">Liquid Iron</entry>
<entry key="LiquidMetal.Gold.name">Liquid Gold</entry>

View File

@ -38,7 +38,7 @@ import cpw.mods.fml.common.registry.VillagerRegistry;
* @dependencies: IC2 API, MFR API
*/
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.dev.63", dependencies = "required-after:Forge@[7.7.1.675,)")
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.dev.67", dependencies = "required-after:Forge@[7.7.1.675,)")
@NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.util.network.TPacketHandler.class)
public class TConstruct
{

View File

@ -1,6 +0,0 @@
package mods.tinker.tconstruct.api;
public class TConstructAPI
{
}

View File

@ -0,0 +1,114 @@
package mods.tinker.tconstruct.blocks;
import java.util.List;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.blocks.logic.GlowstoneAggregator;
import mods.tinker.tconstruct.common.TProxyCommon;
import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.library.blocks.InventoryBlock;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class Aggregator extends InventoryBlock
{
public String[] textureNames = { "glowstone_top", "glowstone_top_inactive", "glowstone_side", "glowstone_bottom"};
public Icon[] icons;
public Aggregator(int id)
{
super(id, Material.iron);
setHardness(2.0f);
this.setCreativeTab(TConstructRegistry.blockTab);
setLightValue(1.0f);
}
@Override
public int damageDropped (int meta)
{
return meta;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister)
{
this.icons = new Icon[textureNames.length];
for (int i = 0; i < this.icons.length; ++i)
{
this.icons[i] = iconRegister.registerIcon("tinker:machines/aggregator_"+textureNames[i]);
}
}
/*@Override
public Icon getBlockTexture(IBlockAccess iblockaccess, int x, int y, int z, int side)
{
if (iblockaccess instanceof World)
{
System.out.println("Rawr!");
World world = (World) iblockaccess;
if (world.canBlockSeeTheSky(x, y, z))
{
int level = world.getSavedLightValue(EnumSkyBlock.Sky, x, y, z) - world.skylightSubtracted;
System.out.println("Level: "+level);
if (level < 12)
return icons[1];
}
}
return this.getIcon(side, iblockaccess.getBlockMetadata(x, y, z));
}*/
@Override
@SideOnly(Side.CLIENT)
public Icon getIcon (int side, int meta)
{
if (side == 0)
return icons[3];
if (side == 1)
return icons[0];
return icons[2];
//return icons[meta];
}
@Override
public void getSubBlocks (int id, CreativeTabs tab, List list)
{
list.add(new ItemStack(id, 1, 0));
/*for (int iter = 0; iter < icons.length; iter++)
{
list.add(new ItemStack(id, 1, iter));
}*/
}
@Override
public TileEntity createTileEntity (World world, int metadata)
{
return new GlowstoneAggregator();
}
@Override
public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer)
{
return TProxyCommon.glowstoneAggregatorGui;
}
@Override
public Object getModInstance ()
{
return TConstruct.instance;
}
@Override
public String[] getTextureNames ()
{
return textureNames;
}
}

View File

@ -34,7 +34,7 @@ public abstract class LiquidMetalBase extends Block
protected LiquidMetalBase(int par1, Material par2Material)
{
super(par1, par2Material);
textureNames = new String[] { "iron", "gold", "copper", "tin", "aluminum", "cobalt", "ardite", "bronze", "alubrass", "manyullyn", "alumite", "obsidian", "steel" };
textureNames = new String[] { "iron", "gold", "copper", "tin", "aluminum", "cobalt", "ardite", "bronze", "alubrass", "manyullyn", "alumite", "obsidian", "steel", "glass" };
setLightValue(0.625F);
}

View File

@ -15,7 +15,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class MultiBrickFancy extends TConstructBlock
{
static String blockTextures[] = { "fancybrick_obsidian", "fancybrick_sandstone", "fancybrick_netherrack", "fancybrick_stone_refined", "fancybrick_iron", "fancybrick_gold", "fancybrick_lapis", "fancybrick_diamond", "fancybrick_redstone",
"fancybrick_bone", "fancybrick_slime", "fancybrick_blueslime", "fancybrick_endstone", "fancybrick_obsidian_ingot", "road_stone", "road_refinedstone" };
"fancybrick_bone", "fancybrick_slime", "fancybrick_blueslime", "fancybrick_endstone", "fancybrick_obsidian_ingot", "fancybrick_stone", "road_stone" };
public MultiBrickFancy(int id)
{

View File

@ -0,0 +1,14 @@
package mods.tinker.tconstruct.blocks.logic;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.world.World;
import mods.tinker.tconstruct.library.blocks.InventoryLogic;
public abstract class AggregatorLogic extends InventoryLogic
{
public AggregatorLogic(int invSize)
{
super(invSize);
}
}

View File

@ -0,0 +1,71 @@
package mods.tinker.tconstruct.blocks.logic;
import mods.tinker.tconstruct.inventory.AggregatorContainer;
import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.World;
public class GlowstoneAggregator extends AggregatorLogic
{
short currentTime;
short maxTime = 20 * 60 * 5;
int currentLightLevel;
public GlowstoneAggregator()
{
super(3);
}
@Override
public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z)
{
return new AggregatorContainer(inventoryplayer, this);
}
@Override
protected String getDefaultName ()
{
return "aggregator.glowstone";
}
@Override
public void updateEntity ()
{
if (worldObj.isRemote)
return;
if (inventory[2] == null || inventory[2].stackSize < this.getInventoryStackLimit())
{
if (inventory[0] != null && inventory[0].itemID == Block.cobblestone.blockID)
{
currentLightLevel = worldObj.getSavedLightValue(EnumSkyBlock.Sky, xCoord, yCoord, zCoord) - worldObj.skylightSubtracted;
if (currentLightLevel > 12)
{
currentTime++;
if (currentTime >= 20)
{
currentTime = 0;
inventory[0].stackSize--;
if (inventory[0].stackSize < 1)
inventory[0] = null;
if (inventory[2] != null)
inventory[2].stackSize++;
else
inventory[2] = new ItemStack(Block.glowStone);
}
}
/*
if (this.currentTime % 60 == 0)
System.out.println("Light: " + lightLevel);
currentTime++;
if (currentTime >= maxTime)
{
currentTime = 0;
}*/
}
}
}
}

View File

@ -13,6 +13,7 @@ import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.blocks.logic.CastingBasinLogic;
import mods.tinker.tconstruct.blocks.logic.CastingTableLogic;
import mods.tinker.tconstruct.blocks.logic.FrypanLogic;
import mods.tinker.tconstruct.blocks.logic.GlowstoneAggregator;
import mods.tinker.tconstruct.blocks.logic.GolemCoreLogic;
import mods.tinker.tconstruct.blocks.logic.PartCrafterLogic;
import mods.tinker.tconstruct.blocks.logic.PatternChestLogic;
@ -45,6 +46,7 @@ import mods.tinker.tconstruct.client.entity.projectile.DaggerRender;
import mods.tinker.tconstruct.client.entity.projectile.LaunchedItemRender;
import mods.tinker.tconstruct.client.gui.ArmorExtendedGui;
import mods.tinker.tconstruct.client.gui.FrypanGui;
import mods.tinker.tconstruct.client.gui.GlowstoneAggregatorGui;
import mods.tinker.tconstruct.client.gui.GuiManual;
import mods.tinker.tconstruct.client.gui.InventoryTab;
import mods.tinker.tconstruct.client.gui.KnapsackGui;
@ -155,6 +157,9 @@ public class TProxyClient extends TProxyCommon
return new StencilTableGui(player.inventory, (StencilTableLogic) world.getBlockTileEntity(x, y, z), world, x, y, z);
if (ID == toolForge)
return new ToolForgeGui(player.inventory, (ToolForgeLogic) world.getBlockTileEntity(x, y, z), world, x, y, z);
if (ID == glowstoneAggregatorGui)
return new GlowstoneAggregatorGui(player.inventory, (GlowstoneAggregator) world.getBlockTileEntity(x, y, z), world, x, y, z);
if (ID == manualGuiID)
{
ItemStack stack = player.getCurrentEquippedItem();
@ -386,7 +391,7 @@ public class TProxyClient extends TProxyCommon
//Tool parts
TConstructClientRegistry.registerManualIcon("pickhead", new ItemStack(TContent.pickaxeHead, 1, 2));
TConstructClientRegistry.registerManualIcon("shovelhead", new ItemStack(TContent.shovelHead, 1, 2));
TConstructClientRegistry.registerManualIcon("axehead", new ItemStack(TContent.axeHead, 1, 2));
TConstructClientRegistry.registerManualIcon("axehead", new ItemStack(TContent.hatchetHead, 1, 2));
TConstructClientRegistry.registerManualIcon("swordblade", new ItemStack(TContent.swordBlade, 1, 2));
TConstructClientRegistry.registerManualIcon("pan", new ItemStack(TContent.frypanHead, 1, 2));
TConstructClientRegistry.registerManualIcon("board", new ItemStack(TContent.signHead, 1, 2));
@ -404,9 +409,9 @@ public class TProxyClient extends TProxyCommon
TConstructClientRegistry.registerManualIcon("pickicon",
ToolBuilder.instance.buildTool(new ItemStack(TContent.pickaxeHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.binding, 1, 12), ""));
TConstructClientRegistry.registerManualIcon("shovelicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.shovelHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, ""));
TConstructClientRegistry.registerManualIcon("axeicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.axeHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, ""));
TConstructClientRegistry.registerManualIcon("axeicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.hatchetHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, ""));
TConstructClientRegistry.registerManualIcon("mattockicon",
ToolBuilder.instance.buildTool(new ItemStack(TContent.axeHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.shovelHead, 1, 12), ""));
ToolBuilder.instance.buildTool(new ItemStack(TContent.hatchetHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.shovelHead, 1, 12), ""));
TConstructClientRegistry.registerManualIcon("swordicon",
ToolBuilder.instance.buildTool(new ItemStack(TContent.swordBlade, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.wideGuard, 1, 12), ""));
TConstructClientRegistry.registerManualIcon("longswordicon",
@ -645,9 +650,9 @@ public class TProxyClient extends TProxyCommon
String[] effectTypes = { "diamond", "emerald", "redstone", "piston", "moss", "ice", "lava", "blaze", "necrotic", "electric", "lapis", "quartz", "silk", "beheading", "smite", "spider",
"reinforced" };
int[] universalEffects = { 0, 1, 4, 9, 16 };
int[] weaponEffects = { 3, 5, 7, 8, 11, 13, 14, 15 };
int[] weaponEffects = { 3, 5, 7, 13, 14, 15 };
int[] harvestEffects = { 2 };
int[] nonUtility = { 6, 10, 12 };
int[] nonUtility = { 6, 8, 10, 11, 12 };
for (int partIter = 0; partIter < partTypes.length; partIter++)
{
@ -656,13 +661,17 @@ public class TProxyClient extends TProxyCommon
for (ToolCore tool : TConstructRegistry.getToolMapping())
{
List list = Arrays.asList(tool.toolCategories());
for (int i = 0; i < effectTypes.length; i++)
{
TConstructClientRegistry.addEffectRenderMapping(tool, i, "tinker", effectTypes[i], true);
}
/*List list = Arrays.asList(tool.toolCategories());
for (int i = 0; i < universalEffects.length; i++)
{
TConstructClientRegistry.addEffectRenderMapping(tool, universalEffects[i], "tinker", effectTypes[universalEffects[i]], true);
}
if (list.contains("harvest"))
if (list.contains("harvest") || list.contains("utility"))
{
for (int i = 0; i < harvestEffects.length; i++)
{
@ -684,7 +693,7 @@ public class TProxyClient extends TProxyCommon
{
TConstructClientRegistry.addEffectRenderMapping(tool, nonUtility[i], "tinker", effectTypes[nonUtility[i]], true);
}
}
}*/
}
}

View File

@ -61,22 +61,25 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler
if (input != null && logic.getTempForSlot(i) > 20)
{
ItemStack blockToRender = Smeltery.getRenderIndex(input);
float blockHeight = input.stackSize / (float) blockToRender.stackSize;
renderer.setRenderBounds(-0.001F, 0.0F, -0.001F, 1.001F, MathHelper.clamp_float(blockHeight, 0.01F, 1.0F), 1.001F);
if (blockToRender != null)
{
float blockHeight = input.stackSize / (float) blockToRender.stackSize;
renderer.setRenderBounds(-0.001F, 0.0F, -0.001F, 1.001F, MathHelper.clamp_float(blockHeight, 0.01F, 1.0F), 1.001F);
if (blockToRender.itemID < 4096) //Block
{
Block liquidBlock = Block.blocksList[blockToRender.itemID];
//ForgeHooksClient.bindTexture(liquidBlock.getTextureFile(), 0);
BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, blockToRender.getItemDamage(), posX + i % 3, posY + i / 9, posZ + i / 3, renderer, world);
}
else
//Item
{
Item liquidItem = Item.itemsList[blockToRender.itemID];
//ForgeHooksClient.bindTexture(liquidItem.getTextureFile(), 0);
int metadata = blockToRender.getItemDamage();
BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(metadata), posX, posY + i / 9, posZ, renderer, world);
if (blockToRender.itemID < 4096) //Block
{
Block liquidBlock = Block.blocksList[blockToRender.itemID];
//ForgeHooksClient.bindTexture(liquidBlock.getTextureFile(), 0);
BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, blockToRender.getItemDamage(), posX + i % 3, posY + i / 9, posZ + i / 3, renderer, world);
}
else
//Item
{
Item liquidItem = Item.itemsList[blockToRender.itemID];
//ForgeHooksClient.bindTexture(liquidItem.getTextureFile(), 0);
int metadata = blockToRender.getItemDamage();
BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(metadata), posX, posY + i / 9, posZ, renderer, world);
}
}
}
}
@ -147,7 +150,8 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler
Block liquidBlock = Block.blocksList[blockToRender.itemID];
BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, blockToRender.getItemDamage(), posX + i % 3, posY, posZ + i / 3, renderer, world);
}
else //Item
else
//Item
{
Item liquidItem = Item.itemsList[blockToRender.itemID];
int metadata = blockToRender.getItemDamage();

View File

@ -0,0 +1,43 @@
package mods.tinker.tconstruct.client.gui;
import mods.tinker.tconstruct.blocks.logic.GlowstoneAggregator;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
public class GlowstoneAggregatorGui extends GuiContainer
{
public GlowstoneAggregator logic;
public GlowstoneAggregatorGui(InventoryPlayer inventoryplayer, GlowstoneAggregator frypan, World world, int x, int y, int z)
{
super(frypan.getGuiContainer(inventoryplayer, world, x, y, z));
logic = frypan;
}
protected void drawGuiContainerForegroundLayer(int par1, int par2)
{
//fontRenderer.drawString(StatCollector.translateToLocal("aggregator.glowstone"), 60, 6, 0x404040);
fontRenderer.drawString("Glowstone Aggregator", 8, 6, 0x404040);
fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, (ySize - 96) + 2, 0x404040);
}
protected void drawGuiContainerBackgroundLayer(float f, int i, int j)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture("/mods/tinker/textures/gui/aggregator.png");
int cornerX = (width - xSize) / 2;
int cornerY = (height - ySize) / 2;
drawTexturedModalRect(cornerX, cornerY, 0, 0, xSize, ySize);
/*if (logic.fuel > 0)
{
int fuel = logic.gaugeFuelScaled(12);
drawTexturedModalRect(cornerX + 27, (cornerY + 40) - fuel, 176, 12 - fuel, 14, fuel + 2);
}
int fuelgague = logic.gaugeProgressScaled(24);
drawTexturedModalRect(cornerX + 140, cornerY + 8, 176, 14, fuelgague, 16);*/
}
}

View File

@ -49,7 +49,7 @@ public class GuiManual extends GuiScreen
ItemStack[] iconsRight;
String[] multiTextRight;
ToolMaterial materialRight;
SmallFontRenderer fonts = TProxyClient.smallFontRenderer;
public GuiManual(ItemStack stack, Document doc)
@ -784,7 +784,7 @@ public class GuiManual extends GuiScreen
if (icons[2] != null)
renderitem.renderItemAndEffectIntoGUI(fonts, mc.renderEngine, icons[2], (localWidth + 18) / 2, (localHeight + 74) / 2);
renderitem.zLevel = 0;
GL11.glScalef(0.5F, 0.5F, 0.5F);
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
@ -811,8 +811,10 @@ public class GuiManual extends GuiScreen
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
this.fonts.drawSplitString(icons[1].getTooltip(this.mc.thePlayer, false).get((0)).toString(), localWidth + 128, localHeight + 53, 52, 0);
this.fonts.drawSplitString(icons[2].getTooltip(this.mc.thePlayer, false).get((0)).toString(), localWidth + 128, localHeight + 85, 52, 0);
this.fonts.drawSplitString(icons[3].getTooltip(this.mc.thePlayer, false).get((0)).toString(), localWidth + 128, localHeight + 117, 52, 0);
if (icons[2] != null)
this.fonts.drawSplitString(icons[2].getTooltip(this.mc.thePlayer, false).get((0)).toString(), localWidth + 128, localHeight + 85, 52, 0);
if (icons[3] != null)
this.fonts.drawSplitString(icons[3].getTooltip(this.mc.thePlayer, false).get((0)).toString(), localWidth + 128, localHeight + 117, 52, 0);
this.fonts.drawString("Durability: " + material.durability(), localWidth, localHeight + 40, 0);
this.fonts.drawString("Handle Modifier: " + material.handleDurability() + "x", localWidth, localHeight + 50, 0);

View File

@ -89,14 +89,14 @@ public class StencilTableGui extends GuiContainer
if (button.id == 0)
{
patternIndex++;
if (patternIndex > TContent.patternOutputs.length-1)
if (patternIndex >= TContent.patternOutputs.length-1)
patternIndex = 0;
}
else if (button.id == 1)
{
patternIndex--;
if (patternIndex < 0)
patternIndex = TContent.patternOutputs.length-1;
patternIndex = TContent.patternOutputs.length-2;
}
ItemStack stack = new ItemStack(TContent.woodPattern, 1, patternIndex + 1);
logic.setInventorySlotContents(1, stack);
@ -107,14 +107,14 @@ public class StencilTableGui extends GuiContainer
if (button.id == 0)
{
patternIndex++;
if (patternIndex > TContent.patternOutputs.length)
if (patternIndex > TContent.patternOutputs.length-1)
patternIndex = 0;
}
else if (button.id == 1)
{
patternIndex--;
if (patternIndex < 0)
patternIndex = TContent.patternOutputs.length;
patternIndex = TContent.patternOutputs.length-1;
}
ItemStack stack = new ItemStack(TContent.metalPattern, 1, patternIndex);
logic.setInventorySlotContents(1, stack);

View File

@ -300,6 +300,14 @@ public class ToolStationGui extends NewContainerGui
offset++;
offset++;
}
else if (categories.contains("utility"))
{
float mineSpeed = tags.getInteger("MiningSpeed");
float trueSpeed = mineSpeed / (100f);
fontRenderer.drawString("Usage Speed: " + trueSpeed, xSize + 8, base + offset * 10, 0xffffff);
offset++;
offset++;
}
int modifiers = tags.getInteger("Modifiers");
if (modifiers > 0)

File diff suppressed because it is too large Load Diff

View File

@ -27,6 +27,7 @@ public class TProxyCommon implements IGuiHandler
public static int frypanGuiID = 4;
public static int toolForge = 5;
public static int smelteryGuiID = 7;
public static int glowstoneAggregatorGui = 8;
public static int inventoryGui = 100;
public static int armorGuiID = 101;
@ -147,7 +148,7 @@ public class TProxyCommon implements IGuiHandler
//LanguageRegistry.addName(TContent.blankPattern, "Blank Pattern");
LanguageRegistry.addName(TContent.pickaxe, "Pickaxe");
LanguageRegistry.addName(TContent.shovel, "Shovel");
LanguageRegistry.addName(TContent.axe, "Hatchet");
LanguageRegistry.addName(TContent.hatchet, "Hatchet");
LanguageRegistry.addName(TContent.broadsword, "Broadsword");
LanguageRegistry.addName(TContent.longsword, "Longsword");
LanguageRegistry.addName(TContent.rapier, "Rapier");
@ -164,6 +165,8 @@ public class TProxyCommon implements IGuiHandler
LanguageRegistry.addName(TContent.hammer, "Hammer");
LanguageRegistry.addName(TContent.battleaxe, "Battleaxe");
LanguageRegistry.addName(TContent.cutlass, "Cutlass");
LanguageRegistry.addName(TContent.aggregator, "Glowstone Aggregator");
LanguageRegistry.addName(TContent.knapsack, "Knapsack");
}

View File

@ -0,0 +1,82 @@
package mods.tinker.tconstruct.inventory;
import mods.tinker.tconstruct.blocks.logic.GlowstoneAggregator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class AggregatorContainer extends Container
{
public GlowstoneAggregator logic;
public int progress = 0;
public int fuel = 0;
public int fuelGague = 0;
public AggregatorContainer(InventoryPlayer inventoryplayer, GlowstoneAggregator logic)
{
this.logic = logic;
this.addSlotToContainer(new Slot(logic, 0, 45, 36));
this.addSlotToContainer(new Slot(logic, 1, 80, 36));
this.addSlotToContainer(new Slot(logic, 2, 123, 36));
/* Player inventory */
for (int column = 0; column < 3; column++)
{
for (int row = 0; row < 9; row++)
{
this.addSlotToContainer(new Slot(inventoryplayer, row + column * 9 + 9, 8 + row * 18, 84 + column * 18));
}
}
for (int column = 0; column < 9; column++)
{
this.addSlotToContainer(new Slot(inventoryplayer, column, 8 + column * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer entityplayer)
{
return logic.isUseableByPlayer(entityplayer);
}
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int slotID)
{
ItemStack stack = null;
Slot slot = (Slot)this.inventorySlots.get(slotID);
if (slot != null && slot.getHasStack())
{
ItemStack slotStack = slot.getStack();
stack = slotStack.copy();
if (slotID < logic.getSizeInventory())
{
if (!this.mergeItemStack(slotStack, logic.getSizeInventory(), this.inventorySlots.size(), true))
{
return null;
}
}
else if (!this.mergeItemStack(slotStack, 0, logic.getSizeInventory(), false))
{
return null;
}
if (slotStack.stackSize == 0)
{
slot.putStack((ItemStack)null);
}
else
{
slot.onSlotChanged();
}
}
return stack;
}
}

View File

@ -22,7 +22,7 @@ public class KnapsackContainer extends Container
{
for (int row = 0; row < 9; row++)
{
this.addSlotToContainer(new Slot(knapsack, row + column * 9, 8 + row * 18, 18 + column * 18));
this.addSlotToContainer(new Slot(knapsack, row + column * 9, 8 + row * 18, 17 + column * 18));
}
}
@ -83,13 +83,4 @@ public class KnapsackContainer extends Container
return stack;
}
@Override
protected boolean mergeItemStack(ItemStack stack, int inventorySize, int slotSize, boolean par4)
{
if (!(stack.getItem() instanceof IPattern))
return false;
return super.mergeItemStack(stack, inventorySize, slotSize, par4);
}
}

View File

@ -15,7 +15,7 @@ public class MetalPattern extends Pattern
public void getSubItems (int id, CreativeTabs tab, List list)
{
for (int i = 0; i < patternName.length; i++)
for (int i = 0; i < patternName.length-1; i++)
list.add(new ItemStack(id, 1, i));
}
}

View File

@ -21,32 +21,6 @@ public class Knapsack extends CraftingItem
this.setMaxStackSize(10);
}
@Override
public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player)
{
/*if (!world.isRemote && stack.getItemDamage() == 2)
{
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username);
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
@SideOnly(Side.CLIENT)
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)

View File

@ -0,0 +1,58 @@
package mods.tinker.tconstruct.items.blocks;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
public class MultiBrickFancyItem extends ItemBlock
{
static String blockType[] = { "obsidian", "sandstone", "netherrack", "stone.refined", "iron", "gold", "lapis", "diamond",
"redstone", "bone", "slime", "blueslime", "endstone", "obsidian.ingot", "stone", "stone.road" };
public MultiBrickFancyItem(int id)
{
super(id);
setMaxDamage(0);
setHasSubtypes(true);
}
public int getMetadata(int meta)
{
return meta;
}
public String getUnlocalizedName(ItemStack itemstack)
{
int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length-1);
return (new StringBuilder()).append("block.fancybrick.").append(blockType[pos]).toString();
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
{
switch (stack.getItemDamage())
{
case 5:
case 6:
list.add("Somewhat expensive");
break;
case 7:
list.add("Quite expensive");
break;
case 8:
list.add("Emits Redstone signal up to");
list.add("4 blocks away");
break;
case 10:
case 11:
list.add("Bouncy!");
break;
}
}
}

View File

@ -12,7 +12,7 @@ import net.minecraft.util.MathHelper;
public class MultiBrickItem extends ItemBlock
{
static String blockType[] = { "obsidian", "sandstone", "netherrack", "stone.refined", "iron", "gold", "lapis", "diamond",
"redstone", "bone", "slime", "blueslime", "endstone", "obsidian.ingot" };
"redstone", "bone", "slime", "blueslime", "endstone", "obsidian.ingot", "stone.road", "stone.refined.road" };
public MultiBrickItem(int id)
{

View File

@ -78,6 +78,18 @@ public class Battleaxe extends HarvestTool
return TContent.toughBinding;
}
@Override
public int durabilityTypeAccessory ()
{
return 2;
}
@Override
public int durabilityTypeExtra ()
{
return 1;
}
@Override
public float getRepairCost ()
{

View File

@ -28,7 +28,18 @@ public class Chisel extends ToolCore
@Override
public ItemStack getContainerItemStack (ItemStack itemStack)
{
AbilityHelper.damageTool(itemStack, 1, null, false);
//AbilityHelper.damageTool(itemStack, 1, null, false);
int reinforced = 0;
NBTTagCompound tags = itemStack.getTagCompound();
if (tags.getCompoundTag("InfiTool").hasKey("Unbreaking"))
reinforced = tags.getCompoundTag("InfiTool").getInteger("Unbreaking");
if (random.nextInt(10) < 10 - reinforced)
{
AbilityHelper.damageTool(itemStack, 1, null, false);
}
return itemStack;
}
@ -43,7 +54,7 @@ public class Chisel extends ToolCore
boolean detailed = false;
return detailed;
}
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ)
{
return false;
@ -88,7 +99,18 @@ public class Chisel extends ToolCore
{
world.setBlock(x, y, z, details.outputID, details.outputMeta, 3);
if (!(entityplayer.capabilities.isCreativeMode))
AbilityHelper.damageTool(itemstack, 1, entityplayer, false);
{
int reinforced = 0;
NBTTagCompound tags = itemstack.getTagCompound();
if (tags.getCompoundTag("InfiTool").hasKey("Unbreaking"))
reinforced = tags.getCompoundTag("InfiTool").getInteger("Unbreaking");
if (random.nextInt(10) < 10 - reinforced)
{
AbilityHelper.damageTool(itemstack, 1, null, false);
}
}
world.playAuxSFX(2001, x, y, z, blockID + (meta << 12));
entityplayer.swingItem();
}
@ -101,13 +123,20 @@ public class Chisel extends ToolCore
@Override
public int getMaxItemUseDuration (ItemStack itemstack)
{
return 15;
if (!itemstack.hasTagCompound())
return 20;
int speed = itemstack.getTagCompound().getCompoundTag("InfiTool").getInteger("MiningSpeed") / 100;
int truespeed = 20 - speed;
if (truespeed < 0)
truespeed = 0;
return truespeed;
}
@Override
public EnumAction getItemUseAction (ItemStack itemstack)
{
return EnumAction.bow;
return EnumAction.eat;
}
@Override

View File

@ -53,7 +53,7 @@ public class Hatchet extends HarvestTool
@Override
public Item getHeadItem ()
{
return TContent.axeHead;
return TContent.hatchetHead;
}
@Override

View File

@ -48,7 +48,7 @@ public class Mattock extends DualHarvestTool
@Override
public Item getHeadItem ()
{
return TContent.axeHead;
return TContent.hatchetHead;
}
@Override

View File

@ -3,14 +3,12 @@ package mods.tinker.tconstruct.library;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import mods.tinker.tconstruct.library.crafting.Detailing;
import mods.tinker.tconstruct.library.crafting.LiquidCasting;
import mods.tinker.tconstruct.library.tools.ToolCore;
import mods.tinker.tconstruct.library.tools.ToolMaterial;
import mods.tinker.tconstruct.library.util.TabTools;
import mods.tinker.tconstruct.library.crafting.*;
import mods.tinker.tconstruct.library.tools.*;
import mods.tinker.tconstruct.library.util.*;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
/** A registry to store any relevant API work
*
@ -20,54 +18,210 @@ import net.minecraft.item.Item;
public class TConstructRegistry
{
public static TConstructRegistry instance = new TConstructRegistry();
public static ArrayList<ToolCore> tools = new ArrayList<ToolCore>(20);
public static HashMap<Integer, ToolMaterial> toolMaterials = new HashMap<Integer, ToolMaterial>(40);
public static HashMap<String, ToolMaterial> toolMaterialStrings = new HashMap<String, ToolMaterial>(40);
public static LinkedList<ActiveToolMod> activeModifiers = new LinkedList<ActiveToolMod>();
/* Creative tabs */
public static TabTools toolTab;
public static TabTools materialTab;
public static TabTools blockTab;
@Deprecated
public static Item toolRod;
/* Items */
/** A directory of crafting items and tools used by the mod.
*
* Tools:
* pickaxe, shovel, hatchet, broadsword, longsword, rapier, dagger, cutlass
* frypan, battlesign, mattock, chisel
* lumberaxe, cleaver, scythe, excavator, hammer, battleaxe
*
* Tool crafting parts:
* toolRod, toolShard, binding, toughBinding, toughRod, heavyPlate
* pickaxeHead, shovelhead, hatchetHead, swordBlade, wideguard, handGuard, crossbar, knifeBlade,
* fullGuard, frypanHead, signHead, chiselHead
* scytheBlade, broadAxeHead, excavatorHead, largeSwordBlade, hammerHead
*/
public static HashMap<String, Item> itemDirectory = new HashMap<String, Item>();
/** Adds an item to the directory
*
* @param name Associates the name with the stack
* @param itemstack The stack to add to the directory
*/
public static void addItemToDirectory(String name, Item itemstack)
{
Item add = itemDirectory.get(name);
if (add == null)
System.out.println("[TCon API] "+name+" is already present in the Item directory");
itemDirectory.put(name, itemstack);
}
/** Retrieves an itemstack from the directory
*
* @param name The name of the item to get
* @return Item associated with the name, or null if not present.
*/
public static Item getItem(String name)
{
Item ret = itemDirectory.get(name);
if (ret == null)
System.out.println("[TCon API] Could not find "+name+" in the Item directory");
return ret;
}
/** A directory of ItemStacks. Contains mostly crafting items
*
* Materials:
* paperStack, greenSlimeCrystal, blueSlimeCrystal, searedBrick, mossBall, lavaCrystal, necroticBone, silkyCloth, silkyJewel
* ingotCobalt, ingotArdite, ingotManyullyn, ingotCopper, ingotTin, ingotAluminum, rawAluminum,
* ingotBronze, ingotAluminumBrass, ingotAlumite, ingotSteel, ingotObsidian
* nuggetIron, nuggetCopper, nuggetTin, nuggetAluminum, nuggetSilver, nuggetAluminumBrass
* oreberryIron, oreberryGold, oreberryCopper, oreberryTin, oreberryTin, oreberrySilver,
* diamondApple, blueSlimeFood, canisterEmpty, miniRedHeart, canisterRedHeart
*
*/
static HashMap<String, ItemStack> itemstackDirectory = new HashMap<String, ItemStack>();
/** Adds an itemstack to the directory
*
* @param name Associates the name with the stack
* @param itemstack The stack to add to the directory
*/
public static void addItemStackToDirectory(String name, ItemStack itemstack)
{
ItemStack add = itemstackDirectory.get(name);
if (add == null)
System.out.println("[TCon API] "+name+" is already present in the ItemStack directory");
itemstackDirectory.put(name, itemstack);
}
/** Retrieves an itemstack from the directory
*
* @param name The name of the item to get
* @return Item associated with the name, or null if not present.
*/
public static ItemStack getItemStack(String name)
{
ItemStack ret = itemstackDirectory.get(name);
if (ret == null)
System.out.println("[TCon API] Could not find "+name+" in the ItemStack directory");
return ret;
}
public static ArrayList<ToolCore> tools = new ArrayList<ToolCore>(20);
//Tools
/** Internal tool mapping, used for adding textures
*
* @param tool
*/
public static void addToolMapping (ToolCore tool)
{
tools.add(tool);
}
/** Internal tool mapping, used for adding textures
*
* @return List of tools
*/
public static ArrayList<ToolCore> getToolMapping ()
{
return tools;
}
//Materials
public static void addToolMaterial (int materialID, String materialName, int craftingTier, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced,
float shoddy)
/** Registers a tool to its crafting parts.
* If an output is registered multiple times the parts are added to the recipe's input list
* Valid part amounts are 1, 2, and 4. Part counts of 1 and 2 assume a Tool Rod as a handle.
* Null items are valid as placeholders. ex: Hatchet
*
* @see ToolBuidler
* @param output The ToolCore to craft
* @param parts Pieces to make the tool with
*/
public static void addToolRecipe(ToolCore output, Item... parts)
{
addToolMaterial(materialID, materialName, craftingTier, harvestLevel, durability, miningspeed, attack, handleModifier, reinforced, shoddy, "", "");
ToolBuilder tb = ToolBuilder.instance;
if (parts.length < 1 || parts.length > 4 || parts.length == 3)
System.out.println("[TCon API] Wrong amount of items to craft into a tool");
tb.addToolRecipe(output, parts);
}
public static void addToolMaterial (int materialID, String materialName, int craftingTier, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced,
float shoddy, String style, String ability)
//Materials
public static HashMap<Integer, ToolMaterial> toolMaterials = new HashMap<Integer, ToolMaterial>(40);
public static HashMap<String, ToolMaterial> toolMaterialStrings = new HashMap<String, ToolMaterial>(40);
/** Adds a tool material to the registry
*
* @param materialID Unique ID, stored for each part
* @exception materialID must be unique
* @param materialName Unique name for data lookup purposes
* @param harvestLevel The materials which the tool can harvest. Pickaxe levels - 0: Wood, 1: Stone, 2: Redstone/Diamond, 3: Obsidian, 4: Cobalt/Ardite, 5: Manyullyn
* @param durability Base durability of the tool, affects tool heads.
* @param miningspeed Base mining speed, divided by 100 in use
* @param attack Base attack
* @param handleModifier Durability multiplier on the tool
* @param reinforced Reinforced level
* @param unbreaking Amount of Stonebound to put on the tool. Negative numbers are Spiny.
*/
public static void addToolMaterial (int materialID, String materialName, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced,
float unbreaking, String style, String ability)
{
ToolMaterial mat = toolMaterials.get(materialID);
if (mat == null)
{
mat = new ToolMaterial(materialName, craftingTier, harvestLevel, durability, miningspeed, attack, handleModifier, reinforced, shoddy, style, ability);
mat = new ToolMaterial(materialName, harvestLevel, durability, miningspeed, attack, handleModifier, reinforced, unbreaking, style, ability);
toolMaterials.put(materialID, mat);
toolMaterialStrings.put(materialName, mat);
}
else
throw new RuntimeException("[TConstruct] Material ID " + materialID + " is already occupied by " + mat.materialName);
throw new IllegalArgumentException("[TCon API] Material ID " + materialID + " is already occupied by " + mat.materialName);
}
/** Adds a tool material to the registry
*
* @param materialID Unique ID, stored for each part
* @exception materialID must be unique
* @param material Complete tool material to add. Uses the name in the material for lookup purposes.
*/
public static void addtoolMaterial(int materialID, ToolMaterial material)
{
ToolMaterial mat = toolMaterials.get(materialID);
if (mat == null)
{
toolMaterials.put(materialID, mat);
toolMaterialStrings.put(material.name(), mat);
}
else
throw new IllegalArgumentException("[TCon API] Material ID " + materialID + " is already occupied by " + mat.materialName);
}
/** Looks up a tool material by ID
*
* @param key The ID to look up
* @return Tool Material
*/
public static ToolMaterial getMaterial (int key)
{
return (toolMaterials.get(key));
}
/** Looks up a tool material by name
*
* @param key the name to look up
* @return Tool Material
*/
public static ToolMaterial getMaterial (String key)
{
@ -136,9 +290,31 @@ public class TConstructRegistry
return null;
}
}
public static ArrayList<ActiveToolMod> activeModifiers = new ArrayList<ActiveToolMod>();
public static void registerActiveToolMod(ActiveToolMod mod)
{
activeModifiers.add(mod);
}
/** Default Material Index
* 0: Wood
* 1: Stone
* 2: Iron
* 3: Flint
* 4: Cactus
* 5: Bone
* 6: Obsidian
* 7: Netherrack
* 8: Green Slime
* 9: Paper
* 10: Cobalt
* 11: Ardite
* 12: Manyullyn
* 13: Copper
* 14: Bronze
* 15: Alumite
* 16: Steel
* 17: Blue Slime
*/
}

View File

@ -39,7 +39,8 @@ public class ShapelessToolRecipe extends ShapelessRecipes
{
ItemStack itemstack1 = (ItemStack)iterator.next();
if (itemstack.itemID == itemstack1.itemID && (itemstack1.getItemDamage() == 32767 || itemstack.getItemDamage() == itemstack1.getItemDamage()))
//System.out.println("Rawr! "+itemstack1.getItemDamage());
if (itemstack.itemID == itemstack1.itemID && (itemstack1.getItemDamage() == Short.MAX_VALUE || itemstack.getItemDamage() == itemstack1.getItemDamage()))
{
if (itemstack.getItem() instanceof ToolCore)
{

View File

@ -26,7 +26,7 @@ public class ToolBuilder
public List<ToolMod> toolMods = new ArrayList<ToolMod>();
/* Build tools */
public static void addToolRecipe (ToolCore output, Item head)
public static void addNormalToolRecipe (ToolCore output, Item head)
{
ToolRecipe recipe = instance.recipeList.get(output.getToolName());
if (recipe != null)
@ -41,7 +41,7 @@ public class ToolBuilder
}
}
public static void addToolRecipe (ToolCore output, Item head, Item accessory)
public static void addNormalToolRecipe (ToolCore output, Item head, Item accessory)
{
//instance.combos.add(new ToolRecipe(head, accessory, output));
ToolRecipe recipe = instance.recipeList.get(output.getToolName());
@ -57,26 +57,8 @@ public class ToolBuilder
instance.recipeList.put(output.getToolName(), recipe);
}
}
public static void addToolRecipe (ToolCore output, Item head, Item accessory, Item extra)
{
//instance.combos.add(new ToolRecipe(head, accessory, extra, output));
ToolRecipe recipe = instance.recipeList.get(output.getToolName());
if (recipe != null)
{
recipe.addHeadItem(head);
recipe.addAccessoryItem(accessory);
recipe.addExtraItem(accessory);
}
else
{
recipe = new ToolRecipe(head, accessory, extra, output);
instance.combos.add(recipe);
instance.recipeList.put(output.getToolName(), recipe);
}
}
public static void addCustomToolRecipe (ToolCore output, Item head, Item handle, Item accessory, Item extra)
public static void addNormalToolRecipe (ToolCore output, Item head, Item handle, Item accessory, Item extra)
{
ToolRecipe recipe = instance.recipeList.get(output.getToolName());
if (recipe != null)
@ -93,6 +75,23 @@ public class ToolBuilder
instance.recipeList.put(output.getToolName(), recipe);
}
}
public static void addCustomToolRecipe(ToolRecipe recipe)
{
instance.combos.add(recipe);
}
public static void addToolRecipe (ToolCore output, Item... items)
{
if (items.length == 1)
addNormalToolRecipe(output, items[0]);
if (items.length == 2)
addNormalToolRecipe(output, items[0], items[1]);
if (items.length == 3)
addToolRecipe(output, items[0], items[1], items[2]);
if (items.length == 4)
addNormalToolRecipe(output, items[0], items[1], items[2], items[3]);
}
public ToolCore getMatchingRecipe (Item head, Item handle, Item accessory, Item extra)
{

View File

@ -21,17 +21,17 @@ public class ToolRecipe
public ToolRecipe(Item head, ToolCore tool)
{
this(head, TConstructRegistry.toolRod, null, null, tool);
this(head, TContent.toolRod, null, null, tool);
}
public ToolRecipe(Item head, Item accessory, ToolCore tool)
{
this(head, TConstructRegistry.toolRod, accessory, null, tool);
this(head, TContent.toolRod, accessory, null, tool);
}
public ToolRecipe(Item head, Item accessory, Item extra, ToolCore tool)
{
this(head, TConstructRegistry.toolRod, accessory, extra, tool);
this(head, TContent.toolRod, accessory, extra, tool);
}
public ToolRecipe(Item head, Item handle, Item accessory, Item extra, ToolCore tool)

View File

@ -48,13 +48,13 @@ public class AbilityHelper
if (!stack.hasTagCompound())
return false;
int durability = 0;
int reinforced = 0;
NBTTagCompound tags = stack.getTagCompound();
if (tags.getCompoundTag("InfiTool").hasKey("Unbreaking"))
durability = tags.getCompoundTag("InfiTool").getInteger("Unbreaking");
reinforced = tags.getCompoundTag("InfiTool").getInteger("Unbreaking");
if (random.nextInt(10) < 10 - durability)
if (random.nextInt(10) < 10 - reinforced)
{
damageTool(stack, 1, tags, player, false);
}

View File

@ -228,8 +228,16 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
emptyIcon = iconRegister.registerIcon("tinker:blankface");
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int meta)
{
return blankSprite;
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIcon (ItemStack stack, int renderPass)
{
NBTTagCompound tags = stack.getTagCompound();
@ -535,7 +543,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
public Item getHandleItem ()
{
return TConstructRegistry.toolRod;
return TConstructRegistry.getItem("toolRod");//TContent.toolRod;
}
/* Updating */
@ -630,15 +638,8 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
//Right-click
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ)
{
//Workaround for impossible crash?
if (!player.isSneaking())
{
Block block = Block.blocksList[world.getBlockId(x, y, z)];
if (block.hasTileEntity(world.getBlockMetadata(x, y, z)))
{
return false;
}
}
/*if (world.isRemote)
return true;*/
int posX = x;
int posY = y;
@ -682,26 +683,28 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
boolean used = false;
int hotbarSlot = player.inventory.currentItem;
if (hotbarSlot == 0)
int itemSlot = hotbarSlot == 0 ? 8 : hotbarSlot + 1;
ItemStack nearbyStack = null;
if (hotbarSlot < 8)
{
ItemStack nearbyStack = player.inventory.getStackInSlot(8);
nearbyStack = player.inventory.getStackInSlot(itemSlot);
if (nearbyStack != null && nearbyStack.getItem() instanceof ItemBlock)
{
used = nearbyStack.getItem().onItemUse(nearbyStack, player, world, x, y, z, side, clickX, clickY, clickZ);
if (nearbyStack.stackSize < 1)
player.inventory.setInventorySlotContents(8, null);
{
nearbyStack = null;
player.inventory.setInventorySlotContents(itemSlot, null);
}
}
}
else if (hotbarSlot < 8)
/*if (used) //Update client
{
ItemStack nearbyStack = player.inventory.getStackInSlot(hotbarSlot + 1);
if (nearbyStack != null && nearbyStack.getItem() instanceof ItemBlock)
{
used = nearbyStack.getItem().onItemUse(nearbyStack, player, world, x, y, z, side, clickX, clickY, clickZ);
if (nearbyStack.stackSize < 1)
player.inventory.setInventorySlotContents(hotbarSlot + 1, null);
}
}
Packet103SetSlot packet = new Packet103SetSlot(player.openContainer.windowId, itemSlot, nearbyStack);
((EntityPlayerMP)player).playerNetServerHandler.sendPacketToPlayer(packet);
}*/
return used;
}
@ -876,6 +879,8 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
/* Proper stack damage */
public int getItemDamageFromStack (ItemStack stack)
{
if (stack.itemDamage == Short.MAX_VALUE )
return Short.MAX_VALUE;
NBTTagCompound tags = stack.getTagCompound();
if (tags == null)
{

View File

@ -1,39 +1,32 @@
package mods.tinker.tconstruct.library.tools;
/**
* This class is temporary. A full material registry is planned
/*
* Dynamic substitute for an enum. It carries a lot of information
*/
public class ToolMaterial
{
//mining level, durability, mining speed, baseDamage, handle modifier, Reinforced level, shoddy/spiny level, color/style on name
public final String materialName;
public final int craftingTier; //Not used
public final int harvestLevel;
public final int durability;
public final int miningspeed; // <-- divided by 100
public final int attack;
public final float handleModifier;
public final int reinforced;
public final float shoddy;
public final float stonebound;
public final String tipStyle;
public final String ability;
public ToolMaterial(String name, int tier, int level, int durability, int speed, int damage, float handle, int reinforced, float shoddy)
{
this(name, reinforced, reinforced, reinforced, reinforced, reinforced, shoddy, reinforced, shoddy, "", "");
}
public ToolMaterial(String name, int tier, int level, int durability, int speed, int damage, float handle, int reinforced, float shoddy, String style, String ability)
public ToolMaterial(String name, int level, int durability, int speed, int damage, float handle, int reinforced, float stonebound, String style, String ability)
{
this.materialName = name;
this.craftingTier = tier;
this.harvestLevel = level;
this.durability = durability;
this.miningspeed = speed;
this.attack = damage;
this.handleModifier = handle;
this.reinforced = reinforced;
this.shoddy = shoddy;
this.stonebound = stonebound;
this.tipStyle = style;
this.ability = ability;
}
@ -43,11 +36,6 @@ public class ToolMaterial
return materialName;
}
public int tier()
{
return craftingTier;
}
public int durability()
{
return this.durability;
@ -80,7 +68,7 @@ public class ToolMaterial
public float shoddy()
{
return this.shoddy;
return this.stonebound;
}
public String style()

View File

@ -4,5 +4,10 @@ import net.minecraft.item.ItemStack;
public interface IToolPart
{
/** Parts to build tools from. ex: Pickaxe Head
*
* @param stack This item
* @return Proper material ID. -1 for invalid
*/
public int getMaterialID(ItemStack stack);
}

View File

@ -26,8 +26,11 @@ public class ModAttack extends ToolMod
@Override
protected boolean canModify (ItemStack tool, ItemStack[] input)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
ToolCore toolItem = (ToolCore) tool.getItem();
if (!validType(toolItem))
return false;
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
if (!tags.hasKey(key))
return tags.getInteger("Modifiers") > 0;
@ -51,7 +54,7 @@ public class ModAttack extends ToolMod
{
int amount = 24;
ToolCore toolItem = (ToolCore) tool.getItem();
if (toolItem.pierceArmor() || !validType(toolItem))
if (toolItem.pierceArmor() || !nerfType(toolItem))
amount = 36;
int[] keyPair = tags.getIntArray(key);
@ -107,7 +110,13 @@ public class ModAttack extends ToolMod
tags.setString(tip, modName);
}
public boolean validType(ToolCore tool)
public boolean validType(ToolCore tool)
{
List list = Arrays.asList(tool.toolCategories());
return list.contains("melee") || list.contains("harvest");
}
public boolean nerfType(ToolCore tool)
{
List list = Arrays.asList(tool.toolCategories());
return list.contains("throwing");

View File

@ -103,6 +103,6 @@ public class ModRedstone extends ToolMod
public boolean validType(ToolCore tool)
{
List list = Arrays.asList(tool.toolCategories());
return list.contains("harvest");
return list.contains("harvest") || list.contains("utility");
}
}

View File

@ -85,6 +85,9 @@ public class PHConstruct
landmine = config.getBlock("Landmine", 1470).getInt(1470);
barricade = config.getBlock("Barricade", 1469).getInt(1469);
toolForge = config.getBlock("Tool Forge", 1468).getInt(1468);
multiBrickFancy = config.getBlock("Multi Brick Fancy", 1467).getInt(1467);
aggregator = config.getBlock("Aggregator", 3221).getInt(3221);
/*golemCore = config.getBlock("Golem Core", 1481).getInt(1481);
golemHead = config.getBlock("Golem Head", 1482).getInt(1482);*/
@ -280,6 +283,8 @@ public class PHConstruct
//InfiBlocks
public static int speedBlock;
public static int aggregator;
//Liquids
public static int metalFlowing;
@ -288,6 +293,7 @@ public class PHConstruct
//Decoration
public static int stoneTorch;
public static int multiBrick;
public static int multiBrickFancy;
public static int redstoneBallRepeater;
//Patterns and misc

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 845 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 473 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -0,0 +1,32 @@
0*2
1*2
2*2
3*2
4*2
5*2
6*2
7*2
8*2
9*2
10*2
11*2
12*2
13*2
14*2
15*2
16*2
17*2
18*2
19*2
20*2
21*2
22*2
23*2
24*2
25*2
26*2
27*2
28*2
29*2
30*2
31*2

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB