Added rendering for foci meta 3. texture is just temporary

This commit is contained in:
makeo committed 2015-11-09 23:22:35 +01:00
1 parent f20c3edb41
commit fe2b58a281
4 files changed
+84 -6

No files matched your search

@@ -0,0 +1,73 @@
package makeo.gadomancy.client.models;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
/**
* This class is part of the Gadomancy Mod
* Gadomancy is Open Source and distributed under the
* GNU LESSER GENERAL PUBLIC LICENSE
* for more read the LICENSE file
* <p/>
* Created by makeo @ 09.11.2015 23:08
*/
public class ModelFocusPortalPart extends ModelBase {
//fields
ModelRenderer shape1;
ModelRenderer shape2;
ModelRenderer shape3;
ModelRenderer shape4;
ModelRenderer shape5;
public ModelFocusPortalPart() {
textureWidth = 32;
textureHeight = 32;
shape1 = new ModelRenderer(this, 0, 3);
shape1.addBox(-1F, -2F, 0.41F, 2, 5, 1);
shape1.setRotationPoint(0F, 20F, 3.533333F);
shape1.setTextureSize(64, 32);
shape1.mirror = true;
setRotation(shape1, 0F, 0F, 0F);
shape2 = new ModelRenderer(this, 0, 0);
shape2.addBox(-1F, -1F, 0F, 2, 2, 1);
shape2.setRotationPoint(0F, 23F, 3.5F);
shape2.setTextureSize(64, 32);
shape2.mirror = true;
setRotation(shape2, -0.7853982F, 0F, 0F);
shape3 = new ModelRenderer(this, 0, 12);
shape3.addBox(0F, 0F, 0F, 2, 2, 1);
shape3.setRotationPoint(-1F, 21F, 2.5F);
shape3.setTextureSize(64, 32);
shape3.mirror = true;
setRotation(shape3, 0.7853982F, 0F, 0F);
shape4 = new ModelRenderer(this, 0, 9);
shape4.addBox(0F, 0F, 0F, 2, 2, 1);
shape4.setRotationPoint(-1F, 19F, 2.5F);
shape4.setTextureSize(64, 32);
shape4.mirror = true;
setRotation(shape4, 0.7853982F, 0F, 0F);
shape5 = new ModelRenderer(this, 6, 0);
shape5.addBox(0F, -1F, 0.03F, 2, 4, 1);
shape5.setRotationPoint(-1F, 18F, 3.5F);
shape5.setTextureSize(64, 32);
shape5.mirror = true;
setRotation(shape5, 0.7853982F, 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);
shape1.render(f5);
shape2.render(f5);
shape3.render(f5);
shape4.render(f5);
shape5.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}
@@ -1,5 +1,6 @@
package makeo.gadomancy.client.renderers.tile;
import makeo.gadomancy.client.models.ModelFocusPortalPart;
import makeo.gadomancy.client.models.ModelManipulatorPart;
import makeo.gadomancy.common.blocks.tiles.TileManipulationFocus;
import makeo.gadomancy.common.utils.SimpleResourceLocation;
@@ -17,6 +18,7 @@ import org.lwjgl.opengl.GL11;
*/
public class RenderTileManipulationFocus extends TileEntitySpecialRenderer {
private static final ModelManipulatorPart RANDOM_FOCUS = new ModelManipulatorPart();
private static final ModelFocusPortalPart PORTAL_FOCUS = new ModelFocusPortalPart();
public void renderTileEntityAt(TileManipulationFocus tile, double x, double y, double z, float partialTicks) {
GL11.glPushMatrix();
@@ -27,15 +29,18 @@ public class RenderTileManipulationFocus extends TileEntitySpecialRenderer {
GL11.glRotatef(180, 1, 0, 0);
GL11.glTranslatef(0.5f, -1.5f + (2/16f), -0.5f);
if(tile.getFociId() == 0) {
if(tile.getFociId() == 0 || tile.getFociId() == 1) {
GL11.glPushMatrix();
for(int i = 0; i < 4; i++) {
RANDOM_FOCUS.render(null, 0, 0, 0, 0, 0, 0.0625f);
if(tile.getFociId() == 0) {
RANDOM_FOCUS.render(null, 0, 0, 0, 0, 0, 0.0625f);
} else {
PORTAL_FOCUS.render(null, 0, 0, 0, 0, 0, 0.0625f);
}
GL11.glRotatef(90, 0, 1, 0);
}
GL11.glPopMatrix();
} else if(tile.getFociId() == 1) {
//TODO: Hell hell hell
}
GL11.glPopMatrix();
@@ -62,7 +62,7 @@ public class BlockStoneMachine extends Block {
public IIcon getIcon(int side, int metadata) {
if (metadata == 11 || metadata == 15) {
return pillarIcon;
} else if (metadata == 0) {
} else if (metadata == 0 || metadata == 3) {
return focusIcon;
} else if (metadata == 1) {
if (side > 1) {
@@ -79,7 +79,7 @@ public class BlockStoneMachine extends Block {
@Override
public boolean hasTileEntity(int metadata) {
return metadata == 15 || metadata == 0 || metadata == 1 || metadata == 2;
return metadata == 15 || metadata == 0 || metadata == 1 || metadata == 2 || metadata == 3;
}
@Override