mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-04 23:53:20 +08:00
refactor: implicit cast from double to float may be lossy
This commit is contained in:
parent
d5ad077ce1
commit
6e3b3b20a0
@ -475,7 +475,7 @@ public class StaminaManager extends BasePlayerManager {
|
||||
if (consumption.amount < 0 && isCharacterStamina) {
|
||||
// Do not apply reduction factor when recovering stamina
|
||||
if (player.getTeamManager().getTeamResonances().contains(10301)) {
|
||||
consumption.amount *= 0.85f;
|
||||
consumption.amount *= (int) 0.85f;
|
||||
}
|
||||
}
|
||||
// Delay 1 seconds before starts recovering stamina
|
||||
@ -543,8 +543,8 @@ public class StaminaManager extends BasePlayerManager {
|
||||
consumption.amount = ConsumptionType.CLIMBING.amount;
|
||||
}
|
||||
// Climbing specific reductions
|
||||
consumption.amount *= getFoodCostReductionFactor(ClimbFoodReductionMap);
|
||||
consumption.amount *= getTalentCostReductionFactor(ClimbTalentReductionMap);
|
||||
consumption.amount *= (int) getFoodCostReductionFactor(ClimbFoodReductionMap);
|
||||
consumption.amount *= (int) getTalentCostReductionFactor(ClimbTalentReductionMap);
|
||||
return consumption;
|
||||
}
|
||||
|
||||
@ -560,8 +560,8 @@ public class StaminaManager extends BasePlayerManager {
|
||||
consumption.amount = ConsumptionType.SWIM_DASH.amount;
|
||||
}
|
||||
// Swimming specific reductions
|
||||
consumption.amount *= getFoodCostReductionFactor(SwimFoodReductionMap);
|
||||
consumption.amount *= getTalentCostReductionFactor(SwimTalentReductionMap);
|
||||
consumption.amount *= (int) getFoodCostReductionFactor(SwimFoodReductionMap);
|
||||
consumption.amount *= (int) getTalentCostReductionFactor(SwimTalentReductionMap);
|
||||
return consumption;
|
||||
}
|
||||
|
||||
@ -571,7 +571,7 @@ public class StaminaManager extends BasePlayerManager {
|
||||
consumption.type = ConsumptionType.DASH;
|
||||
consumption.amount = ConsumptionType.DASH.amount;
|
||||
// Dashing specific reductions
|
||||
consumption.amount *= getFoodCostReductionFactor(DashFoodReductionMap);
|
||||
consumption.amount *= (int) getFoodCostReductionFactor(DashFoodReductionMap);
|
||||
}
|
||||
return consumption;
|
||||
}
|
||||
@ -583,8 +583,8 @@ public class StaminaManager extends BasePlayerManager {
|
||||
}
|
||||
Consumption consumption = new Consumption(ConsumptionType.FLY);
|
||||
// Flying specific reductions
|
||||
consumption.amount *= getFoodCostReductionFactor(FlyFoodReductionMap);
|
||||
consumption.amount *= getTalentCostReductionFactor(FlyTalentReductionMap);
|
||||
consumption.amount *= (int) getFoodCostReductionFactor(FlyFoodReductionMap);
|
||||
consumption.amount *= (int) getTalentCostReductionFactor(FlyTalentReductionMap);
|
||||
return consumption;
|
||||
}
|
||||
|
||||
|
@ -143,8 +143,8 @@ public class Position implements Serializable {
|
||||
|
||||
/** In radians */
|
||||
public Position translate(float dist, float angle) {
|
||||
this.x += dist * Math.sin(angle);
|
||||
this.y += dist * Math.cos(angle);
|
||||
this.x += (float) (dist * Math.sin(angle));
|
||||
this.y += (float) (dist * Math.cos(angle));
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -173,8 +173,8 @@ public class Position implements Serializable {
|
||||
|
||||
public Position translateWithDegrees(float dist, float angle) {
|
||||
angle = (float) Math.toRadians(angle);
|
||||
this.x += dist * Math.sin(angle);
|
||||
this.y += -dist * Math.cos(angle);
|
||||
this.x += (float) (dist * Math.sin(angle));
|
||||
this.y += (float) (-dist * Math.cos(angle));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user