From a6a94aa7538729dce253cc99fa1732196ae4fde1 Mon Sep 17 00:00:00 2001 From: DarkGuardsman Date: Mon, 26 Aug 2013 15:04:21 -0400 Subject: [PATCH] Move laser render effect calls to core proxy Its for the best seeing as 3 mods needed this one method and all of them use the core anyways. --- src/dark/core/ClientProxy.java | 36 ++++++++++++++++++++++++++++++++++ src/dark/core/CommonProxy.java | 16 +++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/src/dark/core/ClientProxy.java b/src/dark/core/ClientProxy.java index 96820a64..ca69351a 100644 --- a/src/dark/core/ClientProxy.java +++ b/src/dark/core/ClientProxy.java @@ -1,6 +1,42 @@ package dark.core; +import java.awt.Color; + +import net.minecraft.world.World; +import universalelectricity.core.vector.Vector3; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; +import dark.client.FXBeam; +import dark.client.renders.RenderCopperWire; +import dark.common.transmit.TileEntityWire; + public class ClientProxy extends CommonProxy { + /** Renders a laser beam from one power to another by a set color for a set time + * + * @param world - world this laser is to be rendered in + * @param position - start vector3 + * @param target - end vector3 + * @param color - color of the beam + * @param age - life of the beam in 1/20 secs */ + @Override + public void renderBeam(World world, Vector3 position, Vector3 target, Color color, int age) + { + if (world.isRemote || FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) + { + FMLClientHandler.instance().getClient().effectRenderer.addEffect(new FXBeam(world, position, target, color, DarkMain.TEXTURE_DIRECTORY + "", age)); + } + } + + @Override + public void init() + { + if (CoreRecipeLoader.blockWire != null) + { + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWire.class, new RenderCopperWire()); + } + } } diff --git a/src/dark/core/CommonProxy.java b/src/dark/core/CommonProxy.java index 3ec262ab..0d855d8d 100644 --- a/src/dark/core/CommonProxy.java +++ b/src/dark/core/CommonProxy.java @@ -1,5 +1,10 @@ package dark.core; +import java.awt.Color; + +import net.minecraft.world.World; +import universalelectricity.core.vector.Vector3; + public class CommonProxy { public void preInit() @@ -20,4 +25,15 @@ public class CommonProxy } + /** Renders a laser beam from one power to another by a set color for a set time + * + * @param world - world this laser is to be rendered in + * @param position - start vector3 + * @param target - end vector3 + * @param color - color of the beam + * @param age - life of the beam in 1/20 secs */ + public void renderBeam(World world, Vector3 position, Vector3 target, Color color, int age) + { + } + }