Blue slime balance

This commit is contained in:
mDiyo 2013-03-21 17:38:04 -07:00
parent 12b99e6f32
commit 57d8a3b405
108 changed files with 2776 additions and 2126 deletions

View File

@ -1,7 +1,7 @@
Tinker's Construct - 1.5
Modify all the things, then do it again!
Melt down any metals you find.
Turn everything into golems!
Modify all the things, then do it again!
Melt down any metals you find.
Turn everything into golems!
Most code is public domain; any that isn't has a note in their folders
Most code is public domain; any alternate licenses are noted where appropriate

View File

@ -32,7 +32,7 @@ public class ArmorStandGui extends GuiContainer
//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.func_98187_b("/tinkertextures/gui/armorstand.png");
this.mc.renderEngine.bindTexture("/tinkertextures/gui/armorstand.png");
int var5 = this.guiLeft;
int var6 = this.guiTop;
this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);

View File

@ -156,14 +156,14 @@ public class ArmorStandEntity extends EntityEquipment
}
@Override
public boolean func_94042_c ()
public boolean isInvNameLocalized ()
{
// TODO Auto-generated method stub
return false;
}
@Override
public boolean func_94041_b (int i, ItemStack itemstack)
public boolean isStackValidForSlot (int i, ItemStack itemstack)
{
// TODO Auto-generated method stub
return false;

View File

@ -60,8 +60,9 @@ public class DisplayBlock extends InventoryBlock
return new String[] { "toolstation_top" };
}
public void func_94332_a (IconRegister par1IconRegister)
@Override
public void registerIcons (IconRegister par1IconRegister)
{
this.field_94336_cN = par1IconRegister.func_94245_a(Block.blockSteel.getUnlocalizedName());
this.blockIcon = par1IconRegister.registerIcon(Block.blockSteel.getUnlocalizedName());
}
}

View File

@ -200,14 +200,14 @@ public class ToolrackLogic extends TileEntity
}
@Override
public boolean func_94042_c ()
public boolean isInvNameLocalized ()
{
// TODO Auto-generated method stub
return false;
}
@Override
public boolean func_94041_b (int i, ItemStack itemstack)
public boolean isStackValidForSlot (int i, ItemStack itemstack)
{
// TODO Auto-generated method stub
return false;

File diff suppressed because it is too large Load Diff

View File

@ -144,7 +144,8 @@ public abstract class InventoryBlock extends BlockContainer
public Icon[] icons;
public abstract String[] getTextureNames();
public void func_94332_a(IconRegister iconRegister)
@Override
public void registerIcons(IconRegister iconRegister)
{
String[] textureNames = getTextureNames();
//System.out.println("TextureNames: :"+this.getClass().getSimpleName());
@ -152,7 +153,7 @@ public abstract class InventoryBlock extends BlockContainer
for (int i = 0; i < this.icons.length; ++i)
{
this.icons[i] = iconRegister.func_94245_a("tinker:"+textureNames[i]);
this.icons[i] = iconRegister.registerIcon("tinker:"+textureNames[i]);
}
}
}

View File

@ -151,16 +151,16 @@ public abstract class InventoryLogic extends TileEntity
public String getInvName()
{
return this.func_94042_c() ? this.invName : getDefaultName();
return this.isInvNameLocalized() ? this.invName : getDefaultName();
}
public boolean func_94042_c()
public boolean isInvNameLocalized()
{
return this.invName != null && this.invName.length() > 0;
}
@Override
public boolean func_94041_b (int i, ItemStack itemstack)
public boolean isStackValidForSlot (int i, ItemStack itemstack)
{
// TODO Auto-generated method stub
return false;

View File

@ -25,20 +25,18 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class FancyItemRender extends Render
{
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;
public boolean renderWithColor = true;
/** Defines the zLevel of rendering of item on GUI. */
public float zLevel = 0.0F;
public static boolean field_82407_g = false;
public static boolean renderInFrame = false;
public FancyItemRender()
{
public FancyItemRender() {
this.shadowSize = 0.15F;
this.shadowOpaque = 0.75F;
}
@ -46,16 +44,18 @@ public class FancyItemRender extends Render
/**
* Renders the item
*/
public void doRenderItem (EntityItem par1EntityItem, double par2, double par4, double par6, float par8, float par9)
{
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)
{
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);
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);
@ -66,21 +66,21 @@ public class FancyItemRender extends Render
float f6;
Block block = null;
if (itemstack.itemID < Block.blocksList.length)
{
if (itemstack.itemID < Block.blocksList.length) {
block = Block.blocksList[itemstack.itemID];
}
if (ForgeHooksClient.renderEntityItem(par1EntityItem, itemstack, f2, f3, random, renderManager.renderEngine, renderBlocks))
{
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()))
{
} else if (itemstack.getItemSpriteNumber() == 0
&& block != null
&& RenderBlocks
.renderItemIn3d(Block.blocksList[itemstack.itemID]
.getRenderType())) {
GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F);
if (field_82407_g)
{
if (renderInFrame) {
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);
@ -90,104 +90,91 @@ public class FancyItemRender extends Render
float f7 = 0.25F;
int j = block.getRenderType();
if (j == 1 || j == 19 || j == 12 || j == 2)
{
if (j == 1 || j == 19 || j == 12 || j == 2) {
f7 = 0.5F;
}
GL11.glScalef(f7, f7, f7);
for (i = 0; i < b0; ++i)
{
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;
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);
this.itemRenderBlocks.renderBlockAsItem(block,
itemstack.getItemDamage(), f5);
GL11.glPopMatrix();
}
}
else
{
} else {
float f8;
if (itemstack.getItem().requiresMultipleRenderPasses())
{
if (field_82407_g)
{
if (itemstack.getItem().requiresMultipleRenderPasses()) {
if (renderInFrame) {
GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F);
GL11.glTranslatef(0.0F, -0.05F, 0.0F);
}
else
{
} 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)
{
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);
if (this.renderWithColor) {
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);
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)
{
} else {
if (renderInFrame) {
GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F);
GL11.glTranslatef(0.0F, -0.05F, 0.0F);
}
else
{
} else {
GL11.glScalef(0.5F, 0.5F, 0.5F);
}
Icon icon1 = itemstack.getIconIndex();
if (itemstack.func_94608_d() == 0)
{
if (itemstack.getItemSpriteNumber() == 0) {
this.loadTexture("/terrain.png");
}
else
{
} else {
this.loadTexture("/gui/items.png");
}
if (this.field_77024_a)
{
int l = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, 0);
if (this.renderWithColor) {
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);
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);
}
}
}
@ -200,19 +187,20 @@ public class FancyItemRender extends Render
/**
* Renders a dropped item
*/
private void renderDroppedItem (EntityItem par1EntityItem, Icon par2Icon, int par3, float par4, float par5, float par6, float par7)
{
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());
if (par2Icon == null) {
par2Icon = this.renderManager.renderEngine
.getMissingIcon(par1EntityItem.getEntityItem()
.getItemSpriteNumber());
}
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 f4 = par2Icon.getMinU();
float f5 = par2Icon.getMaxU();
float f6 = par2Icon.getMinV();
float f7 = par2Icon.getMaxV();
float f8 = 1.0F;
float f9 = 0.5F;
float f10 = 0.25F;
@ -220,13 +208,12 @@ public class FancyItemRender extends Render
GL11.glPushMatrix();
if (field_82407_g)
{
if (renderInFrame) {
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);
} 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;
@ -237,38 +224,34 @@ public class FancyItemRender extends Render
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())
{
for (int k = 0; k < b0; ++k) {
GL11.glTranslatef(0.0F, 0.0F, f12 + f11);
// 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
{
} else {
GL11.glTranslatef(0f, 0f, f12 + f11);
}
if (itemstack.func_94608_d() == 0 && itemstack.itemID < Block.blocksList.length && Block.blocksList[itemstack.itemID] != null)
{
if (itemstack.getItemSpriteNumber() == 0) {
this.loadTexture("/terrain.png");
}
else
{
} 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);
ItemRenderer.renderItemIn2D(tessellator, f5, f6, f4, f7,
par2Icon.getSheetWidth(), par2Icon.getSheetHeight(), f12);
if (itemstack != null && itemstack.hasEffect())
{
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");
this.renderManager.renderEngine
.bindTexture("%blur%/misc/glint.png");
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
float f13 = 0.76F;
@ -280,14 +263,16 @@ public class FancyItemRender extends Render
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);
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);
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);
@ -303,8 +288,9 @@ public class FancyItemRender extends Render
/**
* 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)
{
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();
@ -313,12 +299,14 @@ public class FancyItemRender extends Render
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");
if (par3ItemStack.getItemSpriteNumber() == 0
&& block != null
&& RenderBlocks.renderItemIn3d(Block.blocksList[k]
.getRenderType())) {
par2RenderEngine.bindTexture("/terrain.png");
GL11.glPushMatrix();
GL11.glTranslatef((float) (par4 - 2), (float) (par5 + 3), -3.0F + this.zLevel);
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);
@ -329,60 +317,52 @@ public class FancyItemRender extends Render
f = (float) (i1 >> 8 & 255) / 255.0F;
f1 = (float) (i1 & 255) / 255.0F;
if (this.field_77024_a)
{
if (this.renderWithColor) {
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.useInventoryTint = this.renderWithColor;
this.itemRenderBlocks.renderBlockAsItem(block, l, 1.0F);
this.itemRenderBlocks.useInventoryTint = true;
GL11.glPopMatrix();
}
else
{
} else {
int j1;
if (Item.itemsList[k].requiresMultipleRenderPasses())
{
if (Item.itemsList[k].requiresMultipleRenderPasses()) {
GL11.glDisable(GL11.GL_LIGHTING);
par2RenderEngine.func_98187_b("/gui/items.png");
par2RenderEngine.bindTexture(par3ItemStack
.getItemSpriteNumber() == 0 ? "/terrain.png"
: "/gui/items.png");
for (j1 = 0; j1 < Item.itemsList[k].getRenderPasses(l); ++j1)
{
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);
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)
{
if (this.renderWithColor) {
GL11.glColor4f(f, f1, f3, 1.0F);
}
this.func_94149_a(par4, par5, icon1, 16, 16);
this.renderIcon(par4, par5, icon1, 16, 16);
}
GL11.glEnable(GL11.GL_LIGHTING);
}
else
{
} 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 (par3ItemStack.getItemSpriteNumber() == 0) {
par2RenderEngine.bindTexture("/terrain.png");
} else {
par2RenderEngine.bindTexture("/gui/items.png");
}
if (icon == null)
{
icon = par2RenderEngine.func_96448_c(par3ItemStack.func_94608_d());
if (icon == null) {
icon = par2RenderEngine.getMissingIcon(par3ItemStack
.getItemSpriteNumber());
}
j1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0);
@ -390,12 +370,11 @@ public class FancyItemRender extends Render
f2 = (float) (j1 >> 8 & 255) / 255.0F;
f = (float) (j1 & 255) / 255.0F;
if (this.field_77024_a)
{
if (this.renderWithColor) {
GL11.glColor4f(f4, f2, f, 1.0F);
}
this.func_94149_a(par4, par5, icon, 16, 16);
this.renderIcon(par4, par5, icon, 16, 16);
GL11.glEnable(GL11.GL_LIGHTING);
}
}
@ -406,26 +385,28 @@ public class FancyItemRender extends Render
/**
* 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);
public void renderItemAndEffectIntoGUI(FontRenderer par1FontRenderer,
RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4,
int par5) {
if (par3ItemStack != null) {
if (!ForgeHooksClient.renderInventoryItem(renderBlocks,
par2RenderEngine, par3ItemStack, renderWithColor, zLevel,
(float) par4, (float) par5)) {
this.renderItemIntoGUI(par1FontRenderer, par2RenderEngine,
par3ItemStack, par4, par5);
}
if (par3ItemStack.hasEffect())
{
if (par3ItemStack.hasEffect()) {
GL11.glDepthFunc(GL11.GL_GREATER);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDepthMask(false);
par2RenderEngine.func_98187_b("%blur%/misc/glint.png");
par2RenderEngine.bindTexture("%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);
this.renderGlint(par4 * 431278612 + par5 * 32178161, par4 - 2,
par5 - 2, 20, 20);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(true);
this.zLevel += 50.0F;
@ -435,68 +416,82 @@ public class FancyItemRender extends Render
}
}
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)
{
private void renderGlint(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)
{
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 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)
{
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.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.
* 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 renderItemOverlayIntoGUI(FontRenderer par1FontRenderer,
RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4,
int par5) {
this.renderItemStack(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;
public void renderItemStack(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);
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());
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);
@ -515,62 +510,74 @@ public class FancyItemRender extends Render
}
/**
* 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
* 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)
{
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.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)
{
public void renderIcon(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.addVertexWithUV((double) (par1 + 0),
(double) (par2 + par5), (double) this.zLevel,
(double) par3Icon.getMinU(), (double) par3Icon.getMaxV());
tessellator.addVertexWithUV((double) (par1 + par4),
(double) (par2 + par5), (double) this.zLevel,
(double) par3Icon.getMaxU(), (double) par3Icon.getMaxV());
tessellator.addVertexWithUV((double) (par1 + par4),
(double) (par2 + 0), (double) this.zLevel,
(double) par3Icon.getMaxU(), (double) par3Icon.getMinV());
tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + 0),
(double) this.zLevel, (double) par3Icon.getMinU(),
(double) par3Icon.getMinV());
tessellator.draw();
}
/**
* 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.
* 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)
{
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 ()
{
public boolean shouldSpreadItems() {
return true;
}
/**
* Items should have a bob effect
*
* @return
*/
public boolean shouldBob ()
{
public boolean shouldBob() {
return true;
}
public byte getMiniBlockCount (ItemStack stack)
{
public byte getMiniBlockCount(ItemStack stack) {
byte ret = 1;
if (stack.stackSize > 1)
ret = 2;
@ -586,11 +593,11 @@ public class FancyItemRender extends Render
/**
* 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)
{
public byte getMiniItemCount(ItemStack stack) {
byte ret = 1;
if (stack.stackSize > 1)
ret = 2;

View File

@ -68,6 +68,8 @@
<entry key="item.tconstruct.bucket.DSteel.name">Liquid Damascus Steel Bucket</entry>
<entry key="item.tconstruct.bucket.Angmallen.name">Liquid Angmallen Bucket</entry>
<entry key="item.tconstruct.strangefood.edibleslime.name">Gelatinous Slime</entry>
<entry key="SearedBlock.Table.name">Casting Table</entry>
<entry key="SearedBlock.Faucet.name">Seared Faucet</entry>

View File

@ -474,7 +474,7 @@ public class AbilityHelper
}
else
{
world.func_94575_c(x, y, z, block.blockID);
world.setBlock(x, y, z, block.blockID);
onBlockChanged(stack, world, 0, x, y, z, player, random);
return true;
}

View File

@ -107,6 +107,7 @@ public class PHConstruct {
buckets = config.getItem("Patterns and Misc", "Buckets", 14101).getInt(14101);
uselessItem = config.getItem("Patterns and Misc", "Title Icon", 14102).getInt(14102);
slimefood = config.getItem("Patterns and Misc", "Strange Food", 14103).getInt(14103);
boolean ic2 = true;
boolean xycraft = true;
@ -175,6 +176,9 @@ public class PHConstruct {
public static int buckets;
public static int uselessItem;
//Food
public static int slimefood;
//Tools
public static int pickaxe;
public static int shovel;

View File

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

View File

@ -34,7 +34,7 @@ public class TConstructRegistry
//Rendering
//itemMap.func_94245_a
//itemMap.updateIcons
/*public static void addMaterialRenderMapping(int materialID, String textureLocation)

View File

@ -21,7 +21,7 @@ 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.EdibleSlime;
import mods.tinker.tconstruct.entity.BlueSlime;
import mods.tinker.tconstruct.entity.Skyla;
import mods.tinker.tconstruct.entity.UnstableCreeper;
import mods.tinker.tconstruct.items.CraftedSoilItemBlock;
@ -36,6 +36,7 @@ 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.StrangeFood;
import mods.tinker.tconstruct.items.TitleIcon;
import mods.tinker.tconstruct.items.ToolPart;
import mods.tinker.tconstruct.items.ToolShard;
@ -105,6 +106,8 @@ public class TContent implements IFuelHandler
public static Item manualBook;
public static Item buckets;
public static Item titleIcon;
public static Item strangeFood;
//public static Item stonePattern;
//public static Item netherPattern;
@ -183,12 +186,13 @@ public class TContent implements IFuelHandler
EntityRegistry.registerModEntity(Skyla.class, "Skyla", 10, TConstruct.instance, 32, 5, true);
EntityRegistry.registerModEntity(UnstableCreeper.class, "UnstableCreeper", 11, TConstruct.instance, 64, 5, true);
EntityRegistry.registerModEntity(EdibleSlime.class, "EdibleSlime", 12, TConstruct.instance, 64, 5, true);
EntityRegistry.registerModEntity(BlueSlime.class, "EdibleSlime", 12, TConstruct.instance, 64, 5, true);
BiomeGenBase[] overworldBiomes = new BiomeGenBase[] { BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.desert, BiomeGenBase.extremeHills, BiomeGenBase.forest, BiomeGenBase.taiga,
BiomeGenBase.swampland, BiomeGenBase.river, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.beach,
BiomeGenBase.desertHills, BiomeGenBase.forestHills, BiomeGenBase.taigaHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.jungle, BiomeGenBase.jungleHills };
EntityRegistry.addSpawn(UnstableCreeper.class, 8, 4, 6, EnumCreatureType.monster, overworldBiomes);
EntityRegistry.addSpawn(BlueSlime.class, 10, 4, 4, EnumCreatureType.monster, overworldBiomes);
}
void registerBlocks ()
@ -261,11 +265,13 @@ public class TContent implements IFuelHandler
titleIcon = new TitleIcon(PHConstruct.uselessItem).setUnlocalizedName("tconstruct.titleicon");
String[] blanks = new String[] { "blank_pattern", "blank_cast" };
blankPattern = new CraftingItem(PHConstruct.blankPattern, blanks, blanks, "materials/").setUnlocalizedName("tconstruct.Pattern");
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_paperstack", "material_slimecrystal", "material_searedbrick", "material_cobaltingot", "material_arditeingot", "material_manyullyningot",
"material_mossball", "material_lavacrystal", "material_necroticbone", "material_copperingot", "material_tiningot", "material_aluminumingot", "material_aluminumraw",
"material_bronzeingot", "material_alubrassingot", "material_alumiteingot", "material_steelingot" };
materials = new CraftingItem(PHConstruct.materials, craftingMaterials, craftingTextures, "materials/").setUnlocalizedName("tconstruct.Materials");
toolRod = new ToolPart(PHConstruct.toolRod, "ToolRod", "_rod").setUnlocalizedName("tconstruct.ToolRod");
toolShard = new ToolShard(PHConstruct.toolShard, "ToolShard", "_chunk").setUnlocalizedName("tconstruct.ToolShard");
@ -302,7 +308,13 @@ public class TContent implements IFuelHandler
frypanHead = new ToolPart(PHConstruct.frypanHead, "FrypanHead", "_frypan_head").setUnlocalizedName("tconstruct.FrypanHead");
signHead = new ToolPart(PHConstruct.signHead, "SignHead", "_battlesign_head").setUnlocalizedName("tconstruct.SignHead");
strangeFood = new StrangeFood(PHConstruct.slimefood).setUnlocalizedName("tconstruct.strangefood");
//lumberHead = new ToolPart(PHConstruct.lumberHead, 0, broadheads).setUnlocalizedName("tconstruct.LumberHead");
Item.doorWood.setMaxStackSize(16);
Item.doorSteel.setMaxStackSize(16);
Item.snowball.setMaxStackSize(64);
Item.boat.setMaxStackSize(16);
Item.potion.setMaxStackSize(16);
}
void registerMaterials ()
@ -327,6 +339,7 @@ public class TContent implements IFuelHandler
//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);
@ -476,19 +489,35 @@ public class TContent implements IFuelHandler
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
lc.addCastingRecipe(new ItemStack(materials, 1, 9), new LiquidStack(liquidMetalStill.blockID, 1, 2), ingotcast, 50); //copper
lc.addCastingRecipe(new ItemStack(materials, 1, 10), new LiquidStack(liquidMetalStill.blockID, 1, 3), ingotcast, 50); //tin
lc.addCastingRecipe(new ItemStack(materials, 1, 11), new LiquidStack(liquidMetalStill.blockID, 1, 4), ingotcast, 50); //aluminum
lc.addCastingRecipe(new ItemStack(materials, 1, 3), new LiquidStack(liquidMetalStill.blockID, 1, 5), ingotcast, 50); //cobalt
lc.addCastingRecipe(new ItemStack(materials, 1, 4), new LiquidStack(liquidMetalStill.blockID, 1, 6), ingotcast, 50); //ardite
lc.addCastingRecipe(new ItemStack(materials, 1, 13), new LiquidStack(liquidMetalStill.blockID, 1, 7), ingotcast, 50); //bronze
lc.addCastingRecipe(new ItemStack(materials, 1, 14), new LiquidStack(liquidMetalStill.blockID, 1, 8), ingotcast, 50); //albrass
lc.addCastingRecipe(new ItemStack(materials, 1, 5), new LiquidStack(liquidMetalStill.blockID, 1, 9), ingotcast, 50); //manyullyn
lc.addCastingRecipe(new ItemStack(materials, 1, 15), new LiquidStack(liquidMetalStill.blockID, 1, 10), ingotcast, 50); //alumite
lc.addCastingRecipe(new ItemStack(Item.ingotIron), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 0), ingotcast, 75); //Iron
lc.addCastingRecipe(new ItemStack(Item.ingotGold), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 1), ingotcast, 75); //gold
lc.addCastingRecipe(new ItemStack(materials, 1, 9), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 2), ingotcast, 75); //copper
lc.addCastingRecipe(new ItemStack(materials, 1, 10), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 3), ingotcast, 75); //tin
lc.addCastingRecipe(new ItemStack(materials, 1, 11), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 4), ingotcast, 75); //aluminum
lc.addCastingRecipe(new ItemStack(materials, 1, 3), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 5), ingotcast, 75); //cobalt
lc.addCastingRecipe(new ItemStack(materials, 1, 4), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 6), ingotcast, 75); //ardite
lc.addCastingRecipe(new ItemStack(materials, 1, 13), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 7), ingotcast, 75); //bronze
lc.addCastingRecipe(new ItemStack(materials, 1, 14), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 8), ingotcast, 75); //albrass
lc.addCastingRecipe(new ItemStack(materials, 1, 5), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 9), ingotcast, 75); //manyullyn
lc.addCastingRecipe(new ItemStack(materials, 1, 15), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 10), ingotcast, 75); //alumite
// obsidian
lc.addCastingRecipe(new ItemStack(materials, 1, 16), new LiquidStack(liquidMetalStill.blockID, 1, 12), ingotcast, 50); //steel
lc.addCastingRecipe(new ItemStack(materials, 1, 16), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 12), ingotcast, 75); //steel
//Buckets
ItemStack bucket = new ItemStack(Item.bucketEmpty);
lc.addCastingRecipe(new ItemStack(buckets, 1, 0), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 0), bucket, 10); //Iron
lc.addCastingRecipe(new ItemStack(buckets, 1, 1), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 1), bucket, 10); //gold
lc.addCastingRecipe(new ItemStack(buckets, 1, 2), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 2), bucket, 10); //copper
lc.addCastingRecipe(new ItemStack(buckets, 1, 3), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 3), bucket, 10); //tin
lc.addCastingRecipe(new ItemStack(buckets, 1, 4), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 4), bucket, 10); //aluminum
lc.addCastingRecipe(new ItemStack(buckets, 1, 5), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 5), bucket, 10); //cobalt
lc.addCastingRecipe(new ItemStack(buckets, 1, 6), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 6), bucket, 10); //ardite
lc.addCastingRecipe(new ItemStack(buckets, 1, 7), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 7), bucket, 10); //bronze
lc.addCastingRecipe(new ItemStack(buckets, 1, 8), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 8), bucket, 10); //albrass
lc.addCastingRecipe(new ItemStack(buckets, 1, 9), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 9), bucket, 10); //manyullyn
lc.addCastingRecipe(new ItemStack(buckets, 1, 10), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 10), bucket, 10); //alumite
lc.addCastingRecipe(new ItemStack(buckets, 1, 11), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 11), bucket, 10);// obsidian
lc.addCastingRecipe(new ItemStack(buckets, 1, 12), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 12), bucket, 10); //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),
@ -522,10 +551,10 @@ public class TContent implements IFuelHandler
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, 7), new LiquidStack(liquidMetalStill.blockID, 3, 2), new LiquidStack(liquidMetalStill.blockID, 1, 3)); //Bronze
Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 2, 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(
Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 3, 10), new LiquidStack(liquidMetalStill.blockID, 5, 4), new LiquidStack(liquidMetalStill.blockID, 2, 0), new LiquidStack(
liquidMetalStill.blockID, 2, 11)); //Alumite
}
@ -630,7 +659,7 @@ public class TContent implements IFuelHandler
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);
LiquidStack liquidstack = new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, iter);
LiquidDictionary.getOrCreateLiquid("Molten " + liquidNames[iter], liquidstack);
LiquidContainerRegistry.registerLiquid(new LiquidContainerData(liquidstack, new ItemStack(buckets, 1, iter), new ItemStack(Item.bucketEmpty)));
}

View File

@ -248,7 +248,7 @@ public class TEventHandler
if (meta != -1)
{
evt.world.func_94571_i(hitX, hitY, hitZ); //Set air block
evt.world.setBlockToAir(hitX, hitY, hitZ); //Set air block
evt.result = new ItemStack(TContent.buckets, 1, meta);
evt.setResult(Result.ALLOW);
}

View File

@ -41,9 +41,9 @@ public class EquipBlock extends InventoryBlock
}
/*@SideOnly(Side.CLIENT)
public void func_94332_a (IconRegister par1IconRegister)
public void registerIcons (IconRegister par1IconRegister)
{
this.field_94336_cN = par1IconRegister.func_94245_a(Block.blockSteel.getUnlocalizedName());
this.blockIcon = par1iconRegister.registerIcon(Block.blockSteel.getUnlocalizedName());
}*/
@Override

View File

@ -4,7 +4,6 @@ import java.util.List;
import mods.tinker.common.IServantLogic;
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;
@ -13,17 +12,21 @@ 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.Item;
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.common.ForgeDirection;
import net.minecraftforge.liquids.ILiquidTank;
import net.minecraftforge.liquids.LiquidContainerRegistry;
import net.minecraftforge.liquids.LiquidStack;
public class LavaTankBlock extends BlockContainer
{
public Icon[] icons;
public LavaTankBlock(int id)
{
super(id, Material.rock);
@ -32,32 +35,24 @@ public class LavaTankBlock extends BlockContainer
setUnlocalizedName("TConstruct.LavaTank");
setStepSound(Block.soundGlassFootstep);
}
public String[] getTextureNames()
public String[] getTextureNames ()
{
String[] textureNames = {
"lavatank_side",
"lavatank_top",
"searedgague_top",
"searedgague_side",
"searedgague_bottom",
"searedwindow_top",
"searedwindow_side",
"searedwindow_bottom" };
return textureNames;
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)
{
public void registerIcons (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]);
}
}
for (int i = 0; i < this.icons.length; ++i)
{
this.icons[i] = iconRegister.registerIcon("tinker:" + textureNames[i]);
}
}
@Override
public boolean isOpaqueCube ()
@ -75,27 +70,26 @@ public class LavaTankBlock extends BlockContainer
public boolean shouldSideBeRendered (IBlockAccess world, int x, int y, int z, int side)
{
//if (side == 0 && world.getBlockMetadata(x, y, z) == 0)
//return super.shouldSideBeRendered(world, x, y, z, side);
int bID = world.getBlockId(x, y, z);
return bID == this.blockID ? false : super.shouldSideBeRendered(world, x, y, z, side);
//return super.shouldSideBeRendered(world, x, y, z, side);
int bID = world.getBlockId(x, y, z);
return bID == this.blockID ? false : super.shouldSideBeRendered(world, x, y, z, side);
//return true;
}
@Override
public int getLightValue(IBlockAccess world, int x, int y, int z)
{
public int getLightValue (IBlockAccess world, int x, int y, int z)
{
TileEntity logic = world.getBlockTileEntity(x, y, z);
if (logic != null && logic instanceof LavaTankLogic)
return ((LavaTankLogic) logic).getBrightness();
return 0;
}
}
/*@Override
public int getRenderBlockPass()
{
{
return 1;
}*/
}*/
@Override
public int getRenderType ()
@ -118,10 +112,10 @@ public class LavaTankBlock extends BlockContainer
}
else
{
return icons[meta*3+getTextureIndex(side)-1];
return icons[meta * 3 + getTextureIndex(side) - 1];
}
}
public int getTextureIndex (int side)
{
if (side == 0)
@ -141,21 +135,75 @@ public class LavaTankBlock extends BlockContainer
@Override
public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int side, float clickX, float clickY, float clickZ)
{
LiquidStack liquid = LiquidContainerRegistry.getLiquidForFilledItem(player.getCurrentEquippedItem());
if (liquid != null)
ItemStack heldItem = player.inventory.getCurrentItem();
if (heldItem != null)
{
LiquidStack liquid = LiquidContainerRegistry.getLiquidForFilledItem(player.getCurrentEquippedItem());
LavaTankLogic logic = (LavaTankLogic) world.getBlockTileEntity(x, y, z);
int amount = logic.fill(0, liquid, true);
if (amount > 0)
return true;
if (liquid != null)
{
int amount = logic.fill(0, liquid, false);
if (amount == liquid.amount)
{
logic.fill(ForgeDirection.UNKNOWN, liquid, true);
if (!player.capabilities.isCreativeMode)
player.inventory.setInventorySlotContents(player.inventory.currentItem, consumeItem(heldItem));
return true;
}
else
return false;
}
else if (LiquidContainerRegistry.isBucket(heldItem))
{
ILiquidTank[] tanks = logic.getTanks(ForgeDirection.UNKNOWN);
LiquidStack fillLiquid = tanks[0].getLiquid();
ItemStack fillStack = LiquidContainerRegistry.fillLiquidContainer(fillLiquid, heldItem);
if (fillStack != null)
{
logic.drain(ForgeDirection.UNKNOWN, LiquidContainerRegistry.getLiquidForFilledItem(fillStack).amount, true);
if (!player.capabilities.isCreativeMode)
{
if (heldItem.stackSize == 1)
{
player.inventory.setInventorySlotContents(player.inventory.currentItem, fillStack);
}
else
{
player.inventory.setInventorySlotContents(player.inventory.currentItem, consumeItem(heldItem));
if (!player.inventory.addItemStackToInventory(fillStack))
{
player.dropPlayerItem(fillStack);
}
}
}
return true;
}
else
{
return false;
}
}
}
return false;
}
public static ItemStack consumeItem (ItemStack stack)
{
if (stack.stackSize == 1)
{
if (stack.getItem().hasContainerItem())
return stack.getItem().getContainerItemStack(stack);
else
return false;
return null;
}
else
{
stack.splitStack(1);
return stack;
}
return false;
}
@Override
@ -172,15 +220,15 @@ public class LavaTankBlock extends BlockContainer
list.add(new ItemStack(id, 1, iter));
}
}
/* Data */
public int damageDropped (int meta)
{
return meta;
}
/* Updates */
public void onNeighborBlockChange(World world, int x, int y, int z, int nBlockID)
public void onNeighborBlockChange (World world, int x, int y, int z, int nBlockID)
{
TileEntity logic = world.getBlockTileEntity(x, y, z);
if (logic instanceof IServantLogic)

View File

@ -27,19 +27,19 @@ public abstract class LiquidMetalBase extends Block
protected LiquidMetalBase(int par1, Material par2Material)
{
super(par1, par2Material);
textureNames = new String[] { "iron", "gold", "copper", "tin", "aluminum", "cobalt", "ardite", "bronze", "alubrass", "manyullyn", "alumite", "steel" };
textureNames = new String[] { "iron", "gold", "copper", "tin", "aluminum", "cobalt", "ardite", "bronze", "alubrass", "manyullyn", "alumite", "obsidian", "steel" };
setLightValue(0.625F);
}
public void func_94332_a (IconRegister iconRegister)
public void registerIcons (IconRegister iconRegister)
{
this.stillInoms = new Icon[textureNames.length];
this.flowInoms = new Icon[textureNames.length];
for (int i = 0; i < this.stillInoms.length; ++i)
{
this.stillInoms[i] = iconRegister.func_94245_a("tinker:liquid_" + textureNames[i]);
this.flowInoms[i] = iconRegister.func_94245_a("tinker:liquid_" + textureNames[i] + "_flow");
this.stillInoms[i] = iconRegister.registerIcon("tinker:liquid_" + textureNames[i]);
this.flowInoms[i] = iconRegister.registerIcon("tinker:liquid_" + textureNames[i] + "_flow");
}
}
@ -623,11 +623,11 @@ public abstract class LiquidMetalBase extends Block
if (var6 == 0)
{
par1World.func_94575_c(par2, par3, par4, Block.obsidian.blockID);
par1World.setBlock(par2, par3, par4, Block.obsidian.blockID);
}
else if (var6 <= 4)
{
par1World.func_94575_c(par2, par3, par4, Block.cobblestone.blockID);
par1World.setBlock(par2, par3, par4, Block.cobblestone.blockID);
}
this.triggerLavaMixEffects(par1World, par2, par3, par4);

View File

@ -33,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.setBlockAndMetadataWithNotify(x, y, z, stillLiquidId(), meta, 3);
world.setBlock(x, y, z, stillLiquidId(), meta, 3);
world.markBlockRangeForRenderUpdate(x, y, z, x, y, z);
world.markBlockForUpdate(x, y, z);
((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).setLiquidType(tex);
@ -76,7 +76,7 @@ public class LiquidMetalFlowing extends LiquidMetalBase
flow = j1;
if (flow < 0)
{
world.func_94571_i(x, y, z);
world.setBlockToAir(x, y, z);
}
else
{
@ -98,11 +98,11 @@ public class LiquidMetalFlowing extends LiquidMetalBase
{
if (flow >= 8)
{
world.setBlockAndMetadataWithNotify(x, y - 1, z, blockID, flow, 3);
world.setBlock(x, y - 1, z, blockID, flow, 3);
}
else
{
world.setBlockAndMetadataWithNotify(x, y - 1, z, blockID, flow + 8, 3);
world.setBlock(x, y - 1, z, blockID, flow + 8, 3);
}
((LiquidTextureLogic) world.getBlockTileEntity(x, y - 1, z)).setLiquidType(tex);
}
@ -144,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, 3);
world.setBlock(x, y, z, blockID, meta, 3);
((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).setLiquidType(tex);
}

View File

@ -59,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.func_94575_c(par2, par3, par4, Block.fire.blockID);
par1World.setBlock(par2, par3, par4, Block.fire.blockID);
return;
}
}
@ -81,7 +81,7 @@ public class LiquidMetalStill extends LiquidMetalBase implements ILiquid
if (par1World.isAirBlock(par2, par3 + 1, par4) && this.isFlammable(par1World, par2, par3, par4))
{
par1World.func_94575_c(par2, par3 + 1, par4, Block.fire.blockID);
par1World.setBlock(par2, par3 + 1, par4, Block.fire.blockID);
}
}
}
@ -175,7 +175,7 @@ public class LiquidMetalStill extends LiquidMetalBase implements ILiquid
int meta = world.getBlockMetadata(x, y, z);
int tex = ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).getLiquidType();
world.setBlockAndMetadataWithNotify(x, y, z, this.blockID - 1, meta, 2);
world.setBlock(x, y, z, this.blockID - 1, meta, 2);
world.scheduleBlockUpdate(x, y, z, this.blockID - 1, this.tickRate(world));
((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).setLiquidType(tex);
/*int meta = world.getBlockMetadata(x, y, z);

View File

@ -28,13 +28,13 @@ public class TConstructBlock extends Block
return meta;
}
public void func_94332_a(IconRegister iconRegister)
public void registerIcons(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]);
this.icons[i] = iconRegister.registerIcon("tinker:"+textureNames[i]);
}
}

View File

@ -0,0 +1,67 @@
package mods.tinker.tconstruct.client;
import net.minecraft.block.Block;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.RenderEngine;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.Item;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class BreakingFX extends EntityFX
{
public BreakingFX(World par1World, double par2, double par4, double par6, Item par8Item, RenderEngine par9RenderEngine)
{
super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D);
this.func_94052_a(par9RenderEngine, par8Item.getIconFromDamage(0));
this.particleRed = this.particleGreen = this.particleBlue = 1.0F;
this.particleGravity = Block.blockSnow.blockParticleGravity;
this.particleScale /= 2.0F;
}
public BreakingFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, Item par14Item, RenderEngine par15RenderEngine)
{
this(par1World, par2, par4, par6, par14Item, par15RenderEngine);
this.motionX *= 0.10000000149011612D;
this.motionY *= 0.10000000149011612D;
this.motionZ *= 0.10000000149011612D;
this.motionX += par8;
this.motionY += par10;
this.motionZ += par12;
}
public int getFXLayer()
{
return 2;
}
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
{
float f6 = ((float)this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F;
float f7 = f6 + 0.015609375F;
float f8 = ((float)this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F;
float f9 = f8 + 0.015609375F;
float f10 = 0.1F * this.particleScale;
if (this.particleTextureIndex != null)
{
f6 = this.particleTextureIndex.getInterpolatedU((double)(this.particleTextureJitterX / 4.0F * 16.0F));
f7 = this.particleTextureIndex.getInterpolatedU((double)((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F));
f8 = this.particleTextureIndex.getInterpolatedV((double)(this.particleTextureJitterY / 4.0F * 16.0F));
f9 = this.particleTextureIndex.getInterpolatedV((double)((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F));
}
float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX);
float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY);
float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ);
float f14 = 1.0F;
par1Tessellator.setColorOpaque_F(f14 * this.particleRed, f14 * this.particleGreen, f14 * this.particleBlue);
par1Tessellator.addVertexWithUV((double)(f11 - par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 - par5 * f10 - par7 * f10), (double)f6, (double)f9);
par1Tessellator.addVertexWithUV((double)(f11 - par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 - par5 * f10 + par7 * f10), (double)f6, (double)f8);
par1Tessellator.addVertexWithUV((double)(f11 + par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 + par5 * f10 + par7 * f10), (double)f7, (double)f8);
par1Tessellator.addVertexWithUV((double)(f11 + par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 + par5 * f10 - par7 * f10), (double)f7, (double)f9);
}
}

View File

@ -56,18 +56,18 @@ public class CastingTableSpecialRenderer extends TileEntitySpecialRenderer
entityitem.getEntityItem().stackSize = 1;
entityitem.hoverStart = 0.0F;
GL11.glPushMatrix();
GL11.glTranslatef(1F, 1.478F, 0.55F);
GL11.glTranslatef(1F, 1.565F, 0.55F);
GL11.glRotatef(90F, 1, 0F, 0F);
GL11.glScalef(2F, 2F, 2F);
if (stack.getItem() instanceof ItemBlock)
{
GL11.glRotatef(90F, -1, 0F, 0F);
GL11.glTranslatef(0F, -0.1F, 0.2275F);
GL11.glTranslatef(0F, -10.1F, 0.2275F);
}
RenderItem.field_82407_g = true;
RenderItem.renderInFrame = true;
RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
RenderItem.field_82407_g = false;
RenderItem.renderInFrame = false;
GL11.glPopMatrix();
}

View File

@ -98,11 +98,11 @@ public class FluidRender implements ISimpleBlockRenderingHandler
if (f8 < -999.0F)
{
d8 = (double) icon.func_94214_a(0.0D);
d12 = (double) icon.func_94207_b(0.0D);
d8 = (double) icon.getInterpolatedU(0.0D);
d12 = (double) icon.getInterpolatedV(0.0D);
d7 = d8;
d11 = (double) icon.func_94207_b(16.0D);
d10 = (double) icon.func_94214_a(16.0D);
d11 = (double) icon.getInterpolatedV(16.0D);
d10 = (double) icon.getInterpolatedU(16.0D);
d14 = d11;
d9 = d10;
d13 = d12;
@ -111,14 +111,14 @@ public class FluidRender implements ISimpleBlockRenderingHandler
{
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));
d8 = (double) icon.getInterpolatedU((double) (8.0F + (-f9 - f7) * 16.0F));
d12 = (double) icon.getInterpolatedV((double) (8.0F + (-f9 + f7) * 16.0F));
d7 = (double) icon.getInterpolatedU((double) (8.0F + (-f9 + f7) * 16.0F));
d11 = (double) icon.getInterpolatedV((double) (8.0F + (f9 + f7) * 16.0F));
d10 = (double) icon.getInterpolatedU((double) (8.0F + (f9 + f7) * 16.0F));
d14 = (double) icon.getInterpolatedV((double) (8.0F + (f9 - f7) * 16.0F));
d9 = (double) icon.getInterpolatedU((double) (8.0F + (f9 - f7) * 16.0F));
d13 = (double) icon.getInterpolatedV((double) (8.0F + (-f9 - f7) * 16.0F));
}
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
@ -213,12 +213,11 @@ public class FluidRender implements ISimpleBlockRenderingHandler
}
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);
float f11 = icon1.getInterpolatedU(0.0D);
f7 = icon1.getInterpolatedU(8.0D);
float f12 = icon1.getInterpolatedV((1.0D - d15) * 16.0D * 0.5D);
float f13 = icon1.getInterpolatedV((1.0D - d17) * 16.0D * 0.5D);
float f14 = icon1.getInterpolatedV(8.0D);
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, xPos, y, zPos));
float f15 = 1.0F;

View File

@ -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.func_98187_b(texturePath);
renderEngine.bindTexture(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.func_98187_b(texturePath);
renderEngine.bindTexture(texturePath);
GL11.glScalef(0.0625F, 0.0625F, 1F);
this.renderTexturedQuad();
@ -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.func_98187_b(texturePath);
renderEngine.bindTexture(texturePath);
float var7 = 0;
float var8 = 1;
float var9 = 0;
@ -317,7 +317,7 @@ public class SuperCustomToolRenderer implements IItemRenderer
var17 = 1.0F;
String texturePath = tool.getIconLocation(var10, renderPass);
renderEngine.func_98187_b(texturePath);
renderEngine.bindTexture(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.func_98187_b(texturePath);
renderEngine.bindTexture(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.func_98187_b(texturePath);
renderEngine.bindTexture(texturePath);
GL11.glColor4f(par5, par6, par7, 1.0F);
ItemRenderer.renderItemIn2D(var8, var10, var11, var9, var12, var16);

View File

@ -16,10 +16,11 @@ 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.entityrender.SlimeRender;
import mods.tinker.tconstruct.client.gui.ToolGuiElement;
import mods.tinker.tconstruct.entity.CartEntity;
import mods.tinker.tconstruct.entity.Crystal;
import mods.tinker.tconstruct.entity.EdibleSlime;
import mods.tinker.tconstruct.entity.BlueSlime;
import mods.tinker.tconstruct.entity.Skyla;
import mods.tinker.tconstruct.entity.UnstableCreeper;
import mods.tinker.tconstruct.logic.CastingTableLogic;
@ -53,7 +54,6 @@ import net.minecraft.client.particle.EntitySpellParticleFX;
import net.minecraft.client.particle.EntitySplashFX;
import net.minecraft.client.particle.EntitySuspendFX;
import net.minecraft.client.renderer.entity.RenderCreeper;
import net.minecraft.client.renderer.entity.RenderSlime;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.item.Item;
@ -74,6 +74,7 @@ public class TProxyClient extends TProxyCommon
{
public static SmallFontRenderer smallFontRenderer;
public static Icon blankSprite;
public static Icon metalBall;
public static Minecraft mc;
/* Registers any rendering code. */
@ -105,7 +106,7 @@ public class TProxyClient extends TProxyCommon
RenderingRegistry.registerEntityRenderingHandler(FancyEntityItem.class, new FancyItemRender());
RenderingRegistry.registerEntityRenderingHandler(Crystal.class, new CrystalRender());
RenderingRegistry.registerEntityRenderingHandler(UnstableCreeper.class, new RenderCreeper());
RenderingRegistry.registerEntityRenderingHandler(EdibleSlime.class, new RenderSlime(new ModelSlime(16), new ModelSlime(0), 0.25F));
RenderingRegistry.registerEntityRenderingHandler(BlueSlime.class, new SlimeRender(new ModelSlime(16), new ModelSlime(0), 0.25F));
//RenderingRegistry.registerEntityRenderingHandler(net.minecraft.entity.player.EntityPlayer.class, new PlayerArmorRender()); // <-- Works, woo!
addRenderMappings();
@ -187,21 +188,28 @@ public class TProxyClient extends TProxyCommon
addToolButtons();
}
public static final String[] shardNames = new String[] { "Wood", "Stone Shard", "Iron Chunk", "Flint Shard", "Cactus Shard", "Bone", "Obsidian Shard", "Netherrack Shard", "Slime Crystal Fragment", "Paper", "Cobalt Chunk", "Ardite Chunk", "Manyullyn Chunk", "Copper Chunk", "Bronze Chunk", "Alumite Chunk", "Steel Chunk" };
public static final String[] shardNames = new String[] { "Wood", "Stone Shard", "Iron Chunk", "Flint Shard", "Cactus Shard", "Bone", "Obsidian Shard", "Netherrack Shard",
"Slime Crystal Fragment", "Paper", "Cobalt Chunk", "Ardite Chunk", "Manyullyn Chunk", "Copper Chunk", "Bronze Chunk", "Alumite Chunk", "Steel Chunk" };
public static final String[] materialItemInternalNames = new String[] { "PaperStack", "SlimeCrystal", "SearedBrick", "CobaltIngot", "ArditeIngot", "ManyullynIngot", "Mossball", "LavaCrystal", "NecroticBone", "CopperIngot", "TinIngot", "AluminumIngot", "RawAluminum", "BronzeIngot", "AlBrassIngot", "AlumiteIngot", "SteelIngot" };
public static final String[] materialItemInternalNames = new String[] { "PaperStack", "SlimeCrystal", "SearedBrick", "CobaltIngot", "ArditeIngot", "ManyullynIngot", "Mossball", "LavaCrystal",
"NecroticBone", "CopperIngot", "TinIngot", "AluminumIngot", "RawAluminum", "BronzeIngot", "AlBrassIngot", "AlumiteIngot", "SteelIngot" };
public static final String[] materialItemNames = new String[] { "Paper Stack", "Slime Crystal", "Seared Brick", "Cobalt Ingot", "Ardite Ingot", "Manyullyn Ingot", "Ball of Moss", "Lava Crystal", "Necrotic Bone", "Copper Ingot", "Tin Ingot", "Aluminum Ingot", "Raw Aluminum", "Bronze Ingot", "Aluminum Brass Ingot", "Alumite Ingot", "Steel Ingot" };
public static final String[] materialItemNames = new String[] { "Paper Stack", "Slime Crystal", "Seared Brick", "Cobalt Ingot", "Ardite Ingot", "Manyullyn Ingot", "Ball of Moss", "Lava Crystal",
"Necrotic Bone", "Copper Ingot", "Tin Ingot", "Aluminum Ingot", "Raw Aluminum", "Bronze Ingot", "Aluminum Brass Ingot", "Alumite Ingot", "Steel Ingot" };
public static final String[] toolMaterialNames = new String[] { "Wood", "Stone", "Iron", "Flint", "Cactus", "Bone", "Obsidian", "Netherrack", "Slime", "Paper", "Cobalt", "Ardite", "Manyullyn", "Copper", "Bronze", "Alumite", "Steel" };
public static final String[] toolMaterialNames = new String[] { "Wood", "Stone", "Iron", "Flint", "Cactus", "Bone", "Obsidian", "Netherrack", "Slime", "Paper", "Cobalt", "Ardite", "Manyullyn",
"Copper", "Bronze", "Alumite", "Steel" };
public static final String[] materialTypes = new String[] { "ToolRod", "PickaxeHead", "ShovelHead", "AxeHead", "SwordBlade", "LargeGuard", "MediumGuard", "Crossbar", "Binding", "FrypanHead", "SignHead", "LumberHead" };
public static final String[] materialTypes = new String[] { "ToolRod", "PickaxeHead", "ShovelHead", "AxeHead", "SwordBlade", "LargeGuard", "MediumGuard", "Crossbar", "Binding", "FrypanHead",
"SignHead", "LumberHead" };
public static final String[] materialNames = new String[] { " Rod", " Pickaxe Head", " Shovel Head", " Axe Head", " Sword Blade", " Wide Guard", " Hand Guard", " Crossbar", " Binding", " Pan", " Board", " Broad Axe Head" };
public static final String[] materialNames = new String[] { " Rod", " Pickaxe Head", " Shovel Head", " Axe Head", " Sword Blade", " Wide Guard", " Hand Guard", " Crossbar", " Binding", " Pan",
" Board", " Broad Axe Head" };
public static final String[] patterns = new String[] { "ingot", "rod", "pickaxe", "shovel", "axe", "swordblade", "largeguard", "mediumguard", "crossbar", "binding", "frypan", "sign" };
public static final String[] patternNames = new String[] { "Ingot", "Tool Rod", "Pickaxe Head", "Shovel Head", "Axe Head", "Sword Blade", "Wide Guard", "Hand Guard", "Crossbar", "Tool Binding", "Pan", "Board", "Broad Axe Head" };
public static final String[] patternNames = new String[] { "Ingot", "Tool Rod", "Pickaxe Head", "Shovel Head", "Axe Head", "Sword Blade", "Wide Guard", "Hand Guard", "Crossbar", "Tool Binding",
"Pan", "Board", "Broad Axe Head" };
public static Document diary;
public static Document volume1;
@ -282,14 +290,17 @@ public class TProxyClient extends TProxyCommon
//"Ice Axe",
"Mattock", "Broadsword", "Longsword", "Rapier", "Frying Pan", "Battlesign" };
static String[] toolDescriptions = { "The main way to repair or change your tools. Place a tool and a material on the left to get started.",
static String[] toolDescriptions = {
"The main way to repair or change your tools. Place a tool and a material on the left to get started.",
"The Pickaxe is a basic mining tool. It is effective on stone and ores.\n\nRequired parts:\n- Pickaxe Head\n- Tool Binding\n- Handle",
"The Shovel is a basic digging tool. It is effective on dirt, sand, and snow.\n\nRequired parts:\n- Shovel Head\n- Handle",
"The Axe is a basic chopping tool. It is effective on wood and leaves.\n\nRequired parts:\n- Axe Head\n- Handle",
//"The Lumber Axe is a broad chopping tool. It harvests wood in a wide range and can fell entire trees.\n\nRequired parts:\n- Broad Axe Head\n- Handle",
//"The Ice Axe is a tool for harvesting ice, mining, and attacking foes.\n\nSpecial Ability:\n- Wall Climb\nNatural Ability:\n- Ice Harvest\nDamage: Moderate\n\nRequired parts:\n- Pickaxe Head\n- Spike\n- Handle",
"The Cutter Mattock is a versatile farming tool. It is effective on wood, dirt, and plants.\n\nSpecial Ability: Hoe\n\nRequired parts:\n- Axe Head\n- Shovel Head\n- Handle", "The Broadsword is a defensive weapon. Blocking cuts damage in half.\n\nSpecial Ability: Block\nDamage: Moderate\nDurability: High\n\nRequired parts:\n- Sword Blade\n- Wide Guard\n- Handle",
"The Longsword is a balanced weapon. It is useful for knocking enemies away or getting in and out of battle quickly.\n\nNatural Ability:\n- Charge Boost\nDamage: Moderate\nDurability: Moderate\n\nRequired parts:\n- Sword Blade\n- Hand Guard\n- Handle", "The Rapier is an offensive weapon that relies on quick strikes to defeat foes.\n\nNatural Abilities:\n- Armor Pierce\n- Quick Strike\n- Charge Boost\nDamage: High\nDurability: Low\n\nRequired parts:\n- Sword Blade\n- Crossbar\n- Handle",
"The Cutter Mattock is a versatile farming tool. It is effective on wood, dirt, and plants.\n\nSpecial Ability: Hoe\n\nRequired parts:\n- Axe Head\n- Shovel Head\n- Handle",
"The Broadsword is a defensive weapon. Blocking cuts damage in half.\n\nSpecial Ability: Block\nDamage: Moderate\nDurability: High\n\nRequired parts:\n- Sword Blade\n- Wide Guard\n- Handle",
"The Longsword is a balanced weapon. It is useful for knocking enemies away or getting in and out of battle quickly.\n\nNatural Ability:\n- Charge Boost\nDamage: Moderate\nDurability: Moderate\n\nRequired parts:\n- Sword Blade\n- Hand Guard\n- Handle",
"The Rapier is an offensive weapon that relies on quick strikes to defeat foes.\n\nNatural Abilities:\n- Armor Pierce\n- Quick Strike\n- Charge Boost\nDamage: High\nDurability: Low\n\nRequired parts:\n- Sword Blade\n- Crossbar\n- Handle",
"The Frying is a heavy weapon that uses sheer weight to stun foes.\n\nSpecial Ability: Block\nNatural Ability: Bash\nShift+rClick: Place Frying Pan\nDamage: Low\nDurability: High\n\nRequired parts:\n- Pan\n- Handle",
//"The Battlesign is an advance in weapon technology worthy of Zombie Pigmen everywhere.\n\nSpecial Ability: Block\nShift-rClick: Place sign\nDamage: Low\nDurability: Average\n\nRequired parts:\n- Board\n- Handle"
"The Battlesign is an advance in weapon technology worthy of Zombie Pigmen everywhere.\n\nSpecial Ability: Block\nDamage: Low\nDurability: Average\n\nRequired parts:\n- Sign Board\n- Handle" };
@ -364,18 +375,18 @@ public class TProxyClient extends TProxyCommon
settings.keyBindings = allKeys;
settings.loadOptions();
}
public void spawnParticle (String particle, double xPos, double yPos, double zPos, double velX, double velY, double velZ)
public void spawnParticle (String particle, double xPos, double yPos, double zPos, double velX, double velY, double velZ)
{
this.doSpawnParticle(particle, xPos, yPos, zPos, velX, velY, velZ);
}
public EntityFX doSpawnParticle(String par1Str, double par2, double par4, double par6, double par8, double par10, double par12)
{
public EntityFX doSpawnParticle (String par1Str, double par2, double par4, double par6, double par8, double par10, double par12)
{
if (this.mc == null)
this.mc = Minecraft.getMinecraft();
if ( this.mc.renderViewEntity != null && this.mc.effectRenderer != null)
if (this.mc.renderViewEntity != null && this.mc.effectRenderer != null)
{
int i = this.mc.gameSettings.particleSetting;
@ -440,12 +451,6 @@ public class TProxyClient extends TProxyCommon
{
entityfx = new EntityCritFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
}
else if (par1Str.equals("magicCrit"))
{
entityfx = new EntityCritFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
((EntityFX)entityfx).setRBGColorF(((EntityFX)entityfx).getRedColorF() * 0.3F, ((EntityFX)entityfx).getGreenColorF() * 0.8F, ((EntityFX)entityfx).getBlueColorF());
((EntityFX)entityfx).func_94053_h();
}
else if (par1Str.equals("smoke"))
{
entityfx = new EntitySmokeFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
@ -537,9 +542,9 @@ public class TProxyClient extends TProxyCommon
{
entityfx = new EntitySnowShovelFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
}
else if (par1Str.equals("slime"))
else if (par1Str.equals("blueslime"))
{
entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, Item.appleGold, mc.renderEngine);
entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, TContent.strangeFood, mc.renderEngine);
}
else if (par1Str.equals("heart"))
{
@ -583,5 +588,48 @@ public class TProxyClient extends TProxyCommon
{
return null;
}
}
/*if (this.mc.renderViewEntity != null && this.mc.effectRenderer != null)
{
int i = this.mc.gameSettings.particleSetting;
if (i == 1 && mc.theWorld.rand.nextInt(3) == 0)
{
i = 2;
}
double d6 = this.mc.renderViewEntity.posX - par2;
double d7 = this.mc.renderViewEntity.posY - par4;
double d8 = this.mc.renderViewEntity.posZ - par6;
EntityFX entityfx = null;
double d9 = 16.0D;
if (d6 * d6 + d7 * d7 + d8 * d8 > d9 * d9)
{
return null;
}
else if (i > 1)
{
return null;
}
else
{
if (par1Str.equals("blueslime"))
{
entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, Item.appleGold, mc.renderEngine);RenderGlobal
}
else if (par1Str.equals("metalslime"))
{
entityfx = new BreakingFX(mc.theWorld, par2, par4, par6, metalBall, mc.renderEngine);
}
return (EntityFX) entityfx;
}
}
else
{
return null;
}*/
}
}

View File

@ -42,6 +42,7 @@ public class TableRender implements ISimpleBlockRenderingHandler
@Override
public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer)
{
System.out.println("Rendering Table Block");
if (modelID == tabelModelID)
{
int metadata = world.getBlockMetadata(x, y, z);

View File

@ -0,0 +1,57 @@
package mods.tinker.tconstruct.client.entityrender;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class SlimeModel extends ModelBase
{
/** The slime's bodies, both the inside box and the outside box */
ModelRenderer slimeBodies;
/** The slime's right eye */
ModelRenderer slimeRightEye;
/** The slime's left eye */
ModelRenderer slimeLeftEye;
/** The slime's mouth */
ModelRenderer slimeMouth;
public SlimeModel(int par1)
{
this.slimeBodies = new ModelRenderer(this, 0, par1);
this.slimeBodies.addBox(-4.0F, 16.0F, -4.0F, 8, 8, 8);
if (par1 > 0)
{
this.slimeBodies = new ModelRenderer(this, 0, par1);
this.slimeBodies.addBox(-3.0F, 17.0F, -3.0F, 6, 6, 6);
this.slimeRightEye = new ModelRenderer(this, 32, 0);
this.slimeRightEye.addBox(-3.25F, 18.0F, -3.5F, 2, 2, 2);
this.slimeLeftEye = new ModelRenderer(this, 32, 4);
this.slimeLeftEye.addBox(1.25F, 18.0F, -3.5F, 2, 2, 2);
this.slimeMouth = new ModelRenderer(this, 32, 8);
this.slimeMouth.addBox(0.0F, 21.0F, -3.5F, 1, 1, 1);
}
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7)
{
this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
this.slimeBodies.render(par7);
if (this.slimeRightEye != null)
{
this.slimeRightEye.render(par7);
this.slimeLeftEye.render(par7);
this.slimeMouth.render(par7);
}
}
}

View File

@ -0,0 +1,80 @@
package mods.tinker.tconstruct.client.entityrender;
import mods.tinker.tconstruct.entity.BlueSlime;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.EntityLiving;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class SlimeRender extends RenderLiving
{
private ModelBase scaleAmount;
public SlimeRender(ModelBase par1ModelBase, ModelBase par2ModelBase, float par3)
{
super(par1ModelBase, par3);
this.scaleAmount = par2ModelBase;
}
/**
* Determines whether Slime Render should pass or not.
*/
protected int shouldSlimeRenderPass(BlueSlime par1EdibleSlime, int par2, float par3)
{
if (par1EdibleSlime.getHasActivePotion())
{
return 0;
}
else if (par2 == 0)
{
this.setRenderPassModel(this.scaleAmount);
GL11.glEnable(GL11.GL_NORMALIZE);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
return 1;
}
else
{
if (par2 == 1)
{
GL11.glDisable(GL11.GL_BLEND);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
return -1;
}
}
/**
* sets the scale for the slime based on getSlimeSize in EdibleSlime
*/
protected void scaleSlime(BlueSlime par1EdibleSlime, float par2)
{
float f1 = (float)par1EdibleSlime.getSlimeSize();
float f2 = (par1EdibleSlime.field_70812_c + (par1EdibleSlime.field_70811_b - par1EdibleSlime.field_70812_c) * par2) / (f1 * 0.5F + 1.0F);
float f3 = 1.0F / (f2 + 1.0F);
GL11.glScalef(f3 * f1, 1.0F / f3 * f1, f3 * f1);
}
/**
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
* entityLiving, partialTickTime
*/
protected void preRenderCallback(EntityLiving par1EntityLiving, float par2)
{
this.scaleSlime((BlueSlime)par1EntityLiving, par2);
}
/**
* Queries whether should render the specified pass or not.
*/
protected int shouldRenderPass(EntityLiving par1EntityLiving, int par2, float par3)
{
return this.shouldSlimeRenderPass((BlueSlime)par1EntityLiving, par2, par3);
}
}

View File

@ -27,7 +27,7 @@ public class FrypanGui extends GuiContainer
protected void drawGuiContainerBackgroundLayer(float f, int i, int j)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/frypan.png");
mc.renderEngine.bindTexture("/mods/tinker/textures/gui/frypan.png");
int cornerX = (width - xSize) / 2;
int cornerY = (height - ySize) / 2;
drawTexturedModalRect(cornerX, cornerY, 0, 0, xSize, ySize);

View File

@ -35,7 +35,7 @@ public class GuiButtonTool extends GuiButton
{
boolean var4 = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.func_98187_b(texture);
mc.renderEngine.bindTexture(texture);
this.field_82253_i = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
int var5 = this.getHoverState(this.field_82253_i);

View File

@ -130,7 +130,7 @@ public class GuiManual extends GuiScreen
//int texID = this.mc.renderEngine.getTexture();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/bookright.png");
this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/bookright.png");
int localWidth = (this.width) / 2;
byte localHeight = 8;
this.drawTexturedModalRect(localWidth, localHeight, 0, 0, this.bookImageWidth, this.bookImageHeight);
@ -138,7 +138,7 @@ public class GuiManual extends GuiScreen
//texID = this.mc.renderEngine.getTexture("/mods/tinker/textures/gui/bookleft.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
//this.mc.renderEngine.bindTexture(texID);
this.mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/bookleft.png");
this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/bookleft.png");
localWidth = localWidth - this.bookImageWidth;
this.drawTexturedModalRect(localWidth, localHeight, 256 - this.bookImageWidth, 0, this.bookImageWidth, this.bookImageHeight);

View File

@ -133,7 +133,7 @@ public class PartCrafterGui extends GuiContainer
{
// Draw the background
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/toolparts.png");
this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/toolparts.png");
int cornerX = (this.width - this.xSize) / 2;
int cornerY = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(cornerX, cornerY, 0, 0, this.xSize, this.ySize);
@ -163,7 +163,7 @@ public class PartCrafterGui extends GuiContainer
//texID = this.mc.renderEngine.getTexture("/mods/tinker/textures/gui/patternchestmini.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
//his.mc.renderEngine.bindTexture(texID);
this.mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/patternchestmini.png");
this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/patternchestmini.png");
this.drawTexturedModalRect(cornerX-116, cornerY+11, 0, 0, this.xSize, this.ySize);
}
@ -171,7 +171,7 @@ public class PartCrafterGui extends GuiContainer
//texID = this.mc.renderEngine.getTexture("/mods/tinker/textures/gui/description.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
//this.mc.renderEngine.bindTexture(texID);
this.mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/description.png");
this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/description.png");
cornerX = (this.width + this.xSize) / 2;
cornerY = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(cornerX, cornerY, 126, 0, 126, this.ySize);

View File

@ -29,7 +29,7 @@ public class PatternChestGui extends GuiContainer
protected void drawGuiContainerBackgroundLayer(float f, int i, int j)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/patternchest.png");
mc.renderEngine.bindTexture("/mods/tinker/textures/gui/patternchest.png");
int cornerX = (width - xSize) / 2;
int cornerY = (height - ySize) / 2;
drawTexturedModalRect(cornerX, cornerY, 0, 0, xSize, ySize);

View File

@ -45,7 +45,7 @@ public class PatternShaperGui extends GuiContainer
protected void drawGuiContainerBackgroundLayer (float par1, int par2, int par3)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/patternshaper.png");
this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/patternshaper.png");
int cornerX = (this.width - this.xSize) / 2;
int cornerY = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(cornerX, cornerY, 0, 0, this.xSize, this.ySize);

View File

@ -122,7 +122,7 @@ public class SmelteryGui extends GuiContainer
protected void drawGuiContainerBackgroundLayer (float f, int i, int j)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/smeltery.png");
mc.renderEngine.bindTexture("/mods/tinker/textures/gui/smeltery.png");
int cornerX = (width - xSize) / 2;
int cornerY = (height - ySize) / 2;
drawTexturedModalRect(cornerX + 46, cornerY, 0, 0, xSize, ySize);
@ -132,7 +132,7 @@ public class SmelteryGui extends GuiContainer
{
//ForgeHooksClient.bindTexture(Block.lavaStill.getTextureFile(), 0);
//int renderIndex = Block.lavaStill.getBlockTextureFromSideAndMetadata(0, 0);
this.mc.renderEngine.func_98187_b("/terrain.png");
this.mc.renderEngine.bindTexture("/terrain.png");
Icon lavaIcon = Block.lavaStill.getBlockTextureFromSideAndMetadata(0, 0);
//int xTex = renderIndex % 16 * 16;
//int yTex = renderIndex / 16 * 16;
@ -142,7 +142,7 @@ public class SmelteryGui extends GuiContainer
{
int size = fuel >= 16 ? 16 : fuel;
fuel -= size;
func_94065_a(cornerX + 117, (cornerY + 68) - size - 16 * count, lavaIcon, 12, size);
drawTexturedModelRectFromIcon(cornerX + 117, (cornerY + 68) - size - 16 * count, lavaIcon, 12, size);
//drawTexturedModalRect(cornerX + 117, (cornerY + 68) - size - 16 * count, 0, 16 - size, 12, size);
count++;
}
@ -157,7 +157,7 @@ public class SmelteryGui extends GuiContainer
{
Block liquidBlock = Block.blocksList[liquid.itemID];
//ForgeHooksClient.bindTexture(liquidBlock.getTextureFile(), 0);
this.mc.renderEngine.func_98187_b("/terrain.png");
this.mc.renderEngine.bindTexture("/terrain.png");
renderIndex = liquidBlock.getBlockTextureFromSideAndMetadata(0, liquid.itemMeta);
}
else
@ -165,7 +165,7 @@ public class SmelteryGui extends GuiContainer
{
Item liquidItem = Item.itemsList[liquid.itemID];
//ForgeHooksClient.bindTexture(liquidItem.getTextureFile(), 0);
this.mc.renderEngine.func_98187_b("/gui/items.png");
this.mc.renderEngine.bindTexture("/gui/items.png");
renderIndex = liquidItem.getIconFromDamage(liquid.itemMeta);
}
@ -178,10 +178,10 @@ public class SmelteryGui extends GuiContainer
{
int size = liquidSize >= 16 ? 16 : liquidSize;
int basePos = 54;
func_94065_a(cornerX + basePos, (cornerY + 68) - size - base, renderIndex, 16, size);
func_94065_a(cornerX + basePos + 16, (cornerY + 68) - size - base, renderIndex, 16, size);
func_94065_a(cornerX + basePos + 32, (cornerY + 68) - size - base, renderIndex, 16, size);
func_94065_a(cornerX + basePos + 48, (cornerY + 68) - size - base, renderIndex, 4, size);
drawTexturedModelRectFromIcon(cornerX + basePos, (cornerY + 68) - size - base, renderIndex, 16, size);
drawTexturedModelRectFromIcon(cornerX + basePos + 16, (cornerY + 68) - size - base, renderIndex, 16, size);
drawTexturedModelRectFromIcon(cornerX + basePos + 32, (cornerY + 68) - size - base, renderIndex, 16, size);
drawTexturedModelRectFromIcon(cornerX + basePos + 48, (cornerY + 68) - size - base, renderIndex, 4, size);
liquidSize -= size;
base += size;
}
@ -192,13 +192,13 @@ public class SmelteryGui extends GuiContainer
//Liquid gague
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/smeltery.png");
mc.renderEngine.bindTexture("/mods/tinker/textures/gui/smeltery.png");
drawTexturedModalRect(cornerX + 54, cornerY + 16, xSize, 76, 52, 52);
//drawTexturedModalRect(cornerX+111, cornerY+16, xSize, 128, 52, 52);
//Side inventory
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/smelteryside.png");
mc.renderEngine.bindTexture("/mods/tinker/textures/gui/smelteryside.png");
if (logic.layers == 1)
{
drawTexturedModalRect(cornerX - 46, cornerY, 0, 0, 98, 43);
@ -230,7 +230,7 @@ public class SmelteryGui extends GuiContainer
}
}
fontRenderer.drawString("Time: "+logic.useTime, 140, 2, 0xFFFFFF);
//fontRenderer.drawString("Time: "+logic.useTime, 140, 2, 0xFFFFFF);
/*fontRenderer.drawString("Scrolling: "+isScrolling, 140, 12, 0xFFFFFF);
fontRenderer.drawString("Scroll: "+currentScroll, 140, 22, 0xFFFFFF);*/
}

View File

@ -291,7 +291,7 @@ public class ToolStationGui extends GuiContainer
// Draw the background
//int texID = this.mc.renderEngine.getTexture("/mods/tinker/textures/gui/toolstation.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/toolstation.png");
this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/toolstation.png");
int cornerX = (this.width - this.xSize) / 2;
int cornerY = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(cornerX, cornerY, 0, 0, this.xSize, this.ySize);
@ -299,7 +299,7 @@ public class ToolStationGui extends GuiContainer
//texID = this.mc.renderEngine.getTexture("/mods/tinker/textures/gui/icons.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
//this.mc.renderEngine.bindTexture(texID);
this.mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/icons.png");
this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/icons.png");
// Draw the slots
for (int i = 0; i < slotX.length; i++)
@ -315,7 +315,7 @@ public class ToolStationGui extends GuiContainer
//texID = this.mc.renderEngine.getTexture("/mods/tinker/textures/gui/description.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
//this.mc.renderEngine.bindTexture(texID);
this.mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/description.png");
this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/description.png");
cornerX = (this.width + this.xSize) / 2;
cornerY = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(cornerX, cornerY, 0, 0, 126, this.ySize + 30);

View File

@ -31,7 +31,7 @@ public class TurnPageButton extends GuiButton
{
boolean var4 = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
par1Minecraft.renderEngine.func_98187_b("/mods/tinker/textures/gui/bookleft.png");
par1Minecraft.renderEngine.bindTexture("/mods/tinker/textures/gui/bookleft.png");
int var5 = 0;
int var6 = 192;

View File

@ -1834,7 +1834,7 @@ public class ModelRendererTurbo extends ModelRenderer
curTexGroup.loadTexture();
GL11.glCallList(displayListArray[i]);
if(!defaultTexture.equals(""))
renderEngine.func_98187_b(defaultTexture);
renderEngine.bindTexture(defaultTexture);
}
}
}

View File

@ -29,11 +29,11 @@ public class TextureGroup
if(!texture.equals(""))
{
RenderEngine renderengine = RenderManager.instance.renderEngine;
renderengine.func_98187_b(texture);
renderengine.bindTexture(texture);
}
/*else if(defaultTexture > -1)
{
RenderManager.instance.renderEngine.func_98187_b(defaultTexture);
RenderManager.instance.renderEngine.bindTexture(defaultTexture);
}*/
}

View File

@ -17,6 +17,7 @@ public class SmelteryContainer extends Container
public SmelteryContainer(InventoryPlayer inventoryplayer, SmelteryLogic smeltery)
{
logic = smeltery;
System.out.println("getSizeInventory: "+logic.getSizeInventory());
playerInv = inventoryplayer;
if (smeltery.layers > 2)
{

View File

@ -13,7 +13,6 @@ public class LiquidCasting
{
public static LiquidCasting instance = new LiquidCasting();
private ArrayList<CastingRecipe> casts = new ArrayList<CastingRecipe>();
private HashMap<List<Integer>, Float> materialReduction = new HashMap<List<Integer>, Float>();
public static void addCastingRecipe(ItemStack replacement, LiquidStack metal, ItemStack cast, boolean consume, int delay)
{
@ -35,6 +34,14 @@ public class LiquidCasting
return -1;
}
public int getCastingAmount(LiquidStack metal, ItemStack cast)
{
CastingRecipe recipe = getCastingRecipe(metal, cast);
if (recipe != null)
return recipe.castingMetal.amount;
return 0;
}
public CastingRecipe getCastingRecipe(LiquidStack metal, ItemStack cast)
{
for (CastingRecipe recipe : casts)
@ -44,13 +51,4 @@ public class LiquidCasting
}
return null;
}
public float getMaterialReduction(LiquidStack metal)
{
if (materialReduction.containsKey(Arrays.asList(metal.itemID, metal.itemMeta)))
{
return materialReduction.get(Arrays.asList(metal.itemID, metal.itemMeta));
}
return 1f;
}
}

View File

@ -0,0 +1,461 @@
package mods.tinker.tconstruct.entity;
import com.google.common.io.ByteArrayDataInput;
import com.google.common.io.ByteArrayDataOutput;
import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.TContent;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.IMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
public class BlueSlime extends EntityLiving implements IMob
{
private static final float[] field_100000_e = new float[] { 1.0F, 0.75F, 0.5F, 0.25F, 0.0F, 0.25F, 0.5F, 0.75F };
public float field_70813_a;
public float field_70811_b;
public float field_70812_c;
/** the time between each jump of the slime */
private int slimeJumpDelay = 0;
public BlueSlime(World world)
{
super(world);
this.texture = "/mods/tinker/textures/mob/slimeedible.png";
int i = 1 << Math.max(1, this.rand.nextInt(4));
this.yOffset = 0.0F;
this.slimeJumpDelay = this.rand.nextInt(20) + 10;
this.setSlimeSize(i);
this.jumpMovementFactor = 0.004F * i + 0.01F;
//if (i > 6)
//makeSlimeJocky(world);
//System.out.println("Woo");
}
@Override
public void initCreature ()
{
//Minecraft.getMinecraft().getLogAgent().logInfo("Initializing a slime with size "+getSlimeSize());
if (getSlimeSize() == 2 && rand.nextInt(15) == 0)
{
EntitySkeleton entityskeleton = new EntitySkeleton(this.worldObj);
entityskeleton.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
entityskeleton.initCreature();
this.worldObj.spawnEntityInWorld(entityskeleton);
entityskeleton.mountEntity(this);
}
}
/*@Override
public void updateRiderPosition()
{
if (this.riddenByEntity != null)
{
if (!(this.riddenByEntity instanceof EntityPlayer) || !((EntityPlayer)this.riddenByEntity).func_71066_bF())
{
this.riddenByEntity.lastTickPosX = this.lastTickPosX;//+Math.sin(this.rotationYaw/360);
this.riddenByEntity.lastTickPosY = this.lastTickPosY + this.getMountedYOffset() + this.riddenByEntity.getYOffset();
this.riddenByEntity.lastTickPosZ = this.lastTickPosZ;//+Math.cos(this.rotationYaw/360);
}
this.riddenByEntity.setPosition(this.posX, this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset(), this.posZ);
}
}*/
@Override
public double getMountedYOffset()
{
return this.height * 0.3;
}
/*protected void makeSlimeJocky(World world)
{
//if (!world.isRemote)
//{
EntitySkeleton skeleton = new EntitySkeleton(world);
skeleton.setPosition(posX, posY, posZ);
skeleton.setAngles(this.rotationYaw, this.rotationYaw);
world.spawnEntityInWorld(skeleton);
skeleton.mountEntity(this);
spawnedJocky = true;
//}
}*/
protected void jump ()
{
this.motionY = 0.05 * getSlimeSize() + 0.37;
if (this.isPotionActive(Potion.jump))
{
this.motionY += (double) ((float) (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F);
}
if (this.isSprinting())
{
float f = this.rotationYaw * 0.017453292F;
this.motionX -= (double) (MathHelper.sin(f) * 0.2F);
this.motionZ += (double) (MathHelper.cos(f) * 0.2F);
}
this.isAirBorne = true;
ForgeHooks.onLivingJump(this);
}
protected void fall (float par1)
{
}
protected String getSlimeParticle ()
{
return "blueslime";
}
@Override
public boolean getCanSpawnHere ()
{
return isValidLightLevel() && this.worldObj.checkIfAABBIsClear(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()
&& !this.worldObj.isAnyLiquid(this.boundingBox);
}
protected boolean isValidLightLevel ()
{
int x = MathHelper.floor_double(this.posX);
int y = MathHelper.floor_double(this.boundingBox.minY);
int z = MathHelper.floor_double(this.posZ);
if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, x, y, z) > this.rand.nextInt(32))
{
return false;
}
else
{
int light = this.worldObj.getBlockLightValue(x, y, z);
if (this.worldObj.isThundering())
{
int i1 = this.worldObj.skylightSubtracted;
this.worldObj.skylightSubtracted = 10;
light = this.worldObj.getBlockLightValue(x, y, z);
this.worldObj.skylightSubtracted = i1;
}
return light <= this.rand.nextInt(10);
}
}
protected void entityInit ()
{
super.entityInit();
this.dataWatcher.addObject(16, new Byte((byte) 1));
}
protected void setSlimeSize (int size)
{
this.dataWatcher.updateObject(16, new Byte((byte) size));
this.setSize(0.6F * size, 0.6F * size);
this.setPosition(this.posX, this.posY, this.posZ);
this.setEntityHealth(this.getMaxHealth());
this.experienceValue = size + 2;
}
public int getMaxHealth ()
{
int i = this.getSlimeSize();
if (i == 1)
return 4;
return (int) Math.min(i * i + 8, 49);
}
/**
* Returns the size of the slime.
*/
public int getSlimeSize ()
{
return this.dataWatcher.getWatchableObjectByte(16);
}
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT (NBTTagCompound par1NBTTagCompound)
{
super.writeEntityToNBT(par1NBTTagCompound);
par1NBTTagCompound.setInteger("Size", this.getSlimeSize() - 1);
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT (NBTTagCompound par1NBTTagCompound)
{
super.readEntityFromNBT(par1NBTTagCompound);
this.setSlimeSize(par1NBTTagCompound.getInteger("Size") + 1);
}
/**
* Returns the name of the sound played when the slime jumps.
*/
protected String getJumpSound ()
{
return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small");
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate ()
{
if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0 && this.getSlimeSize() > 0)
{
this.isDead = true;
}
this.field_70811_b += (this.field_70813_a - this.field_70811_b) * 0.5F;
this.field_70812_c = this.field_70811_b;
boolean flag = this.onGround;
super.onUpdate();
int i;
if (this.onGround && !flag)
{
i = this.getSlimeSize();
for (int j = 0; j < i * 8; ++j)
{
float f = this.rand.nextFloat() * (float) Math.PI * 2.0F;
float offset = this.rand.nextFloat() * 0.5F + 0.5F;
float xPos = MathHelper.sin(f) * (float) i * 0.5F * offset;
float zPos = MathHelper.cos(f) * (float) i * 0.5F * offset;
TConstruct.proxy.spawnParticle(this.getSlimeParticle(), this.posX + (double) xPos, this.boundingBox.minY, this.posZ + (double) zPos, 0.0D, 0.0D, 0.0D);
}
//if (this.makesSoundOnLand())
//{
this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) / 0.8F);
//}
this.field_70813_a = -0.5F;
}
else if (!this.onGround && flag)
{
this.field_70813_a = 1.0F;
}
this.func_70808_l();
if (this.worldObj.isRemote)
{
i = this.getSlimeSize();
this.setSize(0.6F * (float) i, 0.6F * (float) i);
}
}
protected void updateEntityActionState ()
{
this.despawnEntity();
EntityPlayer entityplayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D);
if (entityplayer != null)
{
this.faceEntity(entityplayer, 10.0F, 20.0F);
}
else if (this.onGround && this.slimeJumpDelay == 1)
{
//this.rotationPitch = rand.nextFloat()*360;
this.rotationYaw = this.rotationYaw + rand.nextFloat() * 180 - 90;
if (rotationYaw > 360)
rotationYaw -= 360;
if (rotationYaw < 0)
rotationYaw += 360;
}
if (this.onGround && this.slimeJumpDelay-- <= 0)
{
this.slimeJumpDelay = this.getJumpDelay();
if (entityplayer != null)
{
this.slimeJumpDelay /= 3;
}
this.isJumping = true;
if (this.makesSoundOnJump())
{
this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 0.8F);
}
this.moveStrafing = 1.0F - this.rand.nextFloat() * 2.0F;
this.moveForward = (float) (1 * this.getSlimeSize());
}
else
{
this.isJumping = false;
if (this.onGround)
{
this.moveStrafing = this.moveForward = 0.0F;
}
}
}
protected void func_70808_l ()
{
this.field_70813_a *= 0.6F;
}
/**
* Gets the amount of time the slime needs to wait between jumps.
*/
protected int getJumpDelay ()
{
return this.rand.nextInt(20) + 10;
}
protected BlueSlime createInstance ()
{
return new BlueSlime(this.worldObj);
}
/**
* Will get destroyed next tick.
*/
public void setDead ()
{
int i = this.getSlimeSize();
if (!this.worldObj.isRemote && i > 1 && this.getHealth() <= 0)
{
float f = (-0.5F) * (float) i / 4.0F;
float f1 = (-0.5F) * (float) i / 4.0F;
BlueSlime entityslime = this.createInstance();
entityslime.setSlimeSize(i / 2);
entityslime.setLocationAndAngles(this.posX + (double) f, this.posY + 0.5D, this.posZ + (double) f1, this.rand.nextFloat() * 360.0F, 0.0F);
this.worldObj.spawnEntityInWorld(entityslime);
}
super.setDead();
}
protected void dropFewItems (boolean par1, int par2)
{
int j = this.getDropItemId();
if (j > 0)
{
int k = rand.nextInt(3) + rand.nextInt(this.getSlimeSize());
if (par2 > 0)
{
k += this.rand.nextInt(par2 + 1);
}
for (int l = 0; l < k; ++l)
{
this.dropItem(j, 1);
}
}
}
/**
* Called by a player entity when they collide with an entity
*/
public void onCollideWithPlayer (EntityPlayer par1EntityPlayer)
{
if (this.canDamagePlayer())
{
int i = this.getSlimeSize();
if (this.canEntityBeSeen(par1EntityPlayer) && this.getDistanceSqToEntity(par1EntityPlayer) < 0.6D * (double) i * 0.6D * (double) i
&& par1EntityPlayer.attackEntityFrom(DamageSource.causeMobDamage(this), this.getAttackStrength()))
{
this.playSound("mob.attack", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
}
}
}
/**
* Indicates weather the slime is able to damage the player (based upon the slime's size)
*/
protected boolean canDamagePlayer ()
{
return this.getSlimeSize() > 1;
}
/**
* Gets the amount of damage dealt to the player when "attacked" by the slime.
*/
protected int getAttackStrength ()
{
return this.getSlimeSize();
}
/**
* Returns the sound this mob makes when it is hurt.
*/
protected String getHurtSound ()
{
return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small");
}
/**
* Returns the sound this mob makes on death.
*/
protected String getDeathSound ()
{
return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small");
}
/**
* Returns the item ID for the item the mob drops on death.
*/
protected int getDropItemId ()
{
return TContent.strangeFood.itemID;
}
/**
* Returns the volume for the sounds this mob makes.
*/
protected float getSoundVolume ()
{
return 0.4F * (float) this.getSlimeSize();
}
/**
* The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently
* use in wolves.
*/
public int getVerticalFaceSpeed ()
{
return 0;
}
/**
* Returns true if the slime makes a sound when it jumps (based upon the slime's size)
*/
protected boolean makesSoundOnJump ()
{
return this.getSlimeSize() > 0;
}
/**
* Returns true if the slime makes a sound when it lands after a jump (based upon the slime's size)
*/
/*protected boolean makesSoundOnLand ()
{
return this.getSlimeSize() > 2;
}*/
}

View File

@ -1428,14 +1428,14 @@ public class CartEntity extends Entity
}
@Override
public boolean func_94042_c ()
public boolean isInvNameLocalized ()
{
// TODO Auto-generated method stub
return false;
}
@Override
public boolean func_94041_b (int i, ItemStack itemstack)
public boolean isStackValidForSlot (int i, ItemStack itemstack)
{
// TODO Auto-generated method stub
return false;

View File

@ -1,349 +0,0 @@
package mods.tinker.tconstruct.entity;
import mods.tinker.tconstruct.TConstruct;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.monster.IMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.World;
public class EdibleSlime extends EntityLiving implements IMob
{
private static final float[] field_100000_e = new float[] {1.0F, 0.75F, 0.5F, 0.25F, 0.0F, 0.25F, 0.5F, 0.75F};
public float field_70813_a;
public float field_70811_b;
public float field_70812_c;
/** the time between each jump of the slime */
private int slimeJumpDelay = 0;
public EdibleSlime(World world)
{
super(world);
this.texture = "/mods/tinker/textures/mob/slimeedible.png";
int i = 1 << this.rand.nextInt(3);
this.yOffset = 0.0F;
this.slimeJumpDelay = this.rand.nextInt(20) + 10;
this.setSlimeSize(i);
}
protected String getSlimeParticle()
{
return "slime";
}
@Override
public boolean getCanSpawnHere ()
{
return isValidLightLevel() && this.worldObj.checkIfAABBIsClear(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()
&& !this.worldObj.isAnyLiquid(this.boundingBox);
}
protected boolean isValidLightLevel ()
{
int x = MathHelper.floor_double(this.posX);
int y = MathHelper.floor_double(this.boundingBox.minY);
int z = MathHelper.floor_double(this.posZ);
if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, x, y, z) > this.rand.nextInt(32))
{
return false;
}
else
{
int light = this.worldObj.getBlockLightValue(x, y, z);
if (this.worldObj.isThundering())
{
int i1 = this.worldObj.skylightSubtracted;
this.worldObj.skylightSubtracted = 10;
light = this.worldObj.getBlockLightValue(x, y, z);
this.worldObj.skylightSubtracted = i1;
}
return light <= this.rand.nextInt(12);
}
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(16, new Byte((byte)1));
}
protected void setSlimeSize(int par1)
{
this.dataWatcher.updateObject(16, new Byte((byte)par1));
this.setSize(0.6F * (float)par1, 0.6F * (float)par1);
this.setPosition(this.posX, this.posY, this.posZ);
this.setEntityHealth(this.getMaxHealth());
this.experienceValue = par1;
}
public int getMaxHealth()
{
int i = this.getSlimeSize();
return i * i;
}
/**
* Returns the size of the slime.
*/
public int getSlimeSize()
{
return this.dataWatcher.getWatchableObjectByte(16);
}
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
{
super.writeEntityToNBT(par1NBTTagCompound);
par1NBTTagCompound.setInteger("Size", this.getSlimeSize() - 1);
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
{
super.readEntityFromNBT(par1NBTTagCompound);
this.setSlimeSize(par1NBTTagCompound.getInteger("Size") + 1);
}
/**
* Returns the name of the sound played when the slime jumps.
*/
protected String getJumpSound()
{
return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small");
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0 && this.getSlimeSize() > 0)
{
this.isDead = true;
}
this.field_70811_b += (this.field_70813_a - this.field_70811_b) * 0.5F;
this.field_70812_c = this.field_70811_b;
boolean flag = this.onGround;
super.onUpdate();
int i;
if (this.onGround && !flag)
{
i = this.getSlimeSize();
for (int j = 0; j < i * 8; ++j)
{
float f = this.rand.nextFloat() * (float)Math.PI * 2.0F;
float offset = this.rand.nextFloat() * 0.5F + 0.5F;
float xPos = MathHelper.sin(f) * (float)i * 0.5F * offset;
float zPos = MathHelper.cos(f) * (float)i * 0.5F * offset;
//this.worldObj.spawnParticle(this.getSlimeParticle(), this.posX + (double)f2, this.boundingBox.minY, this.posZ + (double)f3, 0.0D, 0.0D, 0.0D);
TConstruct.proxy.spawnParticle(this.getSlimeParticle(), this.posX + (double)xPos, this.boundingBox.minY, this.posZ + (double)zPos, 0.0D, 0.0D, 0.0D);
}
if (this.makesSoundOnLand())
{
this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) / 0.8F);
}
this.field_70813_a = -0.5F;
}
else if (!this.onGround && flag)
{
this.field_70813_a = 1.0F;
}
this.func_70808_l();
if (this.worldObj.isRemote)
{
i = this.getSlimeSize();
this.setSize(0.6F * (float)i, 0.6F * (float)i);
}
}
protected void updateEntityActionState()
{
this.despawnEntity();
EntityPlayer entityplayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D);
if (entityplayer != null)
{
this.faceEntity(entityplayer, 10.0F, 20.0F);
}
if (this.onGround && this.slimeJumpDelay-- <= 0)
{
this.slimeJumpDelay = this.getJumpDelay();
if (entityplayer != null)
{
this.slimeJumpDelay /= 3;
}
this.isJumping = true;
if (this.makesSoundOnJump())
{
this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 0.8F);
}
this.moveStrafing = 1.0F - this.rand.nextFloat() * 2.0F;
this.moveForward = (float)(1 * this.getSlimeSize());
}
else
{
this.isJumping = false;
if (this.onGround)
{
this.moveStrafing = this.moveForward = 0.0F;
}
}
}
protected void func_70808_l()
{
this.field_70813_a *= 0.6F;
}
/**
* Gets the amount of time the slime needs to wait between jumps.
*/
protected int getJumpDelay()
{
return this.rand.nextInt(20) + 10;
}
protected EdibleSlime createInstance()
{
return new EdibleSlime(this.worldObj);
}
/**
* Will get destroyed next tick.
*/
public void setDead()
{
int i = this.getSlimeSize();
if (!this.worldObj.isRemote && i > 1 && this.getHealth() <= 0)
{
int j = 2 + this.rand.nextInt(3);
for (int k = 0; k < j; ++k)
{
float f = ((float)(k % 2) - 0.5F) * (float)i / 4.0F;
float f1 = ((float)(k / 2) - 0.5F) * (float)i / 4.0F;
EdibleSlime entityslime = this.createInstance();
entityslime.setSlimeSize(i / 2);
entityslime.setLocationAndAngles(this.posX + (double)f, this.posY + 0.5D, this.posZ + (double)f1, this.rand.nextFloat() * 360.0F, 0.0F);
this.worldObj.spawnEntityInWorld(entityslime);
}
}
super.setDead();
}
/**
* Called by a player entity when they collide with an entity
*/
public void onCollideWithPlayer(EntityPlayer par1EntityPlayer)
{
if (this.canDamagePlayer())
{
int i = this.getSlimeSize();
if (this.canEntityBeSeen(par1EntityPlayer) && this.getDistanceSqToEntity(par1EntityPlayer) < 0.6D * (double)i * 0.6D * (double)i && par1EntityPlayer.attackEntityFrom(DamageSource.causeMobDamage(this), this.getAttackStrength()))
{
this.playSound("mob.attack", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
}
}
}
/**
* Indicates weather the slime is able to damage the player (based upon the slime's size)
*/
protected boolean canDamagePlayer()
{
return this.getSlimeSize() > 1;
}
/**
* Gets the amount of damage dealt to the player when "attacked" by the slime.
*/
protected int getAttackStrength()
{
return this.getSlimeSize();
}
/**
* Returns the sound this mob makes when it is hurt.
*/
protected String getHurtSound()
{
return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small");
}
/**
* Returns the sound this mob makes on death.
*/
protected String getDeathSound()
{
return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small");
}
/**
* Returns the item ID for the item the mob drops on death.
*/
protected int getDropItemId()
{
return this.getSlimeSize() == 1 ? Item.slimeBall.itemID : 0;
}
/**
* Returns the volume for the sounds this mob makes.
*/
protected float getSoundVolume()
{
return 0.4F * (float)this.getSlimeSize();
}
/**
* The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently
* use in wolves.
*/
public int getVerticalFaceSpeed()
{
return 0;
}
/**
* Returns true if the slime makes a sound when it jumps (based upon the slime's size)
*/
protected boolean makesSoundOnJump()
{
return this.getSlimeSize() > 0;
}
/**
* Returns true if the slime makes a sound when it lands after a jump (based upon the slime's size)
*/
protected boolean makesSoundOnLand()
{
return this.getSlimeSize() > 2;
}
}

View File

@ -36,13 +36,13 @@ public class CraftingItem extends Item
}
@SideOnly(Side.CLIENT)
public void func_94581_a(IconRegister iconRegister)
public void updateIcons(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:"+folder+textureNames[i]);
this.icons[i] = iconRegister.registerIcon("tinker:"+folder+textureNames[i]);
}
}

View File

@ -27,6 +27,7 @@ public class FilledBucket extends ItemBucket
//setTextureFile(TContent.craftingTexture);
//setIconIndex(224);
setUnlocalizedName("tconstruct.bucket");
setContainerItem(Item.bucketEmpty);
}
public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player)
@ -134,7 +135,7 @@ public class FilledBucket extends ItemBucket
}
else
{
world.func_94575_c(clickX, clickY, clickZ, TContent.liquidMetalStill.blockID);
world.setBlock(clickX, clickY, clickZ, TContent.liquidMetalStill.blockID);
LiquidTextureLogic logic = (LiquidTextureLogic) world.getBlockTileEntity(clickX, clickY, clickZ);
logic.setLiquidType(meta);
@ -158,13 +159,13 @@ public class FilledBucket extends ItemBucket
}
@SideOnly(Side.CLIENT)
public void func_94581_a(IconRegister iconRegister)
public void updateIcons(IconRegister iconRegister)
{
this.icons = new Icon[materialNames.length];
for (int i = 0; i < this.icons.length; ++i)
{
this.icons[i] = iconRegister.func_94245_a("tinker:materials/bucket_"+textureNames[i]);
this.icons[i] = iconRegister.registerIcon("tinker:materials/bucket_"+textureNames[i]);
}
}

View File

@ -39,13 +39,13 @@ public class Pattern extends CraftingItem
"ingot", "rod", "pickaxe", "shovel", "axe", "swordblade", "largeguard", "mediumguard", "crossbar", "binding", "frypan", "sign" };
/*@SideOnly(Side.CLIENT)
public void func_94581_a(IconRegister iconRegister)
public void updateIcons(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]);
this.icons[i] = iconRegister.registerIcon("tinker:"+textureNames[i]);
}
}*/

View File

@ -0,0 +1,72 @@
package mods.tinker.tconstruct.items;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mods.tinker.tconstruct.TConstruct;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class SpecialFood extends ItemFood
{
int[] hunger;
float[] saturation;
String[] unlocalizedNames;
String[] iconNames;
Icon[] icons;
public SpecialFood(int id, int[] hunger, float[] saturation, String[] textureNames, String[] iconNames)
{
super(id, 0, 0, false);
this.hunger = hunger;
this.saturation = saturation;
this.unlocalizedNames = textureNames;
this.iconNames = iconNames;
}
@Override
public ItemStack onEaten(ItemStack stack, World world, EntityPlayer player)
{
stack.stackSize--;
int damage = stack.getItemDamage();
player.getFoodStats().addStats(hunger[damage], saturation[damage]);
world.playSoundAtEntity(player, "random.burp", 0.5F, world.rand.nextFloat() * 0.1F + 0.9F);
this.onFoodEaten(stack, world, player);
return stack;
}
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int meta)
{
return icons[meta];
}
@SideOnly(Side.CLIENT)
public void updateIcons(IconRegister iconRegister)
{
this.icons = new Icon[iconNames.length];
for (int i = 0; i < this.icons.length; ++i)
{
this.icons[i] = iconRegister.registerIcon("tinker:"+iconNames[i]);
}
}
public String getUnlocalizedName(ItemStack stack)
{
int arr = MathHelper.clamp_int(stack.getItemDamage(), 0, unlocalizedNames.length);
return getUnlocalizedName() + "." +unlocalizedNames[arr];
}
public void getSubItems (int id, CreativeTabs tab, List list)
{
for (int i = 0; i < unlocalizedNames.length; i++)
list.add(new ItemStack(id, 1, i));
}
}

View File

@ -0,0 +1,24 @@
package mods.tinker.tconstruct.items;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class StrangeFood extends SpecialFood
{
public StrangeFood(int id)
{
super(id, new int[] { 1 }, new float[] { 1f }, new String[] { "edibleslime" }, new String[] { "edibleslime" });
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
{
list.add("\u00a7b\u00a7oIt smells terrible, but if you");
list.add("\u00a7b\u00a7ohave nothing else to eat...");
}
}

View File

@ -13,9 +13,10 @@ public class TitleIcon extends Item
}
@Override
public void func_94581_a (IconRegister iconRegister)
public void updateIcons (IconRegister iconRegister)
{
TProxyClient.blankSprite = iconRegister.func_94245_a("tinker:blanksprite");
iconIndex = iconRegister.func_94245_a("tinker:tparts");
TProxyClient.blankSprite = iconRegister.registerIcon("tinker:blanksprite");
TProxyClient.metalBall = iconRegister.registerIcon("tinker:metalball");
iconIndex = iconRegister.registerIcon("tinker:tparts");
}
}

View File

@ -32,13 +32,13 @@ public class ToolPart extends CraftingItem
}
/*@SideOnly(Side.CLIENT)
public void func_94581_a(IconRegister iconRegister)
public void updateIcons(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:parts/"+textureNames[i]);
this.icons[i] = iconRegister.registerIcon("tinker:parts/"+textureNames[i]);
}
}*/

View File

@ -1,5 +1,6 @@
package mods.tinker.tconstruct.logic;
import cpw.mods.fml.common.FMLLog;
import mods.tinker.common.IPattern;
import mods.tinker.common.InventoryLogic;
import mods.tinker.tconstruct.TConstruct;
@ -7,6 +8,7 @@ import mods.tinker.tconstruct.crafting.CastingRecipe;
import mods.tinker.tconstruct.crafting.LiquidCasting;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet;
@ -20,7 +22,6 @@ import net.minecraftforge.liquids.LiquidStack;
public class CastingTableLogic extends InventoryLogic implements ILiquidTank, ITankContainer
{
public LiquidStack liquid;
float materialRedux = 0;
int castingDelay = 0;
int renderOffset = 0;
@ -58,10 +59,15 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank, IT
public int getCapacity ()
{
int ret = TConstruct.ingotLiquidValue;
if (inventory[0] != null && inventory[0].getItem() instanceof IPattern)
ret *= ((IPattern) inventory[0].getItem()).getPatternCost(inventory[0].getItemDamage()) * 0.5;
if (materialRedux > 0)
ret *= materialRedux;
ItemStack inv = inventory[0];
if (inv != null && inv.getItem() instanceof IPattern)
ret *= ((IPattern) inv.getItem()).getPatternCost(inv.getItemDamage()) * 0.5;
else
ret = LiquidCasting.instance.getCastingAmount(liquid, inv);
return ret;
}
@ -76,9 +82,18 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank, IT
if (inventory[1] == null && LiquidCasting.instance.getCastingRecipe(resource, inventory[0]) != null)
{
liquid = resource.copy();
materialRedux = LiquidCasting.instance.getMaterialReduction(resource);
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
int capacity = getCapacity();
if (liquid.amount > capacity)
{
liquid.amount = capacity;
}
if (liquid.amount == capacity)
{
castingDelay = LiquidCasting.instance.getCastingDelay(liquid, inventory[0]);
}
renderOffset = liquid.amount;
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
return liquid.amount;
}
else
@ -194,7 +209,6 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank, IT
CastingRecipe recipe = LiquidCasting.instance.getCastingRecipe(liquid, inventory[0]);
if (recipe != null)
{
materialRedux = 0;
inventory[1] = recipe.getResult();
if (recipe.consumeCast)
inventory[0] = null;

View File

@ -4,7 +4,12 @@ import mods.tinker.common.CoordTuple;
import mods.tinker.common.IMasterLogic;
import mods.tinker.common.IServantLogic;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.Packet132TileEntityData;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.liquids.LiquidStack;
public class MultiServantLogic extends TileEntity
implements IServantLogic
@ -85,9 +90,8 @@ public class MultiServantLogic extends TileEntity
}
}
public void readFromNBT (NBTTagCompound tags)
public void readCustomNBT (NBTTagCompound tags)
{
super.readFromNBT(tags);
hasMaster = tags.getBoolean("HasMaster");
if (hasMaster)
{
@ -100,9 +104,8 @@ public class MultiServantLogic extends TileEntity
}
}
public void writeToNBT (NBTTagCompound tags)
public void writeCustomNBT (NBTTagCompound tags)
{
super.writeToNBT(tags);
tags.setBoolean("HasMaster", hasMaster);
if (hasMaster)
{
@ -113,4 +116,34 @@ public class MultiServantLogic extends TileEntity
tags.setByte("masterMeat", masterMeat);
}
}
@Override
public void readFromNBT (NBTTagCompound tags)
{
super.readFromNBT(tags);
readCustomNBT(tags);
}
@Override
public void writeToNBT (NBTTagCompound tags)
{
super.writeToNBT(tags);
writeCustomNBT(tags);
}
/* Packets */
@Override
public Packet getDescriptionPacket ()
{
NBTTagCompound tag = new NBTTagCompound();
writeCustomNBT(tag);
return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag);
}
@Override
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet)
{
readCustomNBT(packet.customParam1);
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
}
}

View File

@ -61,7 +61,7 @@ public class SmelteryDrainLogic extends MultiServantLogic
@Override
public int fill (int tankIndex, LiquidStack resource, boolean doFill)
{
if (hasMaster) //Not sure if it should fill or not
if (hasMaster && resource != null)
{
if (doFill)
{

View File

@ -2,6 +2,8 @@ package mods.tinker.tconstruct.logic;
import java.util.ArrayList;
import cpw.mods.fml.common.FMLLog;
import mods.tinker.common.CoordTuple;
import mods.tinker.common.IActiveLogic;
import mods.tinker.common.IFacingLogic;
@ -107,6 +109,7 @@ public class SmelteryLogic extends InventoryLogic
@Override
public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z)
{
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
return new SmelteryContainer(inventoryplayer, this);
}
@ -210,7 +213,7 @@ public class SmelteryLogic extends InventoryLogic
if (meltingTemps[i] > 20 && this.isStackInSlot(i))
{
if (activeTemps[i] < internalTemp && activeTemps[i] < meltingTemps[i])
activeTemps[i] += 5;
activeTemps[i] += 10;
else if (meltingTemps[i] >= activeTemps[i])
{
if (!worldObj.isRemote)
@ -311,13 +314,13 @@ public class SmelteryLogic extends InventoryLogic
}
/* Inventory */
public int getMaxStackStackSize (ItemStack stack)
/*public int getMaxStackStackSize (ItemStack stack)
{
LiquidStack liquid = getResultFor(stack);
if (liquid == null)
return 0;
return liquid.amount;
}
}*/
public int getInventoryStackLimit ()
{
@ -332,6 +335,12 @@ public class SmelteryLogic extends InventoryLogic
}
/* Multiblock */
@Override
public void notifyChange (int x, int y, int z)
{
checkValidPlacement();
}
public void checkValidPlacement ()
{
switch (getRenderDirection())
@ -576,7 +585,6 @@ public class SmelteryLogic extends InventoryLogic
return false;
}
/* Not an ILiquidTank, but is still a liquid tank of sorts */
public int getCapacity ()
{
return maxLiquid;
@ -612,9 +620,14 @@ public class SmelteryLogic extends InventoryLogic
public int fill (LiquidStack resource, boolean doFill)
{
int amount = resource.amount;
addMoltenMetal(resource, false);
return amount;
if (resource != null)
{
int amount = resource.amount;
addMoltenMetal(resource, false);
return amount;
}
else
return 0;
}
@Override
@ -632,8 +645,16 @@ public class SmelteryLogic extends InventoryLogic
}
/* NBT */
@Override
public void readFromNBT (NBTTagCompound tags)
{
super.readFromNBT(tags);
readCustomNBT(tags);
//checkValidPlacement();
}
public void readCustomNBT (NBTTagCompound tags)
{
direction = tags.getByte("Direction");
useTime = tags.getInteger("UseTime");
@ -653,13 +674,17 @@ public class SmelteryLogic extends InventoryLogic
int meta = tagList.getInteger("meta");
moltenMetal.add(new LiquidStack(id, amount, meta));
}
adjustLayers(layers, true);
super.readFromNBT(tags);
}
@Override
public void writeToNBT (NBTTagCompound tags)
{
super.writeToNBT(tags);
writeCustomNBT(tags);
}
public void writeCustomNBT (NBTTagCompound tags)
{
tags.setByte("Direction", direction);
tags.setInteger("UseTime", useTime);
@ -679,7 +704,6 @@ public class SmelteryLogic extends InventoryLogic
}
tags.setTag("Liquids", taglist);
super.writeToNBT(tags);
}
/* Packets */
@ -697,10 +721,4 @@ public class SmelteryLogic extends InventoryLogic
readFromNBT(packet.customParam1);
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
}
@Override
public void notifyChange (int x, int y, int z)
{
checkValidPlacement();
}
}

View File

@ -75,11 +75,11 @@ public class BattleSign extends Weapon
if (par7 == 1)
{
int var11 = MathHelper.floor_double((double)((player.rotationYaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15;
par3World.setBlockAndMetadataWithNotify(par4, par5, par6, Block.signPost.blockID, var11);
par3World.setBlock(par4, par5, par6, Block.signPost.blockID, var11);
}
else
{
par3World.setBlockAndMetadataWithNotify(par4, par5, par6, Block.signWall.blockID, par7);
par3World.setBlock(par4, par5, par6, Block.signWall.blockID, par7);
}
//--par1ItemStack.stackSize;

View File

@ -44,7 +44,7 @@ public abstract class DualHarvestTool extends HarvestTool
if (result != null)
{
//System.out.println("Woo~");
world.func_94571_i(x, y, z);
world.setBlockToAir(x, y, z);
if (!player.capabilities.isCreativeMode)
onBlockDestroyed(stack, world, bID, x, y, z, player);
if (!world.isRemote)
@ -64,7 +64,7 @@ public abstract class DualHarvestTool extends HarvestTool
{
if (!player.capabilities.isCreativeMode)
onBlockDestroyed(stack, world, bID, x, y, z, player);
world.func_94571_i(x, y, z);
world.setBlockToAir(x, y, z);
if (!world.isRemote)
world.playAuxSFX(2001, x, y, z, bID + (meta << 12));
return true;

View File

@ -83,7 +83,7 @@ public class FryingPan extends Weapon
}
else
{
world.setBlockAndMetadataWithNotify(x, y, z, TContent.heldItemBlock.blockID, 0, 3);
world.setBlock(x, y, z, TContent.heldItemBlock.blockID, 0, 3);
EquipLogic logic = (EquipLogic) world.getBlockTileEntity(x, y, z);
logic.setEquipmentItem(stack);

View File

@ -54,8 +54,8 @@ public class Hammer extends HarvestTool
coords.add(new int[] {0, 0, -1});
}
@Override
public boolean onBlockDestroyed (ItemStack itemstack, World world, int bID, int x, int y, int z, EntityLiving living)
//@Override
/*public boolean onBlockDestroyed (ItemStack itemstack, World world, int bID, int x, int y, int z, EntityLiving living)
{
if (!(itemstack.getTagCompound().getCompoundTag("InfiTool").getBoolean("Broken")) && living instanceof EntityPlayer)
{
@ -68,11 +68,11 @@ public class Hammer extends HarvestTool
if (block != null)
{
if (block.blockID == Block.stone.blockID)
world.func_94575_c(xPos, yPos, zPos, Block.cobblestone.blockID);
world.setBlock(xPos, yPos, zPos, Block.cobblestone.blockID);
else if (block.blockMaterial == Material.rock)
{
int meta = world.getBlockMetadata(xPos, yPos, zPos);
world.func_94571_i(x, y, z);
world.setBlockToAir(x, y, z);
Block.blocksList[bID].harvestBlock(world, (EntityPlayer)player, xPos, yPos, zPos, meta);
if (!player.capabilities.isCreativeMode)
onBlockDestroyed(itemstack, world, bID, xPos, yPos, zPos, player);
@ -82,7 +82,7 @@ public class Hammer extends HarvestTool
}
}
return AbilityHelper.onBlockChanged(itemstack, world, bID, x, y, z, living, random);
}
}*/
@Override
protected Item getHeadItem ()

View File

@ -38,7 +38,7 @@ public abstract class HarvestTool extends ToolCore
if (result != null)
{
//System.out.println("Woo~");
world.func_94571_i(x, y, z);
world.setBlockToAir(x, y, z);
if (!player.capabilities.isCreativeMode)
onBlockDestroyed(stack, world, bID, x, y, z, player);
if (!world.isRemote)
@ -56,7 +56,7 @@ public abstract class HarvestTool extends ToolCore
}
else
{
world.func_94571_i(x, y, z);
world.setBlockToAir(x, y, z);
if (!player.capabilities.isCreativeMode)
onBlockDestroyed(stack, world, bID, x, y, z, player);
if (!world.isRemote)

View File

@ -129,7 +129,7 @@ public class LumberAxe extends HarvestTool
if (!(tags.getBoolean("Broken")))
if (world.getBlockId(xPos, yPos, zPos) == bID && world.getBlockMetadata(xPos, yPos, zPos) % 4 == meta % 4)
{
world.func_94571_i(x, y, z);
world.setBlockToAir(x, y, z);
Block.blocksList[bID].harvestBlock(world, player, xPos, yPos, zPos, meta);
if (!player.capabilities.isCreativeMode)
onBlockDestroyed(stack, world, bID, xPos, yPos, zPos, player);
@ -155,7 +155,7 @@ public class LumberAxe extends HarvestTool
if (block != null && block.blockMaterial == Material.wood)
{
int meta = world.getBlockMetadata(xPos, yPos, zPos);
world.func_94571_i(x, y, z);
world.setBlockToAir(x, y, z);
Block.blocksList[blockID].harvestBlock(world, player, xPos, yPos, zPos, meta);
if (!player.capabilities.isCreativeMode)
onBlockDestroyed(stack, world, blockID, xPos, yPos, zPos, player);

View File

@ -146,7 +146,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
}
@Override
public void func_94581_a (IconRegister iconRegister)
public void updateIcons (IconRegister iconRegister)
{
headIcons.clear();
brokenHeadIcons.clear();
@ -157,21 +157,21 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
while (iter.hasNext())
{
Map.Entry pairs = (Map.Entry) iter.next();
headIcons.put((Integer) pairs.getKey(), iconRegister.func_94245_a((String) pairs.getValue()));
headIcons.put((Integer) pairs.getKey(), iconRegister.registerIcon((String) pairs.getValue()));
}
iter = brokenHeadStrings.entrySet().iterator();
while (iter.hasNext())
{
Map.Entry pairs = (Map.Entry) iter.next();
brokenHeadIcons.put((Integer) pairs.getKey(), iconRegister.func_94245_a((String) pairs.getValue()));
brokenHeadIcons.put((Integer) pairs.getKey(), iconRegister.registerIcon((String) pairs.getValue()));
}
iter = handleStrings.entrySet().iterator();
while (iter.hasNext())
{
Map.Entry pairs = (Map.Entry) iter.next();
handleIcons.put((Integer) pairs.getKey(), iconRegister.func_94245_a((String) pairs.getValue()));
handleIcons.put((Integer) pairs.getKey(), iconRegister.registerIcon((String) pairs.getValue()));
}
if (getPartAmount() > 2)
@ -180,7 +180,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
while (iter.hasNext())
{
Map.Entry pairs = (Map.Entry) iter.next();
accessoryIcons.put((Integer) pairs.getKey(), iconRegister.func_94245_a((String) pairs.getValue()));
accessoryIcons.put((Integer) pairs.getKey(), iconRegister.registerIcon((String) pairs.getValue()));
}
}
@ -188,15 +188,8 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
while (iter.hasNext())
{
Map.Entry pairs = (Map.Entry) iter.next();
effectIcons.put((Integer) pairs.getKey(), iconRegister.func_94245_a((String) pairs.getValue()));
effectIcons.put((Integer) pairs.getKey(), iconRegister.registerIcon((String) pairs.getValue()));
}
/*System.out.println(this.getClass().getSimpleName() + " Test");
System.out.println("Head size: " + headStrings.size() + " " + headIcons.size());
System.out.println("Broken head size: " + brokenHeadStrings.size() + " " + brokenHeadIcons.size());
System.out.println("Handle size: " + handleStrings.size() + " " + handleIcons.size());
System.out.println("Accessory size: " + accessoryStrings.size() + " " + accessoryIcons.size());
System.out.println("Effect size: " + effectStrings.size() + " " + effectIcons.size());*/
}
@Override
@ -525,8 +518,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(new ItemStack(block.idDropped(bID, random, 0), 1, block.damageDropped(meta)));
if (result != null)
{
//System.out.println("Woo~");
world.func_94571_i(x, y, z);
world.setBlockToAir(x, y, z);
if (!player.capabilities.isCreativeMode)
onBlockDestroyed(stack, world, bID, x, y, z, player);
if (!world.isRemote)

View File

@ -72,7 +72,7 @@ public class NetherOreGenerator extends WorldGenerator
int genID = par1World.getBlockId(var38, var41, var44);
if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && genID == Block.netherrack.blockID)
{
par1World.setBlockAndMetadataWithNotify(var38, var41, var44, this.minableBlockId, minableBlockMeta, 2);
par1World.setBlock(var38, var41, var44, this.minableBlockId, minableBlockMeta, 2);
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

@ -0,0 +1,16 @@
0*3
1*3
2*3
3*3
4*3
5*3
6*3
7*3
8*3
9*3
10*3
11*3
12*3
13*3
14*3
15*3

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

@ -0,0 +1,16 @@
0*3
1*3
2*3
3*3
4*3
5*3
6*3
7*3
8*3
9*3
10*3
11*3
12*3
13*3
14*3
15*3

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@ -0,0 +1,16 @@
0*3
1*3
2*3
3*3
4*3
5*3
6*3
7*3
8*3
9*3
10*3
11*3
12*3
13*3
14*3
15*3

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -0,0 +1,16 @@
0*3
1*3
2*3
3*3
4*3
5*3
6*3
7*3
8*3
9*3
10*3
11*3
12*3
13*3
14*3
15*3

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,16 @@
0*3
1*3
2*3
3*3
4*3
5*3
6*3
7*3
8*3
9*3
10*3
11*3
12*3
13*3
14*3
15*3

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -0,0 +1,16 @@
0*3
1*3
2*3
3*3
4*3
5*3
6*3
7*3
8*3
9*3
10*3
11*3
12*3
13*3
14*3
15*3

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

@ -0,0 +1,16 @@
0*3
1*3
2*3
3*3
4*3
5*3
6*3
7*3
8*3
9*3
10*3
11*3
12*3
13*3
14*3
15*3

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -0,0 +1,16 @@
0*3
1*3
2*3
3*3
4*3
5*3
6*3
7*3
8*3
9*3
10*3
11*3
12*3
13*3
14*3
15*3

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

View File

@ -0,0 +1,16 @@
0*3
1*3
2*3
3*3
4*3
5*3
6*3
7*3
8*3
9*3
10*3
11*3
12*3
13*3
14*3
15*3

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -0,0 +1,16 @@
0*3
1*3
2*3
3*3
4*3
5*3
6*3
7*3
8*3
9*3
10*3
11*3
12*3
13*3
14*3
15*3

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

View File

@ -0,0 +1,38 @@
0*2
1*2
2*2
3*2
4*2
5*2
6*2
7*2
8*2
9*2
10*2
11*2
12*2
13*2
14*2
15*2
16*2
17*2
18*2
19*2
18*2
17*2
16*2
15*2
14*2
13*2
12*2
11*2
10*2
9*2
8*2
7*2
6*2
5*2
4*2
3*2
2*2
1*2

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

@ -0,0 +1,16 @@
0*3
1*3
2*3
3*3
4*3
5*3
6*3
7*3
8*3
9*3
10*3
11*3
12*3
13*3
14*3
15*3

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Some files were not shown because too many files have changed in this diff Show More