cleanup
This commit is contained in:
parent
1473ae2a05
commit
8f15c5357c
17 changed files with 45 additions and 39 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -40,7 +40,8 @@ public class BlockColorGlass extends BlockColored
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override @SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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<Integer, IPacketManager> 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
|
||||
{
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -24,9 +24,9 @@ public class Pair<L, R>
|
|||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
if(left == null || right == null)
|
||||
if (left == null || right == null)
|
||||
{
|
||||
super.hashCode();
|
||||
super.hashCode();
|
||||
}
|
||||
return left.hashCode() ^ right.hashCode();
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue