Fix worldgen, disable metallurgy stats
@ -29,7 +29,7 @@
|
|||||||
<entry key="MetalOre.Aluminum.name">Aluminum Ore</entry>
|
<entry key="MetalOre.Aluminum.name">Aluminum Ore</entry>
|
||||||
<entry key="MetalOre.Slag.name">Stone Slag</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.Drain.name">Smeltery Drain</entry>
|
||||||
<entry key="Smeltery.Brick.name">Seared Bricks</entry>
|
<entry key="Smeltery.Brick.name">Seared Bricks</entry>
|
||||||
<entry key="LavaTank.Tank.name">Lava Tank</entry>
|
<entry key="LavaTank.Tank.name">Lava Tank</entry>
|
||||||
|
@ -9,31 +9,18 @@ Volume 1
|
|||||||
By Skyla</text>
|
By Skyla</text>
|
||||||
</page>
|
</page>
|
||||||
|
|
||||||
<page type="contents">
|
<page type="text">
|
||||||
<text>Introduction
|
<text>Table of Contents
|
||||||
Worktables
|
|
||||||
Tools
|
This book is -not- anywhere near finished. Please don't read me yet.</text>
|
||||||
Materials
|
|
||||||
Abilities
|
|
||||||
Modifiers
|
|
||||||
Notes</text>
|
|
||||||
<sidebar>1
|
|
||||||
2
|
|
||||||
3
|
|
||||||
4
|
|
||||||
5
|
|
||||||
6</sidebar>
|
|
||||||
</page>
|
</page>
|
||||||
|
|
||||||
<page type="text">
|
<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>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>
|
||||||
|
|
||||||
This book is a magic copy. Whenever the original is updated, this book will automatically copy the source.</text>
|
|
||||||
</page>
|
</page>
|
||||||
|
|
||||||
<page type="text">
|
<page type="text">
|
||||||
<title>Worktables</title>
|
<text>Worktables
|
||||||
<text>
|
|
||||||
|
|
||||||
In general:
|
In general:
|
||||||
- Tools are made from parts
|
- Tools are made from parts
|
||||||
|
@ -9,20 +9,21 @@ By Thruul M'gon</text>
|
|||||||
</page>
|
</page>
|
||||||
|
|
||||||
<page type="contents">
|
<page type="contents">
|
||||||
|
<text>Table of Contents</text>
|
||||||
<link>
|
<link>
|
||||||
<text>Introduction</text>
|
<text>Introduction</text>
|
||||||
<icon>smelterybook</icon>
|
<icon>smelterybook</icon>
|
||||||
<jump>3</jump>
|
<jump>3</jump>
|
||||||
</link>
|
</link>
|
||||||
<link>
|
<link>
|
||||||
<text>Smeltery</text>
|
<text>Casting</text>
|
||||||
<icon>smeltery</icon>
|
<icon>castingtable</icon>
|
||||||
<jump>6</jump>
|
<jump>8</jump>
|
||||||
</link>
|
</link>
|
||||||
<link>
|
<link>
|
||||||
<text>Recipes</text>
|
<text>Construction</text>
|
||||||
<icon>blankcast</icon>
|
<icon>smeltery</icon>
|
||||||
<jump>9</jump>
|
<jump>5</jump>
|
||||||
</link>
|
</link>
|
||||||
<link>
|
<link>
|
||||||
<text>Alloys</text>
|
<text>Alloys</text>
|
||||||
@ -30,56 +31,103 @@ By Thruul M'gon</text>
|
|||||||
<jump>9</jump>
|
<jump>9</jump>
|
||||||
</link>
|
</link>
|
||||||
<link>
|
<link>
|
||||||
<text>Casting</text>
|
<text>Recipes</text>
|
||||||
<icon>castingtable</icon>
|
<icon>blankcast</icon>
|
||||||
<jump>14</jump>
|
<jump>9</jump>
|
||||||
</link>
|
</link>
|
||||||
</page>
|
</page>
|
||||||
|
|
||||||
<page type="text">
|
<page type="text">
|
||||||
<text>Welcome, puny Tinker, to the world of metalcraft.
|
<text>Welcome to the world of metalcraft. Within these pages you will learn the secrets of crafting rare and precious metals into usable materials.
|
||||||
</text>
|
|
||||||
</page>
|
|
||||||
<page type="text">
|
|
||||||
<text>Alloys are made when two metals are mixed in precise proportions. Currently known alloys are:
|
|
||||||
|
|
||||||
Bronze, made from Copper(3) and Tin(1)
|
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!
|
||||||
Aluminum Brass, made from Aluminum(3) and Copper(1)
|
|
||||||
Manyullyn, made from Cobalt(1) and Ardite(1)
|
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>
|
||||||
Alumite, made from Aluminum(5), Iron(2), and Obsidian(2)</text>
|
|
||||||
</page>
|
</page>
|
||||||
|
|
||||||
<page type="text">
|
<page type="text">
|
||||||
<title>Worktables</title>
|
<text>When working with the Smeltery, there are a few things to keep in mind:
|
||||||
<text>
|
|
||||||
|
|
||||||
In general:
|
* 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.
|
||||||
- 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>
|
* 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>
|
||||||
|
|
||||||
<page type="text">
|
<page type="text">
|
||||||
<text>Blank patterns are where the
|
<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.
|
||||||
</text>
|
|
||||||
</page>
|
|
||||||
|
|
||||||
<page type="craftingrecipe">
|
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.
|
||||||
<title>Blank Wood Pattern</title>
|
|
||||||
<recipe>woodpattern</recipe>
|
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>
|
||||||
|
|
||||||
<page type="text">
|
<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>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.
|
||||||
</text>
|
|
||||||
|
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>
|
||||||
|
|
||||||
<page type="craftingrecipe">
|
<page type="picture">
|
||||||
<title>Stencil Table</title>
|
<text>Figure 1a</text>
|
||||||
<recipe>stenciltable</recipe>
|
<picture>/mods/tinker/resources/manuals/smelterysmall.png</picture>
|
||||||
</page>
|
</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">
|
<page type="text">
|
||||||
<text></text>
|
<text>To be continued...</text>
|
||||||
</page>
|
</page>
|
||||||
</book>
|
</book>
|
BIN
mods/tinker/resources/manuals/smelterysmall.png
Normal file
After Width: | Height: | Size: 46 KiB |
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -23,7 +23,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
|||||||
* @author: mDiyo
|
* @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)
|
@NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.TPacketHandler.class)
|
||||||
public class TConstruct
|
public class TConstruct
|
||||||
{
|
{
|
||||||
@ -63,9 +63,8 @@ public class TConstruct
|
|||||||
public void init (FMLInitializationEvent evt)
|
public void init (FMLInitializationEvent evt)
|
||||||
{
|
{
|
||||||
GameRegistry.registerWorldGenerator(new TBaseWorldGenerator());
|
GameRegistry.registerWorldGenerator(new TBaseWorldGenerator());
|
||||||
playerTracker = new TPlayerHandler();
|
GameRegistry.registerFuelHandler(content);
|
||||||
MinecraftForge.EVENT_BUS.register(playerTracker);
|
GameRegistry.registerCraftingHandler(new TCraftingHandler());
|
||||||
GameRegistry.registerPlayerTracker(playerTracker);
|
|
||||||
NetworkRegistry.instance().registerGuiHandler(instance, new TGuiHandler());
|
NetworkRegistry.instance().registerGuiHandler(instance, new TGuiHandler());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,12 +73,13 @@ public class TConstruct
|
|||||||
{
|
{
|
||||||
content.modIntegration();
|
content.modIntegration();
|
||||||
content.oreRegistry();
|
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 TEventHandler events;
|
||||||
public static TAfterEventHandler lateEvents;
|
|
||||||
public static TPlayerHandler playerTracker;
|
public static TPlayerHandler playerTracker;
|
||||||
public static TContent content;
|
public static TContent content;
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package mods.tinker.tconstruct;
|
package mods.tinker.tconstruct;
|
||||||
|
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -177,7 +178,6 @@ public class TContent implements IFuelHandler
|
|||||||
addSmelteryRecipes();
|
addSmelteryRecipes();
|
||||||
addCraftingRecipes();
|
addCraftingRecipes();
|
||||||
setupToolTabs();
|
setupToolTabs();
|
||||||
GameRegistry.registerFuelHandler(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void createEntities ()
|
void createEntities ()
|
||||||
@ -346,7 +346,7 @@ public class TContent implements IFuelHandler
|
|||||||
//Thaumcraft
|
//Thaumcraft
|
||||||
TConstructRegistry.addToolMaterial(21, "Thaumium", 2, 2, 250, 600, 2, 1.3F, 1, 0f);
|
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(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(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);
|
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(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(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(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;
|
PatternBuilder pb = PatternBuilder.instance;
|
||||||
if (PHConstruct.enableTWood)
|
if (PHConstruct.enableTWood)
|
||||||
@ -540,6 +540,7 @@ public class TContent implements IFuelHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WeakReference<ToolCore> tool = new WeakReference<ToolCore>(null);
|
||||||
void addSmelteryRecipes ()
|
void addSmelteryRecipes ()
|
||||||
{
|
{
|
||||||
//Ore
|
//Ore
|
||||||
|
29
mods/tinker/tconstruct/TCraftingHandler.java
Normal 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) {}
|
||||||
|
|
||||||
|
}
|
@ -249,6 +249,14 @@ public class TProxyClient extends TProxyCommon
|
|||||||
TConstructClientRegistry.registerManualIcon("blankcast", new ItemStack(TContent.blankPattern, 1, 1));
|
TConstructClientRegistry.registerManualIcon("blankcast", new ItemStack(TContent.blankPattern, 1, 1));
|
||||||
TConstructClientRegistry.registerManualIcon("castingtable", new ItemStack(TContent.searedBlock));
|
TConstructClientRegistry.registerManualIcon("castingtable", new ItemStack(TContent.searedBlock));
|
||||||
TConstructClientRegistry.registerManualIcon("liquidiron", new ItemStack(TContent.liquidMetalStill));
|
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)
|
public static Document getManualFromStack (ItemStack stack)
|
||||||
|
@ -42,16 +42,12 @@ public class GuiManual extends GuiScreen
|
|||||||
ItemStack[] iconsRight;
|
ItemStack[] iconsRight;
|
||||||
String[] multiTextRight;
|
String[] multiTextRight;
|
||||||
|
|
||||||
//CustomFont font;
|
|
||||||
//int guiscale;
|
|
||||||
|
|
||||||
public GuiManual(ItemStack stack, Document doc)
|
public GuiManual(ItemStack stack, Document doc)
|
||||||
{
|
{
|
||||||
this.mc = Minecraft.getMinecraft();
|
this.mc = Minecraft.getMinecraft();
|
||||||
this.itemstackBook = stack;
|
this.itemstackBook = stack;
|
||||||
currentPage = 0; //Stack page
|
currentPage = 0; //Stack page
|
||||||
manual = doc;
|
manual = doc;
|
||||||
//font = new CustomFont(mc, "Times New Roman", 16);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -64,16 +60,6 @@ public class GuiManual extends GuiScreen
|
|||||||
this.height = h;
|
this.height = h;
|
||||||
this.buttonList.clear();
|
this.buttonList.clear();
|
||||||
this.initGui();
|
this.initGui();
|
||||||
|
|
||||||
/*int scale = 0;
|
|
||||||
|
|
||||||
while (width / (scale + 1) >= 160)
|
|
||||||
{
|
|
||||||
scale++;
|
|
||||||
}
|
|
||||||
|
|
||||||
guiscale = scale;*/
|
|
||||||
//font.scale = scale;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initGui ()
|
public void initGui ()
|
||||||
@ -100,7 +86,7 @@ public class GuiManual extends GuiScreen
|
|||||||
|
|
||||||
void updateText ()
|
void updateText ()
|
||||||
{
|
{
|
||||||
if (currentPage >= maxPages - 1)
|
if (currentPage >= maxPages)
|
||||||
currentPage = maxPages - 2;
|
currentPage = maxPages - 2;
|
||||||
if (currentPage % 2 == 1)
|
if (currentPage % 2 == 1)
|
||||||
currentPage--;
|
currentPage--;
|
||||||
@ -124,16 +110,48 @@ public class GuiManual extends GuiScreen
|
|||||||
|
|
||||||
else if (pageLeftType.equals("contents"))
|
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()];
|
multiTextLeft = new String[nodes.getLength()];
|
||||||
iconsLeft = new ItemStack[nodes.getLength()];
|
iconsLeft = new ItemStack[nodes.getLength()];
|
||||||
for (int i = 0; i < nodes.getLength(); i++)
|
for (int i = 0; i < nodes.getLength(); i++)
|
||||||
{
|
{
|
||||||
NodeList children = nodes.item(i).getChildNodes();
|
NodeList children = nodes.item(i).getChildNodes();
|
||||||
multiTextLeft[i] = children.item(0).getTextContent();
|
multiTextLeft[i] = children.item(1).getTextContent();
|
||||||
iconsLeft[i] = TConstructClientRegistry.getManualIcon(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);
|
node = nList.item(currentPage + 1);
|
||||||
@ -151,8 +169,11 @@ public class GuiManual extends GuiScreen
|
|||||||
|
|
||||||
else if (pageRightType.equals("contents"))
|
else if (pageRightType.equals("contents"))
|
||||||
{
|
{
|
||||||
//Minecraft.getMinecraft().getLogAgent().logInfo("Contents!");
|
NodeList nodes = element.getElementsByTagName("text");
|
||||||
NodeList nodes = element.getElementsByTagName("link");
|
if (nodes != null)
|
||||||
|
textRight = nodes.item(0).getTextContent();
|
||||||
|
|
||||||
|
nodes = element.getElementsByTagName("link");
|
||||||
multiTextRight = new String[nodes.getLength()];
|
multiTextRight = new String[nodes.getLength()];
|
||||||
iconsRight = new ItemStack[nodes.getLength()];
|
iconsRight = new ItemStack[nodes.getLength()];
|
||||||
for (int i = 0; i < nodes.getLength(); i++)
|
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());
|
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
|
else
|
||||||
{
|
{
|
||||||
@ -172,55 +221,77 @@ public class GuiManual extends GuiScreen
|
|||||||
|
|
||||||
public void drawScreen (int par1, int par2, float par3)
|
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);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/bookright.png");
|
this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/bookright.png");
|
||||||
int localWidth = (this.width) / 2;
|
int localWidth = (this.width) / 2;
|
||||||
byte localHeight = 8;
|
byte localHeight = 8;
|
||||||
this.drawTexturedModalRect(localWidth, localHeight, 0, 0, this.bookImageWidth, this.bookImageHeight);
|
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);
|
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");
|
this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/bookleft.png");
|
||||||
localWidth = localWidth - this.bookImageWidth;
|
localWidth = localWidth - this.bookImageWidth;
|
||||||
this.drawTexturedModalRect(localWidth, localHeight, 256 - this.bookImageWidth, 0, this.bookImageWidth, this.bookImageHeight);
|
this.drawTexturedModalRect(localWidth, localHeight, 256 - this.bookImageWidth, 0, this.bookImageWidth, this.bookImageHeight);
|
||||||
|
|
||||||
super.drawScreen(par1, par2, par3);
|
super.drawScreen(par1, par2, par3);
|
||||||
|
|
||||||
//if (textLeft != null)
|
//Workaround
|
||||||
//{
|
if (pageLeftType.equals("picture"))
|
||||||
if (pageLeftType.equals("text"))
|
{
|
||||||
{
|
drawPicture(multiTextLeft[0], localWidth + 16, localHeight + 12);
|
||||||
if (textLeft != null)
|
}
|
||||||
drawTextPage(textLeft, localWidth + 16, localHeight + 12);
|
if (pageRightType.equals("picture"))
|
||||||
}
|
{
|
||||||
else if (pageLeftType.equals("intro"))
|
drawPicture(multiTextRight[0], localWidth + 220, localHeight + 12);
|
||||||
{
|
}
|
||||||
if (textLeft != null)
|
|
||||||
drawTitlePage(textLeft, localWidth + 16, localHeight + 12);
|
if (pageLeftType.equals("text"))
|
||||||
}
|
{
|
||||||
else if (pageLeftType.equals("contents"))
|
if (textLeft != null)
|
||||||
drawContentTablePage(iconsLeft, localWidth + 16, localHeight + 12);
|
drawTextPage(textLeft, localWidth + 16, localHeight + 12);
|
||||||
//}
|
}
|
||||||
//if (textRight != null)
|
else if (pageLeftType.equals("intro"))
|
||||||
//{
|
{
|
||||||
if (pageRightType.equals("text"))
|
if (textLeft != null)
|
||||||
{
|
drawTitlePage(textLeft, localWidth + 16, localHeight + 12);
|
||||||
if (textRight != null)
|
}
|
||||||
drawTextPage(textRight, localWidth + 220, localHeight + 12);
|
else if (pageLeftType.equals("contents"))
|
||||||
}
|
{
|
||||||
else if (pageRightType.equals("intro"))
|
drawContentTablePage(textLeft, iconsLeft, multiTextLeft, localWidth + 16, localHeight + 12);
|
||||||
{
|
}
|
||||||
if (textRight != null)
|
else if (pageLeftType.equals("sidebar"))
|
||||||
drawTitlePage(textRight, localWidth + 220, localHeight + 12);
|
{
|
||||||
}
|
drawSidebarPage(textLeft, iconsLeft, multiTextLeft, localWidth + 16, localHeight + 12);
|
||||||
else if (pageRightType.equals("contents"))
|
}
|
||||||
drawContentTablePage(iconsRight, localWidth + 220, 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)
|
public void drawTextPage (String text, int localWidth, int localHeight)
|
||||||
{
|
{
|
||||||
this.fontRenderer.drawSplitString(text, localWidth, localHeight, 178, 0);
|
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);
|
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++)
|
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);
|
||||||
this.fontRenderer.drawString(multiTextRight[i], localWidth+38, localHeight + 18*i + 18, 0);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,7 @@ public class SmelteryLogic extends InventoryLogic
|
|||||||
int maxTemp;
|
int maxTemp;
|
||||||
public int useTime;
|
public int useTime;
|
||||||
public int fuelGague;
|
public int fuelGague;
|
||||||
|
boolean inUse;
|
||||||
|
|
||||||
ArrayList<CoordTuple> lavaTanks;
|
ArrayList<CoordTuple> lavaTanks;
|
||||||
CoordTuple activeLavaTank;
|
CoordTuple activeLavaTank;
|
||||||
@ -208,12 +209,16 @@ public class SmelteryLogic extends InventoryLogic
|
|||||||
{
|
{
|
||||||
if (useTime > 0)
|
if (useTime > 0)
|
||||||
{
|
{
|
||||||
|
inUse = false;
|
||||||
for (int i = 0; i < 9 * layers; i++)
|
for (int i = 0; i < 9 * layers; i++)
|
||||||
{
|
{
|
||||||
if (meltingTemps[i] > 20 && this.isStackInSlot(i))
|
if (meltingTemps[i] > 20 && this.isStackInSlot(i))
|
||||||
{
|
{
|
||||||
if (activeTemps[i] < internalTemp && activeTemps[i] < meltingTemps[i])
|
if (activeTemps[i] < internalTemp && activeTemps[i] < meltingTemps[i])
|
||||||
|
{
|
||||||
activeTemps[i] += 1;
|
activeTemps[i] += 1;
|
||||||
|
inUse = true;
|
||||||
|
}
|
||||||
else if (meltingTemps[i] >= activeTemps[i])
|
else if (meltingTemps[i] >= activeTemps[i])
|
||||||
{
|
{
|
||||||
if (!worldObj.isRemote)
|
if (!worldObj.isRemote)
|
||||||
@ -293,7 +298,7 @@ public class SmelteryLogic extends InventoryLogic
|
|||||||
{
|
{
|
||||||
fuelGague = 0;
|
fuelGague = 0;
|
||||||
}
|
}
|
||||||
if (tankContainer instanceof ITankContainer)
|
if (tankContainer instanceof ITankContainer && inUse)
|
||||||
{
|
{
|
||||||
LiquidStack liquid = ((ITankContainer) tankContainer).drain(ForgeDirection.DOWN, 50, false);
|
LiquidStack liquid = ((ITankContainer) tankContainer).drain(ForgeDirection.DOWN, 50, false);
|
||||||
if (liquid != null && liquid.itemID == Block.lavaStill.blockID)
|
if (liquid != null && liquid.itemID == Block.lavaStill.blockID)
|
||||||
|
@ -1,18 +1,25 @@
|
|||||||
package mods.tinker.tconstruct.player;
|
package mods.tinker.tconstruct.player;
|
||||||
|
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import mods.tinker.tconstruct.AbilityHelper;
|
import mods.tinker.tconstruct.AbilityHelper;
|
||||||
import mods.tinker.tconstruct.PHConstruct;
|
import mods.tinker.tconstruct.PHConstruct;
|
||||||
import mods.tinker.tconstruct.TContent;
|
import mods.tinker.tconstruct.TContent;
|
||||||
import mods.tinker.tconstruct.client.TProxyClient;
|
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.Entity;
|
||||||
import net.minecraft.entity.EnumEntitySize;
|
import net.minecraft.entity.EnumEntitySize;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
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.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraftforge.event.ForgeSubscribe;
|
import net.minecraftforge.event.ForgeSubscribe;
|
||||||
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||||
|
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
|
||||||
import net.minecraftforge.event.entity.player.PlayerDropsEvent;
|
import net.minecraftforge.event.entity.player.PlayerDropsEvent;
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
import cpw.mods.fml.common.IPlayerTracker;
|
import cpw.mods.fml.common.IPlayerTracker;
|
||||||
@ -34,11 +41,13 @@ public class TPlayerHandler implements IPlayerTracker
|
|||||||
tags.setCompoundTag("TConstruct", new NBTTagCompound());
|
tags.setCompoundTag("TConstruct", new NBTTagCompound());
|
||||||
}
|
}
|
||||||
TPlayerStats stats = new TPlayerStats();
|
TPlayerStats stats = new TPlayerStats();
|
||||||
stats.player = entityplayer;
|
stats.player = new WeakReference<EntityPlayer>(entityplayer);
|
||||||
stats.level = entityplayer.experienceLevel;
|
stats.level = entityplayer.experienceLevel;
|
||||||
stats.health = 20; //More hp in the future
|
stats.health = 20; //More hp in the future
|
||||||
stats.hunger = entityplayer.getFoodStats().getFoodLevel();
|
stats.hunger = entityplayer.getFoodStats().getFoodLevel();
|
||||||
stats.diary = tags.getCompoundTag("TConstruct").getBoolean("diary");
|
stats.diary = tags.getCompoundTag("TConstruct").getBoolean("diary");
|
||||||
|
stats.stationManual = tags.getCompoundTag("TConstruct").getBoolean("stationManual");
|
||||||
|
stats.smelteryManual = tags.getCompoundTag("TConstruct").getBoolean("smelteryManual");
|
||||||
if (!stats.diary)
|
if (!stats.diary)
|
||||||
{
|
{
|
||||||
tags.getCompoundTag("TConstruct").setBoolean("diary", true);
|
tags.getCompoundTag("TConstruct").setBoolean("diary", true);
|
||||||
@ -70,13 +79,18 @@ public class TPlayerHandler implements IPlayerTracker
|
|||||||
{
|
{
|
||||||
//Boom!
|
//Boom!
|
||||||
TPlayerStats stats = getPlayerStats(entityplayer.username);
|
TPlayerStats stats = getPlayerStats(entityplayer.username);
|
||||||
stats.player = entityplayer;
|
stats.player = new WeakReference<EntityPlayer>(entityplayer);
|
||||||
|
|
||||||
if (PHConstruct.keepLevels)
|
if (PHConstruct.keepLevels)
|
||||||
entityplayer.experienceLevel = stats.level;
|
entityplayer.experienceLevel = stats.level;
|
||||||
if (PHConstruct.keepHunger)
|
if (PHConstruct.keepHunger)
|
||||||
entityplayer.getFoodStats().setFoodLevel(stats.hunger);
|
entityplayer.getFoodStats().setFoodLevel(stats.hunger);
|
||||||
NBTTagCompound tags = entityplayer.getEntityData().getCompoundTag("TConstruct");
|
NBTTagCompound tags = entityplayer.getEntityData();
|
||||||
tags.setBoolean("diary", stats.diary);
|
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();
|
Side side = FMLCommonHandler.instance().getEffectiveSide();
|
||||||
if (side == Side.CLIENT)
|
if (side == Side.CLIENT)
|
||||||
@ -98,7 +112,7 @@ public class TPlayerHandler implements IPlayerTracker
|
|||||||
//System.out.println("Client side: "+evt.entityLiving.motionY);
|
//System.out.println("Client side: "+evt.entityLiving.motionY);
|
||||||
}
|
}
|
||||||
//else
|
//else
|
||||||
//System.out.println("Server side");
|
//System.out.println("Server side");
|
||||||
|
|
||||||
evt.distance -= 1;
|
evt.distance -= 1;
|
||||||
//evt.distance = 0;
|
//evt.distance = 0;
|
||||||
@ -164,56 +178,124 @@ public class TPlayerHandler implements IPlayerTracker
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return stats.player;
|
return stats.player.get();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Modify Player */
|
/* Modify Player */
|
||||||
public void updateSize(String user, float offset)
|
public void updateSize (String user, float offset)
|
||||||
{
|
{
|
||||||
/*EntityPlayer player = getEntityPlayer(user);
|
/*EntityPlayer player = getEntityPlayer(user);
|
||||||
setEntitySize(0.6F, offset, player);
|
setEntitySize(0.6F, offset, player);
|
||||||
player.yOffset = offset - 0.18f;*/
|
player.yOffset = offset - 0.18f;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setEntitySize(float width, float height, Entity entity)
|
public static void setEntitySize (float width, float height, Entity entity)
|
||||||
{
|
{
|
||||||
System.out.println("Size: "+height);
|
System.out.println("Size: " + height);
|
||||||
if (width != entity.width || height != entity.height)
|
if (width != entity.width || height != entity.height)
|
||||||
{
|
{
|
||||||
entity.width = width;
|
entity.width = width;
|
||||||
entity.height = height;
|
entity.height = height;
|
||||||
entity.boundingBox.maxX = entity.boundingBox.minX + (double)entity.width;
|
entity.boundingBox.maxX = entity.boundingBox.minX + (double) entity.width;
|
||||||
entity.boundingBox.maxZ = entity.boundingBox.minZ + (double)entity.width;
|
entity.boundingBox.maxZ = entity.boundingBox.minZ + (double) entity.width;
|
||||||
entity.boundingBox.maxY = entity.boundingBox.minY + (double)entity.height;
|
entity.boundingBox.maxY = entity.boundingBox.minY + (double) entity.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
float que = width % 2.0F;
|
float que = width % 2.0F;
|
||||||
|
|
||||||
if ((double)que < 0.375D)
|
if ((double) que < 0.375D)
|
||||||
{
|
{
|
||||||
entity.myEntitySize = EnumEntitySize.SIZE_1;
|
entity.myEntitySize = EnumEntitySize.SIZE_1;
|
||||||
}
|
}
|
||||||
else if ((double)que < 0.75D)
|
else if ((double) que < 0.75D)
|
||||||
{
|
{
|
||||||
entity.myEntitySize = EnumEntitySize.SIZE_2;
|
entity.myEntitySize = EnumEntitySize.SIZE_2;
|
||||||
}
|
}
|
||||||
else if ((double)que < 1.0D)
|
else if ((double) que < 1.0D)
|
||||||
{
|
{
|
||||||
entity.myEntitySize = EnumEntitySize.SIZE_3;
|
entity.myEntitySize = EnumEntitySize.SIZE_3;
|
||||||
}
|
}
|
||||||
else if ((double)que < 1.375D)
|
else if ((double) que < 1.375D)
|
||||||
{
|
{
|
||||||
entity.myEntitySize = EnumEntitySize.SIZE_4;
|
entity.myEntitySize = EnumEntitySize.SIZE_4;
|
||||||
}
|
}
|
||||||
else if ((double)que < 1.75D)
|
else if ((double) que < 1.75D)
|
||||||
{
|
{
|
||||||
entity.myEntitySize = EnumEntitySize.SIZE_5;
|
entity.myEntitySize = EnumEntitySize.SIZE_5;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
entity.myEntitySize = EnumEntitySize.SIZE_6;
|
entity.myEntitySize = EnumEntitySize.SIZE_6;
|
||||||
}
|
}
|
||||||
//entity.yOffset = height;
|
//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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,18 @@
|
|||||||
package mods.tinker.tconstruct.player;
|
package mods.tinker.tconstruct.player;
|
||||||
|
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
|
||||||
public class TPlayerStats
|
public class TPlayerStats
|
||||||
{
|
{
|
||||||
public EntityPlayer player;
|
public WeakReference<EntityPlayer> player;
|
||||||
public int level;
|
public int level;
|
||||||
public int health;
|
public int health;
|
||||||
public int hunger;
|
public int hunger;
|
||||||
public boolean diary;
|
public boolean diary;
|
||||||
|
public boolean stationManual;
|
||||||
|
public boolean smelteryManual;
|
||||||
|
|
||||||
//public boolean prevOnGround;
|
//public boolean prevOnGround;
|
||||||
//public double prevMotionY;
|
//public double prevMotionY;
|
||||||
|
@ -4,6 +4,7 @@ import java.util.Random;
|
|||||||
|
|
||||||
import mods.tinker.tconstruct.PHConstruct;
|
import mods.tinker.tconstruct.PHConstruct;
|
||||||
import mods.tinker.tconstruct.TContent;
|
import mods.tinker.tconstruct.TContent;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.IChunkProvider;
|
import net.minecraft.world.chunk.IChunkProvider;
|
||||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
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);
|
//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);
|
//ardite = new ManhattanOreGenerator(TContent.oreSlag.blockID, 2, 2, 4, 100, true, false, Block.netherrack.blockID);
|
||||||
copper = new WorldGenMinable(TContent.oreSlag.blockID, 3, 9);
|
copper = new WorldGenMinable(TContent.oreSlag.blockID, 3, 9, Block.stone.blockID);
|
||||||
tin = new WorldGenMinable(TContent.oreSlag.blockID, 4, 9);
|
tin = new WorldGenMinable(TContent.oreSlag.blockID, 4, 9, Block.stone.blockID);
|
||||||
aluminum = new WorldGenMinable(TContent.oreSlag.blockID, 5, 16);
|
aluminum = new WorldGenMinable(TContent.oreSlag.blockID, 5, 16, Block.stone.blockID);
|
||||||
|
|
||||||
cobalt = new NetherOreGenerator(TContent.oreSlag.blockID, 1, 3);
|
cobalt = new WorldGenMinable(TContent.oreSlag.blockID, 1, 3, Block.netherrack.blockID);
|
||||||
ardite = new NetherOreGenerator(TContent.oreSlag.blockID, 2, 3);
|
ardite = new WorldGenMinable(TContent.oreSlag.blockID, 2, 3, Block.netherrack.blockID);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -101,6 +102,6 @@ public class TBaseWorldGenerator
|
|||||||
WorldGenMinable copper;
|
WorldGenMinable copper;
|
||||||
WorldGenMinable tin;
|
WorldGenMinable tin;
|
||||||
WorldGenMinable aluminum;
|
WorldGenMinable aluminum;
|
||||||
NetherOreGenerator cobalt;
|
WorldGenMinable cobalt;
|
||||||
NetherOreGenerator ardite;
|
WorldGenMinable ardite;
|
||||||
}
|
}
|
||||||
|
BIN
mods/tinker/textures/entity/wagon.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
mods/tinker/textures/entity/wagontexture.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
mods/tinker/textures/items/bone_chunk.png
Normal file
After Width: | Height: | Size: 360 B |
BIN
mods/tinker/textures/items/materials.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
mods/tinker/textures/items/materials/bucket_angmallen.png
Normal file
After Width: | Height: | Size: 432 B |
BIN
mods/tinker/textures/items/materials/bucket_dsteel.png
Normal file
After Width: | Height: | Size: 432 B |
BIN
mods/tinker/textures/items/materials/bucket_heptazion.png
Normal file
After Width: | Height: | Size: 432 B |
BIN
mods/tinker/textures/items/materials/pattern_ingot.png
Normal file
After Width: | Height: | Size: 360 B |
BIN
mods/tinker/textures/items/materials/tinkerbook_diary.png
Normal file
After Width: | Height: | Size: 298 B |
BIN
mods/tinker/textures/items/paper_chunk.png
Normal file
After Width: | Height: | Size: 360 B |
BIN
mods/tinker/textures/items/patterns.png
Normal file
After Width: | Height: | Size: 11 KiB |