Skip to content

Commit

Permalink
Various removals of '&' for Javadoc to be happy
Browse files Browse the repository at this point in the history
  • Loading branch information
KingRainbow44 committed Sep 2, 2023
1 parent 34589d0 commit c08ab19
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/main/java/emu/grasscutter/config/ConfigContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static void updateConfig() {
}
}); updated.version = version();

try { // Save configuration & reload.
try { // Save configuration and reload.
Grasscutter.saveConfig(updated);
Grasscutter.loadConfig();
} catch (Exception exception) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public final class ActionSetGlobalValue extends AbilityActionHandler {
@Override
public boolean execute(
Ability ability, AbilityModifierAction action, ByteString abilityData, GameEntity target) {
// Get the key & value.
// Get the key and value.
var valueKey = action.key;
var value = action.ratio;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
import emu.grasscutter.game.props.*;
import emu.grasscutter.net.proto.ActivityInfoOuterClass;
import emu.grasscutter.server.packet.send.PacketActivityScheduleInfoNotify;
import lombok.Getter;

import java.util.*;
import java.util.concurrent.*;
import lombok.Getter;

@SuppressWarnings("unchecked")
@Getter
Expand All @@ -26,7 +27,7 @@ public class ActivityManager extends BasePlayerManager {
}

public static void loadActivityConfigData() {
// scan activity type handler & watcher type
// scan activity type handler and watcher type
var activityHandlerTypeMap = new HashMap<ActivityType, ConstructorAccess<?>>();
var activityWatcherTypeMap = new HashMap<WatcherTriggerType, ConstructorAccess<?>>();
Grasscutter.reflector
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/emu/grasscutter/game/avatar/Avatar.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package emu.grasscutter.game.avatar;

import static emu.grasscutter.config.Configuration.GAME_OPTIONS;

import dev.morphia.annotations.*;
import emu.grasscutter.GameConstants;
import emu.grasscutter.data.GameData;
Expand Down Expand Up @@ -32,12 +30,15 @@
import emu.grasscutter.server.packet.send.*;
import emu.grasscutter.utils.helpers.ProtoHelper;
import it.unimi.dsi.fastutil.ints.*;
import java.util.*;
import java.util.stream.Stream;
import javax.annotation.*;
import lombok.*;
import org.bson.types.ObjectId;

import javax.annotation.*;
import java.util.*;
import java.util.stream.Stream;

import static emu.grasscutter.config.Configuration.GAME_OPTIONS;

@Entity(value = "avatars", useDiscriminator = false)
public class Avatar {
@Transient @Getter private final Int2ObjectMap<GameItem> equips;
Expand Down Expand Up @@ -1299,7 +1300,7 @@ public TrialAvatarInfo toTrialInfo() {

// Check if the avatar is a trial avatar.
if (this.getTrialAvatarId() > 0) {
// Add the artifacts & weapons for the avatar.
// Add the artifacts and weapons for the avatar.
trialAvatar.addAllTrialEquipList(
this.getEquips().values().stream().map(GameItem::toProto).toList());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public BargainResultType applyOffer(int offer) {
return this.result = BargainResultType.BARGAIN_COMPLETE_SUCC;
}

// Compare the offer against the mood & expected price.
// Compare the offer against the mood and expected price.
// The mood is out of 100; 1 mood should decrease the price by 100.
var moodAdjustment = (int) Math.floor(this.getCurrentMood() / 100.0);
var expectedPrice = this.getExpectedPrice() - moodAdjustment;
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/emu/grasscutter/game/quest/GameMainQuest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
import emu.grasscutter.net.proto.ParentQuestOuterClass.ParentQuest;
import emu.grasscutter.server.packet.send.*;
import emu.grasscutter.utils.*;
import java.util.*;
import java.util.stream.Collectors;
import lombok.*;
import org.bson.types.ObjectId;

import java.util.*;
import java.util.stream.Collectors;

@Entity(value = "quests", useDiscriminator = false)
public class GameMainQuest {
@Id private ObjectId id;
Expand Down Expand Up @@ -328,19 +329,19 @@ public boolean hasRewindPosition(int subId, List<Position> posAndRot) {
}

/**
* Checks if the quest has a teleport position. Returns true if it does & adds the target position
* & rotation to the list.
* Checks if the quest has a teleport position. Returns true if it does and adds the target position
* and rotation to the list.
*
* @param subId The sub-quest ID.
* @param posAndRot A list which will contain the position & rotation if the quest has a teleport.
* @param posAndRot A list which will contain the position and rotation if the quest has a teleport.
* @return True if the quest has a teleport position. False otherwise.
*/
public boolean hasTeleportPosition(int subId, List<Position> posAndRot) {
TeleportData questTransmit = GameData.getTeleportDataMap().get(subId);
if (questTransmit == null) return false;

TeleportData.TransmitPoint transmitPoint =
questTransmit.getTransmit_points().size() > 0
!questTransmit.getTransmit_points().isEmpty()
? questTransmit.getTransmit_points().get(0)
: null;
if (transmitPoint == null) return false;
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/emu/grasscutter/game/quest/QuestManager.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package emu.grasscutter.game.quest;

import static emu.grasscutter.GameConstants.DEBUG;
import static emu.grasscutter.config.Configuration.*;

import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.GameData;
import emu.grasscutter.data.binout.*;
Expand All @@ -15,12 +12,16 @@
import emu.grasscutter.server.packet.send.*;
import io.netty.util.concurrent.FastThreadLocalThread;
import it.unimi.dsi.fastutil.ints.*;
import lombok.*;

import javax.annotation.Nonnull;
import java.util.*;
import java.util.concurrent.*;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import lombok.*;

import static emu.grasscutter.GameConstants.DEBUG;
import static emu.grasscutter.config.Configuration.*;

public final class QuestManager extends BasePlayerManager {
@Getter private final Player player;
Expand Down Expand Up @@ -57,7 +58,7 @@ public QuestManager(Player player) {
this.loggedQuests.addAll(
List.of(
31101, // Quest which holds talks 30902 and 30904.
35001, // Quest which unlocks world border & starts act 2.
35001, // Quest which unlocks world border and starts act 2.
30901, // Quest which is completed upon finishing all 3 initial dungeons.
30903, // Quest which is finished when re-entering scene 3. (home world)
30904, // Quest which unlocks the Adventurers' Guild
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/emu/grasscutter/game/world/World.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package emu.grasscutter.game.world;

import static emu.grasscutter.server.event.player.PlayerTeleportEvent.TeleportType.SCRIPT;

import emu.grasscutter.data.GameData;
import emu.grasscutter.data.excels.dungeon.DungeonData;
import emu.grasscutter.game.entity.*;
Expand All @@ -20,10 +18,13 @@
import emu.grasscutter.server.packet.send.*;
import emu.grasscutter.utils.ConversionUtils;
import it.unimi.dsi.fastutil.ints.*;
import java.util.*;
import lombok.*;
import org.jetbrains.annotations.NotNull;

import java.util.*;

import static emu.grasscutter.server.event.player.PlayerTeleportEvent.TeleportType.SCRIPT;

public class World implements Iterable<Player> {
@Getter private final GameServer server;
@Getter private Player host;
Expand Down Expand Up @@ -386,7 +387,7 @@ public boolean transferPlayerToScene(Player player, TeleportProperties teleportP
// Call player teleport event.
PlayerTeleportEvent event =
new PlayerTeleportEvent(player, teleportProperties, player.getPosition());
// Call event & check if it was canceled.
// Call event and check if it was canceled.
event.call();
if (event.isCanceled()) {
return false; // Teleport was canceled.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package emu.grasscutter.server.http.dispatch;

import static emu.grasscutter.config.Configuration.*;

import com.google.gson.*;
import com.google.protobuf.ByteString;
import emu.grasscutter.*;
Expand All @@ -18,11 +16,14 @@
import emu.grasscutter.utils.*;
import io.javalin.Javalin;
import io.javalin.http.Context;
import org.slf4j.Logger;

import java.time.Instant;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Pattern;
import org.slf4j.Logger;

import static emu.grasscutter.config.Configuration.*;

/** Handles requests related to region queries. */
public final class RegionHandler implements Router {
Expand All @@ -31,7 +32,7 @@ public final class RegionHandler implements Router {
private static String regionListResponseCN;

public RegionHandler() {
try { // Read & initialize region data.
try { // Read and initialize region data.
this.initialize();
} catch (Exception exception) {
Grasscutter.getLogger().error("Failed to initialize region data.", exception);
Expand Down

0 comments on commit c08ab19

Please sign in to comment.