mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-25 06:24:37 +00:00
1.6.2 test - Finished liquids, added connected textures on glass
This commit is contained in:
1 parent
40c6f445a2
commit
a80fcbce86
704 files changed
+60909
No files matched your search
@@ -0,0 +1,100 @@
|
||||
package tconstruct.client.entity.projectile;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemPotion;
|
||||
import net.minecraft.potion.PotionHelper;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import tconstruct.entity.projectile.LaunchedPotion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class LaunchedItemRender extends Render
|
||||
{
|
||||
private Item field_94151_a;
|
||||
private int field_94150_f;
|
||||
|
||||
public LaunchedItemRender(Item par1Item, int par2)
|
||||
{
|
||||
this.field_94151_a = par1Item;
|
||||
this.field_94150_f = par2;
|
||||
}
|
||||
|
||||
public LaunchedItemRender(Item par1Item)
|
||||
{
|
||||
this(par1Item, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
Icon icon = this.field_94151_a.getIconFromDamage(this.field_94150_f);
|
||||
|
||||
if (icon != null)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)par2, (float)par4, (float)par6);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
this.func_110777_b(par1Entity);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
if (icon == ItemPotion.func_94589_d("bottle_splash"))
|
||||
{
|
||||
int i = PotionHelper.func_77915_a(((LaunchedPotion)par1Entity).getPotionDamage(), false);
|
||||
float f2 = (float)(i >> 16 & 255) / 255.0F;
|
||||
float f3 = (float)(i >> 8 & 255) / 255.0F;
|
||||
float f4 = (float)(i & 255) / 255.0F;
|
||||
GL11.glColor3f(f2, f3, f4);
|
||||
GL11.glPushMatrix();
|
||||
this.func_77026_a(tessellator, ItemPotion.func_94589_d("overlay"));
|
||||
GL11.glPopMatrix();
|
||||
GL11.glColor3f(1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
this.func_77026_a(tessellator, icon);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
protected ResourceLocation func_110775_a(Entity par1Entity)
|
||||
{
|
||||
return TextureMap.field_110576_c;
|
||||
}
|
||||
|
||||
private void func_77026_a(Tessellator par1Tessellator, Icon par2Icon)
|
||||
{
|
||||
float f = par2Icon.getMinU();
|
||||
float f1 = par2Icon.getMaxU();
|
||||
float f2 = par2Icon.getMinV();
|
||||
float f3 = par2Icon.getMaxV();
|
||||
float f4 = 1.0F;
|
||||
float f5 = 0.5F;
|
||||
float f6 = 0.25F;
|
||||
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
|
||||
par1Tessellator.startDrawingQuads();
|
||||
par1Tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(0.0F - f6), 0.0D, (double)f, (double)f3);
|
||||
par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6), 0.0D, (double)f1, (double)f3);
|
||||
par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6), 0.0D, (double)f1, (double)f2);
|
||||
par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6), 0.0D, (double)f, (double)f2);
|
||||
par1Tessellator.draw();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user