Fix worldgen, disable metallurgy stats

This commit is contained in:
mDiyo 2013-03-24 14:59:41 -07:00
parent 84705d04c3
commit c9ef3093a3
25 changed files with 451 additions and 268 deletions

View File

@ -29,7 +29,7 @@
<entry key="MetalOre.Aluminum.name">Aluminum Ore</entry>
<entry key="MetalOre.Slag.name">Stone Slag</entry>
<entry key="Smeltery.Controller.name">Smeltery</entry>
<entry key="Smeltery.Controller.name">Smeltery Controller</entry>
<entry key="Smeltery.Drain.name">Smeltery Drain</entry>
<entry key="Smeltery.Brick.name">Seared Bricks</entry>
<entry key="LavaTank.Tank.name">Lava Tank</entry>

View File

@ -9,31 +9,18 @@ Volume 1
By Skyla</text>
</page>
<page type="contents">
<text>Introduction
Worktables
Tools
Materials
Abilities
Modifiers
Notes</text>
<sidebar>1
2
3
4
5
6</sidebar>
<page type="text">
<text>Table of Contents
This book is -not- anywhere near finished. Please don't read me yet.</text>
</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.
This book is a magic copy. Whenever the original is updated, this book will automatically copy the source.</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>
</page>
<page type="text">
<title>Worktables</title>
<text>
<text>Worktables
In general:
- Tools are made from parts

View File

@ -9,20 +9,21 @@ By Thruul M'gon</text>
</page>
<page type="contents">
<text>Table of Contents</text>
<link>
<text>Introduction</text>
<icon>smelterybook</icon>
<jump>3</jump>
</link>
<link>
<text>Smeltery</text>
<icon>smeltery</icon>
<jump>6</jump>
<text>Casting</text>
<icon>castingtable</icon>
<jump>8</jump>
</link>
<link>
<text>Recipes</text>
<icon>blankcast</icon>
<jump>9</jump>
<text>Construction</text>
<icon>smeltery</icon>
<jump>5</jump>
</link>
<link>
<text>Alloys</text>
@ -30,56 +31,103 @@ By Thruul M'gon</text>
<jump>9</jump>
</link>
<link>
<text>Casting</text>
<icon>castingtable</icon>
<jump>14</jump>
<text>Recipes</text>
<icon>blankcast</icon>
<jump>9</jump>
</link>
</page>
<page type="text">
<text>Welcome, puny Tinker, to the world of metalcraft.
</text>
</page>
<page type="text">
<text>Alloys are made when two metals are mixed in precise proportions. Currently known alloys are:
<text>Welcome to the world of metalcraft. Within these pages you will learn the secrets of crafting rare and precious metals into usable materials.
Bronze, made from Copper(3) and Tin(1)
Aluminum Brass, made from Aluminum(3) and Copper(1)
Manyullyn, made from Cobalt(1) and Ardite(1)
Alumite, made from Aluminum(5), Iron(2), and Obsidian(2)</text>
You will learn how to cast everything from the softest Iron to the hardest Manyullyn into whatever shape you desire and create alloy mixes from obscure materials. As always, experimentation is key!
The main structure for melting liquids is called the Smeltery. It is larger than structures you may be familiar with, but the method for construction is relatively simple. It operates much like a furnace with a drain.</text>
</page>
<page type="text">
<title>Worktables</title>
<text>
<text>When working with the Smeltery, there are a few things to keep in mind:
In general:
- Tools are made from parts
- Parts are created from materials using a pattern
* Ores naturally have more material than processed versions, such as ingots. The Smeltery will preserve the full value of the ores - roughly twice as much as a regular furnace would provide.
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>
* Mixing two metals in the Smeltery may result in an alloy. The process happens automatically.
* If you need more space to process metal, add more layers.</text>
</page>
<page type="sidebar">
<text>The Smeltery is a multi-block structure. You will need the following materials to get started.</text>
<item>
<text>1 Smeltery Controller</text>
<icon>smeltery</icon>
</item>
<item>
<text>1 Lava Tank</text>
<icon>lavatank</icon>
</item>
<item>
<text>9 Seared Bricks</text>
<icon>searedbrick</icon>
</item>
<item>
<text>Any combination of 10 Seared Bricks, Lava Tanks, or Drains
</text>
<icon>drain</icon>
</item>
<item>
<text>1 Faucet</text>
<icon>faucet</icon>
</item>
<item>
<text>1 Casting Table</text>
<icon>castingtable</icon>
</item>
</page>
<page type="text">
<text>Blank patterns are where the
</text>
</page>
<text>Begin construction by laying a 3x3 bed of seared bricks. Leave any space above these bricks open; you will be constructing a shell around a 3x3 hollow inside.
<page type="craftingrecipe">
<title>Blank Wood Pattern</title>
<recipe>woodpattern</recipe>
Place the Controller one layer up and the lava tank anywhere on the same level. Fill in the rest of the space with seared bricks, lava tanks, or drains as you like.
The small end of drains should be facing the outside. If you're successful, the Controller will light up and start working. Fill the tank with lava, the basin with metal, and watch it go.
The structure must be a 5x5 shell due to the amount of heat lava gives off. There are no vertical restrictions to the size of the basin. </text>
</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>
<text>Larger basins will hold more metal, of course, and the Controller can be on any level so long as there is a lava tank to match.
When you are ready to pour liquid metal from the Smeltery, put a faucet on a drain and a casting table below it.
Other liquid removal objects will work, but are frowned upon. An example picture is provided for your convienence.</text>
</page>
<page type="craftingrecipe">
<title>Stencil Table</title>
<recipe>stenciltable</recipe>
<page type="picture">
<text>Figure 1a</text>
<picture>/mods/tinker/resources/manuals/smelterysmall.png</picture>
</page>
<page type="sidebar">
<text>Alloys are made when two metals are mixed in precise proportions. Currently known alloys are:</text>
<item>
<text>Bronze, made from Copper(3) and Tin(1)</text>
<icon>bronzeingot</icon>
</item>
<item>
<text>Aluminum Brass, made from Aluminum(3) and Copper(1)</text>
<icon>alubrassingot</icon>
</item>
<item>
<text>Manyullyn, made from Cobalt(1) and Ardite(1)</text>
<icon>manyullyningot</icon>
</item>
<item>
<text>Alumite, made from Aluminum(5), Iron(2), and Obsidian(2)</text>
<icon>alumiteingot</icon>
</item>
</page>
<page type="text">
<text></text>
<text>To be continued...</text>
</page>
</book>

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -1,81 +0,0 @@
package mods.tinker.tconstruct;
import java.util.Random;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.Item;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
public class TAfterEventHandler
{
Random rand = new Random();
/* Bows */
@ForgeSubscribe
public void arrowShoot (ArrowLooseEvent event)
{
event.setCanceled(true);
int j = event.charge;
boolean flag = event.entityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, event.bow) > 0;
if (flag || event.entityPlayer.inventory.hasItem(Item.arrow.itemID))
{
float f = (float)j / 20.0F;
f = (f * f + f * 2.0F) / 3.0F;
if ((double)f < 0.1D)
{
return;
}
if (f > 1.0F)
{
f = 1.0F;
}
EntityArrow entityarrow = new EntityArrow(event.entityPlayer.worldObj, event.entityPlayer, f * 2.0F);
if (f == 1.0F)
{
entityarrow.setIsCritical(true);
}
int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, event.bow);
entityarrow.setDamage(1.5D + k * 0.45D);
int l = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, event.bow);
if (l > 0)
{
entityarrow.setKnockbackStrength(l);
}
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, event.bow) > 0)
{
entityarrow.setFire(100);
}
event.bow.damageItem(1, event.entityPlayer);
event.entityPlayer.worldObj.playSoundAtEntity(event.entityPlayer, "random.bow", 1.0F, 1.0F / (rand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
if (flag)
{
entityarrow.canBePickedUp = 2;
}
else
{
event.entityPlayer.inventory.consumeInventoryItem(Item.arrow.itemID);
}
if (!event.entityPlayer.worldObj.isRemote)
{
event.entityPlayer.worldObj.spawnEntityInWorld(entityarrow);
}
}
}
}

View File

@ -23,7 +23,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
* @author: mDiyo
*/
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.2.2")
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.2.3")
@NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.TPacketHandler.class)
public class TConstruct
{
@ -63,9 +63,8 @@ public class TConstruct
public void init (FMLInitializationEvent evt)
{
GameRegistry.registerWorldGenerator(new TBaseWorldGenerator());
playerTracker = new TPlayerHandler();
MinecraftForge.EVENT_BUS.register(playerTracker);
GameRegistry.registerPlayerTracker(playerTracker);
GameRegistry.registerFuelHandler(content);
GameRegistry.registerCraftingHandler(new TCraftingHandler());
NetworkRegistry.instance().registerGuiHandler(instance, new TGuiHandler());
}
@ -74,12 +73,13 @@ public class TConstruct
{
content.modIntegration();
content.oreRegistry();
lateEvents = new TAfterEventHandler();
MinecraftForge.EVENT_BUS.register(lateEvents);
playerTracker = new TPlayerHandler();
GameRegistry.registerPlayerTracker(playerTracker);
MinecraftForge.EVENT_BUS.register(playerTracker);
}
public static TEventHandler events;
public static TAfterEventHandler lateEvents;
public static TPlayerHandler playerTracker;
public static TContent content;

View File

@ -1,5 +1,6 @@
package mods.tinker.tconstruct;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
@ -177,7 +178,6 @@ public class TContent implements IFuelHandler
addSmelteryRecipes();
addCraftingRecipes();
setupToolTabs();
GameRegistry.registerFuelHandler(this);
}
void createEntities ()
@ -346,7 +346,7 @@ public class TContent implements IFuelHandler
//Thaumcraft
TConstructRegistry.addToolMaterial(21, "Thaumium", 2, 2, 250, 600, 2, 1.3F, 1, 0f);
//Metallurgy
/*//Metallurgy
TConstructRegistry.addToolMaterial(22, "Heptazion", 2, 2, 300, 800, 1, 1.0F, 0, 0f);
TConstructRegistry.addToolMaterial(23, "Damascus Steel", 2, 3, 500, 600, 2, 1.35F, 1, 0f);
TConstructRegistry.addToolMaterial(24, "Angmallen", 2, 2, 300, 800, 2, 0.8F, 0, 0f);
@ -366,7 +366,7 @@ public class TContent implements IFuelHandler
TConstructRegistry.addToolMaterial(36, "Quicksilver", 2, 4, 1100, 1400, 3, 1.0F, 1, 0f);
TConstructRegistry.addToolMaterial(37, "Haderoth", 2, 4, 1250, 1200, 3, 1.0F, 2, 0f);
TConstructRegistry.addToolMaterial(38, "Celenegil", 3, 5, 1600, 1400, 3, 1.0F, 2, 0f);
TConstructRegistry.addToolMaterial(39, "Tartarite", 3, 7, 3000, 1400, 5, 1.6667F, 4, 0f);
TConstructRegistry.addToolMaterial(39, "Tartarite", 3, 7, 3000, 1400, 5, 1.6667F, 4, 0f);*/
PatternBuilder pb = PatternBuilder.instance;
if (PHConstruct.enableTWood)
@ -540,6 +540,7 @@ public class TContent implements IFuelHandler
}
}
WeakReference<ToolCore> tool = new WeakReference<ToolCore>(null);
void addSmelteryRecipes ()
{
//Ore

View File

@ -0,0 +1,29 @@
package mods.tinker.tconstruct;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
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 onSmelting (EntityPlayer player, ItemStack item) {}
}

View File

@ -249,6 +249,14 @@ public class TProxyClient extends TProxyCommon
TConstructClientRegistry.registerManualIcon("blankcast", new ItemStack(TContent.blankPattern, 1, 1));
TConstructClientRegistry.registerManualIcon("castingtable", new ItemStack(TContent.searedBlock));
TConstructClientRegistry.registerManualIcon("liquidiron", new ItemStack(TContent.liquidMetalStill));
TConstructClientRegistry.registerManualIcon("lavatank", new ItemStack(TContent.lavaTank));
TConstructClientRegistry.registerManualIcon("searedbrick", new ItemStack(TContent.smeltery, 1, 2));
TConstructClientRegistry.registerManualIcon("drain", new ItemStack(TContent.smeltery, 1, 1));
TConstructClientRegistry.registerManualIcon("faucet", new ItemStack(TContent.searedBlock, 1, 1));
TConstructClientRegistry.registerManualIcon("bronzeingot", new ItemStack(TContent.materials, 1, 13));
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));
}
public static Document getManualFromStack (ItemStack stack)

View File

@ -42,16 +42,12 @@ public class GuiManual extends GuiScreen
ItemStack[] iconsRight;
String[] multiTextRight;
//CustomFont font;
//int guiscale;
public GuiManual(ItemStack stack, Document doc)
{
this.mc = Minecraft.getMinecraft();
this.itemstackBook = stack;
currentPage = 0; //Stack page
manual = doc;
//font = new CustomFont(mc, "Times New Roman", 16);
}
@Override
@ -64,16 +60,6 @@ public class GuiManual extends GuiScreen
this.height = h;
this.buttonList.clear();
this.initGui();
/*int scale = 0;
while (width / (scale + 1) >= 160)
{
scale++;
}
guiscale = scale;*/
//font.scale = scale;
}
public void initGui ()
@ -100,7 +86,7 @@ public class GuiManual extends GuiScreen
void updateText ()
{
if (currentPage >= maxPages - 1)
if (currentPage >= maxPages)
currentPage = maxPages - 2;
if (currentPage % 2 == 1)
currentPage--;
@ -114,26 +100,58 @@ public class GuiManual extends GuiScreen
{
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();
}
else if (pageLeftType.equals("contents"))
{
NodeList nodes = element.getElementsByTagName("link");
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(0).getTextContent();
iconsLeft[i] = TConstructClientRegistry.getManualIcon(children.item(1).getTextContent());
multiTextLeft[i] = children.item(1).getTextContent();
iconsLeft[i] = TConstructClientRegistry.getManualIcon(children.item(3).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());
}
}
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();
}
}
node = nList.item(currentPage + 1);
@ -141,18 +159,21 @@ public class GuiManual extends GuiScreen
{
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"))
{
//Minecraft.getMinecraft().getLogAgent().logInfo("Contents!");
NodeList nodes = element.getElementsByTagName("link");
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++)
@ -162,6 +183,34 @@ public class GuiManual extends GuiScreen
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
{
@ -172,55 +221,77 @@ public class GuiManual extends GuiScreen
public void drawScreen (int par1, int par2, float par3)
{
//int texID = this.mc.renderEngine.getTexture();
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);
//texID = this.mc.renderEngine.getTexture("/mods/tinker/textures/gui/bookleft.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
//this.mc.renderEngine.bindTexture(texID);
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"))
{
drawPicture(multiTextLeft[0], localWidth + 16, localHeight + 12);
}
if (pageRightType.equals("picture"))
{
drawPicture(multiTextRight[0], localWidth + 220, localHeight + 12);
}
//if (textLeft != null)
//{
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(iconsLeft, localWidth + 16, localHeight + 12);
//}
//if (textRight != null)
//{
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(iconsRight, localWidth + 220, localHeight + 12);
//}
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);
}
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);
}
}
/* Page types */
public void drawTextPage (String text, int localWidth, int localHeight)
{
this.fontRenderer.drawSplitString(text, localWidth, localHeight, 178, 0);
@ -231,13 +302,41 @@ public class GuiManual extends GuiScreen
this.fontRenderer.drawSplitString(text, localWidth, localHeight, 178, 0);
}
public void drawContentTablePage (ItemStack[] icons, int localWidth, int localHeight)
public void drawContentTablePage (String info, ItemStack[] icons, String[] multiText, int localWidth, int localHeight)
{
this.fontRenderer.drawString("\u00a7nTable of Contents", localWidth+50, localHeight+4, 0);
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);
this.fontRenderer.drawString(multiTextRight[i], localWidth+38, localHeight + 18*i + 18, 0);
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);
}
}

View File

@ -42,6 +42,7 @@ public class SmelteryLogic extends InventoryLogic
int maxTemp;
public int useTime;
public int fuelGague;
boolean inUse;
ArrayList<CoordTuple> lavaTanks;
CoordTuple activeLavaTank;
@ -208,12 +209,16 @@ public class SmelteryLogic extends InventoryLogic
{
if (useTime > 0)
{
inUse = false;
for (int i = 0; i < 9 * layers; i++)
{
if (meltingTemps[i] > 20 && this.isStackInSlot(i))
{
if (activeTemps[i] < internalTemp && activeTemps[i] < meltingTemps[i])
{
activeTemps[i] += 1;
inUse = true;
}
else if (meltingTemps[i] >= activeTemps[i])
{
if (!worldObj.isRemote)
@ -293,7 +298,7 @@ public class SmelteryLogic extends InventoryLogic
{
fuelGague = 0;
}
if (tankContainer instanceof ITankContainer)
if (tankContainer instanceof ITankContainer && inUse)
{
LiquidStack liquid = ((ITankContainer) tankContainer).drain(ForgeDirection.DOWN, 50, false);
if (liquid != null && liquid.itemID == Block.lavaStill.blockID)

View File

@ -1,18 +1,25 @@
package mods.tinker.tconstruct.player;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import java.util.Random;
import mods.tinker.tconstruct.AbilityHelper;
import mods.tinker.tconstruct.PHConstruct;
import mods.tinker.tconstruct.TContent;
import mods.tinker.tconstruct.client.TProxyClient;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EnumEntitySize;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.living.LivingFallEvent;
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
import net.minecraftforge.event.entity.player.PlayerDropsEvent;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.IPlayerTracker;
@ -34,11 +41,13 @@ public class TPlayerHandler implements IPlayerTracker
tags.setCompoundTag("TConstruct", new NBTTagCompound());
}
TPlayerStats stats = new TPlayerStats();
stats.player = entityplayer;
stats.player = new WeakReference<EntityPlayer>(entityplayer);
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.smelteryManual = tags.getCompoundTag("TConstruct").getBoolean("smelteryManual");
if (!stats.diary)
{
tags.getCompoundTag("TConstruct").setBoolean("diary", true);
@ -70,21 +79,26 @@ public class TPlayerHandler implements IPlayerTracker
{
//Boom!
TPlayerStats stats = getPlayerStats(entityplayer.username);
stats.player = entityplayer;
stats.player = new WeakReference<EntityPlayer>(entityplayer);
if (PHConstruct.keepLevels)
entityplayer.experienceLevel = stats.level;
if (PHConstruct.keepHunger)
entityplayer.getFoodStats().setFoodLevel(stats.hunger);
NBTTagCompound tags = entityplayer.getEntityData().getCompoundTag("TConstruct");
tags.setBoolean("diary", stats.diary);
NBTTagCompound tags = entityplayer.getEntityData();
NBTTagCompound tTag = new NBTTagCompound();
tTag.setBoolean("diary", stats.diary);
tTag.setBoolean("stationManual", stats.stationManual);
tTag.setBoolean("smelteryManual", stats.smelteryManual);
tags.setCompoundTag("TConstruct", tTag);
Side side = FMLCommonHandler.instance().getEffectiveSide();
if (side == Side.CLIENT)
{
TProxyClient.controlInstance.resetControls();
}
}
@ForgeSubscribe
public void livingFall (LivingFallEvent evt) //Only for negating fall damage
{
@ -98,7 +112,7 @@ public class TPlayerHandler implements IPlayerTracker
//System.out.println("Client side: "+evt.entityLiving.motionY);
}
//else
//System.out.println("Server side");
//System.out.println("Server side");
evt.distance -= 1;
//evt.distance = 0;
@ -107,7 +121,7 @@ public class TPlayerHandler implements IPlayerTracker
//evt.entityLiving.motionY = 10.2;
}
}
/*@ForgeSubscribe
public void livingUpdate (LivingUpdateEvent evt)
{
@ -164,56 +178,124 @@ public class TPlayerHandler implements IPlayerTracker
}
else
{
return stats.player;
return stats.player.get();
}
}
/* Modify Player */
public void updateSize(String user, float offset)
public void updateSize (String user, float offset)
{
/*EntityPlayer player = getEntityPlayer(user);
setEntitySize(0.6F, offset, player);
player.yOffset = offset - 0.18f;*/
}
public static void setEntitySize(float width, float height, Entity entity)
{
System.out.println("Size: "+height);
if (width != entity.width || height != entity.height)
{
entity.width = width;
entity.height = height;
entity.boundingBox.maxX = entity.boundingBox.minX + (double)entity.width;
entity.boundingBox.maxZ = entity.boundingBox.minZ + (double)entity.width;
entity.boundingBox.maxY = entity.boundingBox.minY + (double)entity.height;
}
float que = width % 2.0F;
public static void setEntitySize (float width, float height, Entity entity)
{
System.out.println("Size: " + height);
if (width != entity.width || height != entity.height)
{
entity.width = width;
entity.height = height;
entity.boundingBox.maxX = entity.boundingBox.minX + (double) entity.width;
entity.boundingBox.maxZ = entity.boundingBox.minZ + (double) entity.width;
entity.boundingBox.maxY = entity.boundingBox.minY + (double) entity.height;
}
if ((double)que < 0.375D)
{
entity.myEntitySize = EnumEntitySize.SIZE_1;
}
else if ((double)que < 0.75D)
{
entity.myEntitySize = EnumEntitySize.SIZE_2;
}
else if ((double)que < 1.0D)
{
entity.myEntitySize = EnumEntitySize.SIZE_3;
}
else if ((double)que < 1.375D)
{
entity.myEntitySize = EnumEntitySize.SIZE_4;
}
else if ((double)que < 1.75D)
{
entity.myEntitySize = EnumEntitySize.SIZE_5;
}
else
{
entity.myEntitySize = EnumEntitySize.SIZE_6;
}
//entity.yOffset = height;
}
float que = width % 2.0F;
if ((double) que < 0.375D)
{
entity.myEntitySize = EnumEntitySize.SIZE_1;
}
else if ((double) que < 0.75D)
{
entity.myEntitySize = EnumEntitySize.SIZE_2;
}
else if ((double) que < 1.0D)
{
entity.myEntitySize = EnumEntitySize.SIZE_3;
}
else if ((double) que < 1.375D)
{
entity.myEntitySize = EnumEntitySize.SIZE_4;
}
else if ((double) que < 1.75D)
{
entity.myEntitySize = EnumEntitySize.SIZE_5;
}
else
{
entity.myEntitySize = EnumEntitySize.SIZE_6;
}
//entity.yOffset = height;
}
Random rand = new Random();
/* Bows */
@ForgeSubscribe
public void arrowShoot (ArrowLooseEvent event)
{
event.setCanceled(true);
int j = event.charge;
boolean flag = event.entityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, event.bow) > 0;
if (flag || event.entityPlayer.inventory.hasItem(Item.arrow.itemID))
{
float f = (float) j / 20.0F;
f = (f * f + f * 2.0F) / 3.0F;
if ((double) f < 0.1D)
{
return;
}
if (f > 1.0F)
{
f = 1.0F;
}
EntityArrow entityarrow = new EntityArrow(event.entityPlayer.worldObj, event.entityPlayer, f * 2.0F);
if (f == 1.0F)
{
entityarrow.setIsCritical(true);
}
int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, event.bow);
entityarrow.setDamage(1.5D + k * 0.45D);
int l = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, event.bow);
if (l > 0)
{
entityarrow.setKnockbackStrength(l);
}
if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, event.bow) > 0)
{
entityarrow.setFire(100);
}
event.bow.damageItem(1, event.entityPlayer);
event.entityPlayer.worldObj.playSoundAtEntity(event.entityPlayer, "random.bow", 1.0F, 1.0F / (rand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
if (flag)
{
entityarrow.canBePickedUp = 2;
}
else
{
event.entityPlayer.inventory.consumeInventoryItem(Item.arrow.itemID);
}
if (!event.entityPlayer.worldObj.isRemote)
{
event.entityPlayer.worldObj.spawnEntityInWorld(entityarrow);
}
}
}
}

View File

@ -1,14 +1,18 @@
package mods.tinker.tconstruct.player;
import java.lang.ref.WeakReference;
import net.minecraft.entity.player.EntityPlayer;
public class TPlayerStats
{
public EntityPlayer player;
public WeakReference<EntityPlayer> player;
public int level;
public int health;
public int hunger;
public boolean diary;
public boolean stationManual;
public boolean smelteryManual;
//public boolean prevOnGround;
//public double prevMotionY;

View File

@ -4,6 +4,7 @@ import java.util.Random;
import mods.tinker.tconstruct.PHConstruct;
import mods.tinker.tconstruct.TContent;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
@ -20,12 +21,12 @@ public class TBaseWorldGenerator
//cobalt = new ManhattanOreGenerator(TContent.oreSlag.blockID, 1, 2, 4, 100, true, false, Block.netherrack.blockID);
//ardite = new ManhattanOreGenerator(TContent.oreSlag.blockID, 2, 2, 4, 100, true, false, Block.netherrack.blockID);
copper = new WorldGenMinable(TContent.oreSlag.blockID, 3, 9);
tin = new WorldGenMinable(TContent.oreSlag.blockID, 4, 9);
aluminum = new WorldGenMinable(TContent.oreSlag.blockID, 5, 16);
copper = new WorldGenMinable(TContent.oreSlag.blockID, 3, 9, Block.stone.blockID);
tin = new WorldGenMinable(TContent.oreSlag.blockID, 4, 9, Block.stone.blockID);
aluminum = new WorldGenMinable(TContent.oreSlag.blockID, 5, 16, Block.stone.blockID);
cobalt = new NetherOreGenerator(TContent.oreSlag.blockID, 1, 3);
ardite = new NetherOreGenerator(TContent.oreSlag.blockID, 2, 3);
cobalt = new WorldGenMinable(TContent.oreSlag.blockID, 1, 3, Block.netherrack.blockID);
ardite = new WorldGenMinable(TContent.oreSlag.blockID, 2, 3, Block.netherrack.blockID);
}
@Override
@ -101,6 +102,6 @@ public class TBaseWorldGenerator
WorldGenMinable copper;
WorldGenMinable tin;
WorldGenMinable aluminum;
NetherOreGenerator cobalt;
NetherOreGenerator ardite;
WorldGenMinable cobalt;
WorldGenMinable ardite;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB