mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-04 23:32:55 +08:00
refactor: make getGoodsLimit one liner
This commit is contained in:
parent
6bb349d92b
commit
da61d30f44
@ -896,10 +896,8 @@ public class Player implements PlayerHook, FieldFetch {
|
||||
}
|
||||
|
||||
public ShopLimit getGoodsLimit(int goodsId) {
|
||||
Optional<ShopLimit> shopLimit = this.shopLimit.stream().filter(x -> x.getShopGoodId() == goodsId).findFirst();
|
||||
if (shopLimit.isEmpty())
|
||||
return null;
|
||||
return shopLimit.get();
|
||||
Optional<ShopLimit> limitOptional = this.shopLimit.stream().filter(x -> x.getShopGoodId() == goodsId).findFirst();
|
||||
return limitOptional.orElse(null);
|
||||
}
|
||||
|
||||
public void addShopLimit(int goodsId, int boughtCount, int nextRefreshTime) {
|
||||
|
Loading…
Reference in New Issue
Block a user