mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-07 00:03:04 +08:00
perf: stream api can be simplified here
This commit is contained in:
parent
3d00abcc91
commit
45bf5edb13
@ -314,6 +314,6 @@ public final class ForgingManager extends BasePlayerManager {
|
|||||||
this.sendForgeQueueDataNotify();
|
this.sendForgeQueueDataNotify();
|
||||||
|
|
||||||
// Reset changed flags.
|
// Reset changed flags.
|
||||||
this.player.getActiveForges().stream().forEach(forge -> forge.setChanged(false));
|
this.player.getActiveForges().forEach(forge -> forge.setChanged(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,13 +26,13 @@ public class PacketCreateVehicleRsp extends BasePacket {
|
|||||||
&& ((EntityVehicle) entity).getOwner().equals(player))
|
&& ((EntityVehicle) entity).getOwner().equals(player))
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
previousVehicles.stream()
|
previousVehicles
|
||||||
.forEach(
|
.forEach(
|
||||||
entity -> {
|
entity -> {
|
||||||
List<VehicleMember> vehicleMembers =
|
List<VehicleMember> vehicleMembers =
|
||||||
((EntityVehicle) entity).getVehicleMembers().stream().toList();
|
((EntityVehicle) entity).getVehicleMembers().stream().toList();
|
||||||
|
|
||||||
vehicleMembers.stream()
|
vehicleMembers
|
||||||
.forEach(
|
.forEach(
|
||||||
vehicleMember -> player
|
vehicleMember -> player
|
||||||
.getScene()
|
.getScene()
|
||||||
|
@ -29,7 +29,7 @@ public class PacketStoreItemDelNotify extends BasePacket {
|
|||||||
StoreItemDelNotify.Builder proto =
|
StoreItemDelNotify.Builder proto =
|
||||||
StoreItemDelNotify.newBuilder().setStoreType(StoreType.STORE_TYPE_PACK);
|
StoreItemDelNotify.newBuilder().setStoreType(StoreType.STORE_TYPE_PACK);
|
||||||
|
|
||||||
items.stream().forEach(item -> proto.addGuidList(item.getGuid()));
|
items.forEach(item -> proto.addGuidList(item.getGuid()));
|
||||||
|
|
||||||
this.setData(proto);
|
this.setData(proto);
|
||||||
}
|
}
|
||||||
|
@ -264,7 +264,7 @@ public final class Language {
|
|||||||
List<Int2ObjectMap<String>> languageMaps =
|
List<Int2ObjectMap<String>> languageMaps =
|
||||||
IntStream.range(0, TextStrings.NUM_LANGUAGES)
|
IntStream.range(0, TextStrings.NUM_LANGUAGES)
|
||||||
.mapToObj(mapLanguageMaps::get)
|
.mapToObj(mapLanguageMaps::get)
|
||||||
.collect(Collectors.toList());
|
.toList();
|
||||||
|
|
||||||
Map<TextStrings, TextStrings> canonicalTextStrings = new HashMap<>();
|
Map<TextStrings, TextStrings> canonicalTextStrings = new HashMap<>();
|
||||||
return new Int2ObjectOpenHashMap<>(
|
return new Int2ObjectOpenHashMap<>(
|
||||||
|
Loading…
Reference in New Issue
Block a user