cleanup
This commit is contained in:
parent
1473ae2a05
commit
8f15c5357c
17 changed files with 45 additions and 39 deletions
|
@ -14,6 +14,7 @@ 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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
@ -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))
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue