Tool Forge Renderer Fix

master
mDiyo 2013-06-20 00:27:29 -07:00
parent 9c81ebbac6
commit 03ea24ee58
24 changed files with 489 additions and 87 deletions

View File

@ -64,7 +64,7 @@
<entry key="block.brick.gold.name">Gold Brick</entry>
<entry key="block.brick.diamond.name">Diamond Brick</entry>
<entry key="block.brick.lapis.name">Lapis Brick</entry>
<entry key="block.brick.stone.refined.name">Refined Stone Brick</entry>
<entry key="block.brick.stone.refined.name">Polished Stone Brick</entry>
<entry key="block.brick.redstone.name">Redstone Brick</entry>
<entry key="block.brick.bone.name">Bone Brick</entry>
<entry key="block.brick.slime.name">Slime Brick</entry>
@ -79,7 +79,7 @@
<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.stone.refined.name">Polished 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>

View File

@ -37,6 +37,19 @@ You can then shape a material in a part builder with the pattern, then combine p
Together these make the Tool Workshop. It is recommended you keep all of these nearby when using any of them.</text>
</page>
<page type="text">
<text>Oreberry Bushes
Sometime in your travels you will happen upon the bush known as the Oreberry. They grow underground in dark areas, and require close to complete darkness to produce anything.
The berries can be melted down into nuggets and ingots, making them an invaluable source of metals.</text>
</page>
<page type="picture">
<text>Oreberries in their natural environment</text>
<picture>/mods/tinker/resources/manuals/oreberries.png</picture>
</page>
<page type="crafting">
<text>Blank Pattern</text>
<recipe>

View File

@ -214,7 +214,7 @@ Shift+Right-click: Place Item
- The frying pan cooks a large amount of food at a time.
Natural Abilities:
- Heavy, does extra knockback and stuns the foe.</text>
- Bash, does extra knockback and stuns the foe.</text>
<icon>frypanicon</icon>
<item>
<text>Pan</text>
@ -262,6 +262,178 @@ Class: Utility Tool</text>
</item>
</page>
<page type="toolpage">
<title>Hammer</title>
<text>The Hammer is a heavy mining tool meant for digging out large areas. It is also effective on undead.</text>
<text>Natural Abilities:
- Area of Effect, Mines a 3x3 area. The direction depends on which face is pounded.
- Smite II, Does 2-4 extra hearts of damage against undead.
- Huge Durability, his tool has very high durability to make up for the constant beating it will recieve.
Class: Broad Mining Tool</text>
<icon>hammericon</icon>
<item>
<text>Hammer Head</text>
<icon>hammerhead</icon>
</item>
<item>
<text>Large Plate</text>
<icon>largeplate</icon>
</item>
<item>
<text>Tough Rod</text>
<icon>toughrod</icon>
</item>
<item>
<text>Large Plate</text>
<icon>largeplate</icon>
</item>
</page>
<page type="toolpage">
<title>Lumber Axe</title>
<text>The Lumber Axe is capable of bringing down whole trees or clearing large swaths of food in a single swing.</text>
<text>Natural Abilities:
Fell Trees
- Harvests entire trees. It has a max height of 30. Trees are defined as Leaves on top of Logs.
Area of Effect
- Mines a 3x3x3 area. This is a fallback if a tree is not found.
Class: Broad Mining Tool</text>
<icon>lumbericon</icon>
<item>
<text>Broad Axe Head</text>
<icon>broadaxehead</icon>
</item>
<item>
<text>Large Plate</text>
<icon>largeplate</icon>
</item>
<item>
<text>Tough Rod</text>
<icon>toughrod</icon>
</item>
<item>
<text>Tough Binding</text>
<icon>toughbinding</icon>
</item>
</page>
<page type="toolpage">
<title>Excavator</title>
<text>The Excavator is a large digging tool used for clearing out large swaths of land, gravel, or snow.</text>
<text>Natural Abilities:
Area of Effect
- Mines a 3x3 area. The direction depends on which face is scooped.
Class: Broad Mining Tool</text>
<icon>excavatoricon</icon>
<item>
<text>Excavator Head</text>
<icon>excavatorhead</icon>
</item>
<item>
<text>Large Plate</text>
<icon>largeplate</icon>
</item>
<item>
<text>Tough Rod</text>
<icon>toughrod</icon>
</item>
<item>
<text>Tough Binding</text>
<icon>toughbinding</icon>
</item>
</page>
<page type="toolpage">
<title>Scythe</title>
<text>The Scythe is well known for its large swinging area. It can be used to harvest crops, leaves, and is a decent weapon.</text>
<text>Natural Abilities:
Area of Effect
- Attacks mobs in a 3x3x3.
- Harvests a 3x3x3 area.
Class: Broad Melee Weapon</text>
<icon>scytheicon</icon>
<item>
<text>Scythe Head</text>
<icon>excavatorhead</icon>
</item>
<item>
<text>Tough Rod</text>
<icon>toughrod</icon>
</item>
<item>
<text>Tough Binding</text>
<icon>toughbinding</icon>
</item>
<item>
<text>Tough Rod</text>
<icon>toughrod</icon>
</item>
</page>
<page type="toolpage">
<title>Cleaver</title>
<text>The Cleaver is a heavy defensive weapon. The sword is unwieldly, but the sheer weight of the tool crushes foes.</text>
<text>Right-click: Block
- Blocking cuts a wide variety of damage types in half.
Natural Abilities:
- Beheading II, Beheads mobs. Their head is dropped as loot.
- Heavy, Base attack is increased at the cost of swing time
Class: Heavy Melee Weapon</text>
<icon>cleavericon</icon>
<item>
<text>Large Blade</text>
<icon>largeswordblade</icon>
</item>
<item>
<text>Large Plate</text>
<icon>largeplate</icon>
</item>
<item>
<text>Tough Rod</text>
<icon>toughrod</icon>
</item>
<item>
<text>Tough Rod</text>
<icon>toughrod</icon>
</item>
</page>
<page type="toolpage">
<title>Battleaxe</title>
<text>The battleaxe is an offensive melee weapon that can also bring down small trees.</text>
<text>Right-click: TBD
- This ability is incomplete
Natural Abilities:
- Area of Effect, harvests wood blocks in a 1x9 tower.
- Bash, knocks the enemy further away than normal.
Class: Heavy Melee Weapon</text>
<icon>battleaxeicon</icon>
<item>
<text>Broad Axe Head</text>
<icon>broadaxehead</icon>
</item>
<item>
<text>Broad Axe Head</text>
<icon>broadaxehead</icon>
</item>
<item>
<text>Tough Rod</text>
<icon>toughrod</icon>
</item>
<item>
<text>Tough Binding</text>
<icon>toughbinding</icon>
</item>
</page>
<page type="sectionpage">
<title>Material Traits</title>
<text>Some materials have traits that augment their natural uses.
@ -269,8 +441,7 @@ Class: Utility Tool</text>
- Reinforced: 10% chance per level of not using durability
- Stonebound: The tool mines faster as it wears out, but does less damage
- Spiny: The tool mines does more damage as it wears out, but mines slower
- Writable: One extra modifier per piece
- Awareness: Unknown</text>
- Writable: One extra modifier per piece</text>
</page>
<page type="materialstats">

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -4,6 +4,7 @@ import java.util.List;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.blocks.logic.ToolForgeLogic;
import mods.tinker.tconstruct.client.block.TableForgeRender;
import mods.tinker.tconstruct.client.block.TableRender;
import mods.tinker.tconstruct.common.TContent;
import mods.tinker.tconstruct.common.TProxyCommon;
@ -88,7 +89,7 @@ public class ToolForgeBlock extends InventoryBlock
@Override
public int getRenderType ()
{
return TableRender.tabelModelID;
return TableForgeRender.model;
}
@Override

View File

@ -78,7 +78,7 @@ public class CastingBasinLogic extends InventoryLogic implements ILiquidTank, IT
ItemStack inv = inventory[0];
if (inv != null && inv.getItem() instanceof IPattern)
ret *= ((IPattern) inv.getItem()).getPatternCost(inv.getItemDamage()) * 0.5;
ret *= ((IPattern) inv.getItem()).getPatternCost(inv) * 0.5;
else
ret = TConstruct.basinCasting.getCastingAmount(this.liquid, inv);
@ -93,7 +93,7 @@ public class CastingBasinLogic extends InventoryLogic implements ILiquidTank, IT
ItemStack inv = inventory[0];
if (inv != null && inv.getItem() instanceof IPattern)
ret *= ((IPattern) inv.getItem()).getPatternCost(inv.getItemDamage()) * 0.5;
ret *= ((IPattern) inv.getItem()).getPatternCost(inv) * 0.5;
else
ret = capacity;

View File

@ -78,7 +78,7 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank, IT
ItemStack inv = inventory[0];
if (inv != null && inv.getItem() instanceof IPattern)
ret *= ((IPattern) inv.getItem()).getPatternCost(inv.getItemDamage()) * 0.5;
ret *= ((IPattern) inv.getItem()).getPatternCost(inv) * 0.5;
else
ret = TConstruct.tableCasting.getCastingAmount(this.liquid, inv);
@ -93,7 +93,7 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank, IT
ItemStack inv = inventory[0];
if (inv != null && inv.getItem() instanceof IPattern)
ret *= ((IPattern) inv.getItem()).getPatternCost(inv.getItemDamage()) * 0.5;
ret *= ((IPattern) inv.getItem()).getPatternCost(inv) * 0.5;
else
ret = capacity;

View File

@ -63,7 +63,7 @@ public class PartCrafterLogic extends InventoryLogic
{
int value = PatternBuilder.instance.getPartValue(inventory[2]);
IPattern item = (IPattern)inventory[0].getItem();
int cost = item != null ? item.getPatternCost(inventory[0].getItemDamage()) : 0;
int cost = item != null ? item.getPatternCost(inventory[0]) : 0;
if (value > 0 && cost > 0)
{
int decrease = cost / value;
@ -88,7 +88,7 @@ public class PartCrafterLogic extends InventoryLogic
{
int value = PatternBuilder.instance.getPartValue(inventory[3]);
IPattern item = (IPattern)inventory[1].getItem();
int cost = item != null ? item.getPatternCost(inventory[1].getItemDamage()) : 0;
int cost = item != null ? item.getPatternCost(inventory[1]) : 0;
if (value > 0 && cost > 0)
{
int decrease = cost / value;

View File

@ -3,8 +3,6 @@ package mods.tinker.tconstruct.client;
import java.io.File;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@ -32,6 +30,7 @@ import mods.tinker.tconstruct.client.block.OreberryRender;
import mods.tinker.tconstruct.client.block.SearedRender;
import mods.tinker.tconstruct.client.block.SmallFontRenderer;
import mods.tinker.tconstruct.client.block.SmelteryRender;
import mods.tinker.tconstruct.client.block.TableForgeRender;
import mods.tinker.tconstruct.client.block.TableRender;
import mods.tinker.tconstruct.client.block.TankRender;
import mods.tinker.tconstruct.client.entity.CartRender;
@ -159,7 +158,7 @@ public class TProxyClient extends TProxyCommon
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();
@ -276,6 +275,7 @@ public class TProxyClient extends TProxyCommon
MinecraftForge.EVENT_BUS.register(new TClientEvents());
smallFontRenderer = new SmallFontRenderer(mc.gameSettings, "/font/default.png", mc.renderEngine, false);
RenderingRegistry.registerBlockHandler(new TableRender());
RenderingRegistry.registerBlockHandler(new TableForgeRender());
RenderingRegistry.registerBlockHandler(new FrypanRender());
RenderingRegistry.registerBlockHandler(new SmelteryRender());
RenderingRegistry.registerBlockHandler(new TankRender());
@ -398,6 +398,12 @@ public class TProxyClient extends TProxyCommon
TConstructClientRegistry.registerManualIcon("knifeblade", new ItemStack(TContent.knifeBlade, 1, 2));
TConstructClientRegistry.registerManualIcon("chiselhead", new ItemStack(TContent.chiselHead, 1, 2));
TConstructClientRegistry.registerManualIcon("hammerhead", new ItemStack(TContent.hammerHead, 1, 2));
TConstructClientRegistry.registerManualIcon("excavatorhead", new ItemStack(TContent.excavatorHead, 1, 2));
TConstructClientRegistry.registerManualIcon("scythehead", new ItemStack(TContent.scytheBlade, 1, 2));
TConstructClientRegistry.registerManualIcon("broadaxehead", new ItemStack(TContent.broadAxeHead, 1, 2));
TConstructClientRegistry.registerManualIcon("largeswordblade", new ItemStack(TContent.largeSwordBlade, 1, 2));
TConstructClientRegistry.registerManualIcon("toolrod", new ItemStack(Item.stick));
TConstructClientRegistry.registerManualIcon("binding", new ItemStack(TContent.binding, 1, 4));
@ -405,6 +411,10 @@ public class TProxyClient extends TProxyCommon
TConstructClientRegistry.registerManualIcon("handguard", new ItemStack(TContent.handGuard, 1, 4));
TConstructClientRegistry.registerManualIcon("crossbar", new ItemStack(TContent.crossbar, 1, 4));
TConstructClientRegistry.registerManualIcon("toughrod", new ItemStack(TContent.toughRod, 1, 0));
TConstructClientRegistry.registerManualIcon("toughbinding", new ItemStack(TContent.toughBinding, 1, 17));
TConstructClientRegistry.registerManualIcon("largeplate", new ItemStack(TContent.heavyPlate, 1, 17));
//ToolIcons
TConstructClientRegistry.registerManualIcon("pickicon",
ToolBuilder.instance.buildTool(new ItemStack(TContent.pickaxeHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.binding, 1, 12), ""));
@ -423,6 +433,19 @@ public class TProxyClient extends TProxyCommon
TConstructClientRegistry.registerManualIcon("frypanicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.frypanHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, ""));
TConstructClientRegistry.registerManualIcon("battlesignicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.signHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, ""));
TConstructClientRegistry.registerManualIcon("chiselicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.chiselHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, ""));
TConstructClientRegistry.registerManualIcon("hammericon", ToolBuilder.instance.buildTool(new ItemStack(TContent.hammerHead, 1, 10), new ItemStack(TContent.toughRod, 1, 11),
new ItemStack(TContent.heavyPlate, 1, 12), new ItemStack(TContent.heavyPlate, 8), ""));
TConstructClientRegistry.registerManualIcon("lumbericon", ToolBuilder.instance.buildTool(new ItemStack(TContent.broadAxeHead, 1, 10), new ItemStack(TContent.toughRod, 1, 11),
new ItemStack(TContent.heavyPlate, 1, 12), new ItemStack(TContent.toughBinding, 8), ""));
TConstructClientRegistry.registerManualIcon("excavatoricon", ToolBuilder.instance.buildTool(new ItemStack(TContent.excavatorHead, 1, 10), new ItemStack(TContent.toughRod, 1, 11),
new ItemStack(TContent.heavyPlate, 1, 12), new ItemStack(TContent.toughBinding, 8), ""));
TConstructClientRegistry.registerManualIcon("scytheicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.scytheBlade, 1, 10), new ItemStack(TContent.toughRod, 1, 11),
new ItemStack(TContent.toughBinding, 1, 12), new ItemStack(TContent.toughRod, 8), ""));
TConstructClientRegistry.registerManualIcon("cleavericon", ToolBuilder.instance.buildTool(new ItemStack(TContent.largeSwordBlade, 1, 10), new ItemStack(TContent.toughRod, 1, 11),
new ItemStack(TContent.heavyPlate, 1, 12), new ItemStack(TContent.toughRod, 8), ""));
TConstructClientRegistry.registerManualIcon("battleaxeicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.broadAxeHead, 1, 10), new ItemStack(TContent.toughRod, 1, 11),
new ItemStack(TContent.broadAxeHead, 1, 12), new ItemStack(TContent.toughBinding, 8), ""));
}
public void initManualRecipes ()
@ -614,23 +637,18 @@ public class TProxyClient extends TProxyCommon
}
addTierTwoButton(6, 13, 0, new int[] { 11, 8, 9, 9 }, new int[] { 2, 3, 2, 2 }, "Hammer",
"The Hammer is a broad mining tool. It harvests blocks in a wide range and is effective against undead.\n\nNatural Abilities:\nArea of Effect\n- (3x3x3)\n- Smite\n\nDurability: High");
"The Hammer is a broad mining tool. It harvests blocks in a wide range and is effective against undead.\n\nNatural Abilities:\nArea of Effect\n- (3x3)\n- Smite\n\nDurability: High");
addTierTwoButton(5, 11, 0, new int[] { 6, 8, 9, 9 }, new int[] { 2, 3, 2, 3 }, "Lumber Axe",
"The Lumber Axe is a broad chopping tool. It can fell entire trees or gather wood in a wide range.\n\nNatural Abilities:\n- Fell Trees\nArea of Effect\n- (3x3x3)\n\nDurability: Average");
addTierTwoButton(4, 12, 0, new int[] { 10, 8, 9, 8 }, new int[] { 2, 3, 3, 3 }, "Excavator",
"The Lumber Axe is a broad chopping tool. It can fell entire trees or gather wood in a wide range.\n\nNatural Abilities:\nArea of Effect\n- Fell Trees\n- (3x3x3)\n\nDurability: Average");
addTierTwoButton(5, 12, 0, new int[] { 10, 8, 9, 9 }, new int[] { 2, 3, 2, 3 }, "Excavator",
"The Excavator is a broad digging tool. It harvests soil and snow in a wide range.\n\nNatural Ability:\n- Area of Effect\n- (3x3)\n\nDurability: Average");
addTierTwoButton(4, 10, 0, new int[] { 8, 8, 9, 8 }, new int[] { 2, 3, 3, 3 }, "Scythe",
"The Scythe is a broad reaping tool. It is effective on plants and attacks enemies in a wide range.\n\nNatural Ability:\nArea of Effect\n- (3x3x3)\n\nDurability: Average\nDamage: Low, AoE");
addTierTwoButton(5, 7, 1, new int[] { 6, 8, 9, 8 }, new int[] { 3, 3, 2, 3 }, "Cleaver",
"The Cleaver is a heavy defensive weapon. It has powerful strikes, but is difficult to wield.\n\nSpecial Ability: Block\nNatural Ability:\n- Beheading\n\nDamage: Very High\nDurability: Average");
addTierTwoButton(
5,
8,
1,
new int[] { 6, 8, 6, 9 },
new int[] { 2, 3, 2, 3 },
"Battleaxe",
"The Battleaxe is a heavy offensive weapon. It is capable of bringing down small trees and can send foes flying.\n\nSpecial Ability: Block\nNatural Abilities:\n- Knockback\n- Area of Effect\n- (1x9)\n\nDamage: Average\nDurability: Average");
addTierTwoButton(5, 8, 1, new int[] { 6, 8, 6, 9 }, new int[] { 2, 3, 2, 3 }, "Battleaxe",
"The Battleaxe is a heavy offensive weapon. It is capable of bringing down small trees and can send foes flying.\n\nSpecial Ability: Block\nNatural Abilities:"
+ "\n- Knockback\n- Area of Effect\n- (1x9)\n\nDamage: Average\nDurability: Average");
}
void addToolButton (int slotType, int xButton, int yButton, int[] xIcons, int[] yIcons, String title, String body)

View File

@ -0,0 +1,96 @@
package mods.tinker.tconstruct.client.block;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
public class TableForgeRender implements ISimpleBlockRenderingHandler
{
public static int model = RenderingRegistry.getNextAvailableRenderId();
@Override
public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer)
{
if (modelID == model)
{
renderer.setRenderBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F);
renderStandardInvBlock(renderer, block, metadata);
renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.25F, 0.75F, 0.25F);
renderStandardInvBlock(renderer, block, metadata);
renderer.setRenderBounds(0.75F, 0.0F, 0.0F, 1.0F, 0.75F, 0.25F);
renderStandardInvBlock(renderer, block, metadata);
renderer.setRenderBounds(0.0F, 0.0F, 0.75F, 0.25F, 0.75F, 1.0F);
renderStandardInvBlock(renderer, block, metadata);
renderer.setRenderBounds(0.75F, 0.0F, 0.75F, 1.0F, 0.75F, 1.0F);
renderStandardInvBlock(renderer, block, metadata);
}
}
@Override
public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer)
{
if (modelID == model)
{
renderer.setRenderBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.25F, 0.75F, 0.25F);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.75F, 0.0F, 0.0F, 1.0F, 0.75F, 0.25F);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.0F, 0.0F, 0.75F, 0.25F, 0.75F, 1.0F);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.75F, 0.0F, 0.75F, 1.0F, 0.75F, 1.0F);
renderer.renderStandardBlock(block, x, y, z);
}
return true;
}
@Override
public boolean shouldRender3DInInventory ()
{
return true;
}
@Override
public int getRenderId ()
{
return model;
}
public static void renderStandardInvBlock (RenderBlocks renderblocks, Block block, int meta)
{
Tessellator tessellator = Tessellator.instance;
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1F, 0.0F);
renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1F);
renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1F, 0.0F, 0.0F);
renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta));
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
}

View File

@ -810,11 +810,22 @@ public class GuiManual extends GuiScreen
RenderHelper.disableStandardItemLighting();
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);
String icon = icons[1].getTooltip(this.mc.thePlayer, false).get((0)).toString();
int iconOffset = icon.length() > 12 ? 0 : 3;
this.fonts.drawSplitString(icon, localWidth + 128, localHeight + 50 + iconOffset, 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);
{
icon = icons[2].getTooltip(this.mc.thePlayer, false).get((0)).toString();
iconOffset = icon.length() > 12 ? 0 : 3;
this.fonts.drawSplitString(icons[2].getTooltip(this.mc.thePlayer, false).get((0)).toString(), localWidth + 128, localHeight + 82 + iconOffset, 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);
{
icon = icons[3].getTooltip(this.mc.thePlayer, false).get((0)).toString();
iconOffset = icon.length() > 12 ? 0 : 3;
this.fonts.drawSplitString(icons[3].getTooltip(this.mc.thePlayer, false).get((0)).toString(), localWidth + 128, localHeight + 114 + iconOffset, 52, 0);
}
this.fonts.drawString("Durability: " + material.durability(), localWidth, localHeight + 40, 0);
this.fonts.drawString("Handle Modifier: " + material.handleDurability() + "x", localWidth, localHeight + 50, 0);
@ -863,7 +874,7 @@ public class GuiManual extends GuiScreen
{
this.fonts.drawString("\u00a7n" + title, localWidth + 70, localHeight + 4, 0);
this.fonts.drawSplitString(multiText[0], localWidth, localHeight + 16, 178, 0);
int size = multiText[0].length() / 50;
int size = multiText[0].length() / 48;
this.fonts.drawSplitString(multiText[1], localWidth, localHeight + 28 + 10 * size, 118, 0);
this.fonts.drawString("Crafting Parts: ", localWidth + 124, localHeight + 28 + 10 * size, 0);
@ -875,7 +886,8 @@ public class GuiManual extends GuiScreen
for (int i = 1; i < icons.length; i++)
{
renderitem.renderItemAndEffectIntoGUI(fonts, mc.renderEngine, icons[i], localWidth + 120, localHeight + 20 + 10 * size + 18 * i);
this.fonts.drawSplitString(multiText[i + 1], localWidth + 140, localHeight + 24 + 10 * size + 18 * i, 42, 0);
int partOffset = multiText[i+1].length() > 11 ? -3 : 0;
this.fonts.drawSplitString(multiText[i + 1], localWidth + 140, localHeight + 24 + 10 * size + 18 * i + partOffset, 44, 0);
}
renderitem.zLevel = 0;
RenderHelper.disableStandardItemLighting();

View File

@ -487,22 +487,22 @@ public class TContent implements IFuelHandler
String[] materialStrings = { "paperStack", "greenSlimeCrystal", "searedBrick", "ingotCobalt", "ingotArdite", "ingotManyullyn", "mossBall", "lavaCrystal", "necroticBone", "ingotCopper",
"ingotTin", "ingotAluminum", "rawAluminum", "ingotBronze", "ingotAluminumBrass", "ingotAlumite", "ingotSteel", "blueSlimeCrystal", "ingotObsidian", "nuggetIron", "nuggetCopper",
"nuggetTin", "nuggetAluminum", "nuggetSilver", "nuggetAluminumBrass", "silkyCloth", "silkyJewel" };
for (int i = 0; i < materialStrings.length; i++)
{
TConstructRegistry.addItemStackToDirectory(materialStrings[i], new ItemStack(materials, 1, i));
}
String[] oreberries = { "Iron", "Gold", "Copper", "Tin", "Aluminum", "Silver" };
for (int i = 0; i < oreberries.length; i++)
{
TConstructRegistry.addItemStackToDirectory("oreberry"+oreberries[i], new ItemStack(oreBerries, 1, i));
TConstructRegistry.addItemStackToDirectory("oreberry" + oreberries[i], new ItemStack(oreBerries, 1, i));
}
TConstructRegistry.addItemStackToDirectory("diamondApple", new ItemStack(diamondApple, 1, 0));
TConstructRegistry.addItemStackToDirectory("blueSlimeFood", new ItemStack(strangeFood, 1, 0));
TConstructRegistry.addItemStackToDirectory("canisterEmpty", new ItemStack(heartCanister, 1, 0));
TConstructRegistry.addItemStackToDirectory("miniRedHeart", new ItemStack(heartCanister, 1, 1));
TConstructRegistry.addItemStackToDirectory("canisterRedHeart", new ItemStack(heartCanister, 1, 2));
@ -612,6 +612,31 @@ public class TContent implements IFuelHandler
patternOutputs = new Item[] { toolRod, pickaxeHead, shovelHead, hatchetHead, swordBlade, wideGuard, handGuard, crossbar, binding, frypanHead, signHead, knifeBlade, chiselHead, toughRod,
toughBinding, heavyPlate, broadAxeHead, scytheBlade, excavatorHead, largeSwordBlade, hammerHead, fullGuard };
int[] nonMetals = { 0, 1, 3, 4, 5, 6, 7, 8, 9, 17 };
if (PHConstruct.craftMetalTools)
{
for (int mat = 0; mat < 18; mat++)
{
for (int meta = 0; meta < patternOutputs.length; meta++)
{
TConstructRegistry.addPartMapping(woodPattern.itemID, meta + 1, mat, new ItemStack(patternOutputs[meta], 1, mat));
}
TConstructRegistry.addPartMapping(woodPattern.itemID, 22, mat, new ItemStack(fullGuard, 1, mat));
}
}
else
{
for (int mat = 0; mat < nonMetals.length; mat++)
{
for (int meta = 0; meta < patternOutputs.length; meta++)
{
TConstructRegistry.addPartMapping(woodPattern.itemID, meta + 1, nonMetals[mat], new ItemStack(patternOutputs[meta], 1, nonMetals[mat]));
}
TConstructRegistry.addPartMapping(woodPattern.itemID, 22, nonMetals[mat], new ItemStack(fullGuard, 1, nonMetals[mat]));
}
}
ToolBuilder tb = ToolBuilder.instance;
tb.addNormalToolRecipe(pickaxe, pickaxeHead, binding);
tb.addNormalToolRecipe(broadsword, swordBlade, wideGuard);
@ -628,7 +653,7 @@ public class TContent implements IFuelHandler
tb.addNormalToolRecipe(scythe, scytheBlade, toughRod, toughBinding, toughRod);
tb.addNormalToolRecipe(lumberaxe, broadAxeHead, toughRod, heavyPlate, toughBinding);
tb.addNormalToolRecipe(cleaver, largeSwordBlade, toughRod, heavyPlate, toughRod);
tb.addNormalToolRecipe(excavator, excavatorHead, toughRod, toughBinding, toughRod);
tb.addNormalToolRecipe(excavator, excavatorHead, toughRod, heavyPlate, toughBinding);
tb.addNormalToolRecipe(hammer, hammerHead, toughRod, heavyPlate, heavyPlate);
tb.addNormalToolRecipe(battleaxe, broadAxeHead, toughRod, broadAxeHead, toughBinding);
@ -746,8 +771,9 @@ public class TContent implements IFuelHandler
ItemStack cast = new ItemStack(metalPattern, 1, iter + 1);
for (int iterTwo = 0; iterTwo < liquids.length; iterTwo++)
{
tableCasting.addCastingRecipe(new ItemStack(patternOutputs[iter], 1, liquidDamage[iterTwo]), new LiquidStack(liquids[iterTwo].itemID, ((IPattern) metalPattern).getPatternCost(iter)
* TConstruct.ingotLiquidValue / 2, liquids[iterTwo].itemMeta), cast, 50);
ItemStack metalCast = new ItemStack(patternOutputs[iter], 1, liquidDamage[iterTwo]);
tableCasting.addCastingRecipe(metalCast, new LiquidStack(liquids[iterTwo].itemID, ((IPattern) metalPattern).getPatternCost(metalCast) * TConstruct.ingotLiquidValue / 2,
liquids[iterTwo].itemMeta), cast, 50);
}
}
@ -1012,6 +1038,10 @@ public class TContent implements IFuelHandler
GameRegistry.addShapelessRecipe(new ItemStack(heartCanister, 1, 2), new ItemStack(diamondApple), necroticBone, new ItemStack(heartCanister, 1, 0), new ItemStack(heartCanister, 1, 1));
GameRegistry.addRecipe(new ItemStack(knapsack, 1, 0), "###", "rmr", "###", '#', new ItemStack(Item.leather), 'r', new ItemStack(toughRod, 1, 2), 'm', new ItemStack(Item.ingotGold));
GameRegistry.addRecipe(new ItemStack(knapsack, 1, 0), "###", "rmr", "###", '#', new ItemStack(Item.leather), 'r', new ItemStack(toughRod, 1, 2), 'm', new ItemStack(materials, 1, 14));
//Remove vanilla recipes
RecipeRemover.removeShapedRecipe(new ItemStack(Block.blockIron));
RecipeRemover.removeShapedRecipe(new ItemStack(Block.blockGold));
}
void setupToolTabs ()

View File

@ -2,7 +2,7 @@ package mods.tinker.tconstruct.items;
import java.util.List;
import mods.tinker.tconstruct.common.TContent;
import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.library.crafting.PatternBuilder.MaterialSet;
import mods.tinker.tconstruct.library.util.IPattern;
import net.minecraft.creativetab.CreativeTabs;
@ -68,7 +68,7 @@ public class Pattern extends CraftingItem
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
{
float cost = getPatternCost(stack.getItemDamage()) / 2f;
float cost = getPatternCost(stack) / 2f;
if (cost > 0)
{
if (cost - (int)cost < 0.1)
@ -79,9 +79,10 @@ public class Pattern extends CraftingItem
}
//2 for full material, 1 for half.
public int getPatternCost (int meta)
@Override
public int getPatternCost (ItemStack pattern)
{
switch (meta)
switch (pattern.getItemDamage())
{
case 0: return 2;
case 1: return 1;
@ -111,13 +112,8 @@ public class Pattern extends CraftingItem
}
@Override
public ItemStack getPatternOutput (ItemStack stack, MaterialSet set)
public ItemStack getPatternOutput (ItemStack stack, ItemStack input, MaterialSet set)
{
int type = stack.getItemDamage();
if (type != 0 && type < TContent.patternOutputs.length + 1)
{
return new ItemStack(TContent.patternOutputs[type - 1], 1, set.materialID);
}
return null;
return TConstructRegistry.getPartMapping(this.itemID, stack.getItemDamage(), set.materialID);
}
}

View File

@ -57,13 +57,13 @@ public class Excavator extends HarvestTool
@Override
public Item getAccessoryItem ()
{
return TContent.toughBinding;
return TContent.heavyPlate;
}
@Override
public Item getExtraItem ()
{
return TContent.toughRod;
return TContent.toughBinding;
}
@Override
@ -80,7 +80,7 @@ public class Excavator extends HarvestTool
@Override
public int durabilityTypeAccessory ()
{
return 1;
return 2;
}
@Override

View File

@ -2,13 +2,16 @@ package mods.tinker.tconstruct.library;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
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;
import net.minecraftforge.common.ForgeHooks;
/** A registry to store any relevant API work
*
@ -115,6 +118,30 @@ public class TConstructRegistry
}
public static ArrayList<ToolCore> tools = new ArrayList<ToolCore>(20);
//Parts
/** List: Item ID, metadata, material ID
* ItemStack: Output. Ex: Cactus Binding
*/
public static HashMap<List, ItemStack> patternPartMapping = new HashMap<List, ItemStack>();
/** Maps an item and a material ID to an output part
*
* @param patternID ID to check against
* @param patternMeta Metadata to check against
* @param materialID Material that goes with the item
* @param output The resulting part
*/
public static void addPartMapping(int patternID, int patternMeta, int materialID, ItemStack output)
{
patternPartMapping.put(Arrays.asList(patternID, patternMeta, materialID), output);
}
public static ItemStack getPartMapping(int itemID, int metadata, int materialID)
{
return patternPartMapping.get(Arrays.asList(itemID, metadata, materialID));
}
//Tools
/** Internal tool mapping, used for adding textures

View File

@ -53,11 +53,11 @@ public class PatternBuilder
if (key != null)
{
MaterialSet mat = (MaterialSet) materialSets.get(key.key);
ItemStack toolPart = getMatchingPattern(pattern, mat);
ItemStack toolPart = getMatchingPattern(pattern, material, mat);
if (toolPart != null)
{
int patternValue = ((IPattern) pattern.getItem()).getPatternCost(pattern.getItemDamage());
int patternValue = ((IPattern) pattern.getItem()).getPatternCost(pattern);
int totalMaterial = key.value * material.stackSize;
if (totalMaterial < patternValue) // Not enough material
@ -136,13 +136,13 @@ public class PatternBuilder
return null;
}
public ItemStack getMatchingPattern (ItemStack stack, MaterialSet set)
public ItemStack getMatchingPattern (ItemStack stack, ItemStack input, MaterialSet set)
{
Item item = stack.getItem();
for (IPattern pattern : toolPatterns)
{
if (pattern == item)
return pattern.getPatternOutput(stack, set);
return pattern.getPatternOutput(stack, input, set);
}
return null;
}

View File

@ -5,8 +5,8 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import mods.tinker.tconstruct.event.ToolCraftEvent;
import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.library.event.ToolCraftEvent;
import mods.tinker.tconstruct.library.tools.ToolCore;
import mods.tinker.tconstruct.library.tools.ToolMaterial;
import mods.tinker.tconstruct.library.tools.ToolMod;

View File

@ -1,10 +1,14 @@
package mods.tinker.tconstruct.event;
package mods.tinker.tconstruct.library.event;
import mods.tinker.tconstruct.library.tools.ToolCore;
import mods.tinker.tconstruct.library.tools.ToolMaterial;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.event.Event;
/* This event fires after all of the other construction. The resulting nbttag is added to the tool
* Note: The tag is the base tag. toolTag.getCompoundTag("InfiTool") will have all of the tool's data.
*/
public class ToolCraftEvent extends Event
{
public final ToolCore tool;

View File

@ -5,6 +5,6 @@ import net.minecraft.item.ItemStack;
public interface IPattern
{
public int getPatternCost (int metadata);
public ItemStack getPatternOutput(ItemStack stack, MaterialSet set);
public int getPatternCost (ItemStack pattern);
public ItemStack getPatternOutput(ItemStack pattern, ItemStack input, MaterialSet set);
}

View File

@ -58,6 +58,7 @@ public class PHConstruct
enableTStone = config.get("Difficulty Changes", "Enable mod stone tools", true).getBoolean(true);
enableTCactus = config.get("Difficulty Changes", "Enable mod cactus tools", true).getBoolean(true);
enableTBone = config.get("Difficulty Changes", "Enable mod bone tools", true).getBoolean(true);
craftMetalTools = config.get("Difficulty Changes", "Craft metals with Wood Patterns", false).getBoolean(false);
blueSlime = config.get("Mob Spawning", "Activate Blue Slime Spawns", true).getBoolean(true);
blueSlimeWeight = config.get("Mob Spawning", "Spawn Weight for Blue Slime", 7).getInt(7);
@ -464,6 +465,8 @@ public class PHConstruct
public static boolean enableTCactus;
public static boolean enableTBone;
public static boolean craftMetalTools;
//Superfun
public static boolean superfunWorld;
public static boolean beginnerBook;

View File

@ -6,12 +6,13 @@ import java.util.Random;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.blocks.logic.LiquidTextureLogic;
import mods.tinker.tconstruct.common.TContent;
import mods.tinker.tconstruct.event.ToolCraftEvent;
import mods.tinker.tconstruct.library.crafting.PatternBuilder;
import mods.tinker.tconstruct.library.crafting.Smeltery;
import mods.tinker.tconstruct.library.crafting.ToolBuilder;
import mods.tinker.tconstruct.library.event.ToolCraftEvent;
import mods.tinker.tconstruct.library.tools.ToolCore;
import mods.tinker.tconstruct.modifiers.ModAttack;
import mods.tinker.tconstruct.util.player.TPlayerStats;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.boss.EntityWither;
@ -28,14 +29,11 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.world.World;
import net.minecraftforge.event.Event.Result;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
import net.minecraftforge.event.entity.player.FillBucketEvent;
import net.minecraftforge.liquids.LiquidStack;
@ -210,28 +208,6 @@ public class TEventHandler
}
}
}
if (event.entityLiving instanceof EntityPlayer)
{
EntityPlayer enemy = (EntityPlayer) event.entityLiving;
if (event.source.damageType.equals("player"))
{
EntityPlayer player = (EntityPlayer) event.source.getEntity();
ItemStack stack = player.getCurrentEquippedItem();
if (stack != null && stack.hasTagCompound() && stack.getItem() instanceof ToolCore)
{
int beheading = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("Beheading");
if (beheading > 0 && random.nextInt(100) < beheading * 50)
{
ItemStack dropStack = new ItemStack(Item.skull.itemID, 1, 3);
NBTTagCompound nametag = new NBTTagCompound();
nametag.setString("SkullOwner", enemy.username);
addDrops(event, dropStack);
}
}
}
}
}
else if (event.entityLiving.getClass() == EntityGhast.class)
@ -239,6 +215,35 @@ public class TEventHandler
addDrops(event, new ItemStack(Item.ghastTear, 1));
}
}
if (event.entityLiving instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) event.entityLiving;
if (event.source.damageType.equals("player"))
{
EntityPlayer source = (EntityPlayer) event.source.getEntity();
ItemStack stack = source.getCurrentEquippedItem();
if (stack != null && stack.hasTagCompound() && stack.getItem() instanceof ToolCore)
{
int beheading = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("Beheading");
if (beheading > 0 && random.nextInt(100) < beheading * 50)
{
ItemStack dropStack = new ItemStack(Item.skull.itemID, 1, 3);
NBTTagCompound nametag = new NBTTagCompound();
nametag.setString("SkullOwner", player.username);
addDrops(event, dropStack);
}
}
}
if (!player.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory"))
{
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username);
stats.armor.dropItems();
stats.knapsack.dropItems();
}
}
}
void addDrops (LivingDropsEvent event, ItemStack dropStack)

View File

@ -221,4 +221,17 @@ public class ArmorExtended implements IInventory
}
}
}
public void dropItems ()
{
EntityPlayer player = parent.get();
for (int i = 0; i < 4; ++i)
{
if (this.inventory[i] != null)
{
player.dropPlayerItemWithRandomChoice(this.inventory[i], true);
this.inventory[i] = null;
}
}
}
}

View File

@ -152,4 +152,17 @@ public class KnapsackInventory implements IInventory
}
}
}
public void dropItems ()
{
EntityPlayer player = parent.get();
for (int i = 0; i < inventory.length; ++i)
{
if (this.inventory[i] != null)
{
player.dropPlayerItemWithRandomChoice(this.inventory[i], true);
this.inventory[i] = null;
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B