use of ValkyrienWarfareCombat.Entity.EntityCannonBall in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class EntityDraggable method tickAddedVelocityForWorld.
public static void tickAddedVelocityForWorld(World world) {
try {
for (int i = 0; i < world.loadedEntityList.size(); i++) {
Entity e = world.loadedEntityList.get(i);
//TODO: Maybe add a check to prevent moving entities that are fixed onto a Ship, but I like the visual effect
if (!(e instanceof PhysicsWrapperEntity) && !(e instanceof EntityCannonBall)) {
EntityDraggable draggable = getDraggableFromEntity(e);
draggable.tickAddedVelocity();
if (draggable.worldBelowFeet == null) {
if (draggable.draggableAsEntity.onGround) {
draggable.velocityAddedToPlayer.zero();
draggable.yawDifVelocity = 0;
} else {
if (draggable.draggableAsEntity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) draggable.draggableAsEntity;
if (player.isCreative() && player.capabilities.isFlying) {
draggable.velocityAddedToPlayer.multiply(.99D * .95D);
draggable.yawDifVelocity *= .95D * .95D;
}
}
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations