mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-21 19:34:42 +01:00
Refactor out some EntrySets
This commit is contained in:
@@ -172,16 +172,11 @@ public class CookingManager extends BasePlayerManager {
|
||||
|
||||
// Construct CookRecipeData protos.
|
||||
List<CookRecipeDataOuterClass.CookRecipeData> data = new ArrayList<>();
|
||||
for (var recipe : unlockedRecipes.entrySet()) {
|
||||
int recipeId = recipe.getKey();
|
||||
int proficiency = recipe.getValue();
|
||||
|
||||
CookRecipeDataOuterClass.CookRecipeData proto = CookRecipeDataOuterClass.CookRecipeData.newBuilder()
|
||||
unlockedRecipes.forEach((recipeId, proficiency) ->
|
||||
data.add(CookRecipeDataOuterClass.CookRecipeData.newBuilder()
|
||||
.setRecipeId(recipeId)
|
||||
.setProficiency(proficiency)
|
||||
.build();
|
||||
data.add(proto);
|
||||
}
|
||||
.build()));
|
||||
|
||||
// Send packet.
|
||||
this.player.sendPacket(new PacketCookDataNotify(data));
|
||||
|
||||
@@ -304,9 +304,8 @@ public class StaminaManager extends BasePlayerManager {
|
||||
session.send(new PacketVehicleStaminaNotify(vehicleId, ((float) newStamina) / 100));
|
||||
}
|
||||
// notify updated
|
||||
for (Map.Entry<String, AfterUpdateStaminaListener> listener : afterUpdateStaminaListeners.entrySet()) {
|
||||
listener.getValue().onAfterUpdateStamina(reason, newStamina, isCharacterStamina);
|
||||
}
|
||||
int s = newStamina;
|
||||
afterUpdateStaminaListeners.forEach((k, v) -> v.onAfterUpdateStamina(reason, s, isCharacterStamina));
|
||||
return newStamina;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user