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