mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-07 00:23:20 +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) {
|
public ShopLimit getGoodsLimit(int goodsId) {
|
||||||
Optional<ShopLimit> shopLimit = this.shopLimit.stream().filter(x -> x.getShopGoodId() == goodsId).findFirst();
|
Optional<ShopLimit> limitOptional = this.shopLimit.stream().filter(x -> x.getShopGoodId() == goodsId).findFirst();
|
||||||
if (shopLimit.isEmpty())
|
return limitOptional.orElse(null);
|
||||||
return null;
|
|
||||||
return shopLimit.get();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addShopLimit(int goodsId, int boughtCount, int nextRefreshTime) {
|
public void addShopLimit(int goodsId, int boughtCount, int nextRefreshTime) {
|
||||||
|
Loading…
Reference in New Issue
Block a user