Fixed a few issues with pipe renders
This commit is contained in:
parent
605d4212c5
commit
bca0fbdbaf
5 changed files with 563 additions and 558 deletions
|
@ -2,8 +2,13 @@ package resonantinduction.mechanical;
|
|||
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import resonantinduction.mechanical.fluid.pipe.ItemPipeRenderer;
|
||||
import resonantinduction.mechanical.fluid.pipe.RenderPipe;
|
||||
import resonantinduction.mechanical.fluid.pipe.TilePipe;
|
||||
import resonantinduction.mechanical.fluid.tank.ItemTankRenderer;
|
||||
import resonantinduction.mechanical.fluid.tank.RenderTank;
|
||||
import resonantinduction.mechanical.fluid.tank.TileTank;
|
||||
import resonantinduction.mechanical.render.MechanicalBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
public class ClientProxy extends CommonProxy
|
||||
|
@ -19,5 +24,7 @@ public class ClientProxy extends CommonProxy
|
|||
{
|
||||
MinecraftForgeClient.registerItemRenderer(Mechanical.blockTank.blockID, new ItemTankRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(Mechanical.blockPipe.blockID, new ItemPipeRenderer());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TilePipe.class, new RenderPipe());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileTank.class, new RenderTank());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,6 @@ public class ItemBlockFluidContainer extends ItemBlock
|
|||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
return this.maxStackSize;
|
||||
}
|
||||
|
||||
|
@ -108,7 +107,7 @@ public class ItemBlockFluidContainer extends ItemBlock
|
|||
@Override
|
||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata)
|
||||
{
|
||||
if (super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, (stack.getItemDamage() / FluidContainerMaterial.spacing)))
|
||||
if (super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, (metadata / FluidContainerMaterial.spacing)))
|
||||
{
|
||||
TileEntity tile = world.getBlockTileEntity(x, y, z);
|
||||
if (tile instanceof TileFluidNetwork)
|
||||
|
|
|
@ -45,26 +45,26 @@ public class ItemPipeRenderer implements IItemRenderer
|
|||
if (type == ItemRenderType.ENTITY)
|
||||
{
|
||||
GL11.glTranslatef(-.5F, -1F, -.5F);
|
||||
RenderPipe.render(meta, (byte) 0b000011);
|
||||
RenderPipe.render(meta, (byte) 0b001100);
|
||||
}
|
||||
else if (type == ItemRenderType.INVENTORY)
|
||||
{
|
||||
GL11.glTranslatef(0F, -1F, 0F);
|
||||
RenderPipe.render(meta, (byte) 0b000011);
|
||||
RenderPipe.render(meta, (byte) 0b001100);
|
||||
}
|
||||
else if (type == ItemRenderType.EQUIPPED)
|
||||
{
|
||||
GL11.glTranslatef(-1F, -1.2F, 0.5F);
|
||||
RenderPipe.render(meta, (byte) 0b001100);
|
||||
RenderPipe.render(meta, (byte) 0b000011);
|
||||
}
|
||||
else if (type == ItemRenderType.EQUIPPED_FIRST_PERSON)
|
||||
{
|
||||
GL11.glTranslatef(-2F, -1.5F, 0.2F);
|
||||
RenderPipe.render(meta, (byte) 0b001100);
|
||||
RenderPipe.render(meta, (byte) 0b000011);
|
||||
}
|
||||
else
|
||||
{
|
||||
RenderPipe.render(item.getItemDamage(), (byte) 0b001100);
|
||||
RenderPipe.render(item.getItemDamage(), (byte) 0b000011);
|
||||
}
|
||||
if (Mechanical.blockReleaseValve != null && item.itemID == Mechanical.blockReleaseValve.blockID)
|
||||
{
|
||||
|
|
|
@ -155,11 +155,11 @@ public class RenderPipe extends TileEntitySpecialRenderer
|
|||
{
|
||||
if (mat == FluidContainerMaterial.WOOD)
|
||||
{
|
||||
// MODEL_TROUGH_PIPE.render(side, false);
|
||||
MODEL_TROUGH_PIPE.render(side, false);
|
||||
}
|
||||
else if (mat == FluidContainerMaterial.STONE)
|
||||
{
|
||||
// MODEL_TROUGH_PIPE.render(side, true);
|
||||
MODEL_TROUGH_PIPE.render(side, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -6,8 +6,10 @@
|
|||
|
||||
package resonantinduction.old.client.model;
|
||||
|
||||
import resonantinduction.mechanical.fluid.prefab.TileFluidNetwork;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
public class ModelOpenTrough extends ModelBase
|
||||
{
|
||||
|
@ -279,16 +281,13 @@ public class ModelOpenTrough extends ModelBase
|
|||
setRotation(cornerFrontRight, 0F, 0F, 0F);
|
||||
}
|
||||
|
||||
public void render(boolean[] side, boolean stone)
|
||||
public void render(byte side, boolean stone)
|
||||
{
|
||||
if (side != null)
|
||||
{
|
||||
renderMiddle(!side[0], stone);
|
||||
renderBack(side[2] ? PipeType.NORMAL : stone ? PipeType.SOLID : PipeType.MID_CAP);
|
||||
renderFront(side[3] ? PipeType.NORMAL : stone ? PipeType.SOLID : PipeType.MID_CAP);
|
||||
renderRight(side[4] ? PipeType.NORMAL : stone ? PipeType.SOLID : PipeType.MID_CAP);
|
||||
renderLeft(side[5] ? PipeType.NORMAL : stone ? PipeType.SOLID : PipeType.MID_CAP);
|
||||
}
|
||||
renderMiddle(TileFluidNetwork.canRenderSide(side, ForgeDirection.DOWN), stone);
|
||||
renderBack(TileFluidNetwork.canRenderSide(side, ForgeDirection.NORTH) ? PipeType.NORMAL : stone ? PipeType.SOLID : PipeType.MID_CAP);
|
||||
renderFront(TileFluidNetwork.canRenderSide(side, ForgeDirection.SOUTH) ? PipeType.NORMAL : stone ? PipeType.SOLID : PipeType.MID_CAP);
|
||||
renderRight(TileFluidNetwork.canRenderSide(side, ForgeDirection.WEST) ? PipeType.NORMAL : stone ? PipeType.SOLID : PipeType.MID_CAP);
|
||||
renderLeft(TileFluidNetwork.canRenderSide(side, ForgeDirection.EAST) ? PipeType.NORMAL : stone ? PipeType.SOLID : PipeType.MID_CAP);
|
||||
}
|
||||
|
||||
public void renderMiddle(boolean bottom, boolean corners)
|
||||
|
|
Loading…
Reference in a new issue