Skip to content

Commit

Permalink
Format code [skip actions]
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Aug 7, 2023
1 parent b9a493d commit bbf0d4d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
6 changes: 5 additions & 1 deletion src/main/java/emu/grasscutter/game/entity/EntityGadget.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ public void updateState(int state) {
.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!
Expand Down
11 changes: 4 additions & 7 deletions src/main/java/emu/grasscutter/game/inventory/Inventory.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
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;
Expand Down Expand Up @@ -65,17 +64,15 @@ public GameItem getItemByGuid(long id) {
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;
}
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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@

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 {

@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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public boolean execute(
if (targetAmount == 0) {
targetAmount = 1;
}
return targetAmount <= quest.getOwner().getPlayerProgress().getCurrentProgress(condition.getParamStr());
return targetAmount
<= quest.getOwner().getPlayerProgress().getCurrentProgress(condition.getParamStr());
}
}

0 comments on commit bbf0d4d

Please sign in to comment.