From c5edf6898957224ef8405247647405f56e0e5546 Mon Sep 17 00:00:00 2001 From: Brian Ricketts Date: Sun, 10 Feb 2013 01:32:35 -0600 Subject: [PATCH] Worked a lot on frame --- AssemblyLineStandard.xml | 582 +++++++++--------- models/CraneFrame.tcn | Bin 1417 -> 0 bytes models/CraneRail.java | 413 +++++++++++++ models/CraneRails.tcn | Bin 0 -> 1383 bytes resources/assemblyline/textures/craneRail.png | Bin 0 -> 718 bytes .../assemblyline/client/ClientProxy.java | 3 + .../client/model/ModelCraneController.java | 4 +- .../client/model/ModelCraneRail.java | 476 ++++++++++++++ .../client/render/BlockRenderingHandler.java | 9 + .../client/render/RenderCraneRail.java | 46 ++ .../assemblyline/common/CommonProxy.java | 2 + .../machine/crane/BlockCraneController.java | 4 + .../common/machine/crane/BlockCraneRail.java | 153 ++++- .../common/machine/crane/CraneHelper.java | 28 + .../common/machine/crane/CraneManager.java | 54 -- .../machine/crane/ICraneConnectable.java | 6 + .../crane/TileEntityCraneController.java | 9 +- .../machine/crane/TileEntityCraneRail.java | 8 + 18 files changed, 1444 insertions(+), 353 deletions(-) delete mode 100644 models/CraneFrame.tcn create mode 100644 models/CraneRail.java create mode 100644 models/CraneRails.tcn create mode 100644 resources/assemblyline/textures/craneRail.png create mode 100644 src/minecraft/assemblyline/client/model/ModelCraneRail.java create mode 100644 src/minecraft/assemblyline/client/render/RenderCraneRail.java create mode 100644 src/minecraft/assemblyline/common/machine/crane/CraneHelper.java delete mode 100644 src/minecraft/assemblyline/common/machine/crane/CraneManager.java create mode 100644 src/minecraft/assemblyline/common/machine/crane/ICraneConnectable.java create mode 100644 src/minecraft/assemblyline/common/machine/crane/TileEntityCraneRail.java diff --git a/AssemblyLineStandard.xml b/AssemblyLineStandard.xml index a5a3516f..df0137e6 100644 --- a/AssemblyLineStandard.xml +++ b/AssemblyLineStandard.xml @@ -1,291 +1,291 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/models/CraneFrame.tcn b/models/CraneFrame.tcn deleted file mode 100644 index 702224a8e26b791d6df1880e756815846ed27f33..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1417 zcmWIWW@Zs#U|`^2Ft4z6DmQxk;w%dT1LG0~22KVQhTQy=)EvEv+#D_j1)w6J1cL;_ z_s<`1CjUFjh)%z~doh2ug$(`eE zm#K;V4YU>il2jGxA{i@sQ8{<>J=@gpm(6Ch)^~VS?d&~e^n~?wO2XdMvcl^o>7gR} zv3#eapWdD!Hu=@l&c6#%cKYq9*k>l2KX=BvIklhW9x=b(ePp?JwPV_qd4B&AtcwhD zxo%yKOI@?;cKeIYZCj7p#R^z|^r?Th@z%9@>FeHh%t{f~u{1 zx_$1_{=o0LZ|{Gx+kO9%(HzM)^1r9@Y_nJ|I6=i=$5th=}!0j{%HL@Xi~b+w@Ce!nr_#g7wl!0%{S~PFIjT+b>fzl zj%Swd@%edg_PU4CehHt ze9vuiRP>sAaA#s)xuZwV(Zsh4_?v&9o;Tld^46GdJJgf6v;yrCyDxBSN3PCihGwTJR?RkV_U9RFnDuk*Umc&R ztskB9Ig*yGX<_Ez3S5=u)>9iS^}I^K=3z|#%1s6OT&le6wAZP5^PQH@)BSD#qWbWI_1P2b-MVgWG7@kAI@QVI@#fS*Ukyga z7N;q@vJV;VKHlvtx{2*_^P#_~=lvHRRzH(e*22Ofz!lgfAY_*)_B@%BLjmY&MX+za z`xM;g2@uWM3;jZqWhT;ncz> zmo%{v6k>`_O*2g(&Tz4CW|!nD)&8>a42Qrgw}|!3-K(8CIW$BTiD(^}bi-kV?80_O zDM^scB1$ny6WrLCI9fGYIcj+>op4}SD6sTHX`t~Jp9KNCour*x16IT;9*j^Fc@@^N zJ>LBnqkzq{1+nKBH9B^Jqr>)V z=HUfrn0dGYx$ZCZX$XMWw0f(Rg9bAwkPaPf;it*qqKDZeel0YOvyG8Rx+OQ=Y7S***qAyv@6IA4}OYF{|}* zdRbhGbi{R&`X!+sKTRv$yZ5fk?RWhTO>gF|k58746AN?;XZVFA07da`F6o_M$1~ znQrE;Q$k{6vbWxQf7aRUa6MyyHzSiS1MZR$TpGd&lFG>dZ&o%)S<1)|4P;2Lf_MOE CO?a39 diff --git a/models/CraneRail.java b/models/CraneRail.java new file mode 100644 index 00000000..e98676c0 --- /dev/null +++ b/models/CraneRail.java @@ -0,0 +1,413 @@ +// Date: 2/9/2013 10:50:15 PM +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + + + + + + +package net.minecraft.src; + +public class ModelCraneRail extends ModelBase +{ + //fields + ModelRenderer SegmentBLBack; + ModelRenderer SegmentLUBack; + ModelRenderer SegmentRUBack; + ModelRenderer SegmentBRBack; + ModelRenderer SegmentBLFront; + ModelRenderer SegmentLUFront; + ModelRenderer SegmentRUFront; + ModelRenderer SegmentBRFront; + ModelRenderer SegmentLBUp; + ModelRenderer SegmentRBUp; + ModelRenderer SegmentLFUp; + ModelRenderer SegmentRFUp; + ModelRenderer SegmentUBRight; + ModelRenderer SegmentBFRight; + ModelRenderer SegmentUFRight; + ModelRenderer SegmentBBRight; + ModelRenderer SegmentLFDown; + ModelRenderer SegmentLBDown; + ModelRenderer SegmentRBDown; + ModelRenderer FootTop; + ModelRenderer SegmentRFDown; + ModelRenderer FootBottom; + ModelRenderer SegmentBFMid; + ModelRenderer SegmentUBMid; + ModelRenderer SegmentBBMid; + ModelRenderer SegmentUFMid; + ModelRenderer SegmentLBMid; + ModelRenderer SegmentLFMid; + ModelRenderer SegmentRBMid; + ModelRenderer SegmentRFMid; + ModelRenderer SegmentMidDiag4; + ModelRenderer SegmentRUMid; + ModelRenderer SegmentBRMid; + ModelRenderer SegmentBLMid; + ModelRenderer SegmentLUMid; + ModelRenderer SegmentMidDiag3; + ModelRenderer SegmentMidDiag7; + ModelRenderer SegmentMidDiag8; + ModelRenderer SegmentMidDiag1; + ModelRenderer SegmentMidDiag2; + ModelRenderer SegmentMidDiag6; + ModelRenderer SegmentMidDiag5; + ModelRenderer SegmentUBLeft; + ModelRenderer SegmentUFLeft; + ModelRenderer SegmentBFLeft; + ModelRenderer SegmentBBLeft; + + public ModelCraneRail() + { + textureWidth = 64; + textureHeight = 32; + + SegmentBLBack = new ModelRenderer(this, 10, 13); + SegmentBLBack.addBox(0F, 0F, 0F, 1, 1, 4); + SegmentBLBack.setRotationPoint(3F, 19F, 4F); + SegmentBLBack.setTextureSize(64, 32); + SegmentBLBack.mirror = true; + setRotation(SegmentBLBack, 0F, 0F, 0F); + SegmentLUBack = new ModelRenderer(this, 10, 13); + SegmentLUBack.addBox(0F, 0F, 0F, 1, 1, 4); + SegmentLUBack.setRotationPoint(3F, 12F, 4F); + SegmentLUBack.setTextureSize(64, 32); + SegmentLUBack.mirror = true; + setRotation(SegmentLUBack, 0F, 0F, 0F); + SegmentRUBack = new ModelRenderer(this, 10, 13); + SegmentRUBack.addBox(0F, 0F, 0F, 1, 1, 4); + SegmentRUBack.setRotationPoint(-4F, 12F, 4F); + SegmentRUBack.setTextureSize(64, 32); + SegmentRUBack.mirror = true; + setRotation(SegmentRUBack, 0F, 0F, 0F); + SegmentBRBack = new ModelRenderer(this, 10, 13); + SegmentBRBack.addBox(0F, 0F, 0F, 1, 1, 4); + SegmentBRBack.setRotationPoint(-4F, 19F, 4F); + SegmentBRBack.setTextureSize(64, 32); + SegmentBRBack.mirror = true; + setRotation(SegmentBRBack, 0F, 0F, 0F); + SegmentBLFront = new ModelRenderer(this, 10, 13); + SegmentBLFront.addBox(0F, 0F, 0F, 1, 1, 4); + SegmentBLFront.setRotationPoint(3F, 19F, -8F); + SegmentBLFront.setTextureSize(64, 32); + SegmentBLFront.mirror = true; + setRotation(SegmentBLFront, 0F, 0F, 0F); + SegmentLUFront = new ModelRenderer(this, 10, 13); + SegmentLUFront.addBox(0F, 0F, 0F, 1, 1, 4); + SegmentLUFront.setRotationPoint(3F, 12F, -8F); + SegmentLUFront.setTextureSize(64, 32); + SegmentLUFront.mirror = true; + setRotation(SegmentLUFront, 0F, 0F, 0F); + SegmentRUFront = new ModelRenderer(this, 10, 13); + SegmentRUFront.addBox(0F, 0F, 0F, 1, 1, 4); + SegmentRUFront.setRotationPoint(-4F, 12F, -8F); + SegmentRUFront.setTextureSize(64, 32); + SegmentRUFront.mirror = true; + setRotation(SegmentRUFront, 0F, 0F, 0F); + SegmentBRFront = new ModelRenderer(this, 10, 13); + SegmentBRFront.addBox(0F, 0F, 0F, 1, 1, 4); + SegmentBRFront.setRotationPoint(-4F, 19F, -8F); + SegmentBRFront.setTextureSize(64, 32); + SegmentBRFront.mirror = true; + setRotation(SegmentBRFront, 0F, 0F, 0F); + SegmentLBUp = new ModelRenderer(this, 20, 13); + SegmentLBUp.addBox(0F, 0F, 0F, 1, 4, 1); + SegmentLBUp.setRotationPoint(3F, 8F, 3F); + SegmentLBUp.setTextureSize(64, 32); + SegmentLBUp.mirror = true; + setRotation(SegmentLBUp, 0F, 0F, 0F); + SegmentRBUp = new ModelRenderer(this, 20, 13); + SegmentRBUp.addBox(0F, 0F, 0F, 1, 4, 1); + SegmentRBUp.setRotationPoint(-4F, 8F, 3F); + SegmentRBUp.setTextureSize(64, 32); + SegmentRBUp.mirror = true; + setRotation(SegmentRBUp, 0F, 0F, 0F); + SegmentLFUp = new ModelRenderer(this, 20, 13); + SegmentLFUp.addBox(0F, 0F, 0F, 1, 4, 1); + SegmentLFUp.setRotationPoint(3F, 8F, -4F); + SegmentLFUp.setTextureSize(64, 32); + SegmentLFUp.mirror = true; + setRotation(SegmentLFUp, 0F, 0F, 0F); + SegmentRFUp = new ModelRenderer(this, 20, 13); + SegmentRFUp.addBox(0F, 0F, 0F, 1, 4, 1); + SegmentRFUp.setRotationPoint(-4F, 8F, -4F); + SegmentRFUp.setTextureSize(64, 32); + SegmentRFUp.mirror = true; + setRotation(SegmentRFUp, 0F, 0F, 0F); + SegmentUBRight = new ModelRenderer(this, 0, 13); + SegmentUBRight.addBox(0F, 0F, 0F, 4, 1, 1); + SegmentUBRight.setRotationPoint(-8F, 12F, 3F); + SegmentUBRight.setTextureSize(64, 32); + SegmentUBRight.mirror = true; + setRotation(SegmentUBRight, 0F, 0F, 0F); + SegmentBFRight = new ModelRenderer(this, 0, 13); + SegmentBFRight.addBox(0F, 0F, 0F, 4, 1, 1); + SegmentBFRight.setRotationPoint(-8F, 19F, -4F); + SegmentBFRight.setTextureSize(64, 32); + SegmentBFRight.mirror = true; + setRotation(SegmentBFRight, 0F, 0F, 0F); + SegmentUFRight = new ModelRenderer(this, 0, 13); + SegmentUFRight.addBox(0F, 0F, 0F, 4, 1, 1); + SegmentUFRight.setRotationPoint(-8F, 12F, -4F); + SegmentUFRight.setTextureSize(64, 32); + SegmentUFRight.mirror = true; + setRotation(SegmentUFRight, 0F, 0F, 0F); + SegmentBBRight = new ModelRenderer(this, 0, 13); + SegmentBBRight.addBox(0F, 0F, 0F, 4, 1, 1); + SegmentBBRight.setRotationPoint(-8F, 19F, 3F); + SegmentBBRight.setTextureSize(64, 32); + SegmentBBRight.mirror = true; + setRotation(SegmentBBRight, 0F, 0F, 0F); + SegmentLFDown = new ModelRenderer(this, 20, 13); + SegmentLFDown.addBox(0F, 0F, 0F, 1, 4, 1); + SegmentLFDown.setRotationPoint(3F, 20F, -4F); + SegmentLFDown.setTextureSize(64, 32); + SegmentLFDown.mirror = true; + setRotation(SegmentLFDown, 0F, 0F, 0F); + SegmentLBDown = new ModelRenderer(this, 20, 13); + SegmentLBDown.addBox(0F, 0F, 0F, 1, 4, 1); + SegmentLBDown.setRotationPoint(3F, 20F, 3F); + SegmentLBDown.setTextureSize(64, 32); + SegmentLBDown.mirror = true; + setRotation(SegmentLBDown, 0F, 0F, 0F); + SegmentRBDown = new ModelRenderer(this, 20, 13); + SegmentRBDown.addBox(0F, 0F, 0F, 1, 4, 1); + SegmentRBDown.setRotationPoint(-4F, 20F, 3F); + SegmentRBDown.setTextureSize(64, 32); + SegmentRBDown.mirror = true; + setRotation(SegmentRBDown, 0F, 0F, 0F); + FootTop = new ModelRenderer(this, 24, 0); + FootTop.addBox(0F, 0F, 0F, 10, 2, 10); + FootTop.setRotationPoint(-5F, 20F, -5F); + FootTop.setTextureSize(64, 32); + FootTop.mirror = true; + setRotation(FootTop, 0F, 0F, 0F); + SegmentRFDown = new ModelRenderer(this, 20, 13); + SegmentRFDown.addBox(0F, 0F, 0F, 1, 4, 1); + SegmentRFDown.setRotationPoint(-4F, 20F, -4F); + SegmentRFDown.setTextureSize(64, 32); + SegmentRFDown.mirror = true; + setRotation(SegmentRFDown, 0F, 0F, 0F); + FootBottom = new ModelRenderer(this, 0, 18); + FootBottom.addBox(0F, 0F, 0F, 12, 2, 12); + FootBottom.setRotationPoint(-6F, 22F, -6F); + FootBottom.setTextureSize(64, 32); + FootBottom.mirror = true; + setRotation(FootBottom, 0F, 0F, 0F); + SegmentBFMid = new ModelRenderer(this, 30, 12); + SegmentBFMid.addBox(0F, 0F, 0F, 8, 1, 1); + SegmentBFMid.setRotationPoint(-4F, 19F, -4F); + SegmentBFMid.setTextureSize(64, 32); + SegmentBFMid.mirror = true; + setRotation(SegmentBFMid, 0F, 0F, 0F); + SegmentUBMid = new ModelRenderer(this, 30, 12); + SegmentUBMid.addBox(0F, 0F, 0F, 8, 1, 1); + SegmentUBMid.setRotationPoint(-4F, 12F, 3F); + SegmentUBMid.setTextureSize(64, 32); + SegmentUBMid.mirror = true; + setRotation(SegmentUBMid, 0F, 0F, 0F); + SegmentBBMid = new ModelRenderer(this, 30, 12); + SegmentBBMid.addBox(0F, 0F, 0F, 8, 1, 1); + SegmentBBMid.setRotationPoint(-4F, 19F, 3F); + SegmentBBMid.setTextureSize(64, 32); + SegmentBBMid.mirror = true; + setRotation(SegmentBBMid, 0F, 0F, 0F); + SegmentUFMid = new ModelRenderer(this, 30, 12); + SegmentUFMid.addBox(0F, 0F, 0F, 8, 1, 1); + SegmentUFMid.setRotationPoint(-4F, 12F, -4F); + SegmentUFMid.setTextureSize(64, 32); + SegmentUFMid.mirror = true; + setRotation(SegmentUFMid, 0F, 0F, 0F); + SegmentLBMid = new ModelRenderer(this, 48, 19); + SegmentLBMid.addBox(0F, 0F, 0F, 1, 6, 1); + SegmentLBMid.setRotationPoint(3F, 13F, 3F); + SegmentLBMid.setTextureSize(64, 32); + SegmentLBMid.mirror = true; + setRotation(SegmentLBMid, 0F, 0F, 0F); + SegmentLFMid = new ModelRenderer(this, 48, 19); + SegmentLFMid.addBox(0F, 0F, 0F, 1, 6, 1); + SegmentLFMid.setRotationPoint(3F, 13F, -4F); + SegmentLFMid.setTextureSize(64, 32); + SegmentLFMid.mirror = true; + setRotation(SegmentLFMid, 0F, 0F, 0F); + SegmentRBMid = new ModelRenderer(this, 48, 19); + SegmentRBMid.addBox(0F, 0F, 0F, 1, 6, 1); + SegmentRBMid.setRotationPoint(-4F, 13F, 3F); + SegmentRBMid.setTextureSize(64, 32); + SegmentRBMid.mirror = true; + setRotation(SegmentRBMid, 0F, 0F, 0F); + SegmentRFMid = new ModelRenderer(this, 48, 19); + SegmentRFMid.addBox(0F, 0F, 0F, 1, 6, 1); + SegmentRFMid.setRotationPoint(-4F, 13F, -4F); + SegmentRFMid.setTextureSize(64, 32); + SegmentRFMid.mirror = true; + setRotation(SegmentRFMid, 0F, 0F, 0F); + SegmentMidDiag4.mirror = true; + SegmentMidDiag4 = new ModelRenderer(this, 0, 0); + SegmentMidDiag4.addBox(0F, 0F, 0F, 1, 1, 10); + SegmentMidDiag4.setRotationPoint(-3.99F, 12F, -3F); + SegmentMidDiag4.setTextureSize(64, 32); + SegmentMidDiag4.mirror = true; + setRotation(SegmentMidDiag4, -0.7853982F, 0F, 0F); + SegmentMidDiag4.mirror = false; + SegmentRUMid = new ModelRenderer(this, 48, 12); + SegmentRUMid.addBox(0F, 0F, 0F, 1, 1, 6); + SegmentRUMid.setRotationPoint(-4F, 12F, -3F); + SegmentRUMid.setTextureSize(64, 32); + SegmentRUMid.mirror = true; + setRotation(SegmentRUMid, 0F, 0F, 0F); + SegmentBRMid = new ModelRenderer(this, 48, 12); + SegmentBRMid.addBox(0F, 0F, 0F, 1, 1, 6); + SegmentBRMid.setRotationPoint(-4F, 19F, -3F); + SegmentBRMid.setTextureSize(64, 32); + SegmentBRMid.mirror = true; + setRotation(SegmentBRMid, 0F, 0F, 0F); + SegmentBLMid = new ModelRenderer(this, 48, 12); + SegmentBLMid.addBox(0F, 0F, 0F, 1, 1, 6); + SegmentBLMid.setRotationPoint(3F, 19F, -3F); + SegmentBLMid.setTextureSize(64, 32); + SegmentBLMid.mirror = true; + setRotation(SegmentBLMid, 0F, 0F, 0F); + SegmentLUMid = new ModelRenderer(this, 48, 12); + SegmentLUMid.addBox(0F, 0F, 0F, 1, 1, 6); + SegmentLUMid.setRotationPoint(3F, 12F, -3F); + SegmentLUMid.setTextureSize(64, 32); + SegmentLUMid.mirror = true; + setRotation(SegmentLUMid, 0F, 0F, 0F); + SegmentMidDiag3 = new ModelRenderer(this, 0, 0); + SegmentMidDiag3.addBox(0F, 0F, 0F, 1, 1, 10); + SegmentMidDiag3.setRotationPoint(-4F, 19F, -4F); + SegmentMidDiag3.setTextureSize(64, 32); + SegmentMidDiag3.mirror = true; + setRotation(SegmentMidDiag3, 0.7853982F, 0F, 0F); + SegmentMidDiag7 = new ModelRenderer(this, 0, 0); + SegmentMidDiag7.addBox(0F, 0F, 0F, 1, 1, 10); + SegmentMidDiag7.setRotationPoint(-2.99F, 12F, 4F); + SegmentMidDiag7.setTextureSize(64, 32); + SegmentMidDiag7.mirror = true; + setRotation(SegmentMidDiag7, -0.7853982F, 1.570796F, 0F); + SegmentMidDiag8 = new ModelRenderer(this, 0, 0); + SegmentMidDiag8.addBox(0F, 0F, 0F, 1, 1, 10); + SegmentMidDiag8.setRotationPoint(-4F, 19F, 4F); + SegmentMidDiag8.setTextureSize(64, 32); + SegmentMidDiag8.mirror = true; + setRotation(SegmentMidDiag8, 0.7853982F, 1.570796F, 0F); + SegmentMidDiag1 = new ModelRenderer(this, 0, 0); + SegmentMidDiag1.addBox(0F, 0F, 0F, 1, 1, 10); + SegmentMidDiag1.setRotationPoint(3F, 19F, -4F); + SegmentMidDiag1.setTextureSize(64, 32); + SegmentMidDiag1.mirror = true; + setRotation(SegmentMidDiag1, 0.7853982F, 0F, 0F); + SegmentMidDiag2 = new ModelRenderer(this, 0, 0); + SegmentMidDiag2.addBox(0F, 0F, 0F, 1, 1, 10); + SegmentMidDiag2.setRotationPoint(3.01F, 12F, -3F); + SegmentMidDiag2.setTextureSize(64, 32); + SegmentMidDiag2.mirror = true; + setRotation(SegmentMidDiag2, -0.7853982F, 0F, 0F); + SegmentMidDiag6 = new ModelRenderer(this, 0, 0); + SegmentMidDiag6.addBox(0F, 0F, 0F, 1, 1, 10); + SegmentMidDiag6.setRotationPoint(-4F, 19F, -3F); + SegmentMidDiag6.setTextureSize(64, 32); + SegmentMidDiag6.mirror = true; + setRotation(SegmentMidDiag6, 0.7853982F, 1.570796F, 0F); + SegmentMidDiag5 = new ModelRenderer(this, 0, 0); + SegmentMidDiag5.addBox(0F, 0F, 0F, 1, 1, 10); + SegmentMidDiag5.setRotationPoint(-2.99F, 12F, -3F); + SegmentMidDiag5.setTextureSize(64, 32); + SegmentMidDiag5.mirror = true; + setRotation(SegmentMidDiag5, -0.7853982F, 1.570796F, 0F); + SegmentUBLeft = new ModelRenderer(this, 0, 13); + SegmentUBLeft.addBox(0F, 0F, 0F, 4, 1, 1); + SegmentUBLeft.setRotationPoint(4F, 12F, 3F); + SegmentUBLeft.setTextureSize(64, 32); + SegmentUBLeft.mirror = true; + setRotation(SegmentUBLeft, 0F, 0F, 0F); + SegmentUFLeft = new ModelRenderer(this, 0, 13); + SegmentUFLeft.addBox(0F, 0F, 0F, 4, 1, 1); + SegmentUFLeft.setRotationPoint(4F, 12F, -4F); + SegmentUFLeft.setTextureSize(64, 32); + SegmentUFLeft.mirror = true; + setRotation(SegmentUFLeft, 0F, 0F, 0F); + SegmentBFLeft = new ModelRenderer(this, 0, 13); + SegmentBFLeft.addBox(0F, 0F, 0F, 4, 1, 1); + SegmentBFLeft.setRotationPoint(4F, 19F, -4F); + SegmentBFLeft.setTextureSize(64, 32); + SegmentBFLeft.mirror = true; + setRotation(SegmentBFLeft, 0F, 0F, 0F); + SegmentBBLeft = new ModelRenderer(this, 0, 13); + SegmentBBLeft.addBox(0F, 0F, 0F, 4, 1, 1); + SegmentBBLeft.setRotationPoint(4F, 19F, 3F); + SegmentBBLeft.setTextureSize(64, 32); + SegmentBBLeft.mirror = true; + setRotation(SegmentBBLeft, 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); + SegmentBLBack.render(f5); + SegmentLUBack.render(f5); + SegmentRUBack.render(f5); + SegmentBRBack.render(f5); + SegmentBLFront.render(f5); + SegmentLUFront.render(f5); + SegmentRUFront.render(f5); + SegmentBRFront.render(f5); + SegmentLBUp.render(f5); + SegmentRBUp.render(f5); + SegmentLFUp.render(f5); + SegmentRFUp.render(f5); + SegmentUBRight.render(f5); + SegmentBFRight.render(f5); + SegmentUFRight.render(f5); + SegmentBBRight.render(f5); + SegmentLFDown.render(f5); + SegmentLBDown.render(f5); + SegmentRBDown.render(f5); + FootTop.render(f5); + SegmentRFDown.render(f5); + FootBottom.render(f5); + SegmentBFMid.render(f5); + SegmentUBMid.render(f5); + SegmentBBMid.render(f5); + SegmentUFMid.render(f5); + SegmentLBMid.render(f5); + SegmentLFMid.render(f5); + SegmentRBMid.render(f5); + SegmentRFMid.render(f5); + SegmentMidDiag4.render(f5); + SegmentRUMid.render(f5); + SegmentBRMid.render(f5); + SegmentBLMid.render(f5); + SegmentLUMid.render(f5); + SegmentMidDiag3.render(f5); + SegmentMidDiag7.render(f5); + SegmentMidDiag8.render(f5); + SegmentMidDiag1.render(f5); + SegmentMidDiag2.render(f5); + SegmentMidDiag6.render(f5); + SegmentMidDiag5.render(f5); + SegmentUBLeft.render(f5); + SegmentUFLeft.render(f5); + SegmentBFLeft.render(f5); + SegmentBBLeft.render(f5); + } + + 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); + } + +} diff --git a/models/CraneRails.tcn b/models/CraneRails.tcn new file mode 100644 index 0000000000000000000000000000000000000000..be8ef2cd7e3972424babd4e4cd1cadd22400d054 GIT binary patch literal 1383 zcmWIWW@Zs#U|`^2u-)eAlv;DAc{K|I!>>vP22KVQhTQy=)EvEv+#D_j1)w4Z21W)6 z29C?FB3|t07}4psbEETTdkHk$*ZyiBQP)81D+GvzP!3DK99mdsQ8sn^}dY8vhr?{W1@tkeXH_1pe?Om6z4 z<0n~ZzW3~(mWn!&>&oWGQ|#B4uH5$c`4h8mpYN>urtRwe%lgKPT7{R5A~)Bkwe;=G zl$nqd^vCMbbx!fy7dX7;!??D6}xv*RKb zZF?vGM|q_$tJ=)fUKt(F&Ma8AtxYjcbbiMwnKw+9A9$19d{w8etlnflVM#&Qb+gml z^IX{X?+obo-|PR)@MLb}g8DD9FL~_u-v2aZu5bDG9JP7(%6-p&&f1@~p_u7XaC$=R zndvFhr>*}o_r^N;>F=Yn-+0~ctqWQpb#-&a(o*r%$XT&kX3Da6>kk>IADw@B#nQfW z&rSMQExyijRHVc^i_NMlE^5oVH0AOy?-t)b62`K0OK5KSv+L=nUM~(zalELr()Pw9 zzf}j4Pd&lN;I zT`B3_HF*p62o5RZV=vQ}@jrg0Aj#0gA?flezf!UAsZwWyr%vpm6YJzzXS(ovw)iAH z6?Sh_x-4>~`x}2x^kV7ff{Ra7Mb}4M6HonlUW;+TlJCj26CT}nm3VkKW7Fq73o`F0 z^eQg^I^T_*`71|;$#H=dGoLLv{l)#z4#QV*w_PsW{>A*AF+s2>n58ojUc{jUT zi{&?joqyRqPnbT6m7jb?cX&tn*s6h6z*a#91AEBG;P%2`Q}j__$TsUVrB94qEN9j&&2#BNWXg^fPU&N!R&EyzvbH3o-Pkwh zyK|uab>H}ZtB-XkRftG_>rvSJVqrAP*(Axul^?t1ejOFuaH2DLiH4qX{d(nop30bX z^)`zv^JS5t2DNtfqQy1`vL3VjRWA8|WAd@Oe-o=t?EClesdTU0Ar4u$ z$QQ-KeT7ea%Zk=IlVY4{Az87PIuPl zQiGiiY7dQW{?0qHzTKU*lI8T`WAP`#1l@O7+&jVLU;9Doq@@z4*va$~`FQ^m^Asl( zG=|LI9bus}#izb;vy$TH=jp1zmq=6csJjNfET^-gC$4 z!a)IBCNXz`MeBnCy?0fyZTPCV@BYuixkACMQ8~{}yIjee=aAz$_0E}V?ZL8tW5l=Y z=UytVp5l46xl?=PJ-fp{wiLcDcH8Iv_oD2FML&YpGkwzY zI-&RZ@S=;WEp_{M)jZn#*FM0Tkx7>Ucew{H>)-@QrC@+JD;uPwWMqg2GQI(eQw9bA DJFRSz literal 0 HcmV?d00001 diff --git a/resources/assemblyline/textures/craneRail.png b/resources/assemblyline/textures/craneRail.png new file mode 100644 index 0000000000000000000000000000000000000000..567cfebc4346415582b9c2ac4d1596b1d6eddc69 GIT binary patch literal 718 zcmV;<0x|uGP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0%J);K~!i%?N~og z!ax+i^E0>@9jNgWkT}qhiRj{oz=VXxjloG=bYL?ONM!XRm@pA07<43YF_gtc2fl&l zz1GwA=%05SZQ7IzFKLta_s4s8*B>R=RVR!bapg9lSQ8~Z@Q+!L17;!f+{5@vL&v_i z8GB?zNX4iG0@6S0Gj_xExY$=V4z!2@G6R5dZBX;hWP{0o(Mw8Z_AIp1%%REXEhVG( zk@kO+830r&nbxNiI-qgdpq0bmPQm)iB>?^ z-gtKkXmwg-N0I;!xdX7@TudHI{S-?e~fdr9O6CVH^F#cff|Je zAQHE@`+wZMKkB}ZJhj{okQ0#u2L*}>fCvtq0b>=lpxxbZidycdtt~_jj*Z)*9iQ+Q z_(>v#fB^0F?1aC69~;h&u31QavfDkrt#JffKH)F$lSDV8Y}yz87(@dAt?d;urH~c%95mmGhlGwIjneLGkD=F4`*;d7OMr( zB{95B<8;99IBqh6$^dL*!e<}hbk{cgtN2I-0HCe}ky$;iDvzB?L8`i`0N@<~cm`%y zHPNK>QvpCue*QU6svc#(sQ};|f!axp=<;~VRYn-7&tt~!0lHwM(gC_jCTYI|AW3xd z;2X^eielnO47q45hbQdf2@p9#2qA(*zwjgQ1065u!KUnD=>Px#07*qoM6N<$f)n9A AXaE2J literal 0 HcmV?d00001 diff --git a/src/minecraft/assemblyline/client/ClientProxy.java b/src/minecraft/assemblyline/client/ClientProxy.java index 2a125650..59aa808b 100644 --- a/src/minecraft/assemblyline/client/ClientProxy.java +++ b/src/minecraft/assemblyline/client/ClientProxy.java @@ -12,6 +12,7 @@ import assemblyline.client.render.BlockRenderingHandler; import assemblyline.client.render.RenderArmbot; import assemblyline.client.render.RenderConveyorBelt; import assemblyline.client.render.RenderCraneController; +import assemblyline.client.render.RenderCraneRail; import assemblyline.client.render.RenderCrate; import assemblyline.client.render.RenderDetector; import assemblyline.client.render.RenderManipulator; @@ -24,6 +25,7 @@ import assemblyline.common.machine.TileEntityRejector; import assemblyline.common.machine.armbot.TileEntityArmbot; import assemblyline.common.machine.belt.TileEntityConveyorBelt; import assemblyline.common.machine.crane.TileEntityCraneController; +import assemblyline.common.machine.crane.TileEntityCraneRail; import assemblyline.common.machine.detector.TileEntityDetector; import assemblyline.common.machine.encoder.TileEntityEncoder; import assemblyline.common.machine.imprinter.TileEntityImprinter; @@ -53,6 +55,7 @@ public class ClientProxy extends CommonProxy ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCrate.class, new RenderCrate()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityArmbot.class, new RenderArmbot()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCraneController.class, new RenderCraneController()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCraneRail.class, new RenderCraneRail()); } @Override diff --git a/src/minecraft/assemblyline/client/model/ModelCraneController.java b/src/minecraft/assemblyline/client/model/ModelCraneController.java index 5e3463f1..c872908d 100644 --- a/src/minecraft/assemblyline/client/model/ModelCraneController.java +++ b/src/minecraft/assemblyline/client/model/ModelCraneController.java @@ -99,9 +99,9 @@ public class ModelCraneController extends ModelBase setRotation(Decoration4, 0F, 0F, 0F); ConnectorTop.setRotationPoint(-4F, 16F, -4F); setRotation(ConnectorTop, 0F, 0F, -1.570796F); - ConnectorFront.setRotationPoint(-4F, 12F, -0.01F); + ConnectorFront.setRotationPoint(-4F, 11.99F, -0.01F); setRotation(ConnectorFront, 0F, 1.570796F, 0F); - ConnectorRight.setRotationPoint(0.01F, 12F, -4F); + ConnectorRight.setRotationPoint(0.01F, 11.99F, -4F); setRotation(ConnectorRight, 0F, 0F, 0F); Base2.render(scale); diff --git a/src/minecraft/assemblyline/client/model/ModelCraneRail.java b/src/minecraft/assemblyline/client/model/ModelCraneRail.java new file mode 100644 index 00000000..4e45fc98 --- /dev/null +++ b/src/minecraft/assemblyline/client/model/ModelCraneRail.java @@ -0,0 +1,476 @@ +package assemblyline.client.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelCraneRail extends ModelBase +{ + // left + ModelRenderer SegmentUBLeft; + ModelRenderer SegmentUFLeft; + ModelRenderer SegmentBFLeft; + ModelRenderer SegmentBBLeft; + // back + ModelRenderer SegmentBLBack; + ModelRenderer SegmentLUBack; + ModelRenderer SegmentRUBack; + ModelRenderer SegmentBRBack; + // front + ModelRenderer SegmentBLFront; + ModelRenderer SegmentLUFront; + ModelRenderer SegmentRUFront; + ModelRenderer SegmentBRFront; + // up + ModelRenderer SegmentLBUp; + ModelRenderer SegmentRBUp; + ModelRenderer SegmentLFUp; + ModelRenderer SegmentRFUp; + // right + ModelRenderer SegmentUBRight; + ModelRenderer SegmentBFRight; + ModelRenderer SegmentUFRight; + ModelRenderer SegmentBBRight; + // down + ModelRenderer SegmentLFDown; + ModelRenderer SegmentLBDown; + ModelRenderer SegmentRBDown; + ModelRenderer SegmentRFDown; + + // middle + ModelRenderer SegmentBFMid; + ModelRenderer SegmentUBMid; + ModelRenderer SegmentBBMid; + ModelRenderer SegmentUFMid; + ModelRenderer SegmentLBMid; + ModelRenderer SegmentLFMid; + ModelRenderer SegmentRBMid; + ModelRenderer SegmentRFMid; + ModelRenderer SegmentRUMid; + ModelRenderer SegmentBRMid; + ModelRenderer SegmentBLMid; + ModelRenderer SegmentLUMid; + ModelRenderer SegmentMidDiag1; + ModelRenderer SegmentMidDiag2; + ModelRenderer SegmentMidDiag3; + ModelRenderer SegmentMidDiag4; + ModelRenderer SegmentMidDiag5; + ModelRenderer SegmentMidDiag6; + ModelRenderer SegmentMidDiag7; + ModelRenderer SegmentMidDiag8; + ModelRenderer FootBottom; + ModelRenderer FootTop; + + public ModelCraneRail() + { + textureWidth = 64; + textureHeight = 32; + + SegmentBLBack = new ModelRenderer(this, 10, 13); + SegmentBLBack.addBox(0F, 0F, 0F, 1, 1, 4); + SegmentBLBack.setRotationPoint(3F, 19F, 4F); + SegmentBLBack.setTextureSize(64, 32); + SegmentBLBack.mirror = true; + setRotation(SegmentBLBack, 0F, 0F, 0F); + SegmentLUBack = new ModelRenderer(this, 10, 13); + SegmentLUBack.addBox(0F, 0F, 0F, 1, 1, 4); + SegmentLUBack.setRotationPoint(3F, 12F, 4F); + SegmentLUBack.setTextureSize(64, 32); + SegmentLUBack.mirror = true; + setRotation(SegmentLUBack, 0F, 0F, 0F); + SegmentRUBack = new ModelRenderer(this, 10, 13); + SegmentRUBack.addBox(0F, 0F, 0F, 1, 1, 4); + SegmentRUBack.setRotationPoint(-4F, 12F, 4F); + SegmentRUBack.setTextureSize(64, 32); + SegmentRUBack.mirror = true; + setRotation(SegmentRUBack, 0F, 0F, 0F); + SegmentBRBack = new ModelRenderer(this, 10, 13); + SegmentBRBack.addBox(0F, 0F, 0F, 1, 1, 4); + SegmentBRBack.setRotationPoint(-4F, 19F, 4F); + SegmentBRBack.setTextureSize(64, 32); + SegmentBRBack.mirror = true; + setRotation(SegmentBRBack, 0F, 0F, 0F); + SegmentBLFront = new ModelRenderer(this, 10, 13); + SegmentBLFront.addBox(0F, 0F, 0F, 1, 1, 4); + SegmentBLFront.setRotationPoint(3F, 19F, -8F); + SegmentBLFront.setTextureSize(64, 32); + SegmentBLFront.mirror = true; + setRotation(SegmentBLFront, 0F, 0F, 0F); + SegmentLUFront = new ModelRenderer(this, 10, 13); + SegmentLUFront.addBox(0F, 0F, 0F, 1, 1, 4); + SegmentLUFront.setRotationPoint(3F, 12F, -8F); + SegmentLUFront.setTextureSize(64, 32); + SegmentLUFront.mirror = true; + setRotation(SegmentLUFront, 0F, 0F, 0F); + SegmentRUFront = new ModelRenderer(this, 10, 13); + SegmentRUFront.addBox(0F, 0F, 0F, 1, 1, 4); + SegmentRUFront.setRotationPoint(-4F, 12F, -8F); + SegmentRUFront.setTextureSize(64, 32); + SegmentRUFront.mirror = true; + setRotation(SegmentRUFront, 0F, 0F, 0F); + SegmentBRFront = new ModelRenderer(this, 10, 13); + SegmentBRFront.addBox(0F, 0F, 0F, 1, 1, 4); + SegmentBRFront.setRotationPoint(-4F, 19F, -8F); + SegmentBRFront.setTextureSize(64, 32); + SegmentBRFront.mirror = true; + setRotation(SegmentBRFront, 0F, 0F, 0F); + SegmentLBUp = new ModelRenderer(this, 20, 13); + SegmentLBUp.addBox(0F, 0F, 0F, 1, 4, 1); + SegmentLBUp.setRotationPoint(3F, 8F, 3F); + SegmentLBUp.setTextureSize(64, 32); + SegmentLBUp.mirror = true; + setRotation(SegmentLBUp, 0F, 0F, 0F); + SegmentRBUp = new ModelRenderer(this, 20, 13); + SegmentRBUp.addBox(0F, 0F, 0F, 1, 4, 1); + SegmentRBUp.setRotationPoint(-4F, 8F, 3F); + SegmentRBUp.setTextureSize(64, 32); + SegmentRBUp.mirror = true; + setRotation(SegmentRBUp, 0F, 0F, 0F); + SegmentLFUp = new ModelRenderer(this, 20, 13); + SegmentLFUp.addBox(0F, 0F, 0F, 1, 4, 1); + SegmentLFUp.setRotationPoint(3F, 8F, -4F); + SegmentLFUp.setTextureSize(64, 32); + SegmentLFUp.mirror = true; + setRotation(SegmentLFUp, 0F, 0F, 0F); + SegmentRFUp = new ModelRenderer(this, 20, 13); + SegmentRFUp.addBox(0F, 0F, 0F, 1, 4, 1); + SegmentRFUp.setRotationPoint(-4F, 8F, -4F); + SegmentRFUp.setTextureSize(64, 32); + SegmentRFUp.mirror = true; + setRotation(SegmentRFUp, 0F, 0F, 0F); + SegmentUBRight = new ModelRenderer(this, 0, 13); + SegmentUBRight.addBox(0F, 0F, 0F, 4, 1, 1); + SegmentUBRight.setRotationPoint(-8F, 12F, 3F); + SegmentUBRight.setTextureSize(64, 32); + SegmentUBRight.mirror = true; + setRotation(SegmentUBRight, 0F, 0F, 0F); + SegmentBFRight = new ModelRenderer(this, 0, 13); + SegmentBFRight.addBox(0F, 0F, 0F, 4, 1, 1); + SegmentBFRight.setRotationPoint(-8F, 19F, -4F); + SegmentBFRight.setTextureSize(64, 32); + SegmentBFRight.mirror = true; + setRotation(SegmentBFRight, 0F, 0F, 0F); + SegmentUFRight = new ModelRenderer(this, 0, 13); + SegmentUFRight.addBox(0F, 0F, 0F, 4, 1, 1); + SegmentUFRight.setRotationPoint(-8F, 12F, -4F); + SegmentUFRight.setTextureSize(64, 32); + SegmentUFRight.mirror = true; + setRotation(SegmentUFRight, 0F, 0F, 0F); + SegmentBBRight = new ModelRenderer(this, 0, 13); + SegmentBBRight.addBox(0F, 0F, 0F, 4, 1, 1); + SegmentBBRight.setRotationPoint(-8F, 19F, 3F); + SegmentBBRight.setTextureSize(64, 32); + SegmentBBRight.mirror = true; + setRotation(SegmentBBRight, 0F, 0F, 0F); + SegmentLFDown = new ModelRenderer(this, 20, 13); + SegmentLFDown.addBox(0F, 0F, 0F, 1, 4, 1); + SegmentLFDown.setRotationPoint(3F, 20F, -4F); + SegmentLFDown.setTextureSize(64, 32); + SegmentLFDown.mirror = true; + setRotation(SegmentLFDown, 0F, 0F, 0F); + SegmentLBDown = new ModelRenderer(this, 20, 13); + SegmentLBDown.addBox(0F, 0F, 0F, 1, 4, 1); + SegmentLBDown.setRotationPoint(3F, 20F, 3F); + SegmentLBDown.setTextureSize(64, 32); + SegmentLBDown.mirror = true; + setRotation(SegmentLBDown, 0F, 0F, 0F); + SegmentRBDown = new ModelRenderer(this, 20, 13); + SegmentRBDown.addBox(0F, 0F, 0F, 1, 4, 1); + SegmentRBDown.setRotationPoint(-4F, 20F, 3F); + SegmentRBDown.setTextureSize(64, 32); + SegmentRBDown.mirror = true; + setRotation(SegmentRBDown, 0F, 0F, 0F); + FootTop = new ModelRenderer(this, 24, 0); + FootTop.addBox(0F, 0F, 0F, 10, 2, 10); + FootTop.setRotationPoint(-5F, 20F, -5F); + FootTop.setTextureSize(64, 32); + FootTop.mirror = true; + setRotation(FootTop, 0F, 0F, 0F); + SegmentRFDown = new ModelRenderer(this, 20, 13); + SegmentRFDown.addBox(0F, 0F, 0F, 1, 4, 1); + SegmentRFDown.setRotationPoint(-4F, 20F, -4F); + SegmentRFDown.setTextureSize(64, 32); + SegmentRFDown.mirror = true; + setRotation(SegmentRFDown, 0F, 0F, 0F); + FootBottom = new ModelRenderer(this, 0, 18); + FootBottom.addBox(0F, 0F, 0F, 12, 2, 12); + FootBottom.setRotationPoint(-6F, 22F, -6F); + FootBottom.setTextureSize(64, 32); + FootBottom.mirror = true; + setRotation(FootBottom, 0F, 0F, 0F); + SegmentBFMid = new ModelRenderer(this, 30, 12); + SegmentBFMid.addBox(0F, 0F, 0F, 8, 1, 1); + SegmentBFMid.setRotationPoint(-4F, 19F, -4F); + SegmentBFMid.setTextureSize(64, 32); + SegmentBFMid.mirror = true; + setRotation(SegmentBFMid, 0F, 0F, 0F); + SegmentUBMid = new ModelRenderer(this, 30, 12); + SegmentUBMid.addBox(0F, 0F, 0F, 8, 1, 1); + SegmentUBMid.setRotationPoint(-4F, 12F, 3F); + SegmentUBMid.setTextureSize(64, 32); + SegmentUBMid.mirror = true; + setRotation(SegmentUBMid, 0F, 0F, 0F); + SegmentBBMid = new ModelRenderer(this, 30, 12); + SegmentBBMid.addBox(0F, 0F, 0F, 8, 1, 1); + SegmentBBMid.setRotationPoint(-4F, 19F, 3F); + SegmentBBMid.setTextureSize(64, 32); + SegmentBBMid.mirror = true; + setRotation(SegmentBBMid, 0F, 0F, 0F); + SegmentUFMid = new ModelRenderer(this, 30, 12); + SegmentUFMid.addBox(0F, 0F, 0F, 8, 1, 1); + SegmentUFMid.setRotationPoint(-4F, 12F, -4F); + SegmentUFMid.setTextureSize(64, 32); + SegmentUFMid.mirror = true; + setRotation(SegmentUFMid, 0F, 0F, 0F); + SegmentLBMid = new ModelRenderer(this, 48, 19); + SegmentLBMid.addBox(0F, 0F, 0F, 1, 6, 1); + SegmentLBMid.setRotationPoint(3F, 13F, 3F); + SegmentLBMid.setTextureSize(64, 32); + SegmentLBMid.mirror = true; + setRotation(SegmentLBMid, 0F, 0F, 0F); + SegmentLFMid = new ModelRenderer(this, 48, 19); + SegmentLFMid.addBox(0F, 0F, 0F, 1, 6, 1); + SegmentLFMid.setRotationPoint(3F, 13F, -4F); + SegmentLFMid.setTextureSize(64, 32); + SegmentLFMid.mirror = true; + setRotation(SegmentLFMid, 0F, 0F, 0F); + SegmentRBMid = new ModelRenderer(this, 48, 19); + SegmentRBMid.addBox(0F, 0F, 0F, 1, 6, 1); + SegmentRBMid.setRotationPoint(-4F, 13F, 3F); + SegmentRBMid.setTextureSize(64, 32); + SegmentRBMid.mirror = true; + setRotation(SegmentRBMid, 0F, 0F, 0F); + SegmentRFMid = new ModelRenderer(this, 48, 19); + SegmentRFMid.addBox(0F, 0F, 0F, 1, 6, 1); + SegmentRFMid.setRotationPoint(-4F, 13F, -4F); + SegmentRFMid.setTextureSize(64, 32); + SegmentRFMid.mirror = true; + setRotation(SegmentRFMid, 0F, 0F, 0F); + SegmentMidDiag4 = new ModelRenderer(this, 0, 0); + SegmentMidDiag4.addBox(0F, 0F, 0F, 1, 1, 10); + SegmentMidDiag4.setRotationPoint(-3.99F, 12F, -3F); + SegmentMidDiag4.setTextureSize(64, 32); + SegmentMidDiag4.mirror = true; + setRotation(SegmentMidDiag4, -0.7853982F, 0F, 0F); + SegmentRUMid = new ModelRenderer(this, 48, 12); + SegmentRUMid.addBox(0F, 0F, 0F, 1, 1, 6); + SegmentRUMid.setRotationPoint(-4F, 12F, -3F); + SegmentRUMid.setTextureSize(64, 32); + SegmentRUMid.mirror = true; + setRotation(SegmentRUMid, 0F, 0F, 0F); + SegmentBRMid = new ModelRenderer(this, 48, 12); + SegmentBRMid.addBox(0F, 0F, 0F, 1, 1, 6); + SegmentBRMid.setRotationPoint(-4F, 19F, -3F); + SegmentBRMid.setTextureSize(64, 32); + SegmentBRMid.mirror = true; + setRotation(SegmentBRMid, 0F, 0F, 0F); + SegmentBLMid = new ModelRenderer(this, 48, 12); + SegmentBLMid.addBox(0F, 0F, 0F, 1, 1, 6); + SegmentBLMid.setRotationPoint(3F, 19F, -3F); + SegmentBLMid.setTextureSize(64, 32); + SegmentBLMid.mirror = true; + setRotation(SegmentBLMid, 0F, 0F, 0F); + SegmentLUMid = new ModelRenderer(this, 48, 12); + SegmentLUMid.addBox(0F, 0F, 0F, 1, 1, 6); + SegmentLUMid.setRotationPoint(3F, 12F, -3F); + SegmentLUMid.setTextureSize(64, 32); + SegmentLUMid.mirror = true; + setRotation(SegmentLUMid, 0F, 0F, 0F); + SegmentMidDiag3 = new ModelRenderer(this, 0, 0); + SegmentMidDiag3.addBox(0F, 0F, 0F, 1, 1, 10); + SegmentMidDiag3.setRotationPoint(-4F, 19F, -4F); + SegmentMidDiag3.setTextureSize(64, 32); + SegmentMidDiag3.mirror = true; + setRotation(SegmentMidDiag3, 0.7853982F, 0F, 0F); + SegmentMidDiag7 = new ModelRenderer(this, 0, 0); + SegmentMidDiag7.addBox(0F, 0F, 0F, 1, 1, 10); + SegmentMidDiag7.setRotationPoint(-2.99F, 12F, 4F); + SegmentMidDiag7.setTextureSize(64, 32); + SegmentMidDiag7.mirror = true; + setRotation(SegmentMidDiag7, -0.7853982F, 1.570796F, 0F); + SegmentMidDiag8 = new ModelRenderer(this, 0, 0); + SegmentMidDiag8.addBox(0F, 0F, 0F, 1, 1, 10); + SegmentMidDiag8.setRotationPoint(-4F, 19F, 4F); + SegmentMidDiag8.setTextureSize(64, 32); + SegmentMidDiag8.mirror = true; + setRotation(SegmentMidDiag8, 0.7853982F, 1.570796F, 0F); + SegmentMidDiag1 = new ModelRenderer(this, 0, 0); + SegmentMidDiag1.addBox(0F, 0F, 0F, 1, 1, 10); + SegmentMidDiag1.setRotationPoint(3F, 19F, -4F); + SegmentMidDiag1.setTextureSize(64, 32); + SegmentMidDiag1.mirror = true; + setRotation(SegmentMidDiag1, 0.7853982F, 0F, 0F); + SegmentMidDiag2 = new ModelRenderer(this, 0, 0); + SegmentMidDiag2.addBox(0F, 0F, 0F, 1, 1, 10); + SegmentMidDiag2.setRotationPoint(3.01F, 12F, -3F); + SegmentMidDiag2.setTextureSize(64, 32); + SegmentMidDiag2.mirror = true; + setRotation(SegmentMidDiag2, -0.7853982F, 0F, 0F); + SegmentMidDiag6 = new ModelRenderer(this, 0, 0); + SegmentMidDiag6.addBox(0F, 0F, 0F, 1, 1, 10); + SegmentMidDiag6.setRotationPoint(-4F, 19F, -3F); + SegmentMidDiag6.setTextureSize(64, 32); + SegmentMidDiag6.mirror = true; + setRotation(SegmentMidDiag6, 0.7853982F, 1.570796F, 0F); + SegmentMidDiag5 = new ModelRenderer(this, 0, 0); + SegmentMidDiag5.addBox(0F, 0F, 0F, 1, 1, 10); + SegmentMidDiag5.setRotationPoint(-2.99F, 12F, -3F); + SegmentMidDiag5.setTextureSize(64, 32); + SegmentMidDiag5.mirror = true; + setRotation(SegmentMidDiag5, -0.7853982F, 1.570796F, 0F); + SegmentUBLeft = new ModelRenderer(this, 0, 13); + SegmentUBLeft.addBox(0F, 0F, 0F, 4, 1, 1); + SegmentUBLeft.setRotationPoint(4F, 12F, 3F); + SegmentUBLeft.setTextureSize(64, 32); + SegmentUBLeft.mirror = true; + setRotation(SegmentUBLeft, 0F, 0F, 0F); + SegmentUFLeft = new ModelRenderer(this, 0, 13); + SegmentUFLeft.addBox(0F, 0F, 0F, 4, 1, 1); + SegmentUFLeft.setRotationPoint(4F, 12F, -4F); + SegmentUFLeft.setTextureSize(64, 32); + SegmentUFLeft.mirror = true; + setRotation(SegmentUFLeft, 0F, 0F, 0F); + SegmentBFLeft = new ModelRenderer(this, 0, 13); + SegmentBFLeft.addBox(0F, 0F, 0F, 4, 1, 1); + SegmentBFLeft.setRotationPoint(4F, 19F, -4F); + SegmentBFLeft.setTextureSize(64, 32); + SegmentBFLeft.mirror = true; + setRotation(SegmentBFLeft, 0F, 0F, 0F); + SegmentBBLeft = new ModelRenderer(this, 0, 13); + SegmentBBLeft.addBox(0F, 0F, 0F, 4, 1, 1); + SegmentBBLeft.setRotationPoint(4F, 19F, 3F); + SegmentBBLeft.setTextureSize(64, 32); + SegmentBBLeft.mirror = true; + setRotation(SegmentBBLeft, 0F, 0F, 0F); + fixPositions(); + } + + // this offsets some positions to avoid Z-Fighting + public void fixPositions() + { + SegmentBLBack.setRotationPoint(3F, 19F, 4F); + SegmentLUBack.setRotationPoint(3F, 12F, 4F); + SegmentRUBack.setRotationPoint(-4F, 12F, 4F); + SegmentBRBack.setRotationPoint(-4F, 19F, 4F); + SegmentBLFront.setRotationPoint(3F, 19F, -8F); + SegmentLUFront.setRotationPoint(3F, 12F, -8F); + SegmentRUFront.setRotationPoint(-4F, 12F, -8F); + SegmentBRFront.setRotationPoint(-4F, 19F, -8F); + SegmentLBUp.setRotationPoint(3F, 8F, 3F); + SegmentRBUp.setRotationPoint(-4F, 8F, 3F); + SegmentLFUp.setRotationPoint(3F, 8F, -4F); + SegmentRFUp.setRotationPoint(-4F, 8F, -4F); + SegmentUBRight.setRotationPoint(-8F, 12F, 3F); + SegmentBFRight.setRotationPoint(-8F, 19F, -4F); + SegmentUFRight.setRotationPoint(-8F, 12F, -4F); + SegmentBBRight.setRotationPoint(-8F, 19F, 3F); + SegmentLFDown.setRotationPoint(3F, 20F, -4F); + SegmentLBDown.setRotationPoint(3F, 20F, 3F); + SegmentRBDown.setRotationPoint(-4F, 20F, 3F); + SegmentRFDown.setRotationPoint(-4F, 20F, -4F); + SegmentBFMid.setRotationPoint(-4F, 19F, -4F); + SegmentUBMid.setRotationPoint(-4F, 12F, 3F); + SegmentBBMid.setRotationPoint(-4F, 19F, 3F); + SegmentUFMid.setRotationPoint(-4F, 12F, -4F); + SegmentLBMid.setRotationPoint(3F, 13F, 3F); + SegmentLFMid.setRotationPoint(3F, 13F, -4F); + SegmentRBMid.setRotationPoint(-4F, 13F, 3F); + SegmentRFMid.setRotationPoint(-4F, 13F, -4F); + SegmentRUMid.setRotationPoint(-4F, 12F, -3F); + SegmentBRMid.setRotationPoint(-4F, 19F, -3F); + SegmentBLMid.setRotationPoint(3F, 19F, -3F); + SegmentLUMid.setRotationPoint(3F, 12F, -3F); + SegmentMidDiag1.setRotationPoint(2.99F, 19.1F, -4F); + SegmentMidDiag2.setRotationPoint(2.99F, 12F, -3.1F); + SegmentMidDiag3.setRotationPoint(-3.99F, 19.1F, -4F); + SegmentMidDiag4.setRotationPoint(-3.99F, 12F, -3.1F); + SegmentMidDiag5.setRotationPoint(-3.1F, 12F, -2.99F); + SegmentMidDiag6.setRotationPoint(-4F, 19.1F, -2.99F); + SegmentMidDiag7.setRotationPoint(-3.1F, 12F, 3.99F); + SegmentMidDiag8.setRotationPoint(-4F, 19F, 3.99F); + SegmentUBLeft.setRotationPoint(4F, 12F, 3F); + SegmentUFLeft.setRotationPoint(4F, 12F, -4F); + SegmentBFLeft.setRotationPoint(4F, 19F, -4F); + SegmentBBLeft.setRotationPoint(4F, 19F, 3F); + } + + public void render(boolean up, boolean down, boolean left, boolean right, boolean front, boolean back, boolean foot) + { + float scale = 0.0625f; + if (up) + { + SegmentLBUp.render(scale); + SegmentRBUp.render(scale); + SegmentLFUp.render(scale); + SegmentRFUp.render(scale); + } + if (down) + { + SegmentLFDown.render(scale); + SegmentLBDown.render(scale); + SegmentRBDown.render(scale); + SegmentRFDown.render(scale); + } + if (left) + { + SegmentUBLeft.render(scale); + SegmentUFLeft.render(scale); + SegmentBFLeft.render(scale); + SegmentBBLeft.render(scale); + } + if (right) + { + SegmentUBRight.render(scale); + SegmentBFRight.render(scale); + SegmentUFRight.render(scale); + SegmentBBRight.render(scale); + } + if (front) + { + SegmentBLFront.render(scale); + SegmentLUFront.render(scale); + SegmentRUFront.render(scale); + SegmentBRFront.render(scale); + } + if (back) + { + SegmentBLBack.render(scale); + SegmentLUBack.render(scale); + SegmentRUBack.render(scale); + SegmentBRBack.render(scale); + } + if (foot) + { + FootBottom.render(scale); + FootTop.render(scale); + } + SegmentBFMid.render(scale); + SegmentUBMid.render(scale); + SegmentBBMid.render(scale); + SegmentUFMid.render(scale); + SegmentLBMid.render(scale); + SegmentLFMid.render(scale); + SegmentRBMid.render(scale); + SegmentRFMid.render(scale); + SegmentRUMid.render(scale); + SegmentBRMid.render(scale); + SegmentBLMid.render(scale); + SegmentLUMid.render(scale); + SegmentMidDiag1.render(scale); + SegmentMidDiag2.render(scale); + SegmentMidDiag3.render(scale); + SegmentMidDiag4.render(scale); + SegmentMidDiag5.render(scale); + SegmentMidDiag6.render(scale); + SegmentMidDiag7.render(scale); + SegmentMidDiag8.render(scale); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/minecraft/assemblyline/client/render/BlockRenderingHandler.java b/src/minecraft/assemblyline/client/render/BlockRenderingHandler.java index ccc4dfd3..fc508f1d 100644 --- a/src/minecraft/assemblyline/client/render/BlockRenderingHandler.java +++ b/src/minecraft/assemblyline/client/render/BlockRenderingHandler.java @@ -84,6 +84,15 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler RenderCraneController.MODEL.render(0.0625f); GL11.glPopMatrix(); } + else if (block.blockID == AssemblyLine.blockCraneRail.blockID){ + GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(AssemblyLine.TEXTURE_PATH + RenderCraneRail.TEXTURE)); + GL11.glPushMatrix(); + GL11.glTranslatef(0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 0f, 1f); + GL11.glRotatef(-90f, 0f, 1f, 0f); + RenderCraneRail.MODEL.render(true, true, false, false, false, false, false); + GL11.glPopMatrix(); + } } public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) diff --git a/src/minecraft/assemblyline/client/render/RenderCraneRail.java b/src/minecraft/assemblyline/client/render/RenderCraneRail.java new file mode 100644 index 00000000..f7075663 --- /dev/null +++ b/src/minecraft/assemblyline/client/render/RenderCraneRail.java @@ -0,0 +1,46 @@ +package assemblyline.client.render; + +import static org.lwjgl.opengl.GL11.*; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.ForgeDirection; +import assemblyline.client.model.ModelCraneRail; +import assemblyline.common.AssemblyLine; +import assemblyline.common.machine.crane.CraneHelper; +import assemblyline.common.machine.crane.TileEntityCraneRail; + +public class RenderCraneRail extends RenderImprintable +{ + public static final String TEXTURE = "craneRail.png"; + public static final ModelCraneRail MODEL = new ModelCraneRail(); + + @Override + public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) + { + if (tileEntity != null && tileEntity instanceof TileEntityCraneRail) + { + int tX, tY, tZ; + tX = tileEntity.xCoord; + tY = tileEntity.yCoord; + tZ = tileEntity.zCoord; + boolean renderUp = CraneHelper.canFrameConnectTo(tileEntity, tX, tY + 1, tZ, ForgeDirection.DOWN); + boolean renderDown = CraneHelper.canFrameConnectTo(tileEntity, tX, tY - 1, tZ, ForgeDirection.UP); + //EAST, X- + boolean renderLeft = CraneHelper.canFrameConnectTo(tileEntity, tX - 1, tY, tZ, ForgeDirection.EAST); + //WAST, X+ + boolean renderRight = CraneHelper.canFrameConnectTo(tileEntity, tX + 1, tY, tZ, ForgeDirection.WEST); + //SOUTH, Z- + boolean renderFront = CraneHelper.canFrameConnectTo(tileEntity, tX, tY, tZ - 1, ForgeDirection.SOUTH); + //NORTH, Z+ + boolean renderBack = CraneHelper.canFrameConnectTo(tileEntity, tX, tY, tZ + 1, ForgeDirection.NORTH); + boolean renderFoot = tileEntity.worldObj.isBlockSolidOnSide(tX, tY - 1, tZ, ForgeDirection.UP); + this.bindTextureByName(AssemblyLine.TEXTURE_PATH + TEXTURE); + glPushMatrix(); + glTranslated(x + 0.5, y + 1.5, z + 0.5); + glRotatef(180f, 0f, 0f, 1f); + glEnable(GL_LIGHTING); + MODEL.render(renderUp, renderDown && !renderFoot, renderLeft, renderRight, renderFront, renderBack, renderFoot); + glPopMatrix(); + } + } + +} \ No newline at end of file diff --git a/src/minecraft/assemblyline/common/CommonProxy.java b/src/minecraft/assemblyline/common/CommonProxy.java index bfdedf6e..816d59f8 100644 --- a/src/minecraft/assemblyline/common/CommonProxy.java +++ b/src/minecraft/assemblyline/common/CommonProxy.java @@ -16,6 +16,7 @@ import assemblyline.common.machine.TileEntityRejector; import assemblyline.common.machine.armbot.TileEntityArmbot; import assemblyline.common.machine.belt.TileEntityConveyorBelt; import assemblyline.common.machine.crane.TileEntityCraneController; +import assemblyline.common.machine.crane.TileEntityCraneRail; import assemblyline.common.machine.detector.TileEntityDetector; import assemblyline.common.machine.encoder.ContainerEncoder; import assemblyline.common.machine.encoder.TileEntityEncoder; @@ -45,6 +46,7 @@ public class CommonProxy implements IGuiHandler GameRegistry.registerTileEntity(TileEntityEncoder.class, "ALEncoder"); GameRegistry.registerTileEntity(TileEntityArmbot.class, "ALArmbot"); GameRegistry.registerTileEntity(TileEntityCraneController.class, "ALCraneController"); + GameRegistry.registerTileEntity(TileEntityCraneRail.class, "ALCraneRail"); GameRegistry.registerTileEntity(TileEntityImprinter.class, "ALImprinter"); GameRegistry.registerTileEntity(TileEntityMulti.class, "ALMulti"); } diff --git a/src/minecraft/assemblyline/common/machine/crane/BlockCraneController.java b/src/minecraft/assemblyline/common/machine/crane/BlockCraneController.java index 22db999a..e4bc7e3c 100644 --- a/src/minecraft/assemblyline/common/machine/crane/BlockCraneController.java +++ b/src/minecraft/assemblyline/common/machine/crane/BlockCraneController.java @@ -42,21 +42,25 @@ public class BlockCraneController extends BlockMachine { case 0: // WEST { + System.out.println("Facing west..."); world.setBlockMetadataWithNotify(x, y, z, ForgeDirection.WEST.ordinal()); break; } case 1: // NORTH { + System.out.println("Facing north..."); world.setBlockMetadataWithNotify(x, y, z, ForgeDirection.NORTH.ordinal()); break; } case 2: // EAST { + System.out.println("Facing east..."); world.setBlockMetadataWithNotify(x, y, z, ForgeDirection.EAST.ordinal()); break; } default: // SOUTH { + System.out.println("Facing south..."); world.setBlockMetadataWithNotify(x, y, z, ForgeDirection.SOUTH.ordinal()); break; } diff --git a/src/minecraft/assemblyline/common/machine/crane/BlockCraneRail.java b/src/minecraft/assemblyline/common/machine/crane/BlockCraneRail.java index c0ee1181..833c0535 100644 --- a/src/minecraft/assemblyline/common/machine/crane/BlockCraneRail.java +++ b/src/minecraft/assemblyline/common/machine/crane/BlockCraneRail.java @@ -1,16 +1,161 @@ package assemblyline.common.machine.crane; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.material.Material; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeDirection; import universalelectricity.prefab.BlockMachine; +import assemblyline.client.render.BlockRenderingHandler; +import assemblyline.common.TabAssemblyLine; public class BlockCraneRail extends BlockMachine { - public static final int RAIL_META = 0; - public BlockCraneRail(int id) { - super("CraneParts", id, Material.iron); - // this.setCreativeTab(TabAssemblyLine.INSTANCE); + super("CraneRail", id, Material.iron); + this.setCreativeTab(TabAssemblyLine.INSTANCE); + this.setBlockBounds(0.25f, 0.25f, 0.25f, 0.75f, 0.75f, 0.75f); + } + + @Override + @SideOnly(Side.CLIENT) + public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) + { + return super.getSelectedBoundingBoxFromPool(world, x, y, z); + } + + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) + { + TileEntity tE = world.getBlockTileEntity(x, y, z); + if (tE != null && tE instanceof TileEntityCraneRail) + { + AxisAlignedBB middle = AxisAlignedBB.getBoundingBox(0.25f, 0.25f, 0.25f, 0.75f, 0.75f, 0.75f); + AxisAlignedBB up = AxisAlignedBB.getBoundingBox(0.25f, 0.75f, 0.25f, 0.75f, 1.0f, 0.75f); + AxisAlignedBB down = AxisAlignedBB.getBoundingBox(0.25f, 0.0f, 0.25f, 0.75f, 0.25f, 0.75f); + AxisAlignedBB left = AxisAlignedBB.getBoundingBox(0.0f, 0.25f, 0.25f, 0.25f, 0.75f, 0.75f); + AxisAlignedBB right = AxisAlignedBB.getBoundingBox(0.75f, 0.25f, 0.25f, 1.0f, 0.75f, 0.75f); + AxisAlignedBB front = AxisAlignedBB.getBoundingBox(0.25f, 0.25f, 0.0f, 0.75f, 0.75f, 0.25f); + AxisAlignedBB back = AxisAlignedBB.getBoundingBox(0.25f, 0.25f, 0.75f, 0.75f, 0.75f, 1.0f); + boolean connectUp = CraneHelper.canFrameConnectTo(tE, x, y + 1, z, ForgeDirection.DOWN); + boolean connectDown = CraneHelper.canFrameConnectTo(tE, x, y - 1, z, ForgeDirection.UP); + // EAST, X- + boolean connectLeft = CraneHelper.canFrameConnectTo(tE, x - 1, y, z, ForgeDirection.EAST); + // WAST, X+ + boolean connectRight = CraneHelper.canFrameConnectTo(tE, x + 1, y, z, ForgeDirection.WEST); + // SOUTH, Z- + boolean connectFront = CraneHelper.canFrameConnectTo(tE, x, y, z - 1, ForgeDirection.SOUTH); + // NORTH, Z+ + boolean connectBack = CraneHelper.canFrameConnectTo(tE, x, y, z + 1, ForgeDirection.NORTH); + if (connectUp) + { + middle.maxY = up.maxY; + } + if (connectDown) + { + middle.minY = down.minY; + } + if (connectLeft) + { + middle.minX = left.minX; + } + if (connectRight) + { + middle.maxX = right.maxX; + } + if (connectFront) + { + middle.minZ = front.minZ; + } + if (connectBack) + { + middle.maxZ = back.maxZ; + } + setBlockBounds((float) middle.minX, (float) middle.minY, (float) middle.minZ, (float) middle.maxX, (float) middle.maxY, (float) middle.maxZ); + middle.offset(x, y, z); + return middle; + } + return super.getCollisionBoundingBoxFromPool(world, x, y, z); } + @Override + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + { + TileEntity tE = world.getBlockTileEntity(x, y, z); + if (tE != null && tE instanceof TileEntityCraneRail) + { + AxisAlignedBB middle = AxisAlignedBB.getBoundingBox(0.25f, 0.25f, 0.25f, 0.75f, 0.75f, 0.75f); + AxisAlignedBB up = AxisAlignedBB.getBoundingBox(0.25f, 0.75f, 0.25f, 0.75f, 1.0f, 0.75f); + AxisAlignedBB down = AxisAlignedBB.getBoundingBox(0.25f, 0.0f, 0.25f, 0.75f, 0.25f, 0.75f); + AxisAlignedBB left = AxisAlignedBB.getBoundingBox(0.0f, 0.25f, 0.25f, 0.25f, 0.75f, 0.75f); + AxisAlignedBB right = AxisAlignedBB.getBoundingBox(0.75f, 0.25f, 0.25f, 1.0f, 0.75f, 0.75f); + AxisAlignedBB front = AxisAlignedBB.getBoundingBox(0.25f, 0.25f, 0.0f, 0.75f, 0.75f, 0.25f); + AxisAlignedBB back = AxisAlignedBB.getBoundingBox(0.25f, 0.25f, 0.75f, 0.75f, 0.75f, 1.0f); + boolean connectUp = CraneHelper.canFrameConnectTo(tE, x, y + 1, z, ForgeDirection.DOWN); + boolean connectDown = CraneHelper.canFrameConnectTo(tE, x, y - 1, z, ForgeDirection.UP); + // EAST, X- + boolean connectLeft = CraneHelper.canFrameConnectTo(tE, x - 1, y, z, ForgeDirection.EAST); + // WAST, X+ + boolean connectRight = CraneHelper.canFrameConnectTo(tE, x + 1, y, z, ForgeDirection.WEST); + // SOUTH, Z- + boolean connectFront = CraneHelper.canFrameConnectTo(tE, x, y, z - 1, ForgeDirection.SOUTH); + // NORTH, Z+ + boolean connectBack = CraneHelper.canFrameConnectTo(tE, x, y, z + 1, ForgeDirection.NORTH); + if (connectUp) + { + middle.maxY = up.maxY; + } + if (connectDown) + { + middle.minY = down.minY; + } + if (connectLeft) + { + middle.minX = left.minX; + } + if (connectRight) + { + middle.maxX = right.maxX; + } + if (connectFront) + { + middle.minZ = front.minZ; + } + if (connectBack) + { + middle.maxZ = back.maxZ; + } + setBlockBounds((float) middle.minX, (float) middle.minY, (float) middle.minZ, (float) middle.maxX, (float) middle.maxY, (float) middle.maxZ); + return; + } + setBlockBounds(0.25f, 0.25f, 0.25f, 0.75f, 0.75f, 0.75f); + } + + @Override + public TileEntity createNewTileEntity(World world, int metadata) + { + return new TileEntityCraneRail(); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return BlockRenderingHandler.BLOCK_RENDER_ID; + } } diff --git a/src/minecraft/assemblyline/common/machine/crane/CraneHelper.java b/src/minecraft/assemblyline/common/machine/crane/CraneHelper.java new file mode 100644 index 00000000..abf3295f --- /dev/null +++ b/src/minecraft/assemblyline/common/machine/crane/CraneHelper.java @@ -0,0 +1,28 @@ +package assemblyline.common.machine.crane; + +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.ForgeDirection; + +/** + * Manager of crane movement, mapping, setup, but not AI + * + * @author Rseifert + * + */ +public class CraneHelper +{ + /** + * The maximum size that a crane can be + */ + public static final int MAX_SIZE = 64; + + public static boolean canFrameConnectTo(TileEntity tileEntity, int x, int y, int z, ForgeDirection side) + { + if (tileEntity.worldObj.getBlockTileEntity(x, y, z) != null && tileEntity.worldObj.getBlockTileEntity(x, y, z) instanceof ICraneConnectable) + { + return true; + } + + return false; + } +} diff --git a/src/minecraft/assemblyline/common/machine/crane/CraneManager.java b/src/minecraft/assemblyline/common/machine/crane/CraneManager.java deleted file mode 100644 index ad506af1..00000000 --- a/src/minecraft/assemblyline/common/machine/crane/CraneManager.java +++ /dev/null @@ -1,54 +0,0 @@ -package assemblyline.common.machine.crane; - -import assemblyline.common.AssemblyLine; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import universalelectricity.core.vector.Vector3; -/** - * Manager of crane movement, mapping, setup, but not AI - * @author Rseifert - * - */ -public class CraneManager -{ - protected int ticks = 0; - /** Limits of how far the crane can move on a 2D plane */ - public int maxLimitX, minLimitY,maxLimitZ, minLimitZ; - - public World world; - - public CraneManager() - { - - } - /** - * maps out the rail system that the crane will use for movement - */ - public void mapRails() - { - //TODO figure out what i'm going to use as the center point of this mapping first - //Most likely it will be the crane head itself, but this might be trigger by - //the crane controller. - } - /** - * finds if the rail at this location is a rail and lines up with the current direction of the rails - * - * @return true if the rail is good to use - */ - public boolean isValidRail(World world, Vector3 loc, ForgeDirection dir) - { - int id = world.getBlockId(loc.intX(), loc.intY(), loc.intZ()); - int meta = world.getBlockMetadata(loc.intX(), loc.intY(), loc.intZ()); - //might have to change this meta later if i go with a more complex render that will connect to walls - ForgeDirection facing = ForgeDirection.getOrientation(meta); - - if (id == AssemblyLine.blockCraneRail.blockID && (dir == facing || dir == facing.getOpposite())) - { - return true; - } - else - { - return false; - } - } -} diff --git a/src/minecraft/assemblyline/common/machine/crane/ICraneConnectable.java b/src/minecraft/assemblyline/common/machine/crane/ICraneConnectable.java new file mode 100644 index 00000000..e3d99335 --- /dev/null +++ b/src/minecraft/assemblyline/common/machine/crane/ICraneConnectable.java @@ -0,0 +1,6 @@ +package assemblyline.common.machine.crane; + +public interface ICraneConnectable +{ + +} diff --git a/src/minecraft/assemblyline/common/machine/crane/TileEntityCraneController.java b/src/minecraft/assemblyline/common/machine/crane/TileEntityCraneController.java index 3af0b379..e621b800 100644 --- a/src/minecraft/assemblyline/common/machine/crane/TileEntityCraneController.java +++ b/src/minecraft/assemblyline/common/machine/crane/TileEntityCraneController.java @@ -1,8 +1,13 @@ package assemblyline.common.machine.crane; +import net.minecraftforge.common.ForgeDirection; import assemblyline.common.machine.TileEntityAssemblyNetwork; -public class TileEntityCraneController extends TileEntityAssemblyNetwork +public class TileEntityCraneController extends TileEntityAssemblyNetwork implements ICraneConnectable { - + @Override + public void updateEntity() + { + + } } diff --git a/src/minecraft/assemblyline/common/machine/crane/TileEntityCraneRail.java b/src/minecraft/assemblyline/common/machine/crane/TileEntityCraneRail.java new file mode 100644 index 00000000..5391fa07 --- /dev/null +++ b/src/minecraft/assemblyline/common/machine/crane/TileEntityCraneRail.java @@ -0,0 +1,8 @@ +package assemblyline.common.machine.crane; + +import assemblyline.common.machine.TileEntityAssemblyNetwork; + +public class TileEntityCraneRail extends TileEntityAssemblyNetwork implements ICraneConnectable +{ + +}