Format code [skip actions]

This commit is contained in:
github-actions 2023-08-07 22:04:40 +00:00
parent b9a493d424
commit bbf0d4dda1
4 changed files with 14 additions and 13 deletions

View File

@ -158,7 +158,11 @@ public class EntityGadget extends EntityBaseGadget {
.getScriptManager()
.callEvent(
new ScriptArgs(
this.getGroupId(), EventType.EVENT_GADGET_STATE_CHANGE, state, this.getConfigId()).setParam3(oldState));
this.getGroupId(),
EventType.EVENT_GADGET_STATE_CHANGE,
state,
this.getConfigId())
.setParam3(oldState));
}
@Deprecated(forRemoval = true) // Dont use!

View File

@ -17,10 +17,9 @@ import emu.grasscutter.server.packet.send.*;
import emu.grasscutter.utils.Utils;
import it.unimi.dsi.fastutil.ints.*;
import it.unimi.dsi.fastutil.longs.*;
import lombok.val;
import javax.annotation.Nullable;
import java.util.*;
import javax.annotation.Nullable;
import lombok.val;
public class Inventory extends BasePlayerManager implements Iterable<GameItem> {
private final Long2ObjectMap<GameItem> store;
@ -65,8 +64,7 @@ public class Inventory extends BasePlayerManager implements Iterable<GameItem> {
return this.getItems().get(id);
}
@Nullable
public InventoryTab getInventoryTabByItemId(int itemId) {
@Nullable public InventoryTab getInventoryTabByItemId(int itemId) {
val itemData = GameData.getItemDataMap().get(itemId);
if (itemData == null || itemData.getItemType() == null) {
return null;
@ -74,8 +72,7 @@ public class Inventory extends BasePlayerManager implements Iterable<GameItem> {
return getInventoryTab(itemData.getItemType());
}
@Nullable
public GameItem getItemById(int itemId) {
@Nullable public GameItem getItemById(int itemId) {
val inventoryTab = this.getInventoryTabByItemId(itemId);
return inventoryTab != null ? inventoryTab.getItemById(itemId) : null;
}

View File

@ -4,8 +4,8 @@ import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_COMPLE
import emu.grasscutter.data.excels.quest.QuestData;
import emu.grasscutter.game.quest.*;
import lombok.val;
import java.util.Arrays;
import lombok.val;
@QuestValueContent(QUEST_CONTENT_COMPLETE_ANY_TALK)
public class ContentCompleteAnyTalk extends BaseContent {
@ -13,9 +13,8 @@ public class ContentCompleteAnyTalk extends BaseContent {
@Override
public boolean execute(
GameQuest quest, QuestData.QuestContentCondition condition, String paramStr, int... params) {
var conditionTalk = Arrays.stream(condition.getParamStr().split(","))
.mapToInt(Integer::parseInt)
.toArray();
var conditionTalk =
Arrays.stream(condition.getParamStr().split(",")).mapToInt(Integer::parseInt).toArray();
for (var talkId : conditionTalk) {
val checkMainQuest = quest.getOwner().getQuestManager().getMainQuestByTalkId(talkId);

View File

@ -16,6 +16,7 @@ public class ContentLuaNotify extends BaseContent {
if (targetAmount == 0) {
targetAmount = 1;
}
return targetAmount <= quest.getOwner().getPlayerProgress().getCurrentProgress(condition.getParamStr());
return targetAmount
<= quest.getOwner().getPlayerProgress().getCurrentProgress(condition.getParamStr());
}
}