diff --git a/src/main/java/makeo/gadomancy/client/models/ModelFocusPortalPart.java b/src/main/java/makeo/gadomancy/client/models/ModelFocusPortalPart.java new file mode 100644 index 0000000..08e49e5 --- /dev/null +++ b/src/main/java/makeo/gadomancy/client/models/ModelFocusPortalPart.java @@ -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 + *
+ * 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; + } +} diff --git a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileManipulationFocus.java b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileManipulationFocus.java index 09e3ff4..80b89ab 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileManipulationFocus.java +++ b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileManipulationFocus.java @@ -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(); diff --git a/src/main/java/makeo/gadomancy/common/blocks/BlockStoneMachine.java b/src/main/java/makeo/gadomancy/common/blocks/BlockStoneMachine.java index 6029814..1f36daf 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/BlockStoneMachine.java +++ b/src/main/java/makeo/gadomancy/common/blocks/BlockStoneMachine.java @@ -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 diff --git a/src/main/resources/assets/gadomancy/textures/models/manipulation_focus_1.png b/src/main/resources/assets/gadomancy/textures/models/manipulation_focus_1.png new file mode 100644 index 0000000..ea273fe Binary files /dev/null and b/src/main/resources/assets/gadomancy/textures/models/manipulation_focus_1.png differ