Initial crashless build

This commit is contained in:
mDiyo committed 2013-03-11 00:05:11 -07:00
1 parent 2f5d798753
commit 1bb3c4cf7b
1162 files changed
+2913 -3311

No files matched your search

+1 -1
View File
@@ -1,3 +1,3 @@
Tinker's Construct - 1.4.7
Tinker's Construct - 1.5
Modify all the things, then do it again!
@@ -1,12 +1,12 @@
package tinker.armory;
package mods.tinker.armory;
import mods.tinker.armory.content.ArmorStandItem;
import mods.tinker.armory.content.DisplayBlock;
import mods.tinker.armory.content.Shelf;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import tinker.armory.content.ArmorStandItem;
import tinker.armory.content.DisplayBlock;
import tinker.armory.content.Shelf;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
@@ -32,7 +32,7 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
public class Armory
{
/* Proxies for sides, used for client-only processing */
@SidedProxy(clientSide = "tinker.armory.client.ArmoryProxyClient", serverSide = "tinker.armory.ArmoryProxyCommon")
@SidedProxy(clientSide = "mods.tinker.armory.client.ArmoryProxyClient", serverSide = "mods.tinker.armory.ArmoryProxyCommon")
public static ArmoryProxyCommon proxy;
/* Instance of this mod, used for grabbing prototype fields */
@@ -42,24 +42,24 @@ public class Armory
@PreInit
public void preInit(FMLPreInitializationEvent evt)
{
PHArmory.initProps();
/*PHArmory.initProps();
toolrack = new DisplayBlock(PHArmory.toolrack, Material.rock);
GameRegistry.registerBlock(toolrack, tinker.armory.content.ToolrackItem.class, "ToolRack");
GameRegistry.registerTileEntity(tinker.armory.content.ShieldrackLogic.class, "Display");
GameRegistry.registerBlock(toolrack, mods.tinker.armory.content.ToolrackItem.class, "ToolRack");
GameRegistry.registerTileEntity(mods.tinker.armory.content.ShieldrackLogic.class, "Display");
shelf = new Shelf(PHArmory.shieldrack, Material.rock);
GameRegistry.registerBlock(shelf, tinker.armory.content.ToolrackItem.class, "Shelf");
GameRegistry.registerTileEntity(tinker.armory.content.ToolrackLogic.class, "aShelf");
GameRegistry.registerBlock(shelf, mods.tinker.armory.content.ToolrackItem.class, "Shelf");
GameRegistry.registerTileEntity(mods.tinker.armory.content.ToolrackLogic.class, "aShelf");*/
/*armorStand = new ArmorStand(1501, Material.rock);
GameRegistry.registerBlock(armorStand, mDiyo.inficraft.armory.ArmorStandItem.class);
GameRegistry.registerTileEntity(mDiyo.inficraft.armory.ArmorStandLogic.class, "InfiArmorStand");*/
armorStandItem = new ArmorStandItem(PHArmory.armorItem).setItemName("armorstand");
/*armorStandItem = new ArmorStandItem(PHArmory.armorItem).setUnlocalizedName("armorstand");
LanguageRegistry.instance().addName(armorStandItem, "Armor Stand");
EntityRegistry.registerModEntity(tinker.armory.content.ArmorStandEntity.class, "Armor Stand", 0, this, 32, 5, true);
EntityRegistry.registerModEntity(mods.tinker.armory.content.ArmorStandEntity.class, "Armor Stand", 0, this, 32, 5, true);
NetworkRegistry.instance().registerGuiHandler(instance, new ArmoryGuiHandler());
GameRegistry.addRecipe(new ItemStack(Armory.instance.armorStandItem, 1, 0), " c ", "csc", " b ", 's', Item.stick, 'c', Block.cobblestone, 'b', Block.stoneSingleSlab);
GameRegistry.addRecipe(new ItemStack(Armory.instance.armorStandItem, 1, 0), " c ", "csc", " b ", 's', Item.stick, 'c', Block.cobblestone, 'b', Block.stoneSingleSlab);*/
}
@Init
@@ -1,10 +1,9 @@
package tinker.armory;
package mods.tinker.armory;
import java.util.List;
import tinker.armory.client.ArmorStandGui;
import tinker.armory.content.EntityEquipment;
import mods.tinker.armory.client.ArmorStandGui;
import mods.tinker.armory.content.EntityEquipment;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
@@ -1,4 +1,4 @@
package tinker.armory;
package mods.tinker.armory;
import java.io.File;
@@ -1,4 +1,4 @@
package tinker.armory;
package mods.tinker.armory;
import java.io.File;
import java.io.IOException;
@@ -1,6 +1,6 @@
package tinker.armory.client;
package mods.tinker.armory.client;
import tinker.armory.content.EntityEquipment;
import mods.tinker.armory.content.EntityEquipment;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
@@ -1,12 +1,11 @@
package tinker.armory.client;
package mods.tinker.armory.client;
import mods.tinker.armory.content.EntityEquipment;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
import org.lwjgl.opengl.GL11;
import tinker.armory.content.EntityEquipment;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -30,9 +29,10 @@ public class ArmorStandGui extends GuiContainer
@Override
protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3)
{
int var4 = this.mc.renderEngine.getTexture("/infitextures/gui/armorstand.png");
//int var4 = this.mc.renderEngine.getTexture("/infitextures/gui/armorstand.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(var4);
//this.mc.renderEngine.bindTexture(var4);
this.mc.renderEngine.func_98187_b("/tinkertextures/gui/armorstand.png");
int var5 = this.guiLeft;
int var6 = this.guiTop;
this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);
@@ -1,7 +1,7 @@
/*
* Armor stand model by Fudgy_Fetus
*/
package tinker.armory.client;
package mods.tinker.armory.client;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
@@ -1,11 +1,9 @@
package tinker.armory.client;
package mods.tinker.armory.client;
import java.io.File;
import tinker.armory.ArmoryProxyCommon;
import tinker.armory.content.ArmorStandEntity;
import tinker.armory.content.ToolrackLogic;
import mods.tinker.armory.ArmoryProxyCommon;
import mods.tinker.armory.content.ToolrackLogic;
import net.minecraft.client.Minecraft;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
@@ -18,7 +16,7 @@ public class ArmoryProxyClient extends ArmoryProxyCommon
RenderingRegistry.registerBlockHandler(new RenderShelf());
RenderingRegistry.registerBlockHandler(new RenderDisplay());
ClientRegistry.bindTileEntitySpecialRenderer(ToolrackLogic.class, new ShelfSpecialRender());
RenderingRegistry.registerEntityRenderingHandler(tinker.armory.content.ArmorStandEntity.class, new RenderArmorStandEntity(new ArmorStandModelStatue(), 0));
RenderingRegistry.registerEntityRenderingHandler(mods.tinker.armory.content.ArmorStandEntity.class, new RenderArmorStandEntity(new ArmorStandModelStatue(), 0));
}
@Override
@@ -1,4 +1,4 @@
package tinker.armory.client;
package mods.tinker.armory.client;
import static net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED;
import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D;
@@ -194,9 +194,11 @@ public class RenderArmorStandEntity extends RenderLiving
GL11.glScalef(-1.0F, -1.0F, 1.0F);
this.preRenderCallback(par1EntityLiving, par9);
GL11.glTranslatef(0.0F, -24.0F * var14 - 0.0078125F - 0.25F, 0.0F);
float var15 = par1EntityLiving.prevLegYaw + (par1EntityLiving.legYaw - par1EntityLiving.prevLegYaw) * par9;
float var16 = par1EntityLiving.legSwing - par1EntityLiving.legYaw * (1.0F - par9);
//float var15 = par1EntityLiving.prevLegYaw + (par1EntityLiving.legYaw - par1EntityLiving.prevLegYaw) * par9;
//float var16 = par1EntityLiving.legSwing - par1EntityLiving.legYaw * (1.0F - par9);
float var15 = 1f;
float var16 = 1f;
if (par1EntityLiving.isChild())
{
var16 *= 3.0F;
@@ -1,5 +1,7 @@
package tinker.armory.client;
package mods.tinker.armory.client;
import mods.tinker.armory.content.DisplayLogic;
import mods.tinker.common.BlockSkinRenderHelper;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
@@ -9,8 +11,6 @@ import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import tinker.armory.content.DisplayLogic;
import tinker.common.BlockSkinRenderHelper;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
@@ -0,0 +1,5 @@
package mods.tinker.armory.client;
public class RenderPedestal {
}
@@ -1,4 +1,4 @@
package tinker.armory.client;
package mods.tinker.armory.client;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
@@ -7,8 +7,6 @@ import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import tinker.armory.content.Shelf;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
@@ -1,5 +1,6 @@
package tinker.armory.client;
package mods.tinker.armory.client;
import mods.tinker.armory.content.ToolrackLogic;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.Item;
@@ -9,8 +10,6 @@ import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import tinker.armory.content.ToolrackLogic;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -22,10 +21,10 @@ public class ShelfSpecialRender extends TileEntitySpecialRenderer
@Override
public void renderTileEntityAt(TileEntity logic, double var2, double var4, double var6, float var8)
{
this.render((ToolrackLogic)logic, var2, var4, var6, var8);
//this.render((ToolrackLogic)logic, var2, var4, var6, var8);
}
public void render(ToolrackLogic logic, double posX, double posY, double posZ, float var8)
/*public void render(ToolrackLogic logic, double posX, double posY, double posZ, float var8)
{
GL11.glPushMatrix();
GL11.glTranslatef((float)posX + 0.25F, (float)posY + 0.5F, (float)posZ + 0.094F); //Center on the block
@@ -76,7 +75,7 @@ public class ShelfSpecialRender extends TileEntitySpecialRenderer
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
}*/
void drawItem(int iconIndex)
{
@@ -1,4 +1,4 @@
package tinker.armory.client;
package mods.tinker.armory.client;
import net.minecraft.block.Block;
import net.minecraft.inventory.Container;
@@ -46,13 +46,13 @@ public class SlotArmorCopy extends Slot
return par1ItemStack == null ? false : (par1ItemStack.getItem() instanceof ItemArmor ? ((ItemArmor)par1ItemStack.getItem()).armorType == this.armorType : (par1ItemStack.getItem().itemID != Block.pumpkin.blockID && par1ItemStack.getItem().itemID != Item.skull.itemID ? false : this.armorType == 0));
}
@SideOnly(Side.CLIENT)
//@SideOnly(Side.CLIENT)
/**
* Returns the icon index on items.png that is used as background image of the slot.
*/
public int getBackgroundIconIndex()
/*public int getBackgroundIconIndex()
{
return 15 + this.armorType * 16;
}
}*/
}
@@ -0,0 +1,5 @@
package mods.tinker.armory.content;
public class ArmorStandBlock {
}
@@ -1,7 +1,7 @@
package tinker.armory.content;
package mods.tinker.armory.content;
import tinker.armory.Armory;
import tinker.armory.client.ArmorStandContainer;
import mods.tinker.armory.Armory;
import mods.tinker.armory.client.ArmorStandContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
@@ -154,4 +154,18 @@ public class ArmorStandEntity extends EntityEquipment
rotationYaw = tags.getFloat("rotationYaw");
rotationYawHead = tags.getFloat("rotationYawHead");
}
@Override
public boolean func_94042_c ()
{
// TODO Auto-generated method stub
return false;
}
@Override
public boolean func_94041_b (int i, ItemStack itemstack)
{
// TODO Auto-generated method stub
return false;
}
}
@@ -1,6 +1,6 @@
package tinker.armory.content;
package mods.tinker.armory.content;
import tinker.armory.Armory;
import mods.tinker.armory.Armory;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
@@ -1,11 +1,13 @@
package tinker.armory.content;
package mods.tinker.armory.content;
import mods.tinker.armory.client.RenderDisplay;
import mods.tinker.common.InventoryBlock;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import tinker.armory.client.RenderDisplay;
import tinker.common.InventoryBlock;
public class DisplayBlock extends InventoryBlock
{
@@ -50,4 +52,16 @@ public class DisplayBlock extends InventoryBlock
{
return false;
}
@Override
public String[] getTextureNames ()
{
// TODO Auto-generated method stub
return new String[] { "toolstation_top" };
}
public void func_94332_a (IconRegister par1IconRegister)
{
this.field_94336_cN = par1IconRegister.func_94245_a(Block.blockSteel.getUnlocalizedName());
}
}
@@ -1,9 +1,9 @@
package tinker.armory.content;
package mods.tinker.armory.content;
import mods.tinker.common.InventoryLogic;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import tinker.common.InventoryLogic;
public abstract class DisplayLogic extends InventoryLogic
{
@@ -1,4 +1,4 @@
package tinker.armory.content;
package mods.tinker.armory.content;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
@@ -1,9 +1,8 @@
package tinker.armory.content;
package mods.tinker.armory.content;
import java.util.List;
import tinker.armory.client.RenderShelf;
import mods.tinker.armory.client.RenderShelf;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
@@ -45,7 +44,7 @@ public class Shelf extends BlockContainer
return new ToolrackLogic();
}
public int getBlockTextureFromSideAndMetadata(int side, int meta)
/*public int getBlockTextureFromSideAndMetadata(int side, int meta)
{
return 6;
}
@@ -54,7 +53,7 @@ public class Shelf extends BlockContainer
{
this.setBounds(var1.getBlockMetadata(var2, var3, var4));
super.addCollidingBlockToList(var1, var2, var3, var4, var5, var6, var7);
}
}*/
public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4)
{
@@ -1,4 +1,4 @@
package tinker.armory.content;
package mods.tinker.armory.content;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
@@ -13,7 +13,7 @@ public class ShieldrackLogic extends DisplayLogic
}
@Override
public String getInvName ()
public String getDefaultName ()
{
return "armory.shieldrack";
}
@@ -1,4 +1,4 @@
package tinker.armory.content;
package mods.tinker.armory.content;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
@@ -18,7 +18,7 @@ public class ToolrackItem extends ItemBlock
return md;
}
public String getItemNameIS(ItemStack itemstack)
public String getUnlocalizedName(ItemStack itemstack)
{
return (new StringBuilder()).append("block.").append(blockType[itemstack.getItemDamage()]).append("Toolrack").toString();
}
@@ -1,4 +1,4 @@
package tinker.armory.content;
package mods.tinker.armory.content;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
@@ -198,4 +198,18 @@ public class ToolrackLogic extends TileEntity
{
readFromNBT(pkt.customParam1);
}
@Override
public boolean func_94042_c ()
{
// TODO Auto-generated method stub
return false;
}
@Override
public boolean func_94041_b (int i, ItemStack itemstack)
{
// TODO Auto-generated method stub
return false;
}
}
@@ -1,10 +1,9 @@
package tinker.common;
package mods.tinker.common;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.IBlockAccess;
public class BlockSkinRenderHelper
@@ -34,7 +33,7 @@ public class BlockSkinRenderHelper
static boolean renderMetadataBlockWithAmbientOcclusion(Block block, int metadata, int xMin, int yMin, int zMin,
float xMax, float yMax, float zMax, RenderBlocks render, IBlockAccess world)
{
render.enableAO = true;
/*render.enableAO = true;
boolean var8 = false;
float var9 = render.lightValueOwn;
float var10 = render.lightValueOwn;
@@ -827,12 +826,13 @@ public class BlockSkinRenderHelper
}
render.enableAO = false;
return var8;
return var8;*/
return false;
}
static boolean renderMetadataBlockWithColorMultiplier(Block block, int metadata, int minX, int minY, int minZ, float maxX, float maxY, float maxZ, RenderBlocks render, IBlockAccess world)
{
render.enableAO = false;
/*render.enableAO = false;
Tessellator var8 = Tessellator.instance;
boolean var9 = false;
float var10 = 0.5F;
@@ -949,7 +949,8 @@ public class BlockSkinRenderHelper
var9 = true;
}
return var9;
return var9;*/
return false;
}
public static boolean renderFakeBlock (int texturePos, int metadata, int x, int y, int z, RenderBlocks renderer, IBlockAccess world)
@@ -978,7 +979,7 @@ public class BlockSkinRenderHelper
static boolean renderFakeBlockWithAmbientOcclusion(int texturePos, int metadata, int xMin, int yMin, int zMin,
float xMax, float yMax, float zMax, RenderBlocks render, IBlockAccess world)
{
Block block = Block.stone;
/*Block block = Block.stone;
render.enableAO = true;
boolean var8 = false;
float var9 = render.lightValueOwn;
@@ -1699,12 +1700,13 @@ public class BlockSkinRenderHelper
}
render.enableAO = false;
return var8;
return var8;*/
return false;
}
static boolean renderFakeBlockWithColorMultiplier(int texturePos, int metadata, int minX, int minY, int minZ, float maxX, float maxY, float maxZ, RenderBlocks render, IBlockAccess world)
{
Block block = Block.stone;
/*Block block = Block.stone;
render.enableAO = false;
Tessellator var8 = Tessellator.instance;
boolean var9 = false;
@@ -1792,6 +1794,7 @@ public class BlockSkinRenderHelper
var9 = true;
}
return var9;
return var9;*/
return false;
}
}
@@ -1,4 +1,4 @@
package tinker.common;
package mods.tinker.common;
public class CoordTuple
{
@@ -1,4 +1,4 @@
package tinker.common;
package mods.tinker.common;
public interface IActiveLogic
{
@@ -1,4 +1,4 @@
package tinker.common;
package mods.tinker.common;
import net.minecraft.entity.EntityLiving;
import net.minecraftforge.common.ForgeDirection;
@@ -1,7 +1,7 @@
package tinker.common;
package mods.tinker.common;
import mods.tinker.tconstruct.crafting.PatternBuilder.MaterialSet;
import net.minecraft.item.ItemStack;
import tinker.tconstruct.crafting.PatternBuilder.MaterialSet;
public interface IPattern
{
@@ -1,4 +1,4 @@
package tinker.common;
package mods.tinker.common;
import net.minecraft.item.ItemStack;
@@ -1,17 +1,18 @@
package tinker.common;
package mods.tinker.common;
import mods.tinker.tconstruct.TConstruct;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import tinker.tconstruct.TConstruct;
public abstract class InventoryBlock extends BlockContainer
{
@@ -79,7 +80,7 @@ public abstract class InventoryBlock extends BlockContainer
if (stack.hasTagCompound())
{
entityitem.func_92014_d().setTagCompound((NBTTagCompound) stack.getTagCompound().copy());
entityitem.getEntityItem().setTagCompound((NBTTagCompound) stack.getTagCompound().copy());
}
float offset = 0.05F;
@@ -95,8 +96,10 @@ public abstract class InventoryBlock extends BlockContainer
super.breakBlock(par1World, x, y, z, par5, par6);
}
/* Placement */
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving entityliving)
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving entityliving, ItemStack stack)
{
TileEntity logic = world.getBlockTileEntity(x, y, z);
if (logic instanceof IFacingLogic)
@@ -127,4 +130,20 @@ public abstract class InventoryBlock extends BlockContainer
{
return meta;
}
/* Textures */
public Icon[] icons;
public abstract String[] getTextureNames();
public void func_94332_a(IconRegister iconRegister)
{
String[] textureNames = getTextureNames();
//System.out.println("TextureNames: :"+this.getClass().getSimpleName());
this.icons = new Icon[textureNames.length];
for (int i = 0; i < this.icons.length; ++i)
{
this.icons[i] = iconRegister.func_94245_a("tinker:"+textureNames[i]);
}
}
}
@@ -1,4 +1,4 @@
package tinker.common;
package mods.tinker.common;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
@@ -19,6 +19,7 @@ public abstract class InventoryLogic extends TileEntity
implements IInventory
{
protected ItemStack[] inventory;
protected String invName;
public InventoryLogic(int invSize)
{
@@ -145,4 +146,23 @@ public abstract class InventoryLogic extends TileEntity
public ItemStack getStackInSlotOnClosing (int slot) { return null; }
public void openChest () {}
public void closeChest () {}
protected abstract String getDefaultName();
public String getInvName()
{
return this.func_94042_c() ? this.invName : getDefaultName();
}
public boolean func_94042_c()
{
return this.invName != null && this.invName.length() > 0;
}
@Override
public boolean func_94041_b (int i, ItemStack itemstack)
{
// TODO Auto-generated method stub
return false;
}
}
@@ -1,4 +1,4 @@
package tinker.common;
package mods.tinker.common;
import java.util.ArrayList;
import java.util.Iterator;
@@ -0,0 +1,25 @@
package mods.tinker.common.fancyitem;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class FancyEntityItem extends EntityItem
{
public FancyEntityItem(World par1World, double par2, double par4, double par6)
{
super(par1World, par2, par4, par6);
}
public FancyEntityItem(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack)
{
this(par1World, par2, par4, par6);
this.setEntityItemStack(par8ItemStack);
this.lifespan = (par8ItemStack.getItem() == null ? 6000 : par8ItemStack.getItem().getEntityLifespan(par8ItemStack, par1World));
}
public FancyEntityItem(World par1World)
{
super(par1World);
}
}
@@ -0,0 +1,603 @@
package mods.tinker.common.fancyitem;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.RenderEngine;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import net.minecraftforge.client.ForgeHooksClient;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class FancyItemRender extends Render
{
private RenderBlocks itemRenderBlocks = new RenderBlocks();
/** The RNG used in RenderItem (for bobbing itemstacks on the ground) */
private Random random = new Random();
public boolean field_77024_a = true;
/** Defines the zLevel of rendering of item on GUI. */
public float zLevel = 0.0F;
public static boolean field_82407_g = false;
public FancyItemRender()
{
this.shadowSize = 0.15F;
this.shadowOpaque = 0.75F;
}
/**
* Renders the item
*/
public void doRenderItem (EntityItem par1EntityItem, double par2, double par4, double par6, float par8, float par9)
{
this.random.setSeed(187L);
ItemStack itemstack = par1EntityItem.getEntityItem();
if (itemstack.getItem() != null)
{
GL11.glPushMatrix();
float f2 = shouldBob() ? MathHelper.sin(((float) par1EntityItem.age + par9) / 10.0F + par1EntityItem.hoverStart) * 0.1F + 0.1F : 0F;
float f3 = (((float) par1EntityItem.age + par9) / 20.0F + par1EntityItem.hoverStart) * (180F / (float) Math.PI);
byte b0 = getMiniBlockCount(itemstack);
GL11.glTranslatef((float) par2, (float) par4 + f2, (float) par6);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
int i;
float f4;
float f5;
float f6;
Block block = null;
if (itemstack.itemID < Block.blocksList.length)
{
block = Block.blocksList[itemstack.itemID];
}
if (ForgeHooksClient.renderEntityItem(par1EntityItem, itemstack, f2, f3, random, renderManager.renderEngine, renderBlocks))
{
;
}
else if (itemstack.func_94608_d() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
{
GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F);
if (field_82407_g)
{
GL11.glScalef(1.25F, 1.25F, 1.25F);
GL11.glTranslatef(0.0F, 0.05F, 0.0F);
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
}
this.loadTexture("/terrain.png");
float f7 = 0.25F;
int j = block.getRenderType();
if (j == 1 || j == 19 || j == 12 || j == 2)
{
f7 = 0.5F;
}
GL11.glScalef(f7, f7, f7);
for (i = 0; i < b0; ++i)
{
GL11.glPushMatrix();
if (i > 0)
{
f5 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7;
f4 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7;
f6 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7;
GL11.glTranslatef(f5, f4, f6);
}
f5 = 1.0F;
this.itemRenderBlocks.renderBlockAsItem(block, itemstack.getItemDamage(), f5);
GL11.glPopMatrix();
}
}
else
{
float f8;
if (itemstack.getItem().requiresMultipleRenderPasses())
{
if (field_82407_g)
{
GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F);
GL11.glTranslatef(0.0F, -0.05F, 0.0F);
}
else
{
GL11.glScalef(0.5F, 0.5F, 0.5F);
}
this.loadTexture("/gui/items.png");
for (int k = 0; k <= itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); ++k)
{
this.random.setSeed(187L);
Icon icon = itemstack.getItem().getIcon(itemstack, k);
f8 = 1.0F;
if (this.field_77024_a)
{
i = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, k);
f5 = (float) (i >> 16 & 255) / 255.0F;
f4 = (float) (i >> 8 & 255) / 255.0F;
f6 = (float) (i & 255) / 255.0F;
GL11.glColor4f(f5 * f8, f4 * f8, f6 * f8, 1.0F);
this.renderDroppedItem(par1EntityItem, icon, b0, par9, f5 * f8, f4 * f8, f6 * f8);
}
else
{
this.renderDroppedItem(par1EntityItem, icon, b0, par9, 1.0F, 1.0F, 1.0F);
}
}
}
else
{
if (field_82407_g)
{
GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F);
GL11.glTranslatef(0.0F, -0.05F, 0.0F);
}
else
{
GL11.glScalef(0.5F, 0.5F, 0.5F);
}
Icon icon1 = itemstack.getIconIndex();
if (itemstack.func_94608_d() == 0)
{
this.loadTexture("/terrain.png");
}
else
{
this.loadTexture("/gui/items.png");
}
if (this.field_77024_a)
{
int l = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, 0);
f8 = (float) (l >> 16 & 255) / 255.0F;
float f9 = (float) (l >> 8 & 255) / 255.0F;
f5 = (float) (l & 255) / 255.0F;
f4 = 1.0F;
this.renderDroppedItem(par1EntityItem, icon1, b0, par9, f8 * f4, f9 * f4, f5 * f4);
}
else
{
this.renderDroppedItem(par1EntityItem, icon1, b0, par9, 1.0F, 1.0F, 1.0F);
}
}
}
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
}
/**
* Renders a dropped item
*/
private void renderDroppedItem (EntityItem par1EntityItem, Icon par2Icon, int par3, float par4, float par5, float par6, float par7)
{
Tessellator tessellator = Tessellator.instance;
if (par2Icon == null)
{
par2Icon = this.renderManager.renderEngine.func_96448_c(par1EntityItem.getEntityItem().func_94608_d());
}
float f4 = par2Icon.func_94209_e();
float f5 = par2Icon.func_94212_f();
float f6 = par2Icon.func_94206_g();
float f7 = par2Icon.func_94210_h();
float f8 = 1.0F;
float f9 = 0.5F;
float f10 = 0.25F;
float f11;
GL11.glPushMatrix();
if (field_82407_g)
{
GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
}
else
{
GL11.glRotatef((((float) par1EntityItem.age + par4) / 20.0F + par1EntityItem.hoverStart) * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F);
}
float f12 = 0.0625F;
f11 = 0.021875F;
ItemStack itemstack = par1EntityItem.getEntityItem();
int j = itemstack.stackSize;
byte b0 = getMiniItemCount(itemstack);
GL11.glTranslatef(-f9, -f10, -((f12 + f11) * (float) b0 / 2.0F));
for (int k = 0; k < b0; ++k)
{
// Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug...
if (k > 0 && shouldSpreadItems())
{
float x = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
float y = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
float z = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
GL11.glTranslatef(x, y, f12 + f11);
}
else
{
GL11.glTranslatef(0f, 0f, f12 + f11);
}
if (itemstack.func_94608_d() == 0 && itemstack.itemID < Block.blocksList.length && Block.blocksList[itemstack.itemID] != null)
{
this.loadTexture("/terrain.png");
}
else
{
this.loadTexture("/gui/items.png");
}
GL11.glColor4f(par5, par6, par7, 1.0F);
ItemRenderer.renderItemIn2D(tessellator, f5, f6, f4, f7, par2Icon.func_94213_j(), par2Icon.func_94208_k(), f12);
if (itemstack != null && itemstack.hasEffect())
{
GL11.glDepthFunc(GL11.GL_EQUAL);
GL11.glDisable(GL11.GL_LIGHTING);
this.renderManager.renderEngine.func_98187_b("%blur%/misc/glint.png");
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
float f13 = 0.76F;
GL11.glColor4f(0.5F * f13, 0.25F * f13, 0.8F * f13, 1.0F);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glPushMatrix();
float f14 = 0.125F;
GL11.glScalef(f14, f14, f14);
float f15 = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F;
GL11.glTranslatef(f15, 0.0F, 0.0F);
GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glScalef(f14, f14, f14);
f15 = (float) (Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F;
GL11.glTranslatef(-f15, 0.0F, 0.0F);
GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12);
GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDepthFunc(GL11.GL_LEQUAL);
}
}
GL11.glPopMatrix();
}
/**
* Renders the item's icon or block into the UI at the specified position.
*/
public void renderItemIntoGUI (FontRenderer par1FontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5)
{
int k = par3ItemStack.itemID;
int l = par3ItemStack.getItemDamage();
Icon icon = par3ItemStack.getIconIndex();
float f;
float f1;
float f2;
Block block = (k < Block.blocksList.length ? Block.blocksList[k] : null);
if (par3ItemStack.func_94608_d() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[k].getRenderType()))
{
par2RenderEngine.func_98187_b("/terrain.png");
GL11.glPushMatrix();
GL11.glTranslatef((float) (par4 - 2), (float) (par5 + 3), -3.0F + this.zLevel);
GL11.glScalef(10.0F, 10.0F, 10.0F);
GL11.glTranslatef(1.0F, 0.5F, 1.0F);
GL11.glScalef(1.0F, 1.0F, -1.0F);
GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
int i1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0);
f2 = (float) (i1 >> 16 & 255) / 255.0F;
f = (float) (i1 >> 8 & 255) / 255.0F;
f1 = (float) (i1 & 255) / 255.0F;
if (this.field_77024_a)
{
GL11.glColor4f(f2, f, f1, 1.0F);
}
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
this.itemRenderBlocks.useInventoryTint = this.field_77024_a;
this.itemRenderBlocks.renderBlockAsItem(block, l, 1.0F);
this.itemRenderBlocks.useInventoryTint = true;
GL11.glPopMatrix();
}
else
{
int j1;
if (Item.itemsList[k].requiresMultipleRenderPasses())
{
GL11.glDisable(GL11.GL_LIGHTING);
par2RenderEngine.func_98187_b("/gui/items.png");
for (j1 = 0; j1 < Item.itemsList[k].getRenderPasses(l); ++j1)
{
Icon icon1 = Item.itemsList[k].getIcon(par3ItemStack, j1);
int k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, j1);
f = (float) (k1 >> 16 & 255) / 255.0F;
f1 = (float) (k1 >> 8 & 255) / 255.0F;
float f3 = (float) (k1 & 255) / 255.0F;
if (this.field_77024_a)
{
GL11.glColor4f(f, f1, f3, 1.0F);
}
this.func_94149_a(par4, par5, icon1, 16, 16);
}
GL11.glEnable(GL11.GL_LIGHTING);
}
else
{
GL11.glDisable(GL11.GL_LIGHTING);
if (par3ItemStack.func_94608_d() == 0)
{
par2RenderEngine.func_98187_b("/terrain.png");
}
else
{
par2RenderEngine.func_98187_b("/gui/items.png");
}
if (icon == null)
{
icon = par2RenderEngine.func_96448_c(par3ItemStack.func_94608_d());
}
j1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0);
float f4 = (float) (j1 >> 16 & 255) / 255.0F;
f2 = (float) (j1 >> 8 & 255) / 255.0F;
f = (float) (j1 & 255) / 255.0F;
if (this.field_77024_a)
{
GL11.glColor4f(f4, f2, f, 1.0F);
}
this.func_94149_a(par4, par5, icon, 16, 16);
GL11.glEnable(GL11.GL_LIGHTING);
}
}
GL11.glEnable(GL11.GL_CULL_FACE);
}
/**
* Render the item's icon or block into the GUI, including the glint effect.
*/
public void renderItemAndEffectIntoGUI (FontRenderer par1FontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5)
{
if (par3ItemStack != null)
{
if (!ForgeHooksClient.renderInventoryItem(renderBlocks, par2RenderEngine, par3ItemStack, field_77024_a, zLevel, (float) par4, (float) par5))
{
this.renderItemIntoGUI(par1FontRenderer, par2RenderEngine, par3ItemStack, par4, par5);
}
if (par3ItemStack.hasEffect())
{
GL11.glDepthFunc(GL11.GL_GREATER);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDepthMask(false);
par2RenderEngine.func_98187_b("%blur%/misc/glint.png");
this.zLevel -= 50.0F;
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR);
GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F);
this.func_77018_a(par4 * 431278612 + par5 * 32178161, par4 - 2, par5 - 2, 20, 20);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(true);
this.zLevel += 50.0F;
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDepthFunc(GL11.GL_LEQUAL);
}
}
}
private void func_77018_a (int par1, int par2, int par3, int par4, int par5)
{
for (int j1 = 0; j1 < 2; ++j1)
{
if (j1 == 0)
{
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
}
if (j1 == 1)
{
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
}
float f = 0.00390625F;
float f1 = 0.00390625F;
float f2 = (float) (Minecraft.getSystemTime() % (long) (3000 + j1 * 1873)) / (3000.0F + (float) (j1 * 1873)) * 256.0F;
float f3 = 0.0F;
Tessellator tessellator = Tessellator.instance;
float f4 = 4.0F;
if (j1 == 1)
{
f4 = -1.0F;
}
tessellator.startDrawingQuads();
tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + par5), (double) this.zLevel, (double) ((f2 + (float) par5 * f4) * f), (double) ((f3 + (float) par5) * f1));
tessellator.addVertexWithUV((double) (par2 + par4), (double) (par3 + par5), (double) this.zLevel, (double) ((f2 + (float) par4 + (float) par5 * f4) * f), (double) ((f3 + (float) par5) * f1));
tessellator.addVertexWithUV((double) (par2 + par4), (double) (par3 + 0), (double) this.zLevel, (double) ((f2 + (float) par4) * f), (double) ((f3 + 0.0F) * f1));
tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + 0), (double) this.zLevel, (double) ((f2 + 0.0F) * f), (double) ((f3 + 0.0F) * f1));
tessellator.draw();
}
}
/**
* Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the
* specified position.
*/
public void renderItemOverlayIntoGUI (FontRenderer par1FontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5)
{
this.func_94148_a(par1FontRenderer, par2RenderEngine, par3ItemStack, par4, par5, (String) null);
}
public void func_94148_a (FontRenderer par1FontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5, String par6Str)
{
if (par3ItemStack != null)
{
if (par3ItemStack.stackSize > 1 || par6Str != null)
{
String s1 = par6Str == null ? String.valueOf(par3ItemStack.stackSize) : par6Str;
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_DEPTH_TEST);
par1FontRenderer.drawStringWithShadow(s1, par4 + 19 - 2 - par1FontRenderer.getStringWidth(s1), par5 + 6 + 3, 16777215);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_DEPTH_TEST);
}
if (par3ItemStack.isItemDamaged())
{
int k = (int) Math.round(13.0D - (double) par3ItemStack.getItemDamageForDisplay() * 13.0D / (double) par3ItemStack.getMaxDamage());
int l = (int) Math.round(255.0D - (double) par3ItemStack.getItemDamageForDisplay() * 255.0D / (double) par3ItemStack.getMaxDamage());
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_TEXTURE_2D);
Tessellator tessellator = Tessellator.instance;
int i1 = 255 - l << 16 | l << 8;
int j1 = (255 - l) / 4 << 16 | 16128;
this.renderQuad(tessellator, par4 + 2, par5 + 13, 13, 2, 0);
this.renderQuad(tessellator, par4 + 2, par5 + 13, 12, 1, j1);
this.renderQuad(tessellator, par4 + 2, par5 + 13, k, 1, i1);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
}
}
/**
* Adds a quad to the tesselator at the specified position with the set width and height and color. Args:
* tessellator, x, y, width, height, color
*/
private void renderQuad (Tessellator par1Tessellator, int par2, int par3, int par4, int par5, int par6)
{
par1Tessellator.startDrawingQuads();
par1Tessellator.setColorOpaque_I(par6);
par1Tessellator.addVertex((double) (par2 + 0), (double) (par3 + 0), 0.0D);
par1Tessellator.addVertex((double) (par2 + 0), (double) (par3 + par5), 0.0D);
par1Tessellator.addVertex((double) (par2 + par4), (double) (par3 + par5), 0.0D);
par1Tessellator.addVertex((double) (par2 + par4), (double) (par3 + 0), 0.0D);
par1Tessellator.draw();
}
public void func_94149_a (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.func_94209_e(), (double) par3Icon.func_94210_h());
tessellator.addVertexWithUV((double) (par1 + par4), (double) (par2 + par5), (double) this.zLevel, (double) par3Icon.func_94212_f(), (double) par3Icon.func_94210_h());
tessellator.addVertexWithUV((double) (par1 + par4), (double) (par2 + 0), (double) this.zLevel, (double) par3Icon.func_94212_f(), (double) par3Icon.func_94206_g());
tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + 0), (double) this.zLevel, (double) par3Icon.func_94209_e(), (double) par3Icon.func_94206_g());
tessellator.draw();
}
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender (Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
{
this.doRenderItem((EntityItem) par1Entity, par2, par4, par6, par8, par9);
}
/**
* Items should spread out when rendered in 3d?
* @return
*/
public boolean shouldSpreadItems ()
{
return true;
}
/**
* Items should have a bob effect
* @return
*/
public boolean shouldBob ()
{
return true;
}
public byte getMiniBlockCount (ItemStack stack)
{
byte ret = 1;
if (stack.stackSize > 1)
ret = 2;
if (stack.stackSize > 5)
ret = 3;
if (stack.stackSize > 20)
ret = 4;
if (stack.stackSize > 40)
ret = 5;
return ret;
}
/**
* Allows for a subclass to override how many rendered items appear in a
* "mini item 3d stack"
* @param stack
* @return
*/
public byte getMiniItemCount (ItemStack stack)
{
byte ret = 1;
if (stack.stackSize > 1)
ret = 2;
if (stack.stackSize > 15)
ret = 3;
if (stack.stackSize > 31)
ret = 4;
return ret;
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

@@ -1,6 +1,5 @@
package tinker.tconstruct;
package mods.tinker.tconstruct;
import ic2.api.ElectricItem;
import ic2.api.ICustomElectricItem;
import ic2.api.IElectricItem;
@@ -8,6 +7,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Random;
import mods.tinker.tconstruct.tools.ToolCore;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.enchantment.EnchantmentHelper;
@@ -32,7 +32,6 @@ import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.Event.Result;
import net.minecraftforge.event.entity.player.UseHoeEvent;
import tinker.tconstruct.tools.ToolCore;
import cpw.mods.fml.client.FMLClientHandler;
public class AbilityHelper
@@ -168,7 +167,7 @@ public class AbilityHelper
if (entity instanceof EntityLiving)
{
EnchantmentThorns.func_92044_a(player, (EntityLiving)entity, random);
EnchantmentThorns.func_92096_a(player, (EntityLiving)entity, random);
}
}
@@ -217,9 +216,9 @@ public class AbilityHelper
}
}
if (!(living instanceof EntityPlayer))// || player.isPVPEnabled()) //TODO: Find an alterntive for this
if (!(living instanceof EntityPlayer) || player.func_96122_a((EntityPlayer)living))
{
List var6 = player.worldObj.getEntitiesWithinAABB(EntityWolf.class, AxisAlignedBB.getAABBPool().addOrModifyAABBInPool(player.posX, player.posY, player.posZ, player.posX + 1.0D, player.posY + 1.0D, player.posZ + 1.0D).expand(16.0D, 4.0D, 16.0D));
List var6 = player.worldObj.getEntitiesWithinAABB(EntityWolf.class, AxisAlignedBB.getAABBPool().getAABB(player.posX, player.posY, player.posZ, player.posX + 1.0D, player.posY + 1.0D, player.posZ + 1.0D).expand(16.0D, 4.0D, 16.0D));
Iterator var4 = var6.iterator();
while (var4.hasNext())
@@ -475,7 +474,7 @@ public class AbilityHelper
}
else
{
world.setBlockWithNotify(x, y, z, block.blockID);
world.func_94575_c(x, y, z, block.blockID);
onBlockChanged(stack, world, 0, x, y, z, player, random);
return true;
}
@@ -1,4 +1,4 @@
package tinker.tconstruct;
package mods.tinker.tconstruct;
import java.io.File;
import java.io.IOException;
@@ -96,6 +96,7 @@ public class PHConstruct {
longbow = config.getItem("Tools", "Longbow", 14062).getInt(14062);
buckets = config.getItem("Patterns and Misc", "Buckets", 14101).getInt(14101);
uselessItem = config.getItem("Patterns and Misc", "Title Icon", 14102).getInt(14102);
boolean ic2 = true;
boolean xycraft = true;
@@ -162,6 +163,7 @@ public class PHConstruct {
public static int manual;
public static int buckets;
public static int uselessItem;
//Tools
public static int pickaxe;
@@ -1,10 +1,7 @@
package tinker.tconstruct;
package mods.tinker.tconstruct;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EntityDamageSource;
import net.minecraft.util.StatCollector;
public class PiercingEntityDamage extends EntityDamageSource
{
@@ -1,10 +1,10 @@
package tinker.tconstruct;
package mods.tinker.tconstruct;
import java.util.Random;
import mods.tinker.tconstruct.player.TPlayerHandler;
import mods.tinker.tconstruct.worldgen.TBaseWorldGenerator;
import net.minecraftforge.common.MinecraftForge;
import tinker.tconstruct.player.TPlayerHandler;
import tinker.tconstruct.worldgen.TBaseWorldGenerator;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
@@ -24,7 +24,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
*/
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.4.7_1.1.14", dependencies = "before:*")
@NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = tinker.tconstruct.TPacketHandler.class)
@NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.TPacketHandler.class)
public class TConstruct
{
public static int ingotLiquidValue = 144;
@@ -33,7 +33,7 @@ public class TConstruct
@Instance("TConstruct")
public static TConstruct instance;
/* Proxies for sides, used for graphics processing */
@SidedProxy(clientSide = "tinker.tconstruct.client.TProxyClient", serverSide = "tinker.tconstruct.TProxyCommon")
@SidedProxy(clientSide = "mods.tinker.tconstruct.client.TProxyClient", serverSide = "mods.tinker.tconstruct.TProxyCommon")
public static TProxyCommon proxy;
public TConstruct()
@@ -52,6 +52,10 @@ public class TConstruct
blockTab = new TabTools("TConstructBlocks");
content = new TContent();
proxy.registerRenderer();
proxy.addNames();
proxy.readManuals();
proxy.registerKeys();
}
@Init
@@ -62,10 +66,6 @@ public class TConstruct
MinecraftForge.EVENT_BUS.register(playerTracker);
GameRegistry.registerPlayerTracker(playerTracker);
NetworkRegistry.instance().registerGuiHandler(instance, new TGuiHandler());
proxy.addNames();
proxy.registerRenderer();
proxy.readManuals();
proxy.registerKeys();
}
@PostInit
@@ -1,11 +1,15 @@
package tinker.tconstruct;
package mods.tinker.tconstruct;
import java.util.ArrayList;
import java.util.HashMap;
import tinker.tconstruct.client.gui.*;
import tinker.tconstruct.crafting.*;
import tinker.tconstruct.tools.*;
import mods.tinker.tconstruct.client.gui.ToolGuiElement;
import mods.tinker.tconstruct.tools.ToolCore;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.Icon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/** A registry to store any relevant API work
*
@@ -14,24 +18,29 @@ import tinker.tconstruct.tools.*;
public class TConstructRegistry
{
public static TConstructRegistry instance = new TConstructRegistry();
public static TConstructRegistry instance = new TConstructRegistry();
public static ArrayList<ToolCore> tools = new ArrayList<ToolCore>(20);
public static ArrayList<ToolGuiElement> toolButtons = new ArrayList<ToolGuiElement>(20);
public static HashMap<Integer, ToolMaterial> toolMaterials = new HashMap<Integer, ToolMaterial>(60);
@SideOnly(Side.CLIENT)
//Tools
public static void addToolMapping(ToolCore tool)
public static void addToolMapping (ToolCore tool)
{
tools.add(tool);
}
public static ArrayList<ToolCore> getToolMapping()
public static ArrayList<ToolCore> getToolMapping ()
{
return tools;
}
//Rendering
public static void addMaterialRenderMapping(int materialID, String textureLocation)
//itemMap.func_94245_a
/*public static void addMaterialRenderMapping(int materialID, String textureLocation)
{
for (ToolCore tool : TConstructRegistry.getToolMapping())
{
@@ -45,11 +54,10 @@ public class TConstructRegistry
{
tool.effectTextures.put(materialID, textureLocation);
}
}
}*/
//Materials
public static void addToolMaterial(int materialID, String materialName, int craftingTier, int harvestLevel,
int durability, int miningspeed, int attack, float handleModifier, int reinforced, float shoddy)
public static void addToolMaterial (int materialID, String materialName, int craftingTier, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced, float shoddy)
{
ToolMaterial mat = toolMaterials.get(materialID);
if (mat == null)
@@ -57,26 +65,26 @@ public class TConstructRegistry
toolMaterials.put(materialID, new ToolMaterial(materialName, craftingTier, harvestLevel, durability, miningspeed, attack, handleModifier, reinforced, shoddy));
}
else
throw new RuntimeException("TConstruct material ID "+materialID+" is already occupied by "+mat.materialName);
throw new RuntimeException("TConstruct material ID " + materialID + " is already occupied by " + mat.materialName);
}
public static ToolMaterial getMaterial(int key)
public static ToolMaterial getMaterial (int key)
{
return (toolMaterials.get(key));
}
//Gui
public static void addToolButton(ToolGuiElement element)
public static void addToolButton (ToolGuiElement element)
{
toolButtons.add(element);
}
public static void addToolButton(int slotType, int xButton, int yButton, int[] xIcons, int[] yIcons, String title, String body, String texture)
public static void addToolButton (int slotType, int xButton, int yButton, int[] xIcons, int[] yIcons, String title, String body, String texture)
{
toolButtons.add(new ToolGuiElement(slotType, xButton, yButton, xIcons, yIcons, title, body, texture));
}
public static ArrayList<ToolGuiElement> getToolButtons()
public static ArrayList<ToolGuiElement> getToolButtons ()
{
return toolButtons;
}
@@ -1,7 +1,70 @@
package tinker.tconstruct;
import java.util.ArrayList;
package mods.tinker.tconstruct;
import mods.tinker.common.IPattern;
import mods.tinker.common.fancyitem.FancyEntityItem;
import mods.tinker.tconstruct.blocks.EquipBlock;
import mods.tinker.tconstruct.blocks.LavaTankBlock;
import mods.tinker.tconstruct.blocks.MetalOre;
import mods.tinker.tconstruct.blocks.SearedBlock;
import mods.tinker.tconstruct.blocks.SmelteryBlock;
import mods.tinker.tconstruct.blocks.TConstructBlock;
import mods.tinker.tconstruct.blocks.ToolStationBlock;
import mods.tinker.tconstruct.blocks.liquids.LiquidMetalFlowing;
import mods.tinker.tconstruct.blocks.liquids.LiquidMetalStill;
import mods.tinker.tconstruct.crafting.LiquidCasting;
import mods.tinker.tconstruct.crafting.PatternBuilder;
import mods.tinker.tconstruct.crafting.Smeltery;
import mods.tinker.tconstruct.crafting.ToolBuilder;
import mods.tinker.tconstruct.entity.CartEntity;
import mods.tinker.tconstruct.entity.Crystal;
import mods.tinker.tconstruct.entity.Skyla;
import mods.tinker.tconstruct.items.CraftedSoilItemBlock;
import mods.tinker.tconstruct.items.CraftingItem;
import mods.tinker.tconstruct.items.FilledBucket;
import mods.tinker.tconstruct.items.LavaTankItemBlock;
import mods.tinker.tconstruct.items.LiquidItemBlock;
import mods.tinker.tconstruct.items.MetalItemBlock;
import mods.tinker.tconstruct.items.MetalOreItemBlock;
import mods.tinker.tconstruct.items.MetalPattern;
import mods.tinker.tconstruct.items.Pattern;
import mods.tinker.tconstruct.items.PatternManual;
import mods.tinker.tconstruct.items.SearedTableItemBlock;
import mods.tinker.tconstruct.items.SmelteryItemBlock;
import mods.tinker.tconstruct.items.TitleIcon;
import mods.tinker.tconstruct.items.ToolPart;
import mods.tinker.tconstruct.items.ToolShard;
import mods.tinker.tconstruct.items.ToolStationItemBlock;
import mods.tinker.tconstruct.logic.CastingTableLogic;
import mods.tinker.tconstruct.logic.FaucetLogic;
import mods.tinker.tconstruct.logic.FrypanLogic;
import mods.tinker.tconstruct.logic.LavaTankLogic;
import mods.tinker.tconstruct.logic.LiquidTextureLogic;
import mods.tinker.tconstruct.logic.MultiServantLogic;
import mods.tinker.tconstruct.logic.PartCrafterLogic;
import mods.tinker.tconstruct.logic.PatternChestLogic;
import mods.tinker.tconstruct.logic.PatternShaperLogic;
import mods.tinker.tconstruct.logic.SmelteryDrainLogic;
import mods.tinker.tconstruct.logic.SmelteryLogic;
import mods.tinker.tconstruct.logic.ToolStationLogic;
import mods.tinker.tconstruct.modifiers.ModBlaze;
import mods.tinker.tconstruct.modifiers.ModBoolean;
import mods.tinker.tconstruct.modifiers.ModDurability;
import mods.tinker.tconstruct.modifiers.ModElectric;
import mods.tinker.tconstruct.modifiers.ModInteger;
import mods.tinker.tconstruct.modifiers.ModLapisBase;
import mods.tinker.tconstruct.modifiers.ModLapisIncrease;
import mods.tinker.tconstruct.modifiers.ModRedstone;
import mods.tinker.tconstruct.modifiers.ModRepair;
import mods.tinker.tconstruct.tools.Axe;
import mods.tinker.tconstruct.tools.BattleSign;
import mods.tinker.tconstruct.tools.Broadsword;
import mods.tinker.tconstruct.tools.FryingPan;
import mods.tinker.tconstruct.tools.Longsword;
import mods.tinker.tconstruct.tools.Mattock;
import mods.tinker.tconstruct.tools.Pickaxe;
import mods.tinker.tconstruct.tools.Rapier;
import mods.tinker.tconstruct.tools.Shovel;
import mods.tinker.tconstruct.tools.ToolCore;
import net.minecraft.block.Block;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
@@ -17,17 +80,6 @@ import net.minecraftforge.liquids.LiquidDictionary;
import net.minecraftforge.liquids.LiquidStack;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import tinker.common.IPattern;
import tinker.common.fancyitem.FancyEntityItem;
import tinker.tconstruct.blocks.*;
import tinker.tconstruct.blocks.liquids.*;
import tinker.tconstruct.client.gui.ToolGuiElement;
import tinker.tconstruct.crafting.*;
import tinker.tconstruct.entity.*;
import tinker.tconstruct.items.*;
import tinker.tconstruct.logic.*;
import tinker.tconstruct.modifiers.*;
import tinker.tconstruct.tools.*;
import cpw.mods.fml.common.IFuelHandler;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
@@ -44,6 +96,7 @@ public class TContent implements IFuelHandler
public static Item manualBook;
public static Item buckets;
public static Item titleIcon;
//public static Item stonePattern;
//public static Item netherPattern;
@@ -78,16 +131,16 @@ public class TContent implements IFuelHandler
public static Item lumberHead;
//Crafting blocks
public static Block woodCrafter;
public static Block woodCrafter;
public static Block heldItemBlock;
public static Block craftedSoil;
public static Block smeltery;
public static Block lavaTank;
public static Block searedBlock;
public static Block oreSlag;
public static Block metalBlock;
//Traps
public static Block landmine;
@@ -95,7 +148,7 @@ public class TContent implements IFuelHandler
public static Block liquidMetalFlowing;
public static Block liquidMetalStill;
public static Material liquidMetal;
//public static Block axle;
//Tool modifiers
@@ -112,7 +165,7 @@ public class TContent implements IFuelHandler
addCraftingRecipes();
setupToolTabs();
GameRegistry.registerFuelHandler(this);
}
}
void createEntities ()
{
@@ -122,8 +175,8 @@ public class TContent implements IFuelHandler
EntityRegistry.registerModEntity(Skyla.class, "Skyla", 10, TConstruct.instance, 32, 5, true);
}
void registerBlocks()
void registerBlocks ()
{
//Tool Station
woodCrafter = new ToolStationBlock(PHConstruct.woodCrafter, Material.wood);
@@ -135,50 +188,75 @@ public class TContent implements IFuelHandler
heldItemBlock = new EquipBlock(PHConstruct.heldItemBlock, Material.wood);
GameRegistry.registerBlock(heldItemBlock, "HeldItemBlock");
GameRegistry.registerTileEntity(tinker.tconstruct.logic.FrypanLogic.class, "FrypanLogic");
craftedSoil = new TConstructBlock(PHConstruct.craftedSoil, 96, Material.sand, 3.0F, 2);
GameRegistry.registerTileEntity(FrypanLogic.class, "FrypanLogic");
String[] soilTypes = new String[] {
"slimesand",
"grout"
};
craftedSoil = new TConstructBlock(PHConstruct.craftedSoil, Material.sand, 3.0F, soilTypes);
craftedSoil.stepSound = Block.soundGravelFootstep;
GameRegistry.registerBlock(craftedSoil, tinker.tconstruct.items.CraftedSoilItemBlock.class, "CraftedSoil");
metalBlock = new TConstructBlock(PHConstruct.metalBlock, 128, Material.iron, 10.0F, 10);
GameRegistry.registerBlock(craftedSoil, CraftedSoilItemBlock.class, "CraftedSoil");
String[] metalTypes = new String[] {
"compressed_cobalt",
"compressed_ardite",
"compressed_manyullyn",
"compressed_copper",
"compressed_bronze",
"compressed_tin",
"compressed_aluminum",
"compressed_alubrass",
"compressed_alumite",
"compressed_steel"
};
metalBlock = new TConstructBlock(PHConstruct.metalBlock, Material.iron, 10.0F, metalTypes);
metalBlock.stepSound = Block.soundMetalFootstep;
GameRegistry.registerBlock(metalBlock, tinker.tconstruct.items.MetalItemBlock.class, "MetalBlock");
GameRegistry.registerBlock(metalBlock, MetalItemBlock.class, "MetalBlock");
//Smeltery
smeltery = new SmelteryBlock(PHConstruct.smeltery).setBlockName("Smeltery");
smeltery = new SmelteryBlock(PHConstruct.smeltery).setUnlocalizedName("Smeltery");
GameRegistry.registerBlock(smeltery, SmelteryItemBlock.class, "Smeltery");
GameRegistry.registerTileEntity(SmelteryLogic.class, "TConstruct.Smeltery");
GameRegistry.registerTileEntity(SmelteryDrainLogic.class, "TConstruct.SmelteryDrain");
GameRegistry.registerTileEntity(MultiServantLogic.class, "TConstruct.Servants");
lavaTank = new LavaTankBlock(PHConstruct.lavaTank).setBlockName("LavaTank");
lavaTank = new LavaTankBlock(PHConstruct.lavaTank).setUnlocalizedName("LavaTank");
lavaTank.setStepSound(Block.soundGlassFootstep);
GameRegistry.registerBlock(lavaTank, LavaTankItemBlock.class, "LavaTank");
GameRegistry.registerTileEntity(tinker.tconstruct.logic.LavaTankLogic.class, "TConstruct.LavaTank");
searedBlock = new SearedBlock(PHConstruct.searedTable).setBlockName("SearedBlock");
GameRegistry.registerTileEntity(LavaTankLogic.class, "TConstruct.LavaTank");
searedBlock = new SearedBlock(PHConstruct.searedTable).setUnlocalizedName("SearedBlock");
GameRegistry.registerBlock(searedBlock, SearedTableItemBlock.class, "SearedBlock");
GameRegistry.registerTileEntity(CastingTableLogic.class, "CastingTable");
GameRegistry.registerTileEntity(FaucetLogic.class, "Faucet");
oreSlag = new MetalOre(PHConstruct.oreSlag, 80, Material.iron, 10.0F, 6);
GameRegistry.registerBlock(oreSlag, tinker.tconstruct.items.MetalOreItemBlock.class, "SearedBrick");
String[] oreTypes = new String[] {
"nether_slag",
"nether_cobalt",
"nether_ardite",
"ore_copper",
"ore_tin",
"ore_aluminum",
"ore_slag"
};
oreSlag = new MetalOre(PHConstruct.oreSlag, Material.iron, 10.0F, oreTypes);
GameRegistry.registerBlock(oreSlag, MetalOreItemBlock.class, "SearedBrick");
MinecraftForge.setBlockHarvestLevel(oreSlag, 0, "pickaxe", 2);
MinecraftForge.setBlockHarvestLevel(oreSlag, 1, "pickaxe", 4);
MinecraftForge.setBlockHarvestLevel(oreSlag, 2, "pickaxe", 4);
MinecraftForge.setBlockHarvestLevel(oreSlag, 3, "pickaxe", 1);
MinecraftForge.setBlockHarvestLevel(oreSlag, 4, "pickaxe", 1);
MinecraftForge.setBlockHarvestLevel(oreSlag, 5, "pickaxe", 1);
//Traps
/*landmine = new Landmine(PHConstruct.landmine, 0, EnumMobType.mobs, Material.cactus).setBlockName("landmine");
/*landmine = new Landmine(PHConstruct.landmine, 0, EnumMobType.mobs, Material.cactus).setUnlocalizedName("landmine");
GameRegistry.registerBlock(landmine, "landmine");*/
//Liquids
liquidMetal = new MaterialLiquid(MapColor.tntColor);
liquidMetalFlowing = new LiquidMetalFlowing(PHConstruct.metalFlowing).setBlockName("liquid.metalFlow");
liquidMetalStill = new LiquidMetalStill(PHConstruct.metalStill).setBlockName("liquid.metalStill");
liquidMetalFlowing = new LiquidMetalFlowing(PHConstruct.metalFlowing).setUnlocalizedName("liquid.metalFlow");
liquidMetalStill = new LiquidMetalStill(PHConstruct.metalStill).setUnlocalizedName("liquid.metalStill");
GameRegistry.registerBlock(liquidMetalFlowing, LiquidItemBlock.class, "metalFlow");
GameRegistry.registerBlock(liquidMetalStill, LiquidItemBlock.class, "metalStill");
GameRegistry.registerTileEntity(LiquidTextureLogic.class, "LiquidTexture");
@@ -186,14 +264,23 @@ public class TContent implements IFuelHandler
void registerItems ()
{
blankPattern = new BlankPattern(PHConstruct.blankPattern, 96, craftingTexture).setItemName("tconstruct.blankpattern");
materials = new Materials(PHConstruct.materials, 128, craftingTexture).setItemName("tconstruct.Materials");
toolRod = new ToolPart(PHConstruct.toolRod, 0, craftingTexture).setItemName("tconstruct.ToolRod");
toolShard = new ToolShard(PHConstruct.toolShard, 64, craftingTexture).setItemName("tconstruct.ToolShard");
woodPattern = new Pattern(PHConstruct.woodPattern, 0, patternTexture).setItemName("tconstruct.Pattern");
metalPattern = new MetalPattern(PHConstruct.metalPattern, 64, patternTexture).setItemName("tconstruct.MetalPattern");
//stonePattern = new Pattern(PHTools.stonePattern, 64, patternTexture).setItemName("tconstruct.Pattern");
//netherPattern = new Pattern(PHTools.netherPattern, 128, patternTexture).setItemName("tconstruct.Pattern");
titleIcon = new TitleIcon(PHConstruct.uselessItem).setUnlocalizedName("tconstruct.titleicon");
String[] blanks = new String[] {"blankpattern", "blankcast"};
blankPattern = new CraftingItem(PHConstruct.blankPattern, blanks, blanks).setUnlocalizedName("tconstruct.blankpattern");
String[] craftingMaterials = new String[] {
"PaperStack", "SlimeCrystal", "SearedBrick", "CobaltIngot", "ArditeIngot", "ManyullynIngot", "Mossball", "LavaCrystal", "NecroticBone",
"CopperIngot", "TinIngot", "AluminumIngot", "RawAluminum", "BronzeIngot", "AlBrassIngot", "AlumiteIngot", "SteelIngot" };
String[] craftingTextures = new String[] {
"material_paper_stack", "material_slime_crystal", "material_seared_brick", "material_cobalt_ingot", "material_ardite_ingot", "material_manyullyn_ingot",
"material_mossball", "material_lava_crystal", "material_necrotic_bone", "material_copper_ingot", "material_tin_ingot", "material_aluminum_ingot",
"material_raw_aluminum", "material_bronze_ingot", "material_alubrass_ingot", "material_alumite_ingot", "material_steel_ingot" };
materials = new CraftingItem(PHConstruct.materials, craftingMaterials, craftingTextures).setUnlocalizedName("tconstruct.Materials");
toolRod = new ToolPart(PHConstruct.toolRod, "ToolRod", "_rod").setUnlocalizedName("tconstruct.ToolRod");
toolShard = new ToolShard(PHConstruct.toolShard, "ToolShard", "_shard").setUnlocalizedName("tconstruct.ToolShard");
woodPattern = new Pattern(PHConstruct.woodPattern, "WoodPattern").setUnlocalizedName("tconstruct.Pattern");
metalPattern = new MetalPattern(PHConstruct.metalPattern, "MetalPattern").setUnlocalizedName("tconstruct.MetalPattern");
//stonePattern = new Pattern(PHTools.stonePattern, 64, patternTexture).setUnlocalizedName("tconstruct.Pattern");
//netherPattern = new Pattern(PHTools.netherPattern, 128, patternTexture).setUnlocalizedName("tconstruct.Pattern");
manualBook = new PatternManual(PHConstruct.manual);
buckets = new FilledBucket(PHConstruct.buckets);
@@ -211,23 +298,21 @@ public class TContent implements IFuelHandler
mattock = new Mattock(PHConstruct.mattock, mattockTexture);
//lumberaxe = new LumberAxe(PHConstruct.lumberaxe, lumberaxeTexture);
pickaxeHead = new ToolPart(PHConstruct.pickaxeHead, 0, baseHeads).setItemName("tconstruct.PickaxeHead");
shovelHead = new ToolPart(PHConstruct.shovelHead, 64, baseHeads).setItemName("tconstruct.ShovelHead");
axeHead = new ToolPart(PHConstruct.axeHead, 128, baseHeads).setItemName("tconstruct.AxeHead");
swordBlade = new ToolPart(PHConstruct.swordBlade, 0, swordparts).setItemName("tconstruct.SwordBlade");
largeGuard = new ToolPart(PHConstruct.largeGuard, 64, swordparts).setItemName("tconstruct.LargeGuard");
medGuard = new ToolPart(PHConstruct.medGuard, 128, swordparts).setItemName("tconstruct.MediumGuard");
crossbar = new ToolPart(PHConstruct.crossbar, 192, swordparts).setItemName("tconstruct.Crossbar");
binding = new ToolPart(PHConstruct.binding, 0, baseAccessories).setItemName("tconstruct.Binding");
pickaxeHead = new ToolPart(PHConstruct.pickaxeHead, "PickaxeHead", "_pickaxe_head").setUnlocalizedName("tconstruct.PickaxeHead");
shovelHead = new ToolPart(PHConstruct.shovelHead, "ShovelHead", "_shovel_head").setUnlocalizedName("tconstruct.ShovelHead");
axeHead = new ToolPart(PHConstruct.axeHead, "AxeHead", "_axe_head").setUnlocalizedName("tconstruct.AxeHead");
swordBlade = new ToolPart(PHConstruct.swordBlade, "SwordBlade", "_sword_blade").setUnlocalizedName("tconstruct.SwordBlade");
largeGuard = new ToolPart(PHConstruct.largeGuard, "LargeGuard", "_large_guard").setUnlocalizedName("tconstruct.LargeGuard");
medGuard = new ToolPart(PHConstruct.medGuard, "MediumGuard", "_medium_guard").setUnlocalizedName("tconstruct.MediumGuard");
crossbar = new ToolPart(PHConstruct.crossbar, "Crossbar", "_crossbar").setUnlocalizedName("tconstruct.Crossbar");
binding = new ToolPart(PHConstruct.binding, "Binding", "_binding").setUnlocalizedName("tconstruct.Binding");
frypanHead = new ToolPart(PHConstruct.frypanHead, 0, jokeparts).setItemName("tconstruct.FrypanHead");
signHead = new ToolPart(PHConstruct.signHead, 64, jokeparts).setItemName("tconstruct.SignHead");
frypanHead = new ToolPart(PHConstruct.frypanHead, "FrypanHead", "_frypan_head").setUnlocalizedName("tconstruct.FrypanHead");
signHead = new ToolPart(PHConstruct.signHead, "SignHead", "_battlesign_head").setUnlocalizedName("tconstruct.SignHead");
//lumberHead = new ToolPart(PHConstruct.lumberHead, 0, broadheads).setItemName("tconstruct.LumberHead");
//lumberHead = new ToolPart(PHConstruct.lumberHead, 0, broadheads).setUnlocalizedName("tconstruct.LumberHead");
}
void registerMaterials ()
{
TConstructRegistry.addToolMaterial(0, "Wood", 1, 0, 59, 200, 0, 1.0F, 0, 0f);
@@ -247,14 +332,14 @@ public class TContent implements IFuelHandler
TConstructRegistry.addToolMaterial(14, "Bronze", 1, 2, 250, 600, 2, 1.3F, 1, 0f);
TConstructRegistry.addToolMaterial(15, "Alumite", 2, 4, 550, 800, 3, 1.3F, 2, 0f);
TConstructRegistry.addToolMaterial(16, "Steel", 2, 3, 750, 800, 3, 1.3F, 2, 0f);
//Thaumcraft
TConstructRegistry.addToolMaterial(21, "Thaumium", 2, 2, 250, 600, 2, 1.3F, 1, 0f);
//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);
TConstructRegistry.addToolMaterial(25, "Promethium", 1, 1, 200, 400, 1, 1.0F, 0, 0.5f);
TConstructRegistry.addToolMaterial(26, "Deep Iron", 1, 2, 250, 600, 2, 1.3F, 1, 0f);
TConstructRegistry.addToolMaterial(27, "Oureclase", 2, 3, 750, 800, 2, 1.2F, 0, 0f);
@@ -265,7 +350,7 @@ public class TContent implements IFuelHandler
TConstructRegistry.addToolMaterial(32, "Orichalcum", 2, 5, 1350, 900, 3, 1.25F, 0, 0f);
TConstructRegistry.addToolMaterial(33, "Adamantine", 3, 6, 1550, 1000, 4, 1.5F, 1, 0f);
TConstructRegistry.addToolMaterial(34, "Atlarus", 3, 6, 1750, 1000, 4, 1.6F, 2, 0f);
TConstructRegistry.addToolMaterial(35, "Black Steel", 2, 2, 500, 800, 2, 1.3F, 2, 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);
@@ -333,13 +418,13 @@ public class TContent implements IFuelHandler
tb.registerToolMod(new ModBlaze(new ItemStack[] { new ItemStack(Item.blazePowder), new ItemStack(Item.blazePowder) }, 7, 2));
tb.registerToolMod(new ModBoolean(new ItemStack[] { new ItemStack(materials, 1, 7) }, 6, "Lava", "\u00a74", "Auto-Smelt"));
tb.registerToolMod(new ModInteger(new ItemStack[] { new ItemStack(materials, 1, 8) }, 8, "Necrotic", 1, "\u00a78", "Life Steal"));
ItemStack ingotcast = new ItemStack(metalPattern, 1, 0);
LiquidCasting lc = LiquidCasting.instance;
//Blank
lc.addCastingRecipe(new ItemStack(blankPattern, 1, 1), new LiquidStack(liquidMetalStill.blockID, 1, 8), 50);
//Ingots
lc.addCastingRecipe(new ItemStack(Item.ingotIron), new LiquidStack(liquidMetalStill.blockID, 1, 0), ingotcast, 50); //Iron
lc.addCastingRecipe(new ItemStack(Item.ingotGold), new LiquidStack(liquidMetalStill.blockID, 1, 1), ingotcast, 50); //gold
@@ -355,52 +440,40 @@ public class TContent implements IFuelHandler
// obsidian
lc.addCastingRecipe(new ItemStack(materials, 1, 16), new LiquidStack(liquidMetalStill.blockID, 1, 12), ingotcast, 50); //steel
liquids = new LiquidStack[] {
new LiquidStack(liquidMetalStill.blockID, 1, 0),
new LiquidStack(liquidMetalStill.blockID, 1, 2),
new LiquidStack(liquidMetalStill.blockID, 1, 5),
new LiquidStack(liquidMetalStill.blockID, 1, 6),
new LiquidStack(liquidMetalStill.blockID, 1, 9),
new LiquidStack(liquidMetalStill.blockID, 1, 7),
new LiquidStack(liquidMetalStill.blockID, 1, 10),
new LiquidStack(liquidMetalStill.blockID, 1, 12)
};
int[] liquidDamage = new int[] {
2, 13, 10, 11, 12, 14, 15, 16
};
liquids = new LiquidStack[] { new LiquidStack(liquidMetalStill.blockID, 1, 0), new LiquidStack(liquidMetalStill.blockID, 1, 2), new LiquidStack(liquidMetalStill.blockID, 1, 5), new LiquidStack(liquidMetalStill.blockID, 1, 6), new LiquidStack(liquidMetalStill.blockID, 1, 9), new LiquidStack(liquidMetalStill.blockID, 1, 7), new LiquidStack(liquidMetalStill.blockID, 1, 10), new LiquidStack(liquidMetalStill.blockID, 1, 12) };
int[] liquidDamage = new int[] { 2, 13, 10, 11, 12, 14, 15, 16 };
for (int iter = 0; iter < patternOutputs.length; iter++)
{
ItemStack cast = new ItemStack(metalPattern, 1, iter+1);
ItemStack cast = new ItemStack(metalPattern, 1, iter + 1);
for (int iterTwo = 0; iterTwo < liquids.length; iterTwo++)
{
lc.addCastingRecipe(new ItemStack(patternOutputs[iter], 1, liquidDamage[iterTwo]), liquids[iterTwo], cast, 50);
}
}
}
void addSmelteryRecipes()
void addSmelteryRecipes ()
{
//Ore
Smeltery.addMelting(Block.oreIron, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 0));
Smeltery.addMelting(Block.oreGold, 0, 550, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 1));
Smeltery.addMelting(Block.oreIron, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0));
Smeltery.addMelting(Block.oreGold, 0, 550, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 1));
//Items
Smeltery.addMelting(new ItemStack(Item.ingotIron, 4), Block.blockSteel.blockID, 0, 500, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 0));
Smeltery.addMelting(new ItemStack(Item.ingotGold, 4), Block.blockGold.blockID, 0, 450, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 1));
Smeltery.addMelting(new ItemStack(Item.goldNugget, 4), Block.blockGold.blockID, 0, 450, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue/9, 1));
Smeltery.addMelting(new ItemStack(Item.goldNugget, 4), Block.blockGold.blockID, 0, 450, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue / 9, 1));
//Blocks
Smeltery.addMelting(Block.blockSteel, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 0));
Smeltery.addMelting(Block.blockGold, 0, 550, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 1));
Smeltery.addMelting(Block.blockSteel, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 0));
Smeltery.addMelting(Block.blockGold, 0, 550, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 1));
Smeltery.addMelting(Block.obsidian, 0, 800, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 11));
//Alloys
Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 4, 7), new LiquidStack(liquidMetalStill.blockID, 3, 2), new LiquidStack(liquidMetalStill.blockID, 1, 3)); //Bronze
Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 4, 8), new LiquidStack(liquidMetalStill.blockID, 3, 4), new LiquidStack(liquidMetalStill.blockID, 1, 2)); //Aluminum Brass
Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 2, 9), new LiquidStack(liquidMetalStill.blockID, 1, 5), new LiquidStack(liquidMetalStill.blockID, 1, 6)); //Manyullyn
Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 9, 10), new LiquidStack(liquidMetalStill.blockID, 5, 4),
new LiquidStack(liquidMetalStill.blockID, 2, 0), new LiquidStack(liquidMetalStill.blockID, 2, 11)); //Alumite
Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 9, 10), new LiquidStack(liquidMetalStill.blockID, 5, 4), new LiquidStack(liquidMetalStill.blockID, 2, 0), new LiquidStack(liquidMetalStill.blockID, 2, 11)); //Alumite
}
void addCraftingRecipes ()
@@ -433,13 +506,13 @@ public class TContent implements IFuelHandler
FurnaceRecipes.smelting().addSmelting(craftedSoil.blockID, 0, new ItemStack(materials, 1, 1), 2f); //Slime
FurnaceRecipes.smelting().addSmelting(craftedSoil.blockID, 1, new ItemStack(materials, 1, 2), 2f); //Seared brick item
//GameRegistry.addRecipe(new ItemStack(oreSlag, 1, 0), "pp", "pp", 'p', new ItemStack(materials, 1, 2)); //Seared brick block
FurnaceRecipes.smelting().addSmelting(oreSlag.blockID, 1, new ItemStack(materials, 1, 3), 3f);
FurnaceRecipes.smelting().addSmelting(oreSlag.blockID, 2, new ItemStack(materials, 1, 4), 3f);
FurnaceRecipes.smelting().addSmelting(oreSlag.blockID, 3, new ItemStack(materials, 1, 9), 0.5f);
FurnaceRecipes.smelting().addSmelting(oreSlag.blockID, 4, new ItemStack(materials, 1, 10), 0.5f);
FurnaceRecipes.smelting().addSmelting(oreSlag.blockID, 5, new ItemStack(materials, 1, 12), 0.5f);
//Smeltery
ItemStack searedBrick = new ItemStack(materials, 1, 2);
GameRegistry.addRecipe(new ItemStack(smeltery, 1, 0), "bbb", "b b", "bbb", 'b', searedBrick);
@@ -449,14 +522,14 @@ public class TContent implements IFuelHandler
GameRegistry.addRecipe(new ItemStack(lavaTank, 1, 0), "bbb", "bgb", "bbb", 'b', searedBrick, 'g', Block.glass);
GameRegistry.addRecipe(new ItemStack(lavaTank, 1, 1), "bgb", "ggg", "bgb", 'b', searedBrick, 'g', Block.glass);
GameRegistry.addRecipe(new ItemStack(lavaTank, 1, 2), "bgb", "bgb", "bgb", 'b', searedBrick, 'g', Block.glass);
GameRegistry.addRecipe(new ItemStack(searedBlock, 1, 0), "bbb", "b b", "b b", 'b', searedBrick);
GameRegistry.addRecipe(new ItemStack(searedBlock, 1, 1), "b b", " b ", 'b', searedBrick);
}
void setupToolTabs ()
{
TConstruct.materialTab.init(new ItemStack(TContent.woodPattern, 1, 255));
TConstruct.materialTab.init(new ItemStack(titleIcon));
TConstruct.blockTab.init(new ItemStack(woodCrafter));
ItemStack tool = new ItemStack(longsword, 1, 0);
@@ -470,8 +543,6 @@ public class TContent implements IFuelHandler
TConstruct.toolTab.init(tool);
}
public void oreRegistry ()
{
OreDictionary.registerOre("oreCobalt", new ItemStack(oreSlag, 1, 1));
@@ -479,7 +550,7 @@ public class TContent implements IFuelHandler
OreDictionary.registerOre("oreCopper", new ItemStack(oreSlag, 1, 3));
OreDictionary.registerOre("oreTin", new ItemStack(oreSlag, 1, 4));
OreDictionary.registerOre("oreNaturalAluminum", new ItemStack(oreSlag, 1, 5));
OreDictionary.registerOre("ingotCobalt", new ItemStack(materials, 1, 3));
OreDictionary.registerOre("ingotArdite", new ItemStack(materials, 1, 4));
OreDictionary.registerOre("ingotManyullyn", new ItemStack(materials, 1, 5));
@@ -502,19 +573,18 @@ public class TContent implements IFuelHandler
OreDictionary.registerOre("blockAluminumBrass", new ItemStack(metalBlock, 1, 7));
OreDictionary.registerOre("blockAlumite", new ItemStack(metalBlock, 1, 8));
OreDictionary.registerOre("blockSteel", new ItemStack(metalBlock, 1, 9));
String[] liquidNames = new String[] { "Iron", "Gold", "Copper", "Tin", "Aluminum", "Cobalt", "Ardite", "Bronze", "Brass", "Manyullyn", "Alumite", "Obsidian", "Steel" };
for (int iter = 0; iter < liquidNames.length; iter++)
{
LiquidStack liquidstack = new LiquidStack(liquidMetalStill.blockID, LiquidContainerRegistry.BUCKET_VOLUME, iter);
LiquidDictionary.getOrCreateLiquid("Molten "+liquidNames[iter], liquidstack);
LiquidDictionary.getOrCreateLiquid("Molten " + liquidNames[iter], liquidstack);
LiquidContainerRegistry.registerLiquid(new LiquidContainerData(liquidstack, new ItemStack(buckets, 1, iter), new ItemStack(Item.bucketEmpty)));
}
}
public void modIntegration ()
{
{
/* IC2 */
ItemStack reBattery = ic2.api.Items.getItem("reBattery");
if (reBattery != null)
@@ -1,4 +1,4 @@
package tinker.tconstruct;
package mods.tinker.tconstruct;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
@@ -1,23 +1,16 @@
package tinker.tconstruct;
package mods.tinker.tconstruct;
import java.util.HashMap;
import net.minecraft.entity.player.EntityPlayer;
import mods.tinker.tconstruct.crafting.PatternBuilder;
import mods.tinker.tconstruct.crafting.Smeltery;
import mods.tinker.tconstruct.logic.LiquidTextureLogic;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraftforge.event.Event.Result;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.player.FillBucketEvent;
import net.minecraftforge.event.entity.player.PlayerDropsEvent;
import net.minecraftforge.liquids.LiquidStack;
import net.minecraftforge.oredict.OreDictionary.OreRegisterEvent;
import tinker.tconstruct.crafting.PatternBuilder;
import tinker.tconstruct.crafting.Smeltery;
import tinker.tconstruct.logic.LiquidTextureLogic;
import tinker.tconstruct.player.TPlayerStats;
import cpw.mods.fml.common.IPlayerTracker;
public class TEventHandler
{
@@ -255,7 +248,7 @@ public class TEventHandler
if (meta != -1)
{
evt.world.setBlockWithNotify(hitX, hitY, hitZ, 0);
evt.world.func_94571_i(hitX, hitY, hitZ); //Set air block
evt.result = new ItemStack(TContent.buckets, 1, meta);
evt.setResult(Result.ALLOW);
}
@@ -1,28 +1,28 @@
package tinker.tconstruct;
package mods.tinker.tconstruct;
import java.util.WeakHashMap;
import mods.tinker.common.InventoryLogic;
import mods.tinker.tconstruct.client.TProxyClient;
import mods.tinker.tconstruct.client.gui.FrypanGui;
import mods.tinker.tconstruct.client.gui.GuiManual;
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.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import tinker.common.InventoryLogic;
import tinker.tconstruct.client.TProxyClient;
import tinker.tconstruct.client.gui.FrypanGui;
import tinker.tconstruct.client.gui.GuiManual;
import tinker.tconstruct.client.gui.PartCrafterGui;
import tinker.tconstruct.client.gui.PatternChestGui;
import tinker.tconstruct.client.gui.PatternShaperGui;
import tinker.tconstruct.client.gui.SmelteryGui;
import tinker.tconstruct.client.gui.ToolStationGui;
import tinker.tconstruct.container.SmelteryContainer;
import tinker.tconstruct.logic.FrypanLogic;
import tinker.tconstruct.logic.PartCrafterLogic;
import tinker.tconstruct.logic.PatternChestLogic;
import tinker.tconstruct.logic.PatternShaperLogic;
import tinker.tconstruct.logic.SmelteryLogic;
import tinker.tconstruct.logic.ToolStationLogic;
import cpw.mods.fml.common.network.IGuiHandler;
public class TGuiHandler implements IGuiHandler
@@ -1,9 +1,12 @@
package tinker.tconstruct;
package mods.tinker.tconstruct;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;
import mods.tinker.common.InventoryLogic;
import mods.tinker.tconstruct.container.SmelteryContainer;
import mods.tinker.tconstruct.logic.ToolStationLogic;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.network.INetworkManager;
@@ -11,9 +14,6 @@ import net.minecraft.network.packet.Packet250CustomPayload;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager;
import tinker.common.InventoryLogic;
import tinker.tconstruct.container.SmelteryContainer;
import tinker.tconstruct.logic.ToolStationLogic;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.network.IPacketHandler;
import cpw.mods.fml.common.network.Player;
@@ -1,4 +1,4 @@
package tinker.tconstruct;
package mods.tinker.tconstruct;
import java.io.File;
@@ -1,11 +1,7 @@
package tinker.tconstruct;
package mods.tinker.tconstruct;
import tinker.tconstruct.crafting.ToolBuilder;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class TabTools extends CreativeTabs
{
@@ -1,4 +1,4 @@
package tinker.tconstruct;
package mods.tinker.tconstruct;
/**
* This class is temporary. A full material registry is planned
*/
@@ -1,17 +1,21 @@
package tinker.tconstruct.blocks;
package mods.tinker.tconstruct.blocks;
import java.util.Random;
import mods.tinker.common.InventoryBlock;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.TGuiHandler;
import mods.tinker.tconstruct.client.FrypanRender;
import mods.tinker.tconstruct.logic.FrypanLogic;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import tinker.common.InventoryBlock;
import tinker.tconstruct.TConstruct;
import tinker.tconstruct.TGuiHandler;
import tinker.tconstruct.client.FrypanRender;
import tinker.tconstruct.logic.FrypanLogic;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class EquipBlock extends InventoryBlock
{
@@ -24,17 +28,18 @@ public class EquipBlock extends InventoryBlock
//this.setCreativeTab(ToolConstruct.materialTab);
}
/*public String getTextureFile()
@Override
public String[] getTextureNames ()
{
return "/tinkertextures/ConstructBlocks.png";
}*/
public int getBlockTextureFromSideAndMetadata (int side, int meta)
{
//return 22 + meta*6 + side;
return 22;
return new String[] { "toolstation_top" };
}
@SideOnly(Side.CLIENT)
public void func_94332_a (IconRegister par1IconRegister)
{
this.field_94336_cN = par1IconRegister.func_94245_a(Block.blockSteel.getUnlocalizedName());
}
@Override
public boolean renderAsNormalBlock ()
{
@@ -46,7 +51,7 @@ public class EquipBlock extends InventoryBlock
{
return false;
}
@Override
public int getRenderType ()
{
@@ -63,7 +68,7 @@ public class EquipBlock extends InventoryBlock
{
return new FrypanLogic();
}
public void randomDisplayTick (World world, int x, int y, int z, Random random)
{
if (isActive(world, x, y, z))
@@ -1,16 +1,14 @@
package tinker.tconstruct.blocks;
package mods.tinker.tconstruct.blocks;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.TConstruct;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFence;
import net.minecraft.block.EnumMobType;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
@@ -23,9 +21,9 @@ public class Landmine extends Block
/** The mob type that can trigger this pressure plate. */
private EnumMobType triggerMobType;
public Landmine(int par1, int par2, EnumMobType par3EnumMobType, Material par4Material)
public Landmine(int par1, EnumMobType par3EnumMobType, Material par4Material)
{
super(par1, par2, par4Material);
super(par1, par4Material);
this.triggerMobType = EnumMobType.mobs;
this.setCreativeTab(TConstruct.blockTab);
this.setTickRandomly(true);
@@ -96,7 +94,7 @@ public class Landmine extends Block
if (var6)
{
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
par1World.setBlockWithNotify(par2, par3, par4, 0);
//par1World.setBlockWithNotify(par2, par3, par4, 0);
}
}
@@ -140,17 +138,17 @@ public class Landmine extends Block
if (this.triggerMobType == EnumMobType.everything)
{
var8 = world.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double)((float)posX + var7), (double)posY, (double)((float)posZ + var7), (double)((float)(posX + 1) - var7), (double)posY + 0.25D, (double)((float)(posZ + 1) - var7)));
var8 = world.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getAABBPool().getAABB((double)((float)posX + var7), (double)posY, (double)((float)posZ + var7), (double)((float)(posX + 1) - var7), (double)posY + 0.25D, (double)((float)(posZ + 1) - var7)));
}
if (this.triggerMobType == EnumMobType.mobs)
{
var8 = world.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double)((float)posX + var7), (double)posY, (double)((float)posZ + var7), (double)((float)(posX + 1) - var7), (double)posY + 0.25D, (double)((float)(posZ + 1) - var7)));
var8 = world.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getAABBPool().getAABB((double)((float)posX + var7), (double)posY, (double)((float)posZ + var7), (double)((float)(posX + 1) - var7), (double)posY + 0.25D, (double)((float)(posZ + 1) - var7)));
}
if (this.triggerMobType == EnumMobType.players)
{
var8 = world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double)((float)posX + var7), (double)posY, (double)((float)posZ + var7), (double)((float)(posX + 1) - var7), (double)posY + 0.25D, (double)((float)(posZ + 1) - var7)));
var8 = world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getAABBPool().getAABB((double)((float)posX + var7), (double)posY, (double)((float)posZ + var7), (double)((float)(posX + 1) - var7), (double)posY + 0.25D, (double)((float)(posZ + 1) - var7)));
}
if (!var8.isEmpty())
@@ -171,7 +169,7 @@ public class Landmine extends Block
if (var6 && !var5)
{
world.setBlockWithNotify(posX, posY, posZ, 0);
//world.setBlockWithNotify(posX, posY, posZ, 0);
world.createExplosion((Entity)null, posX, posY, posZ, 2.0F, true);
/*par1World.setBlockMetadataWithNotify(posX, posY, posZ, 1);
par1World.notifyBlocksOfNeighborChange(posX, posY, posZ, this.blockID);
@@ -227,33 +225,6 @@ public class Landmine extends Block
}
}
/**
* Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube
* returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X,
* Y, Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block.
*/
public boolean isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
return par1IBlockAccess.getBlockMetadata(par2, par3, par4) > 0;
}
/**
* Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z,
* side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block.
*/
public boolean isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
return par1IBlockAccess.getBlockMetadata(par2, par3, par4) == 0 ? false : par5 == 1;
}
/**
* Can this block provide power. Only wire currently seems to have this change based on its state.
*/
public boolean canProvidePower()
{
return true;
}
/**
* Sets the block's bounds for rendering it as an item
*/
@@ -1,33 +1,62 @@
package tinker.tconstruct.blocks;
package mods.tinker.tconstruct.blocks;
import java.util.List;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.TContent;
import mods.tinker.tconstruct.client.TankRender;
import mods.tinker.tconstruct.logic.LavaTankLogic;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.liquids.LiquidContainerRegistry;
import net.minecraftforge.liquids.LiquidStack;
import tinker.tconstruct.TConstruct;
import tinker.tconstruct.TContent;
import tinker.tconstruct.client.TankRender;
import tinker.tconstruct.logic.LavaTankLogic;
public class LavaTankBlock extends BlockContainer
{
public Icon[] icons;
public LavaTankBlock(int id)
{
super(id, 38, Material.rock);
super(id, Material.rock);
setHardness(12);
setCreativeTab(TConstruct.blockTab);
setBlockName("TConstruct.LavaTank");
setUnlocalizedName("TConstruct.LavaTank");
setStepSound(Block.soundGlassFootstep);
}
public String[] getTextureNames()
{
String[] textureNames = {
"lavatank_side",
"lavatank_top",
"searedgague_top",
"searedgague_side",
"searedgague_bottom",
"searedwindow_top",
"searedwindow_side",
"searedwindow_bottom" };
return textureNames;
}
public void func_94332_a(IconRegister iconRegister)
{
String[] textureNames = getTextureNames();
this.icons = new Icon[textureNames.length];
for (int i = 0; i < this.icons.length; ++i)
{
this.icons[i] = iconRegister.func_94245_a("tinker:"+textureNames[i]);
}
}
@Override
public boolean isOpaqueCube ()
@@ -63,38 +92,37 @@ public class LavaTankBlock extends BlockContainer
return TankRender.tankModelID;
}
public int getBlockTextureFromSideAndMetadata (int side, int meta)
public Icon getBlockTextureFromSideAndMetadata (int side, int meta)
{
if (meta == 0)
{
if (side == 0 || side == 1)
{
return blockIndexInTexture + 1;
return icons[1];
}
else
{
return blockIndexInTexture;
return icons[0];
}
}
else
{
if (side == 0)
{
return blockIndexInTexture + 1 + meta * 3;
}
else if (side == 1)
{
return blockIndexInTexture + meta * 3;
}
else
{
return blockIndexInTexture - 1 + meta * 3;
}
return icons[meta*3+getTextureIndex(side)-1];
}
}
public int getTextureIndex (int side)
{
if (side == 0)
return 2;
if (side == 1)
return 0;
return 1;
}
@Override
public TileEntity createNewTileEntity (World world, int metadata)
public TileEntity createTileEntity (World world, int metadata)
{
return new LavaTankLogic();
}
@@ -122,7 +150,7 @@ public class LavaTankBlock extends BlockContainer
@Override
public TileEntity createNewTileEntity (World world)
{
return createNewTileEntity(world, 0);
return createTileEntity(world, 0);
}
@Override
@@ -1,13 +1,13 @@
package tinker.tconstruct.blocks;
package mods.tinker.tconstruct.blocks;
import net.minecraft.block.material.Material;
import net.minecraft.world.World;
public class MetalOre extends TConstructBlock
{
public MetalOre(int id, int tex, Material material, float hardness, int sub)
public MetalOre(int id, Material material, float hardness, String[] tex)
{
super(id, tex, material, hardness, sub);
super(id, material, hardness, tex);
}
public float getBlockHardness (World world, int x, int y, int z)
@@ -1,7 +1,12 @@
package tinker.tconstruct.blocks;
package mods.tinker.tconstruct.blocks;
import java.util.List;
import mods.tinker.common.InventoryBlock;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.client.SearedRender;
import mods.tinker.tconstruct.logic.CastingTableLogic;
import mods.tinker.tconstruct.logic.FaucetLogic;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.item.EntityItem;
@@ -9,22 +14,18 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import tinker.common.InventoryBlock;
import tinker.tconstruct.TConstruct;
import tinker.tconstruct.TContent;
import tinker.tconstruct.client.SearedRender;
import tinker.tconstruct.logic.CastingTableLogic;
import tinker.tconstruct.logic.FaucetLogic;
public class SearedBlock extends InventoryBlock
{
public SearedBlock(int id)
{
super(id, Material.rock);
this.setCreativeTab(TConstruct.blockTab);
blockIndexInTexture = 32;
//blockIndexInTexture = 32;
setHardness(12);
setStepSound(soundMetalFootstep);
}
@@ -140,26 +141,27 @@ public class SearedBlock extends InventoryBlock
}
@Override
public String getTextureFile ()
public String[] getTextureNames()
{
return TContent.blockTexture;
String[] textureNames = {
"castingtable_top",
"castingtable_side",
"castingtable_bottom",
"faucet"};
return textureNames;
}
public int getBlockTextureFromSideAndMetadata (int side, int meta)
@Override
public Icon getBlockTextureFromSideAndMetadata (int side, int meta)
{
if (meta == 0)
return blockIndexInTexture + meta * 3 + getBlockTextureFromSide(side);
/*else if (meta == 1)
{
if (side == 0 || side == 1)
return blockIndexInTexture + meta + 3;
else
return blockIndexInTexture + meta + 2;
}*/
return blockIndexInTexture + meta + 2;
return icons[getTextureIndex(side)];
else
return icons[3];
}
public int getBlockTextureFromSide (int side)
public int getTextureIndex (int side)
{
if (side == 0)
return 2;
@@ -242,7 +244,7 @@ public class SearedBlock extends InventoryBlock
int meta = world.getBlockMetadata(x, y, z);
if (meta == 0)
{
return AxisAlignedBB.getAABBPool().addOrModifyAABBInPool(x, y, z, x + 1, y + 1, z + 1);
return AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + 1, y + 1, z + 1);
}
if (meta == 1)
{
@@ -274,7 +276,7 @@ public class SearedBlock extends InventoryBlock
break;
}
return AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double) ((float) x + xMin), (double) y + 0.25, (double) ((float) z + zMin), (double) ((float) x + xMax), (double) y + 0.625, (double) ((float) z + zMax));
return AxisAlignedBB.getAABBPool().getAABB((double) ((float) x + xMin), (double) y + 0.25, (double) ((float) z + zMin), (double) ((float) x + xMax), (double) y + 0.625, (double) ((float) z + zMax));
}
}
@@ -1,26 +1,25 @@
package tinker.tconstruct.blocks;
package mods.tinker.tconstruct.blocks;
import java.util.List;
import java.util.Random;
import mods.tinker.common.IFacingLogic;
import mods.tinker.common.InventoryBlock;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.TGuiHandler;
import mods.tinker.tconstruct.client.SmelteryRender;
import mods.tinker.tconstruct.logic.MultiServantLogic;
import mods.tinker.tconstruct.logic.SmelteryDrainLogic;
import mods.tinker.tconstruct.logic.SmelteryLogic;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import tinker.common.IFacingLogic;
import tinker.common.InventoryBlock;
import tinker.common.InventoryLogic;
import tinker.tconstruct.TConstruct;
import tinker.tconstruct.TContent;
import tinker.tconstruct.TGuiHandler;
import tinker.tconstruct.client.SmelteryRender;
import tinker.tconstruct.logic.MultiServantLogic;
import tinker.tconstruct.logic.SmelteryDrainLogic;
import tinker.tconstruct.logic.SmelteryLogic;
public class SmelteryBlock extends InventoryBlock
{
@@ -29,102 +28,86 @@ public class SmelteryBlock extends InventoryBlock
public SmelteryBlock(int id)
{
super(id, Material.rock);
blockIndexInTexture = 64;
//blockIndexInTexture = 64;
setHardness(12F);
setStepSound(soundMetalFootstep);
rand = new Random();
this.setCreativeTab(TConstruct.blockTab);
this.setBlockName("tconstruct.Smeltery");
this.setUnlocalizedName("tconstruct.Smeltery");
}
/* Rendering */
@Override
public int getRenderType ()
{
return SmelteryRender.smelteryModel;
}
@Override
public String getTextureFile ()
public String[] getTextureNames()
{
return TContent.blockTexture;
String[] textureNames = {
"smeltery_side",
"smeltery_inactive",
"smeltery_active",
"drain_side",
"drain_out",
"drain_basin",
"searedbrick",
};
return textureNames;
}
public int getBlockTextureFromSideAndMetadata (int side, int meta)
public Icon getBlockTextureFromSideAndMetadata (int side, int meta)
{
if (meta < 2)
{
if (side == 3)
{
return blockIndexInTexture + 1 + meta * 3;
}
else
{
return blockIndexInTexture + meta * 3;
}
}
else if (meta < 4)
{
return blockIndexInTexture + meta + 4;
int sideTex = side == 3 ? 1 : 0;
return icons[sideTex + meta*3];
}
else
{
if (side == 0)
return blockIndexInTexture + meta*3 - 2;
else if (side == 1)
return blockIndexInTexture + meta*3 - 1;
else
return blockIndexInTexture + meta*3 - 3;
return icons[6];
}
}
public int getBlockTexture (IBlockAccess world, int x, int y, int z, int side)
public Icon getBlockTexture (IBlockAccess world, int x, int y, int z, int side)
{
TileEntity logic = world.getBlockTileEntity(x, y, z);
short direction = (logic instanceof IFacingLogic) ? ((IFacingLogic) logic).getRenderDirection() : 0;
int meta = world.getBlockMetadata(x, y, z);
if (meta == 0) //Smeltery
{
/*if (side == 1)
{
return blockIndexInTexture + 3 + meta * 4;
}*/
if (side == direction)
{
if (isActive(world, x, y, z))
{
return blockIndexInTexture + 2;
return icons[2];
}
else
{
return blockIndexInTexture + 1;
return icons[1];
}
}
else
{
return blockIndexInTexture + meta;
return icons[0];
}
}
if (meta == 1)
if (meta == 1) //Drain
{
if (side == direction)
return blockIndexInTexture + 2 + 3;
return icons[5];
else if (side / 2 == direction / 2)
return blockIndexInTexture + 1 + 3;
return icons[4];
else
return blockIndexInTexture + 3;
return icons[3];
}
else if (meta < 4)
else //Brick
{
return blockIndexInTexture + meta + 4;
}
else
{
if (side == 0)
return blockIndexInTexture + meta*3 - 2;
else if (side == 1)
return blockIndexInTexture + meta*3 - 1;
else
return blockIndexInTexture + meta*3 - 3;
return icons[6];
}
}
@@ -233,9 +216,9 @@ public class SmelteryBlock extends InventoryBlock
}
@Override
public void onBlockPlacedBy (World world, int x, int y, int z, EntityLiving entityliving)
public void onBlockPlacedBy (World world, int x, int y, int z, EntityLiving entityliving, ItemStack stack)
{
super.onBlockPlacedBy(world, x, y, z, entityliving);
super.onBlockPlacedBy(world, x, y, z, entityliving, stack);
if (world.getBlockMetadata(x, y, z) == 0)
onBlockPlacedElsewhere(world, x, y, z, entityliving);
}
@@ -0,0 +1,55 @@
package mods.tinker.tconstruct.blocks;
import java.util.List;
import mods.tinker.tconstruct.TConstruct;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
public class TConstructBlock extends Block
{
public String[] textureNames;
public Icon[] icons;
public TConstructBlock(int id, Material material, float hardness, String[] tex)
{
super(id, material);
setHardness(hardness);
this.setCreativeTab(TConstruct.blockTab);
textureNames = tex;
}
@Override
public int damageDropped (int meta)
{
return meta;
}
public void func_94332_a(IconRegister iconRegister)
{
this.icons = new Icon[textureNames.length];
for (int i = 0; i < this.icons.length; ++i)
{
this.icons[i] = iconRegister.func_94245_a("tinker:"+textureNames[i]);
}
}
@Override
public Icon getBlockTextureFromSideAndMetadata (int side, int meta)
{
return icons[meta];
}
@Override
public void getSubBlocks (int id, CreativeTabs tab, List list)
{
for (int iter = 0; iter < icons.length; iter++)
{
list.add(new ItemStack(id, 1, iter));
}
}
}
@@ -1,28 +1,26 @@
package tinker.tconstruct.blocks;
package mods.tinker.tconstruct.blocks;
import java.util.List;
import mods.tinker.common.InventoryBlock;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.client.TableRender;
import mods.tinker.tconstruct.logic.PartCrafterLogic;
import mods.tinker.tconstruct.logic.PatternChestLogic;
import mods.tinker.tconstruct.logic.PatternShaperLogic;
import mods.tinker.tconstruct.logic.ToolStationLogic;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import tinker.common.InventoryBlock;
import tinker.tconstruct.TConstruct;
import tinker.tconstruct.TContent;
import tinker.tconstruct.client.TableRender;
import tinker.tconstruct.logic.CastingTableLogic;
import tinker.tconstruct.logic.PartCrafterLogic;
import tinker.tconstruct.logic.PatternChestLogic;
import tinker.tconstruct.logic.PatternShaperLogic;
import tinker.tconstruct.logic.ToolStationLogic;
public class ToolStationBlock extends InventoryBlock
{
{
public ToolStationBlock(int id, Material material)
{
super(id, material);
@@ -31,39 +29,62 @@ public class ToolStationBlock extends InventoryBlock
}
/* Rendering */
public String getTextureFile ()
@Override
public String[] getTextureNames()
{
return TContent.blockTexture;
String[] textureNames = {
"toolstation_top",
"toolstation_side",
"toolstation_bottom",
"partbuilder_oak_top",
"partbuilder_oak_side",
"partbuilder_oak_bottom",
"partbuilder_spruce_top",
"partbuilder_spruce_side",
"partbuilder_spruce_bottom",
"partbuilder_birch_top",
"partbuilder_birch_side",
"partbuilder_birch_bottom",
"partbuilder_jungle_top",
"partbuilder_jungle_side",
"partbuilder_jungle_bottom",
"patternchest_top",
"patternchest_side",
"patternchest_bottom",
"stenciltable_oak_top",
"stenciltable_oak_side",
"stenciltable_oak_bottom",
"stenciltable_spruce_top",
"stenciltable_spruce_side",
"stenciltable_spruce_bottom",
"stenciltable_birch_top",
"stenciltable_birch_side",
"stenciltable_birch_bottom",
"stenciltable_jungle_top",
"stenciltable_jungle_side",
"stenciltable_jungle_bottom"};
return textureNames;
}
public int getBlockTextureFromSideAndMetadata (int side, int meta)
@Override
public Icon getBlockTextureFromSideAndMetadata (int side, int meta)
{
if (meta == 0)
if (meta <= 4)
{
if (side == 0)
return 3;
else if (side == 1)
return 0;
else if (side == 2 || side == 3)
return 1;
else
return 2;
}
else if (meta <= 4)
{
return 1 + meta * 3 + getBlockTextureFromSide(side);
return icons[meta*3+getTextureIndex(side)];
}
else if (meta <= 9)
{
return 16 + getBlockTextureFromSide(side);
return icons[15+getTextureIndex(side)];
}
else
{
return -10 + meta * 3 + getBlockTextureFromSide(side);
return icons[meta*3+getTextureIndex(side)-12];
}
}
public int getBlockTextureFromSide (int side)
public int getTextureIndex (int side)
{
if (side == 0)
return 2;
@@ -101,8 +122,8 @@ public class ToolStationBlock extends InventoryBlock
{
int metadata = world.getBlockMetadata(x, y, z);
if (metadata == 5)
return AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double) x + this.minX, (double) y + this.minY, (double) z + this.minZ, (double) x + this.maxX, (double) y + this.maxY - 0.125, (double) z + this.maxZ);
return AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double) x + this.minX, (double) y + this.minY, (double) z + this.minZ, (double) x + this.maxX, (double) y + this.maxY, (double) z + this.maxZ);
return AxisAlignedBB.getAABBPool().getAABB((double) x + this.minX, (double) y + this.minY, (double) z + this.minZ, (double) x + this.maxX, (double) y + this.maxY - 0.125, (double) z + this.maxZ);
return AxisAlignedBB.getAABBPool().getAABB((double) x + this.minX, (double) y + this.minY, (double) z + this.minZ, (double) x + this.maxX, (double) y + this.maxY, (double) z + this.maxZ);
}
public TileEntity createNewTileEntity (World world, int metadata)
@@ -1,7 +1,10 @@
package tinker.tconstruct.blocks.liquids;
package mods.tinker.tconstruct.blocks.liquids;
import java.util.Random;
import mods.tinker.tconstruct.TContent;
import mods.tinker.tconstruct.client.FluidRender;
import mods.tinker.tconstruct.logic.LiquidTextureLogic;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
@@ -10,9 +13,6 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Vec3;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import tinker.tconstruct.TContent;
import tinker.tconstruct.client.FluidRender;
import tinker.tconstruct.logic.LiquidTextureLogic;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -24,7 +24,7 @@ public abstract class LiquidMetalBase extends Block
super(par1, par2Material);
}
@Override
/*@Override
public int getBlockTexture(IBlockAccess world, int x, int y, int z, int side)
{
TileEntity logic = world.getBlockTileEntity(x, y, z);
@@ -44,7 +44,7 @@ public abstract class LiquidMetalBase extends Block
return tex;
else
return tex+1;
}
}*/
@Override
public int getRenderType ()
@@ -243,10 +243,10 @@ public abstract class LiquidMetalBase extends Block
/**
* Returns the block texture based on the side being looked at. Args: side
*/
public int getBlockTextureFromSide(int par1)
/*public int getBlockTextureFromSide(int par1)
{
return par1 != 0 && par1 != 1 ? this.blockIndexInTexture + 1 : this.blockIndexInTexture;
}
}*/
/**
* Returns the amount of fluid decay at the coordinates, or -1 if the block at the coordinates is not the same
@@ -619,11 +619,11 @@ public abstract class LiquidMetalBase extends Block
if (var6 == 0)
{
par1World.setBlockWithNotify(par2, par3, par4, Block.obsidian.blockID);
par1World.func_94575_c(par2, par3, par4, Block.obsidian.blockID);
}
else if (var6 <= 4)
{
par1World.setBlockWithNotify(par2, par3, par4, Block.cobblestone.blockID);
par1World.func_94575_c(par2, par3, par4, Block.cobblestone.blockID);
}
this.triggerLavaMixEffects(par1World, par2, par3, par4);
@@ -1,15 +1,14 @@
package tinker.tconstruct.blocks.liquids;
package mods.tinker.tconstruct.blocks.liquids;
import java.util.Random;
import mods.tinker.tconstruct.TContent;
import mods.tinker.tconstruct.logic.LiquidTextureLogic;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.liquids.ILiquid;
import tinker.tconstruct.TContent;
import tinker.tconstruct.logic.LiquidTextureLogic;
public class LiquidMetalFlowing extends LiquidMetalBase
implements ILiquid
@@ -34,7 +33,7 @@ public class LiquidMetalFlowing extends LiquidMetalBase
//System.out.println("x: "+x+", y: "+y+", z: "+z);
int tex = ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).getLiquidType();
int meta = world.getBlockMetadata(x, y, z);
world.setBlockAndMetadata(x, y, z, stillLiquidId(), meta);
world.setBlockAndMetadataWithNotify(x, y, z, stillLiquidId(), meta, 2);
world.markBlockRangeForRenderUpdate(x, y, z, x, y, z);
world.markBlockForUpdate(x, y, z);
((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).setTexturePos(tex);
@@ -77,11 +76,11 @@ public class LiquidMetalFlowing extends LiquidMetalBase
l = j1;
if (l < 0)
{
world.setBlockWithNotify(x, y, z, 0);
world.func_94571_i(x, y, z);
}
else
{
world.setBlockMetadataWithNotify(x, y, z, l);
world.setBlockMetadataWithNotify(x, y, z, l, 2);
world.scheduleBlockUpdate(x, y, z, blockID, tickRate());
world.notifyBlocksOfNeighborChange(x, y, z, blockID);
}
@@ -99,11 +98,11 @@ public class LiquidMetalFlowing extends LiquidMetalBase
{
if (l >= 8)
{
world.setBlockAndMetadataWithNotify(x, y - 1, z, blockID, l);
world.setBlockAndMetadataWithNotify(x, y - 1, z, blockID, l, 3);
}
else
{
world.setBlockAndMetadataWithNotify(x, y - 1, z, blockID, l + 8);
world.setBlockAndMetadataWithNotify(x, y - 1, z, blockID, l + 8, 3);
}
((LiquidTextureLogic) world.getBlockTileEntity(x, y - 1, z)).setTexturePos(tex);
}
@@ -145,7 +144,7 @@ public class LiquidMetalFlowing extends LiquidMetalBase
{
Block.blocksList[bID].dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
}
world.setBlockAndMetadataWithNotify(x, y, z, blockID, meta);
world.setBlockAndMetadataWithNotify(x, y, z, blockID, meta, 3);
((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).setTexturePos(tex);
}
@@ -1,16 +1,15 @@
package tinker.tconstruct.blocks.liquids;
package mods.tinker.tconstruct.blocks.liquids;
import java.util.Random;
import mods.tinker.tconstruct.TContent;
import mods.tinker.tconstruct.logic.LiquidTextureLogic;
import net.minecraft.block.Block;
import net.minecraft.block.BlockStationary;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.liquids.ILiquid;
import tinker.tconstruct.TContent;
import tinker.tconstruct.logic.LiquidTextureLogic;
public class LiquidMetalStill extends LiquidMetalBase implements ILiquid
{
@@ -60,7 +59,7 @@ public class LiquidMetalStill extends LiquidMetalBase implements ILiquid
{
if (this.isFlammable(par1World, par2 - 1, par3, par4) || this.isFlammable(par1World, par2 + 1, par3, par4) || this.isFlammable(par1World, par2, par3, par4 - 1) || this.isFlammable(par1World, par2, par3, par4 + 1) || this.isFlammable(par1World, par2, par3 - 1, par4) || this.isFlammable(par1World, par2, par3 + 1, par4))
{
par1World.setBlockWithNotify(par2, par3, par4, Block.fire.blockID);
par1World.func_94575_c(par2, par3, par4, Block.fire.blockID);
return;
}
}
@@ -82,7 +81,7 @@ public class LiquidMetalStill extends LiquidMetalBase implements ILiquid
if (par1World.isAirBlock(par2, par3 + 1, par4) && this.isFlammable(par1World, par2, par3, par4))
{
par1World.setBlockWithNotify(par2, par3 + 1, par4, Block.fire.blockID);
par1World.func_94575_c(par2, par3 + 1, par4, Block.fire.blockID);
}
}
}
@@ -174,13 +173,16 @@ public class LiquidMetalStill extends LiquidMetalBase implements ILiquid
private void unsetStationary (World world, int x, int y, int z)
{
int meta = world.getBlockMetadata(x, y, z);
world.setBlockAndMetadataWithNotify(x, y, z, this.blockID - 1, meta, 2);
world.scheduleBlockUpdate(x, y, z, this.blockID - 1, this.tickRate(world));
/*int meta = world.getBlockMetadata(x, y, z);
int tex = ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).getLiquidType();
world.editingBlocks = true;
world.setBlockAndMetadata(x, y, z, flowingLiquidID(), meta);
world.markBlockRangeForRenderUpdate(x, y, z, x, y, z);
world.scheduleBlockUpdate(x, y, z, flowingLiquidID(), this.tickRate());
((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).setTexturePos(tex);
world.editingBlocks = false;
world.editingBlocks = false;*/
}
public boolean getBlocksMovement (IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
@@ -1,11 +1,12 @@
package tinker.tconstruct.client;
import org.lwjgl.opengl.GL11;
package mods.tinker.tconstruct.client;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
@@ -1,5 +1,7 @@
package tinker.tconstruct.client;
package mods.tinker.tconstruct.client;
import mods.tinker.common.fancyitem.FancyEntityItem;
import mods.tinker.tconstruct.logic.CastingTableLogic;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
@@ -9,8 +11,6 @@ import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
import tinker.common.fancyitem.FancyEntityItem;
import tinker.tconstruct.logic.CastingTableLogic;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -53,7 +53,7 @@ public class CastingTableSpecialRenderer extends TileEntitySpecialRenderer
void renderItem(CastingTableLogic logic, ItemStack stack)
{
FancyEntityItem entityitem = new FancyEntityItem(logic.worldObj, 0.0D, 0.0D, 0.0D, stack);
entityitem.func_92014_d().stackSize = 1;
entityitem.getEntityItem().stackSize = 1;
entityitem.hoverStart = 0.0F;
GL11.glPushMatrix();
GL11.glTranslatef(1F, 1.478F, 0.55F);
@@ -1,12 +1,14 @@
package tinker.tconstruct.client;
package mods.tinker.tconstruct.client;
import mods.tinker.tconstruct.blocks.liquids.LiquidMetalBase;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFluid;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import tinker.tconstruct.blocks.liquids.LiquidMetalBase;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
@@ -38,6 +40,212 @@ public class FluidRender implements ISimpleBlockRenderingHandler
}
public boolean renderBlockFluids(RenderBlocks renderer, IBlockAccess world, Block block, int x, int y, int z)
{
Tessellator tessellator = Tessellator.instance;
int l = block.colorMultiplier(world, x, y, z);
float f = (float)(l >> 16 & 255) / 255.0F;
float f1 = (float)(l >> 8 & 255) / 255.0F;
float f2 = (float)(l & 255) / 255.0F;
boolean flag = block.shouldSideBeRendered(world, x, y + 1, z, 1);
boolean flag1 = block.shouldSideBeRendered(world, x, y - 1, z, 0);
boolean[] aboolean = new boolean[] {block.shouldSideBeRendered(world, x, y, z - 1, 2), block.shouldSideBeRendered(world, x, y, z + 1, 3), block.shouldSideBeRendered(world, x - 1, y, z, 4), block.shouldSideBeRendered(world, x + 1, y, z, 5)};
if (!flag && !flag1 && !aboolean[0] && !aboolean[1] && !aboolean[2] && !aboolean[3])
{
return false;
}
else
{
boolean flag2 = false;
float f3 = 0.5F;
float f4 = 1.0F;
float f5 = 0.8F;
float f6 = 0.6F;
double d0 = 0.0D;
double d1 = 1.0D;
Material material = block.blockMaterial;
int i1 = world.getBlockMetadata(x, y, z);
double d2 = (double)renderer.getFluidHeight(x, y, z, material);
double d3 = (double)renderer.getFluidHeight(x, y, z + 1, material);
double d4 = (double)renderer.getFluidHeight(x + 1, y, z + 1, material);
double d5 = (double)renderer.getFluidHeight(x + 1, y, z, material);
double d6 = 0.0010000000474974513D;
float f7;
if (renderer.renderAllFaces || flag)
{
flag2 = true;
Icon icon = renderer.func_94165_a(block, 1, i1);
float f8 = (float)BlockFluid.getFlowDirection(world, x, y, z, material);
if (f8 > -999.0F)
{
icon = renderer.func_94165_a(block, 2, i1);
}
d2 -= d6;
d3 -= d6;
d4 -= d6;
d5 -= d6;
double d7;
double d8;
double d9;
double d10;
double d11;
double d12;
double d13;
double d14;
if (f8 < -999.0F)
{
d8 = (double)icon.func_94214_a(0.0D);
d12 = (double)icon.func_94207_b(0.0D);
d7 = d8;
d11 = (double)icon.func_94207_b(16.0D);
d10 = (double)icon.func_94214_a(16.0D);
d14 = d11;
d9 = d10;
d13 = d12;
}
else
{
f7 = MathHelper.sin(f8) * 0.25F;
float f9 = MathHelper.cos(f8) * 0.25F;
d8 = (double)icon.func_94214_a((double)(8.0F + (-f9 - f7) * 16.0F));
d12 = (double)icon.func_94207_b((double)(8.0F + (-f9 + f7) * 16.0F));
d7 = (double)icon.func_94214_a((double)(8.0F + (-f9 + f7) * 16.0F));
d11 = (double)icon.func_94207_b((double)(8.0F + (f9 + f7) * 16.0F));
d10 = (double)icon.func_94214_a((double)(8.0F + (f9 + f7) * 16.0F));
d14 = (double)icon.func_94207_b((double)(8.0F + (f9 - f7) * 16.0F));
d9 = (double)icon.func_94214_a((double)(8.0F + (f9 - f7) * 16.0F));
d13 = (double)icon.func_94207_b((double)(8.0F + (-f9 - f7) * 16.0F));
}
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
f7 = 1.0F;
tessellator.setColorOpaque_F(f4 * f7 * f, f4 * f7 * f1, f4 * f7 * f2);
tessellator.addVertexWithUV((double)(x + 0), (double)y + d2, (double)(z + 0), d8, d12);
tessellator.addVertexWithUV((double)(x + 0), (double)y + d3, (double)(z + 1), d7, d11);
tessellator.addVertexWithUV((double)(x + 1), (double)y + d4, (double)(z + 1), d10, d14);
tessellator.addVertexWithUV((double)(x + 1), (double)y + d5, (double)(z + 0), d9, d13);
}
if (renderer.renderAllFaces || flag1)
{
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y - 1, z));
float f10 = 1.0F;
tessellator.setColorOpaque_F(f3 * f10, f3 * f10, f3 * f10);
renderer.renderBottomFace(block, (double)x, (double)y + d6, (double)z, renderer.func_94173_a(block, 0));
flag2 = true;
}
for (int j1 = 0; j1 < 4; ++j1)
{
int k1 = x;
int l1 = z;
if (j1 == 0)
{
l1 = z - 1;
}
if (j1 == 1)
{
++l1;
}
if (j1 == 2)
{
k1 = x - 1;
}
if (j1 == 3)
{
++k1;
}
Icon icon1 = renderer.func_94165_a(block, j1 + 2, i1);
if (renderer.renderAllFaces || aboolean[j1])
{
double d15;
double d16;
double d17;
double d18;
double d19;
double d20;
if (j1 == 0)
{
d15 = d2;
d17 = d5;
d16 = (double)x;
d18 = (double)(x + 1);
d19 = (double)z + d6;
d20 = (double)z + d6;
}
else if (j1 == 1)
{
d15 = d4;
d17 = d3;
d16 = (double)(x + 1);
d18 = (double)x;
d19 = (double)(z + 1) - d6;
d20 = (double)(z + 1) - d6;
}
else if (j1 == 2)
{
d15 = d3;
d17 = d2;
d16 = (double)x + d6;
d18 = (double)x + d6;
d19 = (double)(z + 1);
d20 = (double)z;
}
else
{
d15 = d5;
d17 = d4;
d16 = (double)(x + 1) - d6;
d18 = (double)(x + 1) - d6;
d19 = (double)z;
d20 = (double)(z + 1);
}
flag2 = true;
float f11 = icon1.func_94214_a(0.0D);
f7 = icon1.func_94214_a(8.0D);
int i2 = icon1.func_94216_b();
float f12 = icon1.func_94207_b((1.0D - d15) * 16.0D * 0.5D);
float f13 = icon1.func_94207_b((1.0D - d17) * 16.0D * 0.5D);
float f14 = icon1.func_94207_b(8.0D);
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, k1, y, l1));
float f15 = 1.0F;
if (j1 < 2)
{
f15 *= f5;
}
else
{
f15 *= f6;
}
tessellator.setColorOpaque_F(f4 * f15 * f, f4 * f15 * f1, f4 * f15 * f2);
tessellator.addVertexWithUV(d16, (double)y + d15, d19, (double)f11, (double)f12);
tessellator.addVertexWithUV(d18, (double)y + d17, d20, (double)f7, (double)f13);
tessellator.addVertexWithUV(d18, (double)(y + 0), d20, (double)f7, (double)f14);
tessellator.addVertexWithUV(d16, (double)(y + 0), d19, (double)f11, (double)f14);
}
}
renderer.renderMinY = d0;
renderer.renderMaxY = d1;
return flag2;
}
}
/*public boolean renderBlockFluids(RenderBlocks renderer, IBlockAccess world, Block block, int x, int y, int z)
{
Tessellator tessellator = Tessellator.instance;
int blockColor = block.colorMultiplier(world, x, y, z);
@@ -227,5 +435,5 @@ public class FluidRender implements ISimpleBlockRenderingHandler
renderer.renderMaxY = var20;
return var13;
}
}
}*/
}
@@ -1,10 +1,7 @@
package tinker.tconstruct.client;
import org.lwjgl.opengl.GL11;
package mods.tinker.tconstruct.client;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.IBlockAccess;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
@@ -1,5 +1,9 @@
package tinker.tconstruct.client;
package mods.tinker.tconstruct.client;
import mods.tinker.common.BlockSkinRenderHelper;
import mods.tinker.tconstruct.TContent;
import mods.tinker.tconstruct.logic.CastingTableLogic;
import mods.tinker.tconstruct.logic.FaucetLogic;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
@@ -10,10 +14,6 @@ import net.minecraftforge.client.ForgeHooksClient;
import org.lwjgl.opengl.GL11;
import tinker.common.BlockSkinRenderHelper;
import tinker.tconstruct.TContent;
import tinker.tconstruct.logic.CastingTableLogic;
import tinker.tconstruct.logic.FaucetLogic;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
@@ -97,7 +97,7 @@ public class SearedRender implements ISimpleBlockRenderingHandler
renderer.setRenderBounds(0.6875, 0.0F, 0.6875, 1.0F, 0.625F, 1.0F);
renderer.renderStandardBlock(block, x, y, z);
CastingTableLogic logic = (CastingTableLogic) world.getBlockTileEntity(x, y, z);
/*CastingTableLogic logic = (CastingTableLogic) world.getBlockTileEntity(x, y, z);
if (logic.liquid != null)
{
float height = logic.liquid.amount / (logic.getCapacity() * 1.03F) / 16F;
@@ -121,7 +121,7 @@ public class SearedRender implements ISimpleBlockRenderingHandler
BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(logic.liquid.itemMeta), logic.liquid.itemMeta, x, y, z, renderer, world);
}
}
}
}*/
}
else if (metadata == 1)
{
@@ -183,7 +183,7 @@ public class SearedRender implements ISimpleBlockRenderingHandler
{
yMin = -1F;
}
if (logic.liquid != null)
/*if (logic.liquid != null)
{
ItemStack blockToRender = new ItemStack(logic.liquid.itemID, 1, logic.liquid.itemMeta);
if (blockToRender.itemID < 4096) //Block
@@ -205,7 +205,7 @@ public class SearedRender implements ISimpleBlockRenderingHandler
BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(meta), meta, x, y, z, renderer, world);
}
//renderer.renderStandardBlock(block, x, y, z);
}
}*/
}
else
@@ -1,4 +1,4 @@
package tinker.tconstruct.client;
package mods.tinker.tconstruct.client;
import java.awt.image.BufferedImage;
import java.io.IOException;
@@ -1,5 +1,8 @@
package tinker.tconstruct.client;
package mods.tinker.tconstruct.client;
import mods.tinker.common.BlockSkinRenderHelper;
import mods.tinker.tconstruct.crafting.Smeltery;
import mods.tinker.tconstruct.logic.SmelteryLogic;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
@@ -12,9 +15,6 @@ import net.minecraftforge.liquids.LiquidStack;
import org.lwjgl.opengl.GL11;
import tinker.common.BlockSkinRenderHelper;
import tinker.tconstruct.crafting.Smeltery;
import tinker.tconstruct.logic.SmelteryLogic;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
@@ -47,7 +47,8 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler
public boolean renderSmeltery (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer)
{
renderer.renderStandardBlock(block, x, y, z);
SmelteryLogic logic = (SmelteryLogic) world.getBlockTileEntity(x, y, z);
return true;
/*SmelteryLogic logic = (SmelteryLogic) world.getBlockTileEntity(x, y, z);
if (logic.validStructure)
{
int posX = logic.centerPos.x - 1, posY = logic.centerPos.y, posZ = logic.centerPos.z - 1;
@@ -56,7 +57,7 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler
{
renderLayer(logic, i*9, posX, posY+i, posZ, renderer, world);
//System.out.println("layers:"+logic.layers);
/*ItemStack input = logic.getStackInSlot(i);
ItemStack input = logic.getStackInSlot(i);
if (input != null && logic.getTempForSlot(i) > 20)
{
ItemStack blockToRender = Smeltery.getRenderIndex(input);
@@ -77,7 +78,7 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler
int metadata = blockToRender.getItemDamage();
BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(metadata), metadata, posX, posY + i / 9, posZ, renderer, world);
}
}*/
}
}
//Liquids
@@ -124,10 +125,10 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler
}
}
}
return false;
return false;*/
}
void renderLayer(SmelteryLogic logic, int start, int posX, int posY, int posZ, RenderBlocks renderer, IBlockAccess world)
/*void renderLayer(SmelteryLogic logic, int start, int posX, int posY, int posZ, RenderBlocks renderer, IBlockAccess world)
{
renderer.setRenderBounds(-0.001F, -0.001F, -0.001F, 1.001F, 1.001F, 1.001F);
for (int i = 0; i < 9; i++)
@@ -156,7 +157,7 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler
}
}
}
}
}*/
@Override
public boolean shouldRender3DInInventory ()
@@ -1,7 +1,8 @@
package tinker.tconstruct.client;
package mods.tinker.tconstruct.client;
import java.util.Random;
import mods.tinker.tconstruct.tools.ToolCore;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.RenderBlocks;
@@ -18,7 +19,6 @@ import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import tinker.tconstruct.tools.ToolCore;
import cpw.mods.fml.client.TextureFXManager;
public class SuperCustomToolRenderer implements IItemRenderer
@@ -54,16 +54,16 @@ public class SuperCustomToolRenderer implements IItemRenderer
@Override
public void renderItem (ItemRenderType type, ItemStack item, Object... data)
{
if (type == ItemRenderType.INVENTORY)
/*if (type == ItemRenderType.INVENTORY)
renderInventoryItem(item, (RenderBlocks) data[0]);
if (type == ItemRenderType.EQUIPPED)
renderEquippedItem(item, (RenderBlocks) data[0], (EntityLiving) data[1]);
if (type == ItemRenderType.ENTITY)
renderEntityItem(item, (RenderBlocks) data[0], (EntityItem) data[1]);
renderEntityItem(item, (RenderBlocks) data[0], (EntityItem) data[1]);*/
}
/* Inventory */
void renderInventoryItem (ItemStack stack, RenderBlocks renderer)
/*void renderInventoryItem (ItemStack stack, RenderBlocks renderer)
{
ToolCore tool = (ToolCore) stack.getItem();
//int itemID = stack.itemID;
@@ -75,7 +75,7 @@ public class SuperCustomToolRenderer implements IItemRenderer
for (int renderPass = 0; renderPass < tool.getRenderPasses(itemDamage); renderPass++)
{
String texturePath = tool.getIconLocation(stack, renderPass);
renderEngine.bindTexture(renderEngine.getTexture(texturePath));
renderEngine.func_98187_b(texturePath);
GL11.glScalef(0.0625F, 0.0625F, 1F);
this.renderTexturedQuad();
@@ -85,7 +85,7 @@ public class SuperCustomToolRenderer implements IItemRenderer
for (int renderPass = 0; renderPass < 3; renderPass++)
{
String texturePath = tool.getEffectLocation(stack, renderPass);
renderEngine.bindTexture(renderEngine.getTexture(texturePath));
renderEngine.func_98187_b(texturePath);
GL11.glScalef(0.0625F, 0.0625F, 1F);
this.renderTexturedQuad();
@@ -102,7 +102,7 @@ public class SuperCustomToolRenderer implements IItemRenderer
* Adds a textured quad to the tesselator at the specified position with the specified texture coords, width and
* height. Args: x, y, u, v, width, height
*/
public void renderTexturedQuad()
/*public void renderTexturedQuad()
{
int x = 0, y = 0, u = 0, v = 0, height = 256, width = 256;
float var7 = 0.00390625F;
@@ -122,7 +122,7 @@ public class SuperCustomToolRenderer implements IItemRenderer
}
/* Equipped */
void renderEquippedItem (ItemStack stack, RenderBlocks renderer, EntityLiving living)
/*void renderEquippedItem (ItemStack stack, RenderBlocks renderer, EntityLiving living)
{
for (int x = 0; x < stack.getItem().getRenderPasses(stack.getItemDamage()); x++)
{
@@ -145,7 +145,7 @@ public class SuperCustomToolRenderer implements IItemRenderer
texturePath = ((ToolCore)stack.getItem()).getIconLocation(stack, renderPass);
else
texturePath = ((ToolCore)stack.getItem()).getEffectLocation(stack, renderPass);
renderEngine.bindTexture(renderEngine.getTexture(texturePath));
renderEngine.func_98187_b(texturePath);
float var7 = 0;
float var8 = 1;
float var9 = 0;
@@ -288,7 +288,7 @@ public class SuperCustomToolRenderer implements IItemRenderer
}
/* Entity */
void renderEntityItem (ItemStack stack, RenderBlocks renderer, EntityItem entity)
/*void renderEntityItem (ItemStack stack, RenderBlocks renderer, EntityItem entity)
{
this.random.setSeed(187L);
ItemStack var10 = entity.func_92014_d();
@@ -317,7 +317,7 @@ public class SuperCustomToolRenderer implements IItemRenderer
var17 = 1.0F;
String texturePath = tool.getIconLocation(var10, renderPass);
renderEngine.bindTexture(renderEngine.getTexture(texturePath));
renderEngine.func_98187_b(texturePath);
int var18 = Item.itemsList[tool.itemID].getColorFromItemStack(var10, renderPass);
var19 = (float) (var18 >> 16 & 255) / 255.0F;
@@ -333,7 +333,7 @@ public class SuperCustomToolRenderer implements IItemRenderer
var17 = 1.0F;
String texturePath = tool.getEffectLocation(var10, renderPass);
renderEngine.bindTexture(renderEngine.getTexture(texturePath));
renderEngine.func_98187_b(texturePath);
int var18 = Item.itemsList[tool.itemID].getColorFromItemStack(var10, renderPass);
var19 = (float) (var18 >> 16 & 255) / 255.0F;
@@ -427,7 +427,7 @@ public class SuperCustomToolRenderer implements IItemRenderer
texturePath = ((ToolCore)stack.getItem()).getIconLocation(stack, renderPass);
else
texturePath = ((ToolCore)stack.getItem()).getEffectLocation(stack, renderPass);
renderEngine.bindTexture(renderEngine.getTexture(texturePath));
renderEngine.func_98187_b(texturePath);
GL11.glColor4f(par5, par6, par7, 1.0F);
ItemRenderer.renderItemIn2D(var8, var10, var11, var9, var12, var16);
@@ -496,5 +496,5 @@ public class SuperCustomToolRenderer implements IItemRenderer
GL11.glPopMatrix();
}
}
}
}*/
}
@@ -0,0 +1,40 @@
package mods.tinker.tconstruct.client;
import mods.tinker.tconstruct.TConstructRegistry;
import mods.tinker.tconstruct.tools.ToolCore;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureMap;
public class TConstructClientRegistry
{
public static TextureMap itemMap = Minecraft.getMinecraft().renderEngine.field_94155_m;
public static void addMaterialRenderMapping (int materialID, String domain, String renderName, boolean useDefaultFolder)
{
for (ToolCore tool : TConstructRegistry.getToolMapping())
{
String[] toolIcons = new String[tool.getPartAmount() + 1];
for (int i = 0; i < tool.getPartAmount() + 1; i++)
{
String icon = domain + ":";
if (useDefaultFolder)
icon += tool.getDefaultFolder()+"/";
icon += renderName + tool.getIconSuffix(i);
toolIcons[i] = icon;
}
tool.registerPartPaths(materialID, toolIcons);
}
}
public static void addEffectRenderMapping (int materialID, String domain, String renderName, boolean useDefaultFolder)
{
for (ToolCore tool : TConstructRegistry.getToolMapping())
{
String icon = domain + ":";
if (useDefaultFolder)
icon += tool.getDefaultFolder()+"/";
icon += renderName + tool.getEffectSuffix();
tool.registerEffectPath(materialID, icon);
}
}
}
@@ -1,19 +1,12 @@
package tinker.tconstruct.client;
package mods.tinker.tconstruct.client;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.Set;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.client.settings.KeyBinding;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import cpw.mods.fml.client.registry.KeyBindingRegistry;
import cpw.mods.fml.common.ITickHandler;
import cpw.mods.fml.common.TickType;
@@ -1,4 +1,4 @@
package tinker.tconstruct.client;
package mods.tinker.tconstruct.client;
import java.io.File;
import java.io.InputStream;
@@ -6,65 +6,27 @@ import java.io.InputStream;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import mods.tinker.common.fancyitem.FancyEntityItem;
import mods.tinker.common.fancyitem.FancyItemRender;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.TConstructRegistry;
import mods.tinker.tconstruct.TContent;
import mods.tinker.tconstruct.TControls;
import mods.tinker.tconstruct.TProxyCommon;
import mods.tinker.tconstruct.client.entityrender.CartRender;
import mods.tinker.tconstruct.client.entityrender.CrystalRender;
import mods.tinker.tconstruct.client.entityrender.SkylaRender;
import mods.tinker.tconstruct.client.gui.ToolGuiElement;
import mods.tinker.tconstruct.entity.CartEntity;
import mods.tinker.tconstruct.entity.Crystal;
import mods.tinker.tconstruct.entity.Skyla;
import mods.tinker.tconstruct.logic.CastingTableLogic;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderEngine;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraft.util.Icon;
import org.w3c.dom.Document;
import tinker.common.fancyitem.FancyEntityItem;
import tinker.common.fancyitem.FancyItemRender;
import tinker.tconstruct.TConstruct;
import tinker.tconstruct.TConstructRegistry;
import tinker.tconstruct.TContent;
import tinker.tconstruct.TControls;
import tinker.tconstruct.TProxyCommon;
import tinker.tconstruct.client.entityrender.CartRender;
import tinker.tconstruct.client.entityrender.CrystalRender;
import tinker.tconstruct.client.entityrender.SkylaRender;
import tinker.tconstruct.client.gui.ToolGuiElement;
import tinker.tconstruct.client.liquidrender.LiquidAlBrassFX;
import tinker.tconstruct.client.liquidrender.LiquidAlBrassFlowFX;
import tinker.tconstruct.client.liquidrender.LiquidAluminumFX;
import tinker.tconstruct.client.liquidrender.LiquidAluminumFlowFX;
import tinker.tconstruct.client.liquidrender.LiquidAlumiteFX;
import tinker.tconstruct.client.liquidrender.LiquidAlumiteFlowFX;
import tinker.tconstruct.client.liquidrender.LiquidAngmallenFX;
import tinker.tconstruct.client.liquidrender.LiquidAngmallenFlowFX;
import tinker.tconstruct.client.liquidrender.LiquidArditeFX;
import tinker.tconstruct.client.liquidrender.LiquidArditeFlowFX;
import tinker.tconstruct.client.liquidrender.LiquidBronzeFX;
import tinker.tconstruct.client.liquidrender.LiquidBronzeFlowFX;
import tinker.tconstruct.client.liquidrender.LiquidCobaltFX;
import tinker.tconstruct.client.liquidrender.LiquidCobaltFlowFX;
import tinker.tconstruct.client.liquidrender.LiquidCopperFX;
import tinker.tconstruct.client.liquidrender.LiquidCopperFlowFX;
import tinker.tconstruct.client.liquidrender.LiquidDamascusSteelFX;
import tinker.tconstruct.client.liquidrender.LiquidDamascusSteelFlowFX;
import tinker.tconstruct.client.liquidrender.LiquidGoldFX;
import tinker.tconstruct.client.liquidrender.LiquidGoldFlowFX;
import tinker.tconstruct.client.liquidrender.LiquidHeptazionFX;
import tinker.tconstruct.client.liquidrender.LiquidHeptazionFlowFX;
import tinker.tconstruct.client.liquidrender.LiquidIronFX;
import tinker.tconstruct.client.liquidrender.LiquidIronFlowFX;
import tinker.tconstruct.client.liquidrender.LiquidManganeseFX;
import tinker.tconstruct.client.liquidrender.LiquidManganeseFlowFX;
import tinker.tconstruct.client.liquidrender.LiquidManyullynFX;
import tinker.tconstruct.client.liquidrender.LiquidManyullynFlowFX;
import tinker.tconstruct.client.liquidrender.LiquidObsidianFX;
import tinker.tconstruct.client.liquidrender.LiquidObsidianFlowFX;
import tinker.tconstruct.client.liquidrender.LiquidSteelFX;
import tinker.tconstruct.client.liquidrender.LiquidSteelFlowFX;
import tinker.tconstruct.client.liquidrender.LiquidTinFX;
import tinker.tconstruct.client.liquidrender.LiquidTinFlowFX;
import tinker.tconstruct.entity.CartEntity;
import tinker.tconstruct.entity.Crystal;
import tinker.tconstruct.entity.Skyla;
import tinker.tconstruct.logic.CastingTableLogic;
import tinker.tconstruct.tools.ToolCore;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.KeyBindingRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
@@ -73,6 +35,7 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
public class TProxyClient extends TProxyCommon
{
public static SmallFontRenderer smallFontRenderer;
public static Icon blankSprite;
/* Registers any rendering code. */
public void registerRenderer ()
@@ -87,7 +50,7 @@ public class TProxyClient extends TProxyCommon
RenderingRegistry.registerBlockHandler(new FluidRender());
//RenderingRegistry.registerBlockHandler(new AxleRender());
RenderEngine renderEngine = FMLClientHandler.instance().getClient().renderEngine;
/*RenderEngine renderEngine = FMLClientHandler.instance().getClient().renderEngine;
renderEngine.registerTextureFX(new LiquidIronFX());
renderEngine.registerTextureFX(new LiquidIronFlowFX());
renderEngine.registerTextureFX(new LiquidGoldFX());
@@ -123,15 +86,15 @@ public class TProxyClient extends TProxyCommon
renderEngine.registerTextureFX(new LiquidDamascusSteelFX());
renderEngine.registerTextureFX(new LiquidDamascusSteelFlowFX());
renderEngine.registerTextureFX(new LiquidAngmallenFX());
renderEngine.registerTextureFX(new LiquidAngmallenFlowFX());
renderEngine.registerTextureFX(new LiquidAngmallenFlowFX());*/
//Tools
MinecraftForgeClient.preloadTexture(TContent.blockTexture);
IItemRenderer render = new SuperCustomToolRenderer();
//MinecraftForgeClient.preloadTexture(TContent.blockTexture);
/*IItemRenderer render = new SuperCustomToolRenderer();
for (ToolCore tool : TConstructRegistry.tools)
{
MinecraftForgeClient.registerItemRenderer(tool.itemID, render);
}
}*/
//Special Renderers
ClientRegistry.bindTileEntitySpecialRenderer(CastingTableLogic.class, new CastingTableSpecialRenderer());
@@ -154,7 +117,7 @@ public class TProxyClient extends TProxyCommon
LanguageRegistry.instance().addStringLocalization("itemGroup.TConstructMaterials", "TConstruct Materials");
LanguageRegistry.instance().addStringLocalization("itemGroup.TConstructBlocks", "TConstruct Blocks");*/
String langDir = "/tinkerlang/";
String langDir = "/mods/tinker/resources/lang/";
String[] langFiles = { "en_US.xml" };
for (String langFile : langFiles)
@@ -403,15 +366,17 @@ public class TProxyClient extends TProxyCommon
String[] effectTypes = { "diamond", "emerald", "redstone", "glowstone", "moss", "ice", "lava", "blaze", "necrotic", "electric", "lapis" };
for (int partIter = 0; partIter < partTypes.length; partIter++)
{
materialRenderMap(partIter, partTypes[partIter]);
TConstructClientRegistry.addMaterialRenderMapping(partIter, "tinker", partTypes[partIter], true);
//materialRenderMap(partIter, partTypes[partIter]);
}
for (int effectIter = 0; effectIter < effectTypes.length; effectIter++)
{
effectRenderMap(effectIter, effectTypes[effectIter]);
TConstructClientRegistry.addEffectRenderMapping(effectIter, "tinker", effectTypes[effectIter], true);
//effectRenderMap(effectIter, effectTypes[effectIter]);
}
}
void materialRenderMap (int materialID, String partialLocation)
/*void materialRenderMap (int materialID, String partialLocation)
{
for (ToolCore tool : TConstructRegistry.getToolMapping())
{
@@ -425,7 +390,7 @@ public class TProxyClient extends TProxyCommon
{
tool.effectTextures.put(materialID, tool.getToolTextureFile() + partialLocation);
}
}
}*/
/* Keybindings */
public static TControls controlInstance;
@@ -1,11 +1,12 @@
package tinker.tconstruct.client;
import org.lwjgl.opengl.GL11;
package mods.tinker.tconstruct.client;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
Loaded 100 of 1162 files, more files were not shown because too many files have changed in this diff. Show more