diff --git a/src/main/java/emu/grasscutter/game/managers/stamina/StaminaManager.java b/src/main/java/emu/grasscutter/game/managers/stamina/StaminaManager.java index 79366e79f..037aab174 100644 --- a/src/main/java/emu/grasscutter/game/managers/stamina/StaminaManager.java +++ b/src/main/java/emu/grasscutter/game/managers/stamina/StaminaManager.java @@ -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; } diff --git a/src/main/java/emu/grasscutter/game/world/Position.java b/src/main/java/emu/grasscutter/game/world/Position.java index 780a6c213..249f6733e 100644 --- a/src/main/java/emu/grasscutter/game/world/Position.java +++ b/src/main/java/emu/grasscutter/game/world/Position.java @@ -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; }