diff --git a/src/dark/core/client/ClientProxy.java b/src/dark/core/client/ClientProxy.java index 98ae2554..6a7924fa 100644 --- a/src/dark/core/client/ClientProxy.java +++ b/src/dark/core/client/ClientProxy.java @@ -14,12 +14,13 @@ import dark.core.common.CommonProxy; import dark.core.common.CoreRecipeLoader; import dark.core.common.DarkMain; import dark.core.common.transmit.TileEntityWire; + @SideOnly(Side.CLIENT) 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 diff --git a/src/dark/core/client/FXBeam.java b/src/dark/core/client/FXBeam.java index b6405aae..86505aae 100644 --- a/src/dark/core/client/FXBeam.java +++ b/src/dark/core/client/FXBeam.java @@ -19,7 +19,7 @@ import cpw.mods.fml.relauncher.SideOnly; import dark.core.common.DarkMain; /** Based off Thaumcraft's Beam Renderer. - * + * * @author Calclavia, Azanor */ @SideOnly(Side.CLIENT) public class FXBeam extends EntityFX diff --git a/src/dark/core/client/renders/FluidBlockRenderer.java b/src/dark/core/client/renders/FluidBlockRenderer.java index 9d5e52a2..815ee024 100644 --- a/src/dark/core/client/renders/FluidBlockRenderer.java +++ b/src/dark/core/client/renders/FluidBlockRenderer.java @@ -39,16 +39,19 @@ public class FluidBlockRenderer Icon icon = fluid.getStillIcon(); if (icon == null) { - Block block = Block.blocksList[fluid.getBlockID()]; - if (block != null) + if (fluid.getBlockID() > 0) { - if (block.blockID == Block.waterStill.blockID) + Block block = Block.blocksList[fluid.getBlockID()]; + if (block != null) { - icon = Block.waterStill.getIcon(0, 0); - } - if (block.blockID == Block.lavaStill.blockID) - { - icon = Block.lavaStill.getIcon(0, 0); + if (block.blockID == Block.waterStill.blockID) + { + icon = Block.waterStill.getIcon(0, 0); + } + if (block.blockID == Block.lavaStill.blockID) + { + icon = Block.lavaStill.getIcon(0, 0); + } } } if (icon == null) diff --git a/src/dark/core/client/renders/RenderFakeBlock.java b/src/dark/core/client/renders/RenderFakeBlock.java index c0786041..eb35b683 100644 --- a/src/dark/core/client/renders/RenderFakeBlock.java +++ b/src/dark/core/client/renders/RenderFakeBlock.java @@ -23,6 +23,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.core.prefab.helpers.BlockRenderInfo; import dark.core.prefab.helpers.EntityFakeBlock; + @SideOnly(Side.CLIENT) public class RenderFakeBlock extends Render { @@ -88,7 +89,7 @@ public class RenderFakeBlock extends Render } /** Renders a block at given location - * + * * @param blockInterface - class used to store info for the render process * @param world - world rendering in * @param x - position on x axis diff --git a/src/dark/core/common/CommonProxy.java b/src/dark/core/common/CommonProxy.java index 4b4285f3..835deacb 100644 --- a/src/dark/core/common/CommonProxy.java +++ b/src/dark/core/common/CommonProxy.java @@ -27,7 +27,7 @@ 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 diff --git a/src/dark/core/common/ExternalModHandler.java b/src/dark/core/common/ExternalModHandler.java index a29dd5b8..637ba87e 100644 --- a/src/dark/core/common/ExternalModHandler.java +++ b/src/dark/core/common/ExternalModHandler.java @@ -6,7 +6,7 @@ import buildcraft.api.transport.IPipeTile.PipeType; import cpw.mods.fml.common.Loader; /** Handles working with other mod without or without the need of the APIs. - * + * * @author DarkGuardsman */ public class ExternalModHandler { @@ -37,7 +37,7 @@ public class ExternalModHandler } /** Checks to see if something can run powerless based on mods loaded - * + * * @param optional - power system that the device can use * @return true if free power is to be generated */ public static boolean runPowerLess() diff --git a/src/dark/core/common/blocks/BlockColorGlass.java b/src/dark/core/common/blocks/BlockColorGlass.java index 7d948c40..b2b8064c 100644 --- a/src/dark/core/common/blocks/BlockColorGlass.java +++ b/src/dark/core/common/blocks/BlockColorGlass.java @@ -40,7 +40,8 @@ public class BlockColorGlass extends BlockColored return false; } - @Override @SideOnly(Side.CLIENT) + @Override + @SideOnly(Side.CLIENT) public boolean renderAsNormalBlock() { return false; diff --git a/src/dark/core/common/blocks/BlockOre.java b/src/dark/core/common/blocks/BlockOre.java index ac17f754..ac4e0423 100644 --- a/src/dark/core/common/blocks/BlockOre.java +++ b/src/dark/core/common/blocks/BlockOre.java @@ -42,7 +42,8 @@ public class BlockOre extends Block implements IExtraObjectInfo } } - @Override @SideOnly(Side.CLIENT) + @Override + @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { for (int i = 0; i < EnumMeterials.values().length; i++) @@ -54,7 +55,8 @@ public class BlockOre extends Block implements IExtraObjectInfo } } - @Override @SideOnly(Side.CLIENT) + @Override + @SideOnly(Side.CLIENT) public Icon getIcon(int side, int metadata) { if (this.icons[metadata] != null) diff --git a/src/dark/core/common/items/ItemParts.java b/src/dark/core/common/items/ItemParts.java index e3b043bb..4f17e1ad 100644 --- a/src/dark/core/common/items/ItemParts.java +++ b/src/dark/core/common/items/ItemParts.java @@ -13,7 +13,7 @@ import dark.core.common.DarkMain; import dark.core.prefab.items.ItemBasic; /** A metadata item containing parts of various machines in Liquid Mechanics Mod. - * + * * @author Rs */ public class ItemParts extends ItemBasic { diff --git a/src/dark/core/network/PacketHandler.java b/src/dark/core/network/PacketHandler.java index 34d40581..c5d9d9b4 100644 --- a/src/dark/core/network/PacketHandler.java +++ b/src/dark/core/network/PacketHandler.java @@ -26,7 +26,7 @@ import cpw.mods.fml.common.network.PacketDispatcher; import cpw.mods.fml.common.network.Player; /** Packet manager based off the PacketManager from UE created by Calclavia - * + * * @author DarkGuardsman */ public class PacketHandler implements IPacketHandler, IPacketReceiver { @@ -34,7 +34,6 @@ public class PacketHandler implements IPacketHandler, IPacketReceiver public static HashMap packetTypes = new HashMap(); - public static PacketManagerTile tile = new PacketManagerTile(); public static PacketManagerEffects effects = new PacketManagerEffects(); @@ -137,7 +136,6 @@ public class PacketHandler implements IPacketHandler, IPacketReceiver return new Vector3(data.readDouble(), data.readDouble(), data.readDouble()); } - @SuppressWarnings("resource") public Packet getPacketWithID(String channelName, int id, Object... sendData) { @@ -171,7 +169,7 @@ public class PacketHandler implements IPacketHandler, IPacketReceiver } /** Gets a packet for the tile entity. - * + * * @return */ @SuppressWarnings("resource") public Packet getPacket(String channelName, TileEntity sender, Object... sendData) @@ -307,7 +305,6 @@ public class PacketHandler implements IPacketHandler, IPacketReceiver return data; } - @Override public void onPacketData(INetworkManager network, Packet250CustomPayload packet, Player player) { @@ -321,7 +318,7 @@ public class PacketHandler implements IPacketHandler, IPacketReceiver if (packetType != null) { - packetType.handlePacket(network, packet, player, data); + packetType.handlePacket(network, packet, player, data); } else { diff --git a/src/dark/core/network/PacketManagerEffects.java b/src/dark/core/network/PacketManagerEffects.java index 17e7d7b7..6e337445 100644 --- a/src/dark/core/network/PacketManagerEffects.java +++ b/src/dark/core/network/PacketManagerEffects.java @@ -35,12 +35,14 @@ public class PacketManagerEffects implements IPacketManager { try { + System.out.println("Effect packet being handled"); World world = ((EntityPlayer) player).worldObj; String effectName = data.readUTF(); if (world != null) { if (effectName.equalsIgnoreCase("laser")) { + System.out.println("Received laser packet"); DarkMain.proxy.renderBeam(world, PacketHandler.readVector3(data), PacketHandler.readVector3(data), new Color(data.readInt(), data.readInt(), data.readInt()), data.readInt()); } } @@ -55,8 +57,9 @@ public class PacketManagerEffects implements IPacketManager public static void sendClientLaserEffect(World world, Vector3 position, Vector3 target, Color color, int age) { - Packet packet = PacketHandler.instance().getPacketWithID(DarkMain.CHANNEL, packetID, position, target, color.getRed(), color.getBlue(), color.getGreen(), age); + Packet packet = PacketHandler.instance().getPacketWithID(DarkMain.CHANNEL, packetID, "laser", position, target, color.getRed(), color.getBlue(), color.getGreen(), age); PacketHandler.instance().sendPacketToClients(packet, world, position, position.distance(target)); + System.out.println("Sent laser render packet to client"); } } diff --git a/src/dark/core/prefab/TileEntityMachine.java b/src/dark/core/prefab/TileEntityMachine.java index 801b0902..318558bb 100644 --- a/src/dark/core/prefab/TileEntityMachine.java +++ b/src/dark/core/prefab/TileEntityMachine.java @@ -99,7 +99,6 @@ public abstract class TileEntityMachine extends TileEntityUniversalElectrical im this.running = this.canRun() && this.consumePower(this.WATTS_PER_TICK, true); if (prevRun != this.running) { - System.out.println("\n\nPower update packet sent to client\n\n\n"); this.sendPowerUpdate(); } } @@ -117,7 +116,7 @@ public abstract class TileEntityMachine extends TileEntityUniversalElectrical im System.out.println(" RedPower: " + this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)); System.out.println(" IsDisabled: " + this.isDisabled());//TODO i'm going to kick myself if this is it, yep disabled System.out.println(" HasPower: " + this.consumePower(WATTS_PER_TICK, false)); - System.out.println(" IsRunning: " + this.running + " \n"); + System.out.println(" IsRunning: " + this.running); } /** Called to consume power from the internal storage */ @@ -288,7 +287,6 @@ public abstract class TileEntityMachine extends TileEntityUniversalElectrical im if (id.equalsIgnoreCase(TilePacketTypes.POWER.name)) { this.running = dis.readBoolean(); - System.out.println("Received isRunning packet"); return true; } if (id.equalsIgnoreCase(TilePacketTypes.NBT.name)) diff --git a/src/dark/core/prefab/TileEntityMulti.java b/src/dark/core/prefab/TileEntityMulti.java index 738330f1..dc3c34c3 100644 --- a/src/dark/core/prefab/TileEntityMulti.java +++ b/src/dark/core/prefab/TileEntityMulti.java @@ -15,7 +15,7 @@ import com.google.common.io.ByteArrayDataInput; import dark.core.network.PacketHandler; /** This is a multiblock to be used for blocks that are bigger than one block. - * + * * @author Calclavia */ public class TileEntityMulti extends TileEntity implements IPacketReceiver { @@ -117,7 +117,7 @@ public class TileEntityMulti extends TileEntity implements IPacketReceiver } /** Determines if this TileEntity requires update calls. - * + * * @return True if you want updateEntity() to be called, false if not */ @Override public boolean canUpdate() diff --git a/src/dark/core/prefab/damage/IDamageableTile.java b/src/dark/core/prefab/damage/IDamageableTile.java index 1a8263bb..4568de9f 100644 --- a/src/dark/core/prefab/damage/IDamageableTile.java +++ b/src/dark/core/prefab/damage/IDamageableTile.java @@ -6,12 +6,12 @@ import dark.core.interfaces.IBlockActivated; /** Used by tiles that want to pretend to be living objects. Will require the use of this interface * as well spawning a EntityTileDamage entity as its location - * + * * @author DarkGuardsman */ public interface IDamageableTile extends IBlockActivated { /** Same as attackEntityFrom in Entity.class - * + * * @param source - DamageSource/DamageType * @param ammount - amount of damage * @return */ @@ -25,7 +25,7 @@ public interface IDamageableTile extends IBlockActivated public float health(); /** Sets the tiles heath - * + * * @param health - amount hit points * @param increase - increase instead of replace */ public void setHealth(float health); diff --git a/src/dark/core/prefab/helpers/FluidHelper.java b/src/dark/core/prefab/helpers/FluidHelper.java index debc3258..19116172 100644 --- a/src/dark/core/prefab/helpers/FluidHelper.java +++ b/src/dark/core/prefab/helpers/FluidHelper.java @@ -88,7 +88,7 @@ public class FluidHelper public static FluidStack getStack(FluidStack stack, int amount) { - if (stack != null) + if (stack != null && stack.getFluid() != null) { return new FluidStack(stack.getFluid().getID(), amount, stack.tag); } diff --git a/src/dark/core/prefab/helpers/Pair.java b/src/dark/core/prefab/helpers/Pair.java index fa695941..a7af6561 100644 --- a/src/dark/core/prefab/helpers/Pair.java +++ b/src/dark/core/prefab/helpers/Pair.java @@ -24,9 +24,9 @@ public class Pair @Override public int hashCode() { - if(left == null || right == null) + if (left == null || right == null) { - super.hashCode(); + super.hashCode(); } return left.hashCode() ^ right.hashCode(); } diff --git a/src/dark/core/prefab/tilenetwork/ResourcePathFinder.java b/src/dark/core/prefab/tilenetwork/ResourcePathFinder.java index 59484a2a..3ab858ff 100644 --- a/src/dark/core/prefab/tilenetwork/ResourcePathFinder.java +++ b/src/dark/core/prefab/tilenetwork/ResourcePathFinder.java @@ -74,7 +74,7 @@ public abstract class ResourcePathFinder } /** Searches for nodes attached to the given node - * + * * @return True on success finding, false on failure. */ public boolean findNodes(Vector3 node) { @@ -125,7 +125,7 @@ public abstract class ResourcePathFinder } /** Finds a node in a give direction - * + * * Note: Calls findNode if the next code is valid */ public boolean find(ForgeDirection direction, Vector3 origin) { @@ -148,7 +148,7 @@ public abstract class ResourcePathFinder /** Called when the pathfinder jumps to the next block. Use this to inject other processes into * the find method - * + * * @return true if you found results, or just want the calling method to return true */ public boolean onFind() {