use of com.Da_Technomancer.crossroads.API.packets.SendFieldsToClient in project Crossroads by Crossroads-Development.
the class EmeraldGoggleEffect method armorTick.
@Override
public void armorTick(World world, EntityPlayer player, ArrayList<String> chat, RayTraceResult ray) {
if (ray != null) {
TileEntity te = world.getTileEntity(ray.getBlockPos());
if (te != null) {
if (te.hasCapability(Capabilities.AXLE_HANDLER_CAPABILITY, ray.sideHit.getOpposite())) {
IAxleHandler axle = te.getCapability(Capabilities.AXLE_HANDLER_CAPABILITY, ray.sideHit.getOpposite());
chat.add("Speed: " + axle.getMotionData()[0]);
chat.add("Energy: " + axle.getMotionData()[1]);
chat.add("Power: " + axle.getMotionData()[2]);
chat.add("I: " + axle.getPhysData()[1] + ", Rotation Ratio: " + axle.getRotationRatio());
} else if (te.hasCapability(Capabilities.AXLE_HANDLER_CAPABILITY, ray.sideHit)) {
IAxleHandler axle = te.getCapability(Capabilities.AXLE_HANDLER_CAPABILITY, ray.sideHit);
chat.add("Speed: " + axle.getMotionData()[0]);
chat.add("Energy: " + axle.getMotionData()[1]);
chat.add("Power: " + axle.getMotionData()[2]);
chat.add("I: " + axle.getPhysData()[1] + ", Rotation Ratio: " + axle.getRotationRatio());
} else if (te.hasCapability(Capabilities.AXIS_HANDLER_CAPABILITY, null)) {
chat.add("Total Energy: " + te.getCapability(Capabilities.AXIS_HANDLER_CAPABILITY, null).getTotalEnergy());
}
if (te instanceof IGoggleInfoTE) {
((IGoggleInfoTE) te).addInfo(chat, GoggleLenses.EMERALD, player, ray.sideHit);
}
}
}
if (world.getTotalWorldTime() % 5 == 1) {
if (FieldWorldSavedData.get(world).fieldNodes.containsKey(MiscOp.getLongFromChunkPos(new ChunkPos(player.getPosition())))) {
ModPackets.network.sendTo(new SendFieldsToClient(FieldWorldSavedData.get(world).fieldNodes.get(MiscOp.getLongFromChunkPos(new ChunkPos(player.getPosition())))[1], (byte) 1, MiscOp.getLongFromChunkPos(new ChunkPos(player.getPosition()))), (EntityPlayerMP) player);
} else {
ModPackets.network.sendTo(new SendFieldsToClient(new byte[1][1], (byte) -1, MiscOp.getLongFromChunkPos(new ChunkPos(player.getPosition()))), (EntityPlayerMP) player);
}
}
}
Aggregations