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() .getScriptManager()
.callEvent( .callEvent(
new ScriptArgs( 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! @Deprecated(forRemoval = true) // Dont use!

View File

@ -17,10 +17,9 @@ import emu.grasscutter.server.packet.send.*;
import emu.grasscutter.utils.Utils; import emu.grasscutter.utils.Utils;
import it.unimi.dsi.fastutil.ints.*; import it.unimi.dsi.fastutil.ints.*;
import it.unimi.dsi.fastutil.longs.*; import it.unimi.dsi.fastutil.longs.*;
import lombok.val;
import javax.annotation.Nullable;
import java.util.*; import java.util.*;
import javax.annotation.Nullable;
import lombok.val;
public class Inventory extends BasePlayerManager implements Iterable<GameItem> { public class Inventory extends BasePlayerManager implements Iterable<GameItem> {
private final Long2ObjectMap<GameItem> store; private final Long2ObjectMap<GameItem> store;
@ -65,8 +64,7 @@ public class Inventory extends BasePlayerManager implements Iterable<GameItem> {
return this.getItems().get(id); return this.getItems().get(id);
} }
@Nullable @Nullable public InventoryTab getInventoryTabByItemId(int itemId) {
public InventoryTab getInventoryTabByItemId(int itemId) {
val itemData = GameData.getItemDataMap().get(itemId); val itemData = GameData.getItemDataMap().get(itemId);
if (itemData == null || itemData.getItemType() == null) { if (itemData == null || itemData.getItemType() == null) {
return null; return null;
@ -74,8 +72,7 @@ public class Inventory extends BasePlayerManager implements Iterable<GameItem> {
return getInventoryTab(itemData.getItemType()); return getInventoryTab(itemData.getItemType());
} }
@Nullable @Nullable public GameItem getItemById(int itemId) {
public GameItem getItemById(int itemId) {
val inventoryTab = this.getInventoryTabByItemId(itemId); val inventoryTab = this.getInventoryTabByItemId(itemId);
return inventoryTab != null ? inventoryTab.getItemById(itemId) : null; 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.data.excels.quest.QuestData;
import emu.grasscutter.game.quest.*; import emu.grasscutter.game.quest.*;
import lombok.val;
import java.util.Arrays; import java.util.Arrays;
import lombok.val;
@QuestValueContent(QUEST_CONTENT_COMPLETE_ANY_TALK) @QuestValueContent(QUEST_CONTENT_COMPLETE_ANY_TALK)
public class ContentCompleteAnyTalk extends BaseContent { public class ContentCompleteAnyTalk extends BaseContent {
@ -13,9 +13,8 @@ public class ContentCompleteAnyTalk extends BaseContent {
@Override @Override
public boolean execute( public boolean execute(
GameQuest quest, QuestData.QuestContentCondition condition, String paramStr, int... params) { GameQuest quest, QuestData.QuestContentCondition condition, String paramStr, int... params) {
var conditionTalk = Arrays.stream(condition.getParamStr().split(",")) var conditionTalk =
.mapToInt(Integer::parseInt) Arrays.stream(condition.getParamStr().split(",")).mapToInt(Integer::parseInt).toArray();
.toArray();
for (var talkId : conditionTalk) { for (var talkId : conditionTalk) {
val checkMainQuest = quest.getOwner().getQuestManager().getMainQuestByTalkId(talkId); val checkMainQuest = quest.getOwner().getQuestManager().getMainQuestByTalkId(talkId);

View File

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