Skip to content

Instantly share code, notes, and snippets.

@zombiepigcreeper
Created January 6, 2012 18:16
Show Gist options
  • Save zombiepigcreeper/1571742 to your computer and use it in GitHub Desktop.
Save zombiepigcreeper/1571742 to your computer and use it in GitHub Desktop.
package net.minecraft.src;
import org.lwjgl.opengl.GL11;
public class RenderStone extends Render
{
public RenderStone()
{
}
public void doRender(Entity entity, double d, double d1, double d2, float f, float f1)
{
GL11.glPushMatrix();
GL11.glTranslatef((float)d, (float)d1, (float)d2);
GL11.glEnable(32826 /*GL_RESCALE_NORMAL_EXT*/);
GL11.glScalef(0.5F, 0.5F, 0.5F);
loadTexture("/katapult/smallstone.png");
Tessellator tessellator = Tessellator.instance;
int i = mod_katapult.smallstone.shiftedIndex;
float f2 = (float)((i % 16) * 16 + 0) / 256F;
float f3 = (float)((i % 16) * 16 + 16) / 256F;
float f4 = (float)((i / 16) * 16 + 0) / 256F;
float f5 = (float)((i / 16) * 16 + 16) / 256F;
float f6 = 1.0F;
float f7 = 0.5F;
float f8 = 0.25F;
GL11.glRotatef(180F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
tessellator.addVertexWithUV(0.0F - f7, 0.0F - f8, 0.0D, f2, f5);
tessellator.addVertexWithUV(f6 - f7, 0.0F - f8, 0.0D, f3, f5);
tessellator.addVertexWithUV(f6 - f7, 1.0F - f8, 0.0D, f3, f4);
tessellator.addVertexWithUV(0.0F - f7, 1.0F - f8, 0.0D, f2, f4);
tessellator.draw();
GL11.glDisable(32826 /*GL_RESCALE_NORMAL_EXT*/);
GL11.glPopMatrix();
}
}
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode fieldsfirst
package net.minecraft.src;
// Referenced classes of package net.minecraft.src:
// EntityThrowable, MovingObjectPosition, EntityBlaze, DamageSource,
// Entity, World, EntityLiving
public class EntityStone extends EntityThrowable
{
public EntityStone(World world)
{
super(world);
}
public EntityStone(World world, EntityLiving entityliving)
{
super(world, entityliving);
}
public EntityStone(World world, double d, double d1, double d2)
{
super(world, d, d1, d2);
}
protected void func_40078_a(MovingObjectPosition movingobjectposition)
{
if(movingobjectposition.entityHit != null)
{
byte byte0 = 0;
if(movingobjectposition.entityHit instanceof EntityLiving)
{
byte0 = 4;
}
if(!movingobjectposition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, field_40083_c), byte0));
}
for(int i = 0; i < 8; i++)
{
worldObj.spawnParticle("snowballpoof", posX, posY, posZ, 0.0D, 0.0D, 0.0D);
}
if(!worldObj.multiplayerWorld)
{
setEntityDead();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment