From fe06c084143029f5580d599695274a31e8fbf364 Mon Sep 17 00:00:00 2001 From: Calclavia Date: Tue, 25 Feb 2014 08:39:05 +0800 Subject: [PATCH] Added new model for metal cast --- .../archaic/process/BlockCast.java | 20 ++++++++++++++++ .../archaic/process/RenderCast.java | 22 ++++++++++++++++-- .../electrical/charger/PartCharger.java | 3 ++- .../assets/resonantinduction/models/cast.png | Bin 0 -> 2931 bytes .../assets/resonantinduction/models/cast.tcn | Bin 0 -> 3872 bytes 5 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 src/main/resources/assets/resonantinduction/models/cast.png create mode 100644 src/main/resources/assets/resonantinduction/models/cast.tcn diff --git a/archaic/src/main/java/resonantinduction/archaic/process/BlockCast.java b/archaic/src/main/java/resonantinduction/archaic/process/BlockCast.java index d28d664a5..1fdc13f9b 100644 --- a/archaic/src/main/java/resonantinduction/archaic/process/BlockCast.java +++ b/archaic/src/main/java/resonantinduction/archaic/process/BlockCast.java @@ -8,6 +8,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Icon; import net.minecraft.world.World; import resonantinduction.core.Reference; +import resonantinduction.core.render.RIBlockRenderingHandler; import universalelectricity.api.vector.Vector3; import calclavia.lib.prefab.block.BlockTile; import calclavia.lib.utility.inventory.InventoryUtility; @@ -26,6 +27,25 @@ public class BlockCast extends BlockTile setTextureName(Reference.PREFIX + "material_metal_side"); } + @SideOnly(Side.CLIENT) + @Override + public int getRenderType() + { + return RIBlockRenderingHandler.ID; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + @SideOnly(Side.CLIENT) @Override public void registerIcons(IconRegister iconReg) diff --git a/archaic/src/main/java/resonantinduction/archaic/process/RenderCast.java b/archaic/src/main/java/resonantinduction/archaic/process/RenderCast.java index cf8cce0eb..393f3a2dd 100644 --- a/archaic/src/main/java/resonantinduction/archaic/process/RenderCast.java +++ b/archaic/src/main/java/resonantinduction/archaic/process/RenderCast.java @@ -1,15 +1,23 @@ package resonantinduction.archaic.process; +import org.lwjgl.opengl.GL11; + +import calclavia.lib.render.RenderUtility; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.client.model.AdvancedModelLoader; +import net.minecraftforge.client.model.IModelCustom; +import resonantinduction.core.Reference; import resonantinduction.core.render.RenderItemOverlayTile; +import resonantinduction.electrical.battery.RenderBattery; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class RenderCast extends RenderItemOverlayTile { - private final RenderBlocks renderBlocks = new RenderBlocks(); + public static RenderCast INSTANCE = new RenderCast(); + public static final IModelCustom MODEL = AdvancedModelLoader.loadModel(Reference.MODEL_DIRECTORY + "cast.tcn"); @Override public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float var8) @@ -17,7 +25,17 @@ public class RenderCast extends RenderItemOverlayTile if (tileEntity instanceof TileCast) { TileCast tile = (TileCast) tileEntity; - renderItemOnSides(tileEntity, tile.getStackInSlot(0), x, y, z, ""); + + GL11.glPushMatrix(); + GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); + GL11.glTranslated(0.25, -0.25, -0.25); + GL11.glScalef(0.5f, 0.5f, 0.5f); + RenderUtility.bind(Reference.DOMAIN, Reference.MODEL_PATH + "cast.png"); + MODEL.renderAll(); + GL11.glPopMatrix(); + + if (tile.worldObj != null) + renderItemOnSides(tileEntity, tile.getStackInSlot(0), x, y, z, ""); } } } diff --git a/electrical/src/main/java/resonantinduction/electrical/charger/PartCharger.java b/electrical/src/main/java/resonantinduction/electrical/charger/PartCharger.java index b1680fe0e..8141c63cf 100644 --- a/electrical/src/main/java/resonantinduction/electrical/charger/PartCharger.java +++ b/electrical/src/main/java/resonantinduction/electrical/charger/PartCharger.java @@ -113,7 +113,8 @@ public class PartCharger extends PartFace implements IExternalInventory, ISidedI if (energyLeft <= 0) break; } - if (energyUsed > 0 && System.currentTimeMillis() - this.lastPacket >= 50) + + if (!world().isRemote && energyUsed > 0 && System.currentTimeMillis() - this.lastPacket >= 50) { this.lastPacket = System.currentTimeMillis(); sendDescUpdate(); diff --git a/src/main/resources/assets/resonantinduction/models/cast.png b/src/main/resources/assets/resonantinduction/models/cast.png new file mode 100644 index 0000000000000000000000000000000000000000..b91730947f8b14fd4c8c77cf21570b125f9521a9 GIT binary patch literal 2931 zcmaJ@c|6p4AOB&&ToKjAM{%+@TmbVrDRy!^|+_D#_MTi{yw5x^wKv zRo1mO$Ap|YN^UZ#m`abMqGz-n&mT|E@AzJ?_xt@h|M(`kIN5BI{Ye%8fNeNiOIOis zw)sm-iN<1b__%1=%d+xhxzPeyY<~s`FelOiNMIbrKZxW?@+U@xx08$kKmtN`_hflG zI$#Ji3e0~K1LIKWA~paRV>xtxLMVv^4j=`QsU{F%-CqzenP>v>&~rpM(hrh?$+po9 zl3TQsJ0UuhU`T{uO~J+-j7We&V)=tPlrSn2!!dz;(#43@o5yen_!EQ`Y6AJkDNjci z@Ie}b1lEJ;KnVyW5{yQ}kh*$kG*TOkLLgCagy=&S%eG?AUM*{&~Q@&g@TF@P-YaB<wn=|(g+b05|#CZOZ>(~eV4o03KY7?vL%T@jwBJS88iy`Q^*+dcYQIi{;u9< zF7f-mAim3mi=2UP7WTgi{pCp1J)6s~Z7bS*ZF~|{)a?vWTNmV^{|1090-U9}J7?tO zC2Y!D%k8ZT%EII7@xYGl4B39TIng_QR!-Vr`25n7j= zAIh>`uBvJS(#eC|-#s}^K=Evq<6D*c}^I=h)H>?`Un^9Pw_O{D;!Vk}T-*$0T*`}%}^&NI& zbs{^=2V*C#|D$hrj?4a7>26^-*6eJk%w=J?veQBCfkim59Ihlc0GW{%>lQ4HqI)Xy zu0j*j5q-`;>y8z*`XTM!z$xBRedJE4yG3hrtiDWt{cS6qw=P>O;s(!*sEJwJUR54; zc6J_n^~yz2DQ+KcV&-_>b+Jk*m{F+!B+aAr=W^OgfJ8*OSy5zcHV`I23h(zTuTNu4 zYll3!gE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-U7s z%7QLaJ0Gs5VE6_y?>tvDbT4S1#-Bgdmf;Sy!N%Nb3Lk!CmoLq-&cMH%LLSdDMkZ%0 z1Tm?00S}~g?(|e8u3tRNu&H#(`YG#A_4Fy<$$>YnrW51NOU-^KK2}C)4CWH2^{`Uf z{Xm246GoJ8SYK#)sbugE49mEA@sHcma&@)_jW%Uh991iydM|7&RwyTw{QNXL?v8@; zeY$DS3zJC(yjSZ%}y;t|2Wn@!j` znQbOQze3Nbs}ThizyKSst;=~fA0d{nGd$gQG^)QL`@ZL>lQ-VSZ@E!it9=8N)-hKW_4?2FeI43iEF);ybAE*{ v@odad`Io}igVpR4Zf}9fZ!balqZ|U5Ef;JF`im{Sc@4%{Ia%^7jwSpDHDm;U literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/resonantinduction/models/cast.tcn b/src/main/resources/assets/resonantinduction/models/cast.tcn new file mode 100644 index 0000000000000000000000000000000000000000..5644babcef2aeabbfe5966945ba2aac0f8fb7dc0 GIT binary patch literal 3872 zcmb7{S5OlS7KKCaReF&kO{#PVEp!A$i1fCAgl6ajM5GrfQWFB9OH+CYC@3H$p%V}U z=|u&kgF@)A{`;`A`_Jsd&Yihu?#!L@_RXAQVnjsD1ONcY0pFsnbY^hzelA1+K>7m! zfC3-@@bYniKqa4fK`8;ef1UsU0stF;p##?SNqUUn@4B16=#zJkzH3={HzMH|HA!B* zPKkkiwMCe_W$l#QZc0x%gg>2Nv;X>hHXdwXTMMt*iZ#w)+$}6EJ(ZF;m1;okZ%o~3%HOeXl?^GRC>20& z8&sXuJm9OJI)uwTU3oog(V(I6@?!6q&*Oy=6)~q1!MfFZY1=@sS{a+o*wE4*@sPaS z)RTIK55x1%h|uePcO=s#yEmZBIYv@es67~c&R20#_`FBvoCg>2?Yyz1XA)4$tW(Dq z>Pp#MNPgS?tFIxotHrH@uT!Dg?U;exx650w=GwW*J^VK3(pHFI=WMcrp|bzN^Tpo> z&Fax*h_9_NKb3H61F3;3)BUqCr_&?0EO#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