.
This commit is contained in:
parent
bd35ad9a56
commit
fab70e6e85
4 changed files with 2 additions and 177 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -20,6 +20,7 @@ LICENSE
|
||||||
/src/minecraft/basiccomponents/*
|
/src/minecraft/basiccomponents/*
|
||||||
/src/minecraft/buildcraft/*
|
/src/minecraft/buildcraft/*
|
||||||
/src/minecraft/EUIClient/*
|
/src/minecraft/EUIClient/*
|
||||||
|
/src/minecraft/BasicPipes/*
|
||||||
/src/common/cpw/*
|
/src/common/cpw/*
|
||||||
/src/common/net/*
|
/src/common/net/*
|
||||||
/src/common/org/*
|
/src/common/org/*
|
||||||
|
@ -30,6 +31,7 @@ LICENSE
|
||||||
/src/common/universalelectricity/*
|
/src/common/universalelectricity/*
|
||||||
/src/common/basiccomponents/*
|
/src/common/basiccomponents/*
|
||||||
/src/common/buildcraft/*
|
/src/common/buildcraft/*
|
||||||
|
/src/common/BasicPipes/*
|
||||||
/bin/
|
/bin/
|
||||||
/conf/
|
/conf/
|
||||||
/docs/
|
/docs/
|
||||||
|
|
|
@ -1,98 +0,0 @@
|
||||||
package BasicPipes;
|
|
||||||
|
|
||||||
import net.minecraft.src.*;
|
|
||||||
|
|
||||||
public class ModelPipe extends ModelBase
|
|
||||||
{
|
|
||||||
//fields
|
|
||||||
ModelRenderer Middle;
|
|
||||||
ModelRenderer Right;
|
|
||||||
ModelRenderer Left;
|
|
||||||
ModelRenderer Back;
|
|
||||||
ModelRenderer Front;
|
|
||||||
ModelRenderer Top;
|
|
||||||
ModelRenderer Bottom;
|
|
||||||
|
|
||||||
public ModelPipe()
|
|
||||||
{
|
|
||||||
textureWidth = 64;
|
|
||||||
textureHeight = 32;
|
|
||||||
|
|
||||||
Middle = new ModelRenderer(this, 0, 0);
|
|
||||||
Middle.addBox(-1F, -1F, -1F, 4, 4, 4);
|
|
||||||
Middle.setRotationPoint(-1F, 15F, -1F);
|
|
||||||
Middle.setTextureSize(64, 32);
|
|
||||||
Middle.mirror = true;
|
|
||||||
setRotation(Middle, 0F, 0F, 0F);
|
|
||||||
Right = new ModelRenderer(this, 21, 0);
|
|
||||||
Right.addBox(0F, 0F, 0F, 6, 4, 4);
|
|
||||||
Right.setRotationPoint(2F, 14F, -2F);
|
|
||||||
Right.setTextureSize(64, 32);
|
|
||||||
Right.mirror = true;
|
|
||||||
setRotation(Right, 0F, 0F, 0F);
|
|
||||||
Left = new ModelRenderer(this, 21, 0);
|
|
||||||
Left.addBox(0F, 0F, 0F, 6, 4, 4);
|
|
||||||
Left.setRotationPoint(-8F, 14F, -2F);
|
|
||||||
Left.setTextureSize(64, 32);
|
|
||||||
Left.mirror = true;
|
|
||||||
setRotation(Left, 0F, 0F, 0F);
|
|
||||||
Back = new ModelRenderer(this, 0, 11);
|
|
||||||
Back.addBox(0F, 0F, 0F, 4, 4, 6);
|
|
||||||
Back.setRotationPoint(-2F, 14F, 2F);
|
|
||||||
Back.setTextureSize(64, 32);
|
|
||||||
Back.mirror = true;
|
|
||||||
setRotation(Back, 0F, 0F, 0F);
|
|
||||||
Front = new ModelRenderer(this, 0, 11);
|
|
||||||
Front.addBox(0F, 0F, 0F, 4, 4, 6);
|
|
||||||
Front.setRotationPoint(-2F, 14F, -8F);
|
|
||||||
Front.setTextureSize(64, 32);
|
|
||||||
Front.mirror = true;
|
|
||||||
setRotation(Front, 0F, 0F, 0F);
|
|
||||||
Top = new ModelRenderer(this, 21, 11);
|
|
||||||
Top.addBox(0F, 0F, 0F, 4, 6, 4);
|
|
||||||
Top.setRotationPoint(-2F, 8F, -2F);
|
|
||||||
Top.setTextureSize(64, 32);
|
|
||||||
Top.mirror = true;
|
|
||||||
setRotation(Top, 0F, 0F, 0F);
|
|
||||||
Bottom = new ModelRenderer(this, 21, 11);
|
|
||||||
Bottom.addBox(0F, 0F, 0F, 4, 6, 4);
|
|
||||||
Bottom.setRotationPoint(-2F, 18F, -2F);
|
|
||||||
Bottom.setTextureSize(64, 32);
|
|
||||||
Bottom.mirror = true;
|
|
||||||
setRotation(Bottom, 0F, 0F, 0F);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
|
|
||||||
{
|
|
||||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
|
||||||
setRotationAngles(f, f1, f2, f3, f4, f5);
|
|
||||||
this.renderMiddle();
|
|
||||||
this.renderBottom();
|
|
||||||
this.renderTop();
|
|
||||||
this.renderLeft();
|
|
||||||
this.renderRight();
|
|
||||||
this.renderBack();
|
|
||||||
this.renderFront();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void renderMiddle() { Middle.render(0.0625F); }
|
|
||||||
public void renderBottom() { Bottom.render(0.0625F); }
|
|
||||||
public void renderTop() { Top.render(0.0625F); }
|
|
||||||
public void renderLeft() { Left.render(0.0625F); }
|
|
||||||
public void renderRight() { Right.render(0.0625F); }
|
|
||||||
public void renderBack() { Back.render(0.0625F); }
|
|
||||||
public void renderFront() { Front.render(0.0625F);}
|
|
||||||
|
|
||||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
|
||||||
{
|
|
||||||
model.rotateAngleX = x;
|
|
||||||
model.rotateAngleY = y;
|
|
||||||
model.rotateAngleZ = z;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
|
|
||||||
{
|
|
||||||
super.setRotationAngles(f, f1, f2, f3, f4, f5);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
package BasicPipes;
|
|
||||||
|
|
||||||
import net.minecraftforge.client.MinecraftForgeClient;
|
|
||||||
import BasicPipes.pipes.TileEntityPipe;
|
|
||||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
|
||||||
|
|
||||||
public class PipeClientProxy extends PipeProxy
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void preInit()
|
|
||||||
{
|
|
||||||
//Preload textures
|
|
||||||
MinecraftForgeClient.preloadTexture("/EUIClient/Textures/Items.png");
|
|
||||||
MinecraftForgeClient.preloadTexture("/EUIClient/Textures/blocks.png");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void init()
|
|
||||||
{
|
|
||||||
ClientRegistry.registerTileEntity(TileEntityPipe.class, "pipe", new RenderPipe());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,57 +0,0 @@
|
||||||
package BasicPipes;
|
|
||||||
|
|
||||||
import net.minecraft.src.TileEntity;
|
|
||||||
import net.minecraft.src.TileEntitySpecialRenderer;
|
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
|
||||||
|
|
||||||
import BasicPipes.pipes.TileEntityPipe;
|
|
||||||
|
|
||||||
public class RenderPipe extends TileEntitySpecialRenderer
|
|
||||||
{
|
|
||||||
int type = 0;
|
|
||||||
private ModelPipe model;
|
|
||||||
|
|
||||||
public RenderPipe()
|
|
||||||
{
|
|
||||||
model = new ModelPipe();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void renderAModelAt(TileEntityPipe tileEntity, double d, double d1, double d2, float f)
|
|
||||||
{
|
|
||||||
//Texture file
|
|
||||||
|
|
||||||
type = tileEntity.getType();
|
|
||||||
switch(type)
|
|
||||||
{
|
|
||||||
case 0: bindTextureByName("/EUIClient/Textures/SteamPipe.png");break;
|
|
||||||
case 1: bindTextureByName("/EUIClient/Textures/WaterPipe.png");break;
|
|
||||||
//case 2: bindTextureByName("/eui/lavaPipe.png");break;
|
|
||||||
//case 3: bindTextureByName("/eui/oilPipe.png");break;
|
|
||||||
//case 4: bindTextureByName("/eui/fuelPipe.png");break;
|
|
||||||
//case 5: bindTextureByName("/eui/airPipe.png");break;
|
|
||||||
default:bindTextureByName("/EUIClient/Textures/DefaultPipe.png"); break;
|
|
||||||
}
|
|
||||||
|
|
||||||
GL11.glPushMatrix();
|
|
||||||
GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
|
|
||||||
GL11.glScalef(1.0F, -1F, -1F);
|
|
||||||
|
|
||||||
if(tileEntity.connectedBlocks[0] != null) model.renderBottom();
|
|
||||||
if(tileEntity.connectedBlocks[1] != null) model.renderTop();
|
|
||||||
if(tileEntity.connectedBlocks[2] != null) model.renderFront();
|
|
||||||
if(tileEntity.connectedBlocks[3] != null) model.renderBack();
|
|
||||||
if(tileEntity.connectedBlocks[4] != null) model.renderRight();
|
|
||||||
if(tileEntity.connectedBlocks[5] != null) model.renderLeft();
|
|
||||||
|
|
||||||
model.renderMiddle();
|
|
||||||
GL11.glPopMatrix();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8) {
|
|
||||||
this.renderAModelAt((TileEntityPipe)tileEntity, var2, var4, var6, var8);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in a new issue