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:
parent
5a14012e80
commit
b4ce59e5e2
6 changed files with 23 additions and 21 deletions
|
@ -14,7 +14,7 @@ public class ClientProxy extends CommonProxy
|
|||
@Override
|
||||
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));
|
||||
}
|
||||
}
|
|
@ -84,7 +84,7 @@ public class FXBeam extends EntityFX
|
|||
}
|
||||
else
|
||||
{
|
||||
|
||||
TEXTURE = new ResourceLocation("warpdrive", "textures/blocks/energy_grey.png");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -69,14 +69,14 @@ public class PacketHandler implements IPacketHandler
|
|||
|
||||
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)
|
||||
return;
|
||||
|
||||
// Hide the area
|
||||
if (!decloak) {
|
||||
//System.out.println("[Cloak Packet] Removing " + size + " blocks...");
|
||||
//WarpDrive.debugPrint("[Cloak Packet] Removing " + size + " blocks...");
|
||||
|
||||
// Now hide the blocks within area
|
||||
World worldObj = player.worldObj;
|
||||
|
@ -86,7 +86,7 @@ public class PacketHandler implements IPacketHandler
|
|||
if (worldObj.getBlockId(x, y, z) != 0)
|
||||
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
|
||||
AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(minX, minY, minZ, maxX, maxY, maxZ);
|
||||
List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(player, aabb);
|
||||
|
@ -160,12 +160,12 @@ public class PacketHandler implements IPacketHandler
|
|||
int z = inputStream.readInt();
|
||||
float yaw = 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);
|
||||
|
||||
if (te != null)
|
||||
{
|
||||
System.out.println("TE is NULL");
|
||||
WarpDrive.debugPrint("TE is NULL");
|
||||
|
||||
if (te instanceof TileEntityLaser)
|
||||
{
|
||||
|
@ -193,7 +193,7 @@ public class PacketHandler implements IPacketHandler
|
|||
int y = inputStream.readInt();
|
||||
int z = 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);
|
||||
|
||||
if (te != null)
|
||||
|
@ -222,6 +222,7 @@ public class PacketHandler implements IPacketHandler
|
|||
|
||||
private void handleBeam(Packet250CustomPayload packet, EntityPlayer player)
|
||||
{
|
||||
WarpDrive.debugPrint("Received beam");
|
||||
DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(packet.data));
|
||||
int dimID;
|
||||
Vector3 source, target;
|
||||
|
@ -254,21 +255,21 @@ public class PacketHandler implements IPacketHandler
|
|||
energy = inputStream.readInt();
|
||||
|
||||
// Render beam
|
||||
/*System.out.println("sx: " + sx + " sy: " + sy + " sz: " + sz);
|
||||
System.out.println("tx: " + sx + " ty: " + sy + " tz: " + sz);
|
||||
WarpDrive.debugPrint("sx: " + sx + " sy: " + sy + " sz: " + sz);
|
||||
WarpDrive.debugPrint("tx: " + sx + " ty: " + sy + " tz: " + sz);
|
||||
|
||||
System.out.println("source: " + source);
|
||||
System.out.println("target: " + target);
|
||||
System.out.println("r: " + r);
|
||||
System.out.println("g: " + g);
|
||||
System.out.println("b " + b);
|
||||
System.out.println("age: " + age);
|
||||
System.out.println("energy: " + energy);*/
|
||||
WarpDrive.debugPrint("source: " + source);
|
||||
WarpDrive.debugPrint("target: " + target);
|
||||
WarpDrive.debugPrint("r: " + r);
|
||||
WarpDrive.debugPrint("g: " + g);
|
||||
WarpDrive.debugPrint("b " + b);
|
||||
WarpDrive.debugPrint("age: " + age);
|
||||
WarpDrive.debugPrint("energy: " + energy);
|
||||
|
||||
// To avoid NPE at logging in
|
||||
if (worldObj == null)
|
||||
{
|
||||
System.out.println("WorldObj is null");
|
||||
WarpDrive.debugPrint("WorldObj is null");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ public class WarpDrive implements LoadingCallback {
|
|||
|
||||
@Instance("WarpDrive")
|
||||
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 WarpCoresRegistry registry;
|
||||
|
|
|
@ -5,6 +5,7 @@ import cpw.mods.fml.client.FMLClientHandler;
|
|||
import cr0s.WarpDrive.CommonProxy;
|
||||
import cr0s.WarpDrive.FXBeam;
|
||||
import cr0s.WarpDrive.Vector3;
|
||||
import cr0s.WarpDrive.WarpDrive;
|
||||
|
||||
public class ClientProxy extends CommonProxy
|
||||
{
|
||||
|
@ -16,7 +17,7 @@ public class ClientProxy extends CommonProxy
|
|||
@Override
|
||||
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));
|
||||
}
|
||||
}
|
|
@ -219,7 +219,7 @@ public abstract class TileEntityAbstractMiner extends WarpChunkTE implements IGr
|
|||
|
||||
if (side == Side.SERVER)
|
||||
{
|
||||
//WarpDrive.debugPrint("trying to fire laser!");
|
||||
WarpDrive.debugPrint("trying to fire laser!");
|
||||
if (source == null || dest == null || worldObj == null)
|
||||
{
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue