Git always finds a way to screw things up, re-added new transmitter renderer
This commit is contained in:
parent
ea9dcf73ec
commit
c27f4d06bc
5 changed files with 174 additions and 123 deletions
|
@ -1,70 +1,105 @@
|
||||||
package mekanism.client;
|
package mekanism.client;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.client.model.ModelBase;
|
import net.minecraft.client.model.ModelBase;
|
||||||
import net.minecraft.client.model.ModelRenderer;
|
import net.minecraft.client.model.ModelRenderer;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraftforge.common.ForgeDirection;
|
import net.minecraftforge.common.ForgeDirection;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class ModelTransmitter extends ModelBase
|
public class ModelTransmitter extends ModelBase
|
||||||
{
|
{
|
||||||
ModelRenderer Center;
|
ModelRenderer UpOn;
|
||||||
ModelRenderer Up;
|
ModelRenderer DownOn;
|
||||||
ModelRenderer Down;
|
ModelRenderer FrontOn;
|
||||||
ModelRenderer Front;
|
ModelRenderer BackOn;
|
||||||
ModelRenderer Back;
|
ModelRenderer LeftOn;
|
||||||
ModelRenderer Left;
|
ModelRenderer RightOn;
|
||||||
ModelRenderer Right;
|
ModelRenderer UpOff;
|
||||||
|
ModelRenderer DownOff;
|
||||||
|
ModelRenderer FrontOff;
|
||||||
|
ModelRenderer BackOff;
|
||||||
|
ModelRenderer LeftOff;
|
||||||
|
ModelRenderer RightOff;
|
||||||
|
|
||||||
public ModelTransmitter()
|
public ModelTransmitter()
|
||||||
{
|
{
|
||||||
textureWidth = 64;
|
textureWidth = 64;
|
||||||
textureHeight = 64;
|
textureHeight = 64;
|
||||||
|
|
||||||
Center = new ModelRenderer(this, 0, 0);
|
UpOn = new ModelRenderer(this, 0, 13);
|
||||||
Center.addBox(0F, 0F, 0F, 6, 6, 6);
|
UpOn.addBox(0F, 0F, 0F, 6, 5, 6);
|
||||||
Center.setRotationPoint(-3F, 13F, -3F);
|
UpOn.setRotationPoint(-3F, 8F, -3F);
|
||||||
Center.setTextureSize(64, 64);
|
UpOn.setTextureSize(64, 64);
|
||||||
Center.mirror = true;
|
UpOn.mirror = true;
|
||||||
setRotation(Center, 0F, 0F, 0F);
|
setRotation(UpOn, 0F, 0F, 0F);
|
||||||
Up = new ModelRenderer(this, 0, 13);
|
DownOn = new ModelRenderer(this, 26, 13);
|
||||||
Up.addBox(0F, 0F, 0F, 6, 5, 6);
|
DownOn.addBox(0F, 0F, 0F, 6, 5, 6);
|
||||||
Up.setRotationPoint(-3F, 8F, -3F);
|
DownOn.setRotationPoint(-3F, 19F, -3F);
|
||||||
Up.setTextureSize(64, 64);
|
DownOn.setTextureSize(64, 64);
|
||||||
Up.mirror = true;
|
DownOn.mirror = true;
|
||||||
setRotation(Up, 0F, 0F, 0F);
|
setRotation(DownOn, 0F, 0F, 0F);
|
||||||
Down = new ModelRenderer(this, 26, 13);
|
FrontOn = new ModelRenderer(this, 0, 26);
|
||||||
Down.addBox(0F, 0F, 0F, 6, 5, 6);
|
FrontOn.addBox(0F, 0F, 0F, 5, 6, 6);
|
||||||
Down.setRotationPoint(-3F, 19F, -3F);
|
FrontOn.setRotationPoint(-3F, 13F, -3F);
|
||||||
Down.setTextureSize(64, 64);
|
FrontOn.setTextureSize(64, 64);
|
||||||
Down.mirror = true;
|
FrontOn.mirror = true;
|
||||||
setRotation(Down, 0F, 0F, 0F);
|
setRotation(FrontOn, 0F, 1.570796F, 0F);
|
||||||
Front = new ModelRenderer(this, 0, 26);
|
BackOn = new ModelRenderer(this, 0, 41);
|
||||||
Front.addBox(0F, 0F, 0F, 5, 6, 6);
|
BackOn.addBox(0F, 0F, 0F, 5, 6, 6);
|
||||||
Front.setRotationPoint(-3F, 13F, -3F);
|
BackOn.setRotationPoint(-3F, 13F, 8F);
|
||||||
Front.setTextureSize(64, 64);
|
BackOn.setTextureSize(64, 64);
|
||||||
Front.mirror = true;
|
BackOn.mirror = true;
|
||||||
setRotation(Front, 0F, 1.570796F, 0F);
|
setRotation(BackOn, 0F, 1.570796F, 0F);
|
||||||
Back = new ModelRenderer(this, 0, 41);
|
LeftOn = new ModelRenderer(this, 26, 0);
|
||||||
Back.addBox(0F, 0F, 0F, 5, 6, 6);
|
LeftOn.addBox(0F, 0F, 0F, 6, 5, 6);
|
||||||
Back.setRotationPoint(-3F, 13F, 8F);
|
LeftOn.setRotationPoint(3F, 19F, 3F);
|
||||||
Back.setTextureSize(64, 64);
|
LeftOn.setTextureSize(64, 64);
|
||||||
Back.mirror = true;
|
LeftOn.mirror = true;
|
||||||
setRotation(Back, 0F, 1.570796F, 0F);
|
setRotation(LeftOn, 1.570796F, 1.570796F, 0F);
|
||||||
Left = new ModelRenderer(this, 26, 0);
|
RightOn = new ModelRenderer(this, 26, 26);
|
||||||
Left.addBox(0F, 0F, 0F, 6, 5, 6);
|
RightOn.addBox(0F, 0F, 0F, 6, 5, 6);
|
||||||
Left.setRotationPoint(3F, 19F, 3F);
|
RightOn.setRotationPoint(-8F, 19F, 3F);
|
||||||
Left.setTextureSize(64, 64);
|
RightOn.setTextureSize(64, 64);
|
||||||
Left.mirror = true;
|
RightOn.mirror = true;
|
||||||
setRotation(Left, 1.570796F, 1.570796F, 0F);
|
setRotation(RightOn, 1.570796F, 1.570796F, 0F);
|
||||||
Right = new ModelRenderer(this, 26, 26);
|
UpOff = new ModelRenderer(this, 0, 0);
|
||||||
Right.addBox(0F, 0F, 0F, 6, 5, 6);
|
UpOff.addBox(0F, 0F, 0F, 6, 0, 6);
|
||||||
Right.setRotationPoint(-8F, 19F, 3F);
|
UpOff.setRotationPoint(-3F, 13F, -3F);
|
||||||
Right.setTextureSize(64, 64);
|
UpOff.setTextureSize(64, 64);
|
||||||
Right.mirror = true;
|
UpOff.mirror = true;
|
||||||
setRotation(Right, 1.570796F, 1.570796F, 0F);
|
setRotation(UpOff, 0F, 0F, 0F);
|
||||||
|
DownOff = new ModelRenderer(this, 0, 0);
|
||||||
|
DownOff.addBox(0F, 0F, 0F, 6, 0, 6);
|
||||||
|
DownOff.setRotationPoint(-3F, 19F, -3F);
|
||||||
|
DownOff.setTextureSize(64, 64);
|
||||||
|
DownOff.mirror = true;
|
||||||
|
setRotation(DownOff, 0F, 0F, 0F);
|
||||||
|
FrontOff = new ModelRenderer(this, 0, 0);
|
||||||
|
FrontOff.addBox(0F, 0F, 0F, 0, 6, 6);
|
||||||
|
FrontOff.setRotationPoint(-3F, 13F, -3F);
|
||||||
|
FrontOff.setTextureSize(64, 64);
|
||||||
|
FrontOff.mirror = true;
|
||||||
|
setRotation(FrontOff, 0F, 1.570796F, 0F);
|
||||||
|
BackOff = new ModelRenderer(this, 0, 0);
|
||||||
|
BackOff.addBox(0F, 0F, 0F, 0, 6, 6);
|
||||||
|
BackOff.setRotationPoint(-3F, 13F, 3F);
|
||||||
|
BackOff.setTextureSize(64, 64);
|
||||||
|
BackOff.mirror = true;
|
||||||
|
setRotation(BackOff, 0F, 1.570796F, 0F);
|
||||||
|
LeftOff = new ModelRenderer(this, 0, 0);
|
||||||
|
LeftOff.addBox(0F, 0F, 0F, 6, 0, 6);
|
||||||
|
LeftOff.setRotationPoint(3F, 19F, 3F);
|
||||||
|
LeftOff.setTextureSize(64, 64);
|
||||||
|
LeftOff.mirror = true;
|
||||||
|
setRotation(LeftOff, 1.570796F, 1.570796F, 0F);
|
||||||
|
RightOff = new ModelRenderer(this, 0, 0);
|
||||||
|
RightOff.addBox(0F, 0F, 0F, 6, 0, 6);
|
||||||
|
RightOff.setRotationPoint(-3F, 19F, 3F);
|
||||||
|
RightOff.setTextureSize(64, 64);
|
||||||
|
RightOff.mirror = true;
|
||||||
|
setRotation(RightOff, 1.570796F, 1.570796F, 0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -73,38 +108,64 @@ public class ModelTransmitter extends ModelBase
|
||||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||||
|
|
||||||
Center.render(0.0625F);
|
|
||||||
|
|
||||||
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
|
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
|
||||||
{
|
{
|
||||||
renderSide(orientation);
|
renderSide(orientation, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderSide(ForgeDirection orientation)
|
public void renderSide(ForgeDirection orientation, boolean on)
|
||||||
{
|
{
|
||||||
switch (orientation)
|
if(on)
|
||||||
{
|
{
|
||||||
case DOWN:
|
switch(orientation)
|
||||||
Down.render(0.0625F);
|
{
|
||||||
break;
|
case DOWN:
|
||||||
case UP:
|
DownOn.render(0.0625F);
|
||||||
Up.render(0.0625F);
|
break;
|
||||||
break;
|
case UP:
|
||||||
case NORTH:
|
UpOn.render(0.0625F);
|
||||||
Back.render(0.0625F);
|
break;
|
||||||
break;
|
case NORTH:
|
||||||
case SOUTH:
|
BackOn.render(0.0625F);
|
||||||
Front.render(0.0625F);
|
break;
|
||||||
break;
|
case SOUTH:
|
||||||
case WEST:
|
FrontOn.render(0.0625F);
|
||||||
Right.render(0.0625F);
|
break;
|
||||||
break;
|
case WEST:
|
||||||
case EAST:
|
RightOn.render(0.0625F);
|
||||||
Left.render(0.0625F);
|
break;
|
||||||
break;
|
case EAST:
|
||||||
default:
|
LeftOn.render(0.0625F);
|
||||||
return;
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
switch(orientation)
|
||||||
|
{
|
||||||
|
case DOWN:
|
||||||
|
DownOff.render(0.0625F);
|
||||||
|
break;
|
||||||
|
case UP:
|
||||||
|
UpOff.render(0.0625F);
|
||||||
|
break;
|
||||||
|
case NORTH:
|
||||||
|
BackOff.render(0.0625F);
|
||||||
|
break;
|
||||||
|
case SOUTH:
|
||||||
|
FrontOff.render(0.0625F);
|
||||||
|
break;
|
||||||
|
case WEST:
|
||||||
|
RightOff.render(0.0625F);
|
||||||
|
break;
|
||||||
|
case EAST:
|
||||||
|
LeftOff.render(0.0625F);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,13 +46,9 @@ public class RenderMechanicalPipe extends TileEntitySpecialRenderer
|
||||||
|
|
||||||
for(int i = 0; i < 6; i++)
|
for(int i = 0; i < 6; i++)
|
||||||
{
|
{
|
||||||
if(connectable[i])
|
model.renderSide(ForgeDirection.getOrientation(i), connectable[i]);
|
||||||
{
|
|
||||||
model.renderSide(ForgeDirection.getOrientation(i));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
model.Center.render(0.0625F);
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
if(tileEntity.liquidScale > 0 && tileEntity.refLiquid != null)
|
if(tileEntity.liquidScale > 0 && tileEntity.refLiquid != null)
|
||||||
|
|
|
@ -67,46 +67,42 @@ public class RenderPressurizedTube extends TileEntitySpecialRenderer
|
||||||
{
|
{
|
||||||
for(int i = 0; i < 6; i++)
|
for(int i = 0; i < 6; i++)
|
||||||
{
|
{
|
||||||
if(connectable[i])
|
TileEntity sideTile = Object3D.get(tileEntity).getFromSide(ForgeDirection.getOrientation(i)).getTileEntity(tileEntity.worldObj);
|
||||||
|
|
||||||
|
if(sideTile instanceof TileEntityGasTank && i != 0 && i != 1)
|
||||||
{
|
{
|
||||||
TileEntity sideTile = Object3D.get(tileEntity).getFromSide(ForgeDirection.getOrientation(i)).getTileEntity(tileEntity.worldObj);
|
GL11.glPushMatrix();
|
||||||
|
|
||||||
if(sideTile instanceof TileEntityGasTank && i != 0 && i != 1)
|
switch(ForgeDirection.getOrientation(i))
|
||||||
{
|
{
|
||||||
GL11.glPushMatrix();
|
case NORTH:
|
||||||
|
GL11.glScalef(1, 1, 1.63f);
|
||||||
switch(ForgeDirection.getOrientation(i))
|
GL11.glTranslatef(0, 0, -.073f);
|
||||||
{
|
break;
|
||||||
case NORTH:
|
case SOUTH:
|
||||||
GL11.glScalef(1, 1, 1.63f);
|
GL11.glScalef(1, 1, 1.63f);
|
||||||
GL11.glTranslatef(0, 0, -.073f);
|
GL11.glTranslatef(0, 0, .073f);
|
||||||
break;
|
break;
|
||||||
case SOUTH:
|
case WEST:
|
||||||
GL11.glScalef(1, 1, 1.63f);
|
GL11.glScalef(1.63f, 1, 1);
|
||||||
GL11.glTranslatef(0, 0, .073f);
|
GL11.glTranslatef(.073f, 0, 0);
|
||||||
break;
|
break;
|
||||||
case WEST:
|
case EAST:
|
||||||
GL11.glScalef(1.63f, 1, 1);
|
GL11.glScalef(1.63f, 1, 1);
|
||||||
GL11.glTranslatef(.073f, 0, 0);
|
GL11.glTranslatef(-.073f, 0, 0);
|
||||||
break;
|
break;
|
||||||
case EAST:
|
|
||||||
GL11.glScalef(1.63f, 1, 1);
|
|
||||||
GL11.glTranslatef(-.073f, 0, 0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
model.renderSide(ForgeDirection.getOrientation(i));
|
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
model.renderSide(ForgeDirection.getOrientation(i));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model.renderSide(ForgeDirection.getOrientation(i), connectable[i]);
|
||||||
|
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
model.renderSide(ForgeDirection.getOrientation(i), connectable[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
model.Center.render(0.0625F);
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
if(tileEntity.gasScale > 0 && tileEntity.refGas != null && tileEntity.refGas.hasTexture())
|
if(tileEntity.gasScale > 0 && tileEntity.refGas != null && tileEntity.refGas.hasTexture())
|
||||||
|
|
|
@ -43,14 +43,9 @@ public class RenderUniversalCable extends TileEntitySpecialRenderer
|
||||||
|
|
||||||
for(int i = 0; i < 6; i++)
|
for(int i = 0; i < 6; i++)
|
||||||
{
|
{
|
||||||
if(connectable[i])
|
model.renderSide(ForgeDirection.getOrientation(i), connectable[i]);
|
||||||
{
|
|
||||||
model.renderSide(ForgeDirection.getOrientation(i));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
model.Center.render(0.0625F);
|
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
if(Mekanism.fancyUniversalCableRender)
|
if(Mekanism.fancyUniversalCableRender)
|
||||||
|
|
|
@ -37,9 +37,12 @@ public class TransmitterRenderer implements ISimpleBlockRenderingHandler
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
transmitter.Center.render(0.0625F);
|
transmitter.UpOn.render(0.0625F);
|
||||||
transmitter.Up.render(0.0625F);
|
transmitter.DownOn.render(0.0625F);
|
||||||
transmitter.Down.render(0.0625F);
|
transmitter.BackOff.render(0.0625F);
|
||||||
|
transmitter.FrontOff.render(0.0625F);
|
||||||
|
transmitter.LeftOff.render(0.0625F);
|
||||||
|
transmitter.RightOff.render(0.0625F);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue