Quartz Modifier

This commit is contained in:
mDiyo 2013-04-10 04:09:19 -07:00
parent 41a0e80078
commit a4d318f059
62 changed files with 2593 additions and 1400 deletions

View File

@ -24,96 +24,96 @@ public class RenderDisplay implements ISimpleBlockRenderingHandler
}
public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer)
{
if (modelID == displayModel)
{
if (metadata == 5)
{
renderer.setRenderBounds(0.0F, 0.0, 0.0F, 1.0F, 0.875F, 1.0F);
renderDo(renderer, block, metadata);
}
else
{
renderer.setRenderBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F);
renderDo(renderer, block, metadata);
renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.25F, 0.75F, 0.25F);
renderDo(renderer, block, metadata);
renderer.setRenderBounds(0.75F, 0.0F, 0.0F, 1.0F, 0.75F, 0.25F);
renderDo(renderer, block, metadata);
renderer.setRenderBounds(0.0F, 0.0F, 0.75F, 0.25F, 0.75F, 1.0F);
renderDo(renderer, block, metadata);
renderer.setRenderBounds(0.75F, 0.0F, 0.75F, 1.0F, 0.75F, 1.0F);
renderDo(renderer, block, metadata);
}
}
}
{
if (modelID == displayModel)
{
if (metadata == 5)
{
renderer.setRenderBounds(0.0F, 0.0, 0.0F, 1.0F, 0.875F, 1.0F);
renderDo(renderer, block, metadata);
}
else
{
renderer.setRenderBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F);
renderDo(renderer, block, metadata);
renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.25F, 0.75F, 0.25F);
renderDo(renderer, block, metadata);
renderer.setRenderBounds(0.75F, 0.0F, 0.0F, 1.0F, 0.75F, 0.25F);
renderDo(renderer, block, metadata);
renderer.setRenderBounds(0.0F, 0.0F, 0.75F, 0.25F, 0.75F, 1.0F);
renderDo(renderer, block, metadata);
renderer.setRenderBounds(0.75F, 0.0F, 0.75F, 1.0F, 0.75F, 1.0F);
renderDo(renderer, block, metadata);
}
}
}
@Override
public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer)
{
if (modelID == displayModel)
{
int metadata = world.getBlockMetadata(x, y, z);
TileEntity te = world.getBlockTileEntity(x, y, z);
ItemStack topStack = ((DisplayLogic)te).getFrontDisplay();
Block topSkin = Block.blocksList[topStack.itemID];
int topMeta = topStack.getItemDamage();
ItemStack bottomStack = ((DisplayLogic)te).getBackDisplay();
Block bottomSkin = Block.blocksList[bottomStack.itemID];
int bottomMeta = bottomStack.getItemDamage();
renderer.setRenderBounds(0.125, 0.125F, 0.0F, 0.375, 0.875F, 0.0625);
BlockSkinRenderHelper.renderMetadataBlock(bottomSkin, bottomMeta, x, y, z, renderer, world);
renderer.setRenderBounds(0.6125, 0.125F, 0.0F, 0.875, 0.875F, 0.0625);
BlockSkinRenderHelper.renderMetadataBlock(bottomSkin, bottomMeta, x, y, z, renderer, world);
renderer.setRenderBounds(0.0F, 0.5F, 0.0F, 1.0F, 0.625F, 0.09375);
BlockSkinRenderHelper.renderMetadataBlock(topSkin, topMeta, x, y, z, renderer, world);
renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 0.125);
BlockSkinRenderHelper.renderMetadataBlock(topSkin, topMeta, x, y, z, renderer, world);
}
return false;
}
@Override
public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer)
{
if (modelID == displayModel)
{
int metadata = world.getBlockMetadata(x, y, z);
TileEntity te = world.getBlockTileEntity(x, y, z);
ItemStack topStack = ((DisplayLogic) te).getFrontDisplay();
Block topSkin = Block.blocksList[topStack.itemID];
int topMeta = topStack.getItemDamage();
ItemStack bottomStack = ((DisplayLogic) te).getBackDisplay();
Block bottomSkin = Block.blocksList[bottomStack.itemID];
int bottomMeta = bottomStack.getItemDamage();
@Override
public boolean shouldRender3DInInventory ()
{
return true;
}
renderer.setRenderBounds(0.125, 0.125F, 0.0F, 0.375, 0.875F, 0.0625);
BlockSkinRenderHelper.renderMetadataBlock(bottomSkin, bottomMeta, x, y, z, renderer, world);
renderer.setRenderBounds(0.6125, 0.125F, 0.0F, 0.875, 0.875F, 0.0625);
BlockSkinRenderHelper.renderMetadataBlock(bottomSkin, bottomMeta, x, y, z, renderer, world);
renderer.setRenderBounds(0.0F, 0.5F, 0.0F, 1.0F, 0.625F, 0.09375);
BlockSkinRenderHelper.renderMetadataBlock(topSkin, topMeta, x, y, z, renderer, world);
renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 0.125);
BlockSkinRenderHelper.renderMetadataBlock(topSkin, topMeta, x, y, z, renderer, world);
}
return false;
}
@Override
public int getRenderId ()
{
return displayModel;
}
@Override
public boolean shouldRender3DInInventory ()
{
return true;
}
private void renderDo(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.renderBottomFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(0, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderblocks.renderTopFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(1, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1F);
renderblocks.renderEastFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(2, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderblocks.renderWestFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(3, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1F, 0.0F, 0.0F);
renderblocks.renderNorthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(4, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderblocks.renderSouthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(5, meta));
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
@Override
public int getRenderId ()
{
return displayModel;
}
private void renderDo (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.renderBottomFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(0, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderblocks.renderTopFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(1, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1F);
renderblocks.renderEastFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(2, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderblocks.renderWestFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(3, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1F, 0.0F, 0.0F);
renderblocks.renderNorthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(4, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderblocks.renderSouthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(5, meta));
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
}

View File

@ -7,24 +7,24 @@ import net.minecraft.item.ItemStack;
public abstract class DisplayLogic extends InventoryLogic
{
public DisplayLogic(int invSize)
{
super(invSize + 2); //Skin blocks
}
public DisplayLogic(int invSize)
{
super(invSize + 2); //Skin blocks
}
public ItemStack getFrontDisplay()
{
if (inventory[0] == null || !(inventory[0].getItem() instanceof ItemBlock))
return new ItemStack(Block.planks, 1, 1);
else
return inventory[0];
}
public ItemStack getFrontDisplay ()
{
if (inventory[0] == null || !(inventory[0].getItem() instanceof ItemBlock))
return new ItemStack(Block.planks, 1, 1);
else
return inventory[0];
}
public ItemStack getBackDisplay()
{
if (inventory[1] == null || !(inventory[1].getItem() instanceof ItemBlock))
return new ItemStack(Block.cloth, 1, 3);
else
return inventory[1];
}
public ItemStack getBackDisplay ()
{
if (inventory[1] == null || !(inventory[1].getItem() instanceof ItemBlock))
return new ItemStack(Block.cloth, 1, 3);
else
return inventory[1];
}
}

View File

@ -91,22 +91,31 @@ public abstract class ToolMod
public void addMatchingEffect (ItemStack tool)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
if (tags.hasKey("Effect3") || tags.hasKey(key))
if (tags.hasKey("Effect6") || tags.hasKey(key))
return;
else if (tags.hasKey("Effect5"))
{
tags.setInteger("Effect6", effectIndex);
}
else if (tags.hasKey("Effect4"))
{
tags.setInteger("Effect5", effectIndex);
}
else if (tags.hasKey("Effect3"))
{
tags.setInteger("Effect4", effectIndex);
}
else if (tags.hasKey("Effect2"))
{
//System.out.println("Adding Effect 3");
tags.setInteger("Effect3", effectIndex);
}
else if (tags.hasKey("Effect1"))
{
//System.out.println("Adding Effect 2");
tags.setInteger("Effect2", effectIndex);
}
else
{
//System.out.println("Adding Effect 1");
tags.setInteger("Effect1", effectIndex);
}
}

View File

@ -51,7 +51,7 @@
<entry key="item.tconstruct.blankpattern.pattern.name">Blank Pattern</entry>
<entry key="item.tconstruct.blankpattern.cast.name">Blank Cast</entry>
<entry key="item.tconstruct.manual.diary.name">Tinker's Log</entry>
<entry key="item.tconstruct.manual.beginner.name">Materials and You</entry>
<entry key="item.tconstruct.manual.toolstation.name">Materials and You</entry>
<entry key="item.tconstruct.manual.smeltery.name">Mighty Smelting</entry>
@ -80,5 +80,7 @@
<entry key="entity.TConstruct.EdibleSlime.name">Blue Slime</entry>
<entry key="entity.TConstruct.UnstableCreeper.name">Nitro Creeper</entry>
<entry key="entity.TConstruct.EdibleSlime">Blue Slime</entry>
<entry key="entity.TConstruct.UnstableCreeper">Nitro Creeper</entry>
</properties>

View File

@ -0,0 +1,161 @@
<?xml version="1.0"?>
<book>
<page type="intro">
<text>Materials and You
Surviving the first day and beyond
Volume 1
By Skyla</text>
</page>
<page type="contents">
<text>Table of Contents</text>
<link>
<text>Getting Started</text>
<icon>sapling</icon>
<jump>3</jump>
</link>
<link>
<text>Recipes</text>
<icon>workbench</icon>
<jump>5</jump>
</link>
</page>
<page type="text">
<text>Welcome to the first edition of Materials and You: Surviving the first day and beyond. Within these pages you will find the first steps to making the tools and materials you need to survive.
This book is a magic copy; it updates whenever the original has been modified. Check back occasionally for information on new things.</text>
</page>
<page type="text">
<text>The first step in making tools is crafting a blank pattern. It is a blank slate to stamp a shape into, providing a reference for future creations. The patterns are shaped on the Stencil Table or are used as tabletops.
You can then shape a material in a part builder with the pattern, then combine parts in the tool station. Patterns can be stored and accessed in the pattern chest.
Together these make the Tool Workshop. It is recommended you keep all of these nearby when using any of them.</text>
</page>
<page type="crafting">
<text>Blank Pattern</text>
<recipe>
<name>blankpattern</name>
<size>two</size>
</recipe>
</page>
<page type="crafting">
<text>Stencil Table</text>
<recipe>
<name>stenciltable</name>
<size>two</size>
</recipe>
</page>
<page type="crafting">
<text>Part Crafter</text>
<recipe>
<name>partcrafter</name>
<size>two</size>
</recipe>
</page>
<page type="crafting">
<text>Pattern Chest</text>
<recipe>
<name>patternchest</name>
<size>two</size>
</recipe>
</page>
<page type="crafting">
<text>Tool Station</text>
<recipe>
<name>toolstation</name>
<size>two</size>
</recipe>
</page>
<page type="text">
<text>Once you're well established, you can begin to process metals in a more efficient manner. The scope of the smeltery is beyond this volume, but a few recipes will help you get started.</text>
</page>
<page type="crafting">
<text>Grout</text>
<recipe>
<name>grout</name>
<size>two</size>
</recipe>
</page>
<page type="smelting">
<text>Seared Brick</text>
<recipe>searedbrick</recipe>
</page>
<page type="crafting">
<text>Seared Bricks</text>
<recipe>
<name>searedbricks</name>
<size>two</size>
</recipe>
</page>
<page type="crafting">
<text>Smeltery Controller</text>
<recipe>
<name>smelterycontroller</name>
<size>three</size>
</recipe>
</page>
<page type="crafting">
<text>Smeltery Drain</text>
<recipe>
<name>smelterydrain</name>
<size>three</size>
</recipe>
</page>
<page type="crafting">
<text>Lava Tank</text>
<recipe>
<name>smelterytank1</name>
<size>three</size>
</recipe>
</page>
<page type="crafting">
<text>Seared Glass</text>
<recipe>
<name>smelterytank2</name>
<size>three</size>
</recipe>
</page>
<page type="crafting">
<text>Seared Window</text>
<recipe>
<name>smelterytank3</name>
<size>three</size>
</recipe>
</page>
<page type="crafting">
<text>Casting Table</text>
<recipe>
<name>smelterytable</name>
<size>three</size>
</recipe>
</page>
<page type="crafting">
<text>Seared Faucet</text>
<recipe>
<name>smelteryfaucet</name>
<size>three</size>
</recipe>
</page>
</book>

View File

@ -5,50 +5,208 @@
<text>Materials and You
A Guide to Tools and Abilities
Volume 1
Volume 2
By Skyla</text>
</page>
<page type="text">
<text>Table of Contents
This book is -not- anywhere near finished. Please don't read me yet.</text>
<page type="contents">
<text>Table of Contents</text>
<link>
<text>Tools</text>
<icon>ironpick</icon>
<jump>2</jump>
</link>
<link>
<text>Materials</text>
<icon>woodplanks</icon>
<jump>4</jump>
</link>
<link>
<text>Modifiers</text>
<icon>lavacrystal</icon>
<jump>4</jump>
</link>
</page>
<page type="text">
<text>Welcome to the first edition of Materials and You: A Guide to Tools and Abilities. Within you will find details on each tool and anything you can make them from. You will also find the key to becoming a great Tool Tinker: changing tools after they're created. Many of the best known tools have changed so much since their inception that they may as well be somethign else.</text>
<text>Welcome to the second edition of Materials and You: A Guide to Tools and Abilities. Within these pages you will details on every known tool, modifier, and material. A detailed breakdown of each
This book is a magic copy; it updates whenever the original has been modified. Check back occasionally for information on new things.</text>
</page>
<page type="text">
<text>Worktables
In general:
- Tools are made from parts
- Parts are created from materials using a pattern
We will create three separate areas for the creation of tools. The first will be for shaping patterns, the second for crafting parts out of materials, and the last will be the main station for finished products.</text>
<page type="materialstats">
<title>Wood</title>
<icon>woodaxe</icon>
<text>It seems to grow everywhere.</text>
<material>
<main>woodplanks</main>
</material>
</page>
<page type="text">
<text>Blank patterns are where the
</text>
<page type="materialstats">
<title>Stone</title>
<icon>stonepick</icon>
<text>One of the most common materials in the world.</text>
<material>
<main>stoneblock</main>
<shard>stoneshard</shard>
<rod>stonerod</rod>
</material>
</page>
<page type="craftingrecipe">
<title>Blank Wood Pattern</title>
<recipe>woodpattern</recipe>
<page type="materialstats">
<title>Iron</title>
<icon>ironpick</icon>
<text>A staple for tools, it can be refined and processed.</text>
<material>
<main>ironingot</main>
</material>
</page>
<page type="text">
<text>The Stencil Table is where you shape blank patterns into something useful. This is done by punching a hole in precisely the shape you want the end result to look like. Materials can be place in the hole and combined until they resemble the end product.
</text>
<page type="materialstats">
<title>Flint</title>
<icon>flintshovel</icon>
<text>More durable than stone. The material of choice for cavemen.</text>
<material>
<main>flint</main>
</material>
</page>
<page type="craftingrecipe">
<title>Stencil Table</title>
<recipe>stenciltable</recipe>
<page type="materialstats">
<title>Cactus</title>
<icon>cactussword</icon>
<text>A form of wood found only in the desert.</text>
<material>
<main>cactus</main>
</material>
</page>
<page type="text">
<text></text>
<page type="materialstats">
<title>Bone</title>
<icon>bonerapier</icon>
<text>A material with many uses dead or alive.</text>
<material>
<main>bone</main>
</material>
</page>
<page type="materialstats">
<title>Obsidian</title>
<icon>bonefrypan</icon>
<text>Tough as nails, but fragile when shaped.</text>
<material>
<main>obsidian</main>
</material>
</page>
<page type="materialstats">
<title>Alumite</title>
<icon>alumitepick</icon>
<text>An uncommon alloy. It seems to be quite durable.</text>
<material>
<main>alumiteingot</main>
</material>
</page>
<page type="materialstats">
<title>Netherrack</title>
<icon>netherrackmattock</icon>
<text>This is made of what?!</text>
<material>
<main>netherrack</main>
</material>
</page>
<page type="materialstats">
<title>Blue Slime</title>
<icon>blueslimebattlesign</icon>
<text>Converting it from food has made it stronger.</text>
<toolmaterial>BlueSlime</toolmaterial>
<material>
<main>blueslimecrystal</main>
</material>
</page>
<page type="materialstats">
<title>Green Slime</title>
<icon>slimebattlesign</icon>
<text>Soft and springy, it seems to last forever.</text>
<toolmaterial>Slime</toolmaterial>
<material>
<main>slimecrystal</main>
</material>
</page>
<page type="materialstats">
<title>Paper</title>
<icon>paperpick</icon>
<text>It's very weak, but can take a lot of modification.</text>
<material>
<main>paperstack</main>
</material>
</page>
<page type="materialstats">
<title>Paper</title>
<icon>paperpick</icon>
<text>It's very weak, but can take a lot of modification.</text>
<material>
<main>paperstack</main>
</material>
</page>
<page type="materialstats">
<title>Cobalt</title>
<icon>cobaltlongsword</icon>
<text>One of the nether materials. It's bright blue.</text>
<material>
<main>cobaltingot</main>
</material>
</page>
<page type="materialstats">
<title>Ardite</title>
<icon>arditelongsword</icon>
<text>One of the nether materials. It's rustic red.</text>
<material>
<main>arditeingot</main>
</material>
</page>
<page type="materialstats">
<title>Manyullyn</title>
<icon>manyullynlongsword</icon>
<text>The nether alloy. It's stronger than diamond.</text>
<material>
<main>manyullyningot</main>
</material>
</page>
<page type="materialstats">
<title>Copper</title>
<icon>copperaxe</icon>
<text>A common metal found in the ground.</text>
<material>
<main>copperingot</main>
</material>
</page>
<page type="materialstats">
<title>Bronze</title>
<icon>bronzeaxe</icon>
<text>A common alloy. It's a bit better than iron.</text>
<material>
<main>bronzeingot</main>
</material>
</page>
<page type="materialstats">
<title>Steel</title>
<icon>steelsword</icon>
<text>An Iron alloy. The method for obtaining this is unknown.</text>
<material>
<main>steelingot</main>
</material>
</page>
</book>

View File

@ -127,7 +127,80 @@ Other liquid removal objects will work, but are frowned upon. An example picture
</item>
</page>
<page type="text">
<text>To be continued...</text>
<page type="crafting">
<text>Grout</text>
<recipe>
<name>grout</name>
<size>two</size>
</recipe>
</page>
<page type="smelting">
<text>Seared Brick</text>
<recipe>searedbrick</recipe>
</page>
<page type="crafting">
<text>Seared Bricks</text>
<recipe>
<name>searedbricks</name>
<size>two</size>
</recipe>
</page>
<page type="crafting">
<text>Smeltery Controller</text>
<recipe>
<name>smelterycontroller</name>
<size>three</size>
</recipe>
</page>
<page type="crafting">
<text>Smeltery Drain</text>
<recipe>
<name>smelterydrain</name>
<size>three</size>
</recipe>
</page>
<page type="crafting">
<text>Lava Tank</text>
<recipe>
<name>smelterytank1</name>
<size>three</size>
</recipe>
</page>
<page type="crafting">
<text>Seared Glass</text>
<recipe>
<name>smelterytank2</name>
<size>three</size>
</recipe>
</page>
<page type="crafting">
<text>Seared Window</text>
<recipe>
<name>smelterytank3</name>
<size>three</size>
</recipe>
</page>
<page type="crafting">
<text>Casting Table</text>
<recipe>
<name>smelterytable</name>
<size>three</size>
</recipe>
</page>
<page type="crafting">
<text>Seared Faucet</text>
<recipe>
<name>smelteryfaucet</name>
<size>three</size>
</recipe>
</page>
</book>

View File

@ -56,7 +56,7 @@ public class PHConstruct {
redCreeper = config.get("Mob Spawning", "Activate Nitro Creeper Spawns", true).getBoolean(true);
blueSlime = config.get("Mob Spawning", "Activate Blue Slime Spawns", true).getBoolean(true);
redCreeperWeight = config.get("Mob Spawning", "Spawn Weight for Nitro Creeper", 5).getInt(5);
redCreeperWeight = config.get("Mob Spawning", "Spawn Weight for Nitro Creeper", 6).getInt(6);
blueSlimeWeight = config.get("Mob Spawning", "Spawn Weight for Blue Slime", 8).getInt(8);
woodCrafter = config.getBlock("Wood Tool Station", 1471).getInt(1471);
@ -75,6 +75,8 @@ public class PHConstruct {
golemHead = config.getBlock("Golem Head", 1482).getInt(1482);
golemPedestal = config.getBlock("Golem Pedestal", 1483).getInt(1483);
stoneTorch = config.getBlock("Stone Torch", 1484).getInt(1484);
manual = config.getItem("Patterns and Misc", "Tinker's Manual", 14018).getInt(14018);
blankPattern = config.getItem("Patterns and Misc", "Blank Patterns", 14019).getInt(14019);
materials = config.getItem("Patterns and Misc", "Materials", 14020).getInt(14020);
@ -147,7 +149,7 @@ public class PHConstruct {
tinDensity = config.get("Worldgen", "Tin Density", 8).getInt(8);
tinHeight = config.get("Worldgen", "Tin Height", 0).getInt(0);
tinRange = config.get("Worldgen", "Tin Range", 40).getInt(40);
aluminumDensity = config.get("Worldgen", "Aluminum Density", 9).getInt(9);
aluminumDensity = config.get("Worldgen", "Aluminum Density", 5).getInt(5);
aluminumHeight = config.get("Worldgen", "Aluminum Height", 0).getInt(0);
aluminumRange = config.get("Worldgen", "Aluminum Range", 64).getInt(64);
netherDensity = config.get("Worldgen", "Nether Ores Density", 8).getInt(8);
@ -179,6 +181,9 @@ public class PHConstruct {
public static int metalFlowing;
public static int metalStill;
//Decoration
public static int stoneTorch;
//Patterns and misc
public static int blankPattern;
public static int materials;

View File

@ -25,7 +25,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
* @author: mDiyo
*/
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.2.17")
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.2.23")
@NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.TPacketHandler.class)
public class TConstruct
{

File diff suppressed because it is too large Load Diff

View File

@ -10,21 +10,32 @@ import cpw.mods.fml.common.ICraftingHandler;
public class TCraftingHandler implements ICraftingHandler
{
@Override
public void onCrafting (EntityPlayer player, ItemStack item, IInventory craftMatrix)
{
if (item.getItem().itemID == TContent.smeltery.blockID)
{
NBTTagCompound tags = player.getEntityData().getCompoundTag("TConstruct");
if (!tags.getBoolean("smelteryManual"))
{
tags.setBoolean("smelteryManual", true);
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TContent.manualBook, 1, 2));
}
}
}
@Override
public void onCrafting (EntityPlayer player, ItemStack item, IInventory craftMatrix)
{
if (item.getItem().itemID == TContent.toolStationWood.blockID)
{
NBTTagCompound tags = player.getEntityData().getCompoundTag("TConstruct");
if (!tags.getBoolean("materialManual"))
{
tags.setBoolean("materialManual", true);
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TContent.manualBook, 1, 1));
}
}
if (item.getItem().itemID == TContent.smeltery.blockID)
{
NBTTagCompound tags = player.getEntityData().getCompoundTag("TConstruct");
if (!tags.getBoolean("smelteryManual"))
{
tags.setBoolean("smelteryManual", true);
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TContent.manualBook, 1, 2));
}
}
}
@Override
public void onSmelting (EntityPlayer player, ItemStack item) {}
@Override
public void onSmelting (EntityPlayer player, ItemStack item)
{
}
}

View File

@ -40,11 +40,11 @@ public class EquipBlock extends InventoryBlock
return Block.blockSteel.getBlockTextureFromSideAndMetadata(side, meta);
}
/*@SideOnly(Side.CLIENT)
@SideOnly(Side.CLIENT)
public void registerIcons (IconRegister par1IconRegister)
{
this.blockIcon = par1iconRegister.registerIcon(Block.blockSteel.getUnlocalizedName());
}*/
//this.blockIcon = par1iconRegister.registerIcon(Block.blockSteel.getUnlocalizedName());
}
@Override
public boolean renderAsNormalBlock ()

View File

@ -8,6 +8,7 @@ import mods.tinker.tconstruct.client.SearedRender;
import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.logic.CastingTableLogic;
import mods.tinker.tconstruct.logic.FaucetLogic;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.item.EntityItem;
@ -282,4 +283,19 @@ public class SearedBlock extends InventoryBlock
return super.getCollisionBoundingBoxFromPool(world, x, y, z);
}
/* Redstone */
public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side)
{
return world.getBlockMetadata(x, y, z) == 1;
}
public void onNeighborBlockChange(World world, int x, int y, int z, int neighborBlockID)
{
if (world.isBlockIndirectlyGettingPowered(x, y, z) && world.getBlockMetadata(x, y, z) == 1)
{
FaucetLogic logic = (FaucetLogic) world.getBlockTileEntity(x, y, z);
logic.setActive(true);
}
}
}

View File

@ -0,0 +1,287 @@
package mods.tinker.tconstruct.blocks;
import static net.minecraftforge.common.ForgeDirection.EAST;
import static net.minecraftforge.common.ForgeDirection.NORTH;
import static net.minecraftforge.common.ForgeDirection.SOUTH;
import static net.minecraftforge.common.ForgeDirection.WEST;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class StoneTorch extends Block
{
public StoneTorch(int id)
{
super(id, Material.circuits);
this.setCreativeTab(CreativeTabs.tabDecorations);
setLightValue(0.9375F);
}
/**
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
* cleared to be reused)
*/
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
return null;
}
/**
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
*/
public boolean isOpaqueCube()
{
return false;
}
/**
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
*/
public boolean renderAsNormalBlock()
{
return false;
}
/**
* The type of render function that is called for this block
*/
public int getRenderType()
{
return 2;
}
/**
* Gets if we can place a torch on a block.
*/
private boolean canPlaceTorchOn(World par1World, int par2, int par3, int par4)
{
if (par1World.doesBlockHaveSolidTopSurface(par2, par3, par4))
{
return true;
}
else
{
int l = par1World.getBlockId(par2, par3, par4);
return (Block.blocksList[l] != null && Block.blocksList[l].canPlaceTorchOnTop(par1World, par2, par3, par4));
}
}
/**
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
*/
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
return par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true) ||
par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true) ||
par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true) ||
par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true) ||
canPlaceTorchOn(par1World, par2, par3 - 1, par4);
}
/**
* Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata
*/
public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9)
{
int j1 = par9;
if (par5 == 1 && this.canPlaceTorchOn(par1World, par2, par3 - 1, par4))
{
j1 = 5;
}
if (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true))
{
j1 = 4;
}
if (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true))
{
j1 = 3;
}
if (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true))
{
j1 = 2;
}
if (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true))
{
j1 = 1;
}
return j1;
}
@SideOnly(Side.CLIENT)
public void registerIcons (IconRegister par1IconRegister)
{
this.blockIcon = par1IconRegister.registerIcon("tinker:torch_stone");
}
/**
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
* their own) Args: x, y, z, neighbor blockID
*/
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
this.func_94397_d(par1World, par2, par3, par4, par5);
}
protected boolean func_94397_d(World par1World, int par2, int par3, int par4, int par5)
{
if (this.dropTorchIfCantStay(par1World, par2, par3, par4))
{
int i1 = par1World.getBlockMetadata(par2, par3, par4);
boolean flag = false;
if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true) && i1 == 1)
{
flag = true;
}
if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true) && i1 == 2)
{
flag = true;
}
if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true) && i1 == 3)
{
flag = true;
}
if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true) && i1 == 4)
{
flag = true;
}
if (!this.canPlaceTorchOn(par1World, par2, par3 - 1, par4) && i1 == 5)
{
flag = true;
}
if (flag)
{
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
par1World.setBlockToAir(par2, par3, par4);
return true;
}
else
{
return false;
}
}
else
{
return true;
}
}
/**
* Tests if the block can remain at its current location and will drop as an item if it is unable to stay. Returns
* True if it can stay and False if it drops. Args: world, x, y, z
*/
protected boolean dropTorchIfCantStay(World par1World, int par2, int par3, int par4)
{
if (!this.canPlaceBlockAt(par1World, par2, par3, par4))
{
if (par1World.getBlockId(par2, par3, par4) == this.blockID)
{
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
par1World.setBlockToAir(par2, par3, par4);
}
return false;
}
else
{
return true;
}
}
/**
* Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world,
* x, y, z, startVec, endVec
*/
public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3)
{
int l = par1World.getBlockMetadata(par2, par3, par4) & 7;
float f = 0.15F;
if (l == 1)
{
this.setBlockBounds(0.0F, 0.2F, 0.5F - f, f * 2.0F, 0.8F, 0.5F + f);
}
else if (l == 2)
{
this.setBlockBounds(1.0F - f * 2.0F, 0.2F, 0.5F - f, 1.0F, 0.8F, 0.5F + f);
}
else if (l == 3)
{
this.setBlockBounds(0.5F - f, 0.2F, 0.0F, 0.5F + f, 0.8F, f * 2.0F);
}
else if (l == 4)
{
this.setBlockBounds(0.5F - f, 0.2F, 1.0F - f * 2.0F, 0.5F + f, 0.8F, 1.0F);
}
else
{
f = 0.1F;
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.6F, 0.5F + f);
}
return super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3, par6Vec3);
}
@SideOnly(Side.CLIENT)
/**
* A randomly called display update to be able to add particles or other items for display
*/
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
int meta = par1World.getBlockMetadata(par2, par3, par4);
double d0 = (double)((float)par2 + 0.5F);
double d1 = (double)((float)par3 + 0.7F);
double d2 = (double)((float)par4 + 0.5F);
double d3 = 0.2199999988079071D;
double d4 = 0.27000001072883606D;
if (meta == 1)
{
par1World.spawnParticle("smoke", d0 - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", d0 - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
}
else if (meta == 2)
{
par1World.spawnParticle("smoke", d0 + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", d0 + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
}
else if (meta == 3)
{
par1World.spawnParticle("smoke", d0, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", d0, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D);
}
else if (meta == 4)
{
par1World.spawnParticle("smoke", d0, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", d0, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D);
}
else
{
par1World.spawnParticle("smoke", d0, d1, d2, 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", d0, d1, d2, 0.0D, 0.0D, 0.0D);
}
}
}

View File

@ -30,7 +30,7 @@ public class FrypanRender implements ISimpleBlockRenderingHandler
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(1F, 0.0F, 0.4375F, 2F, 0.125F, 0.5625F);
renderer.renderStandardBlock(block, x, y, z);
return false;
return true;
}
@Override

View File

@ -222,7 +222,7 @@ public class SearedRender implements ISimpleBlockRenderingHandler
renderer.renderStandardBlock(block, x, y, z);
}
}
return false;
return true;
}
@Override

View File

@ -122,7 +122,7 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler
}
}
}
return false;
return true;
}
void renderLayer(SmelteryLogic logic, int start, int posX, int posY, int posZ, RenderBlocks renderer, IBlockAccess world)

View File

@ -198,10 +198,10 @@ public class TProxyClient extends TProxyCommon
"Slime Crystal Fragment", "Paper", "Cobalt Chunk", "Ardite Chunk", "Manyullyn Chunk", "Copper Chunk", "Bronze Chunk", "Alumite Chunk", "Steel Chunk", "Slime Crystal Fragment" };
public static final String[] materialItemInternalNames = new String[] { "PaperStack", "SlimeCrystal", "SearedBrick", "CobaltIngot", "ArditeIngot", "ManyullynIngot", "Mossball", "LavaCrystal",
"NecroticBone", "CopperIngot", "TinIngot", "AluminumIngot", "RawAluminum", "BronzeIngot", "AlBrassIngot", "AlumiteIngot", "SteelIngot", "BlueSlimeCrystal" };
"NecroticBone", "CopperIngot", "TinIngot", "AluminumIngot", "RawAluminum", "BronzeIngot", "AlBrassIngot", "AlumiteIngot", "SteelIngot", "BlueSlimeCrystal", "ObsidianIngot" };
public static final String[] materialItemNames = new String[] { "Paper Stack", "Slime Crystal", "Seared Brick", "Cobalt Ingot", "Ardite Ingot", "Manyullyn Ingot", "Ball of Moss", "Lava Crystal",
"Necrotic Bone", "Copper Ingot", "Tin Ingot", "Aluminum Ingot", "Raw Aluminum", "Bronze Ingot", "Aluminum Brass Ingot", "Alumite Ingot", "Steel Ingot", "Slime Crystal" };
"Necrotic Bone", "Copper Ingot", "Tin Ingot", "Aluminum Ingot", "Raw Aluminum", "Bronze Ingot", "Aluminum Brass Ingot", "Alumite Ingot", "Steel Ingot", "Slime Crystal", "Obsidian Ingot" };
public static final String[] toolMaterialNames = new String[] { "Wood", "Stone", "Iron", "Flint", "Cactus", "Bone", "Obsidian", "Netherrack", "Slime", "Paper", "Cobalt", "Ardite", "Manyullyn",
"Copper", "Bronze", "Alumite", "Steel", "Blue Slime" };
@ -219,15 +219,18 @@ public class TProxyClient extends TProxyCommon
public static Document diary;
public static Document volume1;
public static Document volume2;
public static Document smelter;
public void readManuals ()
{
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
diary = readManual("/mods/tinker/resources/manuals/diary.xml", dbFactory);
volume1 = readManual("/mods/tinker/resources/manuals/materials.xml", dbFactory);
volume1 = readManual("/mods/tinker/resources/manuals/firstday.xml", dbFactory);
volume2 = readManual("/mods/tinker/resources/manuals/materials.xml", dbFactory);
smelter = readManual("/mods/tinker/resources/manuals/smeltery.xml", dbFactory);
initManualIcons();
initManualRecipes();
}
Document readManual (String location, DocumentBuilderFactory dbFactory)
@ -262,6 +265,72 @@ public class TProxyClient extends TProxyCommon
TConstructClientRegistry.registerManualIcon("alubrassingot", new ItemStack(TContent.materials, 1, 14));
TConstructClientRegistry.registerManualIcon("manyullyningot", new ItemStack(TContent.materials, 1, 5));
TConstructClientRegistry.registerManualIcon("alumiteingot", new ItemStack(TContent.materials, 1, 15));
TConstructClientRegistry.registerManualIcon("blankpattern", new ItemStack(TContent.blankPattern, 1, 0));
TConstructClientRegistry.registerManualIcon("toolstation", new ItemStack(TContent.toolStationWood, 1, 0));
TConstructClientRegistry.registerManualIcon("partcrafter", new ItemStack(TContent.toolStationWood, 1, 1));
TConstructClientRegistry.registerManualIcon("patternchest", new ItemStack(TContent.toolStationWood, 1, 5));
TConstructClientRegistry.registerManualIcon("stenciltable", new ItemStack(TContent.toolStationWood, 1, 10));
TConstructClientRegistry.registerManualIcon("torch", new ItemStack(Block.torchWood));
TConstructClientRegistry.registerManualIcon("sapling", new ItemStack(Block.sapling));
TConstructClientRegistry.registerManualIcon("workbench", new ItemStack(Block.workbench));
TConstructClientRegistry.registerManualIcon("coal", new ItemStack(Item.coal));
TConstructClientRegistry.registerManualIcon("obsidianingot", new ItemStack(TContent.materials, 1, 18));
TConstructClientRegistry.registerManualIcon("lavacrystal", new ItemStack(TContent.materials, 1, 7));
TConstructClientRegistry.registerManualIcon("woodplanks", new ItemStack(Block.planks));
TConstructClientRegistry.registerManualIcon("stoneblock", new ItemStack(Block.stone));
TConstructClientRegistry.registerManualIcon("ironingot", new ItemStack(Item.ingotIron));
TConstructClientRegistry.registerManualIcon("flint", new ItemStack(Item.flint));
TConstructClientRegistry.registerManualIcon("cactus", new ItemStack(Block.cactus));
TConstructClientRegistry.registerManualIcon("bone", new ItemStack(Item.bone));
TConstructClientRegistry.registerManualIcon("obsidian", new ItemStack(Block.obsidian));
TConstructClientRegistry.registerManualIcon("netherrack", new ItemStack(Block.netherrack));
TConstructClientRegistry.registerManualIcon("blueslimecrystal", new ItemStack(TContent.materials, 1, 17));
TConstructClientRegistry.registerManualIcon("slimecrystal", new ItemStack(TContent.materials, 1, 1));
TConstructClientRegistry.registerManualIcon("paperstack", new ItemStack(TContent.materials, 1, 0));
TConstructClientRegistry.registerManualIcon("cobaltingot", new ItemStack(TContent.materials, 1, 3));
TConstructClientRegistry.registerManualIcon("arditeingot", new ItemStack(TContent.materials, 1, 4));
TConstructClientRegistry.registerManualIcon("copperingot", new ItemStack(TContent.materials, 1, 9));
TConstructClientRegistry.registerManualIcon("steelingot", new ItemStack(TContent.materials, 1, 16));
}
public void initManualRecipes()
{
ItemStack pattern = new ItemStack(TContent.blankPattern, 1, 0);
ItemStack stick = new ItemStack(Item.stick, 1, 0);
ItemStack plank = new ItemStack(Block.planks, 1, 0);
ItemStack workbench = new ItemStack(Block.workbench, 1, 0);
ItemStack chest = new ItemStack(Block.chest, 1, 0);
ItemStack log = new ItemStack(Block.wood, 1, 0);
ItemStack sand = new ItemStack(Block.sand, 1, 0);
ItemStack gravel = new ItemStack(Block.gravel, 1, 0);
ItemStack clay = new ItemStack(Item.clay, 1, 0);
ItemStack glass = new ItemStack(Block.glass, 1, 0);
ItemStack grout = new ItemStack(TContent.craftedSoil, 2, 1);
ItemStack searedbrick = new ItemStack(TContent.materials, 1, 2);
TConstructClientRegistry.registerManualSmallRecipe("blankpattern", pattern, plank, stick, stick, plank);
TConstructClientRegistry.registerManualSmallRecipe("toolstation", new ItemStack(TContent.toolStationWood, 1, 0), null, pattern, null, workbench);
TConstructClientRegistry.registerManualSmallRecipe("partcrafter", new ItemStack(TContent.toolStationWood, 1, 1), null, pattern, null, plank);
TConstructClientRegistry.registerManualSmallRecipe("patternchest", new ItemStack(TContent.toolStationWood, 1, 5), null, pattern, null, chest);
TConstructClientRegistry.registerManualSmallRecipe("stenciltable", new ItemStack(TContent.toolStationWood, 1, 10), null, pattern, null, log);
TConstructClientRegistry.registerManualSmallRecipe("grout", grout, sand, gravel, null, clay);
TConstructClientRegistry.registerManualFurnaceRecipe("searedbrick", searedbrick, grout);
TConstructClientRegistry.registerManualSmallRecipe("searedbricks", new ItemStack(TContent.smeltery, 1, 2), searedbrick, searedbrick, searedbrick, searedbrick);
TConstructClientRegistry.registerManualLargeRecipe("smelterycontroller", new ItemStack(TContent.smeltery, 1, 0), searedbrick, searedbrick, searedbrick, searedbrick, null, searedbrick, searedbrick, searedbrick, searedbrick);
TConstructClientRegistry.registerManualLargeRecipe("smelterydrain", new ItemStack(TContent.smeltery, 1, 1), searedbrick, null, searedbrick, searedbrick, null, searedbrick, searedbrick, searedbrick, searedbrick);
TConstructClientRegistry.registerManualLargeRecipe("smelterytank1", new ItemStack(TContent.lavaTank, 1, 0), searedbrick, searedbrick, searedbrick, searedbrick, glass, searedbrick, searedbrick, searedbrick, searedbrick);
TConstructClientRegistry.registerManualLargeRecipe("smelterytank2", new ItemStack(TContent.lavaTank, 1, 1), searedbrick, glass, searedbrick, glass, glass, glass, searedbrick, glass, searedbrick);
TConstructClientRegistry.registerManualLargeRecipe("smelterytank3", new ItemStack(TContent.lavaTank, 1, 2), searedbrick, glass, searedbrick, searedbrick, glass, searedbrick, searedbrick, glass, searedbrick);
TConstructClientRegistry.registerManualLargeRecipe("smelterytable", new ItemStack(TContent.searedBlock, 1, 0), searedbrick, searedbrick, searedbrick, searedbrick, null, searedbrick, searedbrick, null, searedbrick);
TConstructClientRegistry.registerManualLargeRecipe("smelteryfaucet", new ItemStack(TContent.searedBlock, 1, 1), searedbrick, null, searedbrick, null, searedbrick, null, null, null, null);
}
public static Document getManualFromStack (ItemStack stack)
@ -269,11 +338,13 @@ public class TProxyClient extends TProxyCommon
switch (stack.getItemDamage())
{
case 0:
return diary;
case 1:
return volume1;
case 1:
return volume2;
case 2:
return smelter;
case 3:
return diary;
}
return null;
@ -349,7 +420,7 @@ public class TProxyClient extends TProxyCommon
void addRenderMappings ()
{
String[] partTypes = { "wood", "stone", "iron", "flint", "cactus", "bone", "obsidian", "netherrack", "slime", "paper", "cobalt", "ardite", "manyullyn", "copper", "bronze", "alumite", "steel", "blueslime" };
String[] effectTypes = { "diamond", "emerald", "redstone", "glowstone", "moss", "ice", "lava", "blaze", "necrotic", "electric", "lapis" };
String[] effectTypes = { "diamond", "emerald", "redstone", "glowstone", "moss", "ice", "lava", "blaze", "necrotic", "electric", "lapis", "quartz" };
for (int partIter = 0; partIter < partTypes.length; partIter++)
{
TConstructClientRegistry.addMaterialRenderMapping(partIter, "tinker", partTypes[partIter], true);
@ -614,48 +685,5 @@ public class TProxyClient extends TProxyCommon
{
return null;
}
/*if (this.mc.renderViewEntity != null && this.mc.effectRenderer != null)
{
int i = this.mc.gameSettings.particleSetting;
if (i == 1 && mc.theWorld.rand.nextInt(3) == 0)
{
i = 2;
}
double d6 = this.mc.renderViewEntity.posX - par2;
double d7 = this.mc.renderViewEntity.posY - par4;
double d8 = this.mc.renderViewEntity.posZ - par6;
EntityFX entityfx = null;
double d9 = 16.0D;
if (d6 * d6 + d7 * d7 + d8 * d8 > d9 * d9)
{
return null;
}
else if (i > 1)
{
return null;
}
else
{
if (par1Str.equals("blueslime"))
{
entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, Item.appleGold, mc.renderEngine);RenderGlobal
}
else if (par1Str.equals("metalslime"))
{
entityfx = new BreakingFX(mc.theWorld, par2, par4, par6, metalBall, mc.renderEngine);
}
return (EntityFX) entityfx;
}
}
else
{
return null;
}*/
}
}

View File

@ -64,7 +64,7 @@ public class TableRender implements ISimpleBlockRenderingHandler
renderer.renderStandardBlock(block, x, y, z);
}
}
return false;
return true;
}
@Override

View File

@ -64,7 +64,7 @@ public class TankRender implements ISimpleBlockRenderingHandler
}
}
}
return false;
return true;
}
@Override

View File

@ -1,15 +1,23 @@
package mods.tinker.tconstruct.client.gui;
import java.util.List;
import mods.tinker.tconstruct.client.TProxyClient;
import mods.tinker.tconstruct.crafting.PatternBuilder;
import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.library.ToolMaterial;
import mods.tinker.tconstruct.library.client.TConstructClientRegistry;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiParticle;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@ -21,322 +29,647 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiManual extends GuiScreen
{
ItemStack itemstackBook;
Document manual;
private RenderItem renderitem = new RenderItem();
int bookImageWidth = 206;
int bookImageHeight = 200;
int bookTotalPages = 1;
int currentPage;
int maxPages;
ItemStack itemstackBook;
Document manual;
private RenderItem renderitem = new RenderItem();
int bookImageWidth = 206;
int bookImageHeight = 200;
int bookTotalPages = 1;
int currentPage;
int maxPages;
private TurnPageButton buttonNextPage;
private TurnPageButton buttonPreviousPage;
String pageLeftType;
String textLeft;
ItemStack[] iconsLeft;
String[] multiTextLeft;
private TurnPageButton buttonNextPage;
private TurnPageButton buttonPreviousPage;
String pageLeftType;
String textLeft;
ItemStack[] iconsLeft;
String[] multiTextLeft;
ToolMaterial materialLeft;
String pageRightType;
String textRight;
ItemStack[] iconsRight;
String[] multiTextRight;
String pageRightType;
String textRight;
ItemStack[] iconsRight;
String[] multiTextRight;
ToolMaterial materialRight;
public GuiManual(ItemStack stack, Document doc)
{
this.mc = Minecraft.getMinecraft();
this.itemstackBook = stack;
currentPage = 0; //Stack page
manual = doc;
}
public GuiManual(ItemStack stack, Document doc)
{
this.mc = Minecraft.getMinecraft();
this.itemstackBook = stack;
currentPage = 0; //Stack page
manual = doc;
renderitem.renderInFrame = true;
}
@Override
public void setWorldAndResolution (Minecraft minecraft, int w, int h)
{
this.guiParticles = new GuiParticle(minecraft);
this.mc = minecraft;
this.fontRenderer = TProxyClient.smallFontRenderer;
this.width = w;
this.height = h;
this.buttonList.clear();
this.initGui();
}
@Override
public void setWorldAndResolution (Minecraft minecraft, int w, int h)
{
this.guiParticles = new GuiParticle(minecraft);
this.mc = minecraft;
this.fontRenderer = TProxyClient.smallFontRenderer;
this.width = w;
this.height = h;
this.buttonList.clear();
this.initGui();
}
public void initGui ()
{
maxPages = manual.getElementsByTagName("page").getLength();
updateText();
int xPos = (this.width) / 2;
this.buttonList.add(this.buttonNextPage = new TurnPageButton(1, xPos + bookImageWidth - 50, 180, true));
this.buttonList.add(this.buttonPreviousPage = new TurnPageButton(2, xPos - bookImageWidth + 24, 180, false));
}
public void initGui ()
{
multiTextLeft = new String[] { "" };
multiTextRight = new String[] { "" };
iconsLeft = new ItemStack[1];
iconsRight = new ItemStack[1];
maxPages = manual.getElementsByTagName("page").getLength();
updateText();
int xPos = (this.width) / 2;
this.buttonList.add(this.buttonNextPage = new TurnPageButton(1, xPos + bookImageWidth - 50, 180, true));
this.buttonList.add(this.buttonPreviousPage = new TurnPageButton(2, xPos - bookImageWidth + 24, 180, false));
}
protected void actionPerformed (GuiButton button)
{
if (button.enabled)
{
if (button.id == 1)
currentPage += 2;
if (button.id == 2)
currentPage -= 2;
protected void actionPerformed (GuiButton button)
{
if (button.enabled)
{
if (button.id == 1)
currentPage += 2;
if (button.id == 2)
currentPage -= 2;
updateText();
}
}
updateText();
}
}
void updateText ()
{
if (currentPage >= maxPages)
currentPage = maxPages - 2;
if (currentPage % 2 == 1)
currentPage--;
if (currentPage < 0)
currentPage = 0;
void updateText () //TODO: OOP this
{
if (currentPage >= maxPages)
currentPage = maxPages - 2;
if (currentPage % 2 == 1)
currentPage--;
if (currentPage < 0)
currentPage = 0;
NodeList nList = manual.getElementsByTagName("page");
NodeList nList = manual.getElementsByTagName("page");
Node node = nList.item(currentPage);
if (node.getNodeType() == Node.ELEMENT_NODE)
{
Element element = (Element) node;
pageLeftType = element.getAttribute("type");
Node node = nList.item(currentPage);
if (node.getNodeType() == Node.ELEMENT_NODE)
{
Element element = (Element) node;
pageLeftType = element.getAttribute("type");
if (pageLeftType.equals("text") || pageLeftType.equals("intro"))
{
NodeList nodes = element.getElementsByTagName("text");
if (nodes != null)
textLeft = nodes.item(0).getTextContent();
}
if (pageLeftType.equals("text") || pageLeftType.equals("intro"))
{
NodeList nodes = element.getElementsByTagName("text");
if (nodes != null)
textLeft = nodes.item(0).getTextContent();
}
else if (pageLeftType.equals("contents"))
{
NodeList nodes = element.getElementsByTagName("text");
if (nodes != null)
textLeft = nodes.item(0).getTextContent();
nodes = element.getElementsByTagName("link");
multiTextLeft = new String[nodes.getLength()];
iconsLeft = new ItemStack[nodes.getLength()];
for (int i = 0; i < nodes.getLength(); i++)
{
NodeList children = nodes.item(i).getChildNodes();
multiTextLeft[i] = children.item(1).getTextContent();
iconsLeft[i] = TConstructClientRegistry.getManualIcon(children.item(3).getTextContent());
}
}
else if (pageLeftType.equals("contents"))
{
NodeList nodes = element.getElementsByTagName("text");
if (nodes != null)
textLeft = nodes.item(0).getTextContent();
else if (pageLeftType.equals("sidebar"))
{
NodeList nodes = element.getElementsByTagName("text");
if (nodes != null)
textLeft = nodes.item(0).getTextContent();
nodes = element.getElementsByTagName("item");
multiTextLeft = new String[nodes.getLength()];
iconsLeft = new ItemStack[nodes.getLength()];
for (int i = 0; i < nodes.getLength(); i++)
{
NodeList children = nodes.item(i).getChildNodes();
multiTextLeft[i] = children.item(1).getTextContent();
iconsLeft[i] = TConstructClientRegistry.getManualIcon(children.item(3).getTextContent());
}
}
nodes = element.getElementsByTagName("link");
multiTextLeft = new String[nodes.getLength()];
iconsLeft = new ItemStack[nodes.getLength()];
for (int i = 0; i < nodes.getLength(); i++)
{
NodeList children = nodes.item(i).getChildNodes();
multiTextLeft[i] = children.item(1).getTextContent();
iconsLeft[i] = TConstructClientRegistry.getManualIcon(children.item(3).getTextContent());
}
}
else if (pageLeftType.equals("picture"))
{
NodeList nodes = element.getElementsByTagName("text");
if (nodes != null)
textLeft = nodes.item(0).getTextContent();
nodes = element.getElementsByTagName("picture");
if (nodes != null)
multiTextLeft[0] = nodes.item(0).getTextContent();
}
}
else if (pageLeftType.equals("sidebar"))
{
NodeList nodes = element.getElementsByTagName("text");
if (nodes != null)
textLeft = nodes.item(0).getTextContent();
node = nList.item(currentPage + 1);
if (node != null && node.getNodeType() == Node.ELEMENT_NODE)
{
Element element = (Element) node;
pageRightType = element.getAttribute("type");
nodes = element.getElementsByTagName("item");
multiTextLeft = new String[nodes.getLength()];
iconsLeft = new ItemStack[nodes.getLength()];
for (int i = 0; i < nodes.getLength(); i++)
{
NodeList children = nodes.item(i).getChildNodes();
multiTextLeft[i] = children.item(1).getTextContent();
iconsLeft[i] = TConstructClientRegistry.getManualIcon(children.item(3).getTextContent());
}
}
if (pageRightType.equals("text") || pageRightType.equals("intro"))
{
NodeList nodes = element.getElementsByTagName("text");
if (nodes != null)
textRight = nodes.item(0).getTextContent();
}
else if (pageLeftType.equals("picture"))
{
NodeList nodes = element.getElementsByTagName("text");
if (nodes != null)
textLeft = nodes.item(0).getTextContent();
else if (pageRightType.equals("contents"))
{
NodeList nodes = element.getElementsByTagName("text");
if (nodes != null)
textRight = nodes.item(0).getTextContent();
nodes = element.getElementsByTagName("link");
multiTextRight = new String[nodes.getLength()];
iconsRight = new ItemStack[nodes.getLength()];
for (int i = 0; i < nodes.getLength(); i++)
{
NodeList children = nodes.item(i).getChildNodes();
multiTextRight[i] = children.item(1).getTextContent();
iconsRight[i] = TConstructClientRegistry.getManualIcon(children.item(3).getTextContent());
}
}
else if (pageRightType.equals("sidebar"))
{
NodeList nodes = element.getElementsByTagName("text");
if (nodes != null)
textRight = nodes.item(0).getTextContent();
nodes = element.getElementsByTagName("item");
multiTextRight = new String[nodes.getLength()];
iconsRight = new ItemStack[nodes.getLength()];
for (int i = 0; i < nodes.getLength(); i++)
{
NodeList children = nodes.item(i).getChildNodes();
multiTextRight[i] = children.item(1).getTextContent();
iconsRight[i] = TConstructClientRegistry.getManualIcon(children.item(3).getTextContent());
}
}
else if (pageRightType.equals("picture"))
{
NodeList nodes = element.getElementsByTagName("text");
if (nodes != null)
textRight = nodes.item(0).getTextContent();
nodes = element.getElementsByTagName("picture");
if (nodes != null)
multiTextRight[0] = nodes.item(0).getTextContent();
}
}
else
{
pageRightType = "blank";
textRight = null;
}
}
nodes = element.getElementsByTagName("picture");
if (nodes != null)
multiTextLeft[0] = nodes.item(0).getTextContent();
}
public void drawScreen (int par1, int par2, float par3)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/bookright.png");
int localWidth = (this.width) / 2;
byte localHeight = 8;
this.drawTexturedModalRect(localWidth, localHeight, 0, 0, this.bookImageWidth, this.bookImageHeight);
else if (pageLeftType.equals("crafting"))
{
NodeList nodes = element.getElementsByTagName("text");
if (nodes != null)
textLeft = nodes.item(0).getTextContent();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/bookleft.png");
localWidth = localWidth - this.bookImageWidth;
this.drawTexturedModalRect(localWidth, localHeight, 256 - this.bookImageWidth, 0, this.bookImageWidth, this.bookImageHeight);
nodes = element.getElementsByTagName("name");
if (nodes != null)
iconsLeft = TConstructClientRegistry.getRecipeIcons(nodes.item(0).getTextContent());
super.drawScreen(par1, par2, par3);
//Workaround
if (pageLeftType.equals("picture"))
{
drawPicture(multiTextLeft[0], localWidth + 16, localHeight + 12);
}
if (pageRightType.equals("picture"))
{
drawPicture(multiTextRight[0], localWidth + 220, localHeight + 12);
}
nodes = element.getElementsByTagName("size");
if (nodes != null)
multiTextLeft[0] = nodes.item(0).getTextContent();
}
if (pageLeftType.equals("text"))
{
if (textLeft != null)
drawTextPage(textLeft, localWidth + 16, localHeight + 12);
}
else if (pageLeftType.equals("intro"))
{
if (textLeft != null)
drawTitlePage(textLeft, localWidth + 16, localHeight + 12);
}
else if (pageLeftType.equals("contents"))
{
drawContentTablePage(textLeft, iconsLeft, multiTextLeft, localWidth + 16, localHeight + 12);
}
else if (pageLeftType.equals("sidebar"))
{
drawSidebarPage(textLeft, iconsLeft, multiTextLeft, localWidth + 16, localHeight + 12);
}
else if (pageLeftType.equals("picture"))
{
drawPicturePage(textLeft, localWidth + 16, localHeight + 12);
}
else if (pageLeftType.equals("smelting"))
{
NodeList nodes = element.getElementsByTagName("text");
if (nodes != null)
textLeft = nodes.item(0).getTextContent();
if (pageRightType.equals("text"))
{
if (textRight != null)
drawTextPage(textRight, localWidth + 220, localHeight + 12);
}
else if (pageRightType.equals("intro"))
{
if (textRight != null)
drawTitlePage(textRight, localWidth + 220, localHeight + 12);
}
else if (pageRightType.equals("contents"))
{
drawContentTablePage(textRight, iconsRight, multiTextRight, localWidth + 220, localHeight + 12);
}
else if (pageRightType.equals("sidebar"))
{
drawSidebarPage(textRight, iconsRight, multiTextRight, localWidth + 220, localHeight + 12);
}
else if (pageRightType.equals("picture"))
{
drawPicturePage(textRight, localWidth + 220, localHeight + 12);
}
}
nodes = element.getElementsByTagName("recipe");
if (nodes != null)
iconsLeft = TConstructClientRegistry.getRecipeIcons(nodes.item(0).getTextContent());
}
else if (pageLeftType.equals("materialstats"))
{
NodeList nodes = element.getElementsByTagName("title");
if (nodes != null)
textLeft = nodes.item(0).getTextContent();
iconsLeft = new ItemStack[4];
/* Page types */
public void drawTextPage (String text, int localWidth, int localHeight)
{
this.fontRenderer.drawSplitString(text, localWidth, localHeight, 178, 0);
}
nodes = element.getElementsByTagName("text");
if (nodes != null)
multiTextLeft[0] = nodes.item(0).getTextContent();
nodes = element.getElementsByTagName("icon");
if (nodes != null)
iconsLeft[0] = TConstructClientRegistry.getManualIcon(nodes.item(0).getTextContent());
public void drawTitlePage (String text, int localWidth, int localHeight)
{
this.fontRenderer.drawSplitString(text, localWidth, localHeight, 178, 0);
}
nodes = element.getElementsByTagName("toolmaterial");
if (nodes != null && nodes.getLength() > 0)
materialLeft = TConstructRegistry.getMaterial(nodes.item(0).getTextContent());
else
materialLeft = TConstructRegistry.getMaterial(textLeft);
nodes = element.getElementsByTagName("material").item(0).getChildNodes();
public void drawContentTablePage (String info, ItemStack[] icons, String[] multiText, int localWidth, int localHeight)
{
if (info != null)
this.fontRenderer.drawString("\u00a7n"+info, localWidth + 50, localHeight + 4, 0);
for (int i = 0; i < icons.length; i++)
{
renderitem.renderItemIntoGUI(fontRenderer, mc.renderEngine, icons[i], localWidth + 16, localHeight + 18 * i + 18);
int yOffset = 18;
if (multiText[i].length() > 40)
yOffset = 13;
this.fontRenderer.drawString(multiText[i], localWidth + 38, localHeight + 18 * i + yOffset, 0);
}
}
public void drawSidebarPage (String info, ItemStack[] icons, String[] multiText, int localWidth, int localHeight)
{
this.fontRenderer.drawSplitString(info, localWidth, localHeight, 178, 0);
for (int i = 0; i < icons.length; i++)
{
renderitem.renderItemIntoGUI(fontRenderer, mc.renderEngine, icons[i], localWidth + 8, localHeight + 18 * i + 36);
int yOffset = 39;
if (multiText[i].length() > 40)
yOffset = 34;
this.fontRenderer.drawSplitString(multiText[i], localWidth + 30, localHeight + 18 * i + yOffset, 140, 0);
}
}
public void drawPicture(String picture, int localWidth, int localHeight)
{
this.mc.renderEngine.bindTexture(picture);
this.drawTexturedModalRect(localWidth, localHeight+12, 0, 0, 170, 144);
}
public void drawPicturePage(String info, int localWidth, int localHeight)
{
this.fontRenderer.drawSplitString(info, localWidth+8, localHeight, 178, 0);
}
iconsLeft[1] = TConstructClientRegistry.getManualIcon(nodes.item(1).getTextContent());
iconsLeft[2] = PatternBuilder.instance.getShardFromSet(materialLeft.name());
iconsLeft[3] = PatternBuilder.instance.getRodFromSet(materialLeft.name());
}
}
node = nList.item(currentPage + 1);
if (node != null && node.getNodeType() == Node.ELEMENT_NODE)
{
Element element = (Element) node;
pageRightType = element.getAttribute("type");
if (pageRightType.equals("text") || pageRightType.equals("intro"))
{
NodeList nodes = element.getElementsByTagName("text");
if (nodes != null)
textRight = nodes.item(0).getTextContent();
}
else if (pageRightType.equals("contents"))
{
NodeList nodes = element.getElementsByTagName("text");
if (nodes != null)
textRight = nodes.item(0).getTextContent();
nodes = element.getElementsByTagName("link");
multiTextRight = new String[nodes.getLength()];
iconsRight = new ItemStack[nodes.getLength()];
for (int i = 0; i < nodes.getLength(); i++)
{
NodeList children = nodes.item(i).getChildNodes();
multiTextRight[i] = children.item(1).getTextContent();
iconsRight[i] = TConstructClientRegistry.getManualIcon(children.item(3).getTextContent());
}
}
else if (pageRightType.equals("sidebar"))
{
NodeList nodes = element.getElementsByTagName("text");
if (nodes != null)
textRight = nodes.item(0).getTextContent();
nodes = element.getElementsByTagName("item");
multiTextRight = new String[nodes.getLength()];
iconsRight = new ItemStack[nodes.getLength()];
for (int i = 0; i < nodes.getLength(); i++)
{
NodeList children = nodes.item(i).getChildNodes();
multiTextRight[i] = children.item(1).getTextContent();
iconsRight[i] = TConstructClientRegistry.getManualIcon(children.item(3).getTextContent());
}
}
else if (pageRightType.equals("picture"))
{
NodeList nodes = element.getElementsByTagName("text");
if (nodes != null)
textRight = nodes.item(0).getTextContent();
nodes = element.getElementsByTagName("picture");
if (nodes != null)
multiTextRight[0] = nodes.item(0).getTextContent();
}
else if (pageRightType.equals("crafting"))
{
NodeList nodes = element.getElementsByTagName("text");
if (nodes != null)
textRight = nodes.item(0).getTextContent();
nodes = element.getElementsByTagName("name");
if (nodes != null)
iconsRight = TConstructClientRegistry.getRecipeIcons(nodes.item(0).getTextContent());
nodes = element.getElementsByTagName("size");
if (nodes != null)
multiTextRight[0] = nodes.item(0).getTextContent();
}
else if (pageRightType.equals("smelting"))
{
NodeList nodes = element.getElementsByTagName("text");
if (nodes != null)
textRight = nodes.item(0).getTextContent();
nodes = element.getElementsByTagName("recipe");
if (nodes != null)
iconsRight = TConstructClientRegistry.getRecipeIcons(nodes.item(0).getTextContent());
}
else if (pageRightType.equals("materialstats"))
{
NodeList nodes = element.getElementsByTagName("title");
if (nodes != null)
textRight = nodes.item(0).getTextContent();
iconsRight = new ItemStack[4];
nodes = element.getElementsByTagName("text");
if (nodes != null)
multiTextRight[0] = nodes.item(0).getTextContent();
nodes = element.getElementsByTagName("icon");
if (nodes != null)
iconsRight[0] = TConstructClientRegistry.getManualIcon(nodes.item(0).getTextContent());
nodes = element.getElementsByTagName("toolmaterial");
if (nodes != null && nodes.getLength() > 0)
materialRight = TConstructRegistry.getMaterial(nodes.item(0).getTextContent());
else
materialRight = TConstructRegistry.getMaterial(textRight);
nodes = element.getElementsByTagName("material").item(0).getChildNodes();
iconsRight[1] = TConstructClientRegistry.getManualIcon(nodes.item(1).getTextContent());
iconsRight[2] = PatternBuilder.instance.getShardFromSet(materialRight.name());
iconsRight[3] = PatternBuilder.instance.getRodFromSet(materialRight.name());
}
}
else
{
pageRightType = "blank";
textRight = null;
}
}
public void drawScreen (int par1, int par2, float par3)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/bookright.png");
int localWidth = (this.width) / 2;
byte localHeight = 8;
this.drawTexturedModalRect(localWidth, localHeight, 0, 0, this.bookImageWidth, this.bookImageHeight);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/bookleft.png");
localWidth = localWidth - this.bookImageWidth;
this.drawTexturedModalRect(localWidth, localHeight, 256 - this.bookImageWidth, 0, this.bookImageWidth, this.bookImageHeight);
super.drawScreen(par1, par2, par3);
//Workaround
if (pageLeftType.equals("picture")) //TODO: OOP this
{
drawPicture(multiTextLeft[0], localWidth + 16, localHeight + 12);
}
if (pageRightType.equals("picture"))
{
drawPicture(multiTextRight[0], localWidth + 220, localHeight + 12);
}
if (pageLeftType.equals("crafting"))
{
if (multiTextLeft[0].equals("two"))
drawCrafting(2, localWidth + 16, localHeight + 12);
if (multiTextLeft[0].equals("three"))
drawCrafting(3, localWidth + 22, localHeight + 12);
}
if (pageRightType.equals("crafting"))
{
int size = 2;
if (multiTextRight[0].equals("three"))
size = 3;
drawCrafting(size, localWidth + 220, localHeight + 12);
}
if (pageLeftType.equals("smelting"))
{
drawSmelting(localWidth + 16, localHeight + 12);
}
if (pageRightType.equals("smelting"))
{
drawSmelting(localWidth + 220, localHeight + 12);
}
//Text
if (pageLeftType.equals("text"))
{
if (textLeft != null)
drawTextPage(textLeft, localWidth + 16, localHeight + 12);
}
else if (pageLeftType.equals("intro"))
{
if (textLeft != null)
drawTitlePage(textLeft, localWidth + 16, localHeight + 12);
}
else if (pageLeftType.equals("contents"))
{
drawContentTablePage(textLeft, iconsLeft, multiTextLeft, localWidth + 16, localHeight + 12);
}
else if (pageLeftType.equals("sidebar"))
{
drawSidebarPage(textLeft, iconsLeft, multiTextLeft, localWidth + 16, localHeight + 12);
}
else if (pageLeftType.equals("picture"))
{
drawPicturePage(textLeft, localWidth + 16, localHeight + 12);
}
else if (pageLeftType.equals("crafting"))
{
if (multiTextLeft[0].equals("two"))
drawCraftingPage(textLeft, iconsLeft, 2, localWidth + 16, localHeight + 12);
if (multiTextLeft[0].equals("three"))
drawCraftingPage(textLeft, iconsLeft, 3, localWidth + 22, localHeight + 12);
}
else if (pageLeftType.equals("smelting"))
{
drawSmeltingPage(textLeft, iconsLeft, localWidth + 16, localHeight + 12);
}
else if (pageLeftType.equals("materialstats"))
{
drawMaterialPage(textLeft, iconsLeft, multiTextLeft, materialLeft, localWidth + 16, localHeight + 12);
}
if (pageRightType.equals("text"))
{
if (textRight != null)
drawTextPage(textRight, localWidth + 220, localHeight + 12);
}
else if (pageRightType.equals("intro"))
{
if (textRight != null)
drawTitlePage(textRight, localWidth + 220, localHeight + 12);
}
else if (pageRightType.equals("contents"))
{
drawContentTablePage(textRight, iconsRight, multiTextRight, localWidth + 220, localHeight + 12);
}
else if (pageRightType.equals("sidebar"))
{
drawSidebarPage(textRight, iconsRight, multiTextRight, localWidth + 220, localHeight + 12);
}
else if (pageRightType.equals("picture"))
{
drawPicturePage(textRight, localWidth + 220, localHeight + 12);
}
else if (pageRightType.equals("crafting"))
{
int size = 2;
if (multiTextRight[0].equals("three"))
size = 3;
drawCraftingPage(textRight, iconsRight, size, localWidth + 220, localHeight + 12);
}
else if (pageRightType.equals("smelting"))
{
drawSmeltingPage(textRight, iconsRight, localWidth + 220, localHeight + 12);
}
else if (pageRightType.equals("materialstats"))
{
drawMaterialPage(textRight, iconsRight, multiTextRight, materialRight, localWidth + 220, localHeight + 12);
}
}
/* Page types */
public void drawTextPage (String text, int localWidth, int localHeight)
{
this.fontRenderer.drawSplitString(text, localWidth, localHeight, 178, 0);
}
public void drawTitlePage (String text, int localWidth, int localHeight)
{
this.fontRenderer.drawSplitString(text, localWidth, localHeight, 178, 0);
}
public void drawContentTablePage (String info, ItemStack[] icons, String[] multiText, int localWidth, int localHeight)
{
if (info != null)
this.fontRenderer.drawString("\u00a7n" + info, localWidth + 50, localHeight + 4, 0);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderHelper.enableGUIStandardItemLighting();
for (int i = 0; i < icons.length; i++)
{
renderitem.renderItemIntoGUI(fontRenderer, mc.renderEngine, icons[i], localWidth + 16, localHeight + 18 * i + 18);
int yOffset = 18;
if (multiText[i].length() > 40)
yOffset = 13;
this.fontRenderer.drawString(multiText[i], localWidth + 38, localHeight + 18 * i + yOffset, 0);
}
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
}
public void drawSidebarPage (String info, ItemStack[] icons, String[] multiText, int localWidth, int localHeight)
{
this.fontRenderer.drawSplitString(info, localWidth, localHeight, 178, 0);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderHelper.enableGUIStandardItemLighting();
for (int i = 0; i < icons.length; i++)
{
renderitem.renderItemIntoGUI(fontRenderer, mc.renderEngine, icons[i], localWidth + 8, localHeight + 18 * i + 36);
int yOffset = 39;
if (multiText[i].length() > 40)
yOffset = 34;
this.fontRenderer.drawSplitString(multiText[i], localWidth + 30, localHeight + 18 * i + yOffset, 140, 0);
}
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
}
public void drawPicture (String picture, int localWidth, int localHeight)
{
this.mc.renderEngine.bindTexture(picture);
this.drawTexturedModalRect(localWidth, localHeight + 12, 0, 0, 170, 144);
}
public void drawPicturePage (String info, int localWidth, int localHeight)
{
this.fontRenderer.drawSplitString(info, localWidth + 8, localHeight, 178, 0);
}
public void drawCrafting (int size, int localWidth, int localHeight)
{
this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/bookcrafting.png");
if (size == 2)
this.drawTexturedModalRect(localWidth + 8, localHeight + 46, 0, 116, 154, 78);
if (size == 3)
this.drawTexturedModalRect(localWidth - 8, localHeight + 28, 0, 0, 183, 114);
}
public void drawCraftingPage (String info, ItemStack[] icons, int recipeSize, int localWidth, int localHeight)
{
if (info != null)
this.fontRenderer.drawString("\u00a7n" + info, localWidth + 50, localHeight + 4, 0);
GL11.glScalef(2f, 2f, 2f);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderHelper.enableGUIStandardItemLighting();
if (recipeSize == 2)
{
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[0], (localWidth + 126) / 2, (localHeight + 68) / 2);
if (icons[0].stackSize > 1)
renderitem.renderItemStack(fontRenderer, mc.renderEngine, icons[0], (localWidth + 126) / 2, (localHeight + 68) / 2, String.valueOf(icons[0].stackSize));
for (int i = 0; i < icons.length - 1; i++)
{
if (icons[i + 1] != null)
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[i + 1], (localWidth + 14 + 36 * (i % 2)) / 2, (localHeight + 36 * (i / 2) + 52) / 2);
}
}
if (recipeSize == 3)
{
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[0], (localWidth + 138) / 2, (localHeight + 70) / 2);
if (icons[0].stackSize > 1)
renderitem.renderItemStack(fontRenderer, mc.renderEngine, icons[0], (localWidth + 126) / 2, (localHeight + 68) / 2, String.valueOf(icons[0].stackSize));
for (int i = 0; i < icons.length - 1; i++)
{
if (icons[i + 1] != null)
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[i + 1], (localWidth - 2 + 36 * (i % 3)) / 2, (localHeight + 36 * (i / 3) + 34) / 2);
}
}
GL11.glScalef(0.5F, 0.5F, 0.5F);
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
}
public void drawSmelting (int localWidth, int localHeight)
{
this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/bookfurnace.png");
this.drawTexturedModalRect(localWidth + 32, localHeight + 32, 0, 0, 111, 114);
}
public void drawSmeltingPage (String info, ItemStack[] icons, int localWidth, int localHeight)
{
if (info != null)
this.fontRenderer.drawString("\u00a7n" + info, localWidth + 50, localHeight + 4, 0);
GL11.glScalef(2f, 2f, 2f);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderHelper.enableGUIStandardItemLighting();
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, TConstructClientRegistry.getManualIcon("coal"), (localWidth + 38) / 2, (localHeight + 110) / 2);
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[0], (localWidth + 106) / 2, (localHeight + 74) / 2);
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[1], (localWidth + 38) / 2, (localHeight + 38) / 2);
/*for (int i = 0; i < icons.length - 1; i++)
{
if (icons[i + 1] != null)
renderitem.renderItemIntoGUI(fontRenderer, mc.renderEngine, icons[i + 1], (localWidth + 14 + 36 * (i % 2)) / 2, (localHeight + 36 * (i / 2) + 52) / 2);
}*/
if (icons[0].stackSize > 1)
renderitem.renderItemStack(fontRenderer, mc.renderEngine, icons[0], (localWidth + 106) / 2, (localHeight + 74) / 2, String.valueOf(icons[0].stackSize));
GL11.glScalef(0.5F, 0.5F, 0.5F);
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
}
public void drawMaterialPage (String title, ItemStack[] icons, String[] multiText, ToolMaterial material, int localWidth, int localHeight)
{
this.fontRenderer.drawString("\u00a7n" + title, localWidth + 70, localHeight + 4, 0);
this.fontRenderer.drawSplitString(multiText[0], localWidth, localHeight + 16, 178, 0);
this.fontRenderer.drawString("Material: ", localWidth+108, localHeight + 40, 0);
this.fontRenderer.drawString("Shard: ", localWidth+108, localHeight + 72, 0);
this.fontRenderer.drawString("Rod: ", localWidth+108, localHeight + 104, 0);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderHelper.enableGUIStandardItemLighting();
//renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[0], localWidth + 50, localHeight + 0);
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[1], localWidth + 108, localHeight + 50);
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[2], localWidth + 108, localHeight + 82);
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[3], localWidth + 108, localHeight + 114);
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
this.fontRenderer.drawSplitString(icons[1].getTooltip(this.mc.thePlayer, false).get((0)).toString(), localWidth + 128, localHeight + 53, 52, 0);
this.fontRenderer.drawSplitString(icons[2].getTooltip(this.mc.thePlayer, false).get((0)).toString(), localWidth + 128, localHeight + 85, 52, 0);
this.fontRenderer.drawSplitString(icons[3].getTooltip(this.mc.thePlayer, false).get((0)).toString(), localWidth + 128, localHeight + 117, 52, 0);
this.fontRenderer.drawString("Durability: " + material.durability(), localWidth, localHeight + 40, 0);
this.fontRenderer.drawString("Handle Modifier: " + material.handleDurability()+"x", localWidth, localHeight + 50, 0);
this.fontRenderer.drawString("Full Tool Durability: " + (int)(material.durability()*material.handleDurability()), localWidth, localHeight + 60, 0);
this.fontRenderer.drawString("Mining Speed: " + material.toolSpeed()/100f, localWidth, localHeight + 80, 0);
this.fontRenderer.drawString("Harvest Level: " + material.harvestLevel()+" ("+PartCrafterGui.getHarvestLevelName(material.harvestLevel())+")", localWidth, localHeight + 90, 0);
int attack = material.attack();
String heart = attack == 2 ? " Heart" : " Hearts";
if (attack % 2 == 0)
this.fontRenderer.drawString("Base Attack: " + material.attack()/2 + heart, localWidth, localHeight + 100, 0);
else
this.fontRenderer.drawString("Base Attack: " + material.attack()/2f + heart, localWidth, localHeight + 100, 0);
int offset = 0;
String ability = material.ability();
if (!ability.equals(""))
{
this.fontRenderer.drawString("Material ability: " + material.ability(), localWidth, localHeight + 120 + 10*offset, 0);
offset++;
if (ability.equals("Writable"))
this.fontRenderer.drawString("+1 Modifiers", localWidth, localHeight + 120 + 10*offset, 0);
}
if (material.reinforced() > 0)
{
this.fontRenderer.drawString("Material ability: Reinforced", localWidth, localHeight + 120 + 10*offset, 0);
offset++;
this.fontRenderer.drawString("Reinforced level: " + material.reinforced(), localWidth, localHeight + 120 + 10*offset, 0);
offset++;
}
if (material.shoddy() > 0)
{
this.fontRenderer.drawString("Shoddy level: " + material.shoddy(), localWidth, localHeight + 120 + 10*offset, 0);
offset++;
}
else if (material.shoddy() < 0)
{
this.fontRenderer.drawString("Spiny level: " + -material.shoddy(), localWidth, localHeight + 120 + 10*offset, 0);
offset++;
}
}
}

View File

@ -108,7 +108,7 @@ public class PartCrafterGui extends GuiContainer
drawDefaultInformation();
}
String getHarvestLevelName (int num)
public static String getHarvestLevelName (int num)
{
switch (num)
{

View File

@ -168,8 +168,14 @@ public class ToolStationGui extends GuiContainer
int maxDur = tags.getInteger("TotalDurability");
dur = maxDur - dur;
fontRenderer.drawString("Durability: " + dur + "/" + maxDur, xSize + 8, 24, 0xffffff);
int damage = tags.getInteger("Attack");
fontRenderer.drawString("Damage: " + damage, xSize + 8, 35, 0xffffff);
int attack = tags.getInteger("Attack");
String heart = attack == 2 ? " Heart" : " Hearts";
if (attack % 2 == 0)
this.fontRenderer.drawString("Attack: " + attack/2 + heart, xSize + 8, 35, 0xffffff);
else
this.fontRenderer.drawString("Attack: " +attack/2f + heart, xSize + 8, 35, 0xffffff);
//fontRenderer.drawString("Attack: " + damage, xSize + 8, 35, 0xffffff);
fontRenderer.drawString("Modifiers remaining: " + tags.getInteger("Modifiers"), xSize + 8, 57, 0xffffff);
if (tags.hasKey("Tooltip1"))

View File

@ -146,6 +146,22 @@ public class PatternBuilder
}
return null;
}
public ItemStack getShardFromSet(String materialset)
{
MaterialSet set = (MaterialSet) materialSets.get(materialset);
if (set != null)
return set.shard.copy();
return null;
}
public ItemStack getRodFromSet(String materialset)
{
MaterialSet set = (MaterialSet) materialSets.get(materialset);
if (set != null)
return set.rod.copy();
return null;
}
//Small data classes. I would prefer the struct from C#, but we do what we can.
public class ItemKey

View File

@ -92,6 +92,15 @@ public class BlueSlime extends EntityLiving implements IMob
this.motionX -= (double) (MathHelper.sin(f) * 0.2F);
this.motionZ += (double) (MathHelper.cos(f) * 0.2F);
}
if (this.getBrightness(1.0F) > 0.9F && rand.nextInt(5) == 0 && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)))
{
int size = this.getSlimeSize() - 1;
if (size <= 0)
this.kill();
else
this.setSlimeSize(size);
}
this.isAirBorne = true;
ForgeHooks.onLivingJump(this);
@ -118,6 +127,11 @@ public class BlueSlime extends EntityLiving implements IMob
int x = MathHelper.floor_double(this.posX);
int y = MathHelper.floor_double(this.boundingBox.minY);
int z = MathHelper.floor_double(this.posZ);
if (y < 60 && rand.nextInt(5) != 0)
{
return false;
}
if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, x, y, z) > this.rand.nextInt(32))
{

View File

@ -13,7 +13,7 @@ import net.minecraft.world.World;
public class PatternManual extends CraftingItem
{
static String[] name = new String[] { "diary", "toolstation", "smeltery" };
static String[] name = new String[] { "beginner", "toolstation", "smeltery" };
static String[] textureName = new String[] { "tinkerbook_diary", "tinkerbook_toolstation", "tinkerbook_smeltery" };
public PatternManual(int id)
{
@ -37,7 +37,7 @@ public class PatternManual extends CraftingItem
switch (stack.getItemDamage())
{
case 0:
list.add("\u00a7oBy: Unknown");
list.add("\u00a7oBy: Skyla");
break;
case 1:
list.add("\u00a7oBy: Skyla");

View File

@ -11,7 +11,7 @@ public class StrangeFood extends SpecialFood
{
public StrangeFood(int id)
{
super(id, new int[] { 1 }, new float[] { 1f }, new String[] { "edibleslime" }, new String[] { "edibleslime" });
super(id, new int[] { 2 }, new float[] { 1f }, new String[] { "edibleslime" }, new String[] { "edibleslime" });
}
@Override

View File

@ -489,8 +489,9 @@ public class AbilityHelper
if (!player.worldObj.isRemote)
{
EntityItem entityitem = new EntityItem(player.worldObj, player.posX + 0.5D, player.posY + 0.5D, player.posZ + 0.5D, stack);
entityitem.delayBeforeCanPickup = 10;
//entityitem.delayBeforeCanPickup = 10;
player.worldObj.spawnEntityInWorld(entityitem);
entityitem.onCollideWithPlayer(player);
}
}
}

View File

@ -14,7 +14,8 @@ 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>(60);
public static HashMap<Integer, ToolMaterial> toolMaterials = new HashMap<Integer, ToolMaterial>(40);
public static HashMap<String, ToolMaterial> toolMaterialStrings = new HashMap<String, ToolMaterial>(40);
public static TabTools toolTab;
public static TabTools materialTab;
@ -43,14 +44,21 @@ public class TConstructRegistry
ToolMaterial mat = toolMaterials.get(materialID);
if (mat == null)
{
toolMaterials.put(materialID, new ToolMaterial(materialName, craftingTier, harvestLevel, durability, miningspeed, attack, handleModifier, reinforced, shoddy, style, ability));
mat = new ToolMaterial(materialName, craftingTier, harvestLevel, durability, miningspeed, attack, handleModifier, reinforced, shoddy, 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 RuntimeException("[TConstruct] Material ID " + materialID + " is already occupied by " + mat.materialName);
}
public static ToolMaterial getMaterial (int key)
{
return (toolMaterials.get(key));
}
public static ToolMaterial getMaterial (String key)
{
return (toolMaterialStrings.get(key));
}
}

View File

@ -7,7 +7,7 @@ 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;
public final int craftingTier; //Not used
public final int harvestLevel;
public final int durability;
public final int miningspeed; // <-- divided by 100

View File

@ -13,6 +13,7 @@ public class TConstructClientRegistry
{
public static ArrayList<ToolGuiElement> toolButtons = new ArrayList<ToolGuiElement>(20);
public static Map<String, ItemStack> manualIcons = new HashMap<String, ItemStack>();
public static Map<String, ItemStack[]> recipeIcons = new HashMap<String, ItemStack[]>();
public static ItemStack defaultStack = new ItemStack(Item.ingotIron);
public static void addMaterialRenderMapping (int materialID, String domain, String renderName, boolean useDefaultFolder)
@ -49,12 +50,41 @@ public class TConstructClientRegistry
manualIcons.put(name, stack);
}
public static ItemStack getManualIcon (String textContent)
public static ItemStack getManualIcon (String textContent)
{
ItemStack stack = manualIcons.get(textContent);
if (stack != null)
return stack;
return defaultStack;
}
public static void registerManualSmallRecipe(String name, ItemStack output, ItemStack... stacks)
{
ItemStack stack = manualIcons.get(textContent);
if (stack != null)
return stack;
return defaultStack;
ItemStack[] recipe = new ItemStack[5];
recipe[0] = output;
System.arraycopy(stacks, 0, recipe, 1, 4);
recipeIcons.put(name, recipe);
}
public static void registerManualLargeRecipe(String name, ItemStack output, ItemStack... stacks)
{
ItemStack[] recipe = new ItemStack[10];
recipe[0] = output;
System.arraycopy(stacks, 0, recipe, 1, 9);
recipeIcons.put(name, recipe);
}
public static void registerManualFurnaceRecipe(String name, ItemStack output, ItemStack input)
{
ItemStack[] recipe = new ItemStack[2];
recipe[0] = output;
recipe[1] = input;
recipeIcons.put(name, recipe);
}
public static ItemStack[] getRecipeIcons(String recipeName)
{
return recipeIcons.get(recipeName);
}
//Gui

View File

@ -1,6 +1,5 @@
package mods.tinker.tconstruct.logic;
import cpw.mods.fml.common.FMLLog;
import mods.tinker.common.IPattern;
import mods.tinker.common.InventoryLogic;
import mods.tinker.tconstruct.TConstruct;
@ -8,6 +7,7 @@ import mods.tinker.tconstruct.crafting.CastingRecipe;
import mods.tinker.tconstruct.crafting.LiquidCasting;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.INetworkManager;
@ -19,7 +19,8 @@ import net.minecraftforge.liquids.ILiquidTank;
import net.minecraftforge.liquids.ITankContainer;
import net.minecraftforge.liquids.LiquidStack;
public class CastingTableLogic extends InventoryLogic implements ILiquidTank, ITankContainer
public class CastingTableLogic extends InventoryLogic
implements ILiquidTank, ITankContainer, ISidedInventory
{
public LiquidStack liquid;
int castingDelay = 0;
@ -129,6 +130,20 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank, IT
return resource.amount;
}
}
@Override
public void onInventoryChanged()
{
super.onInventoryChanged();
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
}
public ItemStack decrStackSize(int slot, int quantity)
{
ItemStack stack = super.decrStackSize(slot, quantity);
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
return stack;
}
@Override
public LiquidStack drain (int maxDrain, boolean doDrain) //Doesn't actually drain
@ -147,9 +162,9 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank, IT
@Override
public int fill (ForgeDirection from, LiquidStack resource, boolean doFill)
{
if (from == ForgeDirection.UP)
//if (from == ForgeDirection.UP)
return fill(0, resource, doFill);
return 0;
//return 0;
}
@Override
@ -268,4 +283,29 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank, IT
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
}
@Override
public int[] getSizeInventorySide (int var1)
{
return new int[] {1, 1, 1, 1, 1, 1, 1};
}
@Override
public boolean func_102007_a (int i, ItemStack itemstack, int j)
{
if (j == 0)
return false;
else
return true;
}
@Override
public boolean func_102008_b (int i, ItemStack itemstack, int j)
{
/*if (j == 0)
return false;
else
return true;*/
return true;
}
}

View File

@ -0,0 +1,100 @@
package mods.tinker.tconstruct.modifiers;
import mods.tinker.common.ToolMod;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class ModAttack extends ToolMod
{
String tooltipName;
int increase;
int max = 72;
String guiType;
public ModAttack(String type, ItemStack[] items, int effect, int inc)
{
super(items, effect, "ModAttack");
tooltipName = "\u00a7fSharpness";
guiType = type;
increase = inc;
}
@Override
protected boolean canModify (ItemStack tool, ItemStack[] input)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
if (!tags.hasKey(key))
return tags.getInteger("Modifiers") > 0;
int keyPair[] = tags.getIntArray(key);
if (keyPair[0] + increase <= keyPair[1])
return true;
else if (keyPair[0] == keyPair[1])
return tags.getInteger("Modifiers") > 0;
else
return false;
}
@Override
public void modify (ItemStack[] input, ItemStack tool)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
if (tags.hasKey(key))
{
int[] keyPair = tags.getIntArray(key);
int leftToBoost = 36 - (keyPair[0] % 36);
if (increase >= leftToBoost)
{
int attack = tags.getInteger("Attack");
attack += 1;
tags.setInteger("Attack", attack);
}
if (keyPair[0] % max == 0)
{
keyPair[0] += increase;
keyPair[1] += max;
tags.setIntArray(key, keyPair);
int modifiers = tags.getInteger("Modifiers");
modifiers -= 1;
tags.setInteger("Modifiers", modifiers);
}
else
{
keyPair[0] += increase;
tags.setIntArray(key, keyPair);
}
updateModTag(tool, keyPair);
}
else
{
int modifiers = tags.getInteger("Modifiers");
modifiers -= 1;
tags.setInteger("Modifiers", modifiers);
String modName = "\u00a7f"+guiType+" ("+increase+"/"+max+")";
int tooltipIndex = addToolTip(tool, tooltipName, modName);
int[] keyPair = new int[] { increase, max, tooltipIndex };
tags.setIntArray(key, keyPair);
int attack = tags.getInteger("Attack");
attack += 1;
tags.setInteger("Attack", attack);
}
}
void updateModTag(ItemStack tool, int[] keys)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
String tip = "ModifierTip"+keys[2];
String modName = "\u00a7f"+guiType+" ("+keys[0]+"/"+keys[1]+")";
tags.setString(tip, modName);
}
}

View File

@ -41,7 +41,6 @@ public class ModBlaze extends ToolMod
@Override
public void modify (ItemStack[] input, ItemStack tool)
{
//System.out.println("Moood");
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
if (tags.hasKey(key))
{
@ -76,7 +75,6 @@ public class ModBlaze extends ToolMod
int fiery = tags.getInteger("Fiery");
fiery += (increase);
System.out.println("Fiery "+fiery);
tags.setInteger("Fiery", fiery);
}

View File

@ -1,7 +1,10 @@
package mods.tinker.tconstruct.modifiers;
import ic2.api.IElectricItem;
import java.util.ArrayList;
import mods.tinker.tconstruct.library.ToolCore;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@ -34,8 +37,14 @@ public class ModElectric extends ModBoolean
for (ItemStack stack : batteries)
{
if (stack.isItemEqual(input[0]) || stack.isItemEqual(input[1]))
battery = true;
if (stack.itemID == input[0].itemID && input[0].getItem() instanceof IElectricItem)
{
battery = true;
}
if (stack.itemID == input[1].itemID && input[1].getItem() instanceof IElectricItem)
{
battery = true;
}
}
return circuit && battery && canModify(tool, input);
}
@ -62,10 +71,16 @@ public class ModElectric extends ModBoolean
int modifiers = tags.getCompoundTag("InfiTool").getInteger("Modifiers");
modifiers -= 1;
tags.getCompoundTag("InfiTool").setInteger("Modifiers", modifiers);
tags.setInteger("charge", 0);
tags.setDouble("electricity", 0);
int charge = 0;
if (input[0].getItem() instanceof IElectricItem && input[0].hasTagCompound())
charge = input[0].getTagCompound().getInteger("charge");
if (input[1].getItem() instanceof IElectricItem && input[1].hasTagCompound())
charge = input[1].getTagCompound().getInteger("charge");
tags.setInteger("charge", charge);
tags.setInteger(key, 1);
addModifierTip(tool, "\u00a7eElectric");
ToolCore toolcore = (ToolCore) tool.getItem();
tool.setItemDamage(1 + (toolcore.getMaxCharge(tool) - charge) * (tool.getMaxDamage() - 1) / toolcore.getMaxCharge(tool));
}
}
}

View File

@ -0,0 +1,39 @@
package mods.tinker.tconstruct.modifiers;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import mods.tinker.common.ToolMod;
import mods.tinker.tconstruct.crafting.PatternBuilder;
public class ModExtraModifier extends ToolMod
{
public ModExtraModifier(ItemStack[] items, String dataKey)
{
super(items, 0, dataKey);
}
@Override
protected boolean canModify (ItemStack tool, ItemStack[] input)
{
if ((input[0] == null && input[1] == null) || (input[0] != null && input[1] != null)) //Only valid for one itemstack
return false;
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
if (tags.getBoolean(key))
{
return false;
}
return true;
}
@Override
public void modify (ItemStack[] input, ItemStack tool)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
tags.setBoolean(key, true);
int modifiers = tags.getInteger("Modifiers");
tags.setInteger("Modifiers", modifiers + 1);
}
}

View File

@ -43,34 +43,7 @@ public class ModLapis extends ToolMod
public void modify (ItemStack[] input, ItemStack tool)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
if (tags.hasKey(key))
{
int keyPair[] = tags.getIntArray(key);
keyPair[0] += increase;
tags.setIntArray(key, keyPair);
if (tool.getItem() instanceof Weapon)
{
if (keyPair[0] >= 100)
addEnchantment(tool, Enchantment.looting, 3);
else if (keyPair[0] >= 50)
addEnchantment(tool, Enchantment.looting, 2);
else if (keyPair[0] >= 20)
addEnchantment(tool, Enchantment.looting, 1);
}
else
{
if (keyPair[0] >= 100)
addEnchantment(tool, Enchantment.fortune, 3);
else if (keyPair[0] >= 50)
addEnchantment(tool, Enchantment.fortune, 2);
else if (keyPair[0] >= 20)
addEnchantment(tool, Enchantment.fortune, 1);
}
updateModTag(tool, keyPair);
}
else
if (!tags.hasKey(key))
{
tags.setBoolean(key, true);
@ -83,6 +56,30 @@ public class ModLapis extends ToolMod
modifiers -= 1;
tags.setInteger("Modifiers", modifiers);
}
int keyPair[] = tags.getIntArray(key);
keyPair[0] += increase;
tags.setIntArray(key, keyPair);
if (tool.getItem() instanceof Weapon)
{
if (keyPair[0] >= 100)
addEnchantment(tool, Enchantment.looting, 3);
else if (keyPair[0] >= 50)
addEnchantment(tool, Enchantment.looting, 2);
else if (keyPair[0] >= 20)
addEnchantment(tool, Enchantment.looting, 1);
}
else
{
if (keyPair[0] >= 100)
addEnchantment(tool, Enchantment.fortune, 3);
else if (keyPair[0] >= 50)
addEnchantment(tool, Enchantment.fortune, 2);
else if (keyPair[0] >= 20)
addEnchantment(tool, Enchantment.fortune, 1);
}
updateModTag(tool, keyPair);
}
public void addEnchantment(ItemStack tool, Enchantment enchant, int level)

View File

@ -1,41 +0,0 @@
package mods.tinker.tconstruct.modifiers;
import mods.tinker.common.ToolMod;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
/* Little mod for actually adding the lapis modifier */
public class ModLapisBase extends ToolMod
{
public ModLapisBase(ItemStack[] items, int effect)
{
super(items, effect, "Lapis");
}
@Override
protected boolean canModify (ItemStack tool, ItemStack[] input)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
if (!tags.hasKey(key))
return tags.getInteger("Modifiers") > 0;
return false;
}
@Override
public void modify (ItemStack[] input, ItemStack tool)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
tags.setBoolean(key, true);
String modName = "\u00a79Lapis (0/100)";
int tooltipIndex = addToolTip(tool, "\u00a79Luck", modName);
int[] keyPair = new int[] { 0, tooltipIndex };
tags.setIntArray(key, keyPair);
int modifiers = tags.getInteger("Modifiers");
modifiers -= 1;
tags.setInteger("Modifiers", modifiers);
}
}

View File

@ -1,113 +0,0 @@
package mods.tinker.tconstruct.modifiers;
import java.util.Iterator;
import java.util.Map;
import mods.tinker.common.ToolMod;
import mods.tinker.tconstruct.library.Weapon;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
public class ModLapisIncrease extends ToolMod
{
int increase;
public ModLapisIncrease(ItemStack[] items, int effect, int inc)
{
super(items, effect, "Lapis");
increase = inc;
}
@Override
protected boolean canModify (ItemStack tool, ItemStack[] input)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
if (!tags.hasKey(key))
return false;
int keyPair[] = tags.getIntArray(key);
if (keyPair[0] + increase <= 100)
return true;
else
return false;
}
@Override
public void modify (ItemStack[] input, ItemStack tool)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
int keyPair[] = tags.getIntArray(key);
keyPair[0] += increase;
tags.setIntArray(key, keyPair);
if (tool.getItem() instanceof Weapon)
{
if (keyPair[0] >= 100)
addEnchantment(tool, Enchantment.looting, 3);
else if (keyPair[0] >= 40)
addEnchantment(tool, Enchantment.looting, 2);
else if (keyPair[0] >= 10)
addEnchantment(tool, Enchantment.looting, 1);
}
else
{
if (keyPair[0] >= 100)
addEnchantment(tool, Enchantment.fortune, 3);
else if (keyPair[0] >= 40)
addEnchantment(tool, Enchantment.fortune, 2);
else if (keyPair[0] >= 10)
addEnchantment(tool, Enchantment.fortune, 1);
}
updateModTag(tool, keyPair);
}
public void addEnchantment(ItemStack tool, Enchantment enchant, int level)
{
NBTTagList tags = new NBTTagList("ench");
Map enchantMap = EnchantmentHelper.getEnchantments(tool);
Iterator iterator = enchantMap.keySet().iterator();
int index;
int lvl;
boolean hasEnchant = false;
while (iterator.hasNext())
{
NBTTagCompound enchantTag = new NBTTagCompound();
index = ((Integer)iterator.next()).intValue();
lvl = (Integer) enchantMap.get(index);
if (index == enchant.effectId)
{
hasEnchant = true;
enchantTag.setShort("id", (short)index);
enchantTag.setShort("lvl", (short)((byte)level));
tags.appendTag(enchantTag);
}
else
{
enchantTag.setShort("id", (short)index);
enchantTag.setShort("lvl", (short)((byte)lvl));
tags.appendTag(enchantTag);
}
}
if (!hasEnchant)
{
NBTTagCompound enchantTag = new NBTTagCompound();
enchantTag.setShort("id", (short)enchant.effectId);
enchantTag.setShort("lvl", (short)((byte)level));
tags.appendTag(enchantTag);
}
tool.stackTagCompound.setTag("ench", tags);
}
void updateModTag (ItemStack tool, int[] keys)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
String tip = "ModifierTip"+keys[1];
String modName = "\u00a79Lapis ("+keys[0]+"/100)";
tags.setString(tip, modName);
}
}

View File

@ -0,0 +1,32 @@
package mods.tinker.tconstruct.modifiers;
import mods.tinker.common.ToolMod;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class ModPotion extends ToolMod
{
public ModPotion(ItemStack[] items, int effect, String dataKey)
{
super(new ItemStack[] { new ItemStack(Item.potion, 1, Short.MAX_VALUE) }, 0, "");
}
protected boolean canModify (ItemStack tool, ItemStack[] input)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
NBTTagCompound potion = tool.getTagCompound().getCompoundTag("Potion");
if (potion == null)
return true;
return false;
}
@Override
public void modify (ItemStack[] input, ItemStack tool)
{
}
}

View File

@ -45,7 +45,7 @@ public class ModRedstone extends ToolMod
if (tags.hasKey(key))
{
int[] keyPair = tags.getIntArray(key);
if (keyPair[0] == max)
if (keyPair[0] % max == 0)
{
keyPair[0] += increase;
keyPair[1] += max;

View File

@ -45,12 +45,12 @@ public class TPlayerHandler implements IPlayerTracker
stats.level = entityplayer.experienceLevel;
stats.health = 20; //More hp in the future
stats.hunger = entityplayer.getFoodStats().getFoodLevel();
stats.diary = tags.getCompoundTag("TConstruct").getBoolean("diary");
stats.stationManual = tags.getCompoundTag("TConstruct").getBoolean("stationManual");
stats.beginnerManual = tags.getCompoundTag("TConstruct").getBoolean("beginnerManual");
stats.materialManual = tags.getCompoundTag("TConstruct").getBoolean("materialManual");
stats.smelteryManual = tags.getCompoundTag("TConstruct").getBoolean("smelteryManual");
if (!stats.diary)
if (!stats.beginnerManual)
{
tags.getCompoundTag("TConstruct").setBoolean("diary", true);
tags.getCompoundTag("TConstruct").setBoolean("beginnerManual", true);
ItemStack diary = new ItemStack(TContent.manualBook);
if (!entityplayer.inventory.addItemStackToInventory(diary))
{
@ -87,8 +87,8 @@ public class TPlayerHandler implements IPlayerTracker
entityplayer.getFoodStats().addStats(-1*(20 - stats.hunger), 0);
NBTTagCompound tags = entityplayer.getEntityData();
NBTTagCompound tTag = new NBTTagCompound();
tTag.setBoolean("diary", stats.diary);
tTag.setBoolean("stationManual", stats.stationManual);
tTag.setBoolean("beginnerManual", stats.beginnerManual);
tTag.setBoolean("materialManual", stats.materialManual);
tTag.setBoolean("smelteryManual", stats.smelteryManual);
tags.setCompoundTag("TConstruct", tTag);

View File

@ -10,8 +10,8 @@ public class TPlayerStats
public int level;
public int health;
public int hunger;
public boolean diary;
public boolean stationManual;
public boolean beginnerManual;
public boolean materialManual;
public boolean smelteryManual;
//public boolean prevOnGround;

View File

@ -31,7 +31,7 @@ public class Pickaxe extends HarvestTool
return materials;
}
static Material[] materials = new Material[] { Material.rock, Material.iron, Material.ice, Material.glass, Material.piston, Material.anvil };
static Material[] materials = new Material[] { Material.rock, Material.iron, Material.ice, Material.glass, Material.piston, Material.anvil, Material.circuits };
@Override
protected Item getHeadItem ()

View File

@ -75,7 +75,7 @@ public class TBaseWorldGenerator
{
if (PHConstruct.generateCobalt)
{
xPos = xChunk + random.nextInt(16); yPos = random.nextInt(64); zPos = zChunk + random.nextInt(16);
xPos = xChunk + random.nextInt(16); yPos = random.nextInt(64)+32; zPos = zChunk + random.nextInt(16);
cobalt.generate(world, random, xPos, yPos, zPos);
}
if (PHConstruct.generateArdite)

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 504 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 B

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B