Debug stuff

Added in and re-enabled a bunch of debug code since beams don't seem to
be working
This commit is contained in:
DarkholmeTenk 2014-02-26 17:11:10 +00:00
parent 5a14012e80
commit b4ce59e5e2
6 changed files with 23 additions and 21 deletions

View file

@ -14,7 +14,7 @@ public class ClientProxy extends CommonProxy
@Override @Override
public void renderBeam(World world, Vector3 position, Vector3 target, float red, float green, float blue, int age, int energy) public void renderBeam(World world, Vector3 position, Vector3 target, float red, float green, float blue, int age, int energy)
{ {
//System.out.println("Rendering beam..."); WarpDrive.debugPrint("Rendering beam...");
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new FXBeam(world, position, target, red, green, blue, age, energy)); FMLClientHandler.instance().getClient().effectRenderer.addEffect(new FXBeam(world, position, target, red, green, blue, age, energy));
} }
} }

View file

@ -84,7 +84,7 @@ public class FXBeam extends EntityFX
} }
else else
{ {
TEXTURE = new ResourceLocation("warpdrive", "textures/blocks/energy_grey.png");
} }
/** /**

View file

@ -69,14 +69,14 @@ public class PacketHandler implements IPacketHandler
int size = w * h * l; int size = w * h * l;
//System.out.println("[Cloak Packet] Received " + ((decloak) ? "DEcloaked" : "cloaked") + "area: (" + minX + "; " + minY + "; " + minZ + ") -> (" + maxX + "; " + maxY + "; " + maxZ + ")"); //WarpDrive.debugPrint("[Cloak Packet] Received " + ((decloak) ? "DEcloaked" : "cloaked") + "area: (" + minX + "; " + minY + "; " + minZ + ") -> (" + maxX + "; " + maxY + "; " + maxZ + ")");
if (minX <= player.posX && maxX >= player.posY && minY <= player.posZ && maxY >= player.posX && minZ <= player.posY && maxZ >= player.posZ) if (minX <= player.posX && maxX >= player.posY && minY <= player.posZ && maxY >= player.posX && minZ <= player.posY && maxZ >= player.posZ)
return; return;
// Hide the area // Hide the area
if (!decloak) { if (!decloak) {
//System.out.println("[Cloak Packet] Removing " + size + " blocks..."); //WarpDrive.debugPrint("[Cloak Packet] Removing " + size + " blocks...");
// Now hide the blocks within area // Now hide the blocks within area
World worldObj = player.worldObj; World worldObj = player.worldObj;
@ -86,7 +86,7 @@ public class PacketHandler implements IPacketHandler
if (worldObj.getBlockId(x, y, z) != 0) if (worldObj.getBlockId(x, y, z) != 0)
worldObj.setBlock(x, y, z, (tier == 1) ? WarpDriveConfig.i.gasID : 0, 5, 4); worldObj.setBlock(x, y, z, (tier == 1) ? WarpDriveConfig.i.gasID : 0, 5, 4);
//System.out.println("[Cloak Packet] Removing entity..."); //WarpDrive.debugPrint("[Cloak Packet] Removing entity...");
// Hide any entities inside area // Hide any entities inside area
AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(minX, minY, minZ, maxX, maxY, maxZ); AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(minX, minY, minZ, maxX, maxY, maxZ);
List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(player, aabb); List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(player, aabb);
@ -160,12 +160,12 @@ public class PacketHandler implements IPacketHandler
int z = inputStream.readInt(); int z = inputStream.readInt();
float yaw = inputStream.readFloat(); float yaw = inputStream.readFloat();
float pitch = inputStream.readFloat(); float pitch = inputStream.readFloat();
System.out.println("Got target packet: (" + x + "; " + y + "; " + z + ") | yaw: " + yaw + " | pitch: " + pitch); WarpDrive.debugPrint("Got target packet: (" + x + "; " + y + "; " + z + ") | yaw: " + yaw + " | pitch: " + pitch);
TileEntity te = player.worldObj.getBlockTileEntity(x, y, z); TileEntity te = player.worldObj.getBlockTileEntity(x, y, z);
if (te != null) if (te != null)
{ {
System.out.println("TE is NULL"); WarpDrive.debugPrint("TE is NULL");
if (te instanceof TileEntityLaser) if (te instanceof TileEntityLaser)
{ {
@ -193,7 +193,7 @@ public class PacketHandler implements IPacketHandler
int y = inputStream.readInt(); int y = inputStream.readInt();
int z = inputStream.readInt(); int z = inputStream.readInt();
int freq = inputStream.readInt(); int freq = inputStream.readInt();
//System.out.println("Got freq packet: (" + x + "; " + y + "; " + z + ") | freq: " + freq); //WarpDrive.debugPrint("Got freq packet: (" + x + "; " + y + "; " + z + ") | freq: " + freq);
TileEntity te = player.worldObj.getBlockTileEntity(x, y, z); TileEntity te = player.worldObj.getBlockTileEntity(x, y, z);
if (te != null) if (te != null)
@ -222,6 +222,7 @@ public class PacketHandler implements IPacketHandler
private void handleBeam(Packet250CustomPayload packet, EntityPlayer player) private void handleBeam(Packet250CustomPayload packet, EntityPlayer player)
{ {
WarpDrive.debugPrint("Received beam");
DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(packet.data)); DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(packet.data));
int dimID; int dimID;
Vector3 source, target; Vector3 source, target;
@ -254,21 +255,21 @@ public class PacketHandler implements IPacketHandler
energy = inputStream.readInt(); energy = inputStream.readInt();
// Render beam // Render beam
/*System.out.println("sx: " + sx + " sy: " + sy + " sz: " + sz); WarpDrive.debugPrint("sx: " + sx + " sy: " + sy + " sz: " + sz);
System.out.println("tx: " + sx + " ty: " + sy + " tz: " + sz); WarpDrive.debugPrint("tx: " + sx + " ty: " + sy + " tz: " + sz);
System.out.println("source: " + source); WarpDrive.debugPrint("source: " + source);
System.out.println("target: " + target); WarpDrive.debugPrint("target: " + target);
System.out.println("r: " + r); WarpDrive.debugPrint("r: " + r);
System.out.println("g: " + g); WarpDrive.debugPrint("g: " + g);
System.out.println("b " + b); WarpDrive.debugPrint("b " + b);
System.out.println("age: " + age); WarpDrive.debugPrint("age: " + age);
System.out.println("energy: " + energy);*/ WarpDrive.debugPrint("energy: " + energy);
// To avoid NPE at logging in // To avoid NPE at logging in
if (worldObj == null) if (worldObj == null)
{ {
System.out.println("WorldObj is null"); WarpDrive.debugPrint("WorldObj is null");
return; return;
} }

View file

@ -119,7 +119,7 @@ public class WarpDrive implements LoadingCallback {
@Instance("WarpDrive") @Instance("WarpDrive")
public static WarpDrive instance; public static WarpDrive instance;
@SidedProxy(clientSide = "cr0s.WarpDrive.ClientProxy", serverSide = "cr0s.WarpDrive.CommonProxy") @SidedProxy(clientSide = "cr0s.WarpDrive.client.ClientProxy", serverSide = "cr0s.WarpDrive.CommonProxy")
public static CommonProxy proxy; public static CommonProxy proxy;
public WarpCoresRegistry registry; public WarpCoresRegistry registry;

View file

@ -5,6 +5,7 @@ import cpw.mods.fml.client.FMLClientHandler;
import cr0s.WarpDrive.CommonProxy; import cr0s.WarpDrive.CommonProxy;
import cr0s.WarpDrive.FXBeam; import cr0s.WarpDrive.FXBeam;
import cr0s.WarpDrive.Vector3; import cr0s.WarpDrive.Vector3;
import cr0s.WarpDrive.WarpDrive;
public class ClientProxy extends CommonProxy public class ClientProxy extends CommonProxy
{ {
@ -16,7 +17,7 @@ public class ClientProxy extends CommonProxy
@Override @Override
public void renderBeam(World world, Vector3 position, Vector3 target, float red, float green, float blue, int age, int energy) public void renderBeam(World world, Vector3 position, Vector3 target, float red, float green, float blue, int age, int energy)
{ {
System.out.println("Rendering beam..."); WarpDrive.debugPrint("Rendering beam...");
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new FXBeam(world, position, target, red, green, blue, age, energy)); FMLClientHandler.instance().getClient().effectRenderer.addEffect(new FXBeam(world, position, target, red, green, blue, age, energy));
} }
} }

View file

@ -219,7 +219,7 @@ public abstract class TileEntityAbstractMiner extends WarpChunkTE implements IGr
if (side == Side.SERVER) if (side == Side.SERVER)
{ {
//WarpDrive.debugPrint("trying to fire laser!"); WarpDrive.debugPrint("trying to fire laser!");
if (source == null || dest == null || worldObj == null) if (source == null || dest == null || worldObj == null)
{ {
return; return;