From 02118497f97edd4b7146c12f46af9c2155246121 Mon Sep 17 00:00:00 2001 From: Robert S Date: Thu, 20 Mar 2014 22:28:01 -0400 Subject: [PATCH] Added textures for block placer --- .../mechanical/process/edit/TilePlacer.java | 40 ++++++++++++++++-- .../textures/blocks/cobble_frame.png | Bin 0 -> 550 bytes .../textures/blocks/cobble_output.png | Bin 0 -> 749 bytes .../textures/blocks/placer.png | Bin 830 -> 550 bytes 4 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 src/main/resources/assets/resonantinduction/textures/blocks/cobble_frame.png create mode 100644 src/main/resources/assets/resonantinduction/textures/blocks/cobble_output.png diff --git a/mechanical/src/main/java/resonantinduction/mechanical/process/edit/TilePlacer.java b/mechanical/src/main/java/resonantinduction/mechanical/process/edit/TilePlacer.java index 101ec288d..d50200fba 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/process/edit/TilePlacer.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/process/edit/TilePlacer.java @@ -1,14 +1,17 @@ package resonantinduction.mechanical.process.edit; import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.packet.Packet; import net.minecraft.util.ChatMessageComponent; +import net.minecraft.util.Icon; import net.minecraftforge.common.ForgeDirection; import org.lwjgl.opengl.GL11; +import resonantinduction.core.Reference; import resonantinduction.core.ResonantInduction; import universalelectricity.api.vector.Vector3; import calclavia.lib.content.module.TileRender; @@ -37,11 +40,18 @@ public class TilePlacer extends TileInventory implements IRotatable, IPacketRece private ForgeDirection renderItemSide_a; private ForgeDirection renderItemSide_b; + @SideOnly(Side.CLIENT) + private Icon front; + + @SideOnly(Side.CLIENT) + private Icon back; + public TilePlacer() { - super(Material.iron); + super(Material.rock); this.normalRender = false; this.maxSlots = 1; + this.textureName = "cobble_frame"; } public InternalInventoryHandler getInvHandler() @@ -86,14 +96,14 @@ public class TilePlacer extends TileInventory implements IRotatable, IPacketRece { if (place_delay < Byte.MAX_VALUE) place_delay++; - + if (place_delay >= 5) {//TODO implement block break speed, and a minor delay doWork(); doWork = false; } } - + } public void work() @@ -181,6 +191,30 @@ public class TilePlacer extends TileInventory implements IRotatable, IPacketRece } } + @Override + @SideOnly(Side.CLIENT) + public Icon getIcon(int side, int meta) + { + if (side == meta) + { + return front; + } + else if (ForgeDirection.getOrientation(meta).getOpposite().ordinal() == side) + { + return back; + } + return super.getIcon(side, meta); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister iconRegister) + { + super.registerIcons(iconRegister); + this.front = iconRegister.registerIcon("placer"); + this.back = iconRegister.registerIcon("cobble_output"); + } + @Override @SideOnly(Side.CLIENT) protected TileRender newRenderer() diff --git a/src/main/resources/assets/resonantinduction/textures/blocks/cobble_frame.png b/src/main/resources/assets/resonantinduction/textures/blocks/cobble_frame.png new file mode 100644 index 0000000000000000000000000000000000000000..a3a5a08557cdc2f77eb77d2c270853d5115d0a94 GIT binary patch literal 550 zcmV+>0@?kEP)#nY@ zno+&Kzr$j&NSMuL7>!043^8rbc2D0R$fwOUxMR+vmCsCZE>ml26XkV>WC za=8!+h0tg;Bs?CE9oc)BE9;_Cu)EUIA0!x%VgysIMrz)eH<`uI89u(5)tu$CdpI1W z+wG=ON&u21K}t!QrX)!Mz;?T(R;wYUL`q2*hD1?Bu~;OIV>E!Pt1A|Z1-h;?olYs0 zO4RFh07jz`)oPVYCWDlc@9%FGiv{I!8OL!@SF07%=@i?x*=#n{>vg)_F3n~W!!WQc zi?6RQTCEngZDSY)7Z(>qQACm?sG6pcBnclM9~>MUaCv#j`};dW2u#x?iXxiLCND29 zIF3U;pJ#7x56iL;LZB521&)r6$mMdZRx7sKE&KcX1VO-fJVsFz>h(IOr>CT8itD=U zb~|)kXSds-1wnx4d7PY_kjv%x{QN{!Rb1C)I2;0?X&Sa|qw6|`VKA9Yczk>WK>ZmN zMFAiTLmbE9{{EgI2nd3J!C=5-G9iv*bY180@Q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