Oreberries and sound fixes
This commit is contained in:
parent
128457d55c
commit
d5c3d9e3ef
@ -37,7 +37,7 @@ import cpw.mods.fml.common.registry.VillagerRegistry;
|
||||
* @dependencies: IC2 API
|
||||
*/
|
||||
|
||||
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.dev.37", dependencies = "required-after:Forge@[7.7.1.675,)")
|
||||
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.dev.42", dependencies = "required-after:Forge@[7.7.1.675,)")
|
||||
@NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.util.network.TPacketHandler.class)
|
||||
public class TConstruct
|
||||
{
|
||||
|
@ -164,7 +164,7 @@ public class PartCrafterLogic extends InventoryLogic
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide (int side)
|
||||
{
|
||||
return null;
|
||||
return new int[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -106,7 +106,7 @@ public class PatternShaperLogic extends InventoryLogic
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide (int side)
|
||||
{
|
||||
return null;
|
||||
return new int[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -90,7 +90,7 @@ public class ToolStationLogic extends InventoryLogic
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide (int side)
|
||||
{
|
||||
return null;
|
||||
return new int[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
627
mods/tinker/tconstruct/client/RenderItemCopy.java
Normal file
627
mods/tinker/tconstruct/client/RenderItemCopy.java
Normal file
@ -0,0 +1,627 @@
|
||||
package mods.tinker.tconstruct.client;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import mods.tinker.tconstruct.client.block.SmallFontRenderer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.RenderEngine;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderItemCopy 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 renderWithColor = true;
|
||||
|
||||
/** Defines the zLevel of rendering of item on GUI. */
|
||||
public float zLevel = 0.0F;
|
||||
public static boolean renderInFrame = false;
|
||||
|
||||
public RenderItemCopy()
|
||||
{
|
||||
this.shadowSize = 0.15F;
|
||||
this.shadowOpaque = 0.75F;
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the item
|
||||
*/
|
||||
public void doRenderItem(EntityItem par1EntityItem, double par2, double par4, double par6, float par8, float par9)
|
||||
{
|
||||
this.random.setSeed(187L);
|
||||
ItemStack itemstack = par1EntityItem.getEntityItem();
|
||||
|
||||
if (itemstack.getItem() != null)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
float f2 = shouldBob() ? MathHelper.sin(((float)par1EntityItem.age + par9) / 10.0F + par1EntityItem.hoverStart) * 0.1F + 0.1F : 0F;
|
||||
float f3 = (((float)par1EntityItem.age + par9) / 20.0F + par1EntityItem.hoverStart) * (180F / (float)Math.PI);
|
||||
byte b0 = getMiniBlockCount(itemstack);
|
||||
|
||||
GL11.glTranslatef((float)par2, (float)par4 + f2, (float)par6);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
int i;
|
||||
float f4;
|
||||
float f5;
|
||||
float f6;
|
||||
|
||||
Block block = null;
|
||||
if (itemstack.itemID < Block.blocksList.length)
|
||||
{
|
||||
block = Block.blocksList[itemstack.itemID];
|
||||
}
|
||||
|
||||
if (ForgeHooksClient.renderEntityItem(par1EntityItem, itemstack, f2, f3, random, renderManager.renderEngine, renderBlocks))
|
||||
{
|
||||
;
|
||||
}
|
||||
else if (itemstack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
||||
{
|
||||
GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
this.loadTexture("/terrain.png");
|
||||
float f7 = 0.25F;
|
||||
int j = block.getRenderType();
|
||||
|
||||
if (j == 1 || j == 19 || j == 12 || j == 2)
|
||||
{
|
||||
f7 = 0.5F;
|
||||
}
|
||||
|
||||
GL11.glScalef(f7, f7, f7);
|
||||
|
||||
for (i = 0; i < b0; ++i)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
f5 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7;
|
||||
f4 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7;
|
||||
f6 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7;
|
||||
GL11.glTranslatef(f5, f4, f6);
|
||||
}
|
||||
|
||||
f5 = 1.0F;
|
||||
this.itemRenderBlocks.renderBlockAsItem(block, itemstack.getItemDamage(), f5);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
float f8;
|
||||
|
||||
if (itemstack.getItem().requiresMultipleRenderPasses())
|
||||
{
|
||||
if (renderInFrame)
|
||||
{
|
||||
GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F);
|
||||
GL11.glTranslatef(0.0F, -0.05F, 0.0F);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
this.loadTexture("/gui/items.png");
|
||||
|
||||
for (int k = 0; k < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); ++k)
|
||||
{
|
||||
this.random.setSeed(187L);
|
||||
Icon icon = itemstack.getItem().getIcon(itemstack, k);
|
||||
f8 = 1.0F;
|
||||
|
||||
if (this.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (renderInFrame)
|
||||
{
|
||||
GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F);
|
||||
GL11.glTranslatef(0.0F, -0.05F, 0.0F);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
Icon icon1 = itemstack.getIconIndex();
|
||||
|
||||
if (itemstack.getItemSpriteNumber() == 0)
|
||||
{
|
||||
this.loadTexture("/terrain.png");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.loadTexture("/gui/items.png");
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders a dropped item
|
||||
*/
|
||||
private void renderDroppedItem(EntityItem par1EntityItem, Icon par2Icon, int par3, float par4, float par5, float par6, float par7)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
if (par2Icon == null)
|
||||
{
|
||||
par2Icon = this.renderManager.renderEngine.getMissingIcon(par1EntityItem.getEntityItem().getItemSpriteNumber());
|
||||
}
|
||||
|
||||
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;
|
||||
float f11;
|
||||
|
||||
if (this.renderManager.options.fancyGraphics)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
float f12 = 0.0625F;
|
||||
f11 = 0.021875F;
|
||||
ItemStack itemstack = par1EntityItem.getEntityItem();
|
||||
int j = itemstack.stackSize;
|
||||
byte b0 = getMiniItemCount(itemstack);
|
||||
|
||||
GL11.glTranslatef(-f9, -f10, -((f12 + f11) * (float)b0 / 2.0F));
|
||||
|
||||
for (int k = 0; k < b0; ++k)
|
||||
{
|
||||
// Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug...
|
||||
if (k > 0 && shouldSpreadItems())
|
||||
{
|
||||
float x = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
|
||||
float y = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
|
||||
float z = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
|
||||
GL11.glTranslatef(x, y, f12 + f11);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glTranslatef(0f, 0f, f12 + f11);
|
||||
}
|
||||
|
||||
if (itemstack.getItemSpriteNumber() == 0)
|
||||
{
|
||||
this.loadTexture("/terrain.png");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.loadTexture("/gui/items.png");
|
||||
}
|
||||
|
||||
GL11.glColor4f(par5, par6, par7, 1.0F);
|
||||
ItemRenderer.renderItemIn2D(tessellator, f5, f6, f4, f7, par2Icon.getSheetWidth(), par2Icon.getSheetHeight(), f12);
|
||||
|
||||
if (itemstack != null && itemstack.hasEffect())
|
||||
{
|
||||
GL11.glDepthFunc(GL11.GL_EQUAL);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
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;
|
||||
GL11.glColor4f(0.5F * f13, 0.25F * f13, 0.8F * f13, 1.0F);
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glPushMatrix();
|
||||
float f14 = 0.125F;
|
||||
GL11.glScalef(f14, f14, f14);
|
||||
float f15 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F;
|
||||
GL11.glTranslatef(f15, 0.0F, 0.0F);
|
||||
GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
|
||||
ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(f14, f14, f14);
|
||||
f15 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F;
|
||||
GL11.glTranslatef(-f15, 0.0F, 0.0F);
|
||||
GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
|
||||
ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthFunc(GL11.GL_LEQUAL);
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int l = 0; l < par3; ++l)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
|
||||
if (l > 0)
|
||||
{
|
||||
f11 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F;
|
||||
float f16 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F;
|
||||
float f17 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F;
|
||||
GL11.glTranslatef(f11, f16, f17);
|
||||
}
|
||||
|
||||
if (!renderInFrame)
|
||||
{
|
||||
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
|
||||
GL11.glColor4f(par5, par6, par7, 1.0F);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
tessellator.addVertexWithUV((double)(0.0F - f9), (double)(0.0F - f10), 0.0D, (double)f4, (double)f7);
|
||||
tessellator.addVertexWithUV((double)(f8 - f9), (double)(0.0F - f10), 0.0D, (double)f5, (double)f7);
|
||||
tessellator.addVertexWithUV((double)(f8 - f9), (double)(1.0F - f10), 0.0D, (double)f5, (double)f6);
|
||||
tessellator.addVertexWithUV((double)(0.0F - f9), (double)(1.0F - f10), 0.0D, (double)f4, (double)f6);
|
||||
tessellator.draw();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the item's icon or block into the UI at the specified position.
|
||||
*/
|
||||
public void renderItemIntoGUI(SmallFontRenderer par1SmallFontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5)
|
||||
{
|
||||
int k = par3ItemStack.itemID;
|
||||
int l = par3ItemStack.getItemDamage();
|
||||
Icon icon = par3ItemStack.getIconIndex();
|
||||
float f;
|
||||
float f1;
|
||||
float f2;
|
||||
|
||||
Block block = (k < Block.blocksList.length ? Block.blocksList[k] : null);
|
||||
if (par3ItemStack.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.glScalef(10.0F, 10.0F, 10.0F);
|
||||
GL11.glTranslatef(1.0F, 0.5F, 1.0F);
|
||||
GL11.glScalef(1.0F, 1.0F, -1.0F);
|
||||
GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
|
||||
int i1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0);
|
||||
f2 = (float)(i1 >> 16 & 255) / 255.0F;
|
||||
f = (float)(i1 >> 8 & 255) / 255.0F;
|
||||
f1 = (float)(i1 & 255) / 255.0F;
|
||||
|
||||
if (this.renderWithColor)
|
||||
{
|
||||
GL11.glColor4f(f2, f, f1, 1.0F);
|
||||
}
|
||||
|
||||
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||
this.itemRenderBlocks.useInventoryTint = this.renderWithColor;
|
||||
this.itemRenderBlocks.renderBlockAsItem(block, l, 1.0F);
|
||||
this.itemRenderBlocks.useInventoryTint = true;
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
else
|
||||
{
|
||||
int j1;
|
||||
|
||||
if (Item.itemsList[k].requiresMultipleRenderPasses())
|
||||
{
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
par2RenderEngine.bindTexture(par3ItemStack.getItemSpriteNumber() == 0 ? "/terrain.png" : "/gui/items.png");
|
||||
|
||||
for (j1 = 0; j1 < Item.itemsList[k].getRenderPasses(l); ++j1)
|
||||
{
|
||||
Icon icon1 = Item.itemsList[k].getIcon(par3ItemStack, j1);
|
||||
int k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, j1);
|
||||
f = (float)(k1 >> 16 & 255) / 255.0F;
|
||||
f1 = (float)(k1 >> 8 & 255) / 255.0F;
|
||||
float f3 = (float)(k1 & 255) / 255.0F;
|
||||
|
||||
if (this.renderWithColor)
|
||||
{
|
||||
GL11.glColor4f(f, f1, f3, 1.0F);
|
||||
}
|
||||
|
||||
this.renderIcon(par4, par5, icon1, 16, 16);
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
if (par3ItemStack.getItemSpriteNumber() == 0)
|
||||
{
|
||||
par2RenderEngine.bindTexture("/terrain.png");
|
||||
}
|
||||
else
|
||||
{
|
||||
par2RenderEngine.bindTexture("/gui/items.png");
|
||||
}
|
||||
|
||||
if (icon == null)
|
||||
{
|
||||
icon = par2RenderEngine.getMissingIcon(par3ItemStack.getItemSpriteNumber());
|
||||
}
|
||||
|
||||
j1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0);
|
||||
float f4 = (float)(j1 >> 16 & 255) / 255.0F;
|
||||
f2 = (float)(j1 >> 8 & 255) / 255.0F;
|
||||
f = (float)(j1 & 255) / 255.0F;
|
||||
|
||||
if (this.renderWithColor)
|
||||
{
|
||||
GL11.glColor4f(f4, f2, f, 1.0F);
|
||||
}
|
||||
|
||||
this.renderIcon(par4, par5, icon, 16, 16);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the item's icon or block into the GUI, including the glint effect.
|
||||
*/
|
||||
public void renderItemAndEffectIntoGUI(SmallFontRenderer par1SmallFontRenderer, 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(par1SmallFontRenderer, par2RenderEngine, par3ItemStack, par4, par5);
|
||||
}
|
||||
|
||||
if (par3ItemStack.hasEffect())
|
||||
{
|
||||
GL11.glDepthFunc(GL11.GL_GREATER);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthMask(false);
|
||||
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.renderGlint(par4 * 431278612 + par5 * 32178161, par4 - 2, par5 - 2, 20, 20);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDepthMask(true);
|
||||
this.zLevel += 50.0F;
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthFunc(GL11.GL_LEQUAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void 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)
|
||||
{
|
||||
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
|
||||
}
|
||||
|
||||
float f = 0.00390625F;
|
||||
float f1 = 0.00390625F;
|
||||
float f2 = (float)(Minecraft.getSystemTime() % (long)(3000 + j1 * 1873)) / (3000.0F + (float)(j1 * 1873)) * 256.0F;
|
||||
float f3 = 0.0F;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
float f4 = 4.0F;
|
||||
|
||||
if (j1 == 1)
|
||||
{
|
||||
f4 = -1.0F;
|
||||
}
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV((double)(par2 + 0), (double)(par3 + par5), (double)this.zLevel, (double)((f2 + (float)par5 * f4) * f), (double)((f3 + (float)par5) * f1));
|
||||
tessellator.addVertexWithUV((double)(par2 + par4), (double)(par3 + par5), (double)this.zLevel, (double)((f2 + (float)par4 + (float)par5 * f4) * f), (double)((f3 + (float)par5) * f1));
|
||||
tessellator.addVertexWithUV((double)(par2 + par4), (double)(par3 + 0), (double)this.zLevel, (double)((f2 + (float)par4) * f), (double)((f3 + 0.0F) * f1));
|
||||
tessellator.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)this.zLevel, (double)((f2 + 0.0F) * f), (double)((f3 + 0.0F) * f1));
|
||||
tessellator.draw();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the
|
||||
* specified position.
|
||||
*/
|
||||
public void renderItemOverlayIntoGUI(SmallFontRenderer par1SmallFontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5)
|
||||
{
|
||||
this.renderItemOverlayIntoGUI(par1SmallFontRenderer, par2RenderEngine, par3ItemStack, par4, par5, (String)null);
|
||||
}
|
||||
|
||||
public void renderItemOverlayIntoGUI(SmallFontRenderer par1SmallFontRenderer, 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);
|
||||
par1SmallFontRenderer.drawStringWithShadow(s1, par4 + 19 - 2 - par1SmallFontRenderer.getStringWidth(s1), par5 + 6 + 3, 16777215);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
}
|
||||
|
||||
if (par3ItemStack.isItemDamaged())
|
||||
{
|
||||
int k = (int)Math.round(13.0D - (double)par3ItemStack.getItemDamageForDisplay() * 13.0D / (double)par3ItemStack.getMaxDamage());
|
||||
int l = (int)Math.round(255.0D - (double)par3ItemStack.getItemDamageForDisplay() * 255.0D / (double)par3ItemStack.getMaxDamage());
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
int i1 = 255 - l << 16 | l << 8;
|
||||
int j1 = (255 - l) / 4 << 16 | 16128;
|
||||
this.renderQuad(tessellator, par4 + 2, par5 + 13, 13, 2, 0);
|
||||
this.renderQuad(tessellator, par4 + 2, par5 + 13, 12, 1, j1);
|
||||
this.renderQuad(tessellator, par4 + 2, par5 + 13, k, 1, i1);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a quad to the tesselator at the specified position with the set width and height and color. Args:
|
||||
* tessellator, x, y, width, height, color
|
||||
*/
|
||||
private void renderQuad(Tessellator par1Tessellator, int par2, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
par1Tessellator.startDrawingQuads();
|
||||
par1Tessellator.setColorOpaque_I(par6);
|
||||
par1Tessellator.addVertex((double)(par2 + 0), (double)(par3 + 0), 0.0D);
|
||||
par1Tessellator.addVertex((double)(par2 + 0), (double)(par3 + par5), 0.0D);
|
||||
par1Tessellator.addVertex((double)(par2 + par4), (double)(par3 + par5), 0.0D);
|
||||
par1Tessellator.addVertex((double)(par2 + par4), (double)(par3 + 0), 0.0D);
|
||||
par1Tessellator.draw();
|
||||
}
|
||||
|
||||
public void 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.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.
|
||||
*/
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
|
||||
{
|
||||
this.doRenderItem((EntityItem)par1Entity, par2, par4, par6, par8, par9);
|
||||
}
|
||||
|
||||
/**
|
||||
* Items should spread out when rendered in 3d?
|
||||
* @return
|
||||
*/
|
||||
public boolean shouldSpreadItems()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Items should have a bob effect
|
||||
* @return
|
||||
*/
|
||||
public boolean shouldBob()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public byte getMiniBlockCount(ItemStack stack)
|
||||
{
|
||||
byte ret = 1;
|
||||
if (stack.stackSize > 1 ) ret = 2;
|
||||
if (stack.stackSize > 5 ) ret = 3;
|
||||
if (stack.stackSize > 20) ret = 4;
|
||||
if (stack.stackSize > 40) ret = 5;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows for a subclass to override how many rendered items appear in a
|
||||
* "mini item 3d stack"
|
||||
* @param stack
|
||||
* @return
|
||||
*/
|
||||
public byte getMiniItemCount(ItemStack stack)
|
||||
{
|
||||
byte ret = 1;
|
||||
if (stack.stackSize > 1) ret = 2;
|
||||
if (stack.stackSize > 15) ret = 3;
|
||||
if (stack.stackSize > 31) ret = 4;
|
||||
return ret;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,8 @@
|
||||
package mods.tinker.tconstruct.client.gui;
|
||||
|
||||
import mods.tinker.tconstruct.client.RenderItemCopy;
|
||||
import mods.tinker.tconstruct.client.TProxyClient;
|
||||
import mods.tinker.tconstruct.client.block.SmallFontRenderer;
|
||||
import mods.tinker.tconstruct.library.TConstructRegistry;
|
||||
import mods.tinker.tconstruct.library.client.TConstructClientRegistry;
|
||||
import mods.tinker.tconstruct.library.crafting.PatternBuilder;
|
||||
@ -10,7 +12,6 @@ import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiParticle;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@ -28,7 +29,7 @@ public class GuiManual extends GuiScreen
|
||||
{
|
||||
ItemStack itemstackBook;
|
||||
Document manual;
|
||||
private RenderItem renderitem = new RenderItem();
|
||||
private RenderItemCopy renderitem = new RenderItemCopy();
|
||||
int bookImageWidth = 206;
|
||||
int bookImageHeight = 200;
|
||||
int bookTotalPages = 1;
|
||||
@ -48,6 +49,8 @@ public class GuiManual extends GuiScreen
|
||||
ItemStack[] iconsRight;
|
||||
String[] multiTextRight;
|
||||
ToolMaterial materialRight;
|
||||
|
||||
SmallFontRenderer fonts = TProxyClient.smallFontRenderer;
|
||||
|
||||
public GuiManual(ItemStack stack, Document doc)
|
||||
{
|
||||
@ -63,7 +66,6 @@ public class GuiManual extends GuiScreen
|
||||
{
|
||||
this.guiParticles = new GuiParticle(minecraft);
|
||||
this.mc = minecraft;
|
||||
this.fontRenderer = TProxyClient.smallFontRenderer;
|
||||
this.width = w;
|
||||
this.height = h;
|
||||
this.buttonList.clear();
|
||||
@ -616,34 +618,34 @@ public class GuiManual extends GuiScreen
|
||||
/* Page types */
|
||||
public void drawTextPage (String text, int localWidth, int localHeight)
|
||||
{
|
||||
this.fontRenderer.drawSplitString(text, localWidth, localHeight, 178, 0);
|
||||
this.fonts.drawSplitString(text, localWidth, localHeight, 178, 0);
|
||||
}
|
||||
|
||||
public void drawTitlePage (String text, int localWidth, int localHeight)
|
||||
{
|
||||
this.fontRenderer.drawSplitString(text, localWidth, localHeight, 178, 0);
|
||||
this.fonts.drawSplitString(text, localWidth, localHeight, 178, 0);
|
||||
}
|
||||
|
||||
public void drawSectionPage (String title, String body, int localWidth, int localHeight)
|
||||
{
|
||||
this.fontRenderer.drawSplitString("\u00a7n" + title, localWidth + 70, localHeight + 4, 178, 0);
|
||||
this.fontRenderer.drawSplitString(body, localWidth, localHeight + 16, 190, 0);
|
||||
this.fonts.drawSplitString("\u00a7n" + title, localWidth + 70, localHeight + 4, 178, 0);
|
||||
this.fonts.drawSplitString(body, localWidth, localHeight + 16, 190, 0);
|
||||
}
|
||||
|
||||
public void drawContentTablePage (String info, ItemStack[] icons, String[] multiText, int localWidth, int localHeight)
|
||||
{
|
||||
if (info != null)
|
||||
this.fontRenderer.drawString("\u00a7n" + info, localWidth + 25 + fontRenderer.getStringWidth(info) / 2, localHeight + 4, 0);
|
||||
this.fonts.drawString("\u00a7n" + info, localWidth + 25 + fonts.getStringWidth(info) / 2, localHeight + 4, 0);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
renderitem.zLevel = 100;
|
||||
for (int i = 0; i < icons.length; i++)
|
||||
{
|
||||
renderitem.renderItemIntoGUI(fontRenderer, mc.renderEngine, icons[i], localWidth + 16, localHeight + 18 * i + 18);
|
||||
renderitem.renderItemIntoGUI(fonts, mc.renderEngine, icons[i], localWidth + 16, localHeight + 18 * i + 18);
|
||||
int yOffset = 18;
|
||||
if (multiText[i].length() > 40)
|
||||
yOffset = 13;
|
||||
this.fontRenderer.drawString(multiText[i], localWidth + 38, localHeight + 18 * i + yOffset, 0);
|
||||
this.fonts.drawString(multiText[i], localWidth + 38, localHeight + 18 * i + yOffset, 0);
|
||||
}
|
||||
renderitem.zLevel = 0;
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
@ -652,17 +654,17 @@ public class GuiManual extends GuiScreen
|
||||
|
||||
public void drawSidebarPage (String info, ItemStack[] icons, String[] multiText, int localWidth, int localHeight)
|
||||
{
|
||||
this.fontRenderer.drawSplitString(info, localWidth, localHeight, 178, 0);
|
||||
this.fonts.drawSplitString(info, localWidth, localHeight, 178, 0);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
renderitem.zLevel = 100;
|
||||
for (int i = 0; i < icons.length; i++)
|
||||
{
|
||||
renderitem.renderItemIntoGUI(fontRenderer, mc.renderEngine, icons[i], localWidth + 8, localHeight + 18 * i + 36);
|
||||
renderitem.renderItemIntoGUI(fonts, mc.renderEngine, icons[i], localWidth + 8, localHeight + 18 * i + 36);
|
||||
int yOffset = 39;
|
||||
if (multiText[i].length() > 40)
|
||||
yOffset = 34;
|
||||
this.fontRenderer.drawSplitString(multiText[i], localWidth + 30, localHeight + 18 * i + yOffset, 140, 0);
|
||||
this.fonts.drawSplitString(multiText[i], localWidth + 30, localHeight + 18 * i + yOffset, 140, 0);
|
||||
}
|
||||
renderitem.zLevel = 0;
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
@ -677,7 +679,7 @@ public class GuiManual extends GuiScreen
|
||||
|
||||
public void drawPicturePage (String info, int localWidth, int localHeight)
|
||||
{
|
||||
this.fontRenderer.drawSplitString(info, localWidth + 8, localHeight, 178, 0);
|
||||
this.fonts.drawSplitString(info, localWidth + 8, localHeight, 178, 0);
|
||||
}
|
||||
|
||||
public void drawCrafting (int size, int localWidth, int localHeight)
|
||||
@ -692,7 +694,7 @@ public class GuiManual extends GuiScreen
|
||||
public void drawCraftingPage (String info, ItemStack[] icons, int recipeSize, int localWidth, int localHeight)
|
||||
{
|
||||
if (info != null)
|
||||
this.fontRenderer.drawString("\u00a7n" + info, localWidth + 50, localHeight + 4, 0);
|
||||
this.fonts.drawString("\u00a7n" + info, localWidth + 50, localHeight + 4, 0);
|
||||
|
||||
GL11.glScalef(2f, 2f, 2f);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
@ -701,25 +703,25 @@ public class GuiManual extends GuiScreen
|
||||
|
||||
if (recipeSize == 2)
|
||||
{
|
||||
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[0], (localWidth + 126) / 2, (localHeight + 68) / 2);
|
||||
renderitem.renderItemAndEffectIntoGUI(fonts, mc.renderEngine, icons[0], (localWidth + 126) / 2, (localHeight + 68) / 2);
|
||||
if (icons[0].stackSize > 1)
|
||||
renderitem.renderItemOverlayIntoGUI(fontRenderer, mc.renderEngine, icons[0], (localWidth + 126) / 2, (localHeight + 68) / 2, String.valueOf(icons[0].stackSize));
|
||||
renderitem.renderItemOverlayIntoGUI(fonts, mc.renderEngine, icons[0], (localWidth + 126) / 2, (localHeight + 68) / 2, String.valueOf(icons[0].stackSize));
|
||||
for (int i = 0; i < icons.length - 1; i++)
|
||||
{
|
||||
if (icons[i + 1] != null)
|
||||
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[i + 1], (localWidth + 14 + 36 * (i % 2)) / 2, (localHeight + 36 * (i / 2) + 52) / 2);
|
||||
renderitem.renderItemAndEffectIntoGUI(fonts, mc.renderEngine, icons[i + 1], (localWidth + 14 + 36 * (i % 2)) / 2, (localHeight + 36 * (i / 2) + 52) / 2);
|
||||
}
|
||||
}
|
||||
|
||||
if (recipeSize == 3)
|
||||
{
|
||||
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[0], (localWidth + 138) / 2, (localHeight + 70) / 2);
|
||||
renderitem.renderItemAndEffectIntoGUI(fonts, mc.renderEngine, icons[0], (localWidth + 138) / 2, (localHeight + 70) / 2);
|
||||
if (icons[0].stackSize > 1)
|
||||
renderitem.renderItemOverlayIntoGUI(fontRenderer, mc.renderEngine, icons[0], (localWidth + 126) / 2, (localHeight + 68) / 2, String.valueOf(icons[0].stackSize));
|
||||
renderitem.renderItemOverlayIntoGUI(fonts, mc.renderEngine, icons[0], (localWidth + 126) / 2, (localHeight + 68) / 2, String.valueOf(icons[0].stackSize));
|
||||
for (int i = 0; i < icons.length - 1; i++)
|
||||
{
|
||||
if (icons[i + 1] != null)
|
||||
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[i + 1], (localWidth - 2 + 36 * (i % 3)) / 2, (localHeight + 36 * (i / 3) + 34) / 2);
|
||||
renderitem.renderItemAndEffectIntoGUI(fonts, mc.renderEngine, icons[i + 1], (localWidth - 2 + 36 * (i % 3)) / 2, (localHeight + 36 * (i / 3) + 34) / 2);
|
||||
}
|
||||
}
|
||||
|
||||
@ -738,19 +740,19 @@ public class GuiManual extends GuiScreen
|
||||
public void drawSmeltingPage (String info, ItemStack[] icons, int localWidth, int localHeight)
|
||||
{
|
||||
if (info != null)
|
||||
this.fontRenderer.drawString("\u00a7n" + info, localWidth + 50, localHeight + 4, 0);
|
||||
this.fonts.drawString("\u00a7n" + info, localWidth + 50, localHeight + 4, 0);
|
||||
|
||||
GL11.glScalef(2f, 2f, 2f);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
renderitem.zLevel = 100;
|
||||
|
||||
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, TConstructClientRegistry.getManualIcon("coal"), (localWidth + 38) / 2, (localHeight + 110) / 2);
|
||||
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[0], (localWidth + 106) / 2, (localHeight + 74) / 2);
|
||||
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[1], (localWidth + 38) / 2, (localHeight + 38) / 2);
|
||||
renderitem.renderItemAndEffectIntoGUI(fonts, mc.renderEngine, TConstructClientRegistry.getManualIcon("coal"), (localWidth + 38) / 2, (localHeight + 110) / 2);
|
||||
renderitem.renderItemAndEffectIntoGUI(fonts, mc.renderEngine, icons[0], (localWidth + 106) / 2, (localHeight + 74) / 2);
|
||||
renderitem.renderItemAndEffectIntoGUI(fonts, mc.renderEngine, icons[1], (localWidth + 38) / 2, (localHeight + 38) / 2);
|
||||
|
||||
if (icons[0].stackSize > 1)
|
||||
renderitem.renderItemOverlayIntoGUI(fontRenderer, mc.renderEngine, icons[0], (localWidth + 106) / 2, (localHeight + 74) / 2, String.valueOf(icons[0].stackSize));
|
||||
renderitem.renderItemOverlayIntoGUI(fonts, mc.renderEngine, icons[0], (localWidth + 106) / 2, (localHeight + 74) / 2, String.valueOf(icons[0].stackSize));
|
||||
|
||||
renderitem.zLevel = 0;
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
@ -766,7 +768,7 @@ public class GuiManual extends GuiScreen
|
||||
|
||||
public void drawModifierPage (ItemStack[] icons, String type, int localWidth, int localHeight)
|
||||
{
|
||||
this.fontRenderer.drawString("\u00a7nTool Station", localWidth + 60, localHeight + 4, 0);
|
||||
this.fonts.drawString("\u00a7nTool Station", localWidth + 60, localHeight + 4, 0);
|
||||
GL11.glScalef(2f, 2f, 2f);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
@ -776,11 +778,11 @@ public class GuiManual extends GuiScreen
|
||||
toolstack = TConstructClientRegistry.getManualIcon("ironlongsword");
|
||||
|
||||
renderitem.zLevel = 100;
|
||||
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, toolstack, (localWidth + 54) / 2, (localHeight + 54) / 2);
|
||||
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[0], (localWidth + 130) / 2, (localHeight + 54) / 2);
|
||||
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[1], (localWidth + 18) / 2, (localHeight + 36) / 2);
|
||||
renderitem.renderItemAndEffectIntoGUI(fonts, mc.renderEngine, toolstack, (localWidth + 54) / 2, (localHeight + 54) / 2);
|
||||
renderitem.renderItemAndEffectIntoGUI(fonts, mc.renderEngine, icons[0], (localWidth + 130) / 2, (localHeight + 54) / 2);
|
||||
renderitem.renderItemAndEffectIntoGUI(fonts, mc.renderEngine, icons[1], (localWidth + 18) / 2, (localHeight + 36) / 2);
|
||||
if (icons[2] != null)
|
||||
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[2], (localWidth + 18) / 2, (localHeight + 74) / 2);
|
||||
renderitem.renderItemAndEffectIntoGUI(fonts, mc.renderEngine, icons[2], (localWidth + 18) / 2, (localHeight + 74) / 2);
|
||||
renderitem.zLevel = 0;
|
||||
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
@ -790,88 +792,88 @@ public class GuiManual extends GuiScreen
|
||||
|
||||
public void drawMaterialPage (String title, ItemStack[] icons, String[] multiText, ToolMaterial material, int localWidth, int localHeight)
|
||||
{
|
||||
this.fontRenderer.drawString("\u00a7n" + title, localWidth + 70, localHeight + 4, 0);
|
||||
this.fontRenderer.drawSplitString(multiText[0], localWidth, localHeight + 16, 178, 0);
|
||||
this.fonts.drawString("\u00a7n" + title, localWidth + 70, localHeight + 4, 0);
|
||||
this.fonts.drawSplitString(multiText[0], localWidth, localHeight + 16, 178, 0);
|
||||
|
||||
this.fontRenderer.drawString("Material: ", localWidth + 108, localHeight + 40, 0);
|
||||
this.fontRenderer.drawString("Shard: ", localWidth + 108, localHeight + 72, 0);
|
||||
this.fontRenderer.drawString("Rod: ", localWidth + 108, localHeight + 104, 0);
|
||||
this.fonts.drawString("Material: ", localWidth + 108, localHeight + 40, 0);
|
||||
this.fonts.drawString("Shard: ", localWidth + 108, localHeight + 72, 0);
|
||||
this.fonts.drawString("Rod: ", localWidth + 108, localHeight + 104, 0);
|
||||
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
renderitem.zLevel = 100;
|
||||
//renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[0], localWidth + 50, localHeight + 0);
|
||||
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[1], localWidth + 108, localHeight + 50);
|
||||
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[2], localWidth + 108, localHeight + 82);
|
||||
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[3], localWidth + 108, localHeight + 114);
|
||||
//renderitem.renderItemAndEffectIntoGUI(fonts, mc.renderEngine, icons[0], localWidth + 50, localHeight + 0);
|
||||
renderitem.renderItemAndEffectIntoGUI(fonts, mc.renderEngine, icons[1], localWidth + 108, localHeight + 50);
|
||||
renderitem.renderItemAndEffectIntoGUI(fonts, mc.renderEngine, icons[2], localWidth + 108, localHeight + 82);
|
||||
renderitem.renderItemAndEffectIntoGUI(fonts, mc.renderEngine, icons[3], localWidth + 108, localHeight + 114);
|
||||
renderitem.zLevel = 0;
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
|
||||
this.fontRenderer.drawSplitString(icons[1].getTooltip(this.mc.thePlayer, false).get((0)).toString(), localWidth + 128, localHeight + 53, 52, 0);
|
||||
this.fontRenderer.drawSplitString(icons[2].getTooltip(this.mc.thePlayer, false).get((0)).toString(), localWidth + 128, localHeight + 85, 52, 0);
|
||||
this.fontRenderer.drawSplitString(icons[3].getTooltip(this.mc.thePlayer, false).get((0)).toString(), localWidth + 128, localHeight + 117, 52, 0);
|
||||
this.fonts.drawSplitString(icons[1].getTooltip(this.mc.thePlayer, false).get((0)).toString(), localWidth + 128, localHeight + 53, 52, 0);
|
||||
this.fonts.drawSplitString(icons[2].getTooltip(this.mc.thePlayer, false).get((0)).toString(), localWidth + 128, localHeight + 85, 52, 0);
|
||||
this.fonts.drawSplitString(icons[3].getTooltip(this.mc.thePlayer, false).get((0)).toString(), localWidth + 128, localHeight + 117, 52, 0);
|
||||
|
||||
this.fontRenderer.drawString("Durability: " + material.durability(), localWidth, localHeight + 40, 0);
|
||||
this.fontRenderer.drawString("Handle Modifier: " + material.handleDurability() + "x", localWidth, localHeight + 50, 0);
|
||||
this.fontRenderer.drawString("Full Tool Durability: " + (int) (material.durability() * material.handleDurability()), localWidth, localHeight + 60, 0);
|
||||
this.fonts.drawString("Durability: " + material.durability(), localWidth, localHeight + 40, 0);
|
||||
this.fonts.drawString("Handle Modifier: " + material.handleDurability() + "x", localWidth, localHeight + 50, 0);
|
||||
this.fonts.drawString("Full Tool Durability: " + (int) (material.durability() * material.handleDurability()), localWidth, localHeight + 60, 0);
|
||||
|
||||
this.fontRenderer.drawString("Mining Speed: " + material.toolSpeed() / 100f, localWidth, localHeight + 80, 0);
|
||||
this.fontRenderer.drawString("Mining Level: " + material.harvestLevel() + " (" + PartCrafterGui.getHarvestLevelName(material.harvestLevel()) + ")", localWidth, localHeight + 90, 0);
|
||||
this.fonts.drawString("Mining Speed: " + material.toolSpeed() / 100f, localWidth, localHeight + 80, 0);
|
||||
this.fonts.drawString("Mining Level: " + material.harvestLevel() + " (" + PartCrafterGui.getHarvestLevelName(material.harvestLevel()) + ")", localWidth, localHeight + 90, 0);
|
||||
int attack = material.attack();
|
||||
String heart = attack == 2 ? " Heart" : " Hearts";
|
||||
if (attack % 2 == 0)
|
||||
this.fontRenderer.drawString("Base Attack: " + material.attack() / 2 + heart, localWidth, localHeight + 100, 0);
|
||||
this.fonts.drawString("Base Attack: " + material.attack() / 2 + heart, localWidth, localHeight + 100, 0);
|
||||
else
|
||||
this.fontRenderer.drawString("Base Attack: " + material.attack() / 2f + heart, localWidth, localHeight + 100, 0);
|
||||
this.fonts.drawString("Base Attack: " + material.attack() / 2f + heart, localWidth, localHeight + 100, 0);
|
||||
|
||||
int offset = 0;
|
||||
String ability = material.ability();
|
||||
if (!ability.equals(""))
|
||||
{
|
||||
this.fontRenderer.drawString("Material ability: " + material.ability(), localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
this.fonts.drawString("Material ability: " + material.ability(), localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
offset++;
|
||||
if (ability.equals("Writable"))
|
||||
this.fontRenderer.drawString("+1 Modifiers", localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
this.fonts.drawString("+1 Modifiers", localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
}
|
||||
|
||||
if (material.reinforced() > 0)
|
||||
{
|
||||
this.fontRenderer.drawString("Material ability: Reinforced", localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
this.fonts.drawString("Material ability: Reinforced", localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
offset++;
|
||||
this.fontRenderer.drawString("Reinforced level: " + material.reinforced(), localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
this.fonts.drawString("Reinforced level: " + material.reinforced(), localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
offset++;
|
||||
}
|
||||
|
||||
if (material.shoddy() > 0)
|
||||
{
|
||||
this.fontRenderer.drawString("Stonebound level: " + material.shoddy(), localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
this.fonts.drawString("Stonebound level: " + material.shoddy(), localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
offset++;
|
||||
}
|
||||
else if (material.shoddy() < 0)
|
||||
{
|
||||
this.fontRenderer.drawString("Splintering level: " + -material.shoddy(), localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
this.fonts.drawString("Splintering level: " + -material.shoddy(), localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
offset++;
|
||||
}
|
||||
}
|
||||
|
||||
public void drawToolPage (String title, ItemStack[] icons, String[] multiText, int localWidth, int localHeight)
|
||||
{
|
||||
this.fontRenderer.drawString("\u00a7n" + title, localWidth + 70, localHeight + 4, 0);
|
||||
this.fontRenderer.drawSplitString(multiText[0], localWidth, localHeight + 16, 178, 0);
|
||||
this.fonts.drawString("\u00a7n" + title, localWidth + 70, localHeight + 4, 0);
|
||||
this.fonts.drawSplitString(multiText[0], localWidth, localHeight + 16, 178, 0);
|
||||
int size = multiText[0].length() / 50;
|
||||
this.fontRenderer.drawSplitString(multiText[1], localWidth, localHeight + 28 + 10 * size, 118, 0);
|
||||
this.fonts.drawSplitString(multiText[1], localWidth, localHeight + 28 + 10 * size, 118, 0);
|
||||
|
||||
this.fontRenderer.drawString("Crafting Parts: ", localWidth + 124, localHeight + 28 + 10 * size, 0);
|
||||
this.fonts.drawString("Crafting Parts: ", localWidth + 124, localHeight + 28 + 10 * size, 0);
|
||||
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
renderitem.zLevel = 100;
|
||||
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[0], localWidth + 50, localHeight + 0);
|
||||
renderitem.renderItemAndEffectIntoGUI(fonts, mc.renderEngine, icons[0], localWidth + 50, localHeight + 0);
|
||||
for (int i = 1; i < icons.length; i++)
|
||||
{
|
||||
renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[i], localWidth + 120, localHeight + 20 + 10 * size + 18 * i);
|
||||
this.fontRenderer.drawSplitString(multiText[i + 1], localWidth + 140, localHeight + 24 + 10 * size + 18 * i, 42, 0);
|
||||
renderitem.renderItemAndEffectIntoGUI(fonts, mc.renderEngine, icons[i], localWidth + 120, localHeight + 20 + 10 * size + 18 * i);
|
||||
this.fonts.drawSplitString(multiText[i + 1], localWidth + 140, localHeight + 24 + 10 * size + 18 * i, 42, 0);
|
||||
}
|
||||
renderitem.zLevel = 0;
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
|
@ -97,7 +97,7 @@ public class FryingPan extends Weapon
|
||||
else
|
||||
{
|
||||
world.setBlock(x, y, z, TContent.heldItemBlock.blockID, 0, 3);
|
||||
world.playSoundEffect(x, y, z, "mods.tinker.resources.sounds.frypan_hit", 1.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 0.65F);
|
||||
world.playSoundEffect(x, y, z, "sounds.frypan_hit", 1.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 0.65F);
|
||||
|
||||
EquipLogic logic = (EquipLogic) world.getBlockTileEntity(x, y, z);
|
||||
logic.setEquipmentItem(stack);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -185,9 +185,9 @@ public class PHConstruct
|
||||
generateSilverBush = config.get("Worldgen Disabler", "Generate Silver Bushes", true).getBoolean(true);
|
||||
addToVillages = config.get("Worldgen Disabler", "Add Village Generation", true).getBoolean(true);
|
||||
|
||||
copperuDensity = config.get("Worldgen", "Copper Underground Density", ic2 ? 1 : 0).getInt(ic2 ? 1 : 0);
|
||||
tinuDensity = config.get("Worldgen", "Tin Underground Density", ic2 ? 1 : 0).getInt(ic2 ? 1 : 0);
|
||||
aluminumuDensity = config.get("Worldgen", "Aluminum Underground Density", xycraft ? 1 : 0).getInt(xycraft ? 1 : 0);
|
||||
copperuDensity = config.get("Worldgen", "Copper Underground Density", 2).getInt(2);
|
||||
tinuDensity = config.get("Worldgen", "Tin Underground Density", 2).getInt(2);
|
||||
aluminumuDensity = config.get("Worldgen", "Aluminum Underground Density", 3).getInt(3);
|
||||
netherDensity = config.get("Worldgen", "Nether Ores Density", 8).getInt(8);
|
||||
|
||||
copperuMinY = config.get("Worldgen", "Copper Underground Min Y", 20).getInt(20);
|
||||
@ -201,7 +201,7 @@ public class PHConstruct
|
||||
goldsRarity = config.get("Worldgen", "Gold Surface Rarity", 900).getInt(900);
|
||||
coppersRarity = config.get("Worldgen", "Copper Surface Rarity", 100).getInt(100);
|
||||
tinsRarity = config.get("Worldgen", "Tin Surface Rarity", 100).getInt(100);
|
||||
aluminumsRarity = config.get("Worldgen", "Aluminum Surface Rarity", 70).getInt(70);
|
||||
aluminumsRarity = config.get("Worldgen", "Aluminum Surface Rarity", 50).getInt(50);
|
||||
cobaltsRarity = config.get("Worldgen", "Cobalt Surface Rarity", 2000).getInt(2000);
|
||||
|
||||
ironBushDensity = config.get("Worldgen", "Iron Bush Density", 1).getInt(1);
|
||||
|
@ -85,7 +85,6 @@ public class TEventHandler
|
||||
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, dropStack);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
event.drops.add(entityitem);
|
||||
//event.entityLiving.dropItem(Item.feather.itemID, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ public class XinStick extends Item
|
||||
spawnEntity(player.posX, player.posY+1, player.posZ, creeper, world, player);
|
||||
spawnEntity(player.posX, player.posY+1, player.posZ, pig, world, player);
|
||||
creeper.mountEntity(pig);*/
|
||||
spawnEntity(player.posX, player.posY+1, player.posZ, new SlimeClone(world, "Etho"), world, player);
|
||||
spawnEntity(player.posX, player.posY+1, player.posZ, new SlimeClone(world, "Minalien"), world, player);
|
||||
//System.out.println("Health! "+player.getHealth());
|
||||
//healPlayer(player);
|
||||
//removeChunk(world, player.posX, player.posZ);
|
||||
|
Loading…
x
Reference in New Issue
Block a user