use of org.valkyrienskies.mod.common.ships.interpolation.ITransformInterpolator in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class ShipTransformUpdateMessageHandler method onMessage.
@Override
@SuppressWarnings("Convert2Lambda")
public // errors. DON'T USE A LAMBDA
IMessage onMessage(final ShipTransformUpdateMessage message, final MessageContext ctx) {
IThreadListener mainThread = Minecraft.getMinecraft();
mainThread.addScheduledTask(new Runnable() {
@Override
public void run() {
World world = Minecraft.getMinecraft().world;
IPhysObjectWorld physObjectWorld = ValkyrienUtils.getPhysObjWorld(world);
QueryableShipData worldData = QueryableShipData.get(world);
for (Map.Entry<UUID, Tuple<ShipTransform, AxisAlignedBB>> transformUpdate : message.shipTransforms.entrySet()) {
final UUID shipID = transformUpdate.getKey();
final ShipTransform shipTransform = transformUpdate.getValue().getFirst();
final AxisAlignedBB shipBB = transformUpdate.getValue().getSecond();
final PhysicsObject physicsObject = ValkyrienUtils.getPhysObjWorld(world).getPhysObjectFromUUID(shipID);
if (physicsObject != null) {
// Do not update the transform in ShipData, that will be done by PhysicsObject.tick()
ITransformInterpolator interpolator = physicsObject.getTransformInterpolator();
interpolator.onNewTransformPacket(shipTransform, shipBB);
}
}
}
});
return null;
}
Aggregations