Fixed multimeter item render

This commit is contained in:
Calclavia 2013-08-05 12:10:43 -04:00
parent 5530ab352b
commit b7e391ce89
4 changed files with 10 additions and 39 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -3,28 +3,17 @@
*/
package resonantinduction.multimeter;
import static net.minecraftforge.common.ForgeDirection.EAST;
import static net.minecraftforge.common.ForgeDirection.NORTH;
import static net.minecraftforge.common.ForgeDirection.SOUTH;
import static net.minecraftforge.common.ForgeDirection.WEST;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import resonantinduction.ResonantInduction;
import resonantinduction.base.BlockBase;
import resonantinduction.render.BlockRenderingHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/**
* A block that detects power.
@ -34,11 +23,10 @@ import resonantinduction.render.BlockRenderingHandler;
*/
public class BlockMultimeter extends BlockBase implements ITileEntityProvider
{
private Icon machineIcon;
public BlockMultimeter(int id)
{
super("multimeter", id);
this.func_111022_d(ResonantInduction.PREFIX + "machine");
}
/**
@ -50,24 +38,6 @@ public class BlockMultimeter extends BlockBase implements ITileEntityProvider
return ForgeDirection.getOrientation(side).ordinal();
}
@Override
public Icon getIcon(int side, int metadata)
{
if (side == metadata)
{
return this.blockIcon;
}
return this.machineIcon;
}
@Override
public void registerIcons(IconRegister iconRegister)
{
super.registerIcons(iconRegister);
this.machineIcon = iconRegister.registerIcon(ResonantInduction.PREFIX + "machine");
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float par7, float par8, float par9)
{
@ -106,6 +76,7 @@ public class BlockMultimeter extends BlockBase implements ITileEntityProvider
{
return true;
}
@SideOnly(Side.CLIENT)
@Override
public int getRenderType()

View file

@ -62,10 +62,8 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
else if (block instanceof BlockMultimeter)
{
GL11.glPushMatrix();
GL11.glTranslated(-0.5, 1, -1);
// GL11.glTranslated(1.5, 1.5, -0.5);
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(-180, 0.0F, 1, 1.0F);
GL11.glRotatef(180, 0, 1, 0);
GL11.glTranslated(0, -1, -0.7);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(RenderMultimeter.TEXTURE);
RenderMultimeter.MODEL.render(0.0625f);
GL11.glPopMatrix();

View file

@ -34,9 +34,11 @@ public class RenderMultimeter extends TileEntitySpecialRenderer
ForgeDirection direction = ForgeDirection.getOrientation(tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord));
GL11.glPushMatrix();
/ GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5);
//GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(90F, 0, 0, 1);
GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5);
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
/*
switch (direction)
{