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.CoreRecipeLoader;
|
||||||
import dark.core.common.DarkMain;
|
import dark.core.common.DarkMain;
|
||||||
import dark.core.common.transmit.TileEntityWire;
|
import dark.core.common.transmit.TileEntityWire;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class ClientProxy extends CommonProxy
|
public class ClientProxy extends CommonProxy
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,6 +38,8 @@ public class FluidBlockRenderer
|
||||||
|
|
||||||
Icon icon = fluid.getStillIcon();
|
Icon icon = fluid.getStillIcon();
|
||||||
if (icon == null)
|
if (icon == null)
|
||||||
|
{
|
||||||
|
if (fluid.getBlockID() > 0)
|
||||||
{
|
{
|
||||||
Block block = Block.blocksList[fluid.getBlockID()];
|
Block block = Block.blocksList[fluid.getBlockID()];
|
||||||
if (block != null)
|
if (block != null)
|
||||||
|
@ -51,6 +53,7 @@ public class FluidBlockRenderer
|
||||||
icon = Block.lavaStill.getIcon(0, 0);
|
icon = Block.lavaStill.getIcon(0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (icon == null)
|
if (icon == null)
|
||||||
{
|
{
|
||||||
icon = Block.waterStill.getIcon(0, 0);
|
icon = Block.waterStill.getIcon(0, 0);
|
||||||
|
|
|
@ -23,6 +23,7 @@ import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import dark.core.prefab.helpers.BlockRenderInfo;
|
import dark.core.prefab.helpers.BlockRenderInfo;
|
||||||
import dark.core.prefab.helpers.EntityFakeBlock;
|
import dark.core.prefab.helpers.EntityFakeBlock;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class RenderFakeBlock extends Render
|
public class RenderFakeBlock extends Render
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,7 +40,8 @@ public class BlockColorGlass extends BlockColored
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override @SideOnly(Side.CLIENT)
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
public boolean renderAsNormalBlock()
|
public boolean renderAsNormalBlock()
|
||||||
{
|
{
|
||||||
return false;
|
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)
|
public void registerIcons(IconRegister par1IconRegister)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < EnumMeterials.values().length; i++)
|
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)
|
public Icon getIcon(int side, int metadata)
|
||||||
{
|
{
|
||||||
if (this.icons[metadata] != null)
|
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 HashMap<Integer, IPacketManager> packetTypes = new HashMap();
|
||||||
|
|
||||||
|
|
||||||
public static PacketManagerTile tile = new PacketManagerTile();
|
public static PacketManagerTile tile = new PacketManagerTile();
|
||||||
public static PacketManagerEffects effects = new PacketManagerEffects();
|
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());
|
return new Vector3(data.readDouble(), data.readDouble(), data.readDouble());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@SuppressWarnings("resource")
|
@SuppressWarnings("resource")
|
||||||
public Packet getPacketWithID(String channelName, int id, Object... sendData)
|
public Packet getPacketWithID(String channelName, int id, Object... sendData)
|
||||||
{
|
{
|
||||||
|
@ -307,7 +305,6 @@ public class PacketHandler implements IPacketHandler, IPacketReceiver
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPacketData(INetworkManager network, Packet250CustomPayload packet, Player player)
|
public void onPacketData(INetworkManager network, Packet250CustomPayload packet, Player player)
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,12 +35,14 @@ public class PacketManagerEffects implements IPacketManager
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
System.out.println("Effect packet being handled");
|
||||||
World world = ((EntityPlayer) player).worldObj;
|
World world = ((EntityPlayer) player).worldObj;
|
||||||
String effectName = data.readUTF();
|
String effectName = data.readUTF();
|
||||||
if (world != null)
|
if (world != null)
|
||||||
{
|
{
|
||||||
if (effectName.equalsIgnoreCase("laser"))
|
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());
|
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)
|
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));
|
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);
|
this.running = this.canRun() && this.consumePower(this.WATTS_PER_TICK, true);
|
||||||
if (prevRun != this.running)
|
if (prevRun != this.running)
|
||||||
{
|
{
|
||||||
System.out.println("\n\nPower update packet sent to client\n\n\n");
|
|
||||||
this.sendPowerUpdate();
|
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(" 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(" 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(" 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 */
|
/** 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))
|
if (id.equalsIgnoreCase(TilePacketTypes.POWER.name))
|
||||||
{
|
{
|
||||||
this.running = dis.readBoolean();
|
this.running = dis.readBoolean();
|
||||||
System.out.println("Received isRunning packet");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (id.equalsIgnoreCase(TilePacketTypes.NBT.name))
|
if (id.equalsIgnoreCase(TilePacketTypes.NBT.name))
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class FluidHelper
|
||||||
|
|
||||||
public static FluidStack getStack(FluidStack stack, int amount)
|
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);
|
return new FluidStack(stack.getFluid().getID(), amount, stack.tag);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ public class Pair<L, R>
|
||||||
@Override
|
@Override
|
||||||
public int hashCode()
|
public int hashCode()
|
||||||
{
|
{
|
||||||
if(left == null || right == null)
|
if (left == null || right == null)
|
||||||
{
|
{
|
||||||
super.hashCode();
|
super.hashCode();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue