Bugfixes galore

This commit is contained in:
mDiyo 2013-04-15 11:04:52 -07:00
parent 31c54e3dee
commit 7847102fff
20 changed files with 756 additions and 495 deletions

View File

@ -48,6 +48,8 @@
<entry key="StorageMetals.Alumite.name">Block of Alumite</entry> <entry key="StorageMetals.Alumite.name">Block of Alumite</entry>
<entry key="StorageMetals.Steel.name">Block of Steel</entry> <entry key="StorageMetals.Steel.name">Block of Steel</entry>
<entry key="tile.decoration.stonetorch.name">Torch</entry>
<entry key="item.tconstruct.blankpattern.pattern.name">Blank Pattern</entry> <entry key="item.tconstruct.blankpattern.pattern.name">Blank Pattern</entry>
<entry key="item.tconstruct.blankpattern.cast.name">Blank Cast</entry> <entry key="item.tconstruct.blankpattern.cast.name">Blank Cast</entry>

View File

@ -231,8 +231,8 @@ Class: Lethal Joke Weapon</text>
<text>Some materials have abilities that augment their natural uses. <text>Some materials have abilities that augment their natural uses.
- Reinforced: 10% chance per level of not using durability - Reinforced: 10% chance per level of not using durability
- Shoddy: Mines faster and does less damage as the tool breaks - Stonebound: The tool mines faster as it wears out, but does less damage
- Spiny: Opposite of Shoddy - Spiny: The tool mines does more damage as it wears out, but mines slower
- Writable: One extra modifier per piece - Writable: One extra modifier per piece
- Awareness: Unknown</text> - Awareness: Unknown</text>
</page> </page>
@ -380,7 +380,7 @@ Class: Lethal Joke Weapon</text>
<page type="materialstats"> <page type="materialstats">
<title>Ardite</title> <title>Ardite</title>
<icon>arditelongsword</icon> <icon>arditelongsword</icon>
<text>One of the nether materials. It's rustic red.</text> <text>One of the nether materials. It seems to mine faster as it wears out.</text>
<material> <material>
<main>arditeingot</main> <main>arditeingot</main>
</material> </material>

View File

@ -21,9 +21,10 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
/** TConstruct, the tool mod. /** TConstruct, the tool mod.
* Craft your tools with style, then modify until the original is gone! * Craft your tools with style, then modify until the original is gone!
* @author: mDiyo * @author: mDiyo
* @dependencies: IC2 API, EBXL API
*/ */
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.2.29.1") @Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.2.29.4")
@NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.TPacketHandler.class) @NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.TPacketHandler.class)
public class TConstruct public class TConstruct
{ {

View File

@ -1,8 +1,5 @@
package mods.tinker.tconstruct; package mods.tinker.tconstruct;
import java.util.ArrayList;
import java.util.List;
import mods.tinker.common.IPattern; import mods.tinker.common.IPattern;
import mods.tinker.common.RecipeRemover; import mods.tinker.common.RecipeRemover;
import mods.tinker.common.fancyitem.FancyEntityItem; import mods.tinker.common.fancyitem.FancyEntityItem;
@ -24,6 +21,7 @@ import mods.tinker.tconstruct.entity.BlueSlime;
import mods.tinker.tconstruct.entity.Crystal; import mods.tinker.tconstruct.entity.Crystal;
import mods.tinker.tconstruct.entity.LaunchedPotion; import mods.tinker.tconstruct.entity.LaunchedPotion;
import mods.tinker.tconstruct.entity.NitroCreeper; import mods.tinker.tconstruct.entity.NitroCreeper;
import mods.tinker.tconstruct.entity.Skyla;
import mods.tinker.tconstruct.items.CraftedSoilItemBlock; import mods.tinker.tconstruct.items.CraftedSoilItemBlock;
import mods.tinker.tconstruct.items.CraftingItem; import mods.tinker.tconstruct.items.CraftingItem;
import mods.tinker.tconstruct.items.FilledBucket; import mods.tinker.tconstruct.items.FilledBucket;
@ -211,7 +209,7 @@ public class TContent implements IFuelHandler
//EntityRegistry.registerModEntity(Crystal.class, "Crystal", 2, TConstruct.instance, 32, 5, true); //EntityRegistry.registerModEntity(Crystal.class, "Crystal", 2, TConstruct.instance, 32, 5, true);
EntityRegistry.registerModEntity(Crystal.class, "Crystal", 2, TConstruct.instance, 32, 5, true); EntityRegistry.registerModEntity(Crystal.class, "Crystal", 2, TConstruct.instance, 32, 5, true);
//EntityRegistry.registerModEntity(Skyla.class, "Skyla", 10, TConstruct.instance, 32, 5, true); EntityRegistry.registerModEntity(Skyla.class, "Skyla", 10, TConstruct.instance, 32, 5, true);
EntityRegistry.registerModEntity(NitroCreeper.class, "UnstableCreeper", 11, TConstruct.instance, 64, 5, true); EntityRegistry.registerModEntity(NitroCreeper.class, "UnstableCreeper", 11, TConstruct.instance, 64, 5, true);
EntityRegistry.registerModEntity(BlueSlime.class, "EdibleSlime", 12, TConstruct.instance, 64, 5, true); EntityRegistry.registerModEntity(BlueSlime.class, "EdibleSlime", 12, TConstruct.instance, 64, 5, true);
//EntityRegistry.registerModEntity(MetalSlime.class, "MetalSlime", 13, TConstruct.instance, 64, 5, true); //EntityRegistry.registerModEntity(MetalSlime.class, "MetalSlime", 13, TConstruct.instance, 64, 5, true);
@ -371,18 +369,18 @@ public class TContent implements IFuelHandler
void registerMaterials () void registerMaterials ()
{ {
TConstructRegistry.addToolMaterial(0, "Wood", 1, 0, 59, 200, 0, 1.0F, 0, 0f, "\u00A7e", ""); TConstructRegistry.addToolMaterial(0, "Wood", 1, 0, 59, 200, 0, 1.0F, 0, 0f, "\u00A7e", "");
TConstructRegistry.addToolMaterial(1, "Stone", 1, 1, 131, 400, 1, 0.5F, 0, 1f, "", "Shoddy"); TConstructRegistry.addToolMaterial(1, "Stone", 1, 1, 131, 400, 1, 0.5F, 0, 1f, "", "Stonebound");
TConstructRegistry.addToolMaterial(2, "Iron", 1, 2, 250, 600, 2, 1.3F, 1, 0f, "\u00A7f", ""); TConstructRegistry.addToolMaterial(2, "Iron", 1, 2, 250, 600, 2, 1.3F, 1, 0f, "\u00A7f", "");
TConstructRegistry.addToolMaterial(3, "Flint", 1, 1, 171, 525, 2, 0.7F, 0, 1f, "\u00A78", "Shoddy"); TConstructRegistry.addToolMaterial(3, "Flint", 1, 1, 171, 525, 2, 0.7F, 0, 1f, "\u00A78", "Stonebound");
TConstructRegistry.addToolMaterial(4, "Cactus", 1, 1, 150, 500, 2, 1.0F, 0, -1f, "\u00A72", "Spiny"); TConstructRegistry.addToolMaterial(4, "Cactus", 1, 1, 150, 500, 2, 1.0F, 0, -1f, "\u00A72", "Spiny");
TConstructRegistry.addToolMaterial(5, "Bone", 1, 1, 200, 400, 1, 1.0F, 0, 0f, "\u00A7e", ""); TConstructRegistry.addToolMaterial(5, "Bone", 1, 1, 200, 400, 1, 1.0F, 0, 0f, "\u00A7e", "");
TConstructRegistry.addToolMaterial(6, "Obsidian", 1, 3, 89, 700, 2, 0.8F, 3, 0f, "\u00A7d", ""); TConstructRegistry.addToolMaterial(6, "Obsidian", 1, 3, 89, 700, 2, 0.8F, 3, 0f, "\u00A7d", "");
TConstructRegistry.addToolMaterial(7, "Netherrack", 1, 2, 131, 400, 1, 1.2F, 0, 1f, "\u00A74", "Shoddy"); TConstructRegistry.addToolMaterial(7, "Netherrack", 1, 2, 131, 400, 1, 1.2F, 0, 1f, "\u00A74", "Stonebound");
TConstructRegistry.addToolMaterial(8, "Slime", 1, 3, 1500, 150, 0, 5.0F, 0, 0f, "\u00A7a", ""); TConstructRegistry.addToolMaterial(8, "Slime", 1, 3, 1500, 150, 0, 5.0F, 0, 0f, "\u00A7a", "");
TConstructRegistry.addToolMaterial(9, "Paper", 1, 0, 30, 200, 0, 0.3F, 0, 0f, "\u00A7f", "Writable"); TConstructRegistry.addToolMaterial(9, "Paper", 1, 0, 30, 200, 0, 0.3F, 0, 0f, "\u00A7f", "Writable");
TConstructRegistry.addToolMaterial(10, "Cobalt", 2, 4, 800, 800, 3, 1.75F, 2, 0f, "\u00A73", ""); TConstructRegistry.addToolMaterial(10, "Cobalt", 2, 4, 800, 1100, 3, 1.75F, 2, 0f, "\u00A73", "");
TConstructRegistry.addToolMaterial(11, "Ardite", 2, 4, 600, 800, 3, 2.0F, 0, 0f, "\u00A74", ""); TConstructRegistry.addToolMaterial(11, "Ardite", 2, 4, 600, 800, 3, 2.0F, 0, 3f, "\u00A74", "Stonebound");
TConstructRegistry.addToolMaterial(12, "Manyullyn", 2, 5, 1200, 1000, 4, 2.5F, 0, 0f, "\u00A75", "Awareness"); TConstructRegistry.addToolMaterial(12, "Manyullyn", 2, 5, 1200, 900, 4, 2.5F, 0, 0f, "\u00A75", "");
TConstructRegistry.addToolMaterial(13, "Copper", 1, 1, 180, 500, 2, 1.15F, 0, 0f, "\u00A7c", ""); TConstructRegistry.addToolMaterial(13, "Copper", 1, 1, 180, 500, 2, 1.15F, 0, 0f, "\u00A7c", "");
TConstructRegistry.addToolMaterial(14, "Bronze", 1, 2, 350, 700, 2, 1.3F, 1, 0f, "\u00A76", ""); TConstructRegistry.addToolMaterial(14, "Bronze", 1, 2, 350, 700, 2, 1.3F, 1, 0f, "\u00A76", "");
TConstructRegistry.addToolMaterial(15, "Alumite", 2, 4, 550, 800, 3, 1.3F, 2, 0f, "\u00A7d", ""); TConstructRegistry.addToolMaterial(15, "Alumite", 2, 4, 550, 800, 3, 1.3F, 2, 0f, "\u00A7d", "");
@ -657,8 +655,12 @@ public class TContent implements IFuelHandler
GameRegistry.addRecipe(new ItemStack(manualBook), "wp", 'w', new ItemStack(blankPattern, 1, 0), 'p', Item.paper); GameRegistry.addRecipe(new ItemStack(manualBook), "wp", 'w', new ItemStack(blankPattern, 1, 0), 'p', Item.paper);
GameRegistry.addRecipe(new ItemStack(materials, 1, 0), "pp", "pp", 'p', Item.paper); //Paper stack GameRegistry.addRecipe(new ItemStack(materials, 1, 0), "pp", "pp", 'p', Item.paper); //Paper stack
GameRegistry.addRecipe(new ItemStack(materials, 1, 6), "ppp", "ppp", "ppp", 'p', Block.cobblestoneMossy); //Moss ball OreDictionary.registerOre("mossystone", new ItemStack(Block.stoneBrick, 1, 1));
GameRegistry.addRecipe(new ItemStack(materials, 1, 7), "xcx", "cbc", "xcx", 'b', Item.bucketLava, 'c', Item.coal, 'x', Block.netherrack); //Auto-smelt OreDictionary.registerOre("mossystone", new ItemStack(Block.cobblestoneMossy));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(materials, 1, 6), "ppp", "ppp", "ppp", 'p', "mossystone")); //Moss ball
GameRegistry.addRecipe(new ItemStack(materials, 1, 6), "ppp", "ppp", "ppp", 'p', new ItemStack(Block.stoneBrick, 1, 1)); //Moss ball
GameRegistry.addRecipe(new ItemStack(materials, 1, 7), "xcx", "cbc", "xcx", 'b', Item.bucketLava, 'c', Item.fireballCharge, 'x', Item.blazeRod); //Auto-smelt
GameRegistry.addRecipe(new ItemStack(materials, 1, 7), "xcx", "cbc", "xcx", 'b', Item.bucketLava, 'x', Item.fireballCharge, 'c', Item.blazeRod); //Auto-smelt
//GameRegistry.addShapelessRecipe(new ItemStack(materials, 1, 8), Item.bone, Item.rottenFlesh, Item.chickenRaw, Item.beefRaw, Item.porkRaw, Item.fishRaw); //Necrotic bone //GameRegistry.addShapelessRecipe(new ItemStack(materials, 1, 8), Item.bone, Item.rottenFlesh, Item.chickenRaw, Item.beefRaw, Item.porkRaw, Item.fishRaw); //Necrotic bone
GameRegistry.addShapelessRecipe(new ItemStack(craftedSoil, 1, 0), Item.slimeBall, Item.slimeBall, Item.slimeBall, Item.slimeBall, Block.sand, Block.dirt); //Slimy sand GameRegistry.addShapelessRecipe(new ItemStack(craftedSoil, 1, 0), Item.slimeBall, Item.slimeBall, Item.slimeBall, Item.slimeBall, Block.sand, Block.dirt); //Slimy sand
GameRegistry.addShapelessRecipe(new ItemStack(craftedSoil, 1, 2), strangeFood, strangeFood, strangeFood, strangeFood, Block.sand, Block.dirt); //Slimy sand GameRegistry.addShapelessRecipe(new ItemStack(craftedSoil, 1, 2), strangeFood, strangeFood, strangeFood, strangeFood, Block.sand, Block.dirt); //Slimy sand

View File

@ -1,25 +1,10 @@
package mods.tinker.tconstruct; package mods.tinker.tconstruct;
import java.util.WeakHashMap;
import mods.tinker.common.InventoryLogic; import mods.tinker.common.InventoryLogic;
import mods.tinker.tconstruct.client.TProxyClient; import mods.tinker.tconstruct.client.*;
import mods.tinker.tconstruct.client.gui.FrypanGui; import mods.tinker.tconstruct.client.gui.*;
import mods.tinker.tconstruct.client.gui.GuiManual; import mods.tinker.tconstruct.logic.*;
import mods.tinker.tconstruct.client.gui.PartCrafterGui;
import mods.tinker.tconstruct.client.gui.PatternChestGui;
import mods.tinker.tconstruct.client.gui.PatternShaperGui;
import mods.tinker.tconstruct.client.gui.SmelteryGui;
import mods.tinker.tconstruct.client.gui.ToolStationGui;
import mods.tinker.tconstruct.container.SmelteryContainer;
import mods.tinker.tconstruct.logic.FrypanLogic;
import mods.tinker.tconstruct.logic.PartCrafterLogic;
import mods.tinker.tconstruct.logic.PatternChestLogic;
import mods.tinker.tconstruct.logic.PatternShaperLogic;
import mods.tinker.tconstruct.logic.SmelteryLogic;
import mods.tinker.tconstruct.logic.ToolStationLogic;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -36,8 +21,6 @@ public class TGuiHandler implements IGuiHandler
public static int smeltery = 7; public static int smeltery = 7;
public static int manualGui = -1; public static int manualGui = -1;
public static WeakHashMap<String, Container> openContainers = new WeakHashMap<String, Container>();
@Override @Override
public Object getServerGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z) public Object getServerGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
{ {
@ -47,12 +30,7 @@ public class TGuiHandler implements IGuiHandler
TileEntity tile = world.getBlockTileEntity(x, y, z); TileEntity tile = world.getBlockTileEntity(x, y, z);
if (tile != null && tile instanceof InventoryLogic) if (tile != null && tile instanceof InventoryLogic)
{ {
Object o = ((InventoryLogic) tile).getGuiContainer(player.inventory, world, x, y, z); return ((InventoryLogic) tile).getGuiContainer(player.inventory, world, x, y, z);
if (o instanceof SmelteryContainer)
{
openContainers.put(player.username, (Container) o);
}
return o;
} }
return null; return null;
} }

View File

@ -29,7 +29,6 @@ public class TPacketHandler implements IPacketHandler
if (packet.channel.equals("TConstruct")) if (packet.channel.equals("TConstruct"))
{ {
//System.out.println("Recieved a packet for TConstruct");
if (side == Side.SERVER) if (side == Side.SERVER)
handleServerPacket(packet); handleServerPacket(packet);
else else
@ -39,7 +38,6 @@ public class TPacketHandler implements IPacketHandler
void handleClientPacket (Packet250CustomPayload packet) void handleClientPacket (Packet250CustomPayload packet)
{ {
//System.out.println("Handling client packet");
DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(packet.data)); DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(packet.data));
byte packetType; byte packetType;
@ -63,11 +61,8 @@ public class TPacketHandler implements IPacketHandler
void handleServerPacket (Packet250CustomPayload packet) void handleServerPacket (Packet250CustomPayload packet)
{ {
//System.out.println("Handling server packet");
DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(packet.data)); DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(packet.data));
//byte packetType;
//int dimension;
byte packetID; byte packetID;
try try
@ -105,19 +100,10 @@ public class TPacketHandler implements IPacketHandler
((InventoryLogic) te).setInventorySlotContents(1, new ItemStack(itemID, 1, itemDamage)); ((InventoryLogic) te).setInventorySlotContents(1, new ItemStack(itemID, 1, itemDamage));
} }
} }
else if (packetID == 3) //Smeltery
{
int rowPos = inputStream.readInt();
String user = inputStream.readUTF();
SmelteryContainer container = (SmelteryContainer) TGuiHandler.openContainers.get(user);
//System.out.println("Recieved a scroll packet for row "+rowPos);
container.updateRows(rowPos);
}
else if (packetID == 10) //Double jump else if (packetID == 10) //Double jump
{ {
String user = inputStream.readUTF(); String user = inputStream.readUTF();
//EntityPlayer player = FMLCommonHandler.instance().getSidedDelegate().getServer().getConfigurationManager().getPlayerForUsername(user);
EntityPlayer player = TConstruct.playerTracker.getEntityPlayer(user); EntityPlayer player = TConstruct.playerTracker.getEntityPlayer(user);
player.fallDistance = 0; player.fallDistance = 0;
} }

View File

@ -93,6 +93,7 @@ public class TProxyClient extends TProxyCommon
/* Registers any rendering code. */ /* Registers any rendering code. */
public void registerRenderer () public void registerRenderer ()
{ {
//TickRegistry.registerTickHandler(new TTickHandler(), Side.CLIENT);
Minecraft mc = Minecraft.getMinecraft(); Minecraft mc = Minecraft.getMinecraft();
smallFontRenderer = new SmallFontRenderer(mc.gameSettings, "/font/default.png", mc.renderEngine, false); smallFontRenderer = new SmallFontRenderer(mc.gameSettings, "/font/default.png", mc.renderEngine, false);
RenderingRegistry.registerBlockHandler(new TableRender()); RenderingRegistry.registerBlockHandler(new TableRender());
@ -264,19 +265,21 @@ public class TProxyClient extends TProxyCommon
ItemStack paper = new ItemStack(Item.paper); ItemStack paper = new ItemStack(Item.paper);
ItemStack slimeball = new ItemStack(Item.slimeBall); ItemStack slimeball = new ItemStack(Item.slimeBall);
ItemStack slimyMud = new ItemStack(TContent.craftedSoil); ItemStack slimyMud = new ItemStack(TContent.craftedSoil);
ItemStack blazerod = new ItemStack(Item.blazeRod);
ItemStack firecharge = new ItemStack(Item.fireballCharge);
//TConstruct recipes //TConstruct recipes
TConstructClientRegistry.registerManualSmallRecipe("blankpattern", pattern, plank, stick, stick, plank); TConstructClientRegistry.registerManualSmallRecipe("blankpattern", pattern, plank, stick, stick, plank);
TConstructClientRegistry.registerManualSmallRecipe("toolstation", new ItemStack(TContent.toolStationWood, 1, 0), null, pattern, null, workbench); 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("partcrafter", new ItemStack(TContent.toolStationWood, 1, 1), null, pattern, null, log);
TConstructClientRegistry.registerManualSmallRecipe("patternchest", new ItemStack(TContent.toolStationWood, 1, 5), null, pattern, null, chest); 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("stenciltable", new ItemStack(TContent.toolStationWood, 1, 10), null, pattern, null, plank);
TConstructClientRegistry.registerManualLargeRecipe("slimymud", slimyMud, null, slimeball, slimeball, null, slimeball, slimeball, null, dirt, sand); TConstructClientRegistry.registerManualLargeRecipe("slimymud", slimyMud, null, slimeball, slimeball, null, slimeball, slimeball, null, dirt, sand);
TConstructClientRegistry.registerManualFurnaceRecipe("slimecrystal", new ItemStack(TContent.materials, 1, 1), slimyMud); TConstructClientRegistry.registerManualFurnaceRecipe("slimecrystal", new ItemStack(TContent.materials, 1, 1), slimyMud);
TConstructClientRegistry.registerManualSmallRecipe("paperstack", new ItemStack(TContent.materials, 1, 0), paper, paper, paper, paper); TConstructClientRegistry.registerManualSmallRecipe("paperstack", new ItemStack(TContent.materials, 1, 0), paper, paper, paper, paper);
TConstructClientRegistry.registerManualLargeRecipe("mossball", new ItemStack(TContent.materials, 1, 6), mossycobble, mossycobble, mossycobble, mossycobble, mossycobble, mossycobble, mossycobble, mossycobble, mossycobble); TConstructClientRegistry.registerManualLargeRecipe("mossball", new ItemStack(TContent.materials, 1, 6), mossycobble, mossycobble, mossycobble, mossycobble, mossycobble, mossycobble, mossycobble, mossycobble, mossycobble);
TConstructClientRegistry.registerManualLargeRecipe("lavacrystal", new ItemStack(TContent.materials, 1, 7), netherrack, coal, netherrack, coal, new ItemStack(Item.bucketLava), coal, netherrack, coal, netherrack); TConstructClientRegistry.registerManualLargeRecipe("lavacrystal", new ItemStack(TContent.materials, 1, 7), blazerod, firecharge, blazerod, firecharge, new ItemStack(Item.bucketLava), firecharge, blazerod, firecharge, blazerod);
TConstructClientRegistry.registerManualSmallRecipe("grout", grout, sand, gravel, null, clay); TConstructClientRegistry.registerManualSmallRecipe("grout", grout, sand, gravel, null, clay);
TConstructClientRegistry.registerManualFurnaceRecipe("searedbrick", searedbrick, grout); TConstructClientRegistry.registerManualFurnaceRecipe("searedbrick", searedbrick, grout);

View File

@ -0,0 +1,102 @@
package mods.tinker.tconstruct.client;
import java.util.EnumSet;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.player.EntityPlayer;
import cpw.mods.fml.common.ITickHandler;
import cpw.mods.fml.common.TickType;
public class TTickHandler implements ITickHandler
{
Minecraft mc = Minecraft.getMinecraft();
EntityPlayer player;
int zLevel = 0;
@Override
public void tickStart (EnumSet<TickType> type, Object... tickData) { }
@Override
public void tickEnd (EnumSet<TickType> type, Object... tickData)
{
player = mc.thePlayer;
if (player == null || player.capabilities.isCreativeMode)
return;
this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/newhearts.png");
int hp = player.getHealth();
for (int iter = 0; iter < hp / 20; iter++)
{
int renderHearts = (hp - 20*(iter+1)) / 2;
if (renderHearts > 10)
renderHearts = 10;
for (int i = 0; i < renderHearts; i++)
{
this.drawTexturedModalRect(122 + 8*i, 201, 0 + 18*iter, 0, 8, 8);
}
if (hp % 2 == 1 && renderHearts < 10)
{
this.drawTexturedModalRect(122 + 8*renderHearts, 201, 9 + 18*iter, 0, 8, 8);
}
}
/*int renderHearts = (hp - 20) / 2;
if (renderHearts > 10)
renderHearts = 10;
for (int i = 0; i < renderHearts; i++)
{
this.drawTexturedModalRect(122 + 8*i, 201, 0, 0, 8, 8);
}
renderHearts = (hp - 40) / 2;
if (renderHearts > 10)
renderHearts = 10;
for (int i = 0; i < renderHearts; i++)
{
this.drawTexturedModalRect(122 + 8*i, 201, 18, 0, 8, 8);
}
renderHearts = (hp - 60) / 2;
if (renderHearts > 10)
renderHearts = 10;
for (int i = 0; i < renderHearts; i++)
{
this.drawTexturedModalRect(122 + 8*i, 201, 36, 0, 8, 8);
}
renderHearts = (hp - 80) / 2;
if (renderHearts > 10)
renderHearts = 10;
for (int i = 0; i < renderHearts; i++)
{
this.drawTexturedModalRect(122 + 8*i, 201, 54, 0, 8, 8);
}*/
//this.drawTexturedModalRect(178, 201, 9, 0, 8, 8);
}
@Override
public EnumSet<TickType> ticks ()
{
return EnumSet.of(TickType.RENDER);
//return EnumSet.of(TickType.PLAYER);
}
@Override
public String getLabel ()
{
return "Gui Overlay";
}
public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6)
{
float f = 0.00390625F;
float f1 = 0.00390625F;
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV((double)(par1 + 0), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + 0) * f), (double)((float)(par4 + par6) * f1));
tessellator.addVertexWithUV((double)(par1 + par5), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + par5) * f), (double)((float)(par4 + par6) * f1));
tessellator.addVertexWithUV((double)(par1 + par5), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + par5) * f), (double)((float)(par4 + 0) * f1));
tessellator.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + 0) * f), (double)((float)(par4 + 0) * f1));
tessellator.draw();
}
}

View File

@ -97,9 +97,18 @@ public class GuiManual extends GuiScreen
} }
void updateText () //TODO: OOP this, see BookPage void updateText () //TODO: OOP this, see BookPage
{
System.out.println("maxPages: "+maxPages);
if (maxPages % 2 == 1)
{
if (currentPage > maxPages)
currentPage = maxPages;
}
else
{ {
if (currentPage >= maxPages) if (currentPage >= maxPages)
currentPage = maxPages - 2; currentPage = maxPages - 2;
}
if (currentPage % 2 == 1) if (currentPage % 2 == 1)
currentPage--; currentPage--;
if (currentPage < 0) if (currentPage < 0)
@ -628,6 +637,7 @@ public class GuiManual extends GuiScreen
this.fontRenderer.drawString("\u00a7n" + info, localWidth + 25 + fontRenderer.getStringWidth(info) / 2, localHeight + 4, 0); this.fontRenderer.drawString("\u00a7n" + info, localWidth + 25 + fontRenderer.getStringWidth(info) / 2, localHeight + 4, 0);
GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderHelper.enableGUIStandardItemLighting(); RenderHelper.enableGUIStandardItemLighting();
renderitem.zLevel = 100;
for (int i = 0; i < icons.length; i++) for (int i = 0; i < icons.length; i++)
{ {
renderitem.renderItemIntoGUI(fontRenderer, mc.renderEngine, icons[i], localWidth + 16, localHeight + 18 * i + 18); renderitem.renderItemIntoGUI(fontRenderer, mc.renderEngine, icons[i], localWidth + 16, localHeight + 18 * i + 18);
@ -636,6 +646,7 @@ public class GuiManual extends GuiScreen
yOffset = 13; yOffset = 13;
this.fontRenderer.drawString(multiText[i], localWidth + 38, localHeight + 18 * i + yOffset, 0); this.fontRenderer.drawString(multiText[i], localWidth + 38, localHeight + 18 * i + yOffset, 0);
} }
renderitem.zLevel = 0;
RenderHelper.disableStandardItemLighting(); RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glDisable(GL12.GL_RESCALE_NORMAL);
} }
@ -645,6 +656,7 @@ public class GuiManual extends GuiScreen
this.fontRenderer.drawSplitString(info, localWidth, localHeight, 178, 0); this.fontRenderer.drawSplitString(info, localWidth, localHeight, 178, 0);
GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderHelper.enableGUIStandardItemLighting(); RenderHelper.enableGUIStandardItemLighting();
renderitem.zLevel = 100;
for (int i = 0; i < icons.length; i++) for (int i = 0; i < icons.length; i++)
{ {
renderitem.renderItemIntoGUI(fontRenderer, mc.renderEngine, icons[i], localWidth + 8, localHeight + 18 * i + 36); renderitem.renderItemIntoGUI(fontRenderer, mc.renderEngine, icons[i], localWidth + 8, localHeight + 18 * i + 36);
@ -653,6 +665,7 @@ public class GuiManual extends GuiScreen
yOffset = 34; yOffset = 34;
this.fontRenderer.drawSplitString(multiText[i], localWidth + 30, localHeight + 18 * i + yOffset, 140, 0); this.fontRenderer.drawSplitString(multiText[i], localWidth + 30, localHeight + 18 * i + yOffset, 140, 0);
} }
renderitem.zLevel = 0;
RenderHelper.disableStandardItemLighting(); RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glDisable(GL12.GL_RESCALE_NORMAL);
} }
@ -685,6 +698,7 @@ public class GuiManual extends GuiScreen
GL11.glScalef(2f, 2f, 2f); GL11.glScalef(2f, 2f, 2f);
GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderHelper.enableGUIStandardItemLighting(); RenderHelper.enableGUIStandardItemLighting();
renderitem.zLevel = 100;
if (recipeSize == 2) if (recipeSize == 2)
{ {
@ -710,6 +724,7 @@ public class GuiManual extends GuiScreen
} }
} }
renderitem.zLevel = 0;
GL11.glScalef(0.5F, 0.5F, 0.5F); GL11.glScalef(0.5F, 0.5F, 0.5F);
RenderHelper.disableStandardItemLighting(); RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glDisable(GL12.GL_RESCALE_NORMAL);
@ -729,6 +744,7 @@ public class GuiManual extends GuiScreen
GL11.glScalef(2f, 2f, 2f); GL11.glScalef(2f, 2f, 2f);
GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderHelper.enableGUIStandardItemLighting(); RenderHelper.enableGUIStandardItemLighting();
renderitem.zLevel = 100;
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, TConstructClientRegistry.getManualIcon("coal"), (localWidth + 38) / 2, (localHeight + 110) / 2); 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[0], (localWidth + 106) / 2, (localHeight + 74) / 2);
@ -737,6 +753,7 @@ public class GuiManual extends GuiScreen
if (icons[0].stackSize > 1) if (icons[0].stackSize > 1)
renderitem.renderItemStack(fontRenderer, mc.renderEngine, icons[0], (localWidth + 106) / 2, (localHeight + 74) / 2, String.valueOf(icons[0].stackSize)); renderitem.renderItemStack(fontRenderer, mc.renderEngine, icons[0], (localWidth + 106) / 2, (localHeight + 74) / 2, String.valueOf(icons[0].stackSize));
renderitem.zLevel = 0;
GL11.glScalef(0.5F, 0.5F, 0.5F); GL11.glScalef(0.5F, 0.5F, 0.5F);
RenderHelper.disableStandardItemLighting(); RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glDisable(GL12.GL_RESCALE_NORMAL);
@ -759,11 +776,13 @@ public class GuiManual extends GuiScreen
if (type.equals("weapon")) if (type.equals("weapon"))
toolstack = TConstructClientRegistry.getManualIcon("ironlongsword"); toolstack = TConstructClientRegistry.getManualIcon("ironlongsword");
renderitem.zLevel = 100;
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, toolstack, (localWidth + 54) / 2, (localHeight + 54) / 2); renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, toolstack, (localWidth + 54) / 2, (localHeight + 54) / 2);
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[0], (localWidth + 130) / 2, (localHeight + 54) / 2); renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[0], (localWidth + 130) / 2, (localHeight + 54) / 2);
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[1], (localWidth + 18) / 2, (localHeight + 36) / 2); renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[1], (localWidth + 18) / 2, (localHeight + 36) / 2);
if (icons[2] != null) if (icons[2] != null)
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[2], (localWidth + 18) / 2, (localHeight + 74) / 2); renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[2], (localWidth + 18) / 2, (localHeight + 74) / 2);
renderitem.zLevel = 0;
GL11.glScalef(0.5F, 0.5F, 0.5F); GL11.glScalef(0.5F, 0.5F, 0.5F);
RenderHelper.disableStandardItemLighting(); RenderHelper.disableStandardItemLighting();
@ -781,10 +800,12 @@ public class GuiManual extends GuiScreen
GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderHelper.enableGUIStandardItemLighting(); RenderHelper.enableGUIStandardItemLighting();
renderitem.zLevel = 100;
//renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[0], localWidth + 50, localHeight + 0); //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[1], localWidth + 108, localHeight + 50);
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[2], localWidth + 108, localHeight + 82); renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[2], localWidth + 108, localHeight + 82);
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[3], localWidth + 108, localHeight + 114); renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[3], localWidth + 108, localHeight + 114);
renderitem.zLevel = 0;
RenderHelper.disableStandardItemLighting(); RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glDisable(GL12.GL_RESCALE_NORMAL);
@ -825,12 +846,12 @@ public class GuiManual extends GuiScreen
if (material.shoddy() > 0) if (material.shoddy() > 0)
{ {
this.fontRenderer.drawString("Shoddy level: " + material.shoddy(), localWidth, localHeight + 120 + 10 * offset, 0); this.fontRenderer.drawString("Mining Aspect level: " + material.shoddy(), localWidth, localHeight + 120 + 10 * offset, 0);
offset++; offset++;
} }
else if (material.shoddy() < 0) else if (material.shoddy() < 0)
{ {
this.fontRenderer.drawString("Spiny level: " + -material.shoddy(), localWidth, localHeight + 120 + 10 * offset, 0); this.fontRenderer.drawString("Splintering level: " + -material.shoddy(), localWidth, localHeight + 120 + 10 * offset, 0);
offset++; offset++;
} }
} }
@ -846,12 +867,14 @@ public class GuiManual extends GuiScreen
GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderHelper.enableGUIStandardItemLighting(); RenderHelper.enableGUIStandardItemLighting();
renderitem.zLevel = 100;
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[0], localWidth + 50, localHeight + 0); renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[0], localWidth + 50, localHeight + 0);
for (int i = 1; i < icons.length; i++) for (int i = 1; i < icons.length; i++)
{ {
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[i], localWidth + 120, localHeight + 20 + 10 * size + 18 * i); renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[i], localWidth + 120, localHeight + 20 + 10 * size + 18 * i);
this.fontRenderer.drawSplitString(multiText[i + 1], localWidth + 140, localHeight + 24 + 10 * size + 18 * i, 42, 0); this.fontRenderer.drawSplitString(multiText[i + 1], localWidth + 140, localHeight + 24 + 10 * size + 18 * i, 42, 0);
} }
renderitem.zLevel = 0;
RenderHelper.disableStandardItemLighting(); RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glDisable(GL12.GL_RESCALE_NORMAL);
} }

View File

@ -1,19 +1,24 @@
package mods.tinker.tconstruct.client.gui; package mods.tinker.tconstruct.client.gui;
import mods.tinker.tconstruct.container.ActiveContainer;
import mods.tinker.tconstruct.container.PartCrafterChestContainer; import mods.tinker.tconstruct.container.PartCrafterChestContainer;
import mods.tinker.tconstruct.crafting.PatternBuilder; import mods.tinker.tconstruct.crafting.PatternBuilder;
import mods.tinker.tconstruct.library.TConstructRegistry; import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.library.ToolMaterial; import mods.tinker.tconstruct.library.ToolMaterial;
import mods.tinker.tconstruct.logic.PartCrafterLogic; import mods.tinker.tconstruct.logic.PartCrafterLogic;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.world.World; import net.minecraft.world.World;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public class PartCrafterGui extends GuiContainer public class PartCrafterGui extends NewContainerGui
{ {
PartCrafterLogic logic; PartCrafterLogic logic;
String title, otherTitle = ""; String title, otherTitle = "";
@ -24,9 +29,9 @@ public class PartCrafterGui extends GuiContainer
public PartCrafterGui(InventoryPlayer inventoryplayer, PartCrafterLogic partlogic, World world, int x, int y, int z) public PartCrafterGui(InventoryPlayer inventoryplayer, PartCrafterLogic partlogic, World world, int x, int y, int z)
{ {
super(partlogic.getGuiContainer(inventoryplayer, world, x, y, z)); super((ActiveContainer) partlogic.getGuiContainer(inventoryplayer, world, x, y, z));
logic = partlogic; logic = partlogic;
drawChestPart = inventorySlots instanceof PartCrafterChestContainer; drawChestPart = container instanceof PartCrafterChestContainer;
title = "\u00A7nTool Part Crafting"; title = "\u00A7nTool Part Crafting";
} }
@ -41,7 +46,7 @@ public class PartCrafterGui extends GuiContainer
drawMaterialInformation(); drawMaterialInformation();
} }
void drawDefaultInformation() void drawDefaultInformation ()
{ {
title = "\u00A7nTool Part Building"; title = "\u00A7nTool Part Building";
this.drawCenteredString(fontRenderer, title, xSize + 63, 8, 16777215); this.drawCenteredString(fontRenderer, title, xSize + 63, 8, 16777215);
@ -61,7 +66,7 @@ public class PartCrafterGui extends GuiContainer
{ {
topEnum = TConstructRegistry.getMaterial(topID); topEnum = TConstructRegistry.getMaterial(topID);
hasTop = true; hasTop = true;
title = "\u00A7n"+topEnum.name(); title = "\u00A7n" + topEnum.name();
} }
else else
hasTop = false; hasTop = false;
@ -76,7 +81,7 @@ public class PartCrafterGui extends GuiContainer
{ {
bottomEnum = TConstructRegistry.getMaterial(bottomID); bottomEnum = TConstructRegistry.getMaterial(bottomID);
hasBottom = true; hasBottom = true;
otherTitle = "\u00A7n"+bottomEnum.name(); otherTitle = "\u00A7n" + bottomEnum.name();
} }
else else
hasBottom = false; hasBottom = false;
@ -86,22 +91,22 @@ public class PartCrafterGui extends GuiContainer
if (hasTop) if (hasTop)
{ {
this.drawCenteredString(fontRenderer, title, xSize + 63, offset, 16777215); this.drawCenteredString(fontRenderer, title, xSize + 63, offset, 16777215);
this.fontRenderer.drawString("Base Durability: "+topEnum.durability(), xSize + 8, offset+16, 16777215); this.fontRenderer.drawString("Base Durability: " + topEnum.durability(), xSize + 8, offset + 16, 16777215);
this.fontRenderer.drawString("Handle Modifier: "+topEnum.handleDurability()+"x", xSize + 8, offset+27, 16777215); this.fontRenderer.drawString("Handle Modifier: " + topEnum.handleDurability() + "x", xSize + 8, offset + 27, 16777215);
this.fontRenderer.drawString("Mining Speed: "+topEnum.toolSpeed()/100f, xSize + 8, offset+38, 16777215); this.fontRenderer.drawString("Mining Speed: " + topEnum.toolSpeed() / 100f, xSize + 8, offset + 38, 16777215);
this.fontRenderer.drawString("Mining Level: "+getHarvestLevelName(topEnum.harvestLevel()), xSize + 8, offset+49, 16777215); this.fontRenderer.drawString("Mining Level: " + getHarvestLevelName(topEnum.harvestLevel()), xSize + 8, offset + 49, 16777215);
this.fontRenderer.drawString("Base Attack: "+topEnum.attack(), xSize + 8, offset+60, 16777215); this.fontRenderer.drawString("Base Attack: " + topEnum.attack(), xSize + 8, offset + 60, 16777215);
} }
offset = 90; offset = 90;
if (hasBottom) if (hasBottom)
{ {
this.drawCenteredString(fontRenderer, otherTitle, xSize + 63, offset, 16777215); this.drawCenteredString(fontRenderer, otherTitle, xSize + 63, offset, 16777215);
this.fontRenderer.drawString("Base Durability: "+bottomEnum.durability(), xSize + 8, offset+16, 16777215); this.fontRenderer.drawString("Base Durability: " + bottomEnum.durability(), xSize + 8, offset + 16, 16777215);
this.fontRenderer.drawString("Handle Modifier: "+bottomEnum.handleDurability()+"x", xSize + 8, offset+27, 16777215); this.fontRenderer.drawString("Handle Modifier: " + bottomEnum.handleDurability() + "x", xSize + 8, offset + 27, 16777215);
this.fontRenderer.drawString("Mining Speed: "+bottomEnum.toolSpeed()/100f, xSize + 8, offset+38, 16777215); this.fontRenderer.drawString("Mining Speed: " + bottomEnum.toolSpeed() / 100f, xSize + 8, offset + 38, 16777215);
this.fontRenderer.drawString("Mining Level: "+getHarvestLevelName(bottomEnum.harvestLevel()), xSize + 8, offset+49, 16777215); this.fontRenderer.drawString("Mining Level: " + getHarvestLevelName(bottomEnum.harvestLevel()), xSize + 8, offset + 49, 16777215);
this.fontRenderer.drawString("Base Attack: "+bottomEnum.attack(), xSize + 8, offset+60, 16777215); this.fontRenderer.drawString("Base Attack: " + bottomEnum.attack(), xSize + 8, offset + 60, 16777215);
} }
if (!hasTop && !hasBottom) if (!hasTop && !hasBottom)
@ -164,7 +169,7 @@ public class PartCrafterGui extends GuiContainer
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
//his.mc.renderEngine.bindTexture(texID); //his.mc.renderEngine.bindTexture(texID);
this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/patternchestmini.png"); this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/patternchestmini.png");
this.drawTexturedModalRect(cornerX-116, cornerY+11, 0, 0, this.xSize, this.ySize); this.drawTexturedModalRect(cornerX - 116, cornerY + 11, 0, 0, this.xSize, this.ySize);
} }
// Draw description // Draw description
@ -176,4 +181,105 @@ public class PartCrafterGui extends GuiContainer
cornerY = (this.height - this.ySize) / 2; cornerY = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(cornerX, cornerY, 126, 0, 126, this.ySize); this.drawTexturedModalRect(cornerX, cornerY, 126, 0, 126, this.ySize);
} }
@Override
protected void mouseClicked (int mouseX, int mouseY, int clickNum)
{
boolean flag = clickNum == this.mc.gameSettings.keyBindPickBlock.keyCode + 100;
Slot slot = this.getSlotAtPosition(mouseX, mouseY);
long l = Minecraft.getSystemTime();
this.field_94074_J = this.field_94072_H == slot && l - this.field_94070_G < 250L && this.field_94073_I == clickNum;
this.field_94068_E = false;
int offsetLeft = drawChestPart ? 108 : 0;
if (clickNum == 0 || clickNum == 1 || flag)
{
int i1 = this.guiLeft;
int j1 = this.guiTop;
boolean flag1 = mouseX < i1 - offsetLeft || mouseY < j1 || mouseX >= i1 + this.xSize || mouseY >= j1 + this.ySize;
int k1 = -1;
if (slot != null)
{
k1 = slot.slotNumber;
}
if (flag1)
{
k1 = -999;
}
if (this.mc.gameSettings.touchscreen && flag1 && this.mc.thePlayer.inventory.getItemStack() == null)
{
this.mc.displayGuiScreen((GuiScreen) null);
return;
}
if (k1 != -1)
{
if (this.mc.gameSettings.touchscreen)
{
if (slot != null && slot.getHasStack())
{
this.clickedSlot = slot;
this.draggedStack = null;
this.isRightMouseClick = clickNum == 1;
}
else
{
this.clickedSlot = null;
}
}
else if (!this.field_94076_q)
{
if (this.mc.thePlayer.inventory.getItemStack() == null)
{
if (clickNum == this.mc.gameSettings.keyBindPickBlock.keyCode + 100)
{
this.handleMouseClick(slot, k1, clickNum, 3);
}
else
{
boolean flag2 = k1 != -999 && (Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54));
byte b0 = 0;
if (flag2)
{
this.field_94075_K = slot != null && slot.getHasStack() ? slot.getStack() : null;
b0 = 1;
}
else if (k1 == -999)
{
b0 = 4;
}
this.handleMouseClick(slot, k1, clickNum, b0);
}
this.field_94068_E = true;
}
else
{
this.field_94076_q = true;
this.field_94067_D = clickNum;
this.field_94077_p.clear();
if (clickNum == 0)
{
this.field_94071_C = 0;
}
else if (clickNum == 1)
{
this.field_94071_C = 1;
}
}
}
}
}
this.field_94072_H = slot;
this.field_94070_G = l;
this.field_94073_I = clickNum;
}
} }

View File

@ -11,6 +11,7 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot; import net.minecraft.inventory.Slot;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@ -39,21 +40,9 @@ public class SmelteryGui extends NewContainerGui
int slotPos = 0; int slotPos = 0;
int prevSlotPos = 0; int prevSlotPos = 0;
/*private Slot theSlot;
private Slot clickedSlot = null;
private ItemStack draggedStack = null;
private boolean isRightMouseClick = false;
private int field_94069_F;
private long returningStackTime = 0L;
private ItemStack returningStack = null;
private Slot returningStackDestSlot = null;
private int field_85049_r = 0;
private int field_85048_s = 0;*/
public SmelteryGui(InventoryPlayer inventoryplayer, SmelteryLogic smeltery, World world, int x, int y, int z) public SmelteryGui(InventoryPlayer inventoryplayer, SmelteryLogic smeltery, World world, int x, int y, int z)
{ {
super((ActiveContainer) smeltery.getGuiContainer(inventoryplayer, world, x, y, z)); super((ActiveContainer) smeltery.getGuiContainer(inventoryplayer, world, x, y, z));
//container = (SmelteryContainer) inventorySlots;
logic = smeltery; logic = smeltery;
username = inventoryplayer.player.username; username = inventoryplayer.player.username;
xSize = 248; xSize = 248;
@ -224,8 +213,19 @@ public class SmelteryGui extends NewContainerGui
} }
} }
//fontRenderer.drawString("Time: "+logic.useTime, 140, 2, 0xFFFFFF); //fontRenderer.drawString("slotPos: "+slotPos, 140, 2, 0xFFFFFF);
/*fontRenderer.drawString("Scrolling: "+isScrolling, 140, 12, 0xFFFFFF); /*fontRenderer.drawString("Scrolling: "+isScrolling, 140, 12, 0xFFFFFF);
fontRenderer.drawString("Scroll: "+currentScroll, 140, 22, 0xFFFFFF);*/ fontRenderer.drawString("Scroll: "+currentScroll, 140, 22, 0xFFFFFF);*/
} }
public void drawLiquidRect(int par1, int par2, Icon par3Icon, int par4, int par5)
{
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV((double)(par1 + 0), (double)(par2 + par5), (double)this.zLevel, (double)par3Icon.getMinU(), (double)par3Icon.getMaxV());
tessellator.addVertexWithUV((double)(par1 + par4), (double)(par2 + par5), (double)this.zLevel, (double)par3Icon.getMaxU(), (double)par3Icon.getMaxV());
tessellator.addVertexWithUV((double)(par1 + par4), (double)(par2 + 0), (double)this.zLevel, (double)par3Icon.getMaxU(), (double)par3Icon.getMinV());
tessellator.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)par3Icon.getMinU(), (double)par3Icon.getMinV());
tessellator.draw();
}
} }

View File

@ -1,14 +1,14 @@
package mods.tinker.tconstruct.container; package mods.tinker.tconstruct.container;
import mods.tinker.common.IPattern;
import mods.tinker.tconstruct.logic.PartCrafterLogic; import mods.tinker.tconstruct.logic.PartCrafterLogic;
import mods.tinker.tconstruct.logic.PatternChestLogic; import mods.tinker.tconstruct.logic.PatternChestLogic;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot; import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
public class PartCrafterChestContainer extends Container public class PartCrafterChestContainer extends ActiveContainer
{ {
protected PatternChestLogic patternLogic; protected PatternChestLogic patternLogic;
protected InventoryPlayer invPlayer; protected InventoryPlayer invPlayer;
@ -77,8 +77,14 @@ public class PartCrafterChestContainer extends Container
return null; return null;
} }
} }
else if (!this.mergeItemStack(slotStack, 2, 4, false)) else
{ {
if (slotStack.getItem() instanceof IPattern)
{
if (!this.mergeItemStack(slotStack, 0, 2, false) && ! this.mergeItemStack(slotStack, 8, 38, false))
return null;
}
else if (!this.mergeItemStack(slotStack, 2, 4, false))
return null; return null;
} }

View File

@ -1,5 +1,6 @@
package mods.tinker.tconstruct.container; package mods.tinker.tconstruct.container;
import mods.tinker.common.IPattern;
import mods.tinker.tconstruct.logic.PartCrafterLogic; import mods.tinker.tconstruct.logic.PartCrafterLogic;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
@ -7,7 +8,7 @@ import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot; import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
public class PartCrafterContainer extends Container public class PartCrafterContainer extends ActiveContainer
{ {
protected InventoryPlayer invPlayer; protected InventoryPlayer invPlayer;
protected PartCrafterLogic logic; protected PartCrafterLogic logic;
@ -66,8 +67,14 @@ public class PartCrafterContainer extends Container
return null; return null;
} }
} }
else if (!this.mergeItemStack(slotStack, 2, 4, false)) else
{ {
if (slotStack.getItem() instanceof IPattern)
{
if (!this.mergeItemStack(slotStack, 0, 2, false))
return null;
}
else if (!this.mergeItemStack(slotStack, 2, 4, false))
return null; return null;
} }

View File

@ -71,6 +71,7 @@ public class SmelteryContainer extends ActiveContainer
slot.xDisplayPosition = 2 + 22 * xPos; slot.xDisplayPosition = 2 + 22 * xPos;
slot.yDisplayPosition = 8 + 18 * yPos; slot.yDisplayPosition = 8 + 18 * yPos;
} }
return slotRow;
} }
return -1; return -1;
} }
@ -181,8 +182,9 @@ public class SmelteryContainer extends ActiveContainer
Slot slot; Slot slot;
ItemStack slotStack; ItemStack slotStack;
if (inputStack.isStackable()) /*if (inputStack.isStackable() && startSlot >= logic.getSizeInventory())
{ {
System.out.println("Rawr!");
while (inputStack.stackSize > 0 && (!flag && slotPos < endSlot || flag && slotPos >= startSlot)) while (inputStack.stackSize > 0 && (!flag && slotPos < endSlot || flag && slotPos >= startSlot))
{ {
slot = (Slot) this.inventorySlots.get(slotPos); slot = (Slot) this.inventorySlots.get(slotPos);
@ -208,6 +210,44 @@ public class SmelteryContainer extends ActiveContainer
} }
} }
if (flag)
{
--slotPos;
}
else
{
++slotPos;
}
}
}*/
if (inputStack.isStackable() && startSlot >= logic.getSizeInventory())
{
while (inputStack.stackSize > 0 && (!flag && slotPos < endSlot || flag && slotPos >= startSlot))
{
slot = (Slot)this.inventorySlots.get(slotPos);
slotStack = slot.getStack();
if (slotStack != null && slotStack.itemID == inputStack.itemID && (!inputStack.getHasSubtypes() || inputStack.getItemDamage() == slotStack.getItemDamage()) && ItemStack.areItemStackTagsEqual(inputStack, slotStack))
{
int l = slotStack.stackSize + inputStack.stackSize;
if (l <= inputStack.getMaxStackSize())
{
inputStack.stackSize = 0;
slotStack.stackSize = l;
slot.onSlotChanged();
merged = true;
}
else if (slotStack.stackSize < inputStack.getMaxStackSize())
{
inputStack.stackSize -= inputStack.getMaxStackSize() - slotStack.stackSize;
slotStack.stackSize = inputStack.getMaxStackSize();
slot.onSlotChanged();
merged = true;
}
}
if (flag) if (flag)
{ {
--slotPos; --slotPos;

View File

@ -1,20 +1,20 @@
package mods.tinker.tconstruct.entity; package mods.tinker.tconstruct.entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World; import net.minecraft.world.World;
public class Skyla extends EntityPlayer public class Skyla extends EntityCreeper
{ {
public Skyla(World par1World) public Skyla(World par1World)
{ {
super(par1World); super(par1World);
username = "Skyla"; //username = "Skyla";
texture = "/tinkertextures/mob/skyla.png"; texture = "/mods/tinker/textures/mob/skyla.png";
} }
@Override /*@Override
public void sendChatToPlayer (String var1) {} public void sendChatToPlayer (String var1) {}
@Override @Override
@ -27,6 +27,6 @@ public class Skyla extends EntityPlayer
public ChunkCoordinates getPlayerCoordinates () public ChunkCoordinates getPlayerCoordinates ()
{ {
return null; return null;
} }*/
} }

View File

@ -189,10 +189,11 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
@Override @Override
public Icon getIcon (ItemStack stack, int renderPass) public Icon getIcon (ItemStack stack, int renderPass)
{ {
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); NBTTagCompound tags = stack.getTagCompound();
if (tags != null) if (tags != null)
{ {
tags = stack.getTagCompound().getCompoundTag("InfiTool");
if (renderPass < getPartAmount()) if (renderPass < getPartAmount())
{ {
if (renderPass == 0) // Handle if (renderPass == 0) // Handle

View File

@ -23,6 +23,13 @@ public class ToolStationLogic extends InventoryLogic
toolName = ""; toolName = "";
} }
public boolean canDropInventorySlot(int slot)
{
if (slot == 0)
return false;
return true;
}
@Override @Override
public ItemStack getStackInSlotOnClosing (int var1) public ItemStack getStackInSlotOnClosing (int var1)
{ {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -1,7 +1,6 @@
package test; package test;
import mods.tinker.tconstruct.entity.BlueSlime; import mods.tinker.tconstruct.entity.BlueSlime;
import mods.tinker.tconstruct.entity.NitroCreeper;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
@ -9,6 +8,7 @@ import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.world.World; import net.minecraft.world.World;
/* /*
@ -24,33 +24,30 @@ public class XinStick extends Item
setCreativeTab(CreativeTabs.tabMisc); setCreativeTab(CreativeTabs.tabMisc);
} }
public Icon getIconFromDamage(int par1)
{
return Item.arrow.getIconFromDamage(par1);
}
@Override @Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
{ {
//spawnItem(player.posX, player.posY, player.posZ, tool, world); spawnEntity(player.posX, player.posY+1, player.posZ, new BlueSlime(world), world, player);
//CartEntity cart = new CartEntity(world, 1); System.out.println("Health! "+player.getHealth());
//cart.cartType = 1; //healPlayer(player);
spawnEntity(player.posX, player.posY+1, player.posZ, new NitroCreeper(world), world, player);
return stack; return stack;
} }
/*public boolean onItemUse (ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) public static void healPlayer(EntityPlayer player)
{ {
if (!par3World.isRemote) player.setEntityHealth(200);
{
par3World.spawnEntityInWorld(new CartEntity(par3World, (double) ((float) par4 + 0.5F), (double) ((float) par5 + 1.5F), (double) ((float) par6 + 0.5F), 0));
} }
//--par1ItemStack.stackSize;
return true;
}*/
public static void spawnItem (double x, double y, double z, ItemStack stack, World world) public static void spawnItem (double x, double y, double z, ItemStack stack, World world)
{ {
if (!world.isRemote) if (!world.isRemote)
{ {
EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack);
//entityitem.delayBeforeCanPickup = 10;
world.spawnEntityInWorld(entityitem); world.spawnEntityInWorld(entityitem);
} }
} }