mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-25 23:07:50 +00:00
Various removals of '&' for Javadoc to be happy
This commit is contained in:
parent
34589d0128
commit
c08ab19d84
@ -68,7 +68,7 @@ public class ConfigContainer {
|
|||||||
}
|
}
|
||||||
}); updated.version = version();
|
}); updated.version = version();
|
||||||
|
|
||||||
try { // Save configuration & reload.
|
try { // Save configuration and reload.
|
||||||
Grasscutter.saveConfig(updated);
|
Grasscutter.saveConfig(updated);
|
||||||
Grasscutter.loadConfig();
|
Grasscutter.loadConfig();
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
|
@ -11,7 +11,7 @@ public final class ActionSetGlobalValue extends AbilityActionHandler {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(
|
public boolean execute(
|
||||||
Ability ability, AbilityModifierAction action, ByteString abilityData, GameEntity target) {
|
Ability ability, AbilityModifierAction action, ByteString abilityData, GameEntity target) {
|
||||||
// Get the key & value.
|
// Get the key and value.
|
||||||
var valueKey = action.key;
|
var valueKey = action.key;
|
||||||
var value = action.ratio;
|
var value = action.ratio;
|
||||||
|
|
||||||
|
@ -8,9 +8,10 @@ import emu.grasscutter.game.player.*;
|
|||||||
import emu.grasscutter.game.props.*;
|
import emu.grasscutter.game.props.*;
|
||||||
import emu.grasscutter.net.proto.ActivityInfoOuterClass;
|
import emu.grasscutter.net.proto.ActivityInfoOuterClass;
|
||||||
import emu.grasscutter.server.packet.send.PacketActivityScheduleInfoNotify;
|
import emu.grasscutter.server.packet.send.PacketActivityScheduleInfoNotify;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Getter
|
@Getter
|
||||||
@ -26,7 +27,7 @@ public class ActivityManager extends BasePlayerManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void loadActivityConfigData() {
|
public static void loadActivityConfigData() {
|
||||||
// scan activity type handler & watcher type
|
// scan activity type handler and watcher type
|
||||||
var activityHandlerTypeMap = new HashMap<ActivityType, ConstructorAccess<?>>();
|
var activityHandlerTypeMap = new HashMap<ActivityType, ConstructorAccess<?>>();
|
||||||
var activityWatcherTypeMap = new HashMap<WatcherTriggerType, ConstructorAccess<?>>();
|
var activityWatcherTypeMap = new HashMap<WatcherTriggerType, ConstructorAccess<?>>();
|
||||||
Grasscutter.reflector
|
Grasscutter.reflector
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package emu.grasscutter.game.avatar;
|
package emu.grasscutter.game.avatar;
|
||||||
|
|
||||||
import static emu.grasscutter.config.Configuration.GAME_OPTIONS;
|
|
||||||
|
|
||||||
import dev.morphia.annotations.*;
|
import dev.morphia.annotations.*;
|
||||||
import emu.grasscutter.GameConstants;
|
import emu.grasscutter.GameConstants;
|
||||||
import emu.grasscutter.data.GameData;
|
import emu.grasscutter.data.GameData;
|
||||||
@ -32,12 +30,15 @@ import emu.grasscutter.net.proto.TrialAvatarInfoOuterClass.TrialAvatarInfo;
|
|||||||
import emu.grasscutter.server.packet.send.*;
|
import emu.grasscutter.server.packet.send.*;
|
||||||
import emu.grasscutter.utils.helpers.ProtoHelper;
|
import emu.grasscutter.utils.helpers.ProtoHelper;
|
||||||
import it.unimi.dsi.fastutil.ints.*;
|
import it.unimi.dsi.fastutil.ints.*;
|
||||||
import java.util.*;
|
|
||||||
import java.util.stream.Stream;
|
|
||||||
import javax.annotation.*;
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.bson.types.ObjectId;
|
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)
|
@Entity(value = "avatars", useDiscriminator = false)
|
||||||
public class Avatar {
|
public class Avatar {
|
||||||
@Transient @Getter private final Int2ObjectMap<GameItem> equips;
|
@Transient @Getter private final Int2ObjectMap<GameItem> equips;
|
||||||
@ -1299,7 +1300,7 @@ public class Avatar {
|
|||||||
|
|
||||||
// Check if the avatar is a trial avatar.
|
// Check if the avatar is a trial avatar.
|
||||||
if (this.getTrialAvatarId() > 0) {
|
if (this.getTrialAvatarId() > 0) {
|
||||||
// Add the artifacts & weapons for the avatar.
|
// Add the artifacts and weapons for the avatar.
|
||||||
trialAvatar.addAllTrialEquipList(
|
trialAvatar.addAllTrialEquipList(
|
||||||
this.getEquips().values().stream().map(GameItem::toProto).toList());
|
this.getEquips().values().stream().map(GameItem::toProto).toList());
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ public final class BargainRecord {
|
|||||||
return this.result = BargainResultType.BARGAIN_COMPLETE_SUCC;
|
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.
|
// The mood is out of 100; 1 mood should decrease the price by 100.
|
||||||
var moodAdjustment = (int) Math.floor(this.getCurrentMood() / 100.0);
|
var moodAdjustment = (int) Math.floor(this.getCurrentMood() / 100.0);
|
||||||
var expectedPrice = this.getExpectedPrice() - moodAdjustment;
|
var expectedPrice = this.getExpectedPrice() - moodAdjustment;
|
||||||
|
@ -16,11 +16,12 @@ import emu.grasscutter.net.proto.ChildQuestOuterClass.ChildQuest;
|
|||||||
import emu.grasscutter.net.proto.ParentQuestOuterClass.ParentQuest;
|
import emu.grasscutter.net.proto.ParentQuestOuterClass.ParentQuest;
|
||||||
import emu.grasscutter.server.packet.send.*;
|
import emu.grasscutter.server.packet.send.*;
|
||||||
import emu.grasscutter.utils.*;
|
import emu.grasscutter.utils.*;
|
||||||
import java.util.*;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.bson.types.ObjectId;
|
import org.bson.types.ObjectId;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Entity(value = "quests", useDiscriminator = false)
|
@Entity(value = "quests", useDiscriminator = false)
|
||||||
public class GameMainQuest {
|
public class GameMainQuest {
|
||||||
@Id private ObjectId id;
|
@Id private ObjectId id;
|
||||||
@ -328,11 +329,11 @@ public class GameMainQuest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the quest has a teleport position. Returns true if it does & adds the target position
|
* Checks if the quest has a teleport position. Returns true if it does and adds the target position
|
||||||
* & rotation to the list.
|
* and rotation to the list.
|
||||||
*
|
*
|
||||||
* @param subId The sub-quest ID.
|
* @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.
|
* @return True if the quest has a teleport position. False otherwise.
|
||||||
*/
|
*/
|
||||||
public boolean hasTeleportPosition(int subId, List<Position> posAndRot) {
|
public boolean hasTeleportPosition(int subId, List<Position> posAndRot) {
|
||||||
@ -340,7 +341,7 @@ public class GameMainQuest {
|
|||||||
if (questTransmit == null) return false;
|
if (questTransmit == null) return false;
|
||||||
|
|
||||||
TeleportData.TransmitPoint transmitPoint =
|
TeleportData.TransmitPoint transmitPoint =
|
||||||
questTransmit.getTransmit_points().size() > 0
|
!questTransmit.getTransmit_points().isEmpty()
|
||||||
? questTransmit.getTransmit_points().get(0)
|
? questTransmit.getTransmit_points().get(0)
|
||||||
: null;
|
: null;
|
||||||
if (transmitPoint == null) return false;
|
if (transmitPoint == null) return false;
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
package emu.grasscutter.game.quest;
|
package emu.grasscutter.game.quest;
|
||||||
|
|
||||||
import static emu.grasscutter.GameConstants.DEBUG;
|
|
||||||
import static emu.grasscutter.config.Configuration.*;
|
|
||||||
|
|
||||||
import emu.grasscutter.Grasscutter;
|
import emu.grasscutter.Grasscutter;
|
||||||
import emu.grasscutter.data.GameData;
|
import emu.grasscutter.data.GameData;
|
||||||
import emu.grasscutter.data.binout.*;
|
import emu.grasscutter.data.binout.*;
|
||||||
@ -15,12 +12,16 @@ import emu.grasscutter.net.proto.GivingRecordOuterClass.GivingRecord;
|
|||||||
import emu.grasscutter.server.packet.send.*;
|
import emu.grasscutter.server.packet.send.*;
|
||||||
import io.netty.util.concurrent.FastThreadLocalThread;
|
import io.netty.util.concurrent.FastThreadLocalThread;
|
||||||
import it.unimi.dsi.fastutil.ints.*;
|
import it.unimi.dsi.fastutil.ints.*;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.stream.Collectors;
|
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 {
|
public final class QuestManager extends BasePlayerManager {
|
||||||
@Getter private final Player player;
|
@Getter private final Player player;
|
||||||
@ -57,7 +58,7 @@ public final class QuestManager extends BasePlayerManager {
|
|||||||
this.loggedQuests.addAll(
|
this.loggedQuests.addAll(
|
||||||
List.of(
|
List.of(
|
||||||
31101, // Quest which holds talks 30902 and 30904.
|
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.
|
30901, // Quest which is completed upon finishing all 3 initial dungeons.
|
||||||
30903, // Quest which is finished when re-entering scene 3. (home world)
|
30903, // Quest which is finished when re-entering scene 3. (home world)
|
||||||
30904, // Quest which unlocks the Adventurers' Guild
|
30904, // Quest which unlocks the Adventurers' Guild
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package emu.grasscutter.game.world;
|
package emu.grasscutter.game.world;
|
||||||
|
|
||||||
import static emu.grasscutter.server.event.player.PlayerTeleportEvent.TeleportType.SCRIPT;
|
|
||||||
|
|
||||||
import emu.grasscutter.data.GameData;
|
import emu.grasscutter.data.GameData;
|
||||||
import emu.grasscutter.data.excels.dungeon.DungeonData;
|
import emu.grasscutter.data.excels.dungeon.DungeonData;
|
||||||
import emu.grasscutter.game.entity.*;
|
import emu.grasscutter.game.entity.*;
|
||||||
@ -20,10 +18,13 @@ import emu.grasscutter.server.game.GameServer;
|
|||||||
import emu.grasscutter.server.packet.send.*;
|
import emu.grasscutter.server.packet.send.*;
|
||||||
import emu.grasscutter.utils.ConversionUtils;
|
import emu.grasscutter.utils.ConversionUtils;
|
||||||
import it.unimi.dsi.fastutil.ints.*;
|
import it.unimi.dsi.fastutil.ints.*;
|
||||||
import java.util.*;
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import static emu.grasscutter.server.event.player.PlayerTeleportEvent.TeleportType.SCRIPT;
|
||||||
|
|
||||||
public class World implements Iterable<Player> {
|
public class World implements Iterable<Player> {
|
||||||
@Getter private final GameServer server;
|
@Getter private final GameServer server;
|
||||||
@Getter private Player host;
|
@Getter private Player host;
|
||||||
@ -386,7 +387,7 @@ public class World implements Iterable<Player> {
|
|||||||
// Call player teleport event.
|
// Call player teleport event.
|
||||||
PlayerTeleportEvent event =
|
PlayerTeleportEvent event =
|
||||||
new PlayerTeleportEvent(player, teleportProperties, player.getPosition());
|
new PlayerTeleportEvent(player, teleportProperties, player.getPosition());
|
||||||
// Call event & check if it was canceled.
|
// Call event and check if it was canceled.
|
||||||
event.call();
|
event.call();
|
||||||
if (event.isCanceled()) {
|
if (event.isCanceled()) {
|
||||||
return false; // Teleport was canceled.
|
return false; // Teleport was canceled.
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package emu.grasscutter.server.http.dispatch;
|
package emu.grasscutter.server.http.dispatch;
|
||||||
|
|
||||||
import static emu.grasscutter.config.Configuration.*;
|
|
||||||
|
|
||||||
import com.google.gson.*;
|
import com.google.gson.*;
|
||||||
import com.google.protobuf.ByteString;
|
import com.google.protobuf.ByteString;
|
||||||
import emu.grasscutter.*;
|
import emu.grasscutter.*;
|
||||||
@ -18,11 +16,14 @@ import emu.grasscutter.server.http.objects.QueryCurRegionRspJson;
|
|||||||
import emu.grasscutter.utils.*;
|
import emu.grasscutter.utils.*;
|
||||||
import io.javalin.Javalin;
|
import io.javalin.Javalin;
|
||||||
import io.javalin.http.Context;
|
import io.javalin.http.Context;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import org.slf4j.Logger;
|
|
||||||
|
import static emu.grasscutter.config.Configuration.*;
|
||||||
|
|
||||||
/** Handles requests related to region queries. */
|
/** Handles requests related to region queries. */
|
||||||
public final class RegionHandler implements Router {
|
public final class RegionHandler implements Router {
|
||||||
@ -31,7 +32,7 @@ public final class RegionHandler implements Router {
|
|||||||
private static String regionListResponseCN;
|
private static String regionListResponseCN;
|
||||||
|
|
||||||
public RegionHandler() {
|
public RegionHandler() {
|
||||||
try { // Read & initialize region data.
|
try { // Read and initialize region data.
|
||||||
this.initialize();
|
this.initialize();
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
Grasscutter.getLogger().error("Failed to initialize region data.", exception);
|
Grasscutter.getLogger().error("Failed to initialize region data.", exception);
|
||||||
|
Loading…
Reference in New Issue
Block a user