From 9e8ae6ade3a21378dcdae69a180d25e55ab6bb04 Mon Sep 17 00:00:00 2001 From: Robert S Date: Thu, 8 May 2014 10:11:31 -0400 Subject: [PATCH] Fixed double laser render, and laser fade for laser gun --- .../electrical/laser/gun/ItemMiningLaser.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/electrical/src/main/scala/resonantinduction/electrical/laser/gun/ItemMiningLaser.java b/electrical/src/main/scala/resonantinduction/electrical/laser/gun/ItemMiningLaser.java index 31e2fb5ff..90a6a8769 100644 --- a/electrical/src/main/scala/resonantinduction/electrical/laser/gun/ItemMiningLaser.java +++ b/electrical/src/main/scala/resonantinduction/electrical/laser/gun/ItemMiningLaser.java @@ -166,14 +166,17 @@ public class ItemMiningLaser extends ItemEnergyTool } playerViewOffset = hit.hitVec; + } - //TODO make beam brighter the longer it has been used - //TODO adjust the laser for the end of the gun + //Only call client as the server can render stuff threw packets + if (player.worldObj.isRemote) + { float x = (float) (MathHelper.cos((float) (player.rotationYawHead * 0.0174532925)) * (-.4) - MathHelper.sin((float) (player.rotationYawHead * 0.0174532925)) * (-.1)); float z = (float) (MathHelper.sin((float) (player.rotationYawHead * 0.0174532925)) * (-.4) + MathHelper.cos((float) (player.rotationYawHead * 0.0174532925)) * (-.1)); - ResonantInduction.proxy.renderBeam(player.worldObj, (IVector3) new Vector3(p).translate(new Vector3(x, -.25, z)), (IVector3) new Vector3(playerViewOffset), Color.ORANGE, 1); - ResonantInduction.proxy.renderBeam(player.worldObj, (IVector3) new Vector3(p).translate(new Vector3(x, -.45, z)), (IVector3) new Vector3(playerViewOffset), Color.ORANGE, 1); + ResonantInduction.proxy.renderBeam(player.worldObj, (IVector3) new Vector3(p).translate(new Vector3(x, -.25, z)), (IVector3) new Vector3(playerViewOffset), Color.red, 5); + ResonantInduction.proxy.renderBeam(player.worldObj, (IVector3) new Vector3(p).translate(new Vector3(x, -.45, z)), (IVector3) new Vector3(playerViewOffset), Color.red, 5); } + } }