From 0db69882a309702c5137581123706bcc37097438 Mon Sep 17 00:00:00 2001 From: hamusuke Date: Sat, 2 Sep 2023 09:31:55 +0900 Subject: [PATCH 01/10] fix: sync home avatar costume (#2326) --- .../game/avatar/AvatarStorage.java | 25 +++++++++++++------ .../emu/grasscutter/game/home/GameHome.java | 23 ++++++++++++++++- .../grasscutter/game/home/HomeNPCItem.java | 9 ++++--- .../PacketHomeAvatarCostumeChangeNotify.java | 15 +++++++++++ 4 files changed, 60 insertions(+), 12 deletions(-) create mode 100644 src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarCostumeChangeNotify.java diff --git a/src/main/java/emu/grasscutter/game/avatar/AvatarStorage.java b/src/main/java/emu/grasscutter/game/avatar/AvatarStorage.java index 0a238f5f6..fe35557ee 100644 --- a/src/main/java/emu/grasscutter/game/avatar/AvatarStorage.java +++ b/src/main/java/emu/grasscutter/game/avatar/AvatarStorage.java @@ -1,17 +1,23 @@ package emu.grasscutter.game.avatar; import emu.grasscutter.data.GameData; -import emu.grasscutter.data.excels.avatar.*; +import emu.grasscutter.data.excels.avatar.AvatarData; +import emu.grasscutter.data.excels.avatar.AvatarSkillDepotData; import emu.grasscutter.database.DatabaseHelper; import emu.grasscutter.game.entity.EntityAvatar; import emu.grasscutter.game.inventory.GameItem; -import emu.grasscutter.game.player.*; +import emu.grasscutter.game.player.BasePlayerManager; +import emu.grasscutter.game.player.Player; import emu.grasscutter.server.event.entity.EntityCreationEvent; -import emu.grasscutter.server.packet.send.*; -import it.unimi.dsi.fastutil.ints.*; -import it.unimi.dsi.fastutil.longs.*; +import emu.grasscutter.server.packet.send.PacketAvatarChangeCostumeNotify; +import emu.grasscutter.server.packet.send.PacketAvatarFlycloakChangeNotify; +import it.unimi.dsi.fastutil.ints.Int2ObjectMap; +import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; +import it.unimi.dsi.fastutil.longs.Long2ObjectMap; +import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; -import java.util.*; +import java.util.Iterator; +import java.util.List; public class AvatarStorage extends BasePlayerManager implements Iterable { private final Int2ObjectMap avatars; @@ -114,11 +120,14 @@ public class AvatarStorage extends BasePlayerManager implements Iterable entity = EntityCreationEvent.call( EntityAvatar.class, new Class[] {Avatar.class}, new Object[] {avatar}); - getPlayer().sendPacket(new PacketAvatarChangeCostumeNotify(entity)); + getPlayer().getWorld().broadcastPacket(new PacketAvatarChangeCostumeNotify(entity)); } else { - getPlayer().getScene().broadcastPacket(new PacketAvatarChangeCostumeNotify(entity)); + getPlayer().getWorld().broadcastPacket(new PacketAvatarChangeCostumeNotify(entity)); } + // Notify costume change to HomeWorld + this.getPlayer().getHome().onPlayerChangedAvatarCostume(avatar); + // Done return true; } diff --git a/src/main/java/emu/grasscutter/game/home/GameHome.java b/src/main/java/emu/grasscutter/game/home/GameHome.java index bcc2d68f0..47ce2b54c 100644 --- a/src/main/java/emu/grasscutter/game/home/GameHome.java +++ b/src/main/java/emu/grasscutter/game/home/GameHome.java @@ -6,11 +6,14 @@ import emu.grasscutter.data.GameData; import emu.grasscutter.data.excels.HomeWorldLevelData; import emu.grasscutter.data.excels.scene.SceneData; import emu.grasscutter.database.DatabaseHelper; +import emu.grasscutter.game.avatar.Avatar; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.props.SceneType; import emu.grasscutter.server.packet.send.*; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; -import lombok.*; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.Data; import lombok.experimental.FieldDefaults; import java.time.ZonedDateTime; @@ -102,6 +105,24 @@ public class GameHome { player.getSession().send(new PacketHomeResourceNotify(player)); } + public void onPlayerChangedAvatarCostume(Avatar avatar) { + var world = this.player.getServer().getHomeWorldOrCreate(this.player); + world.broadcastPacket(new PacketHomeAvatarCostumeChangeNotify(avatar.getAvatarId(), avatar.getCostume())); + + this.sceneMap.values().stream() + .map(HomeSceneItem::getBlockItems) + .map(Map::values) + .flatMap(Collection::stream) + .map(HomeBlockItem::getDeployNPCList) + .flatMap(Collection::stream) + .filter(homeNPCItem -> homeNPCItem.getAvatarId() == avatar.getAvatarId()) + .forEach(homeNPCItem -> homeNPCItem.setCostumeId(avatar.getCostume())); + + this.save(); + + world.getPlayers().forEach(player -> player.sendPacket(new PacketHomeMarkPointNotify(player))); + } + // Tell the client the reward is claimed or realm unlocked public void onClaimReward(Player player) { player.getSession().send(new PacketPlayerHomeCompInfoNotify(player)); diff --git a/src/main/java/emu/grasscutter/game/home/HomeNPCItem.java b/src/main/java/emu/grasscutter/game/home/HomeNPCItem.java index f4d4d54a9..3a1795a5f 100644 --- a/src/main/java/emu/grasscutter/game/home/HomeNPCItem.java +++ b/src/main/java/emu/grasscutter/game/home/HomeNPCItem.java @@ -3,8 +3,12 @@ package emu.grasscutter.game.home; import dev.morphia.annotations.Entity; import emu.grasscutter.data.GameData; import emu.grasscutter.game.world.Position; -import emu.grasscutter.net.proto.*; -import lombok.*; +import emu.grasscutter.net.proto.HomeMarkPointFurnitureDataOuterClass; +import emu.grasscutter.net.proto.HomeMarkPointNPCDataOuterClass; +import emu.grasscutter.net.proto.HomeNpcDataOuterClass; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.Data; import lombok.experimental.FieldDefaults; import org.jetbrains.annotations.Nullable; @@ -24,7 +28,6 @@ public class HomeNPCItem implements HomeMarkPointProtoFactory { .avatarId(homeNpcData.getAvatarId()) .spawnPos(new Position(homeNpcData.getSpawnPos())) .spawnRot(new Position(homeNpcData.getSpawnRot())) - .costumeId(homeNpcData.getCostumeId()) .build(); } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarCostumeChangeNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarCostumeChangeNotify.java new file mode 100644 index 000000000..4533b38e1 --- /dev/null +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarCostumeChangeNotify.java @@ -0,0 +1,15 @@ +package emu.grasscutter.server.packet.send; + +import emu.grasscutter.net.packet.BasePacket; +import emu.grasscutter.net.packet.PacketOpcodes; +import emu.grasscutter.net.proto.HomeAvatarCostumeChangeNotifyOuterClass; + +public class PacketHomeAvatarCostumeChangeNotify extends BasePacket { + public PacketHomeAvatarCostumeChangeNotify(int avatarId, int costumeId) { + super(PacketOpcodes.HomeAvatarCostumeChangeNotify); + + this.setData(HomeAvatarCostumeChangeNotifyOuterClass.HomeAvatarCostumeChangeNotify.newBuilder() + .setAvatarId(avatarId) + .setCostumeId(costumeId)); + } +} From 717a358636adca6bf0c6c5f3ae38a08fa7029cda Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 2 Sep 2023 00:33:12 +0000 Subject: [PATCH 02/10] Format code [skip actions] --- .../java/emu/grasscutter/Grasscutter.java | 21 +-- .../auth/AuthenticationSystem.java | 3 +- .../auth/DefaultAuthentication.java | 6 +- .../auth/DefaultAuthenticators.java | 9 +- .../grasscutter/command/CommandHandler.java | 5 +- .../grasscutter/command/CommandHelpers.java | 2 +- .../emu/grasscutter/command/CommandMap.java | 7 +- .../command/commands/AccountCommand.java | 5 +- .../command/commands/AchievementCommand.java | 1 - .../command/commands/AnnounceCommand.java | 5 +- .../command/commands/BanCommand.java | 1 - .../command/commands/ClearCommand.java | 7 +- .../command/commands/CoopCommand.java | 1 - .../command/commands/CutsceneCommand.java | 3 +- .../command/commands/DebugCommand.java | 1 - .../command/commands/EnterDungeonCommand.java | 5 +- .../command/commands/EntityCommand.java | 9 +- .../command/commands/GiveCommand.java | 9 +- .../command/commands/GroupCommand.java | 5 +- .../command/commands/HealCommand.java | 5 +- .../command/commands/HelpCommand.java | 5 +- .../command/commands/KickCommand.java | 1 - .../command/commands/KillAllCommand.java | 5 +- .../commands/KillCharacterCommand.java | 5 +- .../command/commands/LanguageCommand.java | 5 +- .../command/commands/ListCommand.java | 5 +- .../command/commands/PermissionCommand.java | 5 +- .../command/commands/PositionCommand.java | 1 - .../command/commands/QuestCommand.java | 5 +- .../command/commands/ReloadCommand.java | 5 +- .../command/commands/ResetConstCommand.java | 5 +- .../commands/ResetShopLimitCommand.java | 5 +- .../command/commands/SendMailCommand.java | 5 +- .../command/commands/SendMessageCommand.java | 1 - .../command/commands/SetConstCommand.java | 1 - .../commands/SetFetterLevelCommand.java | 5 +- .../command/commands/SetPropCommand.java | 1 - .../command/commands/SetStatsCommand.java | 1 - .../command/commands/SoundCommand.java | 7 +- .../command/commands/SpawnCommand.java | 11 +- .../command/commands/StopCommand.java | 5 +- .../command/commands/TalentCommand.java | 1 - .../command/commands/TeamCommand.java | 5 +- .../command/commands/TeleportAllCommand.java | 5 +- .../command/commands/TeleportCommand.java | 5 +- .../commands/TrialAvatarActivityCommand.java | 5 +- .../command/commands/UnBanCommand.java | 1 - .../command/commands/UnlockAllCommand.java | 5 +- .../command/commands/WeatherCommand.java | 1 - .../emu/grasscutter/config/Configuration.java | 5 +- .../java/emu/grasscutter/data/DataLoader.java | 3 +- .../java/emu/grasscutter/data/GameData.java | 5 +- .../java/emu/grasscutter/data/GameDepot.java | 3 +- .../emu/grasscutter/data/ResourceLoader.java | 11 +- .../grasscutter/data/binout/AbilityData.java | 1 - .../data/binout/AbilityMixinData.java | 1 - .../data/binout/AbilityModifier.java | 3 +- .../data/binout/AbilityModifierEntry.java | 1 - .../grasscutter/data/binout/ConfigGadget.java | 3 +- .../data/binout/HomeworldDefaultSaveData.java | 3 +- .../data/binout/MainQuestData.java | 3 +- .../data/binout/OpenConfigEntry.java | 1 - .../data/binout/SceneNpcBornData.java | 5 +- .../data/binout/SceneNpcBornEntry.java | 3 +- .../data/binout/ScriptSceneData.java | 3 +- .../grasscutter/data/binout/TalentData.java | 1 - .../data/binout/config/ConfigEntityBase.java | 5 +- .../binout/config/ConfigGlobalCombat.java | 3 +- .../data/binout/config/ConfigLevelEntity.java | 3 +- .../config/fields/ConfigGlobalValue.java | 3 +- .../data/binout/routes/SceneRoutes.java | 3 +- .../grasscutter/data/common/DynamicFloat.java | 3 +- .../custom/TrialAvatarActivityCustomData.java | 3 +- .../data/custom/TrialAvatarCustomData.java | 3 +- .../grasscutter/data/excels/BargainData.java | 3 +- .../data/excels/BattlePassMissionData.java | 3 +- .../data/excels/BattlePassRewardData.java | 3 +- .../excels/BlossomRefreshExcelConfigData.java | 3 +- .../grasscutter/data/excels/ChapterData.java | 3 +- .../emu/grasscutter/data/excels/CityData.java | 3 +- .../grasscutter/data/excels/CombineData.java | 1 - .../grasscutter/data/excels/CompoundData.java | 3 +- .../data/excels/CookRecipeData.java | 3 +- .../data/excels/DropTableData.java | 3 +- .../excels/EnvAnimalGatherConfigData.java | 1 - .../data/excels/EquipAffixData.java | 1 - .../grasscutter/data/excels/FetterData.java | 1 - .../grasscutter/data/excels/ForgeData.java | 3 +- .../data/excels/FurnitureMakeConfigData.java | 3 +- .../data/excels/HomeWorldBgmData.java | 9 +- .../data/excels/HomeWorldLevelData.java | 3 +- .../data/excels/HomeWorldNPCData.java | 29 +++- .../data/excels/InvestigationMonsterData.java | 3 +- .../emu/grasscutter/data/excels/ItemData.java | 3 +- .../data/excels/PersonalLineData.java | 3 +- .../data/excels/ProudSkillData.java | 3 +- .../excels/RefreshPolicyExcelConfigData.java | 3 +- .../grasscutter/data/excels/RewardData.java | 1 - .../data/excels/RewardPreviewData.java | 3 +- .../data/excels/ShopGoodsData.java | 1 - .../data/excels/TalkConfigData.java | 3 +- .../excels/achievement/AchievementData.java | 3 +- .../activity/ActivityCondExcelConfigData.java | 3 +- .../data/excels/activity/ActivityData.java | 3 +- .../excels/activity/ActivityShopData.java | 3 +- .../excels/activity/ActivityWatcherData.java | 3 +- .../data/excels/avatar/AvatarCurveData.java | 1 - .../data/excels/avatar/AvatarPromoteData.java | 1 - .../excels/avatar/AvatarSkillDepotData.java | 3 +- .../data/excels/avatar/AvatarTalentData.java | 1 - .../data/excels/dungeon/DailyDungeonData.java | 3 +- .../dungeon/DungeonChallengeConfigData.java | 3 +- .../data/excels/dungeon/DungeonData.java | 3 +- .../excels/dungeon/DungeonPassConfigData.java | 3 +- .../data/excels/giving/GivingData.java | 3 +- .../data/excels/giving/GivingGroupData.java | 3 +- .../data/excels/monster/MonsterCurveData.java | 1 - .../data/excels/monster/MonsterData.java | 3 +- .../data/excels/quest/QuestData.java | 5 +- .../excels/reliquary/ReliquaryLevelData.java | 3 +- .../data/excels/scene/MapLayerFloorData.java | 3 +- .../data/excels/scene/MapLayerGroupData.java | 3 +- .../data/excels/scene/SceneData.java | 3 +- .../data/excels/scene/SceneTagData.java | 3 +- .../data/excels/tower/TowerScheduleData.java | 1 - .../excels/trial/TrialAvatarActivityData.java | 3 +- .../data/excels/trial/TrialAvatarData.java | 3 +- .../excels/trial/TrialAvatarTemplateData.java | 3 +- .../data/excels/trial/TrialReliquaryData.java | 3 +- .../data/excels/weapon/WeaponCurveData.java | 1 - .../data/excels/weapon/WeaponPromoteData.java | 1 - .../data/server/ActivityCondGroup.java | 3 +- .../emu/grasscutter/data/server/Grid.java | 1 - .../grasscutter/database/DatabaseHelper.java | 9 +- .../grasscutter/database/DatabaseManager.java | 19 ++- .../java/emu/grasscutter/game/Account.java | 7 +- .../emu/grasscutter/game/HandbookActions.java | 1 - .../emu/grasscutter/game/ability/Ability.java | 3 +- .../game/ability/AbilityLocalIdGenerator.java | 3 +- .../game/ability/AbilityManager.java | 9 +- .../game/ability/actions/AbilityAction.java | 1 - .../ability/actions/ActionServerLuaCall.java | 3 +- .../game/ability/mixins/AbilityMixin.java | 1 - .../game/achievement/Achievements.java | 7 +- .../game/activity/ActivityConfigItem.java | 3 +- .../game/activity/ActivityHandler.java | 5 +- .../game/activity/ActivityManager.java | 3 +- .../game/activity/ActivityWatcherType.java | 1 - .../game/activity/GameActivity.java | 1 - .../game/activity/PlayerActivityData.java | 3 +- .../activity/condition/ActivityCondition.java | 1 - .../AllActivityConditionBuilder.java | 3 +- .../BasicActivityConditionExecutor.java | 1 - .../PlayerActivityDataMappingBuilder.java | 3 +- .../game/activity/condition/all/DayLess.java | 4 +- .../condition/all/DaysGreatEqual.java | 5 +- .../activity/condition/all/NotFinishTalk.java | 4 +- ...elGreatEqualActivityActivityCondition.java | 4 +- .../activity/condition/all/QuestFinished.java | 4 +- .../condition/all/SalesmanCanDeliver.java | 4 +- .../musicgame/MusicGameActivityHandler.java | 1 - .../activity/musicgame/MusicGameBeatmap.java | 3 +- .../musicgame/MusicGamePlayerData.java | 5 +- .../TrialAvatarActivityChallengeTrigger.java | 3 +- .../TrialAvatarActivityHandler.java | 3 +- .../trialavatar/TrialAvatarPlayerData.java | 5 +- .../emu/grasscutter/game/avatar/Avatar.java | 11 +- .../game/avatar/AvatarStorage.java | 1 - .../game/battlepass/BattlePassManager.java | 5 +- .../game/battlepass/BattlePassSystem.java | 1 - .../emu/grasscutter/game/chat/ChatSystem.java | 5 +- .../game/combine/CombineManger.java | 1 - .../game/combine/CombineResult.java | 1 - .../emu/grasscutter/game/drop/DropSystem.java | 1 - .../game/drop/DropSystemLegacy.java | 1 - .../game/dungeons/DungeonManager.java | 5 +- .../game/dungeons/DungeonSystem.java | 7 +- .../game/dungeons/DungeonTrialTeam.java | 3 +- .../game/dungeons/DungeonValue.java | 1 - .../dungeons/challenge/WorldChallenge.java | 3 +- .../challenge/factory/ChallengeFactory.java | 3 +- .../KillAndGuardChallengeFactoryHandler.java | 7 +- ...llMonsterCountChallengeFactoryHandler.java | 3 +- ...CountInTimeIncChallengeFactoryHandler.java | 3 +- ...lMonsterInTimeChallengeFactoryHandler.java | 3 +- ...illMonsterTimeChallengeFactoryHandler.java | 3 +- .../SurviveChallengeFactoryHandler.java | 5 +- .../TriggerInTimeChallengeFactoryHandler.java | 5 +- .../game/entity/EntityBaseGadget.java | 4 +- .../grasscutter/game/entity/EntityGadget.java | 7 +- .../grasscutter/game/entity/EntityRegion.java | 3 +- .../game/entity/EntityVehicle.java | 5 +- .../grasscutter/game/entity/EntityWeapon.java | 3 +- .../grasscutter/game/entity/GameEntity.java | 3 +- .../game/entity/gadget/GadgetChest.java | 2 +- .../game/entity/gadget/GadgetWorktop.java | 1 - .../chest/BossChestInteractHandler.java | 1 - .../chest/NormalChestInteractHandler.java | 1 - .../entity/gadget/platform/AbilityRoute.java | 2 +- .../entity/gadget/platform/ConfigRoute.java | 3 +- .../expedition/ExpeditionRewardDataList.java | 3 +- .../game/expedition/ExpeditionRewardInfo.java | 3 +- .../game/expedition/ExpeditionSystem.java | 1 - .../grasscutter/game/friends/FriendsList.java | 1 - .../grasscutter/game/friends/Friendship.java | 55 +++---- .../game/friends/PlayerProfile.java | 15 +- .../grasscutter/game/gacha/GachaBanner.java | 4 +- .../grasscutter/game/gacha/GachaRecord.java | 3 +- .../grasscutter/game/gacha/GachaSystem.java | 7 +- .../emu/grasscutter/game/home/GameHome.java | 143 ++++++++--------- .../grasscutter/game/home/HomeBlockItem.java | 9 +- .../game/home/HomeFurnitureItem.java | 32 ++-- .../game/home/HomeMarkPointProtoFactory.java | 3 +- .../grasscutter/game/home/HomeNPCItem.java | 38 ++--- .../grasscutter/game/home/HomeSceneItem.java | 5 +- .../emu/grasscutter/game/home/HomeWorld.java | 62 ++++---- .../game/home/HomeWorldMPSystem.java | 110 ++++++++++--- .../grasscutter/game/inventory/BagTab.java | 3 +- .../grasscutter/game/inventory/EquipType.java | 3 +- .../grasscutter/game/inventory/GameItem.java | 3 +- .../grasscutter/game/inventory/Inventory.java | 9 +- .../game/inventory/ItemQuality.java | 3 +- .../grasscutter/game/inventory/ItemType.java | 3 +- .../game/inventory/MaterialType.java | 3 +- .../java/emu/grasscutter/game/mail/Mail.java | 9 +- .../grasscutter/game/mail/MailHandler.java | 1 - .../game/managers/FurnitureManager.java | 1 - .../game/managers/ResinManager.java | 4 +- .../game/managers/SatiationManager.java | 1 - .../game/managers/SotSManager.java | 1 - .../managers/blossom/BlossomActivity.java | 1 - .../game/managers/blossom/BlossomConfig.java | 3 +- .../game/managers/blossom/BlossomManager.java | 1 - .../game/managers/blossom/BlossomType.java | 3 +- .../cooking/CookingCompoundManager.java | 1 - .../game/managers/cooking/CookingManager.java | 1 - .../deforestation/DeforestationManager.java | 1 - .../game/managers/energy/EnergyManager.java | 7 +- .../game/managers/forging/ForgingManager.java | 1 - .../managers/mapmark/MapMarksManager.java | 1 - .../game/player/InvokeHandler.java | 1 - .../game/player/PlayerBuffManager.java | 3 +- .../grasscutter/game/player/PlayerCodex.java | 3 +- .../game/player/PlayerCollectionRecords.java | 1 - .../game/player/PlayerProgress.java | 3 +- .../game/player/PlayerProgressManager.java | 7 +- .../emu/grasscutter/game/player/TeamInfo.java | 5 +- .../grasscutter/game/player/TeamManager.java | 11 +- .../grasscutter/game/props/ActionReason.java | 1 - .../grasscutter/game/props/ActivityType.java | 3 +- .../game/props/CampTargetType.java | 1 - .../grasscutter/game/props/ClimateType.java | 1 - .../grasscutter/game/props/ElementType.java | 8 +- .../grasscutter/game/props/EnterReason.java | 1 - .../grasscutter/game/props/EntityType.java | 1 - .../grasscutter/game/props/FetterState.java | 1 - .../grasscutter/game/props/FightProperty.java | 7 +- .../emu/grasscutter/game/props/GrowCurve.java | 1 - .../ItemUseAction/ItemUseGainAvatar.java | 1 - .../emu/grasscutter/game/props/ItemUseOp.java | 1 - .../grasscutter/game/props/ItemUseTarget.java | 1 - .../emu/grasscutter/game/props/LifeState.java | 1 - .../grasscutter/game/props/MonsterType.java | 1 - .../game/props/PlayerProperty.java | 3 +- .../grasscutter/game/props/RefreshType.java | 1 - .../emu/grasscutter/game/props/SceneType.java | 1 - .../game/props/ServerBuffType.java | 1 - .../game/props/WatcherTriggerType.java | 1 - .../grasscutter/game/props/WeaponType.java | 1 - .../grasscutter/game/quest/GameMainQuest.java | 5 +- .../emu/grasscutter/game/quest/GameQuest.java | 5 +- .../game/quest/ItemGiveRecord.java | 3 +- .../grasscutter/game/quest/QuestManager.java | 11 +- .../grasscutter/game/quest/QuestSystem.java | 15 +- .../game/quest/QuestValueCond.java | 1 - .../game/quest/QuestValueContent.java | 1 - .../game/quest/QuestValueExec.java | 1 - .../grasscutter/game/quest/RewindData.java | 3 +- .../grasscutter/game/quest/TeleportData.java | 3 +- .../game/quest/conditions/BaseCondition.java | 4 +- .../conditions/ConditionActivityCond.java | 4 +- .../conditions/ConditionActivityEnd.java | 4 +- .../conditions/ConditionActivityOpen.java | 4 +- .../conditions/ConditionCompleteTalk.java | 4 +- .../conditions/ConditionItemNumLessThan.java | 4 +- .../quest/conditions/ConditionLuaNotify.java | 4 +- .../conditions/ConditionPackHaveItem.java | 4 +- .../ConditionPlayerLevelEqualGreater.java | 4 +- .../ConditionQuestGlobalVarEqual.java | 4 +- .../ConditionQuestGlobalVarGreater.java | 4 +- .../ConditionQuestGlobalVarLess.java | 4 +- .../conditions/ConditionQuestVarEqual.java | 4 +- .../conditions/ConditionQuestVarGreater.java | 4 +- .../conditions/ConditionQuestVarLess.java | 4 +- .../quest/conditions/ConditionStateEqual.java | 4 +- .../conditions/ConditionStateNotEqual.java | 4 +- .../content/ContentAddQuestProgress.java | 4 +- .../content/ContentAnyManualTransport.java | 4 +- .../content/ContentClearGroupMonster.java | 4 +- .../quest/content/ContentCompleteAnyTalk.java | 7 +- .../quest/content/ContentCompleteTalk.java | 4 +- .../quest/content/ContentDestroyGadget.java | 4 +- .../quest/content/ContentEnterDungeon.java | 4 +- .../quest/content/ContentEnterMyWorld.java | 4 +- .../content/ContentEnterMyWorldScene.java | 4 +- .../game/quest/content/ContentEnterRoom.java | 4 +- .../quest/content/ContentEnterVehicle.java | 4 +- .../quest/content/ContentFailDungeon.java | 4 +- .../quest/content/ContentFinishDungeon.java | 4 +- .../game/quest/content/ContentFinishPlot.java | 4 +- .../quest/content/ContentGameTimeTick.java | 4 +- .../quest/content/ContentInteractGadget.java | 4 +- .../quest/content/ContentItemLessThan.java | 4 +- .../quest/content/ContentKillMonster.java | 4 +- .../game/quest/content/ContentLeaveScene.java | 4 +- .../game/quest/content/ContentLuaNotify.java | 4 +- .../game/quest/content/ContentMonsterDie.java | 4 +- .../quest/content/ContentNotFinishPlot.java | 4 +- .../game/quest/content/ContentObtainItem.java | 4 +- .../quest/content/ContentPlayerLevelUp.java | 4 +- .../quest/content/ContentQuestStateEqual.java | 4 +- .../content/ContentQuestStateNotEqual.java | 4 +- .../quest/content/ContentQuestVarEqual.java | 4 +- .../quest/content/ContentQuestVarGreater.java | 4 +- .../quest/content/ContentQuestVarLess.java | 4 +- .../game/quest/content/ContentSkill.java | 4 +- .../quest/content/ContentTriggerFire.java | 4 +- .../game/quest/content/ContentUnlockArea.java | 4 +- .../content/ContentUnlockTransPoint.java | 4 +- .../game/quest/content/ContentUseItem.java | 4 +- .../quest/content/ContentWorktopSelect.java | 4 +- .../game/quest/enums/LogicType.java | 3 +- .../game/quest/enums/QuestCond.java | 1 - .../game/quest/enums/QuestContent.java | 1 - .../game/quest/enums/QuestExec.java | 1 - .../game/quest/exec/ExecAddQuestProgress.java | 1 - .../quest/exec/ExecSetGameTimeLocked.java | 1 - .../game/quest/exec/ExecSetOpenState.java | 1 - .../emu/grasscutter/game/shop/ShopInfo.java | 3 +- .../emu/grasscutter/game/shop/ShopSystem.java | 5 +- .../game/systems/AnnouncementSystem.java | 3 +- .../game/systems/InventorySystem.java | 3 +- .../emu/grasscutter/game/talk/TalkExec.java | 3 +- .../grasscutter/game/talk/TalkManager.java | 6 +- .../emu/grasscutter/game/tower/TowerData.java | 1 - .../game/tower/TowerLevelRecord.java | 1 - .../grasscutter/game/tower/TowerManager.java | 1 - .../grasscutter/game/tower/TowerSystem.java | 1 - .../grasscutter/game/world/ChestReward.java | 3 +- .../grasscutter/game/world/GridPosition.java | 3 +- .../game/world/GroupReplacementData.java | 3 +- .../emu/grasscutter/game/world/Position.java | 5 +- .../emu/grasscutter/game/world/Scene.java | 15 +- .../game/world/SceneGroupInstance.java | 5 +- .../game/world/SpawnDataEntry.java | 3 +- .../emu/grasscutter/game/world/World.java | 29 ++-- .../game/world/WorldDataSystem.java | 3 +- .../grasscutter/net/packet/BasePacket.java | 1 - .../net/packet/PacketOpcodesUtils.java | 1 - .../java/emu/grasscutter/plugin/Plugin.java | 5 +- .../emu/grasscutter/plugin/PluginManager.java | 9 +- .../grasscutter/plugin/api/ServerHelper.java | 1 - .../EntityControllerScriptManager.java | 7 +- .../scripts/SceneIndexManager.java | 1 - .../scripts/SceneScriptManager.java | 15 +- .../grasscutter/scripts/SceneTimeAxis.java | 3 +- .../emu/grasscutter/scripts/ScriptLoader.java | 30 ++-- .../emu/grasscutter/scripts/ScriptUtils.java | 3 +- .../grasscutter/scripts/data/SceneBlock.java | 5 +- .../scripts/data/SceneGarbage.java | 3 +- .../grasscutter/scripts/data/SceneGroup.java | 7 +- .../grasscutter/scripts/data/SceneMeta.java | 5 +- .../scripts/data/SceneMonster.java | 3 +- .../grasscutter/scripts/data/SceneRegion.java | 3 +- .../grasscutter/scripts/data/SceneSuite.java | 3 +- .../data/controller/EntityController.java | 5 +- .../scripts/serializer/LuaSerializer.java | 7 +- .../serializer/LuaTableJacksonSerializer.java | 3 +- .../service/ScriptMonsterSpawnService.java | 1 - .../service/ScriptMonsterTideService.java | 1 - .../server/dispatch/DispatchClient.java | 15 +- .../server/dispatch/DispatchServer.java | 15 +- .../server/dispatch/IDispatcher.java | 9 +- .../event/dispatch/ServerMessageEvent.java | 3 +- .../event/entity/EntityCreationEvent.java | 3 +- .../event/entity/EntityDamageEvent.java | 3 +- .../server/event/entity/EntityDeathEvent.java | 3 +- .../event/game/ExecuteCommandEvent.java | 3 +- .../game/ReceiveCommandFeedbackEvent.java | 1 - .../server/event/game/ServerTickEvent.java | 1 - .../event/internal/ServerStartEvent.java | 1 - .../event/internal/ServerStopEvent.java | 1 - .../server/event/player/PlayerChatEvent.java | 3 +- .../player/PlayerFinishDungeonEvent.java | 3 +- .../event/player/PlayerNpcTalkEvent.java | 3 +- .../server/event/player/PlayerWishEvent.java | 3 +- .../grasscutter/server/game/GameServer.java | 22 ++- .../server/game/GameServerPacketHandler.java | 7 +- .../grasscutter/server/game/GameSession.java | 9 +- .../server/game/GameSessionManager.java | 5 +- .../http/dispatch/AuthenticationHandler.java | 4 +- .../server/http/dispatch/RegionHandler.java | 7 +- .../GachaMappingRequestHandler.java | 5 +- .../http/documentation/HandbookHandler.java | 5 +- .../documentation/RootRequestHandler.java | 5 +- .../http/handlers/AnnouncementsHandler.java | 5 +- .../server/http/handlers/GachaHandler.java | 7 +- .../server/http/handlers/GenericHandler.java | 4 +- .../server/http/objects/HttpJsonResponse.java | 9 +- .../objects/WebStaticVersionResponse.java | 5 +- .../HandlerActivityTakeWatcherRewardReq.java | 1 - .../HandlerAvatarExpeditionGetRewardReq.java | 1 - .../packet/recv/HandlerBackMyWorldReq.java | 3 +- .../packet/recv/HandlerBuyGoodsReq.java | 1 - ...andlerCalcWeaponUpgradeReturnItemsReq.java | 1 - .../recv/HandlerChangeMailStarNotify.java | 1 - .../recv/HandlerCombatInvocationsNotify.java | 3 +- .../server/packet/recv/HandlerCombineReq.java | 1 - .../HandlerEvtAvatarEnterFocusNotify.java | 8 +- .../recv/HandlerEvtAvatarExitFocusNotify.java | 8 +- .../HandlerEvtAvatarUpdateFocusNotify.java | 9 +- .../recv/HandlerEvtBulletDeactiveNotify.java | 8 +- .../recv/HandlerEvtBulletHitNotify.java | 8 +- .../recv/HandlerEvtBulletMoveNotify.java | 8 +- .../recv/HandlerGetActivityInfoReq.java | 1 - .../recv/HandlerGetHomeLevelUpRewardReq.java | 1 - .../packet/recv/HandlerGetPlayerTokenReq.java | 7 +- .../server/packet/recv/HandlerGetUgcReq.java | 2 +- .../recv/HandlerHomeChangeEditModeReq.java | 3 +- .../recv/HandlerHomeGetOnlineStatusReq.java | 3 +- .../packet/recv/HandlerHomeKickPlayerReq.java | 20 ++- ...HandlerHomeSaveArrangementNoChangeReq.java | 6 +- .../recv/HandlerHomeSceneInitFinishReq.java | 10 +- .../packet/recv/HandlerHomeSceneJumpReq.java | 6 +- .../packet/recv/HandlerHomeTransferReq.java | 19 ++- .../packet/recv/HandlerItemGivingReq.java | 1 - ...dlerMassiveEntityElementOpBatchNotify.java | 9 +- .../HandlerPlayerApplyEnterHomeResultReq.java | 8 +- .../packet/recv/HandlerQuestTransmitReq.java | 1 - .../packet/recv/HandlerReadMailNotify.java | 1 - .../packet/recv/HandlerSceneAudioNotify.java | 1 - .../recv/HandlerSceneTransToPointReq.java | 24 +-- .../recv/HandlerSetPlayerBornDataReq.java | 5 +- .../recv/HandlerTakePlayerLevelRewardReq.java | 1 - .../packet/recv/HandlerTryEnterHomeReq.java | 23 ++- .../packet/recv/HandlerUnionCmdNotify.java | 4 +- .../send/PacketAbilityInvocationsNotify.java | 1 - .../send/PacketAchievementUpdateNotify.java | 1 - .../PacketActivityScheduleInfoNotify.java | 1 - .../send/PacketAllWidgetDataNotify.java | 3 +- .../packet/send/PacketAvatarDelNotify.java | 1 - .../PacketAvatarExpeditionAllDataRsp.java | 1 - .../PacketAvatarExpeditionCallBackRsp.java | 1 - .../PacketAvatarExpeditionDataNotify.java | 1 - .../PacketAvatarExpeditionGetRewardRsp.java | 1 - .../send/PacketAvatarExpeditionStartRsp.java | 1 - .../PacketAvatarFightPropUpdateNotify.java | 1 - .../packet/send/PacketAvatarPropNotify.java | 1 - .../packet/send/PacketAvatarUpgradeRsp.java | 1 - .../PacketBattlePassMissionUpdateNotify.java | 1 - .../PacketBeginCameraSceneLookNotify.java | 3 +- ...PacketCalcWeaponUpgradeReturnItemsRsp.java | 1 - ...lientAbilitiesInitFinishCombineNotify.java | 1 - .../PacketClientAbilityInitFinishNotify.java | 1 - .../send/PacketCodexDataFullNotify.java | 1 - .../send/PacketCombatInvocationsNotify.java | 1 - .../packet/send/PacketCompoundDataNotify.java | 1 - .../packet/send/PacketCookDataNotify.java | 1 - .../packet/send/PacketCreateVehicleRsp.java | 1 - .../server/packet/send/PacketDelMailRsp.java | 1 - .../send/PacketDelTeamEntityNotify.java | 1 - .../server/packet/send/PacketDoGachaRsp.java | 1 - .../send/PacketDungeonEntryInfoRsp.java | 1 - .../send/PacketDungeonWayPointNotify.java | 1 - ...cketEntityFightPropChangeReasonNotify.java | 1 - .../PacketEntityFightPropUpdateNotify.java | 1 - .../send/PacketEvtAvatarEnterFocusNotify.java | 3 +- .../send/PacketEvtAvatarExitFocusNotify.java | 3 +- .../PacketEvtAvatarUpdateFocusNotify.java | 6 +- .../send/PacketEvtBulletDeactiveNotify.java | 3 +- ...PacketFinishedParentQuestUpdateNotify.java | 1 - .../packet/send/PacketForgeDataNotify.java | 1 - .../send/PacketForgeGetQueueDataRsp.java | 1 - .../send/PacketForgeQueueDataNotify.java | 1 - .../send/PacketForgeQueueManipulateRsp.java | 1 - .../send/PacketFurnitureMakeStartRsp.java | 1 - .../PacketGadgetAutoPickDropInfoNotify.java | 1 - .../packet/send/PacketGetActivityInfoRsp.java | 1 - .../PacketGetActivityShopSheetInfoRsp.java | 1 - .../PacketGetAllActivatedBargainDataRsp.java | 1 - .../send/PacketGetAllMailResultNotify.java | 1 - .../send/PacketGetChatEmojiCollectionRsp.java | 1 - .../packet/send/PacketGetCompoundDataRsp.java | 1 - .../PacketGetFriendShowAvatarInfoRsp.java | 1 - .../PacketGetFriendShowNameCardInfoRsp.java | 1 - .../PacketGetInvestigationMonsterRsp.java | 1 - .../packet/send/PacketGetMailItemRsp.java | 1 - .../send/PacketGetOnlinePlayerListRsp.java | 1 - .../send/PacketGetPlayerFriendListRsp.java | 10 +- .../server/packet/send/PacketGetShopRsp.java | 1 - .../packet/send/PacketGetShopmallDataRsp.java | 1 - .../packet/send/PacketGetWidgetSlotRsp.java | 1 - .../packet/send/PacketGivingRecordNotify.java | 1 - .../packet/send/PacketGroupSuiteNotify.java | 1 - .../packet/send/PacketGroupUnloadNotify.java | 1 - .../PacketHomeAvatarCostumeChangeNotify.java | 7 +- .../send/PacketHomeBasicInfoNotify.java | 20 +-- .../send/PacketHomeChangeEditModeRsp.java | 4 +- .../send/PacketHomeComfortInfoNotify.java | 1 - .../send/PacketHomeGetArrangementInfoRsp.java | 3 +- .../send/PacketHomeGetOnlineStatusRsp.java | 6 +- .../packet/send/PacketHomeKickPlayerRsp.java | 9 +- .../send/PacketHomeMarkPointNotify.java | 35 +++-- .../packet/send/PacketHomeModuleSeenRsp.java | 1 - .../PacketHomeSaveArrangementNoChangeRsp.java | 5 +- .../packet/send/PacketItemAddHintNotify.java | 1 - .../packet/send/PacketMailChangeNotify.java | 1 - .../server/packet/send/PacketMarkMapRsp.java | 1 - .../packet/send/PacketMarkNewNotify.java | 1 - ...cketMassiveEntityElementOpBatchNotify.java | 7 +- .../send/PacketOpenStateChangeNotify.java | 1 - ...cketOtherPlayerEnterOrLeaveHomeNotify.java | 11 +- .../send/PacketPersonalLineAllDataRsp.java | 1 - .../PacketPlayerApplyEnterHomeNotify.java | 5 +- ...acketPlayerApplyEnterHomeResultNotify.java | 17 +- .../PacketPlayerApplyEnterHomeResultRsp.java | 7 +- .../packet/send/PacketPlayerCookRsp.java | 1 - .../send/PacketPlayerEnterSceneNotify.java | 148 +++++++++--------- .../PacketPlayerLevelRewardUpdateNotify.java | 1 - .../packet/send/PacketPlayerLoginRsp.java | 5 +- .../send/PacketPlayerPreEnterMpNotify.java | 9 +- .../packet/send/PacketPlayerStoreNotify.java | 4 +- .../PacketPlayerWorldSceneInfoListNotify.java | 1 - .../packet/send/PacketPullPrivateChatRsp.java | 1 - .../packet/send/PacketPullRecentChatRsp.java | 1 - ...PacketQueryCodexMonsterBeKilledNumRsp.java | 1 - .../send/PacketQuestListUpdateNotify.java | 1 - .../send/PacketQuestUpdateQuestVarNotify.java | 1 - .../send/PacketReliquaryDecomposeRsp.java | 1 - .../send/PacketReliquaryUpgradeRsp.java | 1 - .../packet/send/PacketSceneAudioNotify.java | 1 - .../send/PacketSceneEntityAppearNotify.java | 1 - .../PacketSceneEntityDisappearNotify.java | 1 - .../send/PacketSceneEntityUpdateNotify.java | 1 - .../send/PacketSceneForceLockNotify.java | 3 +- .../send/PacketSceneForceUnlockNotify.java | 3 +- .../send/PacketScenePlayerSoundNotify.java | 1 - .../send/PacketServerAnnounceNotify.java | 1 - .../send/PacketServerBuffChangeNotify.java | 1 - .../send/PacketStoreItemChangeNotify.java | 1 - .../packet/send/PacketStoreItemDelNotify.java | 1 - .../send/PacketStoreWeightLimitNotify.java | 4 +- .../PacketTakeAchievementGoalRewardRsp.java | 1 - .../send/PacketTakeAchievementRewardRsp.java | 1 - .../send/PacketTakeBattlePassRewardRsp.java | 1 - .../send/PacketTakeFurnitureMakeRsp.java | 1 - .../packet/send/PacketTowerAllDataRsp.java | 1 - .../packet/send/PacketTryEnterHomeRsp.java | 4 +- ...ketUnlockedFurnitureFormulaDataNotify.java | 1 - ...acketUnlockedFurnitureSuiteDataNotify.java | 1 - .../PacketUpdatePlayerShowAvatarListRsp.java | 1 - ...PacketUpdatePlayerShowNameCardListRsp.java | 1 - .../packet/send/PacketWeaponUpgradeRsp.java | 1 - .../send/PacketWidgetGadgetDataNotify.java | 1 - .../server/scheduler/AsyncServerTask.java | 3 +- .../java/emu/grasscutter/task/TaskMap.java | 3 +- .../task/tasks/AnnouncementTask.java | 3 +- .../java/emu/grasscutter/tools/Dumpers.java | 3 +- .../java/emu/grasscutter/tools/Tools.java | 9 +- .../java/emu/grasscutter/utils/Crypto.java | 3 +- .../emu/grasscutter/utils/DispatchUtils.java | 7 +- .../java/emu/grasscutter/utils/FileUtils.java | 5 +- .../emu/grasscutter/utils/JsonAdapters.java | 3 +- .../java/emu/grasscutter/utils/JsonUtils.java | 1 - .../grasscutter/utils/StartupArguments.java | 7 +- .../java/emu/grasscutter/utils/TsvUtils.java | 7 +- .../java/emu/grasscutter/utils/Utils.java | 11 +- .../emu/grasscutter/utils/lang/Language.java | 9 +- .../grasscutter/utils/objects/FieldFetch.java | 1 - .../utils/objects/JLineLogbackAppender.java | 1 - .../grasscutter/utils/objects/JObject.java | 1 - .../utils/objects/ServerLogEventAppender.java | 1 - .../grasscutter/utils/objects/text/Style.java | 3 +- .../grasscutter/utils/objects/text/Text.java | 3 +- 584 files changed, 1252 insertions(+), 1507 deletions(-) diff --git a/src/main/java/emu/grasscutter/Grasscutter.java b/src/main/java/emu/grasscutter/Grasscutter.java index d10bcbda6..e649b537c 100644 --- a/src/main/java/emu/grasscutter/Grasscutter.java +++ b/src/main/java/emu/grasscutter/Grasscutter.java @@ -1,5 +1,8 @@ package emu.grasscutter; +import static emu.grasscutter.config.Configuration.SERVER; +import static emu.grasscutter.utils.lang.Language.translate; + import ch.qos.logback.classic.*; import emu.grasscutter.auth.*; import emu.grasscutter.command.*; @@ -18,20 +21,16 @@ import emu.grasscutter.tools.Tools; import emu.grasscutter.utils.*; import emu.grasscutter.utils.lang.Language; import io.netty.util.concurrent.FastThreadLocalThread; +import java.io.*; +import java.util.Calendar; +import java.util.concurrent.*; +import javax.annotation.Nullable; import lombok.*; import org.jline.reader.*; import org.jline.terminal.*; import org.reflections.Reflections; import org.slf4j.LoggerFactory; -import javax.annotation.Nullable; -import java.io.*; -import java.util.Calendar; -import java.util.concurrent.*; - -import static emu.grasscutter.config.Configuration.SERVER; -import static emu.grasscutter.utils.lang.Language.translate; - public final class Grasscutter { public static final File configFile = new File("./config.json"); public static final Reflections reflector = new Reflections("emu.grasscutter"); @@ -211,11 +210,7 @@ public final class Grasscutter { } } - /** - * Utility method for starting the: - * - SDK server - * - Dispatch server - */ + /** Utility method for starting the: - SDK server - Dispatch server */ public static void startDispatch() throws Exception { httpServer.start(); // Start the SDK/HTTP server. diff --git a/src/main/java/emu/grasscutter/auth/AuthenticationSystem.java b/src/main/java/emu/grasscutter/auth/AuthenticationSystem.java index 4e5f541c8..17dd59d32 100644 --- a/src/main/java/emu/grasscutter/auth/AuthenticationSystem.java +++ b/src/main/java/emu/grasscutter/auth/AuthenticationSystem.java @@ -4,9 +4,8 @@ import emu.grasscutter.game.Account; import emu.grasscutter.server.http.objects.*; import emu.grasscutter.utils.DispatchUtils; import io.javalin.http.Context; -import lombok.*; - import javax.annotation.Nullable; +import lombok.*; /** Defines an authenticator for the server. Can be changed by plugins. */ public interface AuthenticationSystem { diff --git a/src/main/java/emu/grasscutter/auth/DefaultAuthentication.java b/src/main/java/emu/grasscutter/auth/DefaultAuthentication.java index 9cbd4c42e..c9d1aac26 100644 --- a/src/main/java/emu/grasscutter/auth/DefaultAuthentication.java +++ b/src/main/java/emu/grasscutter/auth/DefaultAuthentication.java @@ -1,13 +1,13 @@ package emu.grasscutter.auth; +import static emu.grasscutter.config.Configuration.ACCOUNT; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.Grasscutter; import emu.grasscutter.auth.DefaultAuthenticators.*; import emu.grasscutter.game.Account; import emu.grasscutter.server.http.objects.*; -import static emu.grasscutter.config.Configuration.ACCOUNT; -import static emu.grasscutter.utils.lang.Language.translate; - /** * The default Grasscutter authentication implementation. Allows all users to access any account. */ diff --git a/src/main/java/emu/grasscutter/auth/DefaultAuthenticators.java b/src/main/java/emu/grasscutter/auth/DefaultAuthenticators.java index 372b0267f..1892d4504 100644 --- a/src/main/java/emu/grasscutter/auth/DefaultAuthenticators.java +++ b/src/main/java/emu/grasscutter/auth/DefaultAuthenticators.java @@ -1,5 +1,8 @@ package emu.grasscutter.auth; +import static emu.grasscutter.config.Configuration.ACCOUNT; +import static emu.grasscutter.utils.lang.Language.translate; + import at.favre.lib.crypto.bcrypt.BCrypt; import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter.ServerRunMode; @@ -10,16 +13,12 @@ import emu.grasscutter.server.dispatch.*; import emu.grasscutter.server.http.objects.*; import emu.grasscutter.utils.*; import io.javalin.http.ContentType; - -import javax.crypto.Cipher; import java.nio.charset.StandardCharsets; import java.security.KeyFactory; import java.security.interfaces.RSAPrivateKey; import java.security.spec.PKCS8EncodedKeySpec; import java.util.concurrent.*; - -import static emu.grasscutter.config.Configuration.ACCOUNT; -import static emu.grasscutter.utils.lang.Language.translate; +import javax.crypto.Cipher; /** A class containing default authenticators. */ public final class DefaultAuthenticators { diff --git a/src/main/java/emu/grasscutter/command/CommandHandler.java b/src/main/java/emu/grasscutter/command/CommandHandler.java index 35ef15789..ada2ff3a3 100644 --- a/src/main/java/emu/grasscutter/command/CommandHandler.java +++ b/src/main/java/emu/grasscutter/command/CommandHandler.java @@ -1,13 +1,12 @@ package emu.grasscutter.command; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.Grasscutter; import emu.grasscutter.game.player.Player; import emu.grasscutter.server.event.game.ReceiveCommandFeedbackEvent; - import java.util.*; -import static emu.grasscutter.utils.lang.Language.translate; - public interface CommandHandler { /** diff --git a/src/main/java/emu/grasscutter/command/CommandHelpers.java b/src/main/java/emu/grasscutter/command/CommandHelpers.java index 835a35ac6..e43c2212c 100644 --- a/src/main/java/emu/grasscutter/command/CommandHelpers.java +++ b/src/main/java/emu/grasscutter/command/CommandHelpers.java @@ -1,9 +1,9 @@ package emu.grasscutter.command; -import javax.annotation.Nonnull; import java.util.*; import java.util.function.BiConsumer; import java.util.regex.*; +import javax.annotation.Nonnull; public class CommandHelpers { public static final Pattern lvlRegex = diff --git a/src/main/java/emu/grasscutter/command/CommandMap.java b/src/main/java/emu/grasscutter/command/CommandMap.java index 4a01737d9..d452cc6ba 100644 --- a/src/main/java/emu/grasscutter/command/CommandMap.java +++ b/src/main/java/emu/grasscutter/command/CommandMap.java @@ -1,15 +1,14 @@ package emu.grasscutter.command; +import static emu.grasscutter.config.Configuration.SERVER; + import emu.grasscutter.Grasscutter; import emu.grasscutter.database.DatabaseHelper; import emu.grasscutter.game.player.Player; import emu.grasscutter.server.event.game.ExecuteCommandEvent; import it.unimi.dsi.fastutil.objects.*; -import org.reflections.Reflections; - import java.util.*; - -import static emu.grasscutter.config.Configuration.SERVER; +import org.reflections.Reflections; @SuppressWarnings({"UnusedReturnValue", "unused"}) public final class CommandMap { diff --git a/src/main/java/emu/grasscutter/command/commands/AccountCommand.java b/src/main/java/emu/grasscutter/command/commands/AccountCommand.java index 4670b25e9..5efab34c3 100644 --- a/src/main/java/emu/grasscutter/command/commands/AccountCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/AccountCommand.java @@ -1,5 +1,7 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import at.favre.lib.crypto.bcrypt.BCrypt; import emu.grasscutter.Grasscutter; import emu.grasscutter.command.*; @@ -7,12 +9,9 @@ import emu.grasscutter.config.Configuration; import emu.grasscutter.database.*; import emu.grasscutter.game.Account; import emu.grasscutter.game.player.Player; - import java.util.List; import java.util.stream.Collectors; -import static emu.grasscutter.utils.lang.Language.translate; - @Command( label = "account", usage = { diff --git a/src/main/java/emu/grasscutter/command/commands/AchievementCommand.java b/src/main/java/emu/grasscutter/command/commands/AchievementCommand.java index d5333efef..85603931d 100644 --- a/src/main/java/emu/grasscutter/command/commands/AchievementCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/AchievementCommand.java @@ -5,7 +5,6 @@ import emu.grasscutter.data.GameData; import emu.grasscutter.data.excels.achievement.AchievementData; import emu.grasscutter.game.achievement.*; import emu.grasscutter.game.player.Player; - import java.util.*; import java.util.concurrent.atomic.AtomicInteger; diff --git a/src/main/java/emu/grasscutter/command/commands/AnnounceCommand.java b/src/main/java/emu/grasscutter/command/commands/AnnounceCommand.java index 0c1296484..9cd76ba13 100644 --- a/src/main/java/emu/grasscutter/command/commands/AnnounceCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/AnnounceCommand.java @@ -1,14 +1,13 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.Grasscutter; import emu.grasscutter.command.*; import emu.grasscutter.game.player.Player; import emu.grasscutter.server.packet.send.PacketServerAnnounceNotify; - import java.util.*; -import static emu.grasscutter.utils.lang.Language.translate; - @Command( label = "announce", usage = {"", "refresh", "(tpl|revoke) "}, diff --git a/src/main/java/emu/grasscutter/command/commands/BanCommand.java b/src/main/java/emu/grasscutter/command/commands/BanCommand.java index 79cda5858..e777c9172 100644 --- a/src/main/java/emu/grasscutter/command/commands/BanCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/BanCommand.java @@ -4,7 +4,6 @@ import emu.grasscutter.command.*; import emu.grasscutter.game.Account; import emu.grasscutter.game.player.Player; import emu.grasscutter.server.game.GameSession; - import java.util.List; @Command( diff --git a/src/main/java/emu/grasscutter/command/commands/ClearCommand.java b/src/main/java/emu/grasscutter/command/commands/ClearCommand.java index 4ea4c32dc..792ce1b3b 100644 --- a/src/main/java/emu/grasscutter/command/commands/ClearCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/ClearCommand.java @@ -1,16 +1,15 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.command.CommandHelpers.*; + import emu.grasscutter.command.*; import emu.grasscutter.game.inventory.*; import emu.grasscutter.game.player.Player; -import lombok.Setter; - import java.util.*; import java.util.function.BiConsumer; import java.util.regex.Pattern; import java.util.stream.Stream; - -import static emu.grasscutter.command.CommandHelpers.*; +import lombok.Setter; @Command( label = "clear", diff --git a/src/main/java/emu/grasscutter/command/commands/CoopCommand.java b/src/main/java/emu/grasscutter/command/commands/CoopCommand.java index a1ff03be4..ff0bd580a 100644 --- a/src/main/java/emu/grasscutter/command/commands/CoopCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/CoopCommand.java @@ -3,7 +3,6 @@ package emu.grasscutter.command.commands; import emu.grasscutter.Grasscutter; import emu.grasscutter.command.*; import emu.grasscutter.game.player.Player; - import java.util.List; @Command( diff --git a/src/main/java/emu/grasscutter/command/commands/CutsceneCommand.java b/src/main/java/emu/grasscutter/command/commands/CutsceneCommand.java index 059dd7344..e4d736894 100644 --- a/src/main/java/emu/grasscutter/command/commands/CutsceneCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/CutsceneCommand.java @@ -3,9 +3,8 @@ package emu.grasscutter.command.commands; import emu.grasscutter.command.*; import emu.grasscutter.game.player.Player; import emu.grasscutter.server.packet.send.PacketCutsceneBeginNotify; -import lombok.val; - import java.util.List; +import lombok.val; @Command( label = "cutscene", diff --git a/src/main/java/emu/grasscutter/command/commands/DebugCommand.java b/src/main/java/emu/grasscutter/command/commands/DebugCommand.java index 278b900c1..c4aac96af 100644 --- a/src/main/java/emu/grasscutter/command/commands/DebugCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/DebugCommand.java @@ -3,7 +3,6 @@ package emu.grasscutter.command.commands; import emu.grasscutter.Grasscutter; import emu.grasscutter.command.*; import emu.grasscutter.game.player.Player; - import java.util.List; @Command( diff --git a/src/main/java/emu/grasscutter/command/commands/EnterDungeonCommand.java b/src/main/java/emu/grasscutter/command/commands/EnterDungeonCommand.java index 75558c765..5e12ee150 100644 --- a/src/main/java/emu/grasscutter/command/commands/EnterDungeonCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/EnterDungeonCommand.java @@ -1,12 +1,11 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.command.*; import emu.grasscutter.game.player.Player; - import java.util.List; -import static emu.grasscutter.utils.lang.Language.translate; - @Command( label = "enter_dungeon", aliases = {"enterdungeon", "dungeon"}, diff --git a/src/main/java/emu/grasscutter/command/commands/EntityCommand.java b/src/main/java/emu/grasscutter/command/commands/EntityCommand.java index 8d53ae48e..677a9a429 100644 --- a/src/main/java/emu/grasscutter/command/commands/EntityCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/EntityCommand.java @@ -1,5 +1,8 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.command.CommandHelpers.*; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.command.*; import emu.grasscutter.game.entity.*; import emu.grasscutter.game.player.Player; @@ -7,14 +10,10 @@ import emu.grasscutter.game.props.*; import emu.grasscutter.game.world.Scene; import emu.grasscutter.server.event.entity.EntityDamageEvent; import emu.grasscutter.server.packet.send.PacketEntityFightPropUpdateNotify; -import lombok.Setter; - import java.util.*; import java.util.function.BiConsumer; import java.util.regex.Pattern; - -import static emu.grasscutter.command.CommandHelpers.*; -import static emu.grasscutter.utils.lang.Language.translate; +import lombok.Setter; @Command( label = "entity", diff --git a/src/main/java/emu/grasscutter/command/commands/GiveCommand.java b/src/main/java/emu/grasscutter/command/commands/GiveCommand.java index e5c1f035e..d5134af34 100644 --- a/src/main/java/emu/grasscutter/command/commands/GiveCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/GiveCommand.java @@ -1,5 +1,8 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.GameConstants.*; +import static emu.grasscutter.command.CommandHelpers.*; + import emu.grasscutter.command.*; import emu.grasscutter.data.*; import emu.grasscutter.data.excels.ItemData; @@ -9,14 +12,10 @@ import emu.grasscutter.game.avatar.Avatar; import emu.grasscutter.game.inventory.*; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.props.*; -import lombok.Setter; - import java.util.*; import java.util.function.BiConsumer; import java.util.regex.Pattern; - -import static emu.grasscutter.GameConstants.*; -import static emu.grasscutter.command.CommandHelpers.*; +import lombok.Setter; @Command( label = "give", diff --git a/src/main/java/emu/grasscutter/command/commands/GroupCommand.java b/src/main/java/emu/grasscutter/command/commands/GroupCommand.java index f8ea6f2b5..97359285f 100644 --- a/src/main/java/emu/grasscutter/command/commands/GroupCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/GroupCommand.java @@ -1,13 +1,12 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.command.*; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.world.SceneGroupInstance; - import java.util.List; -import static emu.grasscutter.utils.lang.Language.translate; - @Command( label = "group", aliases = {"gr"}, diff --git a/src/main/java/emu/grasscutter/command/commands/HealCommand.java b/src/main/java/emu/grasscutter/command/commands/HealCommand.java index 5a2aa3fb8..e7085c745 100644 --- a/src/main/java/emu/grasscutter/command/commands/HealCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/HealCommand.java @@ -1,14 +1,13 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.command.*; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.props.FightProperty; import emu.grasscutter.server.packet.send.*; - import java.util.List; -import static emu.grasscutter.utils.lang.Language.translate; - @Command( label = "heal", aliases = {"h"}, diff --git a/src/main/java/emu/grasscutter/command/commands/HelpCommand.java b/src/main/java/emu/grasscutter/command/commands/HelpCommand.java index 6d28fe115..bd4e7d369 100644 --- a/src/main/java/emu/grasscutter/command/commands/HelpCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/HelpCommand.java @@ -1,13 +1,12 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.command.*; import emu.grasscutter.game.Account; import emu.grasscutter.game.player.Player; - import java.util.*; -import static emu.grasscutter.utils.lang.Language.translate; - @Command( label = "help", usage = {"[]"}, diff --git a/src/main/java/emu/grasscutter/command/commands/KickCommand.java b/src/main/java/emu/grasscutter/command/commands/KickCommand.java index 454e7db79..3e5a6b2bb 100644 --- a/src/main/java/emu/grasscutter/command/commands/KickCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/KickCommand.java @@ -2,7 +2,6 @@ package emu.grasscutter.command.commands; import emu.grasscutter.command.*; import emu.grasscutter.game.player.Player; - import java.util.List; @Command( diff --git a/src/main/java/emu/grasscutter/command/commands/KillAllCommand.java b/src/main/java/emu/grasscutter/command/commands/KillAllCommand.java index dff353883..c4f3833da 100644 --- a/src/main/java/emu/grasscutter/command/commands/KillAllCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/KillAllCommand.java @@ -1,14 +1,13 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.command.*; import emu.grasscutter.game.entity.*; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.world.Scene; - import java.util.List; -import static emu.grasscutter.utils.lang.Language.translate; - @Command( label = "killall", usage = {"[]"}, diff --git a/src/main/java/emu/grasscutter/command/commands/KillCharacterCommand.java b/src/main/java/emu/grasscutter/command/commands/KillCharacterCommand.java index dd4016b9e..4a289809a 100644 --- a/src/main/java/emu/grasscutter/command/commands/KillCharacterCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/KillCharacterCommand.java @@ -1,15 +1,14 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.command.*; import emu.grasscutter.game.entity.EntityAvatar; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.props.*; import emu.grasscutter.server.packet.send.*; - import java.util.List; -import static emu.grasscutter.utils.lang.Language.translate; - @Command( label = "killCharacter", aliases = {"suicide", "kill"}, diff --git a/src/main/java/emu/grasscutter/command/commands/LanguageCommand.java b/src/main/java/emu/grasscutter/command/commands/LanguageCommand.java index 2f86268e8..dac8dfdc3 100644 --- a/src/main/java/emu/grasscutter/command/commands/LanguageCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/LanguageCommand.java @@ -1,14 +1,13 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.Grasscutter; import emu.grasscutter.command.*; import emu.grasscutter.game.player.Player; import emu.grasscutter.utils.Utils; - import java.util.*; -import static emu.grasscutter.utils.lang.Language.translate; - @Command( label = "language", usage = {"[]"}, diff --git a/src/main/java/emu/grasscutter/command/commands/ListCommand.java b/src/main/java/emu/grasscutter/command/commands/ListCommand.java index fb9ed0f26..ce0259e09 100644 --- a/src/main/java/emu/grasscutter/command/commands/ListCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/ListCommand.java @@ -1,13 +1,12 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.Grasscutter; import emu.grasscutter.command.*; import emu.grasscutter.game.player.Player; - import java.util.*; -import static emu.grasscutter.utils.lang.Language.translate; - @Command( label = "list", aliases = {"players"}, diff --git a/src/main/java/emu/grasscutter/command/commands/PermissionCommand.java b/src/main/java/emu/grasscutter/command/commands/PermissionCommand.java index ede194e19..5847d6c70 100644 --- a/src/main/java/emu/grasscutter/command/commands/PermissionCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/PermissionCommand.java @@ -1,15 +1,14 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.Grasscutter; import emu.grasscutter.command.*; import emu.grasscutter.command.Command.TargetRequirement; import emu.grasscutter.game.Account; import emu.grasscutter.game.player.Player; - import java.util.List; -import static emu.grasscutter.utils.lang.Language.translate; - @Command( label = "permission", usage = {"add ", "remove ", "clear", "list"}, diff --git a/src/main/java/emu/grasscutter/command/commands/PositionCommand.java b/src/main/java/emu/grasscutter/command/commands/PositionCommand.java index 4b034ffa1..9f7f91b45 100644 --- a/src/main/java/emu/grasscutter/command/commands/PositionCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/PositionCommand.java @@ -3,7 +3,6 @@ package emu.grasscutter.command.commands; import emu.grasscutter.command.*; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.world.Position; - import java.util.List; @Command( diff --git a/src/main/java/emu/grasscutter/command/commands/QuestCommand.java b/src/main/java/emu/grasscutter/command/commands/QuestCommand.java index 4b8b467fa..3b4aeb540 100644 --- a/src/main/java/emu/grasscutter/command/commands/QuestCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/QuestCommand.java @@ -1,15 +1,14 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.command.*; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.quest.GameQuest; import emu.grasscutter.game.quest.enums.*; - import java.util.*; import java.util.stream.Collectors; -import static emu.grasscutter.utils.lang.Language.translate; - @Command( label = "quest", aliases = {"q"}, diff --git a/src/main/java/emu/grasscutter/command/commands/ReloadCommand.java b/src/main/java/emu/grasscutter/command/commands/ReloadCommand.java index 50de6ce29..45a3d871f 100644 --- a/src/main/java/emu/grasscutter/command/commands/ReloadCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/ReloadCommand.java @@ -1,13 +1,12 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.Grasscutter; import emu.grasscutter.command.*; import emu.grasscutter.game.player.Player; - import java.util.List; -import static emu.grasscutter.utils.lang.Language.translate; - @Command( label = "reload", permission = "server.reload", diff --git a/src/main/java/emu/grasscutter/command/commands/ResetConstCommand.java b/src/main/java/emu/grasscutter/command/commands/ResetConstCommand.java index 97a8207de..acecf334d 100644 --- a/src/main/java/emu/grasscutter/command/commands/ResetConstCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/ResetConstCommand.java @@ -1,14 +1,13 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.command.*; import emu.grasscutter.game.avatar.Avatar; import emu.grasscutter.game.entity.EntityAvatar; import emu.grasscutter.game.player.Player; - import java.util.List; -import static emu.grasscutter.utils.lang.Language.translate; - @Command( label = "resetConst", aliases = {"resetconstellation"}, diff --git a/src/main/java/emu/grasscutter/command/commands/ResetShopLimitCommand.java b/src/main/java/emu/grasscutter/command/commands/ResetShopLimitCommand.java index e365d20de..230720841 100644 --- a/src/main/java/emu/grasscutter/command/commands/ResetShopLimitCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/ResetShopLimitCommand.java @@ -1,12 +1,11 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.command.*; import emu.grasscutter.game.player.Player; - import java.util.List; -import static emu.grasscutter.utils.lang.Language.translate; - @Command( label = "resetShopLimit", aliases = {"resetshop"}, diff --git a/src/main/java/emu/grasscutter/command/commands/SendMailCommand.java b/src/main/java/emu/grasscutter/command/commands/SendMailCommand.java index 85cd49feb..bf4d96246 100644 --- a/src/main/java/emu/grasscutter/command/commands/SendMailCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/SendMailCommand.java @@ -1,15 +1,14 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.Grasscutter; import emu.grasscutter.command.*; import emu.grasscutter.database.DatabaseHelper; import emu.grasscutter.game.mail.Mail; import emu.grasscutter.game.player.Player; - import java.util.*; -import static emu.grasscutter.utils.lang.Language.translate; - @SuppressWarnings("ConstantConditions") @Command( label = "sendMail", diff --git a/src/main/java/emu/grasscutter/command/commands/SendMessageCommand.java b/src/main/java/emu/grasscutter/command/commands/SendMessageCommand.java index 71e284dd8..cae221176 100644 --- a/src/main/java/emu/grasscutter/command/commands/SendMessageCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/SendMessageCommand.java @@ -4,7 +4,6 @@ import emu.grasscutter.Grasscutter; import emu.grasscutter.command.*; import emu.grasscutter.command.Command.TargetRequirement; import emu.grasscutter.game.player.Player; - import java.util.List; @Command( diff --git a/src/main/java/emu/grasscutter/command/commands/SetConstCommand.java b/src/main/java/emu/grasscutter/command/commands/SetConstCommand.java index 21c4a482a..1e0edd264 100644 --- a/src/main/java/emu/grasscutter/command/commands/SetConstCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/SetConstCommand.java @@ -6,7 +6,6 @@ import emu.grasscutter.game.entity.EntityAvatar; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.world.*; import emu.grasscutter.server.packet.send.PacketSceneEntityAppearNotify; - import java.util.List; @Command( diff --git a/src/main/java/emu/grasscutter/command/commands/SetFetterLevelCommand.java b/src/main/java/emu/grasscutter/command/commands/SetFetterLevelCommand.java index 001fb845e..cc3b5f343 100644 --- a/src/main/java/emu/grasscutter/command/commands/SetFetterLevelCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/SetFetterLevelCommand.java @@ -1,15 +1,14 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.command.*; import emu.grasscutter.data.GameData; import emu.grasscutter.game.avatar.Avatar; import emu.grasscutter.game.player.Player; import emu.grasscutter.server.packet.send.PacketAvatarFetterDataNotify; - import java.util.List; -import static emu.grasscutter.utils.lang.Language.translate; - @Command( label = "setFetterLevel", usage = {""}, diff --git a/src/main/java/emu/grasscutter/command/commands/SetPropCommand.java b/src/main/java/emu/grasscutter/command/commands/SetPropCommand.java index 486350232..6cd5b0f14 100644 --- a/src/main/java/emu/grasscutter/command/commands/SetPropCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/SetPropCommand.java @@ -6,7 +6,6 @@ import emu.grasscutter.game.player.Player; import emu.grasscutter.game.props.PlayerProperty; import emu.grasscutter.game.tower.TowerLevelRecord; import emu.grasscutter.server.packet.send.*; - import java.util.*; import java.util.concurrent.CopyOnWriteArrayList; import java.util.stream.IntStream; diff --git a/src/main/java/emu/grasscutter/command/commands/SetStatsCommand.java b/src/main/java/emu/grasscutter/command/commands/SetStatsCommand.java index 3ba30860e..f88239926 100644 --- a/src/main/java/emu/grasscutter/command/commands/SetStatsCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/SetStatsCommand.java @@ -6,7 +6,6 @@ import emu.grasscutter.game.entity.EntityAvatar; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.props.FightProperty; import emu.grasscutter.server.packet.send.PacketEntityFightPropUpdateNotify; - import java.util.*; @Command( diff --git a/src/main/java/emu/grasscutter/command/commands/SoundCommand.java b/src/main/java/emu/grasscutter/command/commands/SoundCommand.java index 6c5c71a56..b6be991c2 100644 --- a/src/main/java/emu/grasscutter/command/commands/SoundCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/SoundCommand.java @@ -1,14 +1,13 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.command.*; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.world.Position; import emu.grasscutter.server.packet.send.PacketScenePlayerSoundNotify; -import lombok.val; - import java.util.List; - -import static emu.grasscutter.utils.lang.Language.translate; +import lombok.val; @Command( label = "sound", diff --git a/src/main/java/emu/grasscutter/command/commands/SpawnCommand.java b/src/main/java/emu/grasscutter/command/commands/SpawnCommand.java index b5b1ec9fc..f815cc4c0 100644 --- a/src/main/java/emu/grasscutter/command/commands/SpawnCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/SpawnCommand.java @@ -1,5 +1,9 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.command.CommandHelpers.*; +import static emu.grasscutter.config.Configuration.GAME_OPTIONS; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.command.*; import emu.grasscutter.data.GameData; import emu.grasscutter.data.excels.*; @@ -8,15 +12,10 @@ import emu.grasscutter.game.entity.*; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.props.*; import emu.grasscutter.game.world.*; -import lombok.Setter; - import java.util.*; import java.util.function.BiConsumer; import java.util.regex.Pattern; - -import static emu.grasscutter.command.CommandHelpers.*; -import static emu.grasscutter.config.Configuration.GAME_OPTIONS; -import static emu.grasscutter.utils.lang.Language.translate; +import lombok.Setter; @Command( label = "spawn", diff --git a/src/main/java/emu/grasscutter/command/commands/StopCommand.java b/src/main/java/emu/grasscutter/command/commands/StopCommand.java index 9257e7f22..a5f9584bb 100644 --- a/src/main/java/emu/grasscutter/command/commands/StopCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/StopCommand.java @@ -1,13 +1,12 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.Grasscutter; import emu.grasscutter.command.*; import emu.grasscutter.game.player.Player; - import java.util.List; -import static emu.grasscutter.utils.lang.Language.translate; - @Command( label = "stop", aliases = {"shutdown"}, diff --git a/src/main/java/emu/grasscutter/command/commands/TalentCommand.java b/src/main/java/emu/grasscutter/command/commands/TalentCommand.java index f36c3c171..ff71be1bf 100644 --- a/src/main/java/emu/grasscutter/command/commands/TalentCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/TalentCommand.java @@ -6,7 +6,6 @@ import emu.grasscutter.data.excels.avatar.AvatarSkillDepotData; import emu.grasscutter.game.avatar.Avatar; import emu.grasscutter.game.player.Player; import emu.grasscutter.utils.lang.Language; - import java.util.List; @Command( diff --git a/src/main/java/emu/grasscutter/command/commands/TeamCommand.java b/src/main/java/emu/grasscutter/command/commands/TeamCommand.java index 14cf0f244..1028a94e9 100644 --- a/src/main/java/emu/grasscutter/command/commands/TeamCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/TeamCommand.java @@ -1,13 +1,12 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.config.Configuration.GAME_OPTIONS; + import emu.grasscutter.command.*; import emu.grasscutter.game.player.Player; import emu.grasscutter.server.packet.send.PacketChangeMpTeamAvatarRsp; - import java.util.*; -import static emu.grasscutter.config.Configuration.GAME_OPTIONS; - @Command( label = "team", usage = {"add ", "(remove|set) [index|first|last|index-index,...]"}, diff --git a/src/main/java/emu/grasscutter/command/commands/TeleportAllCommand.java b/src/main/java/emu/grasscutter/command/commands/TeleportAllCommand.java index 99fe0c423..4acea6be7 100644 --- a/src/main/java/emu/grasscutter/command/commands/TeleportAllCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/TeleportAllCommand.java @@ -1,13 +1,12 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.command.*; import emu.grasscutter.game.player.Player; import emu.grasscutter.server.event.player.PlayerTeleportEvent.TeleportType; - import java.util.List; -import static emu.grasscutter.utils.lang.Language.translate; - @Command( label = "teleportAll", aliases = {"tpall"}, diff --git a/src/main/java/emu/grasscutter/command/commands/TeleportCommand.java b/src/main/java/emu/grasscutter/command/commands/TeleportCommand.java index 64070561c..f75acb42a 100644 --- a/src/main/java/emu/grasscutter/command/commands/TeleportCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/TeleportCommand.java @@ -1,14 +1,13 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.command.*; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.world.Position; import emu.grasscutter.server.event.player.PlayerTeleportEvent.TeleportType; - import java.util.List; -import static emu.grasscutter.utils.lang.Language.translate; - @Command( label = "teleport", aliases = {"tp"}, diff --git a/src/main/java/emu/grasscutter/command/commands/TrialAvatarActivityCommand.java b/src/main/java/emu/grasscutter/command/commands/TrialAvatarActivityCommand.java index 7a78bcd0d..d375f490d 100644 --- a/src/main/java/emu/grasscutter/command/commands/TrialAvatarActivityCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/TrialAvatarActivityCommand.java @@ -1,16 +1,15 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.command.*; import emu.grasscutter.game.activity.trialavatar.*; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.props.ActivityType; import emu.grasscutter.server.packet.send.PacketActivityInfoNotify; import emu.grasscutter.utils.JsonUtils; - import java.util.List; -import static emu.grasscutter.utils.lang.Language.translate; - @Command( label = "trialAvatarActivity", aliases = {"taa"}, diff --git a/src/main/java/emu/grasscutter/command/commands/UnBanCommand.java b/src/main/java/emu/grasscutter/command/commands/UnBanCommand.java index db027ccf5..3b2849905 100644 --- a/src/main/java/emu/grasscutter/command/commands/UnBanCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/UnBanCommand.java @@ -3,7 +3,6 @@ package emu.grasscutter.command.commands; import emu.grasscutter.command.*; import emu.grasscutter.game.Account; import emu.grasscutter.game.player.Player; - import java.util.List; @Command( diff --git a/src/main/java/emu/grasscutter/command/commands/UnlockAllCommand.java b/src/main/java/emu/grasscutter/command/commands/UnlockAllCommand.java index fa376d5af..6dd1d9935 100644 --- a/src/main/java/emu/grasscutter/command/commands/UnlockAllCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/UnlockAllCommand.java @@ -1,14 +1,13 @@ package emu.grasscutter.command.commands; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.command.*; import emu.grasscutter.data.GameData; import emu.grasscutter.game.player.*; import emu.grasscutter.server.packet.send.PacketOpenStateChangeNotify; - import java.util.*; -import static emu.grasscutter.utils.lang.Language.translate; - @Command( label = "unlockall", usage = {""}, diff --git a/src/main/java/emu/grasscutter/command/commands/WeatherCommand.java b/src/main/java/emu/grasscutter/command/commands/WeatherCommand.java index cf8d52c53..26571d34a 100644 --- a/src/main/java/emu/grasscutter/command/commands/WeatherCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/WeatherCommand.java @@ -3,7 +3,6 @@ package emu.grasscutter.command.commands; import emu.grasscutter.command.*; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.props.ClimateType; - import java.util.List; @Command( diff --git a/src/main/java/emu/grasscutter/config/Configuration.java b/src/main/java/emu/grasscutter/config/Configuration.java index 4229824e3..94f7ba453 100644 --- a/src/main/java/emu/grasscutter/config/Configuration.java +++ b/src/main/java/emu/grasscutter/config/Configuration.java @@ -1,12 +1,11 @@ package emu.grasscutter.config; -import emu.grasscutter.utils.FileUtils; +import static emu.grasscutter.Grasscutter.config; +import emu.grasscutter.utils.FileUtils; import java.nio.file.Path; import java.util.Locale; -import static emu.grasscutter.Grasscutter.config; - /** * A data container for the server's configuration. * diff --git a/src/main/java/emu/grasscutter/data/DataLoader.java b/src/main/java/emu/grasscutter/data/DataLoader.java index eefbd98a0..04b643606 100644 --- a/src/main/java/emu/grasscutter/data/DataLoader.java +++ b/src/main/java/emu/grasscutter/data/DataLoader.java @@ -4,11 +4,10 @@ import emu.grasscutter.Grasscutter; import emu.grasscutter.server.http.handlers.GachaHandler; import emu.grasscutter.tools.Tools; import emu.grasscutter.utils.*; -import lombok.val; - import java.io.*; import java.nio.file.*; import java.util.*; +import lombok.val; public class DataLoader { diff --git a/src/main/java/emu/grasscutter/data/GameData.java b/src/main/java/emu/grasscutter/data/GameData.java index 5bef0478a..01a450fe5 100644 --- a/src/main/java/emu/grasscutter/data/GameData.java +++ b/src/main/java/emu/grasscutter/data/GameData.java @@ -27,11 +27,10 @@ import emu.grasscutter.game.quest.enums.QuestCond; import emu.grasscutter.game.world.GroupReplacementData; import emu.grasscutter.utils.Utils; import it.unimi.dsi.fastutil.ints.*; -import lombok.*; - -import javax.annotation.Nullable; import java.lang.reflect.Field; import java.util.*; +import javax.annotation.Nullable; +import lombok.*; @SuppressWarnings({"unused", "MismatchedQueryAndUpdateOfCollection"}) public final class GameData { diff --git a/src/main/java/emu/grasscutter/data/GameDepot.java b/src/main/java/emu/grasscutter/data/GameDepot.java index 58bbf9bbf..b3c43bb21 100644 --- a/src/main/java/emu/grasscutter/data/GameDepot.java +++ b/src/main/java/emu/grasscutter/data/GameDepot.java @@ -7,9 +7,8 @@ import emu.grasscutter.game.managers.blossom.BlossomConfig; import emu.grasscutter.game.world.SpawnDataEntry; import emu.grasscutter.utils.objects.WeightedList; import it.unimi.dsi.fastutil.ints.*; -import lombok.*; - import java.util.*; +import lombok.*; public class GameDepot { public static final int[] BLOCK_SIZE = new int[] {50, 500}; // Scales diff --git a/src/main/java/emu/grasscutter/data/ResourceLoader.java b/src/main/java/emu/grasscutter/data/ResourceLoader.java index 2888f8349..8a6c91879 100644 --- a/src/main/java/emu/grasscutter/data/ResourceLoader.java +++ b/src/main/java/emu/grasscutter/data/ResourceLoader.java @@ -1,5 +1,8 @@ package emu.grasscutter.data; +import static emu.grasscutter.utils.FileUtils.*; +import static emu.grasscutter.utils.lang.Language.translate; + import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import emu.grasscutter.Grasscutter; @@ -20,9 +23,6 @@ import emu.grasscutter.scripts.*; import emu.grasscutter.utils.*; import it.unimi.dsi.fastutil.Pair; import it.unimi.dsi.fastutil.ints.*; -import lombok.*; - -import javax.script.*; import java.io.*; import java.nio.file.*; import java.util.*; @@ -30,9 +30,8 @@ import java.util.Map.Entry; import java.util.concurrent.*; import java.util.regex.Pattern; import java.util.stream.*; - -import static emu.grasscutter.utils.FileUtils.*; -import static emu.grasscutter.utils.lang.Language.translate; +import javax.script.*; +import lombok.*; public final class ResourceLoader { diff --git a/src/main/java/emu/grasscutter/data/binout/AbilityData.java b/src/main/java/emu/grasscutter/data/binout/AbilityData.java index db4bc60fd..d689d1e19 100644 --- a/src/main/java/emu/grasscutter/data/binout/AbilityData.java +++ b/src/main/java/emu/grasscutter/data/binout/AbilityData.java @@ -3,7 +3,6 @@ package emu.grasscutter.data.binout; import emu.grasscutter.data.binout.AbilityModifier.AbilityModifierAction; import emu.grasscutter.game.ability.AbilityLocalIdGenerator; import emu.grasscutter.game.ability.AbilityLocalIdGenerator.ConfigAbilitySubContainerType; - import java.util.*; public class AbilityData { diff --git a/src/main/java/emu/grasscutter/data/binout/AbilityMixinData.java b/src/main/java/emu/grasscutter/data/binout/AbilityMixinData.java index c6e54de4f..50388dec3 100644 --- a/src/main/java/emu/grasscutter/data/binout/AbilityMixinData.java +++ b/src/main/java/emu/grasscutter/data/binout/AbilityMixinData.java @@ -3,7 +3,6 @@ package emu.grasscutter.data.binout; import com.google.gson.*; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; - import java.io.Serializable; import java.util.*; diff --git a/src/main/java/emu/grasscutter/data/binout/AbilityModifier.java b/src/main/java/emu/grasscutter/data/binout/AbilityModifier.java index 44865e90b..ce0365450 100644 --- a/src/main/java/emu/grasscutter/data/binout/AbilityModifier.java +++ b/src/main/java/emu/grasscutter/data/binout/AbilityModifier.java @@ -3,9 +3,8 @@ package emu.grasscutter.data.binout; import com.google.gson.annotations.SerializedName; import emu.grasscutter.data.common.DynamicFloat; import emu.grasscutter.game.props.ElementType; -import lombok.ToString; - import java.io.Serializable; +import lombok.ToString; public class AbilityModifier implements Serializable { private static final long serialVersionUID = -2001232313615923575L; diff --git a/src/main/java/emu/grasscutter/data/binout/AbilityModifierEntry.java b/src/main/java/emu/grasscutter/data/binout/AbilityModifierEntry.java index aa1862075..9b519ab9c 100644 --- a/src/main/java/emu/grasscutter/data/binout/AbilityModifierEntry.java +++ b/src/main/java/emu/grasscutter/data/binout/AbilityModifierEntry.java @@ -1,7 +1,6 @@ package emu.grasscutter.data.binout; import emu.grasscutter.data.binout.AbilityModifier.AbilityModifierAction; - import java.util.*; public class AbilityModifierEntry { diff --git a/src/main/java/emu/grasscutter/data/binout/ConfigGadget.java b/src/main/java/emu/grasscutter/data/binout/ConfigGadget.java index 94b0d9612..791dad870 100644 --- a/src/main/java/emu/grasscutter/data/binout/ConfigGadget.java +++ b/src/main/java/emu/grasscutter/data/binout/ConfigGadget.java @@ -1,10 +1,9 @@ package emu.grasscutter.data.binout; +import javax.annotation.Nullable; import lombok.*; import lombok.experimental.FieldDefaults; -import javax.annotation.Nullable; - @Data @FieldDefaults(level = AccessLevel.PRIVATE) public class ConfigGadget { diff --git a/src/main/java/emu/grasscutter/data/binout/HomeworldDefaultSaveData.java b/src/main/java/emu/grasscutter/data/binout/HomeworldDefaultSaveData.java index cfd9d6fbf..1fbd3f415 100644 --- a/src/main/java/emu/grasscutter/data/binout/HomeworldDefaultSaveData.java +++ b/src/main/java/emu/grasscutter/data/binout/HomeworldDefaultSaveData.java @@ -2,11 +2,10 @@ package emu.grasscutter.data.binout; import com.google.gson.annotations.SerializedName; import emu.grasscutter.game.world.Position; +import java.util.List; import lombok.*; import lombok.experimental.FieldDefaults; -import java.util.List; - @Data @FieldDefaults(level = AccessLevel.PRIVATE) public class HomeworldDefaultSaveData { diff --git a/src/main/java/emu/grasscutter/data/binout/MainQuestData.java b/src/main/java/emu/grasscutter/data/binout/MainQuestData.java index 50053bcaa..da7b589c7 100644 --- a/src/main/java/emu/grasscutter/data/binout/MainQuestData.java +++ b/src/main/java/emu/grasscutter/data/binout/MainQuestData.java @@ -3,9 +3,8 @@ package emu.grasscutter.data.binout; import dev.morphia.annotations.Entity; import emu.grasscutter.data.GameData; import emu.grasscutter.game.quest.enums.QuestType; -import lombok.Data; - import java.util.*; +import lombok.Data; public class MainQuestData { private int id; diff --git a/src/main/java/emu/grasscutter/data/binout/OpenConfigEntry.java b/src/main/java/emu/grasscutter/data/binout/OpenConfigEntry.java index 368c42880..25f8055bf 100644 --- a/src/main/java/emu/grasscutter/data/binout/OpenConfigEntry.java +++ b/src/main/java/emu/grasscutter/data/binout/OpenConfigEntry.java @@ -1,7 +1,6 @@ package emu.grasscutter.data.binout; import emu.grasscutter.data.ResourceLoader.OpenConfigData; - import java.util.*; public class OpenConfigEntry { diff --git a/src/main/java/emu/grasscutter/data/binout/SceneNpcBornData.java b/src/main/java/emu/grasscutter/data/binout/SceneNpcBornData.java index 771dba034..b24207e1e 100644 --- a/src/main/java/emu/grasscutter/data/binout/SceneNpcBornData.java +++ b/src/main/java/emu/grasscutter/data/binout/SceneNpcBornData.java @@ -3,11 +3,10 @@ package emu.grasscutter.data.binout; import com.github.davidmoten.rtreemulti.RTree; import com.github.davidmoten.rtreemulti.geometry.Geometry; import emu.grasscutter.scripts.data.SceneGroup; -import lombok.*; -import lombok.experimental.FieldDefaults; - import java.util.*; import java.util.concurrent.ConcurrentHashMap; +import lombok.*; +import lombok.experimental.FieldDefaults; @Data @FieldDefaults(level = AccessLevel.PRIVATE) diff --git a/src/main/java/emu/grasscutter/data/binout/SceneNpcBornEntry.java b/src/main/java/emu/grasscutter/data/binout/SceneNpcBornEntry.java index 545278135..b3c2f96b6 100644 --- a/src/main/java/emu/grasscutter/data/binout/SceneNpcBornEntry.java +++ b/src/main/java/emu/grasscutter/data/binout/SceneNpcBornEntry.java @@ -2,11 +2,10 @@ package emu.grasscutter.data.binout; import com.google.gson.annotations.SerializedName; import emu.grasscutter.game.world.Position; +import java.util.List; import lombok.*; import lombok.experimental.FieldDefaults; -import java.util.List; - @Data @FieldDefaults(level = AccessLevel.PRIVATE) public class SceneNpcBornEntry { diff --git a/src/main/java/emu/grasscutter/data/binout/ScriptSceneData.java b/src/main/java/emu/grasscutter/data/binout/ScriptSceneData.java index 543ec4c4a..60cde8fc2 100644 --- a/src/main/java/emu/grasscutter/data/binout/ScriptSceneData.java +++ b/src/main/java/emu/grasscutter/data/binout/ScriptSceneData.java @@ -1,9 +1,8 @@ package emu.grasscutter.data.binout; import com.google.gson.annotations.SerializedName; -import lombok.Data; - import java.util.*; +import lombok.Data; @Data public class ScriptSceneData { diff --git a/src/main/java/emu/grasscutter/data/binout/TalentData.java b/src/main/java/emu/grasscutter/data/binout/TalentData.java index fa1e74101..29b0b93b4 100644 --- a/src/main/java/emu/grasscutter/data/binout/TalentData.java +++ b/src/main/java/emu/grasscutter/data/binout/TalentData.java @@ -2,7 +2,6 @@ package emu.grasscutter.data.binout; import com.google.gson.annotations.SerializedName; import emu.grasscutter.data.common.DynamicFloat; - import java.io.Serializable; public class TalentData implements Serializable { diff --git a/src/main/java/emu/grasscutter/data/binout/config/ConfigEntityBase.java b/src/main/java/emu/grasscutter/data/binout/config/ConfigEntityBase.java index 43c837dd4..1b46b89dc 100644 --- a/src/main/java/emu/grasscutter/data/binout/config/ConfigEntityBase.java +++ b/src/main/java/emu/grasscutter/data/binout/config/ConfigEntityBase.java @@ -1,10 +1,9 @@ package emu.grasscutter.data.binout.config; import emu.grasscutter.data.binout.config.fields.*; -import lombok.Data; - -import javax.annotation.Nullable; import java.util.Collection; +import javax.annotation.Nullable; +import lombok.Data; @Data public class ConfigEntityBase { diff --git a/src/main/java/emu/grasscutter/data/binout/config/ConfigGlobalCombat.java b/src/main/java/emu/grasscutter/data/binout/config/ConfigGlobalCombat.java index a43d4044d..2b736061a 100644 --- a/src/main/java/emu/grasscutter/data/binout/config/ConfigGlobalCombat.java +++ b/src/main/java/emu/grasscutter/data/binout/config/ConfigGlobalCombat.java @@ -1,8 +1,7 @@ package emu.grasscutter.data.binout.config; -import lombok.Data; - import java.util.List; +import lombok.Data; @Data public class ConfigGlobalCombat { diff --git a/src/main/java/emu/grasscutter/data/binout/config/ConfigLevelEntity.java b/src/main/java/emu/grasscutter/data/binout/config/ConfigLevelEntity.java index e45cd7d69..9afe5a5d1 100644 --- a/src/main/java/emu/grasscutter/data/binout/config/ConfigLevelEntity.java +++ b/src/main/java/emu/grasscutter/data/binout/config/ConfigLevelEntity.java @@ -1,9 +1,8 @@ package emu.grasscutter.data.binout.config; import emu.grasscutter.data.binout.config.fields.ConfigAbilityData; -import lombok.Getter; - import java.util.List; +import lombok.Getter; public class ConfigLevelEntity { diff --git a/src/main/java/emu/grasscutter/data/binout/config/fields/ConfigGlobalValue.java b/src/main/java/emu/grasscutter/data/binout/config/fields/ConfigGlobalValue.java index 6762d6cea..c5f58dcb7 100644 --- a/src/main/java/emu/grasscutter/data/binout/config/fields/ConfigGlobalValue.java +++ b/src/main/java/emu/grasscutter/data/binout/config/fields/ConfigGlobalValue.java @@ -1,8 +1,7 @@ package emu.grasscutter.data.binout.config.fields; -import lombok.Data; - import java.util.*; +import lombok.Data; /** Contains information about the entities SGVs */ @Data diff --git a/src/main/java/emu/grasscutter/data/binout/routes/SceneRoutes.java b/src/main/java/emu/grasscutter/data/binout/routes/SceneRoutes.java index 9203ea7b3..e8e631aa6 100644 --- a/src/main/java/emu/grasscutter/data/binout/routes/SceneRoutes.java +++ b/src/main/java/emu/grasscutter/data/binout/routes/SceneRoutes.java @@ -1,10 +1,9 @@ package emu.grasscutter.data.binout.routes; +import javax.annotation.Nullable; import lombok.*; import lombok.experimental.FieldDefaults; -import javax.annotation.Nullable; - @Data @FieldDefaults(level = AccessLevel.PRIVATE) public class SceneRoutes { diff --git a/src/main/java/emu/grasscutter/data/common/DynamicFloat.java b/src/main/java/emu/grasscutter/data/common/DynamicFloat.java index ea29e7074..99dc12433 100644 --- a/src/main/java/emu/grasscutter/data/common/DynamicFloat.java +++ b/src/main/java/emu/grasscutter/data/common/DynamicFloat.java @@ -4,9 +4,8 @@ import emu.grasscutter.data.excels.ProudSkillData; import emu.grasscutter.game.ability.Ability; import it.unimi.dsi.fastutil.floats.FloatArrayList; import it.unimi.dsi.fastutil.objects.*; -import lombok.*; - import java.util.*; +import lombok.*; @Getter public class DynamicFloat { diff --git a/src/main/java/emu/grasscutter/data/custom/TrialAvatarActivityCustomData.java b/src/main/java/emu/grasscutter/data/custom/TrialAvatarActivityCustomData.java index 0828ae3f0..82670b7b8 100644 --- a/src/main/java/emu/grasscutter/data/custom/TrialAvatarActivityCustomData.java +++ b/src/main/java/emu/grasscutter/data/custom/TrialAvatarActivityCustomData.java @@ -1,9 +1,8 @@ package emu.grasscutter.data.custom; import emu.grasscutter.data.common.BaseTrialActivityData; -import lombok.Data; - import java.util.List; +import lombok.Data; @Data public class TrialAvatarActivityCustomData implements BaseTrialActivityData { diff --git a/src/main/java/emu/grasscutter/data/custom/TrialAvatarCustomData.java b/src/main/java/emu/grasscutter/data/custom/TrialAvatarCustomData.java index 67a2891f0..00c599367 100644 --- a/src/main/java/emu/grasscutter/data/custom/TrialAvatarCustomData.java +++ b/src/main/java/emu/grasscutter/data/custom/TrialAvatarCustomData.java @@ -1,8 +1,7 @@ package emu.grasscutter.data.custom; -import lombok.Data; - import java.util.List; +import lombok.Data; @Data public class TrialAvatarCustomData { diff --git a/src/main/java/emu/grasscutter/data/excels/BargainData.java b/src/main/java/emu/grasscutter/data/excels/BargainData.java index b991a2f08..8bc3d050a 100644 --- a/src/main/java/emu/grasscutter/data/excels/BargainData.java +++ b/src/main/java/emu/grasscutter/data/excels/BargainData.java @@ -1,9 +1,8 @@ package emu.grasscutter.data.excels; import emu.grasscutter.data.*; -import lombok.Getter; - import java.util.List; +import lombok.Getter; @Getter @ResourceType(name = "BargainExcelConfigData.json") diff --git a/src/main/java/emu/grasscutter/data/excels/BattlePassMissionData.java b/src/main/java/emu/grasscutter/data/excels/BattlePassMissionData.java index ec062ce4b..ea368acba 100644 --- a/src/main/java/emu/grasscutter/data/excels/BattlePassMissionData.java +++ b/src/main/java/emu/grasscutter/data/excels/BattlePassMissionData.java @@ -3,10 +3,9 @@ package emu.grasscutter.data.excels; import emu.grasscutter.data.*; import emu.grasscutter.game.props.*; import emu.grasscutter.net.proto.BattlePassMissionOuterClass.BattlePassMission.MissionStatus; -import lombok.Getter; - import java.util.*; import java.util.stream.Collectors; +import lombok.Getter; @ResourceType(name = {"BattlePassMissionExcelConfigData.json"}) @Getter diff --git a/src/main/java/emu/grasscutter/data/excels/BattlePassRewardData.java b/src/main/java/emu/grasscutter/data/excels/BattlePassRewardData.java index c2917b086..5e08ded50 100644 --- a/src/main/java/emu/grasscutter/data/excels/BattlePassRewardData.java +++ b/src/main/java/emu/grasscutter/data/excels/BattlePassRewardData.java @@ -1,9 +1,8 @@ package emu.grasscutter.data.excels; import emu.grasscutter.data.*; -import lombok.Getter; - import java.util.List; +import lombok.Getter; @ResourceType(name = "BattlePassRewardExcelConfigData.json") @Getter diff --git a/src/main/java/emu/grasscutter/data/excels/BlossomRefreshExcelConfigData.java b/src/main/java/emu/grasscutter/data/excels/BlossomRefreshExcelConfigData.java index e2ebcf707..437751e28 100644 --- a/src/main/java/emu/grasscutter/data/excels/BlossomRefreshExcelConfigData.java +++ b/src/main/java/emu/grasscutter/data/excels/BlossomRefreshExcelConfigData.java @@ -1,9 +1,8 @@ package emu.grasscutter.data.excels; import emu.grasscutter.data.*; -import lombok.Getter; - import java.util.List; +import lombok.Getter; @ResourceType(name = "BlossomRefreshExcelConfigData.json") @Getter diff --git a/src/main/java/emu/grasscutter/data/excels/ChapterData.java b/src/main/java/emu/grasscutter/data/excels/ChapterData.java index 7bd9b9bb3..1008621a7 100644 --- a/src/main/java/emu/grasscutter/data/excels/ChapterData.java +++ b/src/main/java/emu/grasscutter/data/excels/ChapterData.java @@ -1,9 +1,8 @@ package emu.grasscutter.data.excels; import emu.grasscutter.data.*; -import lombok.Getter; - import java.util.*; +import lombok.Getter; @Getter @ResourceType(name = "ChapterExcelConfigData.json") diff --git a/src/main/java/emu/grasscutter/data/excels/CityData.java b/src/main/java/emu/grasscutter/data/excels/CityData.java index c6bc59746..9bc1940b3 100644 --- a/src/main/java/emu/grasscutter/data/excels/CityData.java +++ b/src/main/java/emu/grasscutter/data/excels/CityData.java @@ -1,11 +1,10 @@ package emu.grasscutter.data.excels; import emu.grasscutter.data.*; +import java.util.List; import lombok.*; import lombok.experimental.FieldDefaults; -import java.util.List; - @ResourceType(name = "CityConfigData.json", loadPriority = ResourceType.LoadPriority.HIGH) @Getter @Setter diff --git a/src/main/java/emu/grasscutter/data/excels/CombineData.java b/src/main/java/emu/grasscutter/data/excels/CombineData.java index df7a5859e..b44305589 100644 --- a/src/main/java/emu/grasscutter/data/excels/CombineData.java +++ b/src/main/java/emu/grasscutter/data/excels/CombineData.java @@ -2,7 +2,6 @@ package emu.grasscutter.data.excels; import emu.grasscutter.data.*; import emu.grasscutter.data.common.ItemParamData; - import java.util.List; import java.util.stream.Collectors; diff --git a/src/main/java/emu/grasscutter/data/excels/CompoundData.java b/src/main/java/emu/grasscutter/data/excels/CompoundData.java index e6f78c198..52da273e4 100644 --- a/src/main/java/emu/grasscutter/data/excels/CompoundData.java +++ b/src/main/java/emu/grasscutter/data/excels/CompoundData.java @@ -3,9 +3,8 @@ package emu.grasscutter.data.excels; import com.google.gson.annotations.SerializedName; import emu.grasscutter.data.*; import emu.grasscutter.data.common.ItemParamData; -import lombok.Getter; - import java.util.List; +import lombok.Getter; @ResourceType( name = {"CompoundExcelConfigData.json"}, diff --git a/src/main/java/emu/grasscutter/data/excels/CookRecipeData.java b/src/main/java/emu/grasscutter/data/excels/CookRecipeData.java index 7e1c069da..6806e01ed 100644 --- a/src/main/java/emu/grasscutter/data/excels/CookRecipeData.java +++ b/src/main/java/emu/grasscutter/data/excels/CookRecipeData.java @@ -3,9 +3,8 @@ package emu.grasscutter.data.excels; import emu.grasscutter.data.*; import emu.grasscutter.data.ResourceType.LoadPriority; import emu.grasscutter.data.common.ItemParamData; -import lombok.Getter; - import java.util.List; +import lombok.Getter; @ResourceType( name = {"CookRecipeExcelConfigData.json"}, diff --git a/src/main/java/emu/grasscutter/data/excels/DropTableData.java b/src/main/java/emu/grasscutter/data/excels/DropTableData.java index 39743e840..e2f1cd15b 100644 --- a/src/main/java/emu/grasscutter/data/excels/DropTableData.java +++ b/src/main/java/emu/grasscutter/data/excels/DropTableData.java @@ -3,9 +3,8 @@ package emu.grasscutter.data.excels; import emu.grasscutter.data.*; import emu.grasscutter.data.ResourceType.LoadPriority; import emu.grasscutter.data.common.DropItemData; -import lombok.Getter; - import java.util.List; +import lombok.Getter; @ResourceType( name = {"DropTableExcelConfigData.json", "DropSubTableExcelConfigData.json"}, diff --git a/src/main/java/emu/grasscutter/data/excels/EnvAnimalGatherConfigData.java b/src/main/java/emu/grasscutter/data/excels/EnvAnimalGatherConfigData.java index 41645e463..ebec960cb 100644 --- a/src/main/java/emu/grasscutter/data/excels/EnvAnimalGatherConfigData.java +++ b/src/main/java/emu/grasscutter/data/excels/EnvAnimalGatherConfigData.java @@ -2,7 +2,6 @@ package emu.grasscutter.data.excels; import emu.grasscutter.data.*; import emu.grasscutter.data.common.ItemParamData; - import java.util.List; @ResourceType( diff --git a/src/main/java/emu/grasscutter/data/excels/EquipAffixData.java b/src/main/java/emu/grasscutter/data/excels/EquipAffixData.java index 4afba16bc..08adc351d 100644 --- a/src/main/java/emu/grasscutter/data/excels/EquipAffixData.java +++ b/src/main/java/emu/grasscutter/data/excels/EquipAffixData.java @@ -2,7 +2,6 @@ package emu.grasscutter.data.excels; import emu.grasscutter.data.*; import emu.grasscutter.data.common.FightPropData; - import java.util.ArrayList; @ResourceType(name = "EquipAffixExcelConfigData.json") diff --git a/src/main/java/emu/grasscutter/data/excels/FetterData.java b/src/main/java/emu/grasscutter/data/excels/FetterData.java index 92adb273b..08eea561c 100644 --- a/src/main/java/emu/grasscutter/data/excels/FetterData.java +++ b/src/main/java/emu/grasscutter/data/excels/FetterData.java @@ -3,7 +3,6 @@ package emu.grasscutter.data.excels; import emu.grasscutter.data.*; import emu.grasscutter.data.ResourceType.LoadPriority; import emu.grasscutter.data.common.OpenCondData; - import java.util.List; @ResourceType( diff --git a/src/main/java/emu/grasscutter/data/excels/ForgeData.java b/src/main/java/emu/grasscutter/data/excels/ForgeData.java index 7a870f1a5..1211b4092 100644 --- a/src/main/java/emu/grasscutter/data/excels/ForgeData.java +++ b/src/main/java/emu/grasscutter/data/excels/ForgeData.java @@ -3,9 +3,8 @@ package emu.grasscutter.data.excels; import emu.grasscutter.data.*; import emu.grasscutter.data.ResourceType.LoadPriority; import emu.grasscutter.data.common.ItemParamData; -import lombok.Getter; - import java.util.List; +import lombok.Getter; @ResourceType( name = {"ForgeExcelConfigData.json"}, diff --git a/src/main/java/emu/grasscutter/data/excels/FurnitureMakeConfigData.java b/src/main/java/emu/grasscutter/data/excels/FurnitureMakeConfigData.java index 3b0516e92..fd2e27175 100644 --- a/src/main/java/emu/grasscutter/data/excels/FurnitureMakeConfigData.java +++ b/src/main/java/emu/grasscutter/data/excels/FurnitureMakeConfigData.java @@ -2,11 +2,10 @@ package emu.grasscutter.data.excels; import emu.grasscutter.data.*; import emu.grasscutter.data.common.ItemParamData; +import java.util.List; import lombok.*; import lombok.experimental.FieldDefaults; -import java.util.List; - @Getter @FieldDefaults(level = AccessLevel.PRIVATE) @ResourceType(name = {"FurnitureMakeExcelConfigData.json"}) diff --git a/src/main/java/emu/grasscutter/data/excels/HomeWorldBgmData.java b/src/main/java/emu/grasscutter/data/excels/HomeWorldBgmData.java index 7e6a18290..41797c727 100644 --- a/src/main/java/emu/grasscutter/data/excels/HomeWorldBgmData.java +++ b/src/main/java/emu/grasscutter/data/excels/HomeWorldBgmData.java @@ -9,11 +9,16 @@ import lombok.experimental.FieldDefaults; @FieldDefaults(level = AccessLevel.PRIVATE) @ResourceType(name = {"HomeWorldBgmExcelConfigData.json"}) public class HomeWorldBgmData extends GameResource { - @SerializedName(value = "homeBgmId", alternate = {"MJJENLEBKEF"}) + @SerializedName( + value = "homeBgmId", + alternate = {"MJJENLEBKEF"}) private int homeBgmId; - @SerializedName(value = "isDefaultUnlock", alternate = {"GBEONILEOBA"}) + @SerializedName( + value = "isDefaultUnlock", + alternate = {"GBEONILEOBA"}) private boolean isDefaultUnlock; + private boolean NBIDHGOOCKD; private boolean JJMNJMCCOKP; private int cityId; diff --git a/src/main/java/emu/grasscutter/data/excels/HomeWorldLevelData.java b/src/main/java/emu/grasscutter/data/excels/HomeWorldLevelData.java index 55a35fcfd..b1798d205 100644 --- a/src/main/java/emu/grasscutter/data/excels/HomeWorldLevelData.java +++ b/src/main/java/emu/grasscutter/data/excels/HomeWorldLevelData.java @@ -1,11 +1,10 @@ package emu.grasscutter.data.excels; import emu.grasscutter.data.*; +import java.util.List; import lombok.*; import lombok.experimental.FieldDefaults; -import java.util.List; - @Getter @FieldDefaults(level = AccessLevel.PRIVATE) @ResourceType(name = {"HomeworldLevelExcelConfigData.json"}) diff --git a/src/main/java/emu/grasscutter/data/excels/HomeWorldNPCData.java b/src/main/java/emu/grasscutter/data/excels/HomeWorldNPCData.java index e1247de8c..41425620b 100644 --- a/src/main/java/emu/grasscutter/data/excels/HomeWorldNPCData.java +++ b/src/main/java/emu/grasscutter/data/excels/HomeWorldNPCData.java @@ -3,27 +3,42 @@ package emu.grasscutter.data.excels; import com.google.gson.annotations.SerializedName; import emu.grasscutter.data.*; import emu.grasscutter.game.inventory.ItemQuality; +import java.util.List; import lombok.*; import lombok.experimental.FieldDefaults; -import java.util.List; - @ResourceType(name = "HomeWorldNPCExcelConfigData.json") @Getter @FieldDefaults(level = AccessLevel.PRIVATE) public class HomeWorldNPCData extends GameResource { int furnitureID; int avatarID; - @SerializedName(value = "npcId", alternate = {"HDLJMOGHICL"}) + + @SerializedName( + value = "npcId", + alternate = {"HDLJMOGHICL"}) int npcId; - @SerializedName(value = "talkIdList", alternate = {"CKMCLCNIBLD"}) + + @SerializedName( + value = "talkIdList", + alternate = {"CKMCLCNIBLD"}) List talkIdList; - @SerializedName(value = "isTalkRandomly", alternate = {"HPJMMEBNMAI"}) + + @SerializedName( + value = "isTalkRandomly", + alternate = {"HPJMMEBNMAI"}) boolean isTalkRandomly; - @SerializedName(value = "npcQuality", alternate = {"BHJOIKFHIBD"}) + + @SerializedName( + value = "npcQuality", + alternate = {"BHJOIKFHIBD"}) ItemQuality npcQuality; - @SerializedName(value = "titleTextMapHash", alternate = {"GNMAIEGCFPO"}) + + @SerializedName( + value = "titleTextMapHash", + alternate = {"GNMAIEGCFPO"}) long titleTextMapHash; + long descTextMapHash; @Override diff --git a/src/main/java/emu/grasscutter/data/excels/InvestigationMonsterData.java b/src/main/java/emu/grasscutter/data/excels/InvestigationMonsterData.java index 07ab113c5..d5f47ab5e 100644 --- a/src/main/java/emu/grasscutter/data/excels/InvestigationMonsterData.java +++ b/src/main/java/emu/grasscutter/data/excels/InvestigationMonsterData.java @@ -1,11 +1,10 @@ package emu.grasscutter.data.excels; import emu.grasscutter.data.*; +import java.util.List; import lombok.*; import lombok.experimental.FieldDefaults; -import java.util.List; - @ResourceType( name = "InvestigationMonsterConfigData.json", loadPriority = ResourceType.LoadPriority.LOW) diff --git a/src/main/java/emu/grasscutter/data/excels/ItemData.java b/src/main/java/emu/grasscutter/data/excels/ItemData.java index 8844b8225..de77a4ba6 100644 --- a/src/main/java/emu/grasscutter/data/excels/ItemData.java +++ b/src/main/java/emu/grasscutter/data/excels/ItemData.java @@ -8,9 +8,8 @@ import emu.grasscutter.game.inventory.*; import emu.grasscutter.game.props.*; import emu.grasscutter.game.props.ItemUseAction.ItemUseAction; import it.unimi.dsi.fastutil.ints.*; -import lombok.Getter; - import java.util.*; +import lombok.Getter; @ResourceType( name = { diff --git a/src/main/java/emu/grasscutter/data/excels/PersonalLineData.java b/src/main/java/emu/grasscutter/data/excels/PersonalLineData.java index 39c669281..9d33f2c2f 100644 --- a/src/main/java/emu/grasscutter/data/excels/PersonalLineData.java +++ b/src/main/java/emu/grasscutter/data/excels/PersonalLineData.java @@ -1,11 +1,10 @@ package emu.grasscutter.data.excels; import emu.grasscutter.data.*; +import java.util.List; import lombok.*; import lombok.experimental.FieldDefaults; -import java.util.List; - @ResourceType(name = "PersonalLineExcelConfigData.json") @Getter @Setter // TODO: remove setters next API break diff --git a/src/main/java/emu/grasscutter/data/excels/ProudSkillData.java b/src/main/java/emu/grasscutter/data/excels/ProudSkillData.java index 50fdf5d46..51d4ae288 100644 --- a/src/main/java/emu/grasscutter/data/excels/ProudSkillData.java +++ b/src/main/java/emu/grasscutter/data/excels/ProudSkillData.java @@ -4,9 +4,8 @@ import dev.morphia.annotations.Transient; import emu.grasscutter.data.*; import emu.grasscutter.data.common.*; import it.unimi.dsi.fastutil.objects.*; -import lombok.Getter; - import java.util.*; +import lombok.Getter; @ResourceType(name = "ProudSkillExcelConfigData.json") public class ProudSkillData extends GameResource { diff --git a/src/main/java/emu/grasscutter/data/excels/RefreshPolicyExcelConfigData.java b/src/main/java/emu/grasscutter/data/excels/RefreshPolicyExcelConfigData.java index 80a9c52e9..a81d3a2c8 100644 --- a/src/main/java/emu/grasscutter/data/excels/RefreshPolicyExcelConfigData.java +++ b/src/main/java/emu/grasscutter/data/excels/RefreshPolicyExcelConfigData.java @@ -3,9 +3,8 @@ package emu.grasscutter.data.excels; import emu.grasscutter.data.*; import emu.grasscutter.game.props.RefreshType; import emu.grasscutter.game.world.World; -import lombok.Getter; - import java.util.*; +import lombok.Getter; @ResourceType(name = "RefreshPolicyExcelConfigData.json") public class RefreshPolicyExcelConfigData extends GameResource { diff --git a/src/main/java/emu/grasscutter/data/excels/RewardData.java b/src/main/java/emu/grasscutter/data/excels/RewardData.java index 938809ad6..1b817aec2 100644 --- a/src/main/java/emu/grasscutter/data/excels/RewardData.java +++ b/src/main/java/emu/grasscutter/data/excels/RewardData.java @@ -2,7 +2,6 @@ package emu.grasscutter.data.excels; import emu.grasscutter.data.*; import emu.grasscutter.data.common.ItemParamData; - import java.util.List; @ResourceType(name = "RewardExcelConfigData.json") diff --git a/src/main/java/emu/grasscutter/data/excels/RewardPreviewData.java b/src/main/java/emu/grasscutter/data/excels/RewardPreviewData.java index 70cf7fd74..dad51e911 100644 --- a/src/main/java/emu/grasscutter/data/excels/RewardPreviewData.java +++ b/src/main/java/emu/grasscutter/data/excels/RewardPreviewData.java @@ -3,9 +3,8 @@ package emu.grasscutter.data.excels; import emu.grasscutter.data.*; import emu.grasscutter.data.ResourceType.LoadPriority; import emu.grasscutter.data.common.*; -import lombok.Getter; - import java.util.Arrays; +import lombok.Getter; @ResourceType(name = "RewardPreviewExcelConfigData.json", loadPriority = LoadPriority.HIGH) public class RewardPreviewData extends GameResource { diff --git a/src/main/java/emu/grasscutter/data/excels/ShopGoodsData.java b/src/main/java/emu/grasscutter/data/excels/ShopGoodsData.java index ec8c8471b..5c1482f4d 100644 --- a/src/main/java/emu/grasscutter/data/excels/ShopGoodsData.java +++ b/src/main/java/emu/grasscutter/data/excels/ShopGoodsData.java @@ -4,7 +4,6 @@ import com.google.gson.annotations.SerializedName; import emu.grasscutter.data.*; import emu.grasscutter.data.common.ItemParamData; import emu.grasscutter.game.shop.ShopInfo; - import java.util.List; @ResourceType(name = "ShopGoodsExcelConfigData.json") diff --git a/src/main/java/emu/grasscutter/data/excels/TalkConfigData.java b/src/main/java/emu/grasscutter/data/excels/TalkConfigData.java index 64f6fb7df..25506dbd2 100644 --- a/src/main/java/emu/grasscutter/data/excels/TalkConfigData.java +++ b/src/main/java/emu/grasscutter/data/excels/TalkConfigData.java @@ -3,9 +3,8 @@ package emu.grasscutter.data.excels; import com.google.gson.annotations.SerializedName; import emu.grasscutter.data.*; import emu.grasscutter.game.talk.TalkExec; -import lombok.*; - import java.util.List; +import lombok.*; @ResourceType(name = "TalkExcelConfigData.json") @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/emu/grasscutter/data/excels/achievement/AchievementData.java b/src/main/java/emu/grasscutter/data/excels/achievement/AchievementData.java index 75ce44ba6..3a3b7836d 100644 --- a/src/main/java/emu/grasscutter/data/excels/achievement/AchievementData.java +++ b/src/main/java/emu/grasscutter/data/excels/achievement/AchievementData.java @@ -3,11 +3,10 @@ package emu.grasscutter.data.excels.achievement; import com.github.davidmoten.guavamini.Lists; import emu.grasscutter.data.*; import emu.grasscutter.data.excels.BattlePassMissionData; -import lombok.Getter; - import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; +import lombok.Getter; @Getter @ResourceType(name = "AchievementExcelConfigData.json") diff --git a/src/main/java/emu/grasscutter/data/excels/activity/ActivityCondExcelConfigData.java b/src/main/java/emu/grasscutter/data/excels/activity/ActivityCondExcelConfigData.java index 232ddadbf..ebb1d3c4f 100644 --- a/src/main/java/emu/grasscutter/data/excels/activity/ActivityCondExcelConfigData.java +++ b/src/main/java/emu/grasscutter/data/excels/activity/ActivityCondExcelConfigData.java @@ -3,11 +3,10 @@ package emu.grasscutter.data.excels.activity; import emu.grasscutter.data.*; import emu.grasscutter.game.activity.condition.ActivityConditions; import emu.grasscutter.game.quest.enums.LogicType; +import java.util.List; import lombok.*; import lombok.experimental.FieldDefaults; -import java.util.List; - @ResourceType(name = "NewActivityCondExcelConfigData.json") @Getter @FieldDefaults(level = AccessLevel.PRIVATE) diff --git a/src/main/java/emu/grasscutter/data/excels/activity/ActivityData.java b/src/main/java/emu/grasscutter/data/excels/activity/ActivityData.java index c7c98e09c..a78ab9228 100644 --- a/src/main/java/emu/grasscutter/data/excels/activity/ActivityData.java +++ b/src/main/java/emu/grasscutter/data/excels/activity/ActivityData.java @@ -1,11 +1,10 @@ package emu.grasscutter.data.excels.activity; import emu.grasscutter.data.*; +import java.util.*; import lombok.*; import lombok.experimental.FieldDefaults; -import java.util.*; - @ResourceType( name = "NewActivityExcelConfigData.json", loadPriority = ResourceType.LoadPriority.LOW) diff --git a/src/main/java/emu/grasscutter/data/excels/activity/ActivityShopData.java b/src/main/java/emu/grasscutter/data/excels/activity/ActivityShopData.java index 9ce698cc1..0f8d2ceb2 100644 --- a/src/main/java/emu/grasscutter/data/excels/activity/ActivityShopData.java +++ b/src/main/java/emu/grasscutter/data/excels/activity/ActivityShopData.java @@ -2,9 +2,8 @@ package emu.grasscutter.data.excels.activity; import emu.grasscutter.data.*; import emu.grasscutter.game.shop.ShopType; -import lombok.Getter; - import java.util.List; +import lombok.Getter; @ResourceType(name = "ActivityShopOverallExcelConfigData.json") public class ActivityShopData extends GameResource { diff --git a/src/main/java/emu/grasscutter/data/excels/activity/ActivityWatcherData.java b/src/main/java/emu/grasscutter/data/excels/activity/ActivityWatcherData.java index 3098f5eaf..48d9daf21 100644 --- a/src/main/java/emu/grasscutter/data/excels/activity/ActivityWatcherData.java +++ b/src/main/java/emu/grasscutter/data/excels/activity/ActivityWatcherData.java @@ -2,11 +2,10 @@ package emu.grasscutter.data.excels.activity; import emu.grasscutter.data.*; import emu.grasscutter.game.props.WatcherTriggerType; +import java.util.List; import lombok.*; import lombok.experimental.FieldDefaults; -import java.util.List; - @ResourceType( name = "NewActivityWatcherConfigData.json", loadPriority = ResourceType.LoadPriority.HIGH) diff --git a/src/main/java/emu/grasscutter/data/excels/avatar/AvatarCurveData.java b/src/main/java/emu/grasscutter/data/excels/avatar/AvatarCurveData.java index 032c57860..6b58a711b 100644 --- a/src/main/java/emu/grasscutter/data/excels/avatar/AvatarCurveData.java +++ b/src/main/java/emu/grasscutter/data/excels/avatar/AvatarCurveData.java @@ -2,7 +2,6 @@ package emu.grasscutter.data.excels.avatar; import emu.grasscutter.data.*; import emu.grasscutter.data.common.CurveInfo; - import java.util.*; import java.util.stream.Stream; diff --git a/src/main/java/emu/grasscutter/data/excels/avatar/AvatarPromoteData.java b/src/main/java/emu/grasscutter/data/excels/avatar/AvatarPromoteData.java index d948b3800..8972de6e9 100644 --- a/src/main/java/emu/grasscutter/data/excels/avatar/AvatarPromoteData.java +++ b/src/main/java/emu/grasscutter/data/excels/avatar/AvatarPromoteData.java @@ -2,7 +2,6 @@ package emu.grasscutter.data.excels.avatar; import emu.grasscutter.data.*; import emu.grasscutter.data.common.*; - import java.util.ArrayList; @ResourceType(name = "AvatarPromoteExcelConfigData.json") diff --git a/src/main/java/emu/grasscutter/data/excels/avatar/AvatarSkillDepotData.java b/src/main/java/emu/grasscutter/data/excels/avatar/AvatarSkillDepotData.java index 5c8b83409..0f844701d 100644 --- a/src/main/java/emu/grasscutter/data/excels/avatar/AvatarSkillDepotData.java +++ b/src/main/java/emu/grasscutter/data/excels/avatar/AvatarSkillDepotData.java @@ -7,10 +7,9 @@ import emu.grasscutter.data.binout.AbilityEmbryoEntry; import emu.grasscutter.game.props.ElementType; import emu.grasscutter.utils.Utils; import it.unimi.dsi.fastutil.ints.*; -import lombok.Getter; - import java.util.*; import java.util.stream.IntStream; +import lombok.Getter; @ResourceType(name = "AvatarSkillDepotExcelConfigData.json", loadPriority = LoadPriority.HIGH) @Getter diff --git a/src/main/java/emu/grasscutter/data/excels/avatar/AvatarTalentData.java b/src/main/java/emu/grasscutter/data/excels/avatar/AvatarTalentData.java index 62081e506..be08ede9f 100644 --- a/src/main/java/emu/grasscutter/data/excels/avatar/AvatarTalentData.java +++ b/src/main/java/emu/grasscutter/data/excels/avatar/AvatarTalentData.java @@ -3,7 +3,6 @@ package emu.grasscutter.data.excels.avatar; import emu.grasscutter.data.*; import emu.grasscutter.data.ResourceType.LoadPriority; import emu.grasscutter.data.common.FightPropData; - import java.util.ArrayList; @ResourceType(name = "AvatarTalentExcelConfigData.json", loadPriority = LoadPriority.HIGHEST) diff --git a/src/main/java/emu/grasscutter/data/excels/dungeon/DailyDungeonData.java b/src/main/java/emu/grasscutter/data/excels/dungeon/DailyDungeonData.java index 341f29a9f..78c9f0a6b 100644 --- a/src/main/java/emu/grasscutter/data/excels/dungeon/DailyDungeonData.java +++ b/src/main/java/emu/grasscutter/data/excels/dungeon/DailyDungeonData.java @@ -2,9 +2,8 @@ package emu.grasscutter.data.excels.dungeon; import emu.grasscutter.data.*; import it.unimi.dsi.fastutil.ints.*; -import lombok.Getter; - import java.util.Calendar; +import lombok.Getter; @ResourceType(name = "DailyDungeonConfigData.json") public class DailyDungeonData extends GameResource { diff --git a/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonChallengeConfigData.java b/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonChallengeConfigData.java index 99a3fa821..12f81f303 100644 --- a/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonChallengeConfigData.java +++ b/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonChallengeConfigData.java @@ -3,9 +3,8 @@ package emu.grasscutter.data.excels.dungeon; import com.google.gson.annotations.SerializedName; import emu.grasscutter.data.*; import emu.grasscutter.game.dungeons.challenge.enums.ChallengeType; -import lombok.Getter; - import java.util.HashSet; +import lombok.Getter; @Getter @ResourceType(name = "DungeonChallengeConfigData.json") diff --git a/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonData.java b/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonData.java index bb3186555..65b4b79e7 100644 --- a/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonData.java +++ b/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonData.java @@ -5,9 +5,8 @@ import emu.grasscutter.data.excels.RewardPreviewData; import emu.grasscutter.game.dungeons.enums.*; import emu.grasscutter.game.world.Position; import emu.grasscutter.scripts.data.SceneMeta; -import lombok.Getter; - import java.util.List; +import lombok.Getter; @ResourceType(name = "DungeonExcelConfigData.json") public class DungeonData extends GameResource { diff --git a/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonPassConfigData.java b/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonPassConfigData.java index 725dbcc7f..4c92c341b 100644 --- a/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonPassConfigData.java +++ b/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonPassConfigData.java @@ -3,9 +3,8 @@ package emu.grasscutter.data.excels.dungeon; import emu.grasscutter.data.*; import emu.grasscutter.game.dungeons.enums.DungeonPassConditionType; import emu.grasscutter.game.quest.enums.LogicType; -import lombok.*; - import java.util.List; +import lombok.*; @ResourceType(name = "DungeonPassExcelConfigData.json") public class DungeonPassConfigData extends GameResource { diff --git a/src/main/java/emu/grasscutter/data/excels/giving/GivingData.java b/src/main/java/emu/grasscutter/data/excels/giving/GivingData.java index 3f800297e..bd22eefcc 100644 --- a/src/main/java/emu/grasscutter/data/excels/giving/GivingData.java +++ b/src/main/java/emu/grasscutter/data/excels/giving/GivingData.java @@ -4,9 +4,8 @@ import com.google.gson.annotations.SerializedName; import emu.grasscutter.data.*; import emu.grasscutter.data.common.ItemParamData; import emu.grasscutter.game.inventory.BagTab; -import lombok.*; - import java.util.List; +import lombok.*; @Data @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/emu/grasscutter/data/excels/giving/GivingGroupData.java b/src/main/java/emu/grasscutter/data/excels/giving/GivingGroupData.java index 4c5bb7d1a..c73101ca8 100644 --- a/src/main/java/emu/grasscutter/data/excels/giving/GivingGroupData.java +++ b/src/main/java/emu/grasscutter/data/excels/giving/GivingGroupData.java @@ -2,9 +2,8 @@ package emu.grasscutter.data.excels.giving; import com.google.gson.annotations.SerializedName; import emu.grasscutter.data.*; -import lombok.*; - import java.util.List; +import lombok.*; @Data @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/emu/grasscutter/data/excels/monster/MonsterCurveData.java b/src/main/java/emu/grasscutter/data/excels/monster/MonsterCurveData.java index 3221cee27..c163da14a 100644 --- a/src/main/java/emu/grasscutter/data/excels/monster/MonsterCurveData.java +++ b/src/main/java/emu/grasscutter/data/excels/monster/MonsterCurveData.java @@ -2,7 +2,6 @@ package emu.grasscutter.data.excels.monster; import emu.grasscutter.data.*; import emu.grasscutter.data.common.CurveInfo; - import java.util.*; import java.util.stream.Stream; diff --git a/src/main/java/emu/grasscutter/data/excels/monster/MonsterData.java b/src/main/java/emu/grasscutter/data/excels/monster/MonsterData.java index 6f926bda4..62ba57a22 100644 --- a/src/main/java/emu/grasscutter/data/excels/monster/MonsterData.java +++ b/src/main/java/emu/grasscutter/data/excels/monster/MonsterData.java @@ -6,9 +6,8 @@ import emu.grasscutter.data.ResourceType.LoadPriority; import emu.grasscutter.data.common.PropGrowCurve; import emu.grasscutter.data.excels.GadgetData; import emu.grasscutter.game.props.*; -import lombok.Getter; - import java.util.*; +import lombok.Getter; @ResourceType(name = "MonsterExcelConfigData.json", loadPriority = LoadPriority.LOW) @Getter diff --git a/src/main/java/emu/grasscutter/data/excels/quest/QuestData.java b/src/main/java/emu/grasscutter/data/excels/quest/QuestData.java index 98dcd27eb..a0463f6d1 100644 --- a/src/main/java/emu/grasscutter/data/excels/quest/QuestData.java +++ b/src/main/java/emu/grasscutter/data/excels/quest/QuestData.java @@ -6,12 +6,11 @@ import emu.grasscutter.data.*; import emu.grasscutter.data.binout.MainQuestData; import emu.grasscutter.data.common.ItemParamData; import emu.grasscutter.game.quest.enums.*; +import java.util.*; +import javax.annotation.*; import lombok.*; import lombok.experimental.FieldDefaults; -import javax.annotation.*; -import java.util.*; - @ResourceType(name = "QuestExcelConfigData.json") @Getter @ToString diff --git a/src/main/java/emu/grasscutter/data/excels/reliquary/ReliquaryLevelData.java b/src/main/java/emu/grasscutter/data/excels/reliquary/ReliquaryLevelData.java index 0a71ccc70..6ea07319e 100644 --- a/src/main/java/emu/grasscutter/data/excels/reliquary/ReliquaryLevelData.java +++ b/src/main/java/emu/grasscutter/data/excels/reliquary/ReliquaryLevelData.java @@ -3,9 +3,8 @@ package emu.grasscutter.data.excels.reliquary; import emu.grasscutter.data.*; import emu.grasscutter.game.props.FightProperty; import it.unimi.dsi.fastutil.ints.*; -import lombok.Getter; - import java.util.List; +import lombok.Getter; @ResourceType(name = "ReliquaryLevelExcelConfigData.json") public class ReliquaryLevelData extends GameResource { diff --git a/src/main/java/emu/grasscutter/data/excels/scene/MapLayerFloorData.java b/src/main/java/emu/grasscutter/data/excels/scene/MapLayerFloorData.java index 60be676db..b2d57c265 100644 --- a/src/main/java/emu/grasscutter/data/excels/scene/MapLayerFloorData.java +++ b/src/main/java/emu/grasscutter/data/excels/scene/MapLayerFloorData.java @@ -2,11 +2,10 @@ package emu.grasscutter.data.excels.scene; import com.google.gson.annotations.SerializedName; import emu.grasscutter.data.*; +import java.util.List; import lombok.*; import lombok.experimental.FieldDefaults; -import java.util.List; - @ResourceType(name = "MapLayerFloorExcelConfigData.json") @Getter @FieldDefaults(level = AccessLevel.PRIVATE) diff --git a/src/main/java/emu/grasscutter/data/excels/scene/MapLayerGroupData.java b/src/main/java/emu/grasscutter/data/excels/scene/MapLayerGroupData.java index d095737c7..4ce808334 100644 --- a/src/main/java/emu/grasscutter/data/excels/scene/MapLayerGroupData.java +++ b/src/main/java/emu/grasscutter/data/excels/scene/MapLayerGroupData.java @@ -2,9 +2,8 @@ package emu.grasscutter.data.excels.scene; import com.google.gson.annotations.SerializedName; import emu.grasscutter.data.*; -import lombok.Getter; - import java.util.List; +import lombok.Getter; @ResourceType(name = "MapLayerGroupExcelConfigData.json") @Getter diff --git a/src/main/java/emu/grasscutter/data/excels/scene/SceneData.java b/src/main/java/emu/grasscutter/data/excels/scene/SceneData.java index e70086754..07c6e25c2 100644 --- a/src/main/java/emu/grasscutter/data/excels/scene/SceneData.java +++ b/src/main/java/emu/grasscutter/data/excels/scene/SceneData.java @@ -3,9 +3,8 @@ package emu.grasscutter.data.excels.scene; import com.google.gson.annotations.SerializedName; import emu.grasscutter.data.*; import emu.grasscutter.game.props.SceneType; -import lombok.Getter; - import java.util.List; +import lombok.Getter; @ResourceType(name = "SceneExcelConfigData.json") @Getter diff --git a/src/main/java/emu/grasscutter/data/excels/scene/SceneTagData.java b/src/main/java/emu/grasscutter/data/excels/scene/SceneTagData.java index 0f3281003..d894c5d65 100644 --- a/src/main/java/emu/grasscutter/data/excels/scene/SceneTagData.java +++ b/src/main/java/emu/grasscutter/data/excels/scene/SceneTagData.java @@ -2,9 +2,8 @@ package emu.grasscutter.data.excels.scene; import com.google.gson.annotations.SerializedName; import emu.grasscutter.data.*; -import lombok.Getter; - import java.util.List; +import lombok.Getter; @ResourceType(name = "SceneTagConfigData.json") @Getter diff --git a/src/main/java/emu/grasscutter/data/excels/tower/TowerScheduleData.java b/src/main/java/emu/grasscutter/data/excels/tower/TowerScheduleData.java index 815eb5a68..4a050829f 100644 --- a/src/main/java/emu/grasscutter/data/excels/tower/TowerScheduleData.java +++ b/src/main/java/emu/grasscutter/data/excels/tower/TowerScheduleData.java @@ -1,7 +1,6 @@ package emu.grasscutter.data.excels.tower; import emu.grasscutter.data.*; - import java.util.List; @ResourceType(name = "TowerScheduleExcelConfigData.json") diff --git a/src/main/java/emu/grasscutter/data/excels/trial/TrialAvatarActivityData.java b/src/main/java/emu/grasscutter/data/excels/trial/TrialAvatarActivityData.java index ac5ebea96..d557725f5 100644 --- a/src/main/java/emu/grasscutter/data/excels/trial/TrialAvatarActivityData.java +++ b/src/main/java/emu/grasscutter/data/excels/trial/TrialAvatarActivityData.java @@ -2,9 +2,8 @@ package emu.grasscutter.data.excels.trial; import emu.grasscutter.data.*; import emu.grasscutter.data.common.BaseTrialActivityData; -import lombok.*; - import java.util.List; +import lombok.*; @ResourceType(name = "TrialAvatarActivityExcelConfigData.json") @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/emu/grasscutter/data/excels/trial/TrialAvatarData.java b/src/main/java/emu/grasscutter/data/excels/trial/TrialAvatarData.java index 2351d800d..676422f45 100644 --- a/src/main/java/emu/grasscutter/data/excels/trial/TrialAvatarData.java +++ b/src/main/java/emu/grasscutter/data/excels/trial/TrialAvatarData.java @@ -1,9 +1,8 @@ package emu.grasscutter.data.excels.trial; import emu.grasscutter.data.*; -import lombok.*; - import java.util.List; +import lombok.*; @ResourceType(name = "TrialAvatarExcelConfigData.json") @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/emu/grasscutter/data/excels/trial/TrialAvatarTemplateData.java b/src/main/java/emu/grasscutter/data/excels/trial/TrialAvatarTemplateData.java index f8996e990..9be392b50 100644 --- a/src/main/java/emu/grasscutter/data/excels/trial/TrialAvatarTemplateData.java +++ b/src/main/java/emu/grasscutter/data/excels/trial/TrialAvatarTemplateData.java @@ -1,9 +1,8 @@ package emu.grasscutter.data.excels.trial; import emu.grasscutter.data.*; -import lombok.*; - import java.util.List; +import lombok.*; @ResourceType(name = "TrialAvatarTemplateExcelConfigData.json") @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/emu/grasscutter/data/excels/trial/TrialReliquaryData.java b/src/main/java/emu/grasscutter/data/excels/trial/TrialReliquaryData.java index b0eeaec4f..d9f34a14f 100644 --- a/src/main/java/emu/grasscutter/data/excels/trial/TrialReliquaryData.java +++ b/src/main/java/emu/grasscutter/data/excels/trial/TrialReliquaryData.java @@ -1,9 +1,8 @@ package emu.grasscutter.data.excels.trial; import emu.grasscutter.data.*; -import lombok.*; - import java.util.List; +import lombok.*; @ResourceType(name = "TrialReliquaryExcelConfigData.json") @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/emu/grasscutter/data/excels/weapon/WeaponCurveData.java b/src/main/java/emu/grasscutter/data/excels/weapon/WeaponCurveData.java index bae5bccf3..16502909c 100644 --- a/src/main/java/emu/grasscutter/data/excels/weapon/WeaponCurveData.java +++ b/src/main/java/emu/grasscutter/data/excels/weapon/WeaponCurveData.java @@ -2,7 +2,6 @@ package emu.grasscutter.data.excels.weapon; import emu.grasscutter.data.*; import emu.grasscutter.data.common.CurveInfo; - import java.util.*; import java.util.stream.Stream; diff --git a/src/main/java/emu/grasscutter/data/excels/weapon/WeaponPromoteData.java b/src/main/java/emu/grasscutter/data/excels/weapon/WeaponPromoteData.java index 34e85e2dc..775737e11 100644 --- a/src/main/java/emu/grasscutter/data/excels/weapon/WeaponPromoteData.java +++ b/src/main/java/emu/grasscutter/data/excels/weapon/WeaponPromoteData.java @@ -2,7 +2,6 @@ package emu.grasscutter.data.excels.weapon; import emu.grasscutter.data.*; import emu.grasscutter.data.common.*; - import java.util.ArrayList; @ResourceType(name = "WeaponPromoteExcelConfigData.json") diff --git a/src/main/java/emu/grasscutter/data/server/ActivityCondGroup.java b/src/main/java/emu/grasscutter/data/server/ActivityCondGroup.java index 1d0087249..8eb33a72a 100644 --- a/src/main/java/emu/grasscutter/data/server/ActivityCondGroup.java +++ b/src/main/java/emu/grasscutter/data/server/ActivityCondGroup.java @@ -1,8 +1,7 @@ package emu.grasscutter.data.server; -import lombok.Data; - import java.util.List; +import lombok.Data; @Data public class ActivityCondGroup { diff --git a/src/main/java/emu/grasscutter/data/server/Grid.java b/src/main/java/emu/grasscutter/data/server/Grid.java index 673811a86..624556d48 100644 --- a/src/main/java/emu/grasscutter/data/server/Grid.java +++ b/src/main/java/emu/grasscutter/data/server/Grid.java @@ -5,7 +5,6 @@ import com.github.davidmoten.rtreemulti.geometry.Geometry; import emu.grasscutter.Grasscutter; import emu.grasscutter.game.world.*; import emu.grasscutter.scripts.SceneIndexManager; - import java.util.*; public class Grid { diff --git a/src/main/java/emu/grasscutter/database/DatabaseHelper.java b/src/main/java/emu/grasscutter/database/DatabaseHelper.java index 75bd32665..fffc6ab73 100644 --- a/src/main/java/emu/grasscutter/database/DatabaseHelper.java +++ b/src/main/java/emu/grasscutter/database/DatabaseHelper.java @@ -1,5 +1,7 @@ package emu.grasscutter.database; +import static com.mongodb.client.model.Filters.eq; + import dev.morphia.query.*; import dev.morphia.query.experimental.filters.Filters; import emu.grasscutter.*; @@ -19,14 +21,11 @@ import emu.grasscutter.game.quest.GameMainQuest; import emu.grasscutter.game.world.SceneGroupInstance; import emu.grasscutter.utils.objects.Returnable; import io.netty.util.concurrent.FastThreadLocalThread; -import lombok.Getter; - -import javax.annotation.Nullable; import java.util.List; import java.util.concurrent.*; import java.util.stream.Stream; - -import static com.mongodb.client.model.Filters.eq; +import javax.annotation.Nullable; +import lombok.Getter; public final class DatabaseHelper { @Getter diff --git a/src/main/java/emu/grasscutter/database/DatabaseManager.java b/src/main/java/emu/grasscutter/database/DatabaseManager.java index f3a2009f9..7331bccb7 100644 --- a/src/main/java/emu/grasscutter/database/DatabaseManager.java +++ b/src/main/java/emu/grasscutter/database/DatabaseManager.java @@ -1,5 +1,7 @@ package emu.grasscutter.database; +import static emu.grasscutter.config.Configuration.DATABASE; + import com.mongodb.MongoCommandException; import com.mongodb.client.*; import dev.morphia.*; @@ -10,8 +12,6 @@ import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter.ServerRunMode; import emu.grasscutter.game.Account; -import static emu.grasscutter.config.Configuration.DATABASE; - public final class DatabaseManager { private static Datastore gameDatastore; private static Datastore dispatchDatastore; @@ -43,14 +43,13 @@ public final class DatabaseManager { // Map classes. var entities = - Grasscutter.reflector - .getTypesAnnotatedWith(Entity.class).stream() - .filter( - cls -> { - Entity e = cls.getAnnotation(Entity.class); - return e != null && !e.value().equals(Mapper.IGNORED_FIELDNAME); - }) - .toArray(Class[]::new); + Grasscutter.reflector.getTypesAnnotatedWith(Entity.class).stream() + .filter( + cls -> { + Entity e = cls.getAnnotation(Entity.class); + return e != null && !e.value().equals(Mapper.IGNORED_FIELDNAME); + }) + .toArray(Class[]::new); gameDatastore.getMapper().map(entities); diff --git a/src/main/java/emu/grasscutter/game/Account.java b/src/main/java/emu/grasscutter/game/Account.java index 0ffffc0f5..da1193b98 100644 --- a/src/main/java/emu/grasscutter/game/Account.java +++ b/src/main/java/emu/grasscutter/game/Account.java @@ -1,14 +1,13 @@ package emu.grasscutter.game; +import static emu.grasscutter.config.Configuration.*; + import dev.morphia.annotations.*; import emu.grasscutter.database.DatabaseHelper; import emu.grasscutter.utils.*; -import org.bson.Document; - import java.util.*; import java.util.stream.Stream; - -import static emu.grasscutter.config.Configuration.*; +import org.bson.Document; @Entity(value = "accounts", useDiscriminator = false) public class Account { diff --git a/src/main/java/emu/grasscutter/game/HandbookActions.java b/src/main/java/emu/grasscutter/game/HandbookActions.java index b94d12e12..5c946ad9a 100644 --- a/src/main/java/emu/grasscutter/game/HandbookActions.java +++ b/src/main/java/emu/grasscutter/game/HandbookActions.java @@ -9,7 +9,6 @@ import emu.grasscutter.game.player.Player; import emu.grasscutter.game.props.ActionReason; import emu.grasscutter.server.packet.send.PacketAddNoGachaAvatarCardNotify; import emu.grasscutter.utils.objects.HandbookBody.*; - import java.util.Objects; /** Commands executed by the handbook. */ diff --git a/src/main/java/emu/grasscutter/game/ability/Ability.java b/src/main/java/emu/grasscutter/game/ability/Ability.java index 398eef970..4bd07c8fd 100644 --- a/src/main/java/emu/grasscutter/game/ability/Ability.java +++ b/src/main/java/emu/grasscutter/game/ability/Ability.java @@ -7,9 +7,8 @@ import emu.grasscutter.game.player.Player; import emu.grasscutter.net.proto.AbilityStringOuterClass.AbilityString; import emu.grasscutter.utils.Utils; import it.unimi.dsi.fastutil.objects.*; -import lombok.Getter; - import java.util.*; +import lombok.Getter; public class Ability { @Getter private AbilityData data; diff --git a/src/main/java/emu/grasscutter/game/ability/AbilityLocalIdGenerator.java b/src/main/java/emu/grasscutter/game/ability/AbilityLocalIdGenerator.java index 5b4ab8440..820751925 100644 --- a/src/main/java/emu/grasscutter/game/ability/AbilityLocalIdGenerator.java +++ b/src/main/java/emu/grasscutter/game/ability/AbilityLocalIdGenerator.java @@ -3,9 +3,8 @@ package emu.grasscutter.game.ability; import emu.grasscutter.Grasscutter; import emu.grasscutter.data.binout.AbilityMixinData; import emu.grasscutter.data.binout.AbilityModifier.AbilityModifierAction; -import lombok.AllArgsConstructor; - import java.util.Map; +import lombok.AllArgsConstructor; @SuppressWarnings("ALL") public class AbilityLocalIdGenerator { diff --git a/src/main/java/emu/grasscutter/game/ability/AbilityManager.java b/src/main/java/emu/grasscutter/game/ability/AbilityManager.java index 311d56dd7..81ab8e60b 100644 --- a/src/main/java/emu/grasscutter/game/ability/AbilityManager.java +++ b/src/main/java/emu/grasscutter/game/ability/AbilityManager.java @@ -20,10 +20,9 @@ import emu.grasscutter.net.proto.AbilityScalarValueEntryOuterClass.AbilityScalar import emu.grasscutter.net.proto.ModifierActionOuterClass.ModifierAction; import emu.grasscutter.server.event.player.PlayerUseSkillEvent; import io.netty.util.concurrent.FastThreadLocalThread; -import lombok.Getter; - import java.util.HashMap; import java.util.concurrent.*; +import lombok.Getter; public final class AbilityManager extends BasePlayerManager { private static final HashMap actionHandlers = @@ -54,8 +53,7 @@ public final class AbilityManager extends BasePlayerManager { } public static void registerHandlers() { - var handlerClassesAction = Grasscutter.reflector - .getSubTypesOf(AbilityActionHandler.class); + var handlerClassesAction = Grasscutter.reflector.getSubTypesOf(AbilityActionHandler.class); for (var obj : handlerClassesAction) { try { @@ -70,8 +68,7 @@ public final class AbilityManager extends BasePlayerManager { } } - var handlerClassesMixin = Grasscutter.reflector - .getSubTypesOf(AbilityMixinHandler.class); + var handlerClassesMixin = Grasscutter.reflector.getSubTypesOf(AbilityMixinHandler.class); for (var obj : handlerClassesMixin) { try { if (obj.isAnnotationPresent(AbilityAction.class)) { diff --git a/src/main/java/emu/grasscutter/game/ability/actions/AbilityAction.java b/src/main/java/emu/grasscutter/game/ability/actions/AbilityAction.java index 7e4753323..7e9849296 100644 --- a/src/main/java/emu/grasscutter/game/ability/actions/AbilityAction.java +++ b/src/main/java/emu/grasscutter/game/ability/actions/AbilityAction.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.ability.actions; import emu.grasscutter.data.binout.AbilityModifier.AbilityModifierAction; - import java.lang.annotation.*; @Retention(RetentionPolicy.RUNTIME) diff --git a/src/main/java/emu/grasscutter/game/ability/actions/ActionServerLuaCall.java b/src/main/java/emu/grasscutter/game/ability/actions/ActionServerLuaCall.java index 6c678b579..26f9134ad 100644 --- a/src/main/java/emu/grasscutter/game/ability/actions/ActionServerLuaCall.java +++ b/src/main/java/emu/grasscutter/game/ability/actions/ActionServerLuaCall.java @@ -6,9 +6,8 @@ import emu.grasscutter.data.binout.AbilityModifier.AbilityModifierAction; import emu.grasscutter.game.ability.Ability; import emu.grasscutter.game.entity.GameEntity; import emu.grasscutter.scripts.ScriptLoader; -import org.luaj.vm2.LuaFunction; - import javax.script.Bindings; +import org.luaj.vm2.LuaFunction; @AbilityAction(AbilityModifierAction.Type.ServerLuaCall) public final class ActionServerLuaCall extends AbilityActionHandler { diff --git a/src/main/java/emu/grasscutter/game/ability/mixins/AbilityMixin.java b/src/main/java/emu/grasscutter/game/ability/mixins/AbilityMixin.java index 511990bc4..94ef546d3 100644 --- a/src/main/java/emu/grasscutter/game/ability/mixins/AbilityMixin.java +++ b/src/main/java/emu/grasscutter/game/ability/mixins/AbilityMixin.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.ability.mixins; import emu.grasscutter.data.binout.AbilityMixinData; - import java.lang.annotation.*; @Retention(RetentionPolicy.RUNTIME) diff --git a/src/main/java/emu/grasscutter/game/achievement/Achievements.java b/src/main/java/emu/grasscutter/game/achievement/Achievements.java index 77db3627a..929c382cb 100644 --- a/src/main/java/emu/grasscutter/game/achievement/Achievements.java +++ b/src/main/java/emu/grasscutter/game/achievement/Achievements.java @@ -12,13 +12,12 @@ import emu.grasscutter.game.props.ActionReason; import emu.grasscutter.net.proto.AchievementOuterClass.Achievement.Status; import emu.grasscutter.server.event.player.PlayerCompleteAchievementEvent; import emu.grasscutter.server.packet.send.*; -import lombok.*; -import org.bson.types.ObjectId; - -import javax.annotation.Nullable; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.IntSupplier; +import javax.annotation.Nullable; +import lombok.*; +import org.bson.types.ObjectId; @Entity("achievements") @Data diff --git a/src/main/java/emu/grasscutter/game/activity/ActivityConfigItem.java b/src/main/java/emu/grasscutter/game/activity/ActivityConfigItem.java index ace61d9ea..58492ec51 100644 --- a/src/main/java/emu/grasscutter/game/activity/ActivityConfigItem.java +++ b/src/main/java/emu/grasscutter/game/activity/ActivityConfigItem.java @@ -1,10 +1,9 @@ package emu.grasscutter.game.activity; +import java.util.*; import lombok.*; import lombok.experimental.FieldDefaults; -import java.util.*; - @Data @FieldDefaults(level = AccessLevel.PRIVATE) public class ActivityConfigItem { diff --git a/src/main/java/emu/grasscutter/game/activity/ActivityHandler.java b/src/main/java/emu/grasscutter/game/activity/ActivityHandler.java index bd75213dd..23c65927a 100644 --- a/src/main/java/emu/grasscutter/game/activity/ActivityHandler.java +++ b/src/main/java/emu/grasscutter/game/activity/ActivityHandler.java @@ -10,11 +10,10 @@ import emu.grasscutter.game.props.WatcherTriggerType; import emu.grasscutter.game.quest.enums.QuestCond; import emu.grasscutter.net.proto.ActivityInfoOuterClass; import emu.grasscutter.utils.helpers.DateHelper; -import lombok.*; -import lombok.experimental.FieldDefaults; - import java.util.*; import java.util.stream.Collectors; +import lombok.*; +import lombok.experimental.FieldDefaults; @Getter @Setter diff --git a/src/main/java/emu/grasscutter/game/activity/ActivityManager.java b/src/main/java/emu/grasscutter/game/activity/ActivityManager.java index 20003cc7d..a3da2524b 100644 --- a/src/main/java/emu/grasscutter/game/activity/ActivityManager.java +++ b/src/main/java/emu/grasscutter/game/activity/ActivityManager.java @@ -8,10 +8,9 @@ import emu.grasscutter.game.player.*; 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 diff --git a/src/main/java/emu/grasscutter/game/activity/ActivityWatcherType.java b/src/main/java/emu/grasscutter/game/activity/ActivityWatcherType.java index a52137e78..c15049d3e 100644 --- a/src/main/java/emu/grasscutter/game/activity/ActivityWatcherType.java +++ b/src/main/java/emu/grasscutter/game/activity/ActivityWatcherType.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.activity; import emu.grasscutter.game.props.WatcherTriggerType; - import java.lang.annotation.*; @Retention(RetentionPolicy.RUNTIME) diff --git a/src/main/java/emu/grasscutter/game/activity/GameActivity.java b/src/main/java/emu/grasscutter/game/activity/GameActivity.java index d8137f93b..6f1a16d7b 100644 --- a/src/main/java/emu/grasscutter/game/activity/GameActivity.java +++ b/src/main/java/emu/grasscutter/game/activity/GameActivity.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.activity; import emu.grasscutter.game.props.ActivityType; - import java.lang.annotation.*; @Retention(RetentionPolicy.RUNTIME) diff --git a/src/main/java/emu/grasscutter/game/activity/PlayerActivityData.java b/src/main/java/emu/grasscutter/game/activity/PlayerActivityData.java index 30eef7d0b..61ecf9d7c 100644 --- a/src/main/java/emu/grasscutter/game/activity/PlayerActivityData.java +++ b/src/main/java/emu/grasscutter/game/activity/PlayerActivityData.java @@ -11,11 +11,10 @@ import emu.grasscutter.game.props.ActionReason; import emu.grasscutter.net.proto.ActivityWatcherInfoOuterClass; import emu.grasscutter.server.packet.send.PacketActivityUpdateWatcherNotify; import emu.grasscutter.utils.JsonUtils; +import java.util.*; import lombok.*; import lombok.experimental.FieldDefaults; -import java.util.*; - @Entity("activities") @Data @FieldDefaults(level = AccessLevel.PRIVATE) diff --git a/src/main/java/emu/grasscutter/game/activity/condition/ActivityCondition.java b/src/main/java/emu/grasscutter/game/activity/condition/ActivityCondition.java index 0ff4f13d1..f4d1b861f 100644 --- a/src/main/java/emu/grasscutter/game/activity/condition/ActivityCondition.java +++ b/src/main/java/emu/grasscutter/game/activity/condition/ActivityCondition.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.activity.condition; import emu.grasscutter.data.excels.activity.ActivityCondExcelConfigData; - import java.lang.annotation.*; /** diff --git a/src/main/java/emu/grasscutter/game/activity/condition/AllActivityConditionBuilder.java b/src/main/java/emu/grasscutter/game/activity/condition/AllActivityConditionBuilder.java index 0a8170cb4..ea7a4b30e 100644 --- a/src/main/java/emu/grasscutter/game/activity/condition/AllActivityConditionBuilder.java +++ b/src/main/java/emu/grasscutter/game/activity/condition/AllActivityConditionBuilder.java @@ -2,10 +2,9 @@ package emu.grasscutter.game.activity.condition; import emu.grasscutter.Grasscutter; import emu.grasscutter.data.excels.activity.ActivityCondExcelConfigData; -import org.reflections.Reflections; - import java.util.*; import java.util.stream.Collectors; +import org.reflections.Reflections; /** * Class that used for scanning classpath, picking up all activity conditions (for diff --git a/src/main/java/emu/grasscutter/game/activity/condition/BasicActivityConditionExecutor.java b/src/main/java/emu/grasscutter/game/activity/condition/BasicActivityConditionExecutor.java index 8610e8089..ff391e4fa 100644 --- a/src/main/java/emu/grasscutter/game/activity/condition/BasicActivityConditionExecutor.java +++ b/src/main/java/emu/grasscutter/game/activity/condition/BasicActivityConditionExecutor.java @@ -6,7 +6,6 @@ import emu.grasscutter.game.activity.*; import emu.grasscutter.game.activity.condition.all.UnknownActivityConditionHandler; import emu.grasscutter.game.quest.enums.LogicType; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; - import java.util.*; import java.util.function.BooleanSupplier; import java.util.stream.Collectors; diff --git a/src/main/java/emu/grasscutter/game/activity/condition/PlayerActivityDataMappingBuilder.java b/src/main/java/emu/grasscutter/game/activity/condition/PlayerActivityDataMappingBuilder.java index ba5d50a49..3c332f062 100644 --- a/src/main/java/emu/grasscutter/game/activity/condition/PlayerActivityDataMappingBuilder.java +++ b/src/main/java/emu/grasscutter/game/activity/condition/PlayerActivityDataMappingBuilder.java @@ -3,9 +3,8 @@ package emu.grasscutter.game.activity.condition; import emu.grasscutter.data.GameData; import emu.grasscutter.data.excels.activity.ActivityCondExcelConfigData; import emu.grasscutter.game.activity.PlayerActivityData; -import it.unimi.dsi.fastutil.ints.AbstractInt2ObjectMap.BasicEntry; import it.unimi.dsi.fastutil.ints.*; - +import it.unimi.dsi.fastutil.ints.AbstractInt2ObjectMap.BasicEntry; import java.util.Map; /** This class is used for building mapping for PlayerActivityData */ diff --git a/src/main/java/emu/grasscutter/game/activity/condition/all/DayLess.java b/src/main/java/emu/grasscutter/game/activity/condition/all/DayLess.java index 0abec7027..ffbe00955 100644 --- a/src/main/java/emu/grasscutter/game/activity/condition/all/DayLess.java +++ b/src/main/java/emu/grasscutter/game/activity/condition/all/DayLess.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.activity.condition.all; +import static emu.grasscutter.game.activity.condition.ActivityConditions.NEW_ACTIVITY_COND_DAYS_LESS; + import emu.grasscutter.game.activity.*; import emu.grasscutter.game.activity.condition.*; -import static emu.grasscutter.game.activity.condition.ActivityConditions.NEW_ACTIVITY_COND_DAYS_LESS; - @ActivityCondition(NEW_ACTIVITY_COND_DAYS_LESS) public class DayLess extends ActivityConditionBaseHandler { @Override diff --git a/src/main/java/emu/grasscutter/game/activity/condition/all/DaysGreatEqual.java b/src/main/java/emu/grasscutter/game/activity/condition/all/DaysGreatEqual.java index e7b751422..adba2f2ff 100644 --- a/src/main/java/emu/grasscutter/game/activity/condition/all/DaysGreatEqual.java +++ b/src/main/java/emu/grasscutter/game/activity/condition/all/DaysGreatEqual.java @@ -1,12 +1,11 @@ package emu.grasscutter.game.activity.condition.all; +import static emu.grasscutter.game.activity.condition.ActivityConditions.NEW_ACTIVITY_COND_DAYS_GREAT_EQUAL; + import emu.grasscutter.game.activity.*; import emu.grasscutter.game.activity.condition.*; - import java.util.Date; -import static emu.grasscutter.game.activity.condition.ActivityConditions.NEW_ACTIVITY_COND_DAYS_GREAT_EQUAL; - @ActivityCondition(NEW_ACTIVITY_COND_DAYS_GREAT_EQUAL) public class DaysGreatEqual extends ActivityConditionBaseHandler { @Override diff --git a/src/main/java/emu/grasscutter/game/activity/condition/all/NotFinishTalk.java b/src/main/java/emu/grasscutter/game/activity/condition/all/NotFinishTalk.java index b1736b268..bf848df7b 100644 --- a/src/main/java/emu/grasscutter/game/activity/condition/all/NotFinishTalk.java +++ b/src/main/java/emu/grasscutter/game/activity/condition/all/NotFinishTalk.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.activity.condition.all; +import static emu.grasscutter.game.activity.condition.ActivityConditions.NEW_ACTIVITY_COND_NOT_FINISH_TALK; + import emu.grasscutter.game.activity.*; import emu.grasscutter.game.activity.condition.*; -import static emu.grasscutter.game.activity.condition.ActivityConditions.NEW_ACTIVITY_COND_NOT_FINISH_TALK; - @ActivityCondition(NEW_ACTIVITY_COND_NOT_FINISH_TALK) public class NotFinishTalk extends ActivityConditionBaseHandler { @Override diff --git a/src/main/java/emu/grasscutter/game/activity/condition/all/PlayerLevelGreatEqualActivityActivityCondition.java b/src/main/java/emu/grasscutter/game/activity/condition/all/PlayerLevelGreatEqualActivityActivityCondition.java index c088cf5fd..c81cea298 100644 --- a/src/main/java/emu/grasscutter/game/activity/condition/all/PlayerLevelGreatEqualActivityActivityCondition.java +++ b/src/main/java/emu/grasscutter/game/activity/condition/all/PlayerLevelGreatEqualActivityActivityCondition.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.activity.condition.all; +import static emu.grasscutter.game.activity.condition.ActivityConditions.NEW_ACTIVITY_COND_PLAYER_LEVEL_GREAT_EQUAL; + import emu.grasscutter.game.activity.*; import emu.grasscutter.game.activity.condition.*; -import static emu.grasscutter.game.activity.condition.ActivityConditions.NEW_ACTIVITY_COND_PLAYER_LEVEL_GREAT_EQUAL; - @ActivityCondition(NEW_ACTIVITY_COND_PLAYER_LEVEL_GREAT_EQUAL) public class PlayerLevelGreatEqualActivityActivityCondition extends ActivityConditionBaseHandler { diff --git a/src/main/java/emu/grasscutter/game/activity/condition/all/QuestFinished.java b/src/main/java/emu/grasscutter/game/activity/condition/all/QuestFinished.java index 6a7257cb0..c3c8c1bec 100644 --- a/src/main/java/emu/grasscutter/game/activity/condition/all/QuestFinished.java +++ b/src/main/java/emu/grasscutter/game/activity/condition/all/QuestFinished.java @@ -1,12 +1,12 @@ package emu.grasscutter.game.activity.condition.all; +import static emu.grasscutter.game.activity.condition.ActivityConditions.NEW_ACTIVITY_COND_QUEST_FINISH; + import emu.grasscutter.game.activity.*; import emu.grasscutter.game.activity.condition.*; import emu.grasscutter.game.quest.GameQuest; import emu.grasscutter.game.quest.enums.QuestState; -import static emu.grasscutter.game.activity.condition.ActivityConditions.NEW_ACTIVITY_COND_QUEST_FINISH; - @ActivityCondition(NEW_ACTIVITY_COND_QUEST_FINISH) public class QuestFinished extends ActivityConditionBaseHandler { @Override diff --git a/src/main/java/emu/grasscutter/game/activity/condition/all/SalesmanCanDeliver.java b/src/main/java/emu/grasscutter/game/activity/condition/all/SalesmanCanDeliver.java index 65059660e..499523662 100644 --- a/src/main/java/emu/grasscutter/game/activity/condition/all/SalesmanCanDeliver.java +++ b/src/main/java/emu/grasscutter/game/activity/condition/all/SalesmanCanDeliver.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.activity.condition.all; +import static emu.grasscutter.game.activity.condition.ActivityConditions.NEW_ACTIVITY_COND_SALESMAN_CAN_DELIVER; + import emu.grasscutter.game.activity.*; import emu.grasscutter.game.activity.condition.*; -import static emu.grasscutter.game.activity.condition.ActivityConditions.NEW_ACTIVITY_COND_SALESMAN_CAN_DELIVER; - @ActivityCondition(NEW_ACTIVITY_COND_SALESMAN_CAN_DELIVER) public class SalesmanCanDeliver extends ActivityConditionBaseHandler { @Override diff --git a/src/main/java/emu/grasscutter/game/activity/musicgame/MusicGameActivityHandler.java b/src/main/java/emu/grasscutter/game/activity/musicgame/MusicGameActivityHandler.java index 4cfc1b169..7220080c4 100644 --- a/src/main/java/emu/grasscutter/game/activity/musicgame/MusicGameActivityHandler.java +++ b/src/main/java/emu/grasscutter/game/activity/musicgame/MusicGameActivityHandler.java @@ -4,7 +4,6 @@ import emu.grasscutter.game.activity.*; import emu.grasscutter.game.props.ActivityType; import emu.grasscutter.net.proto.*; import emu.grasscutter.utils.JsonUtils; - import java.util.stream.Collectors; @GameActivity(ActivityType.NEW_ACTIVITY_MUSIC_GAME) diff --git a/src/main/java/emu/grasscutter/game/activity/musicgame/MusicGameBeatmap.java b/src/main/java/emu/grasscutter/game/activity/musicgame/MusicGameBeatmap.java index 3c8741a52..9d9dcbf3f 100644 --- a/src/main/java/emu/grasscutter/game/activity/musicgame/MusicGameBeatmap.java +++ b/src/main/java/emu/grasscutter/game/activity/musicgame/MusicGameBeatmap.java @@ -3,11 +3,10 @@ package emu.grasscutter.game.activity.musicgame; import dev.morphia.annotations.*; import emu.grasscutter.database.DatabaseHelper; import emu.grasscutter.net.proto.*; +import java.util.*; import lombok.*; import lombok.experimental.FieldDefaults; -import java.util.*; - @Entity("music_game_beatmaps") @Data @FieldDefaults(level = AccessLevel.PRIVATE) diff --git a/src/main/java/emu/grasscutter/game/activity/musicgame/MusicGamePlayerData.java b/src/main/java/emu/grasscutter/game/activity/musicgame/MusicGamePlayerData.java index 97874188d..0bd3cfb81 100644 --- a/src/main/java/emu/grasscutter/game/activity/musicgame/MusicGamePlayerData.java +++ b/src/main/java/emu/grasscutter/game/activity/musicgame/MusicGamePlayerData.java @@ -3,11 +3,10 @@ package emu.grasscutter.game.activity.musicgame; import emu.grasscutter.data.GameData; import emu.grasscutter.data.excels.MusicGameBasicData; import emu.grasscutter.net.proto.*; -import lombok.*; -import lombok.experimental.FieldDefaults; - import java.util.*; import java.util.stream.Collectors; +import lombok.*; +import lombok.experimental.FieldDefaults; @Data @FieldDefaults(level = AccessLevel.PRIVATE) diff --git a/src/main/java/emu/grasscutter/game/activity/trialavatar/TrialAvatarActivityChallengeTrigger.java b/src/main/java/emu/grasscutter/game/activity/trialavatar/TrialAvatarActivityChallengeTrigger.java index 98063fffc..1778f4328 100644 --- a/src/main/java/emu/grasscutter/game/activity/trialavatar/TrialAvatarActivityChallengeTrigger.java +++ b/src/main/java/emu/grasscutter/game/activity/trialavatar/TrialAvatarActivityChallengeTrigger.java @@ -2,9 +2,8 @@ package emu.grasscutter.game.activity.trialavatar; import emu.grasscutter.game.activity.*; import emu.grasscutter.game.props.WatcherTriggerType; -import lombok.val; - import java.util.stream.Stream; +import lombok.val; @ActivityWatcherType(WatcherTriggerType.TRIGGER_FINISH_CHALLENGE) public class TrialAvatarActivityChallengeTrigger extends ActivityWatcher { diff --git a/src/main/java/emu/grasscutter/game/activity/trialavatar/TrialAvatarActivityHandler.java b/src/main/java/emu/grasscutter/game/activity/trialavatar/TrialAvatarActivityHandler.java index 9723dff3f..6b2a194c8 100644 --- a/src/main/java/emu/grasscutter/game/activity/trialavatar/TrialAvatarActivityHandler.java +++ b/src/main/java/emu/grasscutter/game/activity/trialavatar/TrialAvatarActivityHandler.java @@ -12,10 +12,9 @@ import emu.grasscutter.net.proto.ActivityInfoOuterClass.ActivityInfo; import emu.grasscutter.net.proto.TrialAvatarGrantRecordOuterClass.TrialAvatarGrantRecord.GrantReason; import emu.grasscutter.server.packet.send.*; import emu.grasscutter.utils.JsonUtils; -import lombok.*; - import java.util.*; import java.util.stream.Stream; +import lombok.*; @GameActivity(ActivityType.NEW_ACTIVITY_TRIAL_AVATAR) public class TrialAvatarActivityHandler extends ActivityHandler { diff --git a/src/main/java/emu/grasscutter/game/activity/trialavatar/TrialAvatarPlayerData.java b/src/main/java/emu/grasscutter/game/activity/trialavatar/TrialAvatarPlayerData.java index e133968b1..71cf8dd1c 100644 --- a/src/main/java/emu/grasscutter/game/activity/trialavatar/TrialAvatarPlayerData.java +++ b/src/main/java/emu/grasscutter/game/activity/trialavatar/TrialAvatarPlayerData.java @@ -4,11 +4,10 @@ import emu.grasscutter.data.GameData; import emu.grasscutter.data.common.BaseTrialActivityData; import emu.grasscutter.net.proto.TrialAvatarActivityDetailInfoOuterClass.TrialAvatarActivityDetailInfo; import emu.grasscutter.net.proto.TrialAvatarActivityRewardDetailInfoOuterClass.TrialAvatarActivityRewardDetailInfo; -import lombok.*; -import lombok.experimental.FieldDefaults; - import java.util.List; import java.util.stream.*; +import lombok.*; +import lombok.experimental.FieldDefaults; @Data @FieldDefaults(level = AccessLevel.PRIVATE) diff --git a/src/main/java/emu/grasscutter/game/avatar/Avatar.java b/src/main/java/emu/grasscutter/game/avatar/Avatar.java index e14776d81..fc272ed95 100644 --- a/src/main/java/emu/grasscutter/game/avatar/Avatar.java +++ b/src/main/java/emu/grasscutter/game/avatar/Avatar.java @@ -1,5 +1,7 @@ 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; @@ -30,14 +32,11 @@ import emu.grasscutter.net.proto.TrialAvatarInfoOuterClass.TrialAvatarInfo; import emu.grasscutter.server.packet.send.*; import emu.grasscutter.utils.helpers.ProtoHelper; import it.unimi.dsi.fastutil.ints.*; -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; +import javax.annotation.*; +import lombok.*; +import org.bson.types.ObjectId; @Entity(value = "avatars", useDiscriminator = false) public class Avatar { diff --git a/src/main/java/emu/grasscutter/game/avatar/AvatarStorage.java b/src/main/java/emu/grasscutter/game/avatar/AvatarStorage.java index fe35557ee..1d2002e7b 100644 --- a/src/main/java/emu/grasscutter/game/avatar/AvatarStorage.java +++ b/src/main/java/emu/grasscutter/game/avatar/AvatarStorage.java @@ -15,7 +15,6 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import it.unimi.dsi.fastutil.longs.Long2ObjectMap; import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; - import java.util.Iterator; import java.util.List; diff --git a/src/main/java/emu/grasscutter/game/battlepass/BattlePassManager.java b/src/main/java/emu/grasscutter/game/battlepass/BattlePassManager.java index df93a4239..0d48355a5 100644 --- a/src/main/java/emu/grasscutter/game/battlepass/BattlePassManager.java +++ b/src/main/java/emu/grasscutter/game/battlepass/BattlePassManager.java @@ -14,12 +14,11 @@ import emu.grasscutter.net.proto.BattlePassRewardTakeOptionOuterClass.BattlePass import emu.grasscutter.net.proto.BattlePassScheduleOuterClass.BattlePassSchedule; import emu.grasscutter.net.proto.BattlePassUnlockStatusOuterClass.BattlePassUnlockStatus; import emu.grasscutter.server.packet.send.*; -import lombok.Getter; -import org.bson.types.ObjectId; - import java.time.*; import java.time.temporal.TemporalAdjusters; import java.util.*; +import lombok.Getter; +import org.bson.types.ObjectId; @Entity(value = "battlepass", useDiscriminator = false) public class BattlePassManager extends BasePlayerDataManager { diff --git a/src/main/java/emu/grasscutter/game/battlepass/BattlePassSystem.java b/src/main/java/emu/grasscutter/game/battlepass/BattlePassSystem.java index 75b086bd9..b418f1917 100644 --- a/src/main/java/emu/grasscutter/game/battlepass/BattlePassSystem.java +++ b/src/main/java/emu/grasscutter/game/battlepass/BattlePassSystem.java @@ -7,7 +7,6 @@ import emu.grasscutter.game.props.*; import emu.grasscutter.server.event.player.PlayerFinishBattlePassMission; import emu.grasscutter.server.game.*; import emu.grasscutter.server.packet.send.PacketBattlePassMissionUpdateNotify; - import java.util.*; public class BattlePassSystem extends BaseGameSystem { diff --git a/src/main/java/emu/grasscutter/game/chat/ChatSystem.java b/src/main/java/emu/grasscutter/game/chat/ChatSystem.java index 247c38001..dd86b0568 100644 --- a/src/main/java/emu/grasscutter/game/chat/ChatSystem.java +++ b/src/main/java/emu/grasscutter/game/chat/ChatSystem.java @@ -1,5 +1,7 @@ package emu.grasscutter.game.chat; +import static emu.grasscutter.config.Configuration.GAME_INFO; + import emu.grasscutter.GameConstants; import emu.grasscutter.command.CommandMap; import emu.grasscutter.game.player.Player; @@ -8,12 +10,9 @@ import emu.grasscutter.server.event.player.PlayerChatEvent; import emu.grasscutter.server.game.GameServer; import emu.grasscutter.server.packet.send.*; import emu.grasscutter.utils.Utils; - import java.util.*; import java.util.regex.Pattern; -import static emu.grasscutter.config.Configuration.GAME_INFO; - public class ChatSystem implements ChatSystemHandler { static final String PREFIXES = "[/!]"; static final Pattern RE_PREFIXES = Pattern.compile(PREFIXES); diff --git a/src/main/java/emu/grasscutter/game/combine/CombineManger.java b/src/main/java/emu/grasscutter/game/combine/CombineManger.java index 1dbc30b6b..08305cae1 100644 --- a/src/main/java/emu/grasscutter/game/combine/CombineManger.java +++ b/src/main/java/emu/grasscutter/game/combine/CombineManger.java @@ -13,7 +13,6 @@ import emu.grasscutter.server.game.*; import emu.grasscutter.server.packet.send.*; import emu.grasscutter.utils.Utils; import it.unimi.dsi.fastutil.ints.*; - import java.util.*; public class CombineManger extends BaseGameSystem { diff --git a/src/main/java/emu/grasscutter/game/combine/CombineResult.java b/src/main/java/emu/grasscutter/game/combine/CombineResult.java index f71d25d2d..df8ace74b 100644 --- a/src/main/java/emu/grasscutter/game/combine/CombineResult.java +++ b/src/main/java/emu/grasscutter/game/combine/CombineResult.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.combine; import emu.grasscutter.data.common.ItemParamData; - import java.util.List; public class CombineResult { diff --git a/src/main/java/emu/grasscutter/game/drop/DropSystem.java b/src/main/java/emu/grasscutter/game/drop/DropSystem.java index 8c2760945..b5ebf41e8 100644 --- a/src/main/java/emu/grasscutter/game/drop/DropSystem.java +++ b/src/main/java/emu/grasscutter/game/drop/DropSystem.java @@ -12,7 +12,6 @@ import emu.grasscutter.scripts.data.SceneMonster; import emu.grasscutter.server.game.*; import emu.grasscutter.server.packet.send.*; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; - import java.util.*; public final class DropSystem extends BaseGameSystem { diff --git a/src/main/java/emu/grasscutter/game/drop/DropSystemLegacy.java b/src/main/java/emu/grasscutter/game/drop/DropSystemLegacy.java index 6e6985cf3..d0167ab40 100644 --- a/src/main/java/emu/grasscutter/game/drop/DropSystemLegacy.java +++ b/src/main/java/emu/grasscutter/game/drop/DropSystemLegacy.java @@ -11,7 +11,6 @@ import emu.grasscutter.game.world.*; import emu.grasscutter.server.game.*; import emu.grasscutter.utils.Utils; import it.unimi.dsi.fastutil.ints.*; - import java.util.List; @SuppressWarnings("deprecation") diff --git a/src/main/java/emu/grasscutter/game/dungeons/DungeonManager.java b/src/main/java/emu/grasscutter/game/dungeons/DungeonManager.java index 406b82d20..714ceb9b2 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/DungeonManager.java +++ b/src/main/java/emu/grasscutter/game/dungeons/DungeonManager.java @@ -18,11 +18,10 @@ import emu.grasscutter.server.event.player.PlayerFinishDungeonEvent; import emu.grasscutter.server.packet.send.*; import emu.grasscutter.utils.Utils; import it.unimi.dsi.fastutil.ints.*; -import lombok.*; - -import javax.annotation.Nullable; import java.util.*; import java.util.stream.*; +import javax.annotation.Nullable; +import lombok.*; /** * TODO handle time limits TODO handle respawn points TODO handle team wipes and respawns TODO check diff --git a/src/main/java/emu/grasscutter/game/dungeons/DungeonSystem.java b/src/main/java/emu/grasscutter/game/dungeons/DungeonSystem.java index f5427da76..7135ac7aa 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/DungeonSystem.java +++ b/src/main/java/emu/grasscutter/game/dungeons/DungeonSystem.java @@ -12,9 +12,8 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.server.game.*; import emu.grasscutter.server.packet.send.PacketDungeonEntryInfoRsp; import it.unimi.dsi.fastutil.ints.*; -import lombok.val; - import java.util.List; +import lombok.val; public final class DungeonSystem extends BaseGameSystem { private static final BasicDungeonSettleListener basicDungeonSettleObserver = @@ -29,9 +28,7 @@ public final class DungeonSystem extends BaseGameSystem { } public void registerHandlers() { - this.registerHandlers( - this.passCondHandlers, - DungeonBaseHandler.class); + this.registerHandlers(this.passCondHandlers, DungeonBaseHandler.class); } public void registerHandlers(Int2ObjectMap map, Class clazz) { diff --git a/src/main/java/emu/grasscutter/game/dungeons/DungeonTrialTeam.java b/src/main/java/emu/grasscutter/game/dungeons/DungeonTrialTeam.java index ee590db0f..cfda80441 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/DungeonTrialTeam.java +++ b/src/main/java/emu/grasscutter/game/dungeons/DungeonTrialTeam.java @@ -1,9 +1,8 @@ package emu.grasscutter.game.dungeons; import emu.grasscutter.net.proto.TrialAvatarGrantRecordOuterClass.TrialAvatarGrantRecord; -import lombok.*; - import java.util.List; +import lombok.*; @Data @AllArgsConstructor diff --git a/src/main/java/emu/grasscutter/game/dungeons/DungeonValue.java b/src/main/java/emu/grasscutter/game/dungeons/DungeonValue.java index b07510383..11f3f88cd 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/DungeonValue.java +++ b/src/main/java/emu/grasscutter/game/dungeons/DungeonValue.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.dungeons; import emu.grasscutter.game.dungeons.enums.DungeonPassConditionType; - import java.lang.annotation.*; @Retention(RetentionPolicy.RUNTIME) diff --git a/src/main/java/emu/grasscutter/game/dungeons/challenge/WorldChallenge.java b/src/main/java/emu/grasscutter/game/dungeons/challenge/WorldChallenge.java index bb3ddf993..b755566e6 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/challenge/WorldChallenge.java +++ b/src/main/java/emu/grasscutter/game/dungeons/challenge/WorldChallenge.java @@ -9,10 +9,9 @@ import emu.grasscutter.game.world.Scene; import emu.grasscutter.scripts.constants.EventType; import emu.grasscutter.scripts.data.*; import emu.grasscutter.server.packet.send.*; -import lombok.*; - import java.util.List; import java.util.concurrent.atomic.AtomicInteger; +import lombok.*; @Getter @Setter diff --git a/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/ChallengeFactory.java b/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/ChallengeFactory.java index 9263fe589..e59330251 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/ChallengeFactory.java +++ b/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/ChallengeFactory.java @@ -4,9 +4,8 @@ import emu.grasscutter.data.GameData; import emu.grasscutter.game.dungeons.challenge.WorldChallenge; import emu.grasscutter.game.world.Scene; import emu.grasscutter.scripts.data.SceneGroup; -import lombok.val; - import java.util.*; +import lombok.val; public abstract class ChallengeFactory { private static final List challengeFactoryHandlers = new ArrayList<>(); diff --git a/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/KillAndGuardChallengeFactoryHandler.java b/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/KillAndGuardChallengeFactoryHandler.java index 0a15a1cf8..b6de03f56 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/KillAndGuardChallengeFactoryHandler.java +++ b/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/KillAndGuardChallengeFactoryHandler.java @@ -1,15 +1,14 @@ package emu.grasscutter.game.dungeons.challenge.factory; +import static emu.grasscutter.game.dungeons.challenge.enums.ChallengeType.CHALLENGE_KILL_COUNT_GUARD_HP; + import emu.grasscutter.game.dungeons.challenge.WorldChallenge; import emu.grasscutter.game.dungeons.challenge.enums.ChallengeType; import emu.grasscutter.game.dungeons.challenge.trigger.*; import emu.grasscutter.game.world.Scene; import emu.grasscutter.scripts.data.SceneGroup; -import lombok.val; - import java.util.List; - -import static emu.grasscutter.game.dungeons.challenge.enums.ChallengeType.CHALLENGE_KILL_COUNT_GUARD_HP; +import lombok.val; public class KillAndGuardChallengeFactoryHandler implements ChallengeFactoryHandler { @Override diff --git a/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/KillMonsterCountChallengeFactoryHandler.java b/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/KillMonsterCountChallengeFactoryHandler.java index 7167d408b..4756b440c 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/KillMonsterCountChallengeFactoryHandler.java +++ b/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/KillMonsterCountChallengeFactoryHandler.java @@ -5,9 +5,8 @@ import emu.grasscutter.game.dungeons.challenge.enums.ChallengeType; import emu.grasscutter.game.dungeons.challenge.trigger.KillMonsterCountTrigger; import emu.grasscutter.game.world.Scene; import emu.grasscutter.scripts.data.SceneGroup; -import lombok.val; - import java.util.List; +import lombok.val; public class KillMonsterCountChallengeFactoryHandler implements ChallengeFactoryHandler { @Override diff --git a/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/KillMonsterCountInTimeIncChallengeFactoryHandler.java b/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/KillMonsterCountInTimeIncChallengeFactoryHandler.java index 358adb0bd..efa484e6d 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/KillMonsterCountInTimeIncChallengeFactoryHandler.java +++ b/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/KillMonsterCountInTimeIncChallengeFactoryHandler.java @@ -5,9 +5,8 @@ import emu.grasscutter.game.dungeons.challenge.enums.ChallengeType; import emu.grasscutter.game.dungeons.challenge.trigger.*; import emu.grasscutter.game.world.Scene; import emu.grasscutter.scripts.data.SceneGroup; -import lombok.val; - import java.util.List; +import lombok.val; public class KillMonsterCountInTimeIncChallengeFactoryHandler implements ChallengeFactoryHandler { @Override diff --git a/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/KillMonsterInTimeChallengeFactoryHandler.java b/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/KillMonsterInTimeChallengeFactoryHandler.java index d99dddb03..76d35839d 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/KillMonsterInTimeChallengeFactoryHandler.java +++ b/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/KillMonsterInTimeChallengeFactoryHandler.java @@ -5,9 +5,8 @@ import emu.grasscutter.game.dungeons.challenge.enums.ChallengeType; import emu.grasscutter.game.dungeons.challenge.trigger.*; import emu.grasscutter.game.world.Scene; import emu.grasscutter.scripts.data.SceneGroup; -import lombok.val; - import java.util.List; +import lombok.val; public class KillMonsterInTimeChallengeFactoryHandler implements ChallengeFactoryHandler { @Override diff --git a/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/KillMonsterTimeChallengeFactoryHandler.java b/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/KillMonsterTimeChallengeFactoryHandler.java index 88960ffe9..29214b91d 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/KillMonsterTimeChallengeFactoryHandler.java +++ b/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/KillMonsterTimeChallengeFactoryHandler.java @@ -5,9 +5,8 @@ import emu.grasscutter.game.dungeons.challenge.enums.ChallengeType; import emu.grasscutter.game.dungeons.challenge.trigger.*; import emu.grasscutter.game.world.Scene; import emu.grasscutter.scripts.data.SceneGroup; -import lombok.val; - import java.util.List; +import lombok.val; public class KillMonsterTimeChallengeFactoryHandler implements ChallengeFactoryHandler { @Override diff --git a/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/SurviveChallengeFactoryHandler.java b/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/SurviveChallengeFactoryHandler.java index 1995f134e..ddf4596a7 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/SurviveChallengeFactoryHandler.java +++ b/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/SurviveChallengeFactoryHandler.java @@ -1,15 +1,14 @@ package emu.grasscutter.game.dungeons.challenge.factory; +import static emu.grasscutter.game.dungeons.challenge.enums.ChallengeType.CHALLENGE_SURVIVE; + import emu.grasscutter.game.dungeons.challenge.WorldChallenge; import emu.grasscutter.game.dungeons.challenge.enums.ChallengeType; import emu.grasscutter.game.dungeons.challenge.trigger.ForTimeTrigger; import emu.grasscutter.game.world.Scene; import emu.grasscutter.scripts.data.SceneGroup; - import java.util.List; -import static emu.grasscutter.game.dungeons.challenge.enums.ChallengeType.CHALLENGE_SURVIVE; - public class SurviveChallengeFactoryHandler implements ChallengeFactoryHandler { @Override public boolean isThisType(ChallengeType challengeType) { diff --git a/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/TriggerInTimeChallengeFactoryHandler.java b/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/TriggerInTimeChallengeFactoryHandler.java index 8269a7e53..5122a6288 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/TriggerInTimeChallengeFactoryHandler.java +++ b/src/main/java/emu/grasscutter/game/dungeons/challenge/factory/TriggerInTimeChallengeFactoryHandler.java @@ -1,15 +1,14 @@ package emu.grasscutter.game.dungeons.challenge.factory; +import static emu.grasscutter.game.dungeons.challenge.enums.ChallengeType.CHALLENGE_TRIGGER_IN_TIME; + import emu.grasscutter.game.dungeons.challenge.WorldChallenge; import emu.grasscutter.game.dungeons.challenge.enums.ChallengeType; import emu.grasscutter.game.dungeons.challenge.trigger.*; import emu.grasscutter.game.world.Scene; import emu.grasscutter.scripts.data.SceneGroup; - import java.util.List; -import static emu.grasscutter.game.dungeons.challenge.enums.ChallengeType.CHALLENGE_TRIGGER_IN_TIME; - public class TriggerInTimeChallengeFactoryHandler implements ChallengeFactoryHandler { @Override public boolean isThisType(ChallengeType challengeType) { diff --git a/src/main/java/emu/grasscutter/game/entity/EntityBaseGadget.java b/src/main/java/emu/grasscutter/game/entity/EntityBaseGadget.java index 050fe4d4c..0afac929e 100644 --- a/src/main/java/emu/grasscutter/game/entity/EntityBaseGadget.java +++ b/src/main/java/emu/grasscutter/game/entity/EntityBaseGadget.java @@ -1,5 +1,7 @@ package emu.grasscutter.game.entity; +import static emu.grasscutter.scripts.constants.EventType.EVENT_SPECIFIC_GADGET_HP_CHANGE; + import emu.grasscutter.data.binout.config.ConfigEntityGadget; import emu.grasscutter.game.props.FightProperty; import emu.grasscutter.game.quest.enums.QuestContent; @@ -8,8 +10,6 @@ import emu.grasscutter.scripts.data.ScriptArgs; import emu.grasscutter.server.event.entity.EntityDamageEvent; import lombok.Getter; -import static emu.grasscutter.scripts.constants.EventType.EVENT_SPECIFIC_GADGET_HP_CHANGE; - public abstract class EntityBaseGadget extends GameEntity { @Getter(onMethod_ = @Override) protected final Position position; diff --git a/src/main/java/emu/grasscutter/game/entity/EntityGadget.java b/src/main/java/emu/grasscutter/game/entity/EntityGadget.java index 3a54d7488..df0eb80d5 100644 --- a/src/main/java/emu/grasscutter/game/entity/EntityGadget.java +++ b/src/main/java/emu/grasscutter/game/entity/EntityGadget.java @@ -10,6 +10,7 @@ import emu.grasscutter.game.entity.gadget.platform.*; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.props.*; import emu.grasscutter.game.world.*; +import emu.grasscutter.net.proto.*; import emu.grasscutter.net.proto.AbilitySyncStateInfoOuterClass.AbilitySyncStateInfo; import emu.grasscutter.net.proto.AnimatorParameterValueInfoPairOuterClass.AnimatorParameterValueInfoPair; import emu.grasscutter.net.proto.EntityAuthorityInfoOuterClass.EntityAuthorityInfo; @@ -17,7 +18,6 @@ import emu.grasscutter.net.proto.EntityClientDataOuterClass.EntityClientData; import emu.grasscutter.net.proto.EntityRendererChangedInfoOuterClass.EntityRendererChangedInfo; import emu.grasscutter.net.proto.GadgetInteractReqOuterClass.GadgetInteractReq; import emu.grasscutter.net.proto.MotionInfoOuterClass.MotionInfo; -import emu.grasscutter.net.proto.*; import emu.grasscutter.net.proto.PropPairOuterClass.PropPair; import emu.grasscutter.net.proto.ProtEntityTypeOuterClass.ProtEntityType; import emu.grasscutter.net.proto.SceneEntityAiInfoOuterClass.SceneEntityAiInfo; @@ -30,10 +30,9 @@ import emu.grasscutter.scripts.data.*; import emu.grasscutter.server.packet.send.*; import emu.grasscutter.utils.helpers.ProtoHelper; import it.unimi.dsi.fastutil.ints.*; -import lombok.*; - -import javax.annotation.Nullable; import java.util.*; +import javax.annotation.Nullable; +import lombok.*; @ToString(callSuper = true) public class EntityGadget extends EntityBaseGadget { diff --git a/src/main/java/emu/grasscutter/game/entity/EntityRegion.java b/src/main/java/emu/grasscutter/game/entity/EntityRegion.java index 84d0b4220..37be6f3b9 100644 --- a/src/main/java/emu/grasscutter/game/entity/EntityRegion.java +++ b/src/main/java/emu/grasscutter/game/entity/EntityRegion.java @@ -5,10 +5,9 @@ import emu.grasscutter.game.world.*; import emu.grasscutter.net.proto.SceneEntityInfoOuterClass; import emu.grasscutter.scripts.data.SceneRegion; import it.unimi.dsi.fastutil.ints.Int2FloatMap; -import lombok.Getter; - import java.util.Set; import java.util.concurrent.ConcurrentHashMap; +import lombok.Getter; @Getter public class EntityRegion extends GameEntity { diff --git a/src/main/java/emu/grasscutter/game/entity/EntityVehicle.java b/src/main/java/emu/grasscutter/game/entity/EntityVehicle.java index b320474ef..88db87bfa 100644 --- a/src/main/java/emu/grasscutter/game/entity/EntityVehicle.java +++ b/src/main/java/emu/grasscutter/game/entity/EntityVehicle.java @@ -21,10 +21,9 @@ import emu.grasscutter.net.proto.VehicleInfoOuterClass.VehicleInfo; import emu.grasscutter.net.proto.VehicleMemberOuterClass.VehicleMember; import emu.grasscutter.utils.helpers.ProtoHelper; import it.unimi.dsi.fastutil.ints.*; -import lombok.*; - -import javax.annotation.Nullable; import java.util.*; +import javax.annotation.Nullable; +import lombok.*; public class EntityVehicle extends EntityBaseGadget { diff --git a/src/main/java/emu/grasscutter/game/entity/EntityWeapon.java b/src/main/java/emu/grasscutter/game/entity/EntityWeapon.java index f8f4cf42a..4816603db 100644 --- a/src/main/java/emu/grasscutter/game/entity/EntityWeapon.java +++ b/src/main/java/emu/grasscutter/game/entity/EntityWeapon.java @@ -10,9 +10,8 @@ import emu.grasscutter.game.world.*; import emu.grasscutter.net.proto.SceneEntityInfoOuterClass.SceneEntityInfo; import emu.grasscutter.scripts.EntityControllerScriptManager; import it.unimi.dsi.fastutil.ints.*; -import lombok.*; - import javax.annotation.Nullable; +import lombok.*; @ToString(callSuper = true) public class EntityWeapon extends EntityBaseGadget { diff --git a/src/main/java/emu/grasscutter/game/entity/GameEntity.java b/src/main/java/emu/grasscutter/game/entity/GameEntity.java index 1b0854f25..3574825af 100644 --- a/src/main/java/emu/grasscutter/game/entity/GameEntity.java +++ b/src/main/java/emu/grasscutter/game/entity/GameEntity.java @@ -15,9 +15,8 @@ import emu.grasscutter.scripts.data.controller.EntityController; import emu.grasscutter.server.event.entity.*; import emu.grasscutter.server.packet.send.PacketEntityFightPropUpdateNotify; import it.unimi.dsi.fastutil.ints.*; -import lombok.*; - import java.util.*; +import lombok.*; public abstract class GameEntity { @Getter private final Scene scene; diff --git a/src/main/java/emu/grasscutter/game/entity/gadget/GadgetChest.java b/src/main/java/emu/grasscutter/game/entity/gadget/GadgetChest.java index 70d4c9746..f573c5b7d 100644 --- a/src/main/java/emu/grasscutter/game/entity/gadget/GadgetChest.java +++ b/src/main/java/emu/grasscutter/game/entity/gadget/GadgetChest.java @@ -6,10 +6,10 @@ import emu.grasscutter.game.entity.EntityGadget; import emu.grasscutter.game.entity.gadget.chest.BossChestInteractHandler; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.props.WatcherTriggerType; +import emu.grasscutter.net.proto.*; import emu.grasscutter.net.proto.BossChestInfoOuterClass.BossChestInfo; import emu.grasscutter.net.proto.GadgetInteractReqOuterClass.GadgetInteractReq; import emu.grasscutter.net.proto.InterOpTypeOuterClass.InterOpType; -import emu.grasscutter.net.proto.*; import emu.grasscutter.net.proto.InteractTypeOuterClass.InteractType; import emu.grasscutter.net.proto.SceneGadgetInfoOuterClass.SceneGadgetInfo; import emu.grasscutter.scripts.constants.ScriptGadgetState; diff --git a/src/main/java/emu/grasscutter/game/entity/gadget/GadgetWorktop.java b/src/main/java/emu/grasscutter/game/entity/gadget/GadgetWorktop.java index 0a5a4dcb0..1542846a6 100644 --- a/src/main/java/emu/grasscutter/game/entity/gadget/GadgetWorktop.java +++ b/src/main/java/emu/grasscutter/game/entity/gadget/GadgetWorktop.java @@ -9,7 +9,6 @@ import emu.grasscutter.net.proto.SceneGadgetInfoOuterClass.SceneGadgetInfo; import emu.grasscutter.net.proto.SelectWorktopOptionReqOuterClass.SelectWorktopOptionReq; import emu.grasscutter.net.proto.WorktopInfoOuterClass.WorktopInfo; import it.unimi.dsi.fastutil.ints.IntOpenHashSet; - import java.util.*; public final class GadgetWorktop extends GadgetContent { diff --git a/src/main/java/emu/grasscutter/game/entity/gadget/chest/BossChestInteractHandler.java b/src/main/java/emu/grasscutter/game/entity/gadget/chest/BossChestInteractHandler.java index a332b06c0..75ef052a0 100644 --- a/src/main/java/emu/grasscutter/game/entity/gadget/chest/BossChestInteractHandler.java +++ b/src/main/java/emu/grasscutter/game/entity/gadget/chest/BossChestInteractHandler.java @@ -7,7 +7,6 @@ import emu.grasscutter.game.inventory.GameItem; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.props.ActionReason; import emu.grasscutter.server.packet.send.PacketGadgetAutoPickDropInfoNotify; - import java.util.*; public class BossChestInteractHandler implements ChestInteractHandler { diff --git a/src/main/java/emu/grasscutter/game/entity/gadget/chest/NormalChestInteractHandler.java b/src/main/java/emu/grasscutter/game/entity/gadget/chest/NormalChestInteractHandler.java index b668b485c..ef4599efb 100644 --- a/src/main/java/emu/grasscutter/game/entity/gadget/chest/NormalChestInteractHandler.java +++ b/src/main/java/emu/grasscutter/game/entity/gadget/chest/NormalChestInteractHandler.java @@ -4,7 +4,6 @@ import emu.grasscutter.game.entity.gadget.GadgetChest; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.world.ChestReward; import emu.grasscutter.server.event.player.PlayerOpenChestEvent; - import java.util.Random; public class NormalChestInteractHandler implements ChestInteractHandler { diff --git a/src/main/java/emu/grasscutter/game/entity/gadget/platform/AbilityRoute.java b/src/main/java/emu/grasscutter/game/entity/gadget/platform/AbilityRoute.java index a9235a8c9..fd5da0bc1 100644 --- a/src/main/java/emu/grasscutter/game/entity/gadget/platform/AbilityRoute.java +++ b/src/main/java/emu/grasscutter/game/entity/gadget/platform/AbilityRoute.java @@ -1,8 +1,8 @@ package emu.grasscutter.game.entity.gadget.platform; import emu.grasscutter.game.world.Position; -import emu.grasscutter.net.proto.MathQuaternionOuterClass.MathQuaternion; import emu.grasscutter.net.proto.*; +import emu.grasscutter.net.proto.MathQuaternionOuterClass.MathQuaternion; /** TODO mostly hardcoded for EntitySolarIsotomaElevatorPlatform, should be more generic */ public class AbilityRoute extends BaseRoute { diff --git a/src/main/java/emu/grasscutter/game/entity/gadget/platform/ConfigRoute.java b/src/main/java/emu/grasscutter/game/entity/gadget/platform/ConfigRoute.java index 47bc2fc0f..a70a8e769 100644 --- a/src/main/java/emu/grasscutter/game/entity/gadget/platform/ConfigRoute.java +++ b/src/main/java/emu/grasscutter/game/entity/gadget/platform/ConfigRoute.java @@ -3,9 +3,8 @@ package emu.grasscutter.game.entity.gadget.platform; import emu.grasscutter.game.world.Position; import emu.grasscutter.net.proto.*; import emu.grasscutter.scripts.data.SceneGadget; -import lombok.*; - import java.util.*; +import lombok.*; public class ConfigRoute extends BaseRoute { diff --git a/src/main/java/emu/grasscutter/game/expedition/ExpeditionRewardDataList.java b/src/main/java/emu/grasscutter/game/expedition/ExpeditionRewardDataList.java index 6d0bfa51a..2712bfd27 100644 --- a/src/main/java/emu/grasscutter/game/expedition/ExpeditionRewardDataList.java +++ b/src/main/java/emu/grasscutter/game/expedition/ExpeditionRewardDataList.java @@ -1,9 +1,8 @@ package emu.grasscutter.game.expedition; import emu.grasscutter.game.inventory.GameItem; -import lombok.Getter; - import java.util.*; +import lombok.Getter; public class ExpeditionRewardDataList { @Getter private int hourTime; diff --git a/src/main/java/emu/grasscutter/game/expedition/ExpeditionRewardInfo.java b/src/main/java/emu/grasscutter/game/expedition/ExpeditionRewardInfo.java index 6aa6a85d1..b39475b83 100644 --- a/src/main/java/emu/grasscutter/game/expedition/ExpeditionRewardInfo.java +++ b/src/main/java/emu/grasscutter/game/expedition/ExpeditionRewardInfo.java @@ -1,8 +1,7 @@ package emu.grasscutter.game.expedition; -import lombok.Getter; - import java.util.List; +import lombok.Getter; public class ExpeditionRewardInfo { @Getter private int expId; diff --git a/src/main/java/emu/grasscutter/game/expedition/ExpeditionSystem.java b/src/main/java/emu/grasscutter/game/expedition/ExpeditionSystem.java index 2285276c7..d58d4cf62 100644 --- a/src/main/java/emu/grasscutter/game/expedition/ExpeditionSystem.java +++ b/src/main/java/emu/grasscutter/game/expedition/ExpeditionSystem.java @@ -4,7 +4,6 @@ import emu.grasscutter.Grasscutter; import emu.grasscutter.data.DataLoader; import emu.grasscutter.server.game.*; import it.unimi.dsi.fastutil.ints.*; - import java.util.List; public class ExpeditionSystem extends BaseGameSystem { diff --git a/src/main/java/emu/grasscutter/game/friends/FriendsList.java b/src/main/java/emu/grasscutter/game/friends/FriendsList.java index 3c031434e..f7b1cd0f8 100644 --- a/src/main/java/emu/grasscutter/game/friends/FriendsList.java +++ b/src/main/java/emu/grasscutter/game/friends/FriendsList.java @@ -5,7 +5,6 @@ import emu.grasscutter.game.player.*; import emu.grasscutter.net.proto.DealAddFriendResultTypeOuterClass.DealAddFriendResultType; import emu.grasscutter.server.packet.send.*; import it.unimi.dsi.fastutil.ints.*; - import java.util.List; public class FriendsList extends BasePlayerManager { diff --git a/src/main/java/emu/grasscutter/game/friends/Friendship.java b/src/main/java/emu/grasscutter/game/friends/Friendship.java index 0f3f55592..21d483a29 100644 --- a/src/main/java/emu/grasscutter/game/friends/Friendship.java +++ b/src/main/java/emu/grasscutter/game/friends/Friendship.java @@ -11,24 +11,19 @@ import org.bson.types.ObjectId; @Entity(value = "friendships", useDiscriminator = false) public class Friendship { - @Id - private ObjectId id; + @Id private ObjectId id; - @Transient - private Player owner; + @Transient private Player owner; - @Indexed - private int ownerId; - @Indexed - private int friendId; + @Indexed private int ownerId; + @Indexed private int friendId; private boolean isFriend; private int askerId; private PlayerProfile profile; @Deprecated // Morphia use only - public Friendship() { - } + public Friendship() {} public Friendship(Player owner, Player friend, Player asker) { this.setOwner(owner); @@ -95,25 +90,25 @@ public class Friendship { var player = this.getFriendProfile().getPlayer(); // get latest player and sync. return FriendBrief.newBuilder() - .setUid(getFriendProfile().getUid()) - .setNickname(getFriendProfile().getName()) - .setLevel(getFriendProfile().getPlayerLevel()) - .setProfilePicture( - ProfilePicture.newBuilder().setAvatarId(getFriendProfile().getAvatarId())) - .setWorldLevel(getFriendProfile().getWorldLevel()) - .setSignature(getFriendProfile().getSignature()) - .setOnlineState( - player != null && player.isOnline() - ? FriendOnlineState.FRIEND_ONLINE_STATE_ONLINE - : FriendOnlineState.FRIEND_ONLINE_STATE_DISCONNECT) - .setIsMpModeAvailable(true) - .setLastActiveTime(getFriendProfile().getLastActiveTime()) - .setNameCardId(getFriendProfile().getNameCard()) - .setParam(getFriendProfile().getDaysSinceLogin()) - .setIsGameSource(true) - .setPlatformType(PlatformTypeOuterClass.PlatformType.PLATFORM_TYPE_PC) - .setIsInDuel(getFriendProfile().isInDuel()) - .setIsDuelObservable(getFriendProfile().isDuelObservable()) - .build(); + .setUid(getFriendProfile().getUid()) + .setNickname(getFriendProfile().getName()) + .setLevel(getFriendProfile().getPlayerLevel()) + .setProfilePicture( + ProfilePicture.newBuilder().setAvatarId(getFriendProfile().getAvatarId())) + .setWorldLevel(getFriendProfile().getWorldLevel()) + .setSignature(getFriendProfile().getSignature()) + .setOnlineState( + player != null && player.isOnline() + ? FriendOnlineState.FRIEND_ONLINE_STATE_ONLINE + : FriendOnlineState.FRIEND_ONLINE_STATE_DISCONNECT) + .setIsMpModeAvailable(true) + .setLastActiveTime(getFriendProfile().getLastActiveTime()) + .setNameCardId(getFriendProfile().getNameCard()) + .setParam(getFriendProfile().getDaysSinceLogin()) + .setIsGameSource(true) + .setPlatformType(PlatformTypeOuterClass.PlatformType.PLATFORM_TYPE_PC) + .setIsInDuel(getFriendProfile().isInDuel()) + .setIsDuelObservable(getFriendProfile().isDuelObservable()) + .build(); } } diff --git a/src/main/java/emu/grasscutter/game/friends/PlayerProfile.java b/src/main/java/emu/grasscutter/game/friends/PlayerProfile.java index 44b1fe11c..6d150df5f 100644 --- a/src/main/java/emu/grasscutter/game/friends/PlayerProfile.java +++ b/src/main/java/emu/grasscutter/game/friends/PlayerProfile.java @@ -27,9 +27,7 @@ public class PlayerProfile { private boolean isInDuel = false; // TODO: Implement duels. (TCG) private boolean isDuelObservable = false; // TODO: Implement duels. (TCG) - @Getter - private int enterHomeOption; - + @Getter private int enterHomeOption; @Deprecated // Morphia only public PlayerProfile() {} @@ -39,8 +37,7 @@ public class PlayerProfile { this.syncWithCharacter(player); } - @Nullable - public Player getPlayer() { + @Nullable public Player getPlayer() { var player = Grasscutter.getGameServer().getPlayerByUid(this.getUid(), true); this.syncWithCharacter(player); return player; @@ -66,7 +63,13 @@ public class PlayerProfile { this.nameCard = player.getNameCardId(); this.playerLevel = player.getLevel(); this.worldLevel = player.getWorldLevel(); - this.enterHomeOption = player.tryGetHome().map(GameHome::getEnterHomeOption).orElse(FriendEnterHomeOptionOuterClass.FriendEnterHomeOption.FRIEND_ENTER_HOME_OPTION_REFUSE_VALUE); + this.enterHomeOption = + player + .tryGetHome() + .map(GameHome::getEnterHomeOption) + .orElse( + FriendEnterHomeOptionOuterClass.FriendEnterHomeOption + .FRIEND_ENTER_HOME_OPTION_REFUSE_VALUE); this.updateLastActiveTime(); } } diff --git a/src/main/java/emu/grasscutter/game/gacha/GachaBanner.java b/src/main/java/emu/grasscutter/game/gacha/GachaBanner.java index ecd4b3dd6..b1bdaeef2 100644 --- a/src/main/java/emu/grasscutter/game/gacha/GachaBanner.java +++ b/src/main/java/emu/grasscutter/game/gacha/GachaBanner.java @@ -1,5 +1,7 @@ package emu.grasscutter.game.gacha; +import static emu.grasscutter.config.Configuration.*; + import emu.grasscutter.Grasscutter; import emu.grasscutter.data.common.ItemParamData; import emu.grasscutter.game.player.Player; @@ -8,8 +10,6 @@ import emu.grasscutter.net.proto.GachaUpInfoOuterClass.GachaUpInfo; import emu.grasscutter.utils.Utils; import lombok.Getter; -import static emu.grasscutter.config.Configuration.*; - public class GachaBanner { // Constants used by the BannerType enum static final int[][] DEFAULT_WEIGHTS_4 = {{1, 510}, {8, 510}, {10, 10000}}; diff --git a/src/main/java/emu/grasscutter/game/gacha/GachaRecord.java b/src/main/java/emu/grasscutter/game/gacha/GachaRecord.java index fee28789d..b1bbc7172 100644 --- a/src/main/java/emu/grasscutter/game/gacha/GachaRecord.java +++ b/src/main/java/emu/grasscutter/game/gacha/GachaRecord.java @@ -1,9 +1,8 @@ package emu.grasscutter.game.gacha; import dev.morphia.annotations.*; -import org.bson.types.ObjectId; - import java.util.Date; +import org.bson.types.ObjectId; @Entity(value = "gachas", useDiscriminator = false) public class GachaRecord { diff --git a/src/main/java/emu/grasscutter/game/gacha/GachaSystem.java b/src/main/java/emu/grasscutter/game/gacha/GachaSystem.java index e49e862aa..649aa5972 100644 --- a/src/main/java/emu/grasscutter/game/gacha/GachaSystem.java +++ b/src/main/java/emu/grasscutter/game/gacha/GachaSystem.java @@ -1,5 +1,7 @@ package emu.grasscutter.game.gacha; +import static emu.grasscutter.config.Configuration.GAME_OPTIONS; + import com.sun.nio.file.SensitivityWatchEventModifier; import emu.grasscutter.Grasscutter; import emu.grasscutter.data.*; @@ -21,13 +23,10 @@ import emu.grasscutter.server.game.*; import emu.grasscutter.server.packet.send.PacketDoGachaRsp; import emu.grasscutter.utils.*; import it.unimi.dsi.fastutil.ints.*; -import org.greenrobot.eventbus.Subscribe; - import java.nio.file.*; import java.util.*; import java.util.concurrent.ThreadLocalRandom; - -import static emu.grasscutter.config.Configuration.GAME_OPTIONS; +import org.greenrobot.eventbus.Subscribe; public class GachaSystem extends BaseGameSystem { private static final int starglitterId = 221; diff --git a/src/main/java/emu/grasscutter/game/home/GameHome.java b/src/main/java/emu/grasscutter/game/home/GameHome.java index 47ce2b54c..3c179582c 100644 --- a/src/main/java/emu/grasscutter/game/home/GameHome.java +++ b/src/main/java/emu/grasscutter/game/home/GameHome.java @@ -11,34 +11,36 @@ import emu.grasscutter.game.player.Player; import emu.grasscutter.game.props.SceneType; import emu.grasscutter.server.packet.send.*; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; -import lombok.AccessLevel; -import lombok.Builder; -import lombok.Data; -import lombok.experimental.FieldDefaults; - import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.Data; +import lombok.experimental.FieldDefaults; @Entity(value = "homes", useDiscriminator = false) @Data @FieldDefaults(level = AccessLevel.PRIVATE) @Builder(builderMethodName = "of") public class GameHome { - public static final Set HOME_SCENE_IDS = GameData.getSceneDataMap().values().stream() - .filter(sceneData -> sceneData.getSceneType() == SceneType.SCENE_HOME_WORLD || sceneData.getSceneType() == SceneType.SCENE_HOME_ROOM) - .map(SceneData::getId).collect(Collectors.toUnmodifiableSet()); + public static final Set HOME_SCENE_IDS = + GameData.getSceneDataMap().values().stream() + .filter( + sceneData -> + sceneData.getSceneType() == SceneType.SCENE_HOME_WORLD + || sceneData.getSceneType() == SceneType.SCENE_HOME_ROOM) + .map(SceneData::getId) + .collect(Collectors.toUnmodifiableSet()); - @Id - String id; + @Id String id; @Indexed(options = @IndexOptions(unique = true)) long ownerUid; - @Transient - Player player; + @Transient Player player; int level; int exp; @@ -65,11 +67,11 @@ public class GameHome { public static GameHome create(Integer uid) { return GameHome.of() - .ownerUid(uid) - .level(1) - .sceneMap(new ConcurrentHashMap<>()) - .unlockedHomeBgmList(new HashSet<>()) - .build(); + .ownerUid(uid) + .level(1) + .sceneMap(new ConcurrentHashMap<>()) + .unlockedHomeBgmList(new HashSet<>()) + .build(); } public void save() { @@ -78,19 +80,19 @@ public class GameHome { public HomeSceneItem getHomeSceneItem(int sceneId) { return sceneMap.computeIfAbsent( - sceneId, - e -> { - var defaultItem = GameData.getHomeworldDefaultSaveData().get(sceneId); - if (defaultItem != null) { - Grasscutter.getLogger() - .info("Set player {} home {} to initial setting", ownerUid, sceneId); - return HomeSceneItem.parseFrom(defaultItem, sceneId); - } else { - // Realm res missing bricks account, use default realm data to allow main house - defaultItem = GameData.getHomeworldDefaultSaveData().get(2001); - return HomeSceneItem.parseFrom(defaultItem, sceneId); - } - }); + sceneId, + e -> { + var defaultItem = GameData.getHomeworldDefaultSaveData().get(sceneId); + if (defaultItem != null) { + Grasscutter.getLogger() + .info("Set player {} home {} to initial setting", ownerUid, sceneId); + return HomeSceneItem.parseFrom(defaultItem, sceneId); + } else { + // Realm res missing bricks account, use default realm data to allow main house + defaultItem = GameData.getHomeworldDefaultSaveData().get(2001); + return HomeSceneItem.parseFrom(defaultItem, sceneId); + } + }); } public void onOwnerLogin(Player player) { @@ -107,16 +109,17 @@ public class GameHome { public void onPlayerChangedAvatarCostume(Avatar avatar) { var world = this.player.getServer().getHomeWorldOrCreate(this.player); - world.broadcastPacket(new PacketHomeAvatarCostumeChangeNotify(avatar.getAvatarId(), avatar.getCostume())); + world.broadcastPacket( + new PacketHomeAvatarCostumeChangeNotify(avatar.getAvatarId(), avatar.getCostume())); this.sceneMap.values().stream() - .map(HomeSceneItem::getBlockItems) - .map(Map::values) - .flatMap(Collection::stream) - .map(HomeBlockItem::getDeployNPCList) - .flatMap(Collection::stream) - .filter(homeNPCItem -> homeNPCItem.getAvatarId() == avatar.getAvatarId()) - .forEach(homeNPCItem -> homeNPCItem.setCostumeId(avatar.getCostume())); + .map(HomeSceneItem::getBlockItems) + .map(Map::values) + .flatMap(Collection::stream) + .map(HomeBlockItem::getDeployNPCList) + .flatMap(Collection::stream) + .filter(homeNPCItem -> homeNPCItem.getAvatarId() == avatar.getAvatarId()) + .forEach(homeNPCItem -> homeNPCItem.setCostumeId(avatar.getCostume())); this.save(); @@ -162,9 +165,9 @@ public class GameHome { private Set getDefaultUnlockedHomeBgmIds() { return GameData.getHomeWorldBgmDataMap().int2ObjectEntrySet().stream() - .filter(e -> e.getValue().isDefaultUnlock()) - .map(Int2ObjectMap.Entry::getIntKey) - .collect(Collectors.toUnmodifiableSet()); + .filter(e -> e.getValue().isDefaultUnlock()) + .map(Int2ObjectMap.Entry::getIntKey) + .collect(Collectors.toUnmodifiableSet()); } // Same as Player.java addExpDirectly @@ -203,7 +206,7 @@ public class GameHome { // Ensure next update is at top of the hour nextUpdateTime = - (int) ZonedDateTime.now().plusHours(1).truncatedTo(ChronoUnit.HOURS).toEpochSecond(); + (int) ZonedDateTime.now().plusHours(1).truncatedTo(ChronoUnit.HOURS).toEpochSecond(); // Get resources var hourlyResources = getComfortResources(player); @@ -226,42 +229,42 @@ public class GameHome { // Outdoors avatars sceneMap - .get(player.getCurrentRealmId() + 2000) - .getBlockItems() - .forEach( - (i, e) -> { - e.getDeployNPCList() - .forEach( - id -> { - invitedAvatars.add(id.getAvatarId()); - }); - }); + .get(player.getCurrentRealmId() + 2000) + .getBlockItems() + .forEach( + (i, e) -> { + e.getDeployNPCList() + .forEach( + id -> { + invitedAvatars.add(id.getAvatarId()); + }); + }); // Check as realm 5 inside is not in defaults and will be null if (Objects.nonNull(sceneMap.get(player.getCurrentRealmId() + 2200))) { // Indoors avatars sceneMap - .get(player.getCurrentRealmId() + 2200) - .getBlockItems() - .forEach( - (i, e) -> { - e.getDeployNPCList() - .forEach( - id -> { - invitedAvatars.add(id.getAvatarId()); - }); - }); + .get(player.getCurrentRealmId() + 2200) + .getBlockItems() + .forEach( + (i, e) -> { + e.getDeployNPCList() + .forEach( + id -> { + invitedAvatars.add(id.getAvatarId()); + }); + }); } // Add exp to all avatars invitedAvatars.forEach( - id -> { - var avatar = player.getAvatars().getAvatarById(id); - player - .getServer() - .getInventorySystem() - .upgradeAvatarFetterLevel(player, avatar, storedFetterExp); - }); + id -> { + var avatar = player.getAvatars().getAvatarById(id); + player + .getServer() + .getInventorySystem() + .upgradeAvatarFetterLevel(player, avatar, storedFetterExp); + }); storedFetterExp = 0; save(); @@ -285,7 +288,7 @@ public class GameHome { storeResources(player, 0, 0); lastUpdatedTime = clientTime; nextUpdateTime = - (int) ZonedDateTime.now().plusHours(1).truncatedTo(ChronoUnit.HOURS).toEpochSecond(); + (int) ZonedDateTime.now().plusHours(1).truncatedTo(ChronoUnit.HOURS).toEpochSecond(); save(); // Send packet diff --git a/src/main/java/emu/grasscutter/game/home/HomeBlockItem.java b/src/main/java/emu/grasscutter/game/home/HomeBlockItem.java index aadeb9484..dbd080d46 100644 --- a/src/main/java/emu/grasscutter/game/home/HomeBlockItem.java +++ b/src/main/java/emu/grasscutter/game/home/HomeBlockItem.java @@ -3,11 +3,10 @@ package emu.grasscutter.game.home; import dev.morphia.annotations.*; import emu.grasscutter.data.binout.HomeworldDefaultSaveData; import emu.grasscutter.net.proto.HomeBlockArrangementInfoOuterClass.HomeBlockArrangementInfo; -import lombok.*; -import lombok.experimental.FieldDefaults; - import java.util.*; import java.util.stream.Stream; +import lombok.*; +import lombok.experimental.FieldDefaults; @Entity @Data @@ -90,7 +89,9 @@ public class HomeBlockItem { public List getMarkPointProtoFactories() { this.reassignIfNull(); - return Stream.of(this.deployFurnitureList, this.persistentFurnitureList, this.deployNPCList).flatMap(Collection::stream).toList(); + return Stream.of(this.deployFurnitureList, this.persistentFurnitureList, this.deployNPCList) + .flatMap(Collection::stream) + .toList(); } public void reassignIfNull() { diff --git a/src/main/java/emu/grasscutter/game/home/HomeFurnitureItem.java b/src/main/java/emu/grasscutter/game/home/HomeFurnitureItem.java index d52cd31f4..040f47347 100644 --- a/src/main/java/emu/grasscutter/game/home/HomeFurnitureItem.java +++ b/src/main/java/emu/grasscutter/game/home/HomeFurnitureItem.java @@ -6,13 +6,12 @@ import emu.grasscutter.data.binout.HomeworldDefaultSaveData; import emu.grasscutter.data.excels.ItemData; import emu.grasscutter.game.world.Position; import emu.grasscutter.net.proto.*; +import java.util.Set; +import java.util.stream.Collectors; import lombok.*; import lombok.experimental.FieldDefaults; import org.jetbrains.annotations.Nullable; -import java.util.Set; -import java.util.stream.Collectors; - @Entity @Data @FieldDefaults(level = AccessLevel.PRIVATE) @@ -20,11 +19,11 @@ import java.util.stream.Collectors; public class HomeFurnitureItem implements HomeMarkPointProtoFactory { public static final int PAIMON_FURNITURE_ID = 368134; public static final int TELEPORT_FURNITURE_ID = 373501; - public static final Set APARTMENT_FURNITURE_ID_SET = GameData.getItemDataMap().values() - .stream() - .filter(itemData -> itemData.getSpecialFurnitureType() == SpecialFurnitureType.Apartment) - .map(ItemData::getId) - .collect(Collectors.toUnmodifiableSet()); + public static final Set APARTMENT_FURNITURE_ID_SET = + GameData.getItemDataMap().values().stream() + .filter(itemData -> itemData.getSpecialFurnitureType() == SpecialFurnitureType.Apartment) + .map(ItemData::getId) + .collect(Collectors.toUnmodifiableSet()); int furnitureId; int guid; @@ -78,8 +77,7 @@ public class HomeFurnitureItem implements HomeMarkPointProtoFactory { return item.getComfort(); } - @Nullable - @Override + @Nullable @Override public HomeMarkPointFurnitureDataOuterClass.HomeMarkPointFurnitureData toMarkPointProto() { var type = this.adjustByFurnitureId(); if (type == SpecialFurnitureType.NOT_SPECIAL) { @@ -87,11 +85,11 @@ public class HomeFurnitureItem implements HomeMarkPointProtoFactory { } return HomeMarkPointFurnitureDataOuterClass.HomeMarkPointFurnitureData.newBuilder() - .setFurnitureId(this.furnitureId) - .setFurnitureType(type.getValue()) - .setPos(this.spawnPos.toProto()) - .setGuid(this.guid) - .build(); + .setFurnitureId(this.furnitureId) + .setFurnitureType(type.getValue()) + .setPos(this.spawnPos.toProto()) + .setGuid(this.guid) + .build(); } @Override @@ -99,7 +97,9 @@ public class HomeFurnitureItem implements HomeMarkPointProtoFactory { return switch (this.furnitureId) { case PAIMON_FURNITURE_ID -> SpecialFurnitureType.Paimon; case TELEPORT_FURNITURE_ID -> SpecialFurnitureType.TeleportPoint; - default -> APARTMENT_FURNITURE_ID_SET.contains(this.furnitureId) ? SpecialFurnitureType.Apartment : SpecialFurnitureType.NOT_SPECIAL; + default -> APARTMENT_FURNITURE_ID_SET.contains(this.furnitureId) + ? SpecialFurnitureType.Apartment + : SpecialFurnitureType.NOT_SPECIAL; }; } } diff --git a/src/main/java/emu/grasscutter/game/home/HomeMarkPointProtoFactory.java b/src/main/java/emu/grasscutter/game/home/HomeMarkPointProtoFactory.java index a1b7b33df..f08789eac 100644 --- a/src/main/java/emu/grasscutter/game/home/HomeMarkPointProtoFactory.java +++ b/src/main/java/emu/grasscutter/game/home/HomeMarkPointProtoFactory.java @@ -4,8 +4,7 @@ import emu.grasscutter.net.proto.HomeMarkPointFurnitureDataOuterClass; import org.jetbrains.annotations.Nullable; public interface HomeMarkPointProtoFactory { - @Nullable - HomeMarkPointFurnitureDataOuterClass.HomeMarkPointFurnitureData toMarkPointProto(); + @Nullable HomeMarkPointFurnitureDataOuterClass.HomeMarkPointFurnitureData toMarkPointProto(); default SpecialFurnitureType adjustByFurnitureId() { return this.getType(); diff --git a/src/main/java/emu/grasscutter/game/home/HomeNPCItem.java b/src/main/java/emu/grasscutter/game/home/HomeNPCItem.java index 3a1795a5f..fbd2ad377 100644 --- a/src/main/java/emu/grasscutter/game/home/HomeNPCItem.java +++ b/src/main/java/emu/grasscutter/game/home/HomeNPCItem.java @@ -25,19 +25,19 @@ public class HomeNPCItem implements HomeMarkPointProtoFactory { public static HomeNPCItem parseFrom(HomeNpcDataOuterClass.HomeNpcData homeNpcData) { return HomeNPCItem.of() - .avatarId(homeNpcData.getAvatarId()) - .spawnPos(new Position(homeNpcData.getSpawnPos())) - .spawnRot(new Position(homeNpcData.getSpawnRot())) - .build(); + .avatarId(homeNpcData.getAvatarId()) + .spawnPos(new Position(homeNpcData.getSpawnPos())) + .spawnRot(new Position(homeNpcData.getSpawnRot())) + .build(); } public HomeNpcDataOuterClass.HomeNpcData toProto() { return HomeNpcDataOuterClass.HomeNpcData.newBuilder() - .setAvatarId(avatarId) - .setSpawnPos(spawnPos.toProto()) - .setSpawnRot(spawnRot.toProto()) - .setCostumeId(costumeId) - .build(); + .setAvatarId(avatarId) + .setSpawnPos(spawnPos.toProto()) + .setSpawnRot(spawnRot.toProto()) + .setCostumeId(costumeId) + .build(); } public int getFurnitureId() { @@ -49,18 +49,18 @@ public class HomeNPCItem implements HomeMarkPointProtoFactory { return this.furnitureId; } - @Nullable - @Override + @Nullable @Override public HomeMarkPointFurnitureDataOuterClass.HomeMarkPointFurnitureData toMarkPointProto() { return HomeMarkPointFurnitureDataOuterClass.HomeMarkPointFurnitureData.newBuilder() - .setFurnitureId(this.getFurnitureId()) - .setFurnitureType(this.getType().getValue()) - .setPos(this.spawnPos.toProto()) - .setNpcData(HomeMarkPointNPCDataOuterClass.HomeMarkPointNPCData.newBuilder() - .setAvatarId(this.avatarId) - .setCostumeId(this.costumeId) - .build()) - .build(); + .setFurnitureId(this.getFurnitureId()) + .setFurnitureType(this.getType().getValue()) + .setPos(this.spawnPos.toProto()) + .setNpcData( + HomeMarkPointNPCDataOuterClass.HomeMarkPointNPCData.newBuilder() + .setAvatarId(this.avatarId) + .setCostumeId(this.costumeId) + .build()) + .build(); } @Override diff --git a/src/main/java/emu/grasscutter/game/home/HomeSceneItem.java b/src/main/java/emu/grasscutter/game/home/HomeSceneItem.java index 1db1261b9..4157fcb28 100644 --- a/src/main/java/emu/grasscutter/game/home/HomeSceneItem.java +++ b/src/main/java/emu/grasscutter/game/home/HomeSceneItem.java @@ -5,11 +5,10 @@ import emu.grasscutter.Grasscutter; import emu.grasscutter.data.binout.HomeworldDefaultSaveData; import emu.grasscutter.game.world.Position; import emu.grasscutter.net.proto.HomeSceneArrangementInfoOuterClass.HomeSceneArrangementInfo; -import lombok.*; -import lombok.experimental.FieldDefaults; - import java.util.Map; import java.util.stream.Collectors; +import lombok.*; +import lombok.experimental.FieldDefaults; @Entity @Data diff --git a/src/main/java/emu/grasscutter/game/home/HomeWorld.java b/src/main/java/emu/grasscutter/game/home/HomeWorld.java index a62580a85..05f685362 100644 --- a/src/main/java/emu/grasscutter/game/home/HomeWorld.java +++ b/src/main/java/emu/grasscutter/game/home/HomeWorld.java @@ -7,13 +7,11 @@ import emu.grasscutter.net.packet.BasePacket; import emu.grasscutter.net.proto.ChatInfoOuterClass; import emu.grasscutter.server.game.GameServer; import emu.grasscutter.server.packet.send.*; +import java.util.List; import lombok.Getter; -import java.util.List; - public class HomeWorld extends World { - @Getter - private final GameHome home; + @Getter private final GameHome home; public HomeWorld(GameServer server, Player owner) { super(server, owner); @@ -51,21 +49,23 @@ public class HomeWorld extends World { // Copy main team to multiplayer team if (this.isMultiplayer()) { player - .getTeamManager() - .getMpTeam() - .copyFrom( - player.getTeamManager().getCurrentSinglePlayerTeamInfo(), - player.getTeamManager().getMaxTeamSize()); + .getTeamManager() + .getMpTeam() + .copyFrom( + player.getTeamManager().getCurrentSinglePlayerTeamInfo(), + player.getTeamManager().getMaxTeamSize()); player.getTeamManager().setCurrentCharacterIndex(0); if (!player.equals(this.getHost())) { this.broadcastPacket( - new PacketPlayerChatNotify( - player, - 0, - ChatInfoOuterClass.ChatInfo.SystemHint.newBuilder() - .setType(ChatInfoOuterClass.ChatInfo.SystemHintType.SYSTEM_HINT_TYPE_CHAT_ENTER_WORLD.getNumber()) - .build())); + new PacketPlayerChatNotify( + player, + 0, + ChatInfoOuterClass.ChatInfo.SystemHint.newBuilder() + .setType( + ChatInfoOuterClass.ChatInfo.SystemHintType.SYSTEM_HINT_TYPE_CHAT_ENTER_WORLD + .getNumber()) + .build())); } } @@ -83,15 +83,15 @@ public class HomeWorld extends World { public synchronized void removePlayer(Player player) { // Remove team entities this.broadcastPacket( - new PacketDelTeamEntityNotify( - player.getSceneId(), - this.getPlayers().stream() - .map( - p -> - p.getTeamManager().getEntity() == null - ? 0 - : p.getTeamManager().getEntity().getId()) - .toList())); + new PacketDelTeamEntityNotify( + player.getSceneId(), + this.getPlayers().stream() + .map( + p -> + p.getTeamManager().getEntity() == null + ? 0 + : p.getTeamManager().getEntity().getId()) + .toList())); // Deregister this.getPlayers().remove(player); @@ -107,12 +107,14 @@ public class HomeWorld extends World { } this.broadcastPacket( - new PacketPlayerChatNotify( - player, - 0, - ChatInfoOuterClass.ChatInfo.SystemHint.newBuilder() - .setType(ChatInfoOuterClass.ChatInfo.SystemHintType.SYSTEM_HINT_TYPE_CHAT_LEAVE_WORLD.getNumber()) - .build())); + new PacketPlayerChatNotify( + player, + 0, + ChatInfoOuterClass.ChatInfo.SystemHint.newBuilder() + .setType( + ChatInfoOuterClass.ChatInfo.SystemHintType.SYSTEM_HINT_TYPE_CHAT_LEAVE_WORLD + .getNumber()) + .build())); } @Override diff --git a/src/main/java/emu/grasscutter/game/home/HomeWorldMPSystem.java b/src/main/java/emu/grasscutter/game/home/HomeWorldMPSystem.java index f1a1ab3b8..f6f31e7b7 100644 --- a/src/main/java/emu/grasscutter/game/home/HomeWorldMPSystem.java +++ b/src/main/java/emu/grasscutter/game/home/HomeWorldMPSystem.java @@ -17,13 +17,25 @@ public class HomeWorldMPSystem extends BaseGameSystem { public void sendEnterHomeRequest(Player requester, int ownerUid) { var owner = getServer().getPlayerByUid(ownerUid); if (owner == null) { - requester.sendPacket(new PacketPlayerApplyEnterHomeResultNotify(ownerUid, "", false, PlayerApplyEnterHomeResultNotifyOuterClass.PlayerApplyEnterHomeResultNotify.Reason.OPEN_STATE_NOT_OPEN)); + requester.sendPacket( + new PacketPlayerApplyEnterHomeResultNotify( + ownerUid, + "", + false, + PlayerApplyEnterHomeResultNotifyOuterClass.PlayerApplyEnterHomeResultNotify.Reason + .OPEN_STATE_NOT_OPEN)); requester.sendPacket(new PacketTryEnterHomeRsp()); return; } if (owner.getRealmList() == null) { - requester.sendPacket(new PacketPlayerApplyEnterHomeResultNotify(ownerUid, "", false, PlayerApplyEnterHomeResultNotifyOuterClass.PlayerApplyEnterHomeResultNotify.Reason.OPEN_STATE_NOT_OPEN)); + requester.sendPacket( + new PacketPlayerApplyEnterHomeResultNotify( + ownerUid, + "", + false, + PlayerApplyEnterHomeResultNotifyOuterClass.PlayerApplyEnterHomeResultNotify.Reason + .OPEN_STATE_NOT_OPEN)); requester.sendPacket(new PacketTryEnterHomeRsp()); return; } @@ -35,7 +47,13 @@ public class HomeWorldMPSystem extends BaseGameSystem { } if (owner.isInEditMode()) { - requester.sendPacket(new PacketPlayerApplyEnterHomeResultNotify(ownerUid, owner.getNickname(), false, PlayerApplyEnterHomeResultNotifyOuterClass.PlayerApplyEnterHomeResultNotify.Reason.HOST_IN_EDIT_MODE)); + requester.sendPacket( + new PacketPlayerApplyEnterHomeResultNotify( + ownerUid, + owner.getNickname(), + false, + PlayerApplyEnterHomeResultNotifyOuterClass.PlayerApplyEnterHomeResultNotify.Reason + .HOST_IN_EDIT_MODE)); requester.sendPacket(new PacketTryEnterHomeRsp()); return; } @@ -56,12 +74,24 @@ public class HomeWorldMPSystem extends BaseGameSystem { owner.getEnterHomeRequests().remove(requesterUid); if (requester.getWorld().isMultiplayer()) { - requester.sendPacket(new PacketPlayerApplyEnterHomeResultNotify(owner.getUid(), owner.getNickname(), false, PlayerApplyEnterHomeResultNotifyOuterClass.PlayerApplyEnterHomeResultNotify.Reason.SYSTEM_JUDGE)); + requester.sendPacket( + new PacketPlayerApplyEnterHomeResultNotify( + owner.getUid(), + owner.getNickname(), + false, + PlayerApplyEnterHomeResultNotifyOuterClass.PlayerApplyEnterHomeResultNotify.Reason + .SYSTEM_JUDGE)); requester.sendPacket(new PacketTryEnterHomeRsp()); return; } - requester.sendPacket(new PacketPlayerApplyEnterHomeResultNotify(owner.getUid(), owner.getNickname(), isAgreed, PlayerApplyEnterHomeResultNotifyOuterClass.PlayerApplyEnterHomeResultNotify.Reason.PLAYER_JUDGE)); + requester.sendPacket( + new PacketPlayerApplyEnterHomeResultNotify( + owner.getUid(), + owner.getNickname(), + isAgreed, + PlayerApplyEnterHomeResultNotifyOuterClass.PlayerApplyEnterHomeResultNotify.Reason + .PLAYER_JUDGE)); if (!isAgreed) { requester.sendPacket(new PacketTryEnterHomeRsp()); @@ -78,7 +108,9 @@ public class HomeWorldMPSystem extends BaseGameSystem { if (owner.getRealmList() == null) { // should never happen - requester.sendPacket(new PacketTryEnterHomeRsp(RetcodeOuterClass.Retcode.RET_HOME_NOT_FOUND_IN_MEM_VALUE, owner.getUid())); + requester.sendPacket( + new PacketTryEnterHomeRsp( + RetcodeOuterClass.Retcode.RET_HOME_NOT_FOUND_IN_MEM_VALUE, owner.getUid())); return; } @@ -88,12 +120,16 @@ public class HomeWorldMPSystem extends BaseGameSystem { var event = new PlayerEnterHomeEvent(requester, owner, targetHome); event.call(); if (event.isCanceled()) { - requester.sendPacket(new PacketTryEnterHomeRsp(RetcodeOuterClass.Retcode.RET_HOME_OWNER_REFUSE_TO_ENTER_HOME_VALUE, owner.getUid())); + requester.sendPacket( + new PacketTryEnterHomeRsp( + RetcodeOuterClass.Retcode.RET_HOME_OWNER_REFUSE_TO_ENTER_HOME_VALUE, owner.getUid())); return; } if (owner.isInEditMode()) { - requester.sendPacket(new PacketTryEnterHomeRsp(RetcodeOuterClass.Retcode.RET_HOME_CANT_ENTER_BY_IN_EDIT_MODE_VALUE, owner.getUid())); + requester.sendPacket( + new PacketTryEnterHomeRsp( + RetcodeOuterClass.Retcode.RET_HOME_CANT_ENTER_BY_IN_EDIT_MODE_VALUE, owner.getUid())); return; } @@ -109,13 +145,23 @@ public class HomeWorldMPSystem extends BaseGameSystem { requester.setSceneId(realmId); requester.getPosition().set(pos); - requester.sendPacket(new PacketPlayerEnterSceneNotify(requester, owner.getUid(), TeleportProperties.builder().sceneId(realmId).enterReason(EnterReason.EnterHome).teleportTo(pos).teleportType(PlayerTeleportEvent.TeleportType.INTERNAL).build(), !requester.equals(owner))); + requester.sendPacket( + new PacketPlayerEnterSceneNotify( + requester, + owner.getUid(), + TeleportProperties.builder() + .sceneId(realmId) + .enterReason(EnterReason.EnterHome) + .teleportTo(pos) + .teleportType(PlayerTeleportEvent.TeleportType.INTERNAL) + .build(), + !requester.equals(owner))); requester.sendPacket(new PacketTryEnterHomeRsp(owner.getUid())); requester.setHasSentInitPacketInHome(false); world.getPlayers().stream() - .filter(player -> !player.equals(requester)) - .forEach(player -> player.sendPacket(new PacketPlayerPreEnterMpNotify(requester))); + .filter(player -> !player.equals(requester)) + .forEach(player -> player.sendPacket(new PacketPlayerPreEnterMpNotify(requester))); } public boolean leaveCoop(Player player, int prevScene) { @@ -131,17 +177,32 @@ public class HomeWorldMPSystem extends BaseGameSystem { } // Event - var event = new PlayerLeaveHomeEvent(player, player.getCurHomeWorld().getHost(), player.getCurHomeWorld().getHome(), PlayerLeaveHomeEvent.Reason.PLAYER_LEAVE); + var event = + new PlayerLeaveHomeEvent( + player, + player.getCurHomeWorld().getHost(), + player.getCurHomeWorld().getHome(), + PlayerLeaveHomeEvent.Reason.PLAYER_LEAVE); event.call(); player.getPosition().set(pos); var world = new World(player); world.addPlayer(player, prevScene); - player.getCurHomeWorld().sendPacketToHostIfOnline(new PacketOtherPlayerEnterOrLeaveHomeNotify(player, OtherPlayerEnterHomeNotifyOuterClass.OtherPlayerEnterHomeNotify.Reason.LEAVE)); + player + .getCurHomeWorld() + .sendPacketToHostIfOnline( + new PacketOtherPlayerEnterOrLeaveHomeNotify( + player, + OtherPlayerEnterHomeNotifyOuterClass.OtherPlayerEnterHomeNotify.Reason.LEAVE)); player.setCurHomeWorld(this.server.getHomeWorldOrCreate(player)); - player.sendPacket(new PacketPlayerEnterSceneNotify(player, EnterTypeOuterClass.EnterType.ENTER_TYPE_BACK, EnterReason.TeamBack, prevScene, pos)); - + player.sendPacket( + new PacketPlayerEnterSceneNotify( + player, + EnterTypeOuterClass.EnterType.ENTER_TYPE_BACK, + EnterReason.TeamBack, + prevScene, + pos)); return true; } @@ -164,17 +225,30 @@ public class HomeWorldMPSystem extends BaseGameSystem { } // Event - var event = new PlayerLeaveHomeEvent(victim, owner, victim.getCurHomeWorld().getHome(), PlayerLeaveHomeEvent.Reason.KICKED); + var event = + new PlayerLeaveHomeEvent( + victim, owner, victim.getCurHomeWorld().getHome(), PlayerLeaveHomeEvent.Reason.KICKED); event.call(); // Kick victim.getPosition().set(victim.getPrevPosForHome()); var world = new World(victim); world.addPlayer(victim, 3); - victim.getCurHomeWorld().sendPacketToHostIfOnline(new PacketOtherPlayerEnterOrLeaveHomeNotify(victim, OtherPlayerEnterHomeNotifyOuterClass.OtherPlayerEnterHomeNotify.Reason.LEAVE)); + victim + .getCurHomeWorld() + .sendPacketToHostIfOnline( + new PacketOtherPlayerEnterOrLeaveHomeNotify( + victim, + OtherPlayerEnterHomeNotifyOuterClass.OtherPlayerEnterHomeNotify.Reason.LEAVE)); victim.setCurHomeWorld(this.server.getHomeWorldOrCreate(victim)); - victim.sendPacket(new PacketPlayerEnterSceneNotify(victim, EnterTypeOuterClass.EnterType.ENTER_TYPE_BACK, EnterReason.TeamKick, victim.getScene().getId(), victim.getPrevPosForHome())); + victim.sendPacket( + new PacketPlayerEnterSceneNotify( + victim, + EnterTypeOuterClass.EnterType.ENTER_TYPE_BACK, + EnterReason.TeamKick, + victim.getScene().getId(), + victim.getPrevPosForHome())); return true; } } diff --git a/src/main/java/emu/grasscutter/game/inventory/BagTab.java b/src/main/java/emu/grasscutter/game/inventory/BagTab.java index 63b8f0770..697374b75 100644 --- a/src/main/java/emu/grasscutter/game/inventory/BagTab.java +++ b/src/main/java/emu/grasscutter/game/inventory/BagTab.java @@ -1,10 +1,9 @@ package emu.grasscutter.game.inventory; import it.unimi.dsi.fastutil.ints.*; -import lombok.*; - import java.util.*; import java.util.stream.Stream; +import lombok.*; @RequiredArgsConstructor public enum BagTab { diff --git a/src/main/java/emu/grasscutter/game/inventory/EquipType.java b/src/main/java/emu/grasscutter/game/inventory/EquipType.java index b9721a317..00bf4e078 100644 --- a/src/main/java/emu/grasscutter/game/inventory/EquipType.java +++ b/src/main/java/emu/grasscutter/game/inventory/EquipType.java @@ -1,10 +1,9 @@ package emu.grasscutter.game.inventory; import it.unimi.dsi.fastutil.ints.*; -import lombok.Getter; - import java.util.*; import java.util.stream.Stream; +import lombok.Getter; public enum EquipType { EQUIP_NONE(0), diff --git a/src/main/java/emu/grasscutter/game/inventory/GameItem.java b/src/main/java/emu/grasscutter/game/inventory/GameItem.java index 00e370f08..a89f9f30f 100644 --- a/src/main/java/emu/grasscutter/game/inventory/GameItem.java +++ b/src/main/java/emu/grasscutter/game/inventory/GameItem.java @@ -21,11 +21,10 @@ import emu.grasscutter.net.proto.SceneReliquaryInfoOuterClass.SceneReliquaryInfo import emu.grasscutter.net.proto.SceneWeaponInfoOuterClass.SceneWeaponInfo; import emu.grasscutter.net.proto.WeaponOuterClass.Weapon; import emu.grasscutter.utils.objects.WeightedList; +import java.util.*; import lombok.*; import org.bson.types.ObjectId; -import java.util.*; - @Entity(value = "items", useDiscriminator = false) public class GameItem { @Id private ObjectId id; diff --git a/src/main/java/emu/grasscutter/game/inventory/Inventory.java b/src/main/java/emu/grasscutter/game/inventory/Inventory.java index 8f15deb07..9a293f0f0 100644 --- a/src/main/java/emu/grasscutter/game/inventory/Inventory.java +++ b/src/main/java/emu/grasscutter/game/inventory/Inventory.java @@ -1,5 +1,7 @@ package emu.grasscutter.game.inventory; +import static emu.grasscutter.config.Configuration.INVENTORY_LIMITS; + import emu.grasscutter.Grasscutter; import emu.grasscutter.data.GameData; import emu.grasscutter.data.common.ItemParamData; @@ -16,12 +18,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 static emu.grasscutter.config.Configuration.INVENTORY_LIMITS; +import javax.annotation.Nullable; +import lombok.val; public class Inventory extends BasePlayerManager implements Iterable { private final Long2ObjectMap store; diff --git a/src/main/java/emu/grasscutter/game/inventory/ItemQuality.java b/src/main/java/emu/grasscutter/game/inventory/ItemQuality.java index 8d49de6af..954230d62 100644 --- a/src/main/java/emu/grasscutter/game/inventory/ItemQuality.java +++ b/src/main/java/emu/grasscutter/game/inventory/ItemQuality.java @@ -1,10 +1,9 @@ package emu.grasscutter.game.inventory; import it.unimi.dsi.fastutil.ints.*; -import lombok.Getter; - import java.util.*; import java.util.stream.Stream; +import lombok.Getter; public enum ItemQuality { QUALITY_NONE(0), diff --git a/src/main/java/emu/grasscutter/game/inventory/ItemType.java b/src/main/java/emu/grasscutter/game/inventory/ItemType.java index 4eef06095..c6ab80e33 100644 --- a/src/main/java/emu/grasscutter/game/inventory/ItemType.java +++ b/src/main/java/emu/grasscutter/game/inventory/ItemType.java @@ -1,10 +1,9 @@ package emu.grasscutter.game.inventory; import it.unimi.dsi.fastutil.ints.*; -import lombok.Getter; - import java.util.*; import java.util.stream.Stream; +import lombok.Getter; public enum ItemType { ITEM_NONE(0), diff --git a/src/main/java/emu/grasscutter/game/inventory/MaterialType.java b/src/main/java/emu/grasscutter/game/inventory/MaterialType.java index 9440eceea..e53764744 100644 --- a/src/main/java/emu/grasscutter/game/inventory/MaterialType.java +++ b/src/main/java/emu/grasscutter/game/inventory/MaterialType.java @@ -1,10 +1,9 @@ package emu.grasscutter.game.inventory; import it.unimi.dsi.fastutil.ints.*; -import lombok.Getter; - import java.util.*; import java.util.stream.Stream; +import lombok.Getter; public enum MaterialType { MATERIAL_NONE(0), diff --git a/src/main/java/emu/grasscutter/game/mail/Mail.java b/src/main/java/emu/grasscutter/game/mail/Mail.java index da3120f33..89161b950 100644 --- a/src/main/java/emu/grasscutter/game/mail/Mail.java +++ b/src/main/java/emu/grasscutter/game/mail/Mail.java @@ -1,18 +1,17 @@ package emu.grasscutter.game.mail; +import static emu.grasscutter.net.proto.MailItemOuterClass.MailItem.newBuilder; + import dev.morphia.annotations.*; import emu.grasscutter.database.DatabaseHelper; import emu.grasscutter.game.player.Player; +import emu.grasscutter.net.proto.*; import emu.grasscutter.net.proto.EquipParamOuterClass.EquipParam; import emu.grasscutter.net.proto.MailCollectStateOuterClass.MailCollectState; -import emu.grasscutter.net.proto.*; import emu.grasscutter.net.proto.MailTextContentOuterClass.MailTextContent; -import org.bson.types.ObjectId; - import java.time.Instant; import java.util.*; - -import static emu.grasscutter.net.proto.MailItemOuterClass.MailItem.newBuilder; +import org.bson.types.ObjectId; @Entity(value = "mail", useDiscriminator = false) public final class Mail { diff --git a/src/main/java/emu/grasscutter/game/mail/MailHandler.java b/src/main/java/emu/grasscutter/game/mail/MailHandler.java index 1d24787ed..51ca53698 100644 --- a/src/main/java/emu/grasscutter/game/mail/MailHandler.java +++ b/src/main/java/emu/grasscutter/game/mail/MailHandler.java @@ -5,7 +5,6 @@ import emu.grasscutter.database.DatabaseHelper; import emu.grasscutter.game.player.*; import emu.grasscutter.server.event.player.PlayerReceiveMailEvent; import emu.grasscutter.server.packet.send.*; - import java.util.*; public class MailHandler extends BasePlayerManager { diff --git a/src/main/java/emu/grasscutter/game/managers/FurnitureManager.java b/src/main/java/emu/grasscutter/game/managers/FurnitureManager.java index 55347f46b..9fda57bc4 100644 --- a/src/main/java/emu/grasscutter/game/managers/FurnitureManager.java +++ b/src/main/java/emu/grasscutter/game/managers/FurnitureManager.java @@ -8,7 +8,6 @@ import emu.grasscutter.net.proto.ItemParamOuterClass; import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode; import emu.grasscutter.server.packet.send.*; import emu.grasscutter.utils.Utils; - import java.util.*; public class FurnitureManager extends BasePlayerManager { diff --git a/src/main/java/emu/grasscutter/game/managers/ResinManager.java b/src/main/java/emu/grasscutter/game/managers/ResinManager.java index 051309079..0d995dabb 100644 --- a/src/main/java/emu/grasscutter/game/managers/ResinManager.java +++ b/src/main/java/emu/grasscutter/game/managers/ResinManager.java @@ -1,5 +1,7 @@ package emu.grasscutter.game.managers; +import static emu.grasscutter.config.Configuration.GAME_OPTIONS; + import emu.grasscutter.game.inventory.GameItem; import emu.grasscutter.game.player.*; import emu.grasscutter.game.props.*; @@ -7,8 +9,6 @@ import emu.grasscutter.net.proto.RetcodeOuterClass; import emu.grasscutter.server.packet.send.*; import emu.grasscutter.utils.Utils; -import static emu.grasscutter.config.Configuration.GAME_OPTIONS; - public class ResinManager extends BasePlayerManager { public static final int MAX_RESIN_BUYING_COUNT = 6; public static final int AMOUNT_TO_ADD = 60; diff --git a/src/main/java/emu/grasscutter/game/managers/SatiationManager.java b/src/main/java/emu/grasscutter/game/managers/SatiationManager.java index e4f920869..29e992863 100644 --- a/src/main/java/emu/grasscutter/game/managers/SatiationManager.java +++ b/src/main/java/emu/grasscutter/game/managers/SatiationManager.java @@ -4,7 +4,6 @@ import emu.grasscutter.game.avatar.Avatar; import emu.grasscutter.game.player.*; import emu.grasscutter.game.props.PlayerProperty; import emu.grasscutter.server.packet.send.*; - import java.util.*; public class SatiationManager extends BasePlayerManager { diff --git a/src/main/java/emu/grasscutter/game/managers/SotSManager.java b/src/main/java/emu/grasscutter/game/managers/SotSManager.java index e48778f3c..6427de185 100644 --- a/src/main/java/emu/grasscutter/game/managers/SotSManager.java +++ b/src/main/java/emu/grasscutter/game/managers/SotSManager.java @@ -13,7 +13,6 @@ import emu.grasscutter.net.proto.ChangeHpReasonOuterClass.ChangeHpReason; import emu.grasscutter.net.proto.PropChangeReasonOuterClass.PropChangeReason; import emu.grasscutter.server.event.player.PlayerLevelStatueEvent; import emu.grasscutter.server.packet.send.*; - import java.util.*; // Statue of the Seven Manager diff --git a/src/main/java/emu/grasscutter/game/managers/blossom/BlossomActivity.java b/src/main/java/emu/grasscutter/game/managers/blossom/BlossomActivity.java index 6f2735345..5b902d347 100644 --- a/src/main/java/emu/grasscutter/game/managers/blossom/BlossomActivity.java +++ b/src/main/java/emu/grasscutter/game/managers/blossom/BlossomActivity.java @@ -8,7 +8,6 @@ import emu.grasscutter.game.props.FightProperty; import emu.grasscutter.game.world.*; import emu.grasscutter.scripts.data.*; import emu.grasscutter.utils.Utils; - import java.util.*; public final class BlossomActivity { diff --git a/src/main/java/emu/grasscutter/game/managers/blossom/BlossomConfig.java b/src/main/java/emu/grasscutter/game/managers/blossom/BlossomConfig.java index 703b3a46d..a8652e8fe 100644 --- a/src/main/java/emu/grasscutter/game/managers/blossom/BlossomConfig.java +++ b/src/main/java/emu/grasscutter/game/managers/blossom/BlossomConfig.java @@ -1,8 +1,7 @@ package emu.grasscutter.game.managers.blossom; -import lombok.Getter; - import java.util.*; +import lombok.Getter; public class BlossomConfig { @Getter private int monsterFightingVolume; diff --git a/src/main/java/emu/grasscutter/game/managers/blossom/BlossomManager.java b/src/main/java/emu/grasscutter/game/managers/blossom/BlossomManager.java index 3177d0788..5322c22c9 100644 --- a/src/main/java/emu/grasscutter/game/managers/blossom/BlossomManager.java +++ b/src/main/java/emu/grasscutter/game/managers/blossom/BlossomManager.java @@ -14,7 +14,6 @@ import emu.grasscutter.net.proto.*; import emu.grasscutter.server.packet.send.PacketBlossomBriefInfoNotify; import emu.grasscutter.utils.Utils; import it.unimi.dsi.fastutil.ints.*; - import java.util.*; public class BlossomManager { diff --git a/src/main/java/emu/grasscutter/game/managers/blossom/BlossomType.java b/src/main/java/emu/grasscutter/game/managers/blossom/BlossomType.java index 51f184911..925e05b0d 100644 --- a/src/main/java/emu/grasscutter/game/managers/blossom/BlossomType.java +++ b/src/main/java/emu/grasscutter/game/managers/blossom/BlossomType.java @@ -2,9 +2,8 @@ package emu.grasscutter.game.managers.blossom; import emu.grasscutter.utils.Utils; import it.unimi.dsi.fastutil.ints.*; -import lombok.Getter; - import java.util.stream.*; +import lombok.Getter; public enum BlossomType { GOLD(70360056, 101001001, 1), diff --git a/src/main/java/emu/grasscutter/game/managers/cooking/CookingCompoundManager.java b/src/main/java/emu/grasscutter/game/managers/cooking/CookingCompoundManager.java index f09228e46..0f1b1453f 100644 --- a/src/main/java/emu/grasscutter/game/managers/cooking/CookingCompoundManager.java +++ b/src/main/java/emu/grasscutter/game/managers/cooking/CookingCompoundManager.java @@ -14,7 +14,6 @@ import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode; import emu.grasscutter.net.proto.TakeCompoundOutputReqOuterClass.TakeCompoundOutputReq; import emu.grasscutter.server.packet.send.*; import emu.grasscutter.utils.Utils; - import java.util.*; public class CookingCompoundManager extends BasePlayerManager { diff --git a/src/main/java/emu/grasscutter/game/managers/cooking/CookingManager.java b/src/main/java/emu/grasscutter/game/managers/cooking/CookingManager.java index ce38621c7..b1de9efc5 100644 --- a/src/main/java/emu/grasscutter/game/managers/cooking/CookingManager.java +++ b/src/main/java/emu/grasscutter/game/managers/cooking/CookingManager.java @@ -12,7 +12,6 @@ import emu.grasscutter.net.proto.PlayerCookReqOuterClass.PlayerCookReq; import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode; import emu.grasscutter.server.packet.send.*; import io.netty.util.internal.ThreadLocalRandom; - import java.util.*; public class CookingManager extends BasePlayerManager { diff --git a/src/main/java/emu/grasscutter/game/managers/deforestation/DeforestationManager.java b/src/main/java/emu/grasscutter/game/managers/deforestation/DeforestationManager.java index 7dedc7a23..2da932178 100644 --- a/src/main/java/emu/grasscutter/game/managers/deforestation/DeforestationManager.java +++ b/src/main/java/emu/grasscutter/game/managers/deforestation/DeforestationManager.java @@ -6,7 +6,6 @@ import emu.grasscutter.game.entity.EntityItem; import emu.grasscutter.game.player.*; import emu.grasscutter.game.world.*; import emu.grasscutter.net.proto.*; - import java.util.*; public class DeforestationManager extends BasePlayerManager { diff --git a/src/main/java/emu/grasscutter/game/managers/energy/EnergyManager.java b/src/main/java/emu/grasscutter/game/managers/energy/EnergyManager.java index 53c792da6..5b4e6eb64 100644 --- a/src/main/java/emu/grasscutter/game/managers/energy/EnergyManager.java +++ b/src/main/java/emu/grasscutter/game/managers/energy/EnergyManager.java @@ -1,5 +1,7 @@ package emu.grasscutter.game.managers.energy; +import static emu.grasscutter.config.Configuration.GAME_OPTIONS; + import com.google.protobuf.InvalidProtocolBufferException; import emu.grasscutter.Grasscutter; import emu.grasscutter.data.*; @@ -21,12 +23,9 @@ import emu.grasscutter.net.proto.PropChangeReasonOuterClass.PropChangeReason; import emu.grasscutter.server.game.GameSession; import it.unimi.dsi.fastutil.ints.*; import it.unimi.dsi.fastutil.objects.*; -import lombok.Getter; - import java.util.*; import java.util.concurrent.ThreadLocalRandom; - -import static emu.grasscutter.config.Configuration.GAME_OPTIONS; +import lombok.Getter; public class EnergyManager extends BasePlayerManager { private static final Int2ObjectMap> energyDropData = diff --git a/src/main/java/emu/grasscutter/game/managers/forging/ForgingManager.java b/src/main/java/emu/grasscutter/game/managers/forging/ForgingManager.java index bdd85e873..deca11dda 100644 --- a/src/main/java/emu/grasscutter/game/managers/forging/ForgingManager.java +++ b/src/main/java/emu/grasscutter/game/managers/forging/ForgingManager.java @@ -14,7 +14,6 @@ import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode; import emu.grasscutter.server.event.player.PlayerForgeItemEvent; import emu.grasscutter.server.packet.send.*; import emu.grasscutter.utils.Utils; - import java.util.*; public final class ForgingManager extends BasePlayerManager { diff --git a/src/main/java/emu/grasscutter/game/managers/mapmark/MapMarksManager.java b/src/main/java/emu/grasscutter/game/managers/mapmark/MapMarksManager.java index e9d46189f..cce58d338 100644 --- a/src/main/java/emu/grasscutter/game/managers/mapmark/MapMarksManager.java +++ b/src/main/java/emu/grasscutter/game/managers/mapmark/MapMarksManager.java @@ -8,7 +8,6 @@ import emu.grasscutter.net.proto.MarkMapReqOuterClass.MarkMapReq; import emu.grasscutter.net.proto.MarkMapReqOuterClass.MarkMapReq.Operation; import emu.grasscutter.server.event.player.PlayerTeleportEvent.TeleportType; import emu.grasscutter.server.packet.send.*; - import java.util.Map; public class MapMarksManager extends BasePlayerManager { diff --git a/src/main/java/emu/grasscutter/game/player/InvokeHandler.java b/src/main/java/emu/grasscutter/game/player/InvokeHandler.java index 57f9720e0..b6e3e4c5a 100644 --- a/src/main/java/emu/grasscutter/game/player/InvokeHandler.java +++ b/src/main/java/emu/grasscutter/game/player/InvokeHandler.java @@ -2,7 +2,6 @@ package emu.grasscutter.game.player; import emu.grasscutter.net.packet.BasePacket; import emu.grasscutter.net.proto.ForwardTypeOuterClass.ForwardType; - import java.util.*; public class InvokeHandler { diff --git a/src/main/java/emu/grasscutter/game/player/PlayerBuffManager.java b/src/main/java/emu/grasscutter/game/player/PlayerBuffManager.java index 2ea66e482..9fc66d37e 100644 --- a/src/main/java/emu/grasscutter/game/player/PlayerBuffManager.java +++ b/src/main/java/emu/grasscutter/game/player/PlayerBuffManager.java @@ -9,9 +9,8 @@ import emu.grasscutter.net.proto.ServerBuffChangeNotifyOuterClass.ServerBuffChan import emu.grasscutter.net.proto.ServerBuffOuterClass.ServerBuff; import emu.grasscutter.server.packet.send.PacketServerBuffChangeNotify; import it.unimi.dsi.fastutil.ints.*; -import lombok.Getter; - import java.util.*; +import lombok.Getter; public final class PlayerBuffManager extends BasePlayerManager { private final List pendingBuffs; diff --git a/src/main/java/emu/grasscutter/game/player/PlayerCodex.java b/src/main/java/emu/grasscutter/game/player/PlayerCodex.java index 4e59878e6..646ef22d1 100644 --- a/src/main/java/emu/grasscutter/game/player/PlayerCodex.java +++ b/src/main/java/emu/grasscutter/game/player/PlayerCodex.java @@ -6,9 +6,8 @@ import emu.grasscutter.data.excels.codex.CodexAnimalData; import emu.grasscutter.game.entity.*; import emu.grasscutter.game.inventory.GameItem; import emu.grasscutter.server.packet.send.PacketCodexDataUpdateNotify; -import lombok.*; - import java.util.*; +import lombok.*; @Entity public class PlayerCodex { diff --git a/src/main/java/emu/grasscutter/game/player/PlayerCollectionRecords.java b/src/main/java/emu/grasscutter/game/player/PlayerCollectionRecords.java index 053b2a617..1d1488bd4 100644 --- a/src/main/java/emu/grasscutter/game/player/PlayerCollectionRecords.java +++ b/src/main/java/emu/grasscutter/game/player/PlayerCollectionRecords.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.player; import dev.morphia.annotations.Entity; - import java.util.*; @Entity(useDiscriminator = false) diff --git a/src/main/java/emu/grasscutter/game/player/PlayerProgress.java b/src/main/java/emu/grasscutter/game/player/PlayerProgress.java index 638d8c5da..f66b957ef 100644 --- a/src/main/java/emu/grasscutter/game/player/PlayerProgress.java +++ b/src/main/java/emu/grasscutter/game/player/PlayerProgress.java @@ -5,10 +5,9 @@ import emu.grasscutter.Grasscutter; import emu.grasscutter.game.quest.*; import emu.grasscutter.game.quest.enums.QuestContent; import it.unimi.dsi.fastutil.ints.*; -import lombok.*; - import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import lombok.*; /** Tracks progress the player made in the world, like obtained items, seen characters and more */ @Getter diff --git a/src/main/java/emu/grasscutter/game/player/PlayerProgressManager.java b/src/main/java/emu/grasscutter/game/player/PlayerProgressManager.java index d1f7849b3..788928066 100644 --- a/src/main/java/emu/grasscutter/game/player/PlayerProgressManager.java +++ b/src/main/java/emu/grasscutter/game/player/PlayerProgressManager.java @@ -1,5 +1,8 @@ package emu.grasscutter.game.player; +import static emu.grasscutter.config.Configuration.GAME_OPTIONS; +import static emu.grasscutter.scripts.constants.EventType.EVENT_UNLOCK_TRANS_POINT; + import emu.grasscutter.data.GameData; import emu.grasscutter.data.binout.ScenePointEntry; import emu.grasscutter.data.excels.OpenStateData; @@ -9,13 +12,9 @@ import emu.grasscutter.game.quest.enums.*; import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode; import emu.grasscutter.scripts.data.ScriptArgs; import emu.grasscutter.server.packet.send.*; - import java.util.Set; import java.util.stream.Collectors; -import static emu.grasscutter.config.Configuration.GAME_OPTIONS; -import static emu.grasscutter.scripts.constants.EventType.EVENT_UNLOCK_TRANS_POINT; - // @Entity public final class PlayerProgressManager extends BasePlayerDataManager { /****************************************************************************************************************** diff --git a/src/main/java/emu/grasscutter/game/player/TeamInfo.java b/src/main/java/emu/grasscutter/game/player/TeamInfo.java index 516abe766..794f36501 100644 --- a/src/main/java/emu/grasscutter/game/player/TeamInfo.java +++ b/src/main/java/emu/grasscutter/game/player/TeamInfo.java @@ -1,13 +1,12 @@ package emu.grasscutter.game.player; +import static emu.grasscutter.config.Configuration.GAME_OPTIONS; + import dev.morphia.annotations.Entity; import emu.grasscutter.game.avatar.Avatar; import emu.grasscutter.net.proto.AvatarTeamOuterClass.AvatarTeam; - import java.util.*; -import static emu.grasscutter.config.Configuration.GAME_OPTIONS; - @Entity public final class TeamInfo { private String name; diff --git a/src/main/java/emu/grasscutter/game/player/TeamManager.java b/src/main/java/emu/grasscutter/game/player/TeamManager.java index e5d5e0045..f6a038e31 100644 --- a/src/main/java/emu/grasscutter/game/player/TeamManager.java +++ b/src/main/java/emu/grasscutter/game/player/TeamManager.java @@ -1,5 +1,7 @@ package emu.grasscutter.game.player; +import static emu.grasscutter.config.Configuration.GAME_OPTIONS; + import dev.morphia.annotations.*; import emu.grasscutter.*; import emu.grasscutter.data.GameData; @@ -21,12 +23,9 @@ import emu.grasscutter.server.packet.send.*; import emu.grasscutter.utils.Utils; import it.unimi.dsi.fastutil.ints.*; import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; -import lombok.*; - import java.util.*; import java.util.stream.Stream; - -import static emu.grasscutter.config.Configuration.GAME_OPTIONS; +import lombok.*; @Entity public final class TeamManager extends BasePlayerDataManager { @@ -352,7 +351,9 @@ public final class TeamManager extends BasePlayerDataManager { public void updateTeamProperties() { this.updateTeamResonances(); // Update team resonances. this.getWorld() - .broadcastPacket(new PacketSceneTeamUpdateNotify(this.getPlayer())); // Notify the all players in the world. + .broadcastPacket( + new PacketSceneTeamUpdateNotify( + this.getPlayer())); // Notify the all players in the world. // Skill charges packet - Yes, this is official server behavior as of 2.6.0 this.getActiveTeam().stream() diff --git a/src/main/java/emu/grasscutter/game/props/ActionReason.java b/src/main/java/emu/grasscutter/game/props/ActionReason.java index bb2f213fa..76a2aed58 100644 --- a/src/main/java/emu/grasscutter/game/props/ActionReason.java +++ b/src/main/java/emu/grasscutter/game/props/ActionReason.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; - import java.util.*; import java.util.stream.Stream; diff --git a/src/main/java/emu/grasscutter/game/props/ActivityType.java b/src/main/java/emu/grasscutter/game/props/ActivityType.java index 96080ba37..eeeb18b47 100644 --- a/src/main/java/emu/grasscutter/game/props/ActivityType.java +++ b/src/main/java/emu/grasscutter/game/props/ActivityType.java @@ -1,10 +1,9 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; -import lombok.*; - import java.util.*; import java.util.stream.Stream; +import lombok.*; @Getter @AllArgsConstructor diff --git a/src/main/java/emu/grasscutter/game/props/CampTargetType.java b/src/main/java/emu/grasscutter/game/props/CampTargetType.java index e1da596a6..a1076a0ae 100644 --- a/src/main/java/emu/grasscutter/game/props/CampTargetType.java +++ b/src/main/java/emu/grasscutter/game/props/CampTargetType.java @@ -2,7 +2,6 @@ package emu.grasscutter.game.props; import emu.grasscutter.scripts.constants.IntValueEnum; import it.unimi.dsi.fastutil.ints.*; - import java.util.*; import java.util.stream.Stream; diff --git a/src/main/java/emu/grasscutter/game/props/ClimateType.java b/src/main/java/emu/grasscutter/game/props/ClimateType.java index 4160a3e3e..71a7c28e4 100644 --- a/src/main/java/emu/grasscutter/game/props/ClimateType.java +++ b/src/main/java/emu/grasscutter/game/props/ClimateType.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; - import java.util.*; import java.util.stream.Stream; diff --git a/src/main/java/emu/grasscutter/game/props/ElementType.java b/src/main/java/emu/grasscutter/game/props/ElementType.java index 3be848bec..9ef59130c 100644 --- a/src/main/java/emu/grasscutter/game/props/ElementType.java +++ b/src/main/java/emu/grasscutter/game/props/ElementType.java @@ -3,16 +3,12 @@ package emu.grasscutter.game.props; import emu.grasscutter.scripts.constants.IntValueEnum; import emu.grasscutter.utils.Utils; import it.unimi.dsi.fastutil.ints.*; -import lombok.Getter; - import java.util.*; import java.util.stream.Stream; +import lombok.Getter; public enum ElementType implements IntValueEnum { - None( - 0, - FightProperty.FIGHT_PROP_CUR_WIND_ENERGY, - FightProperty.FIGHT_PROP_MAX_WIND_ENERGY), + None(0, FightProperty.FIGHT_PROP_CUR_WIND_ENERGY, FightProperty.FIGHT_PROP_MAX_WIND_ENERGY), Fire( 1, FightProperty.FIGHT_PROP_CUR_FIRE_ENERGY, diff --git a/src/main/java/emu/grasscutter/game/props/EnterReason.java b/src/main/java/emu/grasscutter/game/props/EnterReason.java index 85d5c6014..7ef342e86 100644 --- a/src/main/java/emu/grasscutter/game/props/EnterReason.java +++ b/src/main/java/emu/grasscutter/game/props/EnterReason.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; - import java.util.*; import java.util.stream.Stream; diff --git a/src/main/java/emu/grasscutter/game/props/EntityType.java b/src/main/java/emu/grasscutter/game/props/EntityType.java index 9b4071048..7d074b841 100644 --- a/src/main/java/emu/grasscutter/game/props/EntityType.java +++ b/src/main/java/emu/grasscutter/game/props/EntityType.java @@ -2,7 +2,6 @@ package emu.grasscutter.game.props; import emu.grasscutter.scripts.constants.IntValueEnum; import it.unimi.dsi.fastutil.ints.*; - import java.util.*; import java.util.stream.Stream; diff --git a/src/main/java/emu/grasscutter/game/props/FetterState.java b/src/main/java/emu/grasscutter/game/props/FetterState.java index 1b36b0a34..aac46461d 100644 --- a/src/main/java/emu/grasscutter/game/props/FetterState.java +++ b/src/main/java/emu/grasscutter/game/props/FetterState.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; - import java.util.*; import java.util.stream.Stream; diff --git a/src/main/java/emu/grasscutter/game/props/FightProperty.java b/src/main/java/emu/grasscutter/game/props/FightProperty.java index 50c9ad611..f94bc78a5 100644 --- a/src/main/java/emu/grasscutter/game/props/FightProperty.java +++ b/src/main/java/emu/grasscutter/game/props/FightProperty.java @@ -1,13 +1,12 @@ package emu.grasscutter.game.props; -import it.unimi.dsi.fastutil.ints.*; -import lombok.Getter; +import static java.util.Map.entry; +import it.unimi.dsi.fastutil.ints.*; import java.util.*; import java.util.function.Consumer; import java.util.stream.Stream; - -import static java.util.Map.entry; +import lombok.Getter; public enum FightProperty { FIGHT_PROP_NONE(0), diff --git a/src/main/java/emu/grasscutter/game/props/GrowCurve.java b/src/main/java/emu/grasscutter/game/props/GrowCurve.java index 5d4977a50..2ec0db35d 100644 --- a/src/main/java/emu/grasscutter/game/props/GrowCurve.java +++ b/src/main/java/emu/grasscutter/game/props/GrowCurve.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; - import java.util.*; import java.util.stream.Stream; diff --git a/src/main/java/emu/grasscutter/game/props/ItemUseAction/ItemUseGainAvatar.java b/src/main/java/emu/grasscutter/game/props/ItemUseAction/ItemUseGainAvatar.java index 174f04075..1dae2822d 100644 --- a/src/main/java/emu/grasscutter/game/props/ItemUseAction/ItemUseGainAvatar.java +++ b/src/main/java/emu/grasscutter/game/props/ItemUseAction/ItemUseGainAvatar.java @@ -3,7 +3,6 @@ package emu.grasscutter.game.props.ItemUseAction; import emu.grasscutter.game.avatar.Avatar; import emu.grasscutter.game.props.ItemUseOp; import emu.grasscutter.game.systems.InventorySystem; - import java.util.Optional; public class ItemUseGainAvatar extends ItemUseInt { diff --git a/src/main/java/emu/grasscutter/game/props/ItemUseOp.java b/src/main/java/emu/grasscutter/game/props/ItemUseOp.java index 564d0af7f..7ff42db0b 100644 --- a/src/main/java/emu/grasscutter/game/props/ItemUseOp.java +++ b/src/main/java/emu/grasscutter/game/props/ItemUseOp.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; - import java.util.stream.Stream; public enum ItemUseOp { diff --git a/src/main/java/emu/grasscutter/game/props/ItemUseTarget.java b/src/main/java/emu/grasscutter/game/props/ItemUseTarget.java index 10dd42523..99641d085 100644 --- a/src/main/java/emu/grasscutter/game/props/ItemUseTarget.java +++ b/src/main/java/emu/grasscutter/game/props/ItemUseTarget.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; - import java.util.stream.Stream; public enum ItemUseTarget { diff --git a/src/main/java/emu/grasscutter/game/props/LifeState.java b/src/main/java/emu/grasscutter/game/props/LifeState.java index 9503c31e6..1785b2faf 100644 --- a/src/main/java/emu/grasscutter/game/props/LifeState.java +++ b/src/main/java/emu/grasscutter/game/props/LifeState.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; - import java.util.*; import java.util.stream.Stream; diff --git a/src/main/java/emu/grasscutter/game/props/MonsterType.java b/src/main/java/emu/grasscutter/game/props/MonsterType.java index fe6cb948f..69558ee83 100644 --- a/src/main/java/emu/grasscutter/game/props/MonsterType.java +++ b/src/main/java/emu/grasscutter/game/props/MonsterType.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; - import java.util.*; import java.util.stream.Stream; diff --git a/src/main/java/emu/grasscutter/game/props/PlayerProperty.java b/src/main/java/emu/grasscutter/game/props/PlayerProperty.java index 0f41f41c8..4c5995873 100644 --- a/src/main/java/emu/grasscutter/game/props/PlayerProperty.java +++ b/src/main/java/emu/grasscutter/game/props/PlayerProperty.java @@ -1,9 +1,8 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; -import lombok.Getter; - import java.util.stream.Stream; +import lombok.Getter; public enum PlayerProperty { PROP_NONE(0), diff --git a/src/main/java/emu/grasscutter/game/props/RefreshType.java b/src/main/java/emu/grasscutter/game/props/RefreshType.java index 17e1acaae..8f1baa132 100644 --- a/src/main/java/emu/grasscutter/game/props/RefreshType.java +++ b/src/main/java/emu/grasscutter/game/props/RefreshType.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; - import java.util.*; import java.util.stream.Stream; diff --git a/src/main/java/emu/grasscutter/game/props/SceneType.java b/src/main/java/emu/grasscutter/game/props/SceneType.java index 6023e41d7..09bd084b3 100644 --- a/src/main/java/emu/grasscutter/game/props/SceneType.java +++ b/src/main/java/emu/grasscutter/game/props/SceneType.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; - import java.util.*; import java.util.stream.Stream; diff --git a/src/main/java/emu/grasscutter/game/props/ServerBuffType.java b/src/main/java/emu/grasscutter/game/props/ServerBuffType.java index 6aa9f66c9..b9a082590 100644 --- a/src/main/java/emu/grasscutter/game/props/ServerBuffType.java +++ b/src/main/java/emu/grasscutter/game/props/ServerBuffType.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; - import java.util.stream.Stream; public enum ServerBuffType { diff --git a/src/main/java/emu/grasscutter/game/props/WatcherTriggerType.java b/src/main/java/emu/grasscutter/game/props/WatcherTriggerType.java index 7f60f84fd..98ae0a3c3 100644 --- a/src/main/java/emu/grasscutter/game/props/WatcherTriggerType.java +++ b/src/main/java/emu/grasscutter/game/props/WatcherTriggerType.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; - import java.util.*; import java.util.stream.Stream; diff --git a/src/main/java/emu/grasscutter/game/props/WeaponType.java b/src/main/java/emu/grasscutter/game/props/WeaponType.java index 4a5227cb1..5d1b9640d 100644 --- a/src/main/java/emu/grasscutter/game/props/WeaponType.java +++ b/src/main/java/emu/grasscutter/game/props/WeaponType.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; - import java.util.*; import java.util.stream.Stream; diff --git a/src/main/java/emu/grasscutter/game/quest/GameMainQuest.java b/src/main/java/emu/grasscutter/game/quest/GameMainQuest.java index 1cd3d95f7..d2ddc7af3 100644 --- a/src/main/java/emu/grasscutter/game/quest/GameMainQuest.java +++ b/src/main/java/emu/grasscutter/game/quest/GameMainQuest.java @@ -16,11 +16,10 @@ import emu.grasscutter.net.proto.ChildQuestOuterClass.ChildQuest; import emu.grasscutter.net.proto.ParentQuestOuterClass.ParentQuest; import emu.grasscutter.server.packet.send.*; import emu.grasscutter.utils.*; -import lombok.*; -import org.bson.types.ObjectId; - import java.util.*; import java.util.stream.Collectors; +import lombok.*; +import org.bson.types.ObjectId; @Entity(value = "quests", useDiscriminator = false) public class GameMainQuest { diff --git a/src/main/java/emu/grasscutter/game/quest/GameQuest.java b/src/main/java/emu/grasscutter/game/quest/GameQuest.java index 2cf59fd2e..c62b3c0ef 100644 --- a/src/main/java/emu/grasscutter/game/quest/GameQuest.java +++ b/src/main/java/emu/grasscutter/game/quest/GameQuest.java @@ -16,10 +16,9 @@ import emu.grasscutter.server.event.player.PlayerCompleteQuestEvent; import emu.grasscutter.server.packet.send.*; import emu.grasscutter.utils.Utils; import it.unimi.dsi.fastutil.ints.IntIntImmutablePair; -import lombok.*; - -import javax.script.Bindings; import java.util.*; +import javax.script.Bindings; +import lombok.*; @Entity public class GameQuest { diff --git a/src/main/java/emu/grasscutter/game/quest/ItemGiveRecord.java b/src/main/java/emu/grasscutter/game/quest/ItemGiveRecord.java index 05146b62e..4e1770030 100644 --- a/src/main/java/emu/grasscutter/game/quest/ItemGiveRecord.java +++ b/src/main/java/emu/grasscutter/game/quest/ItemGiveRecord.java @@ -4,9 +4,8 @@ import dev.morphia.annotations.Entity; import emu.grasscutter.data.GameData; import emu.grasscutter.data.excels.giving.GivingData.GiveMethod; import emu.grasscutter.net.proto.GivingRecordOuterClass.GivingRecord; -import lombok.*; - import java.util.*; +import lombok.*; @Data @Entity diff --git a/src/main/java/emu/grasscutter/game/quest/QuestManager.java b/src/main/java/emu/grasscutter/game/quest/QuestManager.java index 53acadb24..9817227ba 100644 --- a/src/main/java/emu/grasscutter/game/quest/QuestManager.java +++ b/src/main/java/emu/grasscutter/game/quest/QuestManager.java @@ -1,5 +1,8 @@ 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.*; @@ -12,16 +15,12 @@ import emu.grasscutter.net.proto.GivingRecordOuterClass.GivingRecord; 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 static emu.grasscutter.GameConstants.DEBUG; -import static emu.grasscutter.config.Configuration.*; +import javax.annotation.Nonnull; +import lombok.*; public final class QuestManager extends BasePlayerManager { @Getter private final Player player; diff --git a/src/main/java/emu/grasscutter/game/quest/QuestSystem.java b/src/main/java/emu/grasscutter/game/quest/QuestSystem.java index 48093add4..09bb54913 100644 --- a/src/main/java/emu/grasscutter/game/quest/QuestSystem.java +++ b/src/main/java/emu/grasscutter/game/quest/QuestSystem.java @@ -26,12 +26,9 @@ public final class QuestSystem extends BaseGameSystem { } public void registerHandlers() { - this.registerHandlers( - this.condHandlers, BaseCondition.class); - this.registerHandlers( - this.contHandlers, BaseContent.class); - this.registerHandlers( - this.execHandlers, QuestExecHandler.class); + this.registerHandlers(this.condHandlers, BaseCondition.class); + this.registerHandlers(this.contHandlers, BaseContent.class); + this.registerHandlers(this.execHandlers, QuestExecHandler.class); } public void registerHandlers(Int2ObjectMap map, Class clazz) { @@ -43,7 +40,8 @@ public final class QuestSystem extends BaseGameSystem { public void registerHandler(Int2ObjectMap map, Class handlerClass) { try { - int value; if (handlerClass.isAnnotationPresent(QuestValueExec.class)) { + int value; + if (handlerClass.isAnnotationPresent(QuestValueExec.class)) { QuestValueExec opcode = handlerClass.getAnnotation(QuestValueExec.class); value = opcode.value().getValue(); } else if (handlerClass.isAnnotationPresent(QuestValueContent.class)) { @@ -62,7 +60,8 @@ public final class QuestSystem extends BaseGameSystem { map.put(value, handlerClass.getDeclaredConstructor().newInstance()); } catch (Exception e) { - Grasscutter.getLogger().warn("Unable to register handler {}.", handlerClass.getSimpleName(), e); + Grasscutter.getLogger() + .warn("Unable to register handler {}.", handlerClass.getSimpleName(), e); } } diff --git a/src/main/java/emu/grasscutter/game/quest/QuestValueCond.java b/src/main/java/emu/grasscutter/game/quest/QuestValueCond.java index a1e1bac82..bcd151661 100644 --- a/src/main/java/emu/grasscutter/game/quest/QuestValueCond.java +++ b/src/main/java/emu/grasscutter/game/quest/QuestValueCond.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.quest; import emu.grasscutter.game.quest.enums.QuestCond; - import java.lang.annotation.*; @Retention(RetentionPolicy.RUNTIME) diff --git a/src/main/java/emu/grasscutter/game/quest/QuestValueContent.java b/src/main/java/emu/grasscutter/game/quest/QuestValueContent.java index c9b3dad56..704face9b 100644 --- a/src/main/java/emu/grasscutter/game/quest/QuestValueContent.java +++ b/src/main/java/emu/grasscutter/game/quest/QuestValueContent.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.quest; import emu.grasscutter.game.quest.enums.QuestContent; - import java.lang.annotation.*; @Retention(RetentionPolicy.RUNTIME) diff --git a/src/main/java/emu/grasscutter/game/quest/QuestValueExec.java b/src/main/java/emu/grasscutter/game/quest/QuestValueExec.java index 9011537e0..7bbe4ace6 100644 --- a/src/main/java/emu/grasscutter/game/quest/QuestValueExec.java +++ b/src/main/java/emu/grasscutter/game/quest/QuestValueExec.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.quest; import emu.grasscutter.game.quest.enums.QuestExec; - import java.lang.annotation.*; @Retention(RetentionPolicy.RUNTIME) diff --git a/src/main/java/emu/grasscutter/game/quest/RewindData.java b/src/main/java/emu/grasscutter/game/quest/RewindData.java index e49b4acce..d17ee1876 100644 --- a/src/main/java/emu/grasscutter/game/quest/RewindData.java +++ b/src/main/java/emu/grasscutter/game/quest/RewindData.java @@ -1,8 +1,7 @@ package emu.grasscutter.game.quest; -import lombok.*; - import java.util.List; +import lombok.*; @Data public class RewindData { diff --git a/src/main/java/emu/grasscutter/game/quest/TeleportData.java b/src/main/java/emu/grasscutter/game/quest/TeleportData.java index 8818ad4f2..83c143f5c 100644 --- a/src/main/java/emu/grasscutter/game/quest/TeleportData.java +++ b/src/main/java/emu/grasscutter/game/quest/TeleportData.java @@ -1,8 +1,7 @@ package emu.grasscutter.game.quest; -import lombok.Data; - import java.util.List; +import lombok.Data; @Data public class TeleportData { diff --git a/src/main/java/emu/grasscutter/game/quest/conditions/BaseCondition.java b/src/main/java/emu/grasscutter/game/quest/conditions/BaseCondition.java index 513c3016e..e53c4cc0e 100644 --- a/src/main/java/emu/grasscutter/game/quest/conditions/BaseCondition.java +++ b/src/main/java/emu/grasscutter/game/quest/conditions/BaseCondition.java @@ -1,11 +1,11 @@ package emu.grasscutter.game.quest.conditions; +import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_UNKNOWN; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.quest.QuestValueCond; -import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_UNKNOWN; - @QuestValueCond(QUEST_COND_UNKNOWN) public class BaseCondition { diff --git a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionActivityCond.java b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionActivityCond.java index 0eac48945..8a62b4fc4 100644 --- a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionActivityCond.java +++ b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionActivityCond.java @@ -1,12 +1,12 @@ package emu.grasscutter.game.quest.conditions; +import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_ACTIVITY_COND; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.quest.QuestValueCond; import lombok.val; -import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_ACTIVITY_COND; - @QuestValueCond(QUEST_COND_ACTIVITY_COND) public class ConditionActivityCond extends BaseCondition { diff --git a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionActivityEnd.java b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionActivityEnd.java index 8e5a107e0..4aa25ec02 100644 --- a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionActivityEnd.java +++ b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionActivityEnd.java @@ -1,12 +1,12 @@ package emu.grasscutter.game.quest.conditions; +import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_ACTIVITY_END; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.quest.QuestValueCond; import lombok.val; -import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_ACTIVITY_END; - @QuestValueCond(QUEST_COND_ACTIVITY_END) public class ConditionActivityEnd extends BaseCondition { diff --git a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionActivityOpen.java b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionActivityOpen.java index 4686f783c..9ebe7993f 100644 --- a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionActivityOpen.java +++ b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionActivityOpen.java @@ -1,12 +1,12 @@ package emu.grasscutter.game.quest.conditions; +import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_ACTIVITY_OPEN; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.quest.QuestValueCond; import lombok.val; -import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_ACTIVITY_OPEN; - @QuestValueCond(QUEST_COND_ACTIVITY_OPEN) public class ConditionActivityOpen extends BaseCondition { diff --git a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionCompleteTalk.java b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionCompleteTalk.java index 8fcdd8ca1..c9c03ad31 100644 --- a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionCompleteTalk.java +++ b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionCompleteTalk.java @@ -1,12 +1,12 @@ package emu.grasscutter.game.quest.conditions; +import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_COMPLETE_TALK; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.quest.QuestValueCond; import lombok.val; -import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_COMPLETE_TALK; - @QuestValueCond(QUEST_COND_COMPLETE_TALK) public class ConditionCompleteTalk extends BaseCondition { diff --git a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionItemNumLessThan.java b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionItemNumLessThan.java index 0ac694d85..8ea52cf76 100644 --- a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionItemNumLessThan.java +++ b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionItemNumLessThan.java @@ -1,12 +1,12 @@ package emu.grasscutter.game.quest.conditions; +import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_ITEM_NUM_LESS_THAN; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.quest.QuestValueCond; import lombok.val; -import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_ITEM_NUM_LESS_THAN; - @QuestValueCond(QUEST_COND_ITEM_NUM_LESS_THAN) public class ConditionItemNumLessThan extends BaseCondition { diff --git a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionLuaNotify.java b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionLuaNotify.java index c704c6f5b..ffea10f7a 100644 --- a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionLuaNotify.java +++ b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionLuaNotify.java @@ -1,12 +1,12 @@ package emu.grasscutter.game.quest.conditions; +import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_LUA_NOTIFY; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.quest.QuestValueCond; import lombok.val; -import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_LUA_NOTIFY; - @QuestValueCond(QUEST_COND_LUA_NOTIFY) public class ConditionLuaNotify extends BaseCondition { diff --git a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionPackHaveItem.java b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionPackHaveItem.java index 667cd7855..14bf7c662 100644 --- a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionPackHaveItem.java +++ b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionPackHaveItem.java @@ -1,12 +1,12 @@ package emu.grasscutter.game.quest.conditions; +import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_PACK_HAVE_ITEM; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.quest.QuestValueCond; import lombok.val; -import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_PACK_HAVE_ITEM; - @QuestValueCond(QUEST_COND_PACK_HAVE_ITEM) public class ConditionPackHaveItem extends BaseCondition { diff --git a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionPlayerLevelEqualGreater.java b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionPlayerLevelEqualGreater.java index 1df185b84..a909f13fe 100644 --- a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionPlayerLevelEqualGreater.java +++ b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionPlayerLevelEqualGreater.java @@ -1,12 +1,12 @@ package emu.grasscutter.game.quest.conditions; +import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_PLAYER_LEVEL_EQUAL_GREATER; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.quest.QuestValueCond; import lombok.val; -import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_PLAYER_LEVEL_EQUAL_GREATER; - @QuestValueCond(QUEST_COND_PLAYER_LEVEL_EQUAL_GREATER) public class ConditionPlayerLevelEqualGreater extends BaseCondition { diff --git a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestGlobalVarEqual.java b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestGlobalVarEqual.java index 52382a3ca..d9808a6a6 100644 --- a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestGlobalVarEqual.java +++ b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestGlobalVarEqual.java @@ -1,13 +1,13 @@ package emu.grasscutter.game.quest.conditions; +import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_QUEST_GLOBAL_VAR_EQUAL; + import emu.grasscutter.Grasscutter; import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.quest.QuestValueCond; import lombok.val; -import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_QUEST_GLOBAL_VAR_EQUAL; - @QuestValueCond(QUEST_COND_QUEST_GLOBAL_VAR_EQUAL) public class ConditionQuestGlobalVarEqual extends BaseCondition { diff --git a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestGlobalVarGreater.java b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestGlobalVarGreater.java index 1d9415da9..9f846c00a 100644 --- a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestGlobalVarGreater.java +++ b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestGlobalVarGreater.java @@ -1,13 +1,13 @@ package emu.grasscutter.game.quest.conditions; +import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_QUEST_GLOBAL_VAR_GREATER; + import emu.grasscutter.Grasscutter; import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.quest.QuestValueCond; import lombok.val; -import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_QUEST_GLOBAL_VAR_GREATER; - @QuestValueCond(QUEST_COND_QUEST_GLOBAL_VAR_GREATER) public class ConditionQuestGlobalVarGreater extends BaseCondition { diff --git a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestGlobalVarLess.java b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestGlobalVarLess.java index 571dab8be..f711ad31d 100644 --- a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestGlobalVarLess.java +++ b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestGlobalVarLess.java @@ -1,13 +1,13 @@ package emu.grasscutter.game.quest.conditions; +import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_QUEST_GLOBAL_VAR_LESS; + import emu.grasscutter.Grasscutter; import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.quest.QuestValueCond; import lombok.val; -import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_QUEST_GLOBAL_VAR_LESS; - @QuestValueCond(QUEST_COND_QUEST_GLOBAL_VAR_LESS) public class ConditionQuestGlobalVarLess extends BaseCondition { diff --git a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestVarEqual.java b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestVarEqual.java index 7f160878f..fcccd5343 100644 --- a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestVarEqual.java +++ b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestVarEqual.java @@ -1,9 +1,9 @@ package emu.grasscutter.game.quest.conditions; -import emu.grasscutter.game.quest.QuestValueCond; - import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_QUEST_VAR_EQUAL; +import emu.grasscutter.game.quest.QuestValueCond; + @QuestValueCond(QUEST_COND_QUEST_VAR_EQUAL) public class ConditionQuestVarEqual extends BaseConditionQuestVar { diff --git a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestVarGreater.java b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestVarGreater.java index dcf283866..3c6da720c 100644 --- a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestVarGreater.java +++ b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestVarGreater.java @@ -1,9 +1,9 @@ package emu.grasscutter.game.quest.conditions; -import emu.grasscutter.game.quest.QuestValueCond; - import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_QUEST_VAR_GREATER; +import emu.grasscutter.game.quest.QuestValueCond; + @QuestValueCond(QUEST_COND_QUEST_VAR_GREATER) public class ConditionQuestVarGreater extends BaseConditionQuestVar { diff --git a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestVarLess.java b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestVarLess.java index b56693709..2f1ba77d1 100644 --- a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestVarLess.java +++ b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionQuestVarLess.java @@ -1,9 +1,9 @@ package emu.grasscutter.game.quest.conditions; -import emu.grasscutter.game.quest.QuestValueCond; - import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_QUEST_VAR_LESS; +import emu.grasscutter.game.quest.QuestValueCond; + @QuestValueCond(QUEST_COND_QUEST_VAR_LESS) public class ConditionQuestVarLess extends BaseConditionQuestVar { diff --git a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionStateEqual.java b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionStateEqual.java index f26ae77f7..76298df0c 100644 --- a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionStateEqual.java +++ b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionStateEqual.java @@ -1,11 +1,11 @@ package emu.grasscutter.game.quest.conditions; +import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_STATE_EQUAL; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.quest.QuestValueCond; -import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_STATE_EQUAL; - @QuestValueCond(QUEST_COND_STATE_EQUAL) public class ConditionStateEqual extends BaseCondition { diff --git a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionStateNotEqual.java b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionStateNotEqual.java index 1f46a4c70..946ef7420 100644 --- a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionStateNotEqual.java +++ b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionStateNotEqual.java @@ -1,11 +1,11 @@ package emu.grasscutter.game.quest.conditions; +import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_STATE_NOT_EQUAL; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.quest.QuestValueCond; -import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_STATE_NOT_EQUAL; - @QuestValueCond(QUEST_COND_STATE_NOT_EQUAL) public class ConditionStateNotEqual extends BaseCondition { diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentAddQuestProgress.java b/src/main/java/emu/grasscutter/game/quest/content/ContentAddQuestProgress.java index 474c2c439..27f6be78b 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentAddQuestProgress.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentAddQuestProgress.java @@ -1,11 +1,11 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_ADD_QUEST_PROGRESS; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; import lombok.val; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_ADD_QUEST_PROGRESS; - @QuestValueContent(QUEST_CONTENT_ADD_QUEST_PROGRESS) public class ContentAddQuestProgress extends BaseContent { diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentAnyManualTransport.java b/src/main/java/emu/grasscutter/game/quest/content/ContentAnyManualTransport.java index 825dd1852..976a31cb8 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentAnyManualTransport.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentAnyManualTransport.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_ANY_MANUAL_TRANSPORT; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_ANY_MANUAL_TRANSPORT; - @QuestValueContent(QUEST_CONTENT_ANY_MANUAL_TRANSPORT) public class ContentAnyManualTransport extends BaseContent { @Override diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentClearGroupMonster.java b/src/main/java/emu/grasscutter/game/quest/content/ContentClearGroupMonster.java index 341d0d094..72ccadbf8 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentClearGroupMonster.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentClearGroupMonster.java @@ -1,11 +1,11 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_CLEAR_GROUP_MONSTER; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; import lombok.val; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_CLEAR_GROUP_MONSTER; - @QuestValueContent(QUEST_CONTENT_CLEAR_GROUP_MONSTER) public class ContentClearGroupMonster extends BaseContent { diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentCompleteAnyTalk.java b/src/main/java/emu/grasscutter/game/quest/content/ContentCompleteAnyTalk.java index f332d9827..6a2b4c23c 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentCompleteAnyTalk.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentCompleteAnyTalk.java @@ -1,12 +1,11 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_COMPLETE_ANY_TALK; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import lombok.val; - import java.util.Arrays; - -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_COMPLETE_ANY_TALK; +import lombok.val; @QuestValueContent(QUEST_CONTENT_COMPLETE_ANY_TALK) public class ContentCompleteAnyTalk extends BaseContent { diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentCompleteTalk.java b/src/main/java/emu/grasscutter/game/quest/content/ContentCompleteTalk.java index 1df8d9997..b93dffc81 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentCompleteTalk.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentCompleteTalk.java @@ -1,11 +1,11 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_COMPLETE_TALK; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; import lombok.val; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_COMPLETE_TALK; - @QuestValueContent(QUEST_CONTENT_COMPLETE_TALK) public class ContentCompleteTalk extends BaseContent { @Override diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentDestroyGadget.java b/src/main/java/emu/grasscutter/game/quest/content/ContentDestroyGadget.java index bbd4cbab7..bb02c2471 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentDestroyGadget.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentDestroyGadget.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_DESTROY_GADGET; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_DESTROY_GADGET; - @QuestValueContent(QUEST_CONTENT_DESTROY_GADGET) public class ContentDestroyGadget extends BaseContent { @Override diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentEnterDungeon.java b/src/main/java/emu/grasscutter/game/quest/content/ContentEnterDungeon.java index 1bd05ba7a..828709331 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentEnterDungeon.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentEnterDungeon.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_ENTER_DUNGEON; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_ENTER_DUNGEON; - @QuestValueContent(QUEST_CONTENT_ENTER_DUNGEON) public class ContentEnterDungeon extends BaseContent { diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentEnterMyWorld.java b/src/main/java/emu/grasscutter/game/quest/content/ContentEnterMyWorld.java index 9d5da840d..38864fc38 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentEnterMyWorld.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentEnterMyWorld.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_ENTER_MY_WORLD; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_ENTER_MY_WORLD; - @QuestValueContent(QUEST_CONTENT_ENTER_MY_WORLD) public class ContentEnterMyWorld extends BaseContent { // params[0] scene ID diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentEnterMyWorldScene.java b/src/main/java/emu/grasscutter/game/quest/content/ContentEnterMyWorldScene.java index 44da340e0..460b3ca94 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentEnterMyWorldScene.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentEnterMyWorldScene.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_ENTER_MY_WORLD_SCENE; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_ENTER_MY_WORLD_SCENE; - @QuestValueContent(QUEST_CONTENT_ENTER_MY_WORLD_SCENE) public class ContentEnterMyWorldScene extends BaseContent { // params[0] scene ID diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentEnterRoom.java b/src/main/java/emu/grasscutter/game/quest/content/ContentEnterRoom.java index 71c98d424..fd53221e2 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentEnterRoom.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentEnterRoom.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_ENTER_ROOM; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_ENTER_ROOM; - @QuestValueContent(QUEST_CONTENT_ENTER_ROOM) public class ContentEnterRoom extends BaseContent { diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentEnterVehicle.java b/src/main/java/emu/grasscutter/game/quest/content/ContentEnterVehicle.java index c95a3f3fa..feb241505 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentEnterVehicle.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentEnterVehicle.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_ENTER_VEHICLE; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_ENTER_VEHICLE; - @QuestValueContent(QUEST_CONTENT_ENTER_VEHICLE) public class ContentEnterVehicle extends BaseContent { @Override diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentFailDungeon.java b/src/main/java/emu/grasscutter/game/quest/content/ContentFailDungeon.java index 93bac6439..04690cfa9 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentFailDungeon.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentFailDungeon.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_FAIL_DUNGEON; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_FAIL_DUNGEON; - @QuestValueContent(QUEST_CONTENT_FAIL_DUNGEON) public class ContentFailDungeon extends BaseContent { diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentFinishDungeon.java b/src/main/java/emu/grasscutter/game/quest/content/ContentFinishDungeon.java index 163d511c3..f44b63a6a 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentFinishDungeon.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentFinishDungeon.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_FINISH_DUNGEON; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_FINISH_DUNGEON; - @QuestValueContent(QUEST_CONTENT_FINISH_DUNGEON) public class ContentFinishDungeon extends BaseContent { // params[0] dungeon ID, params[1] unknown diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentFinishPlot.java b/src/main/java/emu/grasscutter/game/quest/content/ContentFinishPlot.java index 46a5ccf15..0a4139b1e 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentFinishPlot.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentFinishPlot.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_FINISH_PLOT; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_FINISH_PLOT; - @QuestValueContent(QUEST_CONTENT_FINISH_PLOT) public class ContentFinishPlot extends BaseContent { @Override diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentGameTimeTick.java b/src/main/java/emu/grasscutter/game/quest/content/ContentGameTimeTick.java index 5efd4ab2c..7639d9f9c 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentGameTimeTick.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentGameTimeTick.java @@ -1,11 +1,11 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_GAME_TIME_TICK; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; import lombok.val; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_GAME_TIME_TICK; - @QuestValueContent(QUEST_CONTENT_GAME_TIME_TICK) public class ContentGameTimeTick extends BaseContent { @Override diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentInteractGadget.java b/src/main/java/emu/grasscutter/game/quest/content/ContentInteractGadget.java index f8781526d..b074af3f7 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentInteractGadget.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentInteractGadget.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_INTERACT_GADGET; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_INTERACT_GADGET; - @QuestValueContent(QUEST_CONTENT_INTERACT_GADGET) public class ContentInteractGadget extends BaseContent { diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentItemLessThan.java b/src/main/java/emu/grasscutter/game/quest/content/ContentItemLessThan.java index 62ef0e982..bae232a6c 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentItemLessThan.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentItemLessThan.java @@ -1,11 +1,11 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_ITEM_LESS_THAN; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; import lombok.val; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_ITEM_LESS_THAN; - @QuestValueContent(QUEST_CONTENT_ITEM_LESS_THAN) public class ContentItemLessThan extends BaseContent { @Override diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentKillMonster.java b/src/main/java/emu/grasscutter/game/quest/content/ContentKillMonster.java index 8051418bf..570f316ac 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentKillMonster.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentKillMonster.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_KILL_MONSTER; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_KILL_MONSTER; - @QuestValueContent(QUEST_CONTENT_KILL_MONSTER) public class ContentKillMonster extends BaseContent { @Override diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentLeaveScene.java b/src/main/java/emu/grasscutter/game/quest/content/ContentLeaveScene.java index 0f39ec5b3..381f49efe 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentLeaveScene.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentLeaveScene.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_LEAVE_SCENE; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_LEAVE_SCENE; - @QuestValueContent(QUEST_CONTENT_LEAVE_SCENE) public class ContentLeaveScene extends BaseContent { diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentLuaNotify.java b/src/main/java/emu/grasscutter/game/quest/content/ContentLuaNotify.java index 10f6d7209..9e9cb3cd3 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentLuaNotify.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentLuaNotify.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_LUA_NOTIFY; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_LUA_NOTIFY; - @QuestValueContent(QUEST_CONTENT_LUA_NOTIFY) public class ContentLuaNotify extends BaseContent { diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentMonsterDie.java b/src/main/java/emu/grasscutter/game/quest/content/ContentMonsterDie.java index da8ec8f7a..54ae0e578 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentMonsterDie.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentMonsterDie.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_MONSTER_DIE; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_MONSTER_DIE; - @QuestValueContent(QUEST_CONTENT_MONSTER_DIE) public class ContentMonsterDie extends BaseContent { @Override diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentNotFinishPlot.java b/src/main/java/emu/grasscutter/game/quest/content/ContentNotFinishPlot.java index ac30cf745..ba2fafb58 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentNotFinishPlot.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentNotFinishPlot.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_NOT_FINISH_PLOT; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_NOT_FINISH_PLOT; - @QuestValueContent(QUEST_CONTENT_NOT_FINISH_PLOT) public class ContentNotFinishPlot extends BaseContent { @Override diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentObtainItem.java b/src/main/java/emu/grasscutter/game/quest/content/ContentObtainItem.java index d9218b654..09a366672 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentObtainItem.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentObtainItem.java @@ -1,11 +1,11 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_OBTAIN_ITEM; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; import lombok.val; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_OBTAIN_ITEM; - @QuestValueContent(QUEST_CONTENT_OBTAIN_ITEM) public class ContentObtainItem extends BaseContent { @Override diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentPlayerLevelUp.java b/src/main/java/emu/grasscutter/game/quest/content/ContentPlayerLevelUp.java index 93f304cc8..7162b7a2a 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentPlayerLevelUp.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentPlayerLevelUp.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_PLAYER_LEVEL_UP; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_PLAYER_LEVEL_UP; - @QuestValueContent(QUEST_CONTENT_PLAYER_LEVEL_UP) public class ContentPlayerLevelUp extends BaseContent { @Override diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentQuestStateEqual.java b/src/main/java/emu/grasscutter/game/quest/content/ContentQuestStateEqual.java index e3bbf02e0..773fda103 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentQuestStateEqual.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentQuestStateEqual.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_QUEST_STATE_EQUAL; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_QUEST_STATE_EQUAL; - @QuestValueContent(QUEST_CONTENT_QUEST_STATE_EQUAL) public class ContentQuestStateEqual extends BaseContent { diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentQuestStateNotEqual.java b/src/main/java/emu/grasscutter/game/quest/content/ContentQuestStateNotEqual.java index c2f48cd43..ff02ebb17 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentQuestStateNotEqual.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentQuestStateNotEqual.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_QUEST_STATE_NOT_EQUAL; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_QUEST_STATE_NOT_EQUAL; - @QuestValueContent(QUEST_CONTENT_QUEST_STATE_NOT_EQUAL) public class ContentQuestStateNotEqual extends BaseContent { diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentQuestVarEqual.java b/src/main/java/emu/grasscutter/game/quest/content/ContentQuestVarEqual.java index 26cae2f73..cb1449d19 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentQuestVarEqual.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentQuestVarEqual.java @@ -1,11 +1,11 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_QUEST_VAR_EQUAL; + import emu.grasscutter.Grasscutter; import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_QUEST_VAR_EQUAL; - @QuestValueContent(QUEST_CONTENT_QUEST_VAR_EQUAL) public class ContentQuestVarEqual extends BaseContent { diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentQuestVarGreater.java b/src/main/java/emu/grasscutter/game/quest/content/ContentQuestVarGreater.java index 9d01c6681..a9e7f4141 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentQuestVarGreater.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentQuestVarGreater.java @@ -1,11 +1,11 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_QUEST_VAR_GREATER; + import emu.grasscutter.Grasscutter; import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_QUEST_VAR_GREATER; - @QuestValueContent(QUEST_CONTENT_QUEST_VAR_GREATER) public class ContentQuestVarGreater extends BaseContent { diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentQuestVarLess.java b/src/main/java/emu/grasscutter/game/quest/content/ContentQuestVarLess.java index 379cb752d..4bf540be8 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentQuestVarLess.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentQuestVarLess.java @@ -1,11 +1,11 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_QUEST_VAR_LESS; + import emu.grasscutter.Grasscutter; import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_QUEST_VAR_LESS; - @QuestValueContent(QUEST_CONTENT_QUEST_VAR_LESS) public class ContentQuestVarLess extends BaseContent { diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentSkill.java b/src/main/java/emu/grasscutter/game/quest/content/ContentSkill.java index 490e1b353..d762287f2 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentSkill.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentSkill.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_SKILL; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_SKILL; - @QuestValueContent(QUEST_CONTENT_SKILL) public class ContentSkill extends BaseContent { @Override diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentTriggerFire.java b/src/main/java/emu/grasscutter/game/quest/content/ContentTriggerFire.java index 513acc97f..cfbba646e 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentTriggerFire.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentTriggerFire.java @@ -1,11 +1,11 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_TRIGGER_FIRE; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; import lombok.val; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_TRIGGER_FIRE; - @QuestValueContent(QUEST_CONTENT_TRIGGER_FIRE) public class ContentTriggerFire extends BaseContent { @Override diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentUnlockArea.java b/src/main/java/emu/grasscutter/game/quest/content/ContentUnlockArea.java index 50df14e6b..905970f71 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentUnlockArea.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentUnlockArea.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_UNLOCK_AREA; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_UNLOCK_AREA; - @QuestValueContent(QUEST_CONTENT_UNLOCK_AREA) public class ContentUnlockArea extends BaseContent { @Override diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentUnlockTransPoint.java b/src/main/java/emu/grasscutter/game/quest/content/ContentUnlockTransPoint.java index 927e6f08f..95df9e6b1 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentUnlockTransPoint.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentUnlockTransPoint.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_UNLOCK_TRANS_POINT; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_UNLOCK_TRANS_POINT; - @QuestValueContent(QUEST_CONTENT_UNLOCK_TRANS_POINT) public class ContentUnlockTransPoint extends BaseContent { @Override diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentUseItem.java b/src/main/java/emu/grasscutter/game/quest/content/ContentUseItem.java index dfcc74de4..1e3dad3a6 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentUseItem.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentUseItem.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_USE_ITEM; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_USE_ITEM; - @QuestValueContent(QUEST_CONTENT_USE_ITEM) public class ContentUseItem extends BaseContent { @Override diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentWorktopSelect.java b/src/main/java/emu/grasscutter/game/quest/content/ContentWorktopSelect.java index 40e08c200..83e2acdb3 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentWorktopSelect.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentWorktopSelect.java @@ -1,10 +1,10 @@ package emu.grasscutter.game.quest.content; +import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_WORKTOP_SELECT; + import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; -import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_WORKTOP_SELECT; - @QuestValueContent(QUEST_CONTENT_WORKTOP_SELECT) public class ContentWorktopSelect extends BaseContent { @Override diff --git a/src/main/java/emu/grasscutter/game/quest/enums/LogicType.java b/src/main/java/emu/grasscutter/game/quest/enums/LogicType.java index c00652ac6..17d7aac83 100644 --- a/src/main/java/emu/grasscutter/game/quest/enums/LogicType.java +++ b/src/main/java/emu/grasscutter/game/quest/enums/LogicType.java @@ -1,10 +1,9 @@ package emu.grasscutter.game.quest.enums; import emu.grasscutter.Grasscutter; -import org.jetbrains.annotations.NotNull; - import java.util.*; import java.util.function.BooleanSupplier; +import org.jetbrains.annotations.NotNull; public enum LogicType { LOGIC_NONE(0), diff --git a/src/main/java/emu/grasscutter/game/quest/enums/QuestCond.java b/src/main/java/emu/grasscutter/game/quest/enums/QuestCond.java index eb8d2de65..190b313e2 100644 --- a/src/main/java/emu/grasscutter/game/quest/enums/QuestCond.java +++ b/src/main/java/emu/grasscutter/game/quest/enums/QuestCond.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.quest.enums; import it.unimi.dsi.fastutil.ints.*; - import java.util.*; import java.util.stream.Stream; diff --git a/src/main/java/emu/grasscutter/game/quest/enums/QuestContent.java b/src/main/java/emu/grasscutter/game/quest/enums/QuestContent.java index 9a7d791e9..a7e66b874 100644 --- a/src/main/java/emu/grasscutter/game/quest/enums/QuestContent.java +++ b/src/main/java/emu/grasscutter/game/quest/enums/QuestContent.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.quest.enums; import it.unimi.dsi.fastutil.ints.*; - import java.util.*; import java.util.stream.Stream; diff --git a/src/main/java/emu/grasscutter/game/quest/enums/QuestExec.java b/src/main/java/emu/grasscutter/game/quest/enums/QuestExec.java index 6d37a7c9b..31924ca12 100644 --- a/src/main/java/emu/grasscutter/game/quest/enums/QuestExec.java +++ b/src/main/java/emu/grasscutter/game/quest/enums/QuestExec.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.quest.enums; import it.unimi.dsi.fastutil.ints.*; - import java.util.*; import java.util.stream.Stream; diff --git a/src/main/java/emu/grasscutter/game/quest/exec/ExecAddQuestProgress.java b/src/main/java/emu/grasscutter/game/quest/exec/ExecAddQuestProgress.java index 29e19bbf9..9fca6495c 100644 --- a/src/main/java/emu/grasscutter/game/quest/exec/ExecAddQuestProgress.java +++ b/src/main/java/emu/grasscutter/game/quest/exec/ExecAddQuestProgress.java @@ -4,7 +4,6 @@ import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; import emu.grasscutter.game.quest.enums.QuestExec; import emu.grasscutter.game.quest.handlers.QuestExecHandler; - import java.util.Arrays; @QuestValueExec(QuestExec.QUEST_EXEC_ADD_QUEST_PROGRESS) diff --git a/src/main/java/emu/grasscutter/game/quest/exec/ExecSetGameTimeLocked.java b/src/main/java/emu/grasscutter/game/quest/exec/ExecSetGameTimeLocked.java index 65d4d0232..451cdfe22 100644 --- a/src/main/java/emu/grasscutter/game/quest/exec/ExecSetGameTimeLocked.java +++ b/src/main/java/emu/grasscutter/game/quest/exec/ExecSetGameTimeLocked.java @@ -4,7 +4,6 @@ import emu.grasscutter.data.excels.quest.QuestData.QuestExecParam; import emu.grasscutter.game.quest.*; import emu.grasscutter.game.quest.enums.QuestExec; import emu.grasscutter.game.quest.handlers.QuestExecHandler; - import java.util.Objects; @QuestValueExec(QuestExec.QUEST_EXEC_SET_IS_GAME_TIME_LOCKED) diff --git a/src/main/java/emu/grasscutter/game/quest/exec/ExecSetOpenState.java b/src/main/java/emu/grasscutter/game/quest/exec/ExecSetOpenState.java index a8bd72a3f..121e1d51c 100644 --- a/src/main/java/emu/grasscutter/game/quest/exec/ExecSetOpenState.java +++ b/src/main/java/emu/grasscutter/game/quest/exec/ExecSetOpenState.java @@ -4,7 +4,6 @@ import emu.grasscutter.data.excels.quest.QuestData; import emu.grasscutter.game.quest.*; import emu.grasscutter.game.quest.enums.QuestExec; import emu.grasscutter.game.quest.handlers.QuestExecHandler; - import java.util.Arrays; @QuestValueExec(QuestExec.QUEST_EXEC_SET_OPEN_STATE) diff --git a/src/main/java/emu/grasscutter/game/shop/ShopInfo.java b/src/main/java/emu/grasscutter/game/shop/ShopInfo.java index 248983f85..76119984e 100644 --- a/src/main/java/emu/grasscutter/game/shop/ShopInfo.java +++ b/src/main/java/emu/grasscutter/game/shop/ShopInfo.java @@ -2,9 +2,8 @@ package emu.grasscutter.game.shop; import emu.grasscutter.data.common.ItemParamData; import emu.grasscutter.data.excels.ShopGoodsData; -import lombok.*; - import java.util.*; +import lombok.*; public class ShopInfo { @Getter @Setter private int goodsId = 0; diff --git a/src/main/java/emu/grasscutter/game/shop/ShopSystem.java b/src/main/java/emu/grasscutter/game/shop/ShopSystem.java index b05cde2e4..f3ce4679a 100644 --- a/src/main/java/emu/grasscutter/game/shop/ShopSystem.java +++ b/src/main/java/emu/grasscutter/game/shop/ShopSystem.java @@ -1,5 +1,7 @@ package emu.grasscutter.game.shop; +import static emu.grasscutter.config.Configuration.GAME_OPTIONS; + import emu.grasscutter.Grasscutter; import emu.grasscutter.data.*; import emu.grasscutter.data.common.ItemParamData; @@ -7,11 +9,8 @@ import emu.grasscutter.data.excels.ShopGoodsData; import emu.grasscutter.server.game.*; import emu.grasscutter.utils.Utils; import it.unimi.dsi.fastutil.ints.*; - import java.util.*; -import static emu.grasscutter.config.Configuration.GAME_OPTIONS; - public class ShopSystem extends BaseGameSystem { private static final int REFRESH_HOUR = 4; // In GMT+8 server private static final String TIME_ZONE = "Asia/Shanghai"; // GMT+8 Timezone diff --git a/src/main/java/emu/grasscutter/game/systems/AnnouncementSystem.java b/src/main/java/emu/grasscutter/game/systems/AnnouncementSystem.java index 7504d8260..16bf1b23f 100644 --- a/src/main/java/emu/grasscutter/game/systems/AnnouncementSystem.java +++ b/src/main/java/emu/grasscutter/game/systems/AnnouncementSystem.java @@ -8,11 +8,10 @@ import emu.grasscutter.net.proto.AnnounceDataOuterClass; import emu.grasscutter.server.game.*; import emu.grasscutter.server.packet.send.*; import emu.grasscutter.utils.Utils; +import java.util.*; import lombok.*; import lombok.experimental.FieldDefaults; -import java.util.*; - @Getter public class AnnouncementSystem extends BaseGameSystem { private final Map announceConfigItemMap; diff --git a/src/main/java/emu/grasscutter/game/systems/InventorySystem.java b/src/main/java/emu/grasscutter/game/systems/InventorySystem.java index 04f990d82..3072eebab 100644 --- a/src/main/java/emu/grasscutter/game/systems/InventorySystem.java +++ b/src/main/java/emu/grasscutter/game/systems/InventorySystem.java @@ -18,10 +18,9 @@ import emu.grasscutter.server.game.*; import emu.grasscutter.server.packet.send.*; import emu.grasscutter.utils.Utils; import it.unimi.dsi.fastutil.ints.*; -import lombok.val; - import java.util.*; import java.util.stream.Stream; +import lombok.val; public class InventorySystem extends BaseGameSystem { private static final Int2IntMap weaponRefundMaterials = new Int2IntArrayMap(); diff --git a/src/main/java/emu/grasscutter/game/talk/TalkExec.java b/src/main/java/emu/grasscutter/game/talk/TalkExec.java index 7f4583a4d..f6a7aefde 100644 --- a/src/main/java/emu/grasscutter/game/talk/TalkExec.java +++ b/src/main/java/emu/grasscutter/game/talk/TalkExec.java @@ -1,10 +1,9 @@ package emu.grasscutter.game.talk; import it.unimi.dsi.fastutil.ints.*; -import lombok.*; - import java.util.*; import java.util.stream.Stream; +import lombok.*; @AllArgsConstructor public enum TalkExec { diff --git a/src/main/java/emu/grasscutter/game/talk/TalkManager.java b/src/main/java/emu/grasscutter/game/talk/TalkManager.java index c4433439b..175e03ef3 100644 --- a/src/main/java/emu/grasscutter/game/talk/TalkManager.java +++ b/src/main/java/emu/grasscutter/game/talk/TalkManager.java @@ -1,14 +1,14 @@ package emu.grasscutter.game.talk; +import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_COMPLETE_TALK; +import static emu.grasscutter.game.quest.enums.QuestContent.*; + import emu.grasscutter.data.GameData; import emu.grasscutter.data.binout.MainQuestData.TalkData; import emu.grasscutter.game.player.*; import emu.grasscutter.server.event.player.PlayerNpcTalkEvent; import lombok.NonNull; -import static emu.grasscutter.game.quest.enums.QuestCond.QUEST_COND_COMPLETE_TALK; -import static emu.grasscutter.game.quest.enums.QuestContent.*; - public final class TalkManager extends BasePlayerManager { public TalkManager(@NonNull Player player) { super(player); diff --git a/src/main/java/emu/grasscutter/game/tower/TowerData.java b/src/main/java/emu/grasscutter/game/tower/TowerData.java index 43e37b3ae..116243f2f 100644 --- a/src/main/java/emu/grasscutter/game/tower/TowerData.java +++ b/src/main/java/emu/grasscutter/game/tower/TowerData.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.tower; import dev.morphia.annotations.*; - import java.util.Map; @Entity diff --git a/src/main/java/emu/grasscutter/game/tower/TowerLevelRecord.java b/src/main/java/emu/grasscutter/game/tower/TowerLevelRecord.java index ea6739866..8c0dd94a1 100644 --- a/src/main/java/emu/grasscutter/game/tower/TowerLevelRecord.java +++ b/src/main/java/emu/grasscutter/game/tower/TowerLevelRecord.java @@ -1,7 +1,6 @@ package emu.grasscutter.game.tower; import dev.morphia.annotations.Entity; - import java.util.*; @Entity diff --git a/src/main/java/emu/grasscutter/game/tower/TowerManager.java b/src/main/java/emu/grasscutter/game/tower/TowerManager.java index 5f2d32e56..f1b4bbc19 100644 --- a/src/main/java/emu/grasscutter/game/tower/TowerManager.java +++ b/src/main/java/emu/grasscutter/game/tower/TowerManager.java @@ -5,7 +5,6 @@ import emu.grasscutter.data.excels.tower.TowerLevelData; import emu.grasscutter.game.dungeons.*; import emu.grasscutter.game.player.*; import emu.grasscutter.server.packet.send.*; - import java.util.*; public class TowerManager extends BasePlayerManager { diff --git a/src/main/java/emu/grasscutter/game/tower/TowerSystem.java b/src/main/java/emu/grasscutter/game/tower/TowerSystem.java index 7a39cc239..18c1036cd 100644 --- a/src/main/java/emu/grasscutter/game/tower/TowerSystem.java +++ b/src/main/java/emu/grasscutter/game/tower/TowerSystem.java @@ -4,7 +4,6 @@ import emu.grasscutter.Grasscutter; import emu.grasscutter.data.*; import emu.grasscutter.data.excels.tower.TowerScheduleData; import emu.grasscutter.server.game.*; - import java.util.*; public class TowerSystem extends BaseGameSystem { diff --git a/src/main/java/emu/grasscutter/game/world/ChestReward.java b/src/main/java/emu/grasscutter/game/world/ChestReward.java index 24f2afbb0..f071edb6a 100644 --- a/src/main/java/emu/grasscutter/game/world/ChestReward.java +++ b/src/main/java/emu/grasscutter/game/world/ChestReward.java @@ -1,11 +1,10 @@ package emu.grasscutter.game.world; import emu.grasscutter.game.inventory.ItemDef; +import java.util.List; import lombok.*; import lombok.experimental.FieldDefaults; -import java.util.List; - @Data @FieldDefaults(level = AccessLevel.PRIVATE) public class ChestReward { diff --git a/src/main/java/emu/grasscutter/game/world/GridPosition.java b/src/main/java/emu/grasscutter/game/world/GridPosition.java index de6e0cde1..b4a47b43c 100644 --- a/src/main/java/emu/grasscutter/game/world/GridPosition.java +++ b/src/main/java/emu/grasscutter/game/world/GridPosition.java @@ -2,10 +2,9 @@ package emu.grasscutter.game.world; import com.github.davidmoten.rtreemulti.geometry.Point; import dev.morphia.annotations.Entity; -import lombok.*; - import java.io.*; import java.util.List; +import lombok.*; @Entity public final class GridPosition implements Serializable { diff --git a/src/main/java/emu/grasscutter/game/world/GroupReplacementData.java b/src/main/java/emu/grasscutter/game/world/GroupReplacementData.java index b3c56054a..13fd157de 100644 --- a/src/main/java/emu/grasscutter/game/world/GroupReplacementData.java +++ b/src/main/java/emu/grasscutter/game/world/GroupReplacementData.java @@ -1,8 +1,7 @@ package emu.grasscutter.game.world; -import lombok.Data; - import java.util.List; +import lombok.Data; @Data public class GroupReplacementData { diff --git a/src/main/java/emu/grasscutter/game/world/Position.java b/src/main/java/emu/grasscutter/game/world/Position.java index a41f73401..780a6c213 100644 --- a/src/main/java/emu/grasscutter/game/world/Position.java +++ b/src/main/java/emu/grasscutter/game/world/Position.java @@ -5,11 +5,10 @@ import com.google.gson.annotations.SerializedName; import dev.morphia.annotations.Entity; import emu.grasscutter.net.proto.VectorOuterClass.Vector; import emu.grasscutter.utils.Utils; -import lombok.*; -import lombok.experimental.Accessors; - import java.io.Serializable; import java.util.List; +import lombok.*; +import lombok.experimental.Accessors; @Entity @Accessors(chain = true) diff --git a/src/main/java/emu/grasscutter/game/world/Scene.java b/src/main/java/emu/grasscutter/game/world/Scene.java index 9d1cf9635..a42c96a2c 100644 --- a/src/main/java/emu/grasscutter/game/world/Scene.java +++ b/src/main/java/emu/grasscutter/game/world/Scene.java @@ -23,8 +23,8 @@ import emu.grasscutter.game.props.*; import emu.grasscutter.game.quest.QuestGroupSuite; import emu.grasscutter.game.world.data.TeleportProperties; import emu.grasscutter.net.packet.BasePacket; -import emu.grasscutter.net.proto.AttackResultOuterClass.AttackResult; import emu.grasscutter.net.proto.*; +import emu.grasscutter.net.proto.AttackResultOuterClass.AttackResult; import emu.grasscutter.net.proto.VisionTypeOuterClass.VisionType; import emu.grasscutter.scripts.*; import emu.grasscutter.scripts.constants.EventType; @@ -35,12 +35,11 @@ import emu.grasscutter.server.packet.send.*; import emu.grasscutter.server.scheduler.ServerTaskScheduler; import emu.grasscutter.utils.objects.KahnsSort; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; -import lombok.*; - -import javax.annotation.Nullable; import java.util.*; import java.util.concurrent.*; import java.util.stream.Collectors; +import javax.annotation.Nullable; +import lombok.*; public final class Scene { @Getter private final World world; @@ -262,10 +261,10 @@ public final class Scene { // Remove player widget gadgets this.getEntities().values().stream() - .filter(gameEntity -> gameEntity instanceof EntityVehicle) - .map(gameEntity -> (EntityVehicle) gameEntity) - .filter(entityVehicle -> entityVehicle.getOwner().equals(player)) - .forEach(entityVehicle -> this.removeEntity(entityVehicle, VisionType.VISION_TYPE_REMOVE)); + .filter(gameEntity -> gameEntity instanceof EntityVehicle) + .map(gameEntity -> (EntityVehicle) gameEntity) + .filter(entityVehicle -> entityVehicle.getOwner().equals(player)) + .forEach(entityVehicle -> this.removeEntity(entityVehicle, VisionType.VISION_TYPE_REMOVE)); // Deregister scene if not in use if (this.getPlayerCount() <= 0 && !this.dontDestroyWhenEmpty) { diff --git a/src/main/java/emu/grasscutter/game/world/SceneGroupInstance.java b/src/main/java/emu/grasscutter/game/world/SceneGroupInstance.java index 9c79f3f7a..fe443e234 100644 --- a/src/main/java/emu/grasscutter/game/world/SceneGroupInstance.java +++ b/src/main/java/emu/grasscutter/game/world/SceneGroupInstance.java @@ -4,11 +4,10 @@ import dev.morphia.annotations.*; import emu.grasscutter.database.DatabaseHelper; import emu.grasscutter.game.player.Player; import emu.grasscutter.scripts.data.*; -import lombok.*; -import org.bson.types.ObjectId; - import java.util.*; import java.util.concurrent.ConcurrentHashMap; +import lombok.*; +import org.bson.types.ObjectId; @Entity(value = "group_instances", useDiscriminator = false) public final class SceneGroupInstance { diff --git a/src/main/java/emu/grasscutter/game/world/SpawnDataEntry.java b/src/main/java/emu/grasscutter/game/world/SpawnDataEntry.java index 3a9e47ac8..27865e1ae 100644 --- a/src/main/java/emu/grasscutter/game/world/SpawnDataEntry.java +++ b/src/main/java/emu/grasscutter/game/world/SpawnDataEntry.java @@ -1,9 +1,8 @@ package emu.grasscutter.game.world; import emu.grasscutter.data.GameDepot; -import lombok.*; - import java.util.*; +import lombok.*; public class SpawnDataEntry { @Getter @Setter private transient SpawnGroupEntry group; diff --git a/src/main/java/emu/grasscutter/game/world/World.java b/src/main/java/emu/grasscutter/game/world/World.java index c9bd9f0da..c89b0f670 100644 --- a/src/main/java/emu/grasscutter/game/world/World.java +++ b/src/main/java/emu/grasscutter/game/world/World.java @@ -1,5 +1,7 @@ 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.*; @@ -18,13 +20,10 @@ import emu.grasscutter.server.game.GameServer; 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 { @Getter private final GameServer server; @Getter private Player host; @@ -216,21 +215,21 @@ public class World implements Iterable { // Copy main team to multiplayer team if (this.isMultiplayer()) { player - .getTeamManager() - .getMpTeam() - .copyFrom( - player.getTeamManager().getCurrentSinglePlayerTeamInfo(), - player.getTeamManager().getMaxTeamSize()); + .getTeamManager() + .getMpTeam() + .copyFrom( + player.getTeamManager().getCurrentSinglePlayerTeamInfo(), + player.getTeamManager().getMaxTeamSize()); player.getTeamManager().setCurrentCharacterIndex(0); if (player != this.getHost()) { this.broadcastPacket( - new PacketPlayerChatNotify( - player, - 0, - SystemHint.newBuilder() - .setType(SystemHintType.SYSTEM_HINT_TYPE_CHAT_ENTER_WORLD.getNumber()) - .build())); + new PacketPlayerChatNotify( + player, + 0, + SystemHint.newBuilder() + .setType(SystemHintType.SYSTEM_HINT_TYPE_CHAT_ENTER_WORLD.getNumber()) + .build())); } } diff --git a/src/main/java/emu/grasscutter/game/world/WorldDataSystem.java b/src/main/java/emu/grasscutter/game/world/WorldDataSystem.java index 43d7797ed..39bc93717 100644 --- a/src/main/java/emu/grasscutter/game/world/WorldDataSystem.java +++ b/src/main/java/emu/grasscutter/game/world/WorldDataSystem.java @@ -9,10 +9,9 @@ import emu.grasscutter.game.player.Player; import emu.grasscutter.net.proto.InvestigationMonsterOuterClass; import emu.grasscutter.scripts.data.*; import emu.grasscutter.server.game.*; -import org.luaj.vm2.LuaError; - import java.util.*; import java.util.concurrent.ConcurrentHashMap; +import org.luaj.vm2.LuaError; public class WorldDataSystem extends BaseGameSystem { private final Map chestInteractHandlerMap; // chestType-Handler diff --git a/src/main/java/emu/grasscutter/net/packet/BasePacket.java b/src/main/java/emu/grasscutter/net/packet/BasePacket.java index b99b9f52e..ce605f637 100644 --- a/src/main/java/emu/grasscutter/net/packet/BasePacket.java +++ b/src/main/java/emu/grasscutter/net/packet/BasePacket.java @@ -3,7 +3,6 @@ package emu.grasscutter.net.packet; import com.google.protobuf.GeneratedMessageV3; import emu.grasscutter.net.proto.PacketHeadOuterClass.PacketHead; import emu.grasscutter.utils.Crypto; - import java.io.*; public class BasePacket { diff --git a/src/main/java/emu/grasscutter/net/packet/PacketOpcodesUtils.java b/src/main/java/emu/grasscutter/net/packet/PacketOpcodesUtils.java index 25300c122..cedb8990a 100644 --- a/src/main/java/emu/grasscutter/net/packet/PacketOpcodesUtils.java +++ b/src/main/java/emu/grasscutter/net/packet/PacketOpcodesUtils.java @@ -3,7 +3,6 @@ package emu.grasscutter.net.packet; import emu.grasscutter.*; import emu.grasscutter.utils.JsonUtils; import it.unimi.dsi.fastutil.ints.*; - import java.io.*; import java.util.*; import java.util.stream.Collectors; diff --git a/src/main/java/emu/grasscutter/plugin/Plugin.java b/src/main/java/emu/grasscutter/plugin/Plugin.java index 6355a168a..03f14a824 100644 --- a/src/main/java/emu/grasscutter/plugin/Plugin.java +++ b/src/main/java/emu/grasscutter/plugin/Plugin.java @@ -5,11 +5,10 @@ import emu.grasscutter.Grasscutter; import emu.grasscutter.plugin.api.ServerHelper; import emu.grasscutter.server.game.GameServer; import emu.grasscutter.utils.FileUtils; -import lombok.EqualsAndHashCode; -import org.slf4j.*; - import java.io.*; import java.net.URLClassLoader; +import lombok.EqualsAndHashCode; +import org.slf4j.*; /** The base class for all plugins to extend. */ @EqualsAndHashCode diff --git a/src/main/java/emu/grasscutter/plugin/PluginManager.java b/src/main/java/emu/grasscutter/plugin/PluginManager.java index dc7d2e9e8..7b0e3020e 100644 --- a/src/main/java/emu/grasscutter/plugin/PluginManager.java +++ b/src/main/java/emu/grasscutter/plugin/PluginManager.java @@ -1,18 +1,17 @@ package emu.grasscutter.plugin; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.Grasscutter; import emu.grasscutter.server.event.*; import emu.grasscutter.utils.*; -import lombok.*; - -import javax.annotation.Nullable; import java.io.*; import java.lang.reflect.Method; import java.net.*; import java.util.*; import java.util.jar.*; - -import static emu.grasscutter.utils.lang.Language.translate; +import javax.annotation.Nullable; +import lombok.*; /** Manages the server's plugins and the event system. */ public final class PluginManager { diff --git a/src/main/java/emu/grasscutter/plugin/api/ServerHelper.java b/src/main/java/emu/grasscutter/plugin/api/ServerHelper.java index 5b665ec36..67bc2f023 100644 --- a/src/main/java/emu/grasscutter/plugin/api/ServerHelper.java +++ b/src/main/java/emu/grasscutter/plugin/api/ServerHelper.java @@ -7,7 +7,6 @@ import emu.grasscutter.game.player.Player; import emu.grasscutter.server.game.GameServer; import emu.grasscutter.server.http.*; import emu.grasscutter.server.scheduler.ServerTaskScheduler; - import java.util.*; import java.util.stream.Stream; diff --git a/src/main/java/emu/grasscutter/scripts/EntityControllerScriptManager.java b/src/main/java/emu/grasscutter/scripts/EntityControllerScriptManager.java index 05dbf1b50..1e4a84e92 100644 --- a/src/main/java/emu/grasscutter/scripts/EntityControllerScriptManager.java +++ b/src/main/java/emu/grasscutter/scripts/EntityControllerScriptManager.java @@ -1,15 +1,14 @@ package emu.grasscutter.scripts; +import static emu.grasscutter.utils.FileUtils.getScriptPath; + import emu.grasscutter.Grasscutter; import emu.grasscutter.scripts.data.controller.EntityController; -import lombok.val; - import java.io.IOException; import java.nio.file.Files; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; - -import static emu.grasscutter.utils.FileUtils.getScriptPath; +import lombok.val; public class EntityControllerScriptManager { private static final Map gadgetController = new ConcurrentHashMap<>(); diff --git a/src/main/java/emu/grasscutter/scripts/SceneIndexManager.java b/src/main/java/emu/grasscutter/scripts/SceneIndexManager.java index eca62895f..4e33a19b9 100644 --- a/src/main/java/emu/grasscutter/scripts/SceneIndexManager.java +++ b/src/main/java/emu/grasscutter/scripts/SceneIndexManager.java @@ -2,7 +2,6 @@ package emu.grasscutter.scripts; import com.github.davidmoten.rtreemulti.*; import com.github.davidmoten.rtreemulti.geometry.*; - import java.util.*; import java.util.function.Function; diff --git a/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java b/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java index 576a75936..4c461e1e0 100644 --- a/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java +++ b/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java @@ -1,5 +1,7 @@ package emu.grasscutter.scripts; +import static emu.grasscutter.scripts.constants.EventType.EVENT_TIMER_EVENT; + import com.github.davidmoten.rtreemulti.RTree; import com.github.davidmoten.rtreemulti.geometry.Geometry; import emu.grasscutter.Grasscutter; @@ -19,20 +21,17 @@ import emu.grasscutter.server.packet.send.PacketGroupSuiteNotify; import emu.grasscutter.utils.*; import io.netty.util.concurrent.FastThreadLocalThread; import it.unimi.dsi.fastutil.ints.*; -import kotlin.Pair; -import lombok.val; -import org.luaj.vm2.*; -import org.luaj.vm2.lib.jse.CoerceJavaToLua; - -import javax.annotation.*; import java.io.*; import java.nio.file.Files; import java.util.*; import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; - -import static emu.grasscutter.scripts.constants.EventType.EVENT_TIMER_EVENT; +import javax.annotation.*; +import kotlin.Pair; +import lombok.val; +import org.luaj.vm2.*; +import org.luaj.vm2.lib.jse.CoerceJavaToLua; public class SceneScriptManager { private final Scene scene; diff --git a/src/main/java/emu/grasscutter/scripts/SceneTimeAxis.java b/src/main/java/emu/grasscutter/scripts/SceneTimeAxis.java index 6b9e22be3..d43691b48 100644 --- a/src/main/java/emu/grasscutter/scripts/SceneTimeAxis.java +++ b/src/main/java/emu/grasscutter/scripts/SceneTimeAxis.java @@ -2,9 +2,8 @@ package emu.grasscutter.scripts; import emu.grasscutter.scripts.constants.EventType; import emu.grasscutter.scripts.data.ScriptArgs; -import lombok.*; - import java.util.*; +import lombok.*; @Getter @RequiredArgsConstructor diff --git a/src/main/java/emu/grasscutter/scripts/ScriptLoader.java b/src/main/java/emu/grasscutter/scripts/ScriptLoader.java index 67cdb8fa6..c741a408b 100644 --- a/src/main/java/emu/grasscutter/scripts/ScriptLoader.java +++ b/src/main/java/emu/grasscutter/scripts/ScriptLoader.java @@ -9,19 +9,18 @@ import emu.grasscutter.scripts.constants.*; import emu.grasscutter.scripts.data.SceneMeta; import emu.grasscutter.scripts.serializer.*; import emu.grasscutter.utils.FileUtils; -import lombok.Getter; -import org.luaj.vm2.*; -import org.luaj.vm2.lib.OneArgFunction; -import org.luaj.vm2.lib.jse.CoerceJavaToLua; -import org.luaj.vm2.script.*; - -import javax.script.*; import java.io.IOException; import java.lang.ref.SoftReference; import java.nio.file.Files; import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicReference; +import javax.script.*; +import lombok.Getter; +import org.luaj.vm2.*; +import org.luaj.vm2.lib.OneArgFunction; +import org.luaj.vm2.lib.jse.CoerceJavaToLua; +import org.luaj.vm2.script.*; public class ScriptLoader { private static ScriptEngineManager sm; @@ -30,8 +29,8 @@ public class ScriptLoader { @Getter private static ScriptLib scriptLib; @Getter private static LuaValue scriptLibLua; /** suggest GC to remove it if the memory is less */ - private static Map> scriptSources = - new ConcurrentHashMap<>(); + private static Map> scriptSources = new ConcurrentHashMap<>(); + private static Map> scriptsCache = new ConcurrentHashMap<>(); /** sceneId - SceneMeta */ @@ -40,9 +39,7 @@ public class ScriptLoader { private static final AtomicReference currentBindings = new AtomicReference<>(null); private static final AtomicReference currentContext = new AtomicReference<>(null); - /** - * Initializes the script engine. - */ + /** Initializes the script engine. */ public static synchronized void init() throws Exception { if (sm != null) { throw new Exception("Script loader already initialized"); @@ -176,8 +173,7 @@ public class ScriptLoader { */ public static String readScript(String path) { // Check if the path is cached. - var cached = ScriptLoader.tryGet( - ScriptLoader.scriptSources.get(path)); + var cached = ScriptLoader.tryGet(ScriptLoader.scriptSources.get(path)); if (cached.isPresent()) { return cached.get(); } @@ -188,8 +184,7 @@ public class ScriptLoader { try { var source = Files.readString(scriptPath); - ScriptLoader.scriptSources.put( - path, new SoftReference<>(source)); + ScriptLoader.scriptSources.put(path, new SoftReference<>(source)); return source; } catch (IOException exception) { @@ -207,8 +202,7 @@ public class ScriptLoader { */ public static CompiledScript getScript(String path) { // Check if the script is cached. - var sc = ScriptLoader.tryGet( - ScriptLoader.scriptsCache.get(path)); + var sc = ScriptLoader.tryGet(ScriptLoader.scriptsCache.get(path)); if (sc.isPresent()) { return sc.get(); } diff --git a/src/main/java/emu/grasscutter/scripts/ScriptUtils.java b/src/main/java/emu/grasscutter/scripts/ScriptUtils.java index 4e183820d..254ceb56f 100644 --- a/src/main/java/emu/grasscutter/scripts/ScriptUtils.java +++ b/src/main/java/emu/grasscutter/scripts/ScriptUtils.java @@ -2,9 +2,8 @@ package emu.grasscutter.scripts; import emu.grasscutter.Grasscutter; import emu.grasscutter.game.world.Position; -import org.luaj.vm2.*; - import java.util.HashMap; +import org.luaj.vm2.*; public interface ScriptUtils { static HashMap toMap(LuaTable table) { diff --git a/src/main/java/emu/grasscutter/scripts/data/SceneBlock.java b/src/main/java/emu/grasscutter/scripts/data/SceneBlock.java index dc71c4e3a..c135ef020 100644 --- a/src/main/java/emu/grasscutter/scripts/data/SceneBlock.java +++ b/src/main/java/emu/grasscutter/scripts/data/SceneBlock.java @@ -5,11 +5,10 @@ import com.github.davidmoten.rtreemulti.geometry.*; import emu.grasscutter.Grasscutter; import emu.grasscutter.game.world.Position; import emu.grasscutter.scripts.*; -import lombok.*; - -import javax.script.*; import java.util.Map; import java.util.stream.Collectors; +import javax.script.*; +import lombok.*; @ToString @Setter diff --git a/src/main/java/emu/grasscutter/scripts/data/SceneGarbage.java b/src/main/java/emu/grasscutter/scripts/data/SceneGarbage.java index 2229f5d10..62cad91eb 100644 --- a/src/main/java/emu/grasscutter/scripts/data/SceneGarbage.java +++ b/src/main/java/emu/grasscutter/scripts/data/SceneGarbage.java @@ -1,8 +1,7 @@ package emu.grasscutter.scripts.data; -import lombok.*; - import java.util.List; +import lombok.*; @ToString @Setter diff --git a/src/main/java/emu/grasscutter/scripts/data/SceneGroup.java b/src/main/java/emu/grasscutter/scripts/data/SceneGroup.java index 9bb8252f9..9a13a2f5a 100644 --- a/src/main/java/emu/grasscutter/scripts/data/SceneGroup.java +++ b/src/main/java/emu/grasscutter/scripts/data/SceneGroup.java @@ -3,12 +3,11 @@ package emu.grasscutter.scripts.data; import emu.grasscutter.Grasscutter; import emu.grasscutter.game.world.Position; import emu.grasscutter.scripts.ScriptLoader; -import lombok.*; -import org.luaj.vm2.*; - -import javax.script.*; import java.util.*; import java.util.stream.Collectors; +import javax.script.*; +import lombok.*; +import org.luaj.vm2.*; @ToString @Setter diff --git a/src/main/java/emu/grasscutter/scripts/data/SceneMeta.java b/src/main/java/emu/grasscutter/scripts/data/SceneMeta.java index 4377053a2..93038eec2 100644 --- a/src/main/java/emu/grasscutter/scripts/data/SceneMeta.java +++ b/src/main/java/emu/grasscutter/scripts/data/SceneMeta.java @@ -4,11 +4,10 @@ import com.github.davidmoten.rtreemulti.RTree; import com.github.davidmoten.rtreemulti.geometry.Geometry; import emu.grasscutter.Grasscutter; import emu.grasscutter.scripts.*; -import lombok.*; - -import javax.script.*; import java.util.*; import java.util.stream.Collectors; +import javax.script.*; +import lombok.*; @ToString @Setter diff --git a/src/main/java/emu/grasscutter/scripts/data/SceneMonster.java b/src/main/java/emu/grasscutter/scripts/data/SceneMonster.java index c44a1898d..e3f2656fd 100644 --- a/src/main/java/emu/grasscutter/scripts/data/SceneMonster.java +++ b/src/main/java/emu/grasscutter/scripts/data/SceneMonster.java @@ -1,8 +1,7 @@ package emu.grasscutter.scripts.data; -import lombok.*; - import java.util.List; +import lombok.*; @ToString @Setter diff --git a/src/main/java/emu/grasscutter/scripts/data/SceneRegion.java b/src/main/java/emu/grasscutter/scripts/data/SceneRegion.java index 8fe842a33..77706c7ec 100644 --- a/src/main/java/emu/grasscutter/scripts/data/SceneRegion.java +++ b/src/main/java/emu/grasscutter/scripts/data/SceneRegion.java @@ -2,9 +2,8 @@ package emu.grasscutter.scripts.data; import emu.grasscutter.game.world.Position; import emu.grasscutter.scripts.constants.ScriptRegionShape; -import lombok.*; - import java.util.List; +import lombok.*; @Setter @EqualsAndHashCode diff --git a/src/main/java/emu/grasscutter/scripts/data/SceneSuite.java b/src/main/java/emu/grasscutter/scripts/data/SceneSuite.java index 0a4775d61..e9adcdb2e 100644 --- a/src/main/java/emu/grasscutter/scripts/data/SceneSuite.java +++ b/src/main/java/emu/grasscutter/scripts/data/SceneSuite.java @@ -1,8 +1,7 @@ package emu.grasscutter.scripts.data; -import lombok.*; - import java.util.*; +import lombok.*; @ToString @Setter diff --git a/src/main/java/emu/grasscutter/scripts/data/controller/EntityController.java b/src/main/java/emu/grasscutter/scripts/data/controller/EntityController.java index 2473ec76f..82b7c2a65 100644 --- a/src/main/java/emu/grasscutter/scripts/data/controller/EntityController.java +++ b/src/main/java/emu/grasscutter/scripts/data/controller/EntityController.java @@ -4,10 +4,9 @@ import emu.grasscutter.*; import emu.grasscutter.game.entity.GameEntity; import emu.grasscutter.game.props.ElementType; import emu.grasscutter.scripts.*; -import org.luaj.vm2.*; - -import javax.script.*; import java.util.Set; +import javax.script.*; +import org.luaj.vm2.*; public class EntityController { private static final Set SERVER_CALLED = Set.of("OnBeHurt", "OnDie", "OnTimer"); diff --git a/src/main/java/emu/grasscutter/scripts/serializer/LuaSerializer.java b/src/main/java/emu/grasscutter/scripts/serializer/LuaSerializer.java index dcd4f1282..cc7c44556 100644 --- a/src/main/java/emu/grasscutter/scripts/serializer/LuaSerializer.java +++ b/src/main/java/emu/grasscutter/scripts/serializer/LuaSerializer.java @@ -3,15 +3,14 @@ package emu.grasscutter.scripts.serializer; import com.esotericsoftware.reflectasm.*; import emu.grasscutter.Grasscutter; import emu.grasscutter.scripts.ScriptUtils; +import java.lang.reflect.*; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; import lombok.*; import lombok.experimental.FieldDefaults; import org.jetbrains.annotations.Nullable; import org.luaj.vm2.*; -import java.lang.reflect.*; -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; - public class LuaSerializer implements Serializer { private static final Map, MethodAccess> methodAccessCache = new ConcurrentHashMap<>(); diff --git a/src/main/java/emu/grasscutter/scripts/serializer/LuaTableJacksonSerializer.java b/src/main/java/emu/grasscutter/scripts/serializer/LuaTableJacksonSerializer.java index a1f8c6b78..f8458db87 100644 --- a/src/main/java/emu/grasscutter/scripts/serializer/LuaTableJacksonSerializer.java +++ b/src/main/java/emu/grasscutter/scripts/serializer/LuaTableJacksonSerializer.java @@ -7,10 +7,9 @@ import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.databind.type.*; import emu.grasscutter.Grasscutter; -import org.luaj.vm2.*; - import java.io.IOException; import java.util.*; +import org.luaj.vm2.*; public class LuaTableJacksonSerializer extends JsonSerializer implements Serializer { diff --git a/src/main/java/emu/grasscutter/scripts/service/ScriptMonsterSpawnService.java b/src/main/java/emu/grasscutter/scripts/service/ScriptMonsterSpawnService.java index d948167d8..bfed08966 100644 --- a/src/main/java/emu/grasscutter/scripts/service/ScriptMonsterSpawnService.java +++ b/src/main/java/emu/grasscutter/scripts/service/ScriptMonsterSpawnService.java @@ -3,7 +3,6 @@ package emu.grasscutter.scripts.service; import emu.grasscutter.game.entity.EntityMonster; import emu.grasscutter.scripts.SceneScriptManager; import emu.grasscutter.scripts.listener.ScriptMonsterListener; - import java.util.*; public class ScriptMonsterSpawnService { diff --git a/src/main/java/emu/grasscutter/scripts/service/ScriptMonsterTideService.java b/src/main/java/emu/grasscutter/scripts/service/ScriptMonsterTideService.java index e12c447b0..ad784c4a1 100644 --- a/src/main/java/emu/grasscutter/scripts/service/ScriptMonsterTideService.java +++ b/src/main/java/emu/grasscutter/scripts/service/ScriptMonsterTideService.java @@ -5,7 +5,6 @@ import emu.grasscutter.scripts.SceneScriptManager; import emu.grasscutter.scripts.constants.EventType; import emu.grasscutter.scripts.data.*; import emu.grasscutter.scripts.listener.ScriptMonsterListener; - import java.util.List; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicInteger; diff --git a/src/main/java/emu/grasscutter/server/dispatch/DispatchClient.java b/src/main/java/emu/grasscutter/server/dispatch/DispatchClient.java index 72f47718d..80d943ee8 100644 --- a/src/main/java/emu/grasscutter/server/dispatch/DispatchClient.java +++ b/src/main/java/emu/grasscutter/server/dispatch/DispatchClient.java @@ -1,5 +1,7 @@ package emu.grasscutter.server.dispatch; +import static emu.grasscutter.config.Configuration.DISPATCH_INFO; + import com.google.gson.*; import emu.grasscutter.Grasscutter; import emu.grasscutter.database.DatabaseHelper; @@ -8,19 +10,16 @@ import emu.grasscutter.server.game.GameServer; import emu.grasscutter.server.http.handlers.GachaHandler; import emu.grasscutter.utils.*; import emu.grasscutter.utils.objects.HandbookBody; -import lombok.Getter; -import org.java_websocket.WebSocket; -import org.java_websocket.client.WebSocketClient; -import org.java_websocket.handshake.ServerHandshake; -import org.slf4j.Logger; - import java.net.*; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.*; import java.util.function.*; - -import static emu.grasscutter.config.Configuration.DISPATCH_INFO; +import lombok.Getter; +import org.java_websocket.WebSocket; +import org.java_websocket.client.WebSocketClient; +import org.java_websocket.handshake.ServerHandshake; +import org.slf4j.Logger; public final class DispatchClient extends WebSocketClient implements IDispatcher { @Getter private final Logger logger = Grasscutter.getLogger(); diff --git a/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java b/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java index f6182775a..0427ede80 100644 --- a/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java +++ b/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java @@ -1,23 +1,22 @@ package emu.grasscutter.server.dispatch; +import static emu.grasscutter.config.Configuration.DISPATCH_INFO; + import com.google.gson.*; import emu.grasscutter.Grasscutter; import emu.grasscutter.database.DatabaseHelper; import emu.grasscutter.server.event.dispatch.ServerMessageEvent; import emu.grasscutter.utils.Crypto; -import lombok.Getter; -import org.java_websocket.WebSocket; -import org.java_websocket.handshake.ClientHandshake; -import org.java_websocket.server.WebSocketServer; -import org.slf4j.Logger; - import java.net.InetSocketAddress; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.*; import java.util.function.*; - -import static emu.grasscutter.config.Configuration.DISPATCH_INFO; +import lombok.Getter; +import org.java_websocket.WebSocket; +import org.java_websocket.handshake.ClientHandshake; +import org.java_websocket.server.WebSocketServer; +import org.slf4j.Logger; /* Internal communications server. */ public final class DispatchServer extends WebSocketServer implements IDispatcher { diff --git a/src/main/java/emu/grasscutter/server/dispatch/IDispatcher.java b/src/main/java/emu/grasscutter/server/dispatch/IDispatcher.java index 21724f719..0732cfb65 100644 --- a/src/main/java/emu/grasscutter/server/dispatch/IDispatcher.java +++ b/src/main/java/emu/grasscutter/server/dispatch/IDispatcher.java @@ -1,18 +1,17 @@ package emu.grasscutter.server.dispatch; +import static emu.grasscutter.config.Configuration.DISPATCH_INFO; + import com.google.gson.*; import emu.grasscutter.utils.Crypto; import emu.grasscutter.utils.JsonAdapters.ByteArrayAdapter; import emu.grasscutter.utils.objects.JObject; -import org.java_websocket.WebSocket; -import org.slf4j.Logger; - import java.nio.charset.StandardCharsets; import java.util.*; import java.util.concurrent.*; import java.util.function.*; - -import static emu.grasscutter.config.Configuration.DISPATCH_INFO; +import org.java_websocket.WebSocket; +import org.slf4j.Logger; public interface IDispatcher { Gson JSON = diff --git a/src/main/java/emu/grasscutter/server/event/dispatch/ServerMessageEvent.java b/src/main/java/emu/grasscutter/server/event/dispatch/ServerMessageEvent.java index bb55ee966..276929bed 100644 --- a/src/main/java/emu/grasscutter/server/event/dispatch/ServerMessageEvent.java +++ b/src/main/java/emu/grasscutter/server/event/dispatch/ServerMessageEvent.java @@ -3,11 +3,10 @@ package emu.grasscutter.server.event.dispatch; import com.google.gson.*; import emu.grasscutter.server.dispatch.IDispatcher; import emu.grasscutter.server.event.Event; +import java.util.Base64; import lombok.*; import org.java_websocket.WebSocket; -import java.util.Base64; - @Getter @RequiredArgsConstructor public final class ServerMessageEvent extends Event { diff --git a/src/main/java/emu/grasscutter/server/event/entity/EntityCreationEvent.java b/src/main/java/emu/grasscutter/server/event/entity/EntityCreationEvent.java index 9e7318005..c59408fdd 100644 --- a/src/main/java/emu/grasscutter/server/event/entity/EntityCreationEvent.java +++ b/src/main/java/emu/grasscutter/server/event/entity/EntityCreationEvent.java @@ -2,9 +2,8 @@ package emu.grasscutter.server.event.entity; import emu.grasscutter.game.entity.GameEntity; import emu.grasscutter.server.event.Event; -import lombok.*; - import javax.annotation.Nullable; +import lombok.*; /** Invoked when an entity is created. */ @AllArgsConstructor diff --git a/src/main/java/emu/grasscutter/server/event/entity/EntityDamageEvent.java b/src/main/java/emu/grasscutter/server/event/entity/EntityDamageEvent.java index bbe8ceabf..34527941a 100644 --- a/src/main/java/emu/grasscutter/server/event/entity/EntityDamageEvent.java +++ b/src/main/java/emu/grasscutter/server/event/entity/EntityDamageEvent.java @@ -4,9 +4,8 @@ import emu.grasscutter.game.entity.GameEntity; import emu.grasscutter.game.props.ElementType; import emu.grasscutter.server.event.Cancellable; import emu.grasscutter.server.event.types.EntityEvent; -import lombok.*; - import javax.annotation.Nullable; +import lombok.*; public final class EntityDamageEvent extends EntityEvent implements Cancellable { @Getter @Setter private float damage; diff --git a/src/main/java/emu/grasscutter/server/event/entity/EntityDeathEvent.java b/src/main/java/emu/grasscutter/server/event/entity/EntityDeathEvent.java index c7812c21f..2f6c3c1df 100644 --- a/src/main/java/emu/grasscutter/server/event/entity/EntityDeathEvent.java +++ b/src/main/java/emu/grasscutter/server/event/entity/EntityDeathEvent.java @@ -3,9 +3,8 @@ package emu.grasscutter.server.event.entity; import emu.grasscutter.game.entity.GameEntity; import emu.grasscutter.game.world.Location; import emu.grasscutter.server.event.types.EntityEvent; -import lombok.Getter; - import javax.annotation.Nullable; +import lombok.Getter; public final class EntityDeathEvent extends EntityEvent { @Getter private final Location deathLocation; diff --git a/src/main/java/emu/grasscutter/server/event/game/ExecuteCommandEvent.java b/src/main/java/emu/grasscutter/server/event/game/ExecuteCommandEvent.java index bfc3b8245..6b880f3cf 100644 --- a/src/main/java/emu/grasscutter/server/event/game/ExecuteCommandEvent.java +++ b/src/main/java/emu/grasscutter/server/event/game/ExecuteCommandEvent.java @@ -2,9 +2,8 @@ package emu.grasscutter.server.event.game; import emu.grasscutter.game.player.Player; import emu.grasscutter.server.event.*; -import lombok.*; - import javax.annotation.Nullable; +import lombok.*; @Getter @AllArgsConstructor diff --git a/src/main/java/emu/grasscutter/server/event/game/ReceiveCommandFeedbackEvent.java b/src/main/java/emu/grasscutter/server/event/game/ReceiveCommandFeedbackEvent.java index a9b61c31b..b0c14e2f0 100644 --- a/src/main/java/emu/grasscutter/server/event/game/ReceiveCommandFeedbackEvent.java +++ b/src/main/java/emu/grasscutter/server/event/game/ReceiveCommandFeedbackEvent.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.event.game; import emu.grasscutter.game.player.Player; import emu.grasscutter.server.event.Cancellable; import emu.grasscutter.server.event.types.ServerEvent; - import javax.annotation.Nullable; public final class ReceiveCommandFeedbackEvent extends ServerEvent implements Cancellable { diff --git a/src/main/java/emu/grasscutter/server/event/game/ServerTickEvent.java b/src/main/java/emu/grasscutter/server/event/game/ServerTickEvent.java index 1762997de..2c60d9fb6 100644 --- a/src/main/java/emu/grasscutter/server/event/game/ServerTickEvent.java +++ b/src/main/java/emu/grasscutter/server/event/game/ServerTickEvent.java @@ -1,7 +1,6 @@ package emu.grasscutter.server.event.game; import emu.grasscutter.server.event.types.ServerEvent; - import java.time.Instant; public final class ServerTickEvent extends ServerEvent { diff --git a/src/main/java/emu/grasscutter/server/event/internal/ServerStartEvent.java b/src/main/java/emu/grasscutter/server/event/internal/ServerStartEvent.java index 31294d96c..a5e60d7e4 100644 --- a/src/main/java/emu/grasscutter/server/event/internal/ServerStartEvent.java +++ b/src/main/java/emu/grasscutter/server/event/internal/ServerStartEvent.java @@ -1,7 +1,6 @@ package emu.grasscutter.server.event.internal; import emu.grasscutter.server.event.types.ServerEvent; - import java.time.OffsetDateTime; public final class ServerStartEvent extends ServerEvent { diff --git a/src/main/java/emu/grasscutter/server/event/internal/ServerStopEvent.java b/src/main/java/emu/grasscutter/server/event/internal/ServerStopEvent.java index c4e7ca8cf..2fc6bc6a4 100644 --- a/src/main/java/emu/grasscutter/server/event/internal/ServerStopEvent.java +++ b/src/main/java/emu/grasscutter/server/event/internal/ServerStopEvent.java @@ -1,7 +1,6 @@ package emu.grasscutter.server.event.internal; import emu.grasscutter.server.event.types.ServerEvent; - import java.time.OffsetDateTime; public final class ServerStopEvent extends ServerEvent { diff --git a/src/main/java/emu/grasscutter/server/event/player/PlayerChatEvent.java b/src/main/java/emu/grasscutter/server/event/player/PlayerChatEvent.java index 3d4857803..95a44704f 100644 --- a/src/main/java/emu/grasscutter/server/event/player/PlayerChatEvent.java +++ b/src/main/java/emu/grasscutter/server/event/player/PlayerChatEvent.java @@ -3,9 +3,8 @@ package emu.grasscutter.server.event.player; import emu.grasscutter.game.player.Player; import emu.grasscutter.server.event.Cancellable; import emu.grasscutter.server.event.types.PlayerEvent; -import lombok.*; - import javax.annotation.Nullable; +import lombok.*; @Getter @Setter diff --git a/src/main/java/emu/grasscutter/server/event/player/PlayerFinishDungeonEvent.java b/src/main/java/emu/grasscutter/server/event/player/PlayerFinishDungeonEvent.java index afcb75daf..fc1063635 100644 --- a/src/main/java/emu/grasscutter/server/event/player/PlayerFinishDungeonEvent.java +++ b/src/main/java/emu/grasscutter/server/event/player/PlayerFinishDungeonEvent.java @@ -4,9 +4,8 @@ import emu.grasscutter.game.dungeons.DungeonManager; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.world.Scene; import emu.grasscutter.server.event.Event; -import lombok.*; - import java.util.List; +import lombok.*; @Getter @RequiredArgsConstructor diff --git a/src/main/java/emu/grasscutter/server/event/player/PlayerNpcTalkEvent.java b/src/main/java/emu/grasscutter/server/event/player/PlayerNpcTalkEvent.java index efa130df3..18d667df5 100644 --- a/src/main/java/emu/grasscutter/server/event/player/PlayerNpcTalkEvent.java +++ b/src/main/java/emu/grasscutter/server/event/player/PlayerNpcTalkEvent.java @@ -4,9 +4,8 @@ import emu.grasscutter.data.excels.TalkConfigData; import emu.grasscutter.game.player.Player; import emu.grasscutter.server.event.Cancellable; import emu.grasscutter.server.event.types.PlayerEvent; -import lombok.Getter; - import javax.annotation.Nullable; +import lombok.Getter; @Getter public final class PlayerNpcTalkEvent extends PlayerEvent implements Cancellable { diff --git a/src/main/java/emu/grasscutter/server/event/player/PlayerWishEvent.java b/src/main/java/emu/grasscutter/server/event/player/PlayerWishEvent.java index 60871c3ea..02d518b92 100644 --- a/src/main/java/emu/grasscutter/server/event/player/PlayerWishEvent.java +++ b/src/main/java/emu/grasscutter/server/event/player/PlayerWishEvent.java @@ -6,9 +6,8 @@ import emu.grasscutter.game.player.Player; import emu.grasscutter.net.proto.GachaItemOuterClass.GachaItem; import emu.grasscutter.server.event.Cancellable; import emu.grasscutter.server.event.types.PlayerEvent; -import lombok.*; - import java.util.List; +import lombok.*; @Getter public final class PlayerWishEvent extends PlayerEvent implements Cancellable { diff --git a/src/main/java/emu/grasscutter/server/game/GameServer.java b/src/main/java/emu/grasscutter/server/game/GameServer.java index 2f1aeb584..39a3d9880 100644 --- a/src/main/java/emu/grasscutter/server/game/GameServer.java +++ b/src/main/java/emu/grasscutter/server/game/GameServer.java @@ -1,5 +1,8 @@ package emu.grasscutter.server.game; +import static emu.grasscutter.config.Configuration.*; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.*; import emu.grasscutter.Grasscutter.ServerRunMode; import emu.grasscutter.database.DatabaseHelper; @@ -32,17 +35,13 @@ import emu.grasscutter.server.scheduler.ServerTaskScheduler; import emu.grasscutter.task.TaskMap; import emu.grasscutter.utils.Utils; import it.unimi.dsi.fastutil.ints.*; -import kcp.highway.*; -import lombok.*; -import org.jetbrains.annotations.*; - import java.net.*; import java.time.*; import java.util.*; import java.util.concurrent.*; - -import static emu.grasscutter.config.Configuration.*; -import static emu.grasscutter.utils.lang.Language.translate; +import kcp.highway.*; +import lombok.*; +import org.jetbrains.annotations.*; @Getter public final class GameServer extends KcpServer implements Iterable { @@ -207,13 +206,11 @@ public final class GameServer extends KcpServer implements Iterable { getPlayers().put(player.getUid(), player); } - @Nullable - public Player getPlayerByUid(int id) { + @Nullable public Player getPlayerByUid(int id) { return this.getPlayerByUid(id, false); } - @Nullable - public Player getPlayerByUid(int id, boolean allowOfflinePlayers) { + @Nullable public Player getPlayerByUid(int id, boolean allowOfflinePlayers) { // Console check if (id == GameConstants.SERVER_CONSOLE_UID) { return null; @@ -312,7 +309,8 @@ public final class GameServer extends KcpServer implements Iterable { } public HomeWorld getHomeWorldOrCreate(Player owner) { - return this.getHomeWorlds().computeIfAbsent(owner.getUid(), (uid) -> new HomeWorld(this, owner)); + return this.getHomeWorlds() + .computeIfAbsent(owner.getUid(), (uid) -> new HomeWorld(this, owner)); } public void start() { diff --git a/src/main/java/emu/grasscutter/server/game/GameServerPacketHandler.java b/src/main/java/emu/grasscutter/server/game/GameServerPacketHandler.java index 6ffafffb8..6d747797b 100644 --- a/src/main/java/emu/grasscutter/server/game/GameServerPacketHandler.java +++ b/src/main/java/emu/grasscutter/server/game/GameServerPacketHandler.java @@ -1,5 +1,7 @@ package emu.grasscutter.server.game; +import static emu.grasscutter.config.Configuration.GAME_INFO; + import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter.ServerDebugMode; import emu.grasscutter.net.packet.*; @@ -7,8 +9,6 @@ import emu.grasscutter.server.event.game.ReceivePacketEvent; import emu.grasscutter.server.game.GameSession.SessionState; import it.unimi.dsi.fastutil.ints.*; -import static emu.grasscutter.config.Configuration.GAME_INFO; - public final class GameServerPacketHandler { private final Int2ObjectMap handlers; @@ -28,7 +28,8 @@ public final class GameServerPacketHandler { var packetHandler = handlerClass.getDeclaredConstructor().newInstance(); this.handlers.put(opcode.value(), packetHandler); } catch (Exception e) { - Grasscutter.getLogger().warn("Unable to register handler {}.", handlerClass.getSimpleName(), e); + Grasscutter.getLogger() + .warn("Unable to register handler {}.", handlerClass.getSimpleName(), e); } } diff --git a/src/main/java/emu/grasscutter/server/game/GameSession.java b/src/main/java/emu/grasscutter/server/game/GameSession.java index 700483ad6..0cff31cd1 100644 --- a/src/main/java/emu/grasscutter/server/game/GameSession.java +++ b/src/main/java/emu/grasscutter/server/game/GameSession.java @@ -1,5 +1,8 @@ package emu.grasscutter.server.game; +import static emu.grasscutter.config.Configuration.*; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter.ServerDebugMode; import emu.grasscutter.game.Account; @@ -8,14 +11,10 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.server.event.game.SendPacketEvent; import emu.grasscutter.utils.*; import io.netty.buffer.*; -import lombok.*; - import java.io.File; import java.net.InetSocketAddress; import java.nio.file.Path; - -import static emu.grasscutter.config.Configuration.*; -import static emu.grasscutter.utils.lang.Language.translate; +import lombok.*; public class GameSession implements GameSessionManager.KcpChannel { private final GameServer server; diff --git a/src/main/java/emu/grasscutter/server/game/GameSessionManager.java b/src/main/java/emu/grasscutter/server/game/GameSessionManager.java index d529f7579..5c6ef7770 100644 --- a/src/main/java/emu/grasscutter/server/game/GameSessionManager.java +++ b/src/main/java/emu/grasscutter/server/game/GameSessionManager.java @@ -4,11 +4,10 @@ import emu.grasscutter.Grasscutter; import emu.grasscutter.utils.Utils; import io.netty.buffer.*; import io.netty.channel.DefaultEventLoop; -import kcp.highway.*; -import lombok.Getter; - import java.net.InetSocketAddress; import java.util.concurrent.ConcurrentHashMap; +import kcp.highway.*; +import lombok.Getter; public class GameSessionManager { @Getter private static final DefaultEventLoop logicThread = new DefaultEventLoop(); diff --git a/src/main/java/emu/grasscutter/server/http/dispatch/AuthenticationHandler.java b/src/main/java/emu/grasscutter/server/http/dispatch/AuthenticationHandler.java index d72f984b5..718ca08b2 100644 --- a/src/main/java/emu/grasscutter/server/http/dispatch/AuthenticationHandler.java +++ b/src/main/java/emu/grasscutter/server/http/dispatch/AuthenticationHandler.java @@ -1,5 +1,7 @@ package emu.grasscutter.server.http.dispatch; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.Grasscutter; import emu.grasscutter.auth.AuthenticationSystem; import emu.grasscutter.auth.OAuthAuthenticator.ClientType; @@ -10,8 +12,6 @@ import emu.grasscutter.utils.*; import io.javalin.Javalin; import io.javalin.http.Context; -import static emu.grasscutter.utils.lang.Language.translate; - /** Handles requests related to authentication. */ public final class AuthenticationHandler implements Router { /** diff --git a/src/main/java/emu/grasscutter/server/http/dispatch/RegionHandler.java b/src/main/java/emu/grasscutter/server/http/dispatch/RegionHandler.java index abb6492a2..7368ac0c0 100644 --- a/src/main/java/emu/grasscutter/server/http/dispatch/RegionHandler.java +++ b/src/main/java/emu/grasscutter/server/http/dispatch/RegionHandler.java @@ -1,5 +1,7 @@ package emu.grasscutter.server.http.dispatch; +import static emu.grasscutter.config.Configuration.*; + import com.google.gson.*; import com.google.protobuf.ByteString; import emu.grasscutter.*; @@ -16,14 +18,11 @@ import emu.grasscutter.server.http.objects.QueryCurRegionRspJson; 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 static emu.grasscutter.config.Configuration.*; +import org.slf4j.Logger; /** Handles requests related to region queries. */ public final class RegionHandler implements Router { diff --git a/src/main/java/emu/grasscutter/server/http/documentation/GachaMappingRequestHandler.java b/src/main/java/emu/grasscutter/server/http/documentation/GachaMappingRequestHandler.java index fb51a6d94..3a81a9449 100644 --- a/src/main/java/emu/grasscutter/server/http/documentation/GachaMappingRequestHandler.java +++ b/src/main/java/emu/grasscutter/server/http/documentation/GachaMappingRequestHandler.java @@ -1,13 +1,12 @@ package emu.grasscutter.server.http.documentation; +import static emu.grasscutter.config.Configuration.DOCUMENT_LANGUAGE; + import emu.grasscutter.tools.Tools; import emu.grasscutter.utils.lang.Language; import io.javalin.http.*; - import java.util.List; -import static emu.grasscutter.config.Configuration.DOCUMENT_LANGUAGE; - final class GachaMappingRequestHandler implements DocumentationHandler { private final List gachaJsons; diff --git a/src/main/java/emu/grasscutter/server/http/documentation/HandbookHandler.java b/src/main/java/emu/grasscutter/server/http/documentation/HandbookHandler.java index 04a622f95..e4de100e0 100644 --- a/src/main/java/emu/grasscutter/server/http/documentation/HandbookHandler.java +++ b/src/main/java/emu/grasscutter/server/http/documentation/HandbookHandler.java @@ -1,5 +1,7 @@ package emu.grasscutter.server.http.documentation; +import static emu.grasscutter.config.Configuration.HANDBOOK; + import emu.grasscutter.Grasscutter; import emu.grasscutter.auth.AuthenticationSystem.AuthenticationRequest; import emu.grasscutter.server.http.Router; @@ -8,12 +10,9 @@ import emu.grasscutter.utils.objects.*; import emu.grasscutter.utils.objects.HandbookBody.Action; import io.javalin.Javalin; import io.javalin.http.*; - import java.util.*; import java.util.concurrent.*; -import static emu.grasscutter.config.Configuration.HANDBOOK; - /** Handles requests for the new GM Handbook. */ public final class HandbookHandler implements Router { private String handbook; diff --git a/src/main/java/emu/grasscutter/server/http/documentation/RootRequestHandler.java b/src/main/java/emu/grasscutter/server/http/documentation/RootRequestHandler.java index de3d653e9..65b00364d 100644 --- a/src/main/java/emu/grasscutter/server/http/documentation/RootRequestHandler.java +++ b/src/main/java/emu/grasscutter/server/http/documentation/RootRequestHandler.java @@ -1,14 +1,13 @@ package emu.grasscutter.server.http.documentation; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.Grasscutter; import emu.grasscutter.utils.FileUtils; import io.javalin.http.*; - import java.io.IOException; import java.nio.file.Files; -import static emu.grasscutter.utils.lang.Language.translate; - final class RootRequestHandler implements DocumentationHandler { private final String template; diff --git a/src/main/java/emu/grasscutter/server/http/handlers/AnnouncementsHandler.java b/src/main/java/emu/grasscutter/server/http/handlers/AnnouncementsHandler.java index 91e3abd21..edee6909a 100644 --- a/src/main/java/emu/grasscutter/server/http/handlers/AnnouncementsHandler.java +++ b/src/main/java/emu/grasscutter/server/http/handlers/AnnouncementsHandler.java @@ -1,5 +1,7 @@ package emu.grasscutter.server.http.handlers; +import static emu.grasscutter.config.Configuration.*; + import emu.grasscutter.Grasscutter; import emu.grasscutter.data.DataLoader; import emu.grasscutter.server.http.Router; @@ -7,12 +9,9 @@ import emu.grasscutter.server.http.objects.HttpJsonResponse; import emu.grasscutter.utils.FileUtils; import io.javalin.Javalin; import io.javalin.http.*; - import java.io.*; import java.util.*; -import static emu.grasscutter.config.Configuration.*; - /** Handles requests related to the announcements page. */ public final class AnnouncementsHandler implements Router { private static void getAnnouncement(Context ctx) { diff --git a/src/main/java/emu/grasscutter/server/http/handlers/GachaHandler.java b/src/main/java/emu/grasscutter/server/http/handlers/GachaHandler.java index 00ea482ff..512cc4f1e 100644 --- a/src/main/java/emu/grasscutter/server/http/handlers/GachaHandler.java +++ b/src/main/java/emu/grasscutter/server/http/handlers/GachaHandler.java @@ -1,5 +1,7 @@ package emu.grasscutter.server.http.handlers; +import static emu.grasscutter.utils.lang.Language.translate; + import com.google.gson.JsonObject; import emu.grasscutter.Grasscutter; import emu.grasscutter.database.DatabaseHelper; @@ -8,14 +10,11 @@ import emu.grasscutter.server.http.Router; import emu.grasscutter.utils.*; import io.javalin.Javalin; import io.javalin.http.*; -import lombok.Getter; - import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.*; import java.util.*; - -import static emu.grasscutter.utils.lang.Language.translate; +import lombok.Getter; /** Handles all gacha-related HTTP requests. */ public final class GachaHandler implements Router { diff --git a/src/main/java/emu/grasscutter/server/http/handlers/GenericHandler.java b/src/main/java/emu/grasscutter/server/http/handlers/GenericHandler.java index 847f134df..08252cac3 100644 --- a/src/main/java/emu/grasscutter/server/http/handlers/GenericHandler.java +++ b/src/main/java/emu/grasscutter/server/http/handlers/GenericHandler.java @@ -1,13 +1,13 @@ package emu.grasscutter.server.http.handlers; +import static emu.grasscutter.config.Configuration.ACCOUNT; + import emu.grasscutter.*; import emu.grasscutter.server.http.Router; import emu.grasscutter.server.http.objects.*; import io.javalin.Javalin; import io.javalin.http.Context; -import static emu.grasscutter.config.Configuration.ACCOUNT; - /** Handles all generic, hard-coded responses. */ public final class GenericHandler implements Router { private static void serverStatus(Context ctx) { diff --git a/src/main/java/emu/grasscutter/server/http/objects/HttpJsonResponse.java b/src/main/java/emu/grasscutter/server/http/objects/HttpJsonResponse.java index 17c2c477e..2edc529e1 100644 --- a/src/main/java/emu/grasscutter/server/http/objects/HttpJsonResponse.java +++ b/src/main/java/emu/grasscutter/server/http/objects/HttpJsonResponse.java @@ -1,15 +1,14 @@ package emu.grasscutter.server.http.objects; +import static emu.grasscutter.config.Configuration.DISPATCH_INFO; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter.ServerDebugMode; import emu.grasscutter.utils.Utils; import io.javalin.http.*; -import org.jetbrains.annotations.NotNull; - import java.util.*; - -import static emu.grasscutter.config.Configuration.DISPATCH_INFO; -import static emu.grasscutter.utils.lang.Language.translate; +import org.jetbrains.annotations.NotNull; public final class HttpJsonResponse implements Handler { private final String response; diff --git a/src/main/java/emu/grasscutter/server/http/objects/WebStaticVersionResponse.java b/src/main/java/emu/grasscutter/server/http/objects/WebStaticVersionResponse.java index d42d9e3f4..7e65e0b48 100644 --- a/src/main/java/emu/grasscutter/server/http/objects/WebStaticVersionResponse.java +++ b/src/main/java/emu/grasscutter/server/http/objects/WebStaticVersionResponse.java @@ -1,13 +1,12 @@ package emu.grasscutter.server.http.objects; +import static emu.grasscutter.config.Configuration.DISPATCH_INFO; + import emu.grasscutter.Grasscutter; import emu.grasscutter.utils.FileUtils; import io.javalin.http.*; - import java.io.*; -import static emu.grasscutter.config.Configuration.DISPATCH_INFO; - public class WebStaticVersionResponse implements Handler { private static void getPageResources(String path, Context ctx) { diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerActivityTakeWatcherRewardReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerActivityTakeWatcherRewardReq.java index de1d0e800..1706f026f 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerActivityTakeWatcherRewardReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerActivityTakeWatcherRewardReq.java @@ -4,7 +4,6 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.ActivityTakeWatcherRewardReqOuterClass; import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.packet.send.PacketActivityTakeWatcherRewardRsp; - import java.util.Optional; @Opcodes(PacketOpcodes.ActivityTakeWatcherRewardReq) diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerAvatarExpeditionGetRewardReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerAvatarExpeditionGetRewardReq.java index 3220a8372..5d2beea10 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerAvatarExpeditionGetRewardReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerAvatarExpeditionGetRewardReq.java @@ -7,7 +7,6 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.AvatarExpeditionGetRewardReqOuterClass.AvatarExpeditionGetRewardReq; import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.packet.send.*; - import java.util.*; @Opcodes(PacketOpcodes.AvatarExpeditionGetRewardReq) diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerBackMyWorldReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerBackMyWorldReq.java index 1fc38d05b..b6d1f5143 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerBackMyWorldReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerBackMyWorldReq.java @@ -17,7 +17,8 @@ public class HandlerBackMyWorldReq extends PacketHandler { prevScene = 3; } - boolean result = session.getServer().getHomeWorldMPSystem().leaveCoop(session.getPlayer(), prevScene); + boolean result = + session.getServer().getHomeWorldMPSystem().leaveCoop(session.getPlayer(), prevScene); session.send(new PacketBackMyWorldRsp(result ? 0 : RetcodeOuterClass.Retcode.RET_FAIL_VALUE)); } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerBuyGoodsReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerBuyGoodsReq.java index 128476a11..05b0c1941 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerBuyGoodsReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerBuyGoodsReq.java @@ -9,7 +9,6 @@ import emu.grasscutter.net.proto.BuyGoodsReqOuterClass; import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.packet.send.PacketBuyGoodsRsp; import emu.grasscutter.utils.Utils; - import java.util.*; import java.util.stream.Stream; diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerCalcWeaponUpgradeReturnItemsReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerCalcWeaponUpgradeReturnItemsReq.java index 774fae2fd..bc0522acf 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerCalcWeaponUpgradeReturnItemsReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerCalcWeaponUpgradeReturnItemsReq.java @@ -5,7 +5,6 @@ import emu.grasscutter.net.proto.CalcWeaponUpgradeReturnItemsReqOuterClass.CalcW import emu.grasscutter.net.proto.ItemParamOuterClass.ItemParam; import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.packet.send.PacketCalcWeaponUpgradeReturnItemsRsp; - import java.util.List; @Opcodes(PacketOpcodes.CalcWeaponUpgradeReturnItemsReq) diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerChangeMailStarNotify.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerChangeMailStarNotify.java index 4fd1c242c..fb2376310 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerChangeMailStarNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerChangeMailStarNotify.java @@ -5,7 +5,6 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.ChangeMailStarNotifyOuterClass; import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.packet.send.PacketMailChangeNotify; - import java.util.*; @Opcodes(PacketOpcodes.ChangeMailStarNotify) diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerCombatInvocationsNotify.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerCombatInvocationsNotify.java index 4f4df8ee8..6489b140a 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerCombatInvocationsNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerCombatInvocationsNotify.java @@ -50,7 +50,8 @@ public class HandlerCombatInvocationsNotify extends PacketHandler { // Handle movement EntityMoveInfo moveInfo = EntityMoveInfo.parseFrom(entry.getCombatData()); GameEntity entity = session.getPlayer().getScene().getEntityById(moveInfo.getEntityId()); - if (entity != null && session.getPlayer().getSceneLoadState() != Player.SceneLoadState.LOADING) { + if (entity != null + && session.getPlayer().getSceneLoadState() != Player.SceneLoadState.LOADING) { // Move player MotionInfo motionInfo = moveInfo.getMotionInfo(); MotionState motionState = motionInfo.getState(); diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerCombineReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerCombineReq.java index bf32943a5..05d8bd967 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerCombineReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerCombineReq.java @@ -5,7 +5,6 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.*; import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.packet.send.PacketCombineRsp; - import java.util.List; import java.util.stream.Collectors; diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarEnterFocusNotify.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarEnterFocusNotify.java index c92146fa6..1f6a9f87f 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarEnterFocusNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarEnterFocusNotify.java @@ -9,6 +9,12 @@ import emu.grasscutter.server.packet.send.PacketEvtAvatarEnterFocusNotify; public class HandlerEvtAvatarEnterFocusNotify extends PacketHandler { @Override public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { - session.getPlayer().getScene().broadcastPacketToOthers(session.getPlayer(), new PacketEvtAvatarEnterFocusNotify(EvtAvatarEnterFocusNotifyOuterClass.EvtAvatarEnterFocusNotify.parseFrom(payload))); + session + .getPlayer() + .getScene() + .broadcastPacketToOthers( + session.getPlayer(), + new PacketEvtAvatarEnterFocusNotify( + EvtAvatarEnterFocusNotifyOuterClass.EvtAvatarEnterFocusNotify.parseFrom(payload))); } } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarExitFocusNotify.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarExitFocusNotify.java index 8f7cf48a8..b4fb698ac 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarExitFocusNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarExitFocusNotify.java @@ -9,6 +9,12 @@ import emu.grasscutter.server.packet.send.PacketEvtAvatarExitFocusNotify; public class HandlerEvtAvatarExitFocusNotify extends PacketHandler { @Override public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { - session.getPlayer().getScene().broadcastPacketToOthers(session.getPlayer(), new PacketEvtAvatarExitFocusNotify(EvtAvatarExitFocusNotifyOuterClass.EvtAvatarExitFocusNotify.parseFrom(payload))); + session + .getPlayer() + .getScene() + .broadcastPacketToOthers( + session.getPlayer(), + new PacketEvtAvatarExitFocusNotify( + EvtAvatarExitFocusNotifyOuterClass.EvtAvatarExitFocusNotify.parseFrom(payload))); } } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarUpdateFocusNotify.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarUpdateFocusNotify.java index ffc3db7b6..e96a028e1 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarUpdateFocusNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtAvatarUpdateFocusNotify.java @@ -9,6 +9,13 @@ import emu.grasscutter.server.packet.send.PacketEvtAvatarUpdateFocusNotify; public class HandlerEvtAvatarUpdateFocusNotify extends PacketHandler { @Override public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { - session.getPlayer().getScene().broadcastPacketToOthers(session.getPlayer(), new PacketEvtAvatarUpdateFocusNotify(EvtAvatarUpdateFocusNotifyOuterClass.EvtAvatarUpdateFocusNotify.parseFrom(payload))); + session + .getPlayer() + .getScene() + .broadcastPacketToOthers( + session.getPlayer(), + new PacketEvtAvatarUpdateFocusNotify( + EvtAvatarUpdateFocusNotifyOuterClass.EvtAvatarUpdateFocusNotify.parseFrom( + payload))); } } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtBulletDeactiveNotify.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtBulletDeactiveNotify.java index c13768235..349bf58d1 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtBulletDeactiveNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtBulletDeactiveNotify.java @@ -9,6 +9,12 @@ import emu.grasscutter.server.packet.send.PacketEvtBulletDeactiveNotify; public class HandlerEvtBulletDeactiveNotify extends PacketHandler { @Override public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { - session.getPlayer().getScene().broadcastPacketToOthers(session.getPlayer(), new PacketEvtBulletDeactiveNotify(EvtBulletDeactiveNotifyOuterClass.EvtBulletDeactiveNotify.parseFrom(payload))); + session + .getPlayer() + .getScene() + .broadcastPacketToOthers( + session.getPlayer(), + new PacketEvtBulletDeactiveNotify( + EvtBulletDeactiveNotifyOuterClass.EvtBulletDeactiveNotify.parseFrom(payload))); } } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtBulletHitNotify.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtBulletHitNotify.java index e950a0971..510b49176 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtBulletHitNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtBulletHitNotify.java @@ -9,6 +9,12 @@ import emu.grasscutter.server.packet.send.PacketEvtBulletHitNotify; public class HandlerEvtBulletHitNotify extends PacketHandler { @Override public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { - session.getPlayer().getScene().broadcastPacketToOthers(session.getPlayer(), new PacketEvtBulletHitNotify(EvtBulletHitNotifyOuterClass.EvtBulletHitNotify.parseFrom(payload))); + session + .getPlayer() + .getScene() + .broadcastPacketToOthers( + session.getPlayer(), + new PacketEvtBulletHitNotify( + EvtBulletHitNotifyOuterClass.EvtBulletHitNotify.parseFrom(payload))); } } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtBulletMoveNotify.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtBulletMoveNotify.java index fa49a46a7..b7dc71453 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtBulletMoveNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerEvtBulletMoveNotify.java @@ -9,6 +9,12 @@ import emu.grasscutter.server.packet.send.PacketEvtBulletMoveNotify; public class HandlerEvtBulletMoveNotify extends PacketHandler { @Override public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { - session.getPlayer().getScene().broadcastPacketToOthers(session.getPlayer(), new PacketEvtBulletMoveNotify(EvtBulletMoveNotifyOuterClass.EvtBulletMoveNotify.parseFrom(payload))); + session + .getPlayer() + .getScene() + .broadcastPacketToOthers( + session.getPlayer(), + new PacketEvtBulletMoveNotify( + EvtBulletMoveNotifyOuterClass.EvtBulletMoveNotify.parseFrom(payload))); } } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetActivityInfoReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetActivityInfoReq.java index 5329a7310..fdf724d43 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetActivityInfoReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetActivityInfoReq.java @@ -4,7 +4,6 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.GetActivityInfoReqOuterClass; import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.packet.send.PacketGetActivityInfoRsp; - import java.util.HashSet; @Opcodes(PacketOpcodes.GetActivityInfoReq) diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetHomeLevelUpRewardReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetHomeLevelUpRewardReq.java index 04db6e4ac..578fad8ba 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetHomeLevelUpRewardReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetHomeLevelUpRewardReq.java @@ -8,7 +8,6 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.GetHomeLevelUpRewardReqOuterClass.GetHomeLevelUpRewardReq; import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.packet.send.PacketGetHomeLevelUpRewardRsp; - import java.util.*; @Opcodes(PacketOpcodes.GetHomeLevelUpRewardReq) diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetPlayerTokenReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetPlayerTokenReq.java index 7052a0c4a..5f25512fc 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetPlayerTokenReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetPlayerTokenReq.java @@ -1,5 +1,7 @@ package emu.grasscutter.server.packet.recv; +import static emu.grasscutter.config.Configuration.ACCOUNT; + import emu.grasscutter.*; import emu.grasscutter.database.DatabaseHelper; import emu.grasscutter.game.player.Player; @@ -11,12 +13,9 @@ import emu.grasscutter.server.game.GameSession.SessionState; import emu.grasscutter.server.packet.send.PacketGetPlayerTokenRsp; import emu.grasscutter.utils.*; import emu.grasscutter.utils.helpers.ByteHelper; - -import javax.crypto.Cipher; import java.nio.ByteBuffer; import java.security.Signature; - -import static emu.grasscutter.config.Configuration.ACCOUNT; +import javax.crypto.Cipher; @Opcodes(PacketOpcodes.GetPlayerTokenReq) public class HandlerGetPlayerTokenReq extends PacketHandler { diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetUgcReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetUgcReq.java index 62fb5f33c..7102bfa13 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetUgcReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetUgcReq.java @@ -2,8 +2,8 @@ package emu.grasscutter.server.packet.recv; import emu.grasscutter.game.activity.musicgame.MusicGameBeatmap; import emu.grasscutter.net.packet.*; -import emu.grasscutter.net.proto.GetUgcReqOuterClass.GetUgcReq; import emu.grasscutter.net.proto.*; +import emu.grasscutter.net.proto.GetUgcReqOuterClass.GetUgcReq; import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.packet.send.PacketGetUgcRsp; import lombok.val; diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeEditModeReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeEditModeReq.java index 8deaa24b8..b05a64999 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeEditModeReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeEditModeReq.java @@ -13,7 +13,8 @@ public class HandlerHomeChangeEditModeReq extends PacketHandler { var req = HomeChangeEditModeReqOuterClass.HomeChangeEditModeReq.parseFrom(payload); if (req.getIsEnterEditMode() && !session.getPlayer().getCurHomeWorld().getGuests().isEmpty()) { - session.send(new PacketHomeChangeEditModeRsp(RetcodeOuterClass.Retcode.RET_HOME_HAS_GUEST_VALUE)); + session.send( + new PacketHomeChangeEditModeRsp(RetcodeOuterClass.Retcode.RET_HOME_HAS_GUEST_VALUE)); return; } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeGetOnlineStatusReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeGetOnlineStatusReq.java index 81750a880..6188f706b 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeGetOnlineStatusReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeGetOnlineStatusReq.java @@ -8,6 +8,7 @@ import emu.grasscutter.server.packet.send.PacketHomeGetOnlineStatusRsp; public class HandlerHomeGetOnlineStatusReq extends PacketHandler { @Override public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { - session.send(new PacketHomeGetOnlineStatusRsp(session.getPlayer().getCurHomeWorld().getGuests())); + session.send( + new PacketHomeGetOnlineStatusRsp(session.getPlayer().getCurHomeWorld().getGuests())); } } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeKickPlayerReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeKickPlayerReq.java index d323a8a0c..6e80b6fb2 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeKickPlayerReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeKickPlayerReq.java @@ -4,7 +4,6 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.*; import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.packet.send.PacketHomeKickPlayerRsp; - import java.util.concurrent.atomic.AtomicBoolean; @Opcodes(PacketOpcodes.HomeKickPlayerReq) @@ -15,12 +14,19 @@ public class HandlerHomeKickPlayerReq extends PacketHandler { var success = new AtomicBoolean(); session.getPlayer().getCurHomeWorld().getGuests().stream() - .filter(player -> player.getUid() == req.getTargetUid()) - .findFirst() - .ifPresent(player -> { - success.set(session.getServer().getHomeWorldMPSystem().kickPlayerFromHome(session.getPlayer(), player.getUid())); - }); + .filter(player -> player.getUid() == req.getTargetUid()) + .findFirst() + .ifPresent( + player -> { + success.set( + session + .getServer() + .getHomeWorldMPSystem() + .kickPlayerFromHome(session.getPlayer(), player.getUid())); + }); - session.send(new PacketHomeKickPlayerRsp(success.get() ? 0 : RetcodeOuterClass.Retcode.RET_FAIL_VALUE, req)); + session.send( + new PacketHomeKickPlayerRsp( + success.get() ? 0 : RetcodeOuterClass.Retcode.RET_FAIL_VALUE, req)); } } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeSaveArrangementNoChangeReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeSaveArrangementNoChangeReq.java index 35fcec820..dab7235fd 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeSaveArrangementNoChangeReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeSaveArrangementNoChangeReq.java @@ -9,6 +9,10 @@ import emu.grasscutter.server.packet.send.PacketHomeSaveArrangementNoChangeRsp; public class HandlerHomeSaveArrangementNoChangeReq extends PacketHandler { @Override public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { - session.send(new PacketHomeSaveArrangementNoChangeRsp(HomeSaveArrangementNoChangeReqOuterClass.HomeSaveArrangementNoChangeReq.parseFrom(payload).getSceneId())); + session.send( + new PacketHomeSaveArrangementNoChangeRsp( + HomeSaveArrangementNoChangeReqOuterClass.HomeSaveArrangementNoChangeReq.parseFrom( + payload) + .getSceneId())); } } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeSceneInitFinishReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeSceneInitFinishReq.java index b8bc529b0..2932a663b 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeSceneInitFinishReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeSceneInitFinishReq.java @@ -15,8 +15,14 @@ public class HandlerHomeSceneInitFinishReq extends PacketHandler { if (!session.getPlayer().isHasSentInitPacketInHome()) { session.getPlayer().setHasSentInitPacketInHome(true); - if (curHomeWorld.getHost().isOnline() && !curHomeWorld.getHost().equals(session.getPlayer())) { - curHomeWorld.getHost().sendPacket(new PacketOtherPlayerEnterOrLeaveHomeNotify(session.getPlayer(), OtherPlayerEnterHomeNotifyOuterClass.OtherPlayerEnterHomeNotify.Reason.ENTER)); + if (curHomeWorld.getHost().isOnline() + && !curHomeWorld.getHost().equals(session.getPlayer())) { + curHomeWorld + .getHost() + .sendPacket( + new PacketOtherPlayerEnterOrLeaveHomeNotify( + session.getPlayer(), + OtherPlayerEnterHomeNotifyOuterClass.OtherPlayerEnterHomeNotify.Reason.ENTER)); } } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeSceneJumpReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeSceneJumpReq.java index d616b6e4c..d365be12f 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeSceneJumpReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeSceneJumpReq.java @@ -19,7 +19,8 @@ public class HandlerHomeSceneJumpReq extends PacketHandler { var homeScene = home.getHomeSceneItem(realmId); home.save(); - var scene = world.getSceneById(req.getIsEnterRoomScene() ? homeScene.getRoomSceneId() : realmId); + var scene = + world.getSceneById(req.getIsEnterRoomScene() ? homeScene.getRoomSceneId() : realmId); var pos = scene.getScriptManager().getConfig().born_pos; var rot = home.getSceneMap().get(scene.getId()).getBornRot(); @@ -31,7 +32,8 @@ public class HandlerHomeSceneJumpReq extends PacketHandler { pos = home.getSceneMap().get(realmId).getBornPos(); } - world.transferPlayerToScene(session.getPlayer(), req.getIsEnterRoomScene() ? homeScene.getRoomSceneId() : realmId, pos); + world.transferPlayerToScene( + session.getPlayer(), req.getIsEnterRoomScene() ? homeScene.getRoomSceneId() : realmId, pos); session.send(new PacketHomeSceneJumpRsp(req.getIsEnterRoomScene())); } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeTransferReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeTransferReq.java index 7d444138a..89ec4952b 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeTransferReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeTransferReq.java @@ -5,7 +5,6 @@ import emu.grasscutter.game.home.HomeFurnitureItem; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.HomeTransferReqOuterClass; import emu.grasscutter.server.game.GameSession; - import java.util.List; @Opcodes(PacketOpcodes.HomeTransferReq) @@ -18,18 +17,24 @@ public class HandlerHomeTransferReq extends PacketHandler { var item = home.getHomeSceneItem(player.getSceneId()); if (req.getIsTransferToSafePoint()) { - player.getCurHomeWorld().transferPlayerToScene(player, player.getSceneId(), item.getBornPos()); + player + .getCurHomeWorld() + .transferPlayerToScene(player, player.getSceneId(), item.getBornPos()); } else { for (var homeBlockItem : item.getBlockItems().values()) { List items = Lists.newArrayList(); items.addAll(homeBlockItem.getDeployFurnitureList()); items.addAll(homeBlockItem.getPersistentFurnitureList()); items.stream() - .filter(homeFurnitureItem -> homeFurnitureItem.getGuid() == req.getGuid()) - .findFirst() - .ifPresent(homeFurnitureItem -> { - player.getCurHomeWorld().transferPlayerToScene(player, player.getSceneId(), homeFurnitureItem.getSpawnPos()); - }); + .filter(homeFurnitureItem -> homeFurnitureItem.getGuid() == req.getGuid()) + .findFirst() + .ifPresent( + homeFurnitureItem -> { + player + .getCurHomeWorld() + .transferPlayerToScene( + player, player.getSceneId(), homeFurnitureItem.getSpawnPos()); + }); } } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerItemGivingReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerItemGivingReq.java index fc4d0c8be..15b73fcf0 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerItemGivingReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerItemGivingReq.java @@ -8,7 +8,6 @@ import emu.grasscutter.net.proto.ItemGivingReqOuterClass.ItemGivingReq; import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.packet.send.PacketItemGivingRsp; import emu.grasscutter.server.packet.send.PacketItemGivingRsp.Mode; - import java.util.*; @Opcodes(PacketOpcodes.ItemGivingReq) diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerMassiveEntityElementOpBatchNotify.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerMassiveEntityElementOpBatchNotify.java index 70a436f8c..355aec0aa 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerMassiveEntityElementOpBatchNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerMassiveEntityElementOpBatchNotify.java @@ -9,6 +9,13 @@ import emu.grasscutter.server.packet.send.PacketMassiveEntityElementOpBatchNotif public class HandlerMassiveEntityElementOpBatchNotify extends PacketHandler { @Override public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { - session.getPlayer().getScene().broadcastPacketToOthers(session.getPlayer(), new PacketMassiveEntityElementOpBatchNotify(MassiveEntityElementOpBatchNotifyOuterClass.MassiveEntityElementOpBatchNotify.parseFrom(payload))); + session + .getPlayer() + .getScene() + .broadcastPacketToOthers( + session.getPlayer(), + new PacketMassiveEntityElementOpBatchNotify( + MassiveEntityElementOpBatchNotifyOuterClass.MassiveEntityElementOpBatchNotify + .parseFrom(payload))); } } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerPlayerApplyEnterHomeResultReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerPlayerApplyEnterHomeResultReq.java index c5a87dde2..3c3867a99 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerPlayerApplyEnterHomeResultReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerPlayerApplyEnterHomeResultReq.java @@ -9,9 +9,13 @@ import emu.grasscutter.server.packet.send.PacketPlayerApplyEnterHomeResultRsp; public class HandlerPlayerApplyEnterHomeResultReq extends PacketHandler { @Override public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { - var req = PlayerApplyEnterHomeResultReqOuterClass.PlayerApplyEnterHomeResultReq.parseFrom(payload); + var req = + PlayerApplyEnterHomeResultReqOuterClass.PlayerApplyEnterHomeResultReq.parseFrom(payload); - session.getServer().getHomeWorldMPSystem().acceptEnterHomeRequest(session.getPlayer(), req.getApplyUid(), req.getIsAgreed()); + session + .getServer() + .getHomeWorldMPSystem() + .acceptEnterHomeRequest(session.getPlayer(), req.getApplyUid(), req.getIsAgreed()); session.send(new PacketPlayerApplyEnterHomeResultRsp(req.getApplyUid(), req.getIsAgreed())); } } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerQuestTransmitReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerQuestTransmitReq.java index e77b9709c..5424e5695 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerQuestTransmitReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerQuestTransmitReq.java @@ -6,7 +6,6 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.QuestTransmitReqOuterClass.QuestTransmitReq; import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.packet.send.PacketQuestTransmitRsp; - import java.util.ArrayList; @Opcodes(PacketOpcodes.QuestTransmitReq) diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerReadMailNotify.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerReadMailNotify.java index 8e8bda0c1..09cbb6cdc 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerReadMailNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerReadMailNotify.java @@ -5,7 +5,6 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.ReadMailNotifyOuterClass; import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.packet.send.PacketMailChangeNotify; - import java.util.*; @Opcodes(PacketOpcodes.ReadMailNotify) diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerSceneAudioNotify.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerSceneAudioNotify.java index 581744e3a..429df5254 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerSceneAudioNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerSceneAudioNotify.java @@ -4,7 +4,6 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.SceneAudioNotifyOuterClass.SceneAudioNotify; import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.packet.send.PacketSceneAudioNotify; - import java.util.List; @Opcodes(PacketOpcodes.SceneAudioNotify) diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerSceneTransToPointReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerSceneTransToPointReq.java index 63833bf0e..0e06564e2 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerSceneTransToPointReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerSceneTransToPointReq.java @@ -17,20 +17,26 @@ public class HandlerSceneTransToPointReq extends PacketHandler { var player = session.getPlayer(); ScenePointEntry scenePointEntry = - GameData.getScenePointEntryById(req.getSceneId(), req.getPointId()); + GameData.getScenePointEntryById(req.getSceneId(), req.getPointId()); if (scenePointEntry != null) { - if (player.getCurHomeWorld().isInHome(player)) { // if the player is in home, make the player go back - session.getServer().getHomeWorldMPSystem().leaveCoop(player, req.getSceneId(), scenePointEntry.getPointData().getTranPos().clone()); + if (player + .getCurHomeWorld() + .isInHome(player)) { // if the player is in home, make the player go back + session + .getServer() + .getHomeWorldMPSystem() + .leaveCoop( + player, req.getSceneId(), scenePointEntry.getPointData().getTranPos().clone()); session.send(new PacketSceneTransToPointRsp(player, req.getPointId(), req.getSceneId())); return; } else if (player - .getWorld() - .transferPlayerToScene( - player, - req.getSceneId(), - TeleportType.WAYPOINT, - scenePointEntry.getPointData().getTranPos().clone())) { + .getWorld() + .transferPlayerToScene( + player, + req.getSceneId(), + TeleportType.WAYPOINT, + scenePointEntry.getPointData().getTranPos().clone())) { session.send(new PacketSceneTransToPointRsp(player, req.getPointId(), req.getSceneId())); return; } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerSetPlayerBornDataReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerSetPlayerBornDataReq.java index ddf5ebe00..1ce2e20eb 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerSetPlayerBornDataReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerSetPlayerBornDataReq.java @@ -1,5 +1,7 @@ package emu.grasscutter.server.packet.recv; +import static emu.grasscutter.config.Configuration.*; + import emu.grasscutter.*; import emu.grasscutter.command.commands.SendMailCommand.MailBuilder; import emu.grasscutter.data.GameData; @@ -9,11 +11,8 @@ import emu.grasscutter.game.player.Player; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.SetPlayerBornDataReqOuterClass.SetPlayerBornDataReq; import emu.grasscutter.server.game.GameSession; - import java.util.Arrays; -import static emu.grasscutter.config.Configuration.*; - @Opcodes(PacketOpcodes.SetPlayerBornDataReq) public class HandlerSetPlayerBornDataReq extends PacketHandler { diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerTakePlayerLevelRewardReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerTakePlayerLevelRewardReq.java index 17b36ecf3..169a75750 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerTakePlayerLevelRewardReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerTakePlayerLevelRewardReq.java @@ -8,7 +8,6 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.TakePlayerLevelRewardReqOuterClass.TakePlayerLevelRewardReq; import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.packet.send.PacketTakePlayerLevelRewardRsp; - import java.util.*; @Opcodes(PacketOpcodes.TakePlayerLevelRewardReq) diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerTryEnterHomeReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerTryEnterHomeReq.java index a37f28a2e..03c38dcf4 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerTryEnterHomeReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerTryEnterHomeReq.java @@ -25,17 +25,28 @@ public class HandlerTryEnterHomeReq extends PacketHandler { // like a poem // A person who rote this comment, I DID IT!!!!!! by hamusuke. switch (targetHome.getEnterHomeOption()) { - case FriendEnterHomeOptionOuterClass.FriendEnterHomeOption.FRIEND_ENTER_HOME_OPTION_NEED_CONFIRM_VALUE -> { + case FriendEnterHomeOptionOuterClass.FriendEnterHomeOption + .FRIEND_ENTER_HOME_OPTION_NEED_CONFIRM_VALUE -> { if (!targetPlayer.isOnline()) { - session.send(new PacketTryEnterHomeRsp(RetcodeOuterClass.Retcode.RET_HOME_OWNER_OFFLINE_VALUE, req.getTargetUid())); + session.send( + new PacketTryEnterHomeRsp( + RetcodeOuterClass.Retcode.RET_HOME_OWNER_OFFLINE_VALUE, req.getTargetUid())); } else { - session.getServer().getHomeWorldMPSystem().sendEnterHomeRequest(session.getPlayer(), req.getTargetUid()); + session + .getServer() + .getHomeWorldMPSystem() + .sendEnterHomeRequest(session.getPlayer(), req.getTargetUid()); } } - case FriendEnterHomeOptionOuterClass.FriendEnterHomeOption.FRIEND_ENTER_HOME_OPTION_REFUSE_VALUE -> { - session.send(new PacketTryEnterHomeRsp(RetcodeOuterClass.Retcode.RET_HOME_HOME_REFUSE_GUEST_ENTER_VALUE, req.getTargetUid())); + case FriendEnterHomeOptionOuterClass.FriendEnterHomeOption + .FRIEND_ENTER_HOME_OPTION_REFUSE_VALUE -> { + session.send( + new PacketTryEnterHomeRsp( + RetcodeOuterClass.Retcode.RET_HOME_HOME_REFUSE_GUEST_ENTER_VALUE, + req.getTargetUid())); } - case FriendEnterHomeOptionOuterClass.FriendEnterHomeOption.FRIEND_ENTER_HOME_OPTION_DIRECT_VALUE -> { + case FriendEnterHomeOptionOuterClass.FriendEnterHomeOption + .FRIEND_ENTER_HOME_OPTION_DIRECT_VALUE -> { session.getServer().getHomeWorldMPSystem().enterHome(session.getPlayer(), targetPlayer); } } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerUnionCmdNotify.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerUnionCmdNotify.java index 475b76c51..d82d41b66 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerUnionCmdNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerUnionCmdNotify.java @@ -1,13 +1,13 @@ package emu.grasscutter.server.packet.recv; +import static emu.grasscutter.config.Configuration.*; + import emu.grasscutter.Grasscutter.ServerDebugMode; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.UnionCmdNotifyOuterClass.UnionCmdNotify; import emu.grasscutter.net.proto.UnionCmdOuterClass.UnionCmd; import emu.grasscutter.server.game.GameSession; -import static emu.grasscutter.config.Configuration.*; - @Opcodes(PacketOpcodes.UnionCmdNotify) public class HandlerUnionCmdNotify extends PacketHandler { @Override diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketAbilityInvocationsNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketAbilityInvocationsNotify.java index 2ded9b5ba..9a2975da8 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketAbilityInvocationsNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketAbilityInvocationsNotify.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.AbilityInvocationsNotifyOuterClass.AbilityInvocationsNotify; import emu.grasscutter.net.proto.AbilityInvokeEntryOuterClass.AbilityInvokeEntry; - import java.util.List; public class PacketAbilityInvocationsNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketAchievementUpdateNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketAchievementUpdateNotify.java index 51d150ca6..ccea64fda 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketAchievementUpdateNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketAchievementUpdateNotify.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.game.achievement.Achievement; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.AchievementUpdateNotifyOuterClass; - import java.util.List; public class PacketAchievementUpdateNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketActivityScheduleInfoNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketActivityScheduleInfoNotify.java index 55c4845b3..08908c5cb 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketActivityScheduleInfoNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketActivityScheduleInfoNotify.java @@ -4,7 +4,6 @@ import emu.grasscutter.game.activity.ActivityConfigItem; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.*; import emu.grasscutter.utils.helpers.DateHelper; - import java.util.Collection; public class PacketActivityScheduleInfoNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketAllWidgetDataNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketAllWidgetDataNotify.java index 38fa6f3ca..0e90ac109 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketAllWidgetDataNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketAllWidgetDataNotify.java @@ -2,9 +2,8 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.game.player.Player; import emu.grasscutter.net.packet.*; -import emu.grasscutter.net.proto.AllWidgetDataNotifyOuterClass.AllWidgetDataNotify; import emu.grasscutter.net.proto.*; - +import emu.grasscutter.net.proto.AllWidgetDataNotifyOuterClass.AllWidgetDataNotify; import java.util.List; public class PacketAllWidgetDataNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarDelNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarDelNotify.java index 27fbebdd6..40916a49f 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarDelNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarDelNotify.java @@ -2,7 +2,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.AvatarDelNotifyOuterClass.AvatarDelNotify; - import java.util.List; public class PacketAvatarDelNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionAllDataRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionAllDataRsp.java index c33889328..1ada85f16 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionAllDataRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionAllDataRsp.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.game.expedition.ExpeditionInfo; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.AvatarExpeditionAllDataRspOuterClass.AvatarExpeditionAllDataRsp; - import java.util.*; import java.util.stream.Collectors; diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionCallBackRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionCallBackRsp.java index 5b88ccb5c..1f445df53 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionCallBackRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionCallBackRsp.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.game.expedition.ExpeditionInfo; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.AvatarExpeditionCallBackRspOuterClass.AvatarExpeditionCallBackRsp; - import java.util.Map; public class PacketAvatarExpeditionCallBackRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionDataNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionDataNotify.java index 9eef5da77..5067094ad 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionDataNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionDataNotify.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.game.expedition.ExpeditionInfo; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.AvatarExpeditionDataNotifyOuterClass.AvatarExpeditionDataNotify; - import java.util.Map; import java.util.stream.Collectors; diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionGetRewardRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionGetRewardRsp.java index 5c7ee5752..0b7b6ba01 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionGetRewardRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionGetRewardRsp.java @@ -4,7 +4,6 @@ import emu.grasscutter.game.expedition.ExpeditionInfo; import emu.grasscutter.game.inventory.GameItem; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.AvatarExpeditionGetRewardRspOuterClass.AvatarExpeditionGetRewardRsp; - import java.util.*; public class PacketAvatarExpeditionGetRewardRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionStartRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionStartRsp.java index d1a08e3e7..9a4460076 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionStartRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarExpeditionStartRsp.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.game.expedition.ExpeditionInfo; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.AvatarExpeditionStartRspOuterClass.AvatarExpeditionStartRsp; - import java.util.Map; public class PacketAvatarExpeditionStartRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarFightPropUpdateNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarFightPropUpdateNotify.java index 3b2099d60..d4cb3f28e 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarFightPropUpdateNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarFightPropUpdateNotify.java @@ -4,7 +4,6 @@ import emu.grasscutter.game.avatar.Avatar; import emu.grasscutter.game.props.FightProperty; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.AvatarFightPropUpdateNotifyOuterClass.AvatarFightPropUpdateNotify; - import java.util.Map; public class PacketAvatarFightPropUpdateNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarPropNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarPropNotify.java index 54f37c340..eb6d2b18b 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarPropNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarPropNotify.java @@ -4,7 +4,6 @@ import emu.grasscutter.game.avatar.Avatar; import emu.grasscutter.game.props.PlayerProperty; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.AvatarPropNotifyOuterClass.AvatarPropNotify; - import java.util.Map; public class PacketAvatarPropNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarUpgradeRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarUpgradeRsp.java index b9f95dd85..a34d963bc 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarUpgradeRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarUpgradeRsp.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.game.avatar.Avatar; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.AvatarUpgradeRspOuterClass.AvatarUpgradeRsp; - import java.util.Map; public class PacketAvatarUpgradeRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketBattlePassMissionUpdateNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketBattlePassMissionUpdateNotify.java index ac13c3eb9..1d65c6bc5 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketBattlePassMissionUpdateNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketBattlePassMissionUpdateNotify.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.game.battlepass.BattlePassMission; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.BattlePassMissionUpdateNotifyOuterClass.BattlePassMissionUpdateNotify; - import java.util.Collection; public class PacketBattlePassMissionUpdateNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketBeginCameraSceneLookNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketBeginCameraSceneLookNotify.java index 44d08987a..cf8dd186a 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketBeginCameraSceneLookNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketBeginCameraSceneLookNotify.java @@ -2,9 +2,8 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.game.world.Position; import emu.grasscutter.net.packet.*; -import lombok.*; - import java.util.*; +import lombok.*; public final class PacketBeginCameraSceneLookNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketCalcWeaponUpgradeReturnItemsRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketCalcWeaponUpgradeReturnItemsRsp.java index 363750f9d..fbe8b1031 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketCalcWeaponUpgradeReturnItemsRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketCalcWeaponUpgradeReturnItemsRsp.java @@ -4,7 +4,6 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.CalcWeaponUpgradeReturnItemsRspOuterClass.CalcWeaponUpgradeReturnItemsRsp; import emu.grasscutter.net.proto.ItemParamOuterClass.ItemParam; import emu.grasscutter.net.proto.RetcodeOuterClass; - import java.util.List; public class PacketCalcWeaponUpgradeReturnItemsRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketClientAbilitiesInitFinishCombineNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketClientAbilitiesInitFinishCombineNotify.java index e0a5cacfb..32ecbce53 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketClientAbilitiesInitFinishCombineNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketClientAbilitiesInitFinishCombineNotify.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.ClientAbilitiesInitFinishCombineNotifyOuterClass.ClientAbilitiesInitFinishCombineNotify; import emu.grasscutter.net.proto.EntityAbilityInvokeEntryOuterClass.EntityAbilityInvokeEntry; - import java.util.List; public class PacketClientAbilitiesInitFinishCombineNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketClientAbilityInitFinishNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketClientAbilityInitFinishNotify.java index 4d1bbc8cd..8d1b9a3b1 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketClientAbilityInitFinishNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketClientAbilityInitFinishNotify.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.AbilityInvokeEntryOuterClass.AbilityInvokeEntry; import emu.grasscutter.net.proto.ClientAbilityInitFinishNotifyOuterClass.ClientAbilityInitFinishNotify; - import java.util.List; public class PacketClientAbilityInitFinishNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketCodexDataFullNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketCodexDataFullNotify.java index 105266517..14e2755a2 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketCodexDataFullNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketCodexDataFullNotify.java @@ -5,7 +5,6 @@ import emu.grasscutter.game.player.Player; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.CodexDataFullNotifyOuterClass.CodexDataFullNotify; import emu.grasscutter.net.proto.CodexTypeDataOuterClass.CodexTypeData; - import java.util.Collections; public class PacketCodexDataFullNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketCombatInvocationsNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketCombatInvocationsNotify.java index d12698875..b946589a9 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketCombatInvocationsNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketCombatInvocationsNotify.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.CombatInvocationsNotifyOuterClass.CombatInvocationsNotify; import emu.grasscutter.net.proto.CombatInvokeEntryOuterClass.CombatInvokeEntry; - import java.util.List; public class PacketCombatInvocationsNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketCompoundDataNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketCompoundDataNotify.java index 2a96bb02e..dce012dfd 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketCompoundDataNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketCompoundDataNotify.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.CompoundDataNotifyOuterClass.CompoundDataNotify; import emu.grasscutter.net.proto.CompoundQueueDataOuterClass.CompoundQueueData; - import java.util.*; public class PacketCompoundDataNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketCookDataNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketCookDataNotify.java index 0252a6636..0268eb3e7 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketCookDataNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketCookDataNotify.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.CookDataNotifyOuterClass.CookDataNotify; import emu.grasscutter.net.proto.CookRecipeDataOuterClass.CookRecipeData; - import java.util.List; public class PacketCookDataNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketCreateVehicleRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketCreateVehicleRsp.java index fec9b6195..6d9537e19 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketCreateVehicleRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketCreateVehicleRsp.java @@ -7,7 +7,6 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.CreateVehicleRspOuterClass.CreateVehicleRsp; import emu.grasscutter.net.proto.VehicleInteractTypeOuterClass; import emu.grasscutter.net.proto.VehicleMemberOuterClass.VehicleMember; - import java.util.List; public class PacketCreateVehicleRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketDelMailRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketDelMailRsp.java index f17119601..05a27f4b5 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketDelMailRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketDelMailRsp.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.game.player.Player; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.DelMailRspOuterClass.DelMailRsp; - import java.util.List; public class PacketDelMailRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketDelTeamEntityNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketDelTeamEntityNotify.java index 6e9505362..90755a1bc 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketDelTeamEntityNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketDelTeamEntityNotify.java @@ -2,7 +2,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.DelTeamEntityNotifyOuterClass.DelTeamEntityNotify; - import java.util.List; public class PacketDelTeamEntityNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketDoGachaRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketDoGachaRsp.java index f8d95c435..6c8716760 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketDoGachaRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketDoGachaRsp.java @@ -7,7 +7,6 @@ import emu.grasscutter.net.proto.DoGachaRspOuterClass.DoGachaRsp; import emu.grasscutter.net.proto.GachaItemOuterClass.GachaItem; import emu.grasscutter.net.proto.RetcodeOuterClass; import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode; - import java.util.List; public class PacketDoGachaRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketDungeonEntryInfoRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketDungeonEntryInfoRsp.java index 3f81797ed..335bf7675 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketDungeonEntryInfoRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketDungeonEntryInfoRsp.java @@ -4,7 +4,6 @@ import emu.grasscutter.data.common.PointData; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.DungeonEntryInfoOuterClass.DungeonEntryInfo; import emu.grasscutter.net.proto.DungeonEntryInfoRspOuterClass.DungeonEntryInfoRsp; - import java.util.*; public class PacketDungeonEntryInfoRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketDungeonWayPointNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketDungeonWayPointNotify.java index 07d7a506c..d445a417f 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketDungeonWayPointNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketDungeonWayPointNotify.java @@ -2,7 +2,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass; - import java.util.Set; public class PacketDungeonWayPointNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketEntityFightPropChangeReasonNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketEntityFightPropChangeReasonNotify.java index e73f897c0..439daabf0 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketEntityFightPropChangeReasonNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketEntityFightPropChangeReasonNotify.java @@ -7,7 +7,6 @@ import emu.grasscutter.net.proto.ChangeEnergyReasonOuterClass.ChangeEnergyReason import emu.grasscutter.net.proto.ChangeHpReasonOuterClass.ChangeHpReason; import emu.grasscutter.net.proto.EntityFightPropChangeReasonNotifyOuterClass.EntityFightPropChangeReasonNotify; import emu.grasscutter.net.proto.PropChangeReasonOuterClass.PropChangeReason; - import java.util.List; public class PacketEntityFightPropChangeReasonNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketEntityFightPropUpdateNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketEntityFightPropUpdateNotify.java index 22c0f952a..7f1cd945b 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketEntityFightPropUpdateNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketEntityFightPropUpdateNotify.java @@ -4,7 +4,6 @@ import emu.grasscutter.game.entity.GameEntity; import emu.grasscutter.game.props.FightProperty; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.EntityFightPropUpdateNotifyOuterClass.EntityFightPropUpdateNotify; - import java.util.Collection; public class PacketEntityFightPropUpdateNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarEnterFocusNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarEnterFocusNotify.java index e7eae1ccb..ad4fd9247 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarEnterFocusNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarEnterFocusNotify.java @@ -4,7 +4,8 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.EvtAvatarEnterFocusNotifyOuterClass; public class PacketEvtAvatarEnterFocusNotify extends BasePacket { - public PacketEvtAvatarEnterFocusNotify(EvtAvatarEnterFocusNotifyOuterClass.EvtAvatarEnterFocusNotify notify) { + public PacketEvtAvatarEnterFocusNotify( + EvtAvatarEnterFocusNotifyOuterClass.EvtAvatarEnterFocusNotify notify) { super(PacketOpcodes.EvtAvatarEnterFocusNotify); this.setData(EvtAvatarEnterFocusNotifyOuterClass.EvtAvatarEnterFocusNotify.newBuilder(notify)); diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarExitFocusNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarExitFocusNotify.java index 0de4cfb42..1da6c620c 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarExitFocusNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarExitFocusNotify.java @@ -4,7 +4,8 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.EvtAvatarExitFocusNotifyOuterClass; public class PacketEvtAvatarExitFocusNotify extends BasePacket { - public PacketEvtAvatarExitFocusNotify(EvtAvatarExitFocusNotifyOuterClass.EvtAvatarExitFocusNotify notify) { + public PacketEvtAvatarExitFocusNotify( + EvtAvatarExitFocusNotifyOuterClass.EvtAvatarExitFocusNotify notify) { super(PacketOpcodes.EvtAvatarExitFocusNotify); this.setData(EvtAvatarExitFocusNotifyOuterClass.EvtAvatarExitFocusNotify.newBuilder(notify)); diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarUpdateFocusNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarUpdateFocusNotify.java index 4376f5fa5..48bad979b 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarUpdateFocusNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketEvtAvatarUpdateFocusNotify.java @@ -4,9 +4,11 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.EvtAvatarUpdateFocusNotifyOuterClass; public class PacketEvtAvatarUpdateFocusNotify extends BasePacket { - public PacketEvtAvatarUpdateFocusNotify(EvtAvatarUpdateFocusNotifyOuterClass.EvtAvatarUpdateFocusNotify notify) { + public PacketEvtAvatarUpdateFocusNotify( + EvtAvatarUpdateFocusNotifyOuterClass.EvtAvatarUpdateFocusNotify notify) { super(PacketOpcodes.EvtAvatarUpdateFocusNotify); - this.setData(EvtAvatarUpdateFocusNotifyOuterClass.EvtAvatarUpdateFocusNotify.newBuilder(notify)); + this.setData( + EvtAvatarUpdateFocusNotifyOuterClass.EvtAvatarUpdateFocusNotify.newBuilder(notify)); } } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketEvtBulletDeactiveNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketEvtBulletDeactiveNotify.java index 681e574b9..94e7404ef 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketEvtBulletDeactiveNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketEvtBulletDeactiveNotify.java @@ -4,7 +4,8 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.EvtBulletDeactiveNotifyOuterClass; public class PacketEvtBulletDeactiveNotify extends BasePacket { - public PacketEvtBulletDeactiveNotify(EvtBulletDeactiveNotifyOuterClass.EvtBulletDeactiveNotify notify) { + public PacketEvtBulletDeactiveNotify( + EvtBulletDeactiveNotifyOuterClass.EvtBulletDeactiveNotify notify) { super(PacketOpcodes.EvtBulletDeactiveNotify); this.setData(EvtBulletDeactiveNotifyOuterClass.EvtBulletDeactiveNotify.newBuilder(notify)); diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketFinishedParentQuestUpdateNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketFinishedParentQuestUpdateNotify.java index 266632ab0..327901abb 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketFinishedParentQuestUpdateNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketFinishedParentQuestUpdateNotify.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.game.quest.GameMainQuest; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.FinishedParentQuestUpdateNotifyOuterClass.FinishedParentQuestUpdateNotify; - import java.util.List; public class PacketFinishedParentQuestUpdateNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketForgeDataNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketForgeDataNotify.java index 266443cc0..9256cf750 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketForgeDataNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketForgeDataNotify.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.ForgeDataNotifyOuterClass.ForgeDataNotify; import emu.grasscutter.net.proto.ForgeQueueDataOuterClass.ForgeQueueData; - import java.util.Map; public class PacketForgeDataNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketForgeGetQueueDataRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketForgeGetQueueDataRsp.java index 9afb87b31..11abeb56a 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketForgeGetQueueDataRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketForgeGetQueueDataRsp.java @@ -4,7 +4,6 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.ForgeGetQueueDataRspOuterClass.ForgeGetQueueDataRsp; import emu.grasscutter.net.proto.ForgeQueueDataOuterClass.ForgeQueueData; import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode; - import java.util.Map; public class PacketForgeGetQueueDataRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketForgeQueueDataNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketForgeQueueDataNotify.java index 90f28d88f..85c1c1c7c 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketForgeQueueDataNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketForgeQueueDataNotify.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.ForgeQueueDataNotifyOuterClass.ForgeQueueDataNotify; import emu.grasscutter.net.proto.ForgeQueueDataOuterClass.ForgeQueueData; - import java.util.*; public class PacketForgeQueueDataNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketForgeQueueManipulateRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketForgeQueueManipulateRsp.java index 34877376f..281fd8d4d 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketForgeQueueManipulateRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketForgeQueueManipulateRsp.java @@ -6,7 +6,6 @@ import emu.grasscutter.net.proto.ForgeQueueManipulateRspOuterClass.ForgeQueueMan import emu.grasscutter.net.proto.ForgeQueueManipulateTypeOuterClass.ForgeQueueManipulateType; import emu.grasscutter.net.proto.ItemParamOuterClass.ItemParam; import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode; - import java.util.List; public class PacketForgeQueueManipulateRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketFurnitureMakeStartRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketFurnitureMakeStartRsp.java index 8b948c9f2..2e1a7d051 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketFurnitureMakeStartRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketFurnitureMakeStartRsp.java @@ -2,7 +2,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.*; - import java.util.List; public class PacketFurnitureMakeStartRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketGadgetAutoPickDropInfoNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketGadgetAutoPickDropInfoNotify.java index 0f7714e9d..579f81f28 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketGadgetAutoPickDropInfoNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketGadgetAutoPickDropInfoNotify.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.game.inventory.GameItem; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.GadgetAutoPickDropInfoNotifyOuterClass.GadgetAutoPickDropInfoNotify; - import java.util.Collection; public class PacketGadgetAutoPickDropInfoNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketGetActivityInfoRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketGetActivityInfoRsp.java index cf445446f..d74e970b3 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketGetActivityInfoRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketGetActivityInfoRsp.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.game.activity.ActivityManager; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.GetActivityInfoRspOuterClass.GetActivityInfoRsp; - import java.util.Set; public class PacketGetActivityInfoRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketGetActivityShopSheetInfoRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketGetActivityShopSheetInfoRsp.java index ca9f8f527..a13eb6428 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketGetActivityShopSheetInfoRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketGetActivityShopSheetInfoRsp.java @@ -6,7 +6,6 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.ActivityShopSheetInfoOuterClass.ActivityShopSheetInfo; import emu.grasscutter.net.proto.GetActivityShopSheetInfoRspOuterClass.GetActivityShopSheetInfoRsp; import emu.grasscutter.net.proto.RetcodeOuterClass; - import java.util.*; public class PacketGetActivityShopSheetInfoRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketGetAllActivatedBargainDataRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketGetAllActivatedBargainDataRsp.java index 7492e5b98..aa11585c4 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketGetAllActivatedBargainDataRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketGetAllActivatedBargainDataRsp.java @@ -4,7 +4,6 @@ import emu.grasscutter.game.quest.BargainRecord; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.GetAllActivatedBargainDataRspOuterClass.GetAllActivatedBargainDataRsp; import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode; - import java.util.Collection; public final class PacketGetAllActivatedBargainDataRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketGetAllMailResultNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketGetAllMailResultNotify.java index 296d9fd41..2c6fc2009 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketGetAllMailResultNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketGetAllMailResultNotify.java @@ -4,7 +4,6 @@ import emu.grasscutter.game.player.Player; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.GetAllMailResultNotifyOuterClass.GetAllMailResultNotify; import emu.grasscutter.utils.Utils; - import java.time.Instant; import java.util.List; diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketGetChatEmojiCollectionRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketGetChatEmojiCollectionRsp.java index aaa8848ce..f191a7b8a 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketGetChatEmojiCollectionRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketGetChatEmojiCollectionRsp.java @@ -2,7 +2,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.*; - import java.util.List; public class PacketGetChatEmojiCollectionRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketGetCompoundDataRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketGetCompoundDataRsp.java index 114e12b0c..a1d12282a 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketGetCompoundDataRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketGetCompoundDataRsp.java @@ -4,7 +4,6 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.CompoundQueueDataOuterClass.CompoundQueueData; import emu.grasscutter.net.proto.GetCompoundDataRspOuterClass.GetCompoundDataRsp; import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode; - import java.util.*; public class PacketGetCompoundDataRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketGetFriendShowAvatarInfoRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketGetFriendShowAvatarInfoRsp.java index cf1060975..ae3a181c7 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketGetFriendShowAvatarInfoRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketGetFriendShowAvatarInfoRsp.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.GetFriendShowAvatarInfoRspOuterClass.GetFriendShowAvatarInfoRsp; import emu.grasscutter.net.proto.ShowAvatarInfoOuterClass.ShowAvatarInfo; - import java.util.List; @Opcodes(PacketOpcodes.GetFriendShowAvatarInfoRsp) diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketGetFriendShowNameCardInfoRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketGetFriendShowNameCardInfoRsp.java index 84d2ff737..ee8bf60c7 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketGetFriendShowNameCardInfoRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketGetFriendShowNameCardInfoRsp.java @@ -2,7 +2,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.GetFriendShowNameCardInfoRspOuterClass; - import java.util.List; public class PacketGetFriendShowNameCardInfoRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketGetInvestigationMonsterRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketGetInvestigationMonsterRsp.java index 124c9b4c2..b9b48af59 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketGetInvestigationMonsterRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketGetInvestigationMonsterRsp.java @@ -4,7 +4,6 @@ import emu.grasscutter.game.player.Player; import emu.grasscutter.game.world.WorldDataSystem; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.GetInvestigationMonsterRspOuterClass; - import java.util.List; public class PacketGetInvestigationMonsterRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketGetMailItemRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketGetMailItemRsp.java index 3ec476219..2c49dc0b1 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketGetMailItemRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketGetMailItemRsp.java @@ -8,7 +8,6 @@ import emu.grasscutter.game.props.ActionReason; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.EquipParamOuterClass; import emu.grasscutter.net.proto.GetMailItemRspOuterClass.GetMailItemRsp; - import java.util.*; import java.util.stream.Collectors; diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketGetOnlinePlayerListRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketGetOnlinePlayerListRsp.java index c706ce49e..ab691f46b 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketGetOnlinePlayerListRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketGetOnlinePlayerListRsp.java @@ -4,7 +4,6 @@ import emu.grasscutter.Grasscutter; import emu.grasscutter.game.player.Player; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.GetOnlinePlayerListRspOuterClass.GetOnlinePlayerListRsp; - import java.util.List; public class PacketGetOnlinePlayerListRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketGetPlayerFriendListRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketGetPlayerFriendListRsp.java index 04b39136c..59f9a90d0 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketGetPlayerFriendListRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketGetPlayerFriendListRsp.java @@ -1,17 +1,17 @@ package emu.grasscutter.server.packet.send; +import static emu.grasscutter.config.Configuration.GAME_INFO; + import emu.grasscutter.GameConstants; import emu.grasscutter.game.friends.Friendship; import emu.grasscutter.game.player.Player; import emu.grasscutter.net.packet.*; -import emu.grasscutter.net.proto.FriendBriefOuterClass.FriendBrief; import emu.grasscutter.net.proto.*; +import emu.grasscutter.net.proto.FriendBriefOuterClass.FriendBrief; import emu.grasscutter.net.proto.FriendOnlineStateOuterClass.FriendOnlineState; import emu.grasscutter.net.proto.GetPlayerFriendListRspOuterClass.GetPlayerFriendListRsp; import emu.grasscutter.net.proto.ProfilePictureOuterClass.ProfilePicture; -import static emu.grasscutter.config.Configuration.GAME_INFO; - public class PacketGetPlayerFriendListRsp extends BasePacket { public PacketGetPlayerFriendListRsp(Player player) { @@ -32,7 +32,9 @@ public class PacketGetPlayerFriendListRsp extends BasePacket { .setParam(1) .setIsGameSource(true) .setPlatformType(PlatformTypeOuterClass.PlatformType.PLATFORM_TYPE_PC) - .setFriendEnterHomeOptionValue(FriendEnterHomeOptionOuterClass.FriendEnterHomeOption.FRIEND_ENTER_HOME_OPTION_REFUSE_VALUE) + .setFriendEnterHomeOptionValue( + FriendEnterHomeOptionOuterClass.FriendEnterHomeOption + .FRIEND_ENTER_HOME_OPTION_REFUSE_VALUE) .build(); GetPlayerFriendListRsp.Builder proto = diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketGetShopRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketGetShopRsp.java index 149f6f2ef..1ad3806f8 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketGetShopRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketGetShopRsp.java @@ -8,7 +8,6 @@ import emu.grasscutter.net.proto.*; import emu.grasscutter.net.proto.ShopGoodsOuterClass.ShopGoods; import emu.grasscutter.net.proto.ShopOuterClass.Shop; import emu.grasscutter.utils.Utils; - import java.util.*; import java.util.stream.Collectors; diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketGetShopmallDataRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketGetShopmallDataRsp.java index 5fbe06605..3565c8395 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketGetShopmallDataRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketGetShopmallDataRsp.java @@ -2,7 +2,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.GetShopmallDataRspOuterClass.GetShopmallDataRsp; - import java.util.List; public class PacketGetShopmallDataRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketGetWidgetSlotRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketGetWidgetSlotRsp.java index 1b56dbf89..6351f46da 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketGetWidgetSlotRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketGetWidgetSlotRsp.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.game.player.Player; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.*; - import java.util.List; public class PacketGetWidgetSlotRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketGivingRecordNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketGivingRecordNotify.java index 9898ec605..2e1a4bf09 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketGivingRecordNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketGivingRecordNotify.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.GivingRecordNotifyOuterClass.GivingRecordNotify; import emu.grasscutter.net.proto.GivingRecordOuterClass.GivingRecord; - import java.util.Collection; public final class PacketGivingRecordNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketGroupSuiteNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketGroupSuiteNotify.java index db88af153..266221e29 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketGroupSuiteNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketGroupSuiteNotify.java @@ -4,7 +4,6 @@ import emu.grasscutter.data.binout.SceneNpcBornEntry; import emu.grasscutter.game.quest.QuestGroupSuite; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.GroupSuiteNotifyOuterClass; - import java.util.*; public class PacketGroupSuiteNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketGroupUnloadNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketGroupUnloadNotify.java index f0ce0885c..842cf76b9 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketGroupUnloadNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketGroupUnloadNotify.java @@ -2,7 +2,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.GroupUnloadNotifyOuterClass; - import java.util.List; public class PacketGroupUnloadNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarCostumeChangeNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarCostumeChangeNotify.java index 4533b38e1..7e908a6f4 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarCostumeChangeNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarCostumeChangeNotify.java @@ -8,8 +8,9 @@ public class PacketHomeAvatarCostumeChangeNotify extends BasePacket { public PacketHomeAvatarCostumeChangeNotify(int avatarId, int costumeId) { super(PacketOpcodes.HomeAvatarCostumeChangeNotify); - this.setData(HomeAvatarCostumeChangeNotifyOuterClass.HomeAvatarCostumeChangeNotify.newBuilder() - .setAvatarId(avatarId) - .setCostumeId(costumeId)); + this.setData( + HomeAvatarCostumeChangeNotifyOuterClass.HomeAvatarCostumeChangeNotify.newBuilder() + .setAvatarId(avatarId) + .setCostumeId(costumeId)); } } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeBasicInfoNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeBasicInfoNotify.java index 61ca9effe..c1e086859 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeBasicInfoNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeBasicInfoNotify.java @@ -20,16 +20,16 @@ public class PacketHomeBasicInfoNotify extends BasePacket { var homeScene = home.getHomeSceneItem(sceneId); proto.setBasicInfo( - HomeBasicInfoOuterClass.HomeBasicInfo.newBuilder() - .setCurModuleId(owner.getCurrentRealmId()) - .setCurRoomSceneId(homeScene.getRoomSceneId()) - .setIsInEditMode(editMode) - .setHomeOwnerUid(owner.getUid()) - .setExp(home.getExp()) - .setLevel(home.getLevel()) - .setOwnerNickName(owner.getNickname()) - // TODO limit shop - .build()); + HomeBasicInfoOuterClass.HomeBasicInfo.newBuilder() + .setCurModuleId(owner.getCurrentRealmId()) + .setCurRoomSceneId(homeScene.getRoomSceneId()) + .setIsInEditMode(editMode) + .setHomeOwnerUid(owner.getUid()) + .setExp(home.getExp()) + .setLevel(home.getLevel()) + .setOwnerNickName(owner.getNickname()) + // TODO limit shop + .build()); this.setData(proto); } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeChangeEditModeRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeChangeEditModeRsp.java index c23e91492..9a85185a1 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeChangeEditModeRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeChangeEditModeRsp.java @@ -18,7 +18,7 @@ public class PacketHomeChangeEditModeRsp extends BasePacket { public PacketHomeChangeEditModeRsp(int retcode) { super(PacketOpcodes.HomeChangeEditModeRsp); - this.setData(HomeChangeEditModeRspOuterClass.HomeChangeEditModeRsp.newBuilder() - .setRetcode(retcode)); + this.setData( + HomeChangeEditModeRspOuterClass.HomeChangeEditModeRsp.newBuilder().setRetcode(retcode)); } } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeComfortInfoNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeComfortInfoNotify.java index 236af820b..29604f58e 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeComfortInfoNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeComfortInfoNotify.java @@ -4,7 +4,6 @@ import emu.grasscutter.game.home.HomeBlockItem; import emu.grasscutter.game.player.Player; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.*; - import java.util.*; public class PacketHomeComfortInfoNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeGetArrangementInfoRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeGetArrangementInfoRsp.java index 09e01975b..c88a0063a 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeGetArrangementInfoRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeGetArrangementInfoRsp.java @@ -4,7 +4,6 @@ import emu.grasscutter.game.home.HomeSceneItem; import emu.grasscutter.game.player.Player; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.HomeGetArrangementInfoRspOuterClass; - import java.util.List; public class PacketHomeGetArrangementInfoRsp extends BasePacket { @@ -15,7 +14,7 @@ public class PacketHomeGetArrangementInfoRsp extends BasePacket { var proto = HomeGetArrangementInfoRspOuterClass.HomeGetArrangementInfoRsp.newBuilder(); var home = player.getCurHomeWorld().getHome(); var homeScenes = - sceneIdList.stream().map(home::getHomeSceneItem).map(HomeSceneItem::toProto).toList(); + sceneIdList.stream().map(home::getHomeSceneItem).map(HomeSceneItem::toProto).toList(); proto.addAllSceneArrangementInfoList(homeScenes); home.save(); diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeGetOnlineStatusRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeGetOnlineStatusRsp.java index 888495304..aa1bae9f9 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeGetOnlineStatusRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeGetOnlineStatusRsp.java @@ -3,14 +3,14 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.game.player.Player; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.HomeGetOnlineStatusRspOuterClass; - import java.util.List; public class PacketHomeGetOnlineStatusRsp extends BasePacket { public PacketHomeGetOnlineStatusRsp(List guests) { super(PacketOpcodes.HomeGetOnlineStatusRsp); - this.setData(HomeGetOnlineStatusRspOuterClass.HomeGetOnlineStatusRsp.newBuilder() - .addAllPlayerInfoList(guests.stream().map(Player::getOnlinePlayerInfo).toList())); + this.setData( + HomeGetOnlineStatusRspOuterClass.HomeGetOnlineStatusRsp.newBuilder() + .addAllPlayerInfoList(guests.stream().map(Player::getOnlinePlayerInfo).toList())); } } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeKickPlayerRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeKickPlayerRsp.java index d9dc68254..e39fbab27 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeKickPlayerRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeKickPlayerRsp.java @@ -7,9 +7,10 @@ public class PacketHomeKickPlayerRsp extends BasePacket { public PacketHomeKickPlayerRsp(int retcode, HomeKickPlayerReqOuterClass.HomeKickPlayerReq req) { super(PacketOpcodes.HomeKickPlayerRsp); - this.setData(HomeKickPlayerRspOuterClass.HomeKickPlayerRsp.newBuilder() - .setIsKickAll(req.getIsKickAll()) - .setTargetUid(req.getTargetUid()) - .setRetcode(retcode)); + this.setData( + HomeKickPlayerRspOuterClass.HomeKickPlayerRsp.newBuilder() + .setIsKickAll(req.getIsKickAll()) + .setTargetUid(req.getTargetUid()) + .setRetcode(retcode)); } } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeMarkPointNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeMarkPointNotify.java index c9b6fa987..c3b44eea8 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeMarkPointNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeMarkPointNotify.java @@ -4,7 +4,6 @@ import emu.grasscutter.game.home.*; import emu.grasscutter.game.player.Player; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.*; - import java.util.Collection; public class PacketHomeMarkPointNotify extends BasePacket { @@ -25,18 +24,30 @@ public class PacketHomeMarkPointNotify extends BasePacket { var homeScene = home.getHomeSceneItem(moduleId + 2000); var markPointData = - HomeMarkPointSceneDataOuterClass.HomeMarkPointSceneData.newBuilder() - .setModuleId(moduleId) - .setSceneId(moduleId + 2000) - .setSafePointPos(homeScene.isRoom() ? VectorOuterClass.Vector.newBuilder().build() : world.getSceneById(moduleId + 2000).getScriptManager().getConfig().born_pos.toProto()) - .setTeapotSpiritPos(homeScene.isRoom() ? VectorOuterClass.Vector.newBuilder().build() : homeScene.getDjinnPos().toProto()); + HomeMarkPointSceneDataOuterClass.HomeMarkPointSceneData.newBuilder() + .setModuleId(moduleId) + .setSceneId(moduleId + 2000) + .setSafePointPos( + homeScene.isRoom() + ? VectorOuterClass.Vector.newBuilder().build() + : world + .getSceneById(moduleId + 2000) + .getScriptManager() + .getConfig() + .born_pos + .toProto()) + .setTeapotSpiritPos( + homeScene.isRoom() + ? VectorOuterClass.Vector.newBuilder().build() + : homeScene.getDjinnPos().toProto()); - var marks = homeScene.getBlockItems().values().stream() - .map(HomeBlockItem::getMarkPointProtoFactories) - .flatMap(Collection::stream) - .filter(HomeMarkPointProtoFactory::isProtoConvertible) - .map(HomeMarkPointProtoFactory::toMarkPointProto) - .toList(); + var marks = + homeScene.getBlockItems().values().stream() + .map(HomeBlockItem::getMarkPointProtoFactories) + .flatMap(Collection::stream) + .filter(HomeMarkPointProtoFactory::isProtoConvertible) + .map(HomeMarkPointProtoFactory::toMarkPointProto) + .toList(); markPointData.addAllFurnitureList(marks); proto.addMarkPointDataList(markPointData); diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeModuleSeenRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeModuleSeenRsp.java index 823f58609..64b9eac2c 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeModuleSeenRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeModuleSeenRsp.java @@ -2,7 +2,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.HomeModuleSeenRspOuterClass.HomeModuleSeenRsp; - import java.util.List; public class PacketHomeModuleSeenRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeSaveArrangementNoChangeRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeSaveArrangementNoChangeRsp.java index 45708f177..1d3760e6f 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeSaveArrangementNoChangeRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeSaveArrangementNoChangeRsp.java @@ -7,7 +7,8 @@ public class PacketHomeSaveArrangementNoChangeRsp extends BasePacket { public PacketHomeSaveArrangementNoChangeRsp(int sceneId) { super(PacketOpcodes.HomeSaveArrangementNoChangeRsp); - this.setData(HomeSaveArrangementNoChangeRspOuterClass.HomeSaveArrangementNoChangeRsp.newBuilder() - .setSceneId(sceneId)); + this.setData( + HomeSaveArrangementNoChangeRspOuterClass.HomeSaveArrangementNoChangeRsp.newBuilder() + .setSceneId(sceneId)); } } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketItemAddHintNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketItemAddHintNotify.java index 49628f7b9..2b391ae70 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketItemAddHintNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketItemAddHintNotify.java @@ -4,7 +4,6 @@ import emu.grasscutter.game.inventory.GameItem; import emu.grasscutter.game.props.ActionReason; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.ItemAddHintNotifyOuterClass.ItemAddHintNotify; - import java.util.Collection; public class PacketItemAddHintNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketMailChangeNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketMailChangeNotify.java index 28e0e173b..105e1c7dd 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketMailChangeNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketMailChangeNotify.java @@ -8,7 +8,6 @@ import emu.grasscutter.net.proto.MailChangeNotifyOuterClass.MailChangeNotify; import emu.grasscutter.net.proto.MailDataOuterClass.MailData; import emu.grasscutter.net.proto.MailItemOuterClass.MailItem; import emu.grasscutter.net.proto.MailTextContentOuterClass.MailTextContent; - import java.util.*; public class PacketMailChangeNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketMarkMapRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketMarkMapRsp.java index 21340735e..93a29cad0 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketMarkMapRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketMarkMapRsp.java @@ -4,7 +4,6 @@ import emu.grasscutter.game.managers.mapmark.MapMark; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.MapMarkPointOuterClass.MapMarkPoint; import emu.grasscutter.net.proto.MarkMapRspOuterClass.MarkMapRsp; - import java.util.Map; public class PacketMarkMapRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketMarkNewNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketMarkNewNotify.java index 5ec76bb2e..be14e901e 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketMarkNewNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketMarkNewNotify.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.game.player.Player; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.MarkNewNotifyOuterClass.MarkNewNotify; - import java.util.ArrayList; public class PacketMarkNewNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketMassiveEntityElementOpBatchNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketMassiveEntityElementOpBatchNotify.java index 09575be40..20a88ae53 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketMassiveEntityElementOpBatchNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketMassiveEntityElementOpBatchNotify.java @@ -4,9 +4,12 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.MassiveEntityElementOpBatchNotifyOuterClass; public class PacketMassiveEntityElementOpBatchNotify extends BasePacket { - public PacketMassiveEntityElementOpBatchNotify(MassiveEntityElementOpBatchNotifyOuterClass.MassiveEntityElementOpBatchNotify notify) { + public PacketMassiveEntityElementOpBatchNotify( + MassiveEntityElementOpBatchNotifyOuterClass.MassiveEntityElementOpBatchNotify notify) { super(PacketOpcodes.MassiveEntityElementOpBatchNotify); - this.setData(MassiveEntityElementOpBatchNotifyOuterClass.MassiveEntityElementOpBatchNotify.newBuilder(notify)); + this.setData( + MassiveEntityElementOpBatchNotifyOuterClass.MassiveEntityElementOpBatchNotify.newBuilder( + notify)); } } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketOpenStateChangeNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketOpenStateChangeNotify.java index b7d64592e..81ab6f6b2 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketOpenStateChangeNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketOpenStateChangeNotify.java @@ -2,7 +2,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.OpenStateChangeNotifyOuterClass.OpenStateChangeNotify; - import java.util.Map; // Sets openState to value diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketOtherPlayerEnterOrLeaveHomeNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketOtherPlayerEnterOrLeaveHomeNotify.java index 53c9ede74..322aa46d6 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketOtherPlayerEnterOrLeaveHomeNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketOtherPlayerEnterOrLeaveHomeNotify.java @@ -5,11 +5,14 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.OtherPlayerEnterHomeNotifyOuterClass; public class PacketOtherPlayerEnterOrLeaveHomeNotify extends BasePacket { - public PacketOtherPlayerEnterOrLeaveHomeNotify(Player enterer, OtherPlayerEnterHomeNotifyOuterClass.OtherPlayerEnterHomeNotify.Reason reason) { + public PacketOtherPlayerEnterOrLeaveHomeNotify( + Player enterer, + OtherPlayerEnterHomeNotifyOuterClass.OtherPlayerEnterHomeNotify.Reason reason) { super(PacketOpcodes.OtherPlayerEnterHomeNotify); - this.setData(OtherPlayerEnterHomeNotifyOuterClass.OtherPlayerEnterHomeNotify.newBuilder() - .setNickname(enterer.getNickname()) - .setReason(reason)); + this.setData( + OtherPlayerEnterHomeNotifyOuterClass.OtherPlayerEnterHomeNotify.newBuilder() + .setNickname(enterer.getNickname()) + .setReason(reason)); } } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketPersonalLineAllDataRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketPersonalLineAllDataRsp.java index 3d1ae30ec..1dc2f5623 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketPersonalLineAllDataRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketPersonalLineAllDataRsp.java @@ -4,7 +4,6 @@ import emu.grasscutter.data.GameData; import emu.grasscutter.game.quest.*; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.PersonalLineAllDataRspOuterClass; - import java.util.*; import java.util.stream.Collectors; diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerApplyEnterHomeNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerApplyEnterHomeNotify.java index f1eec7178..10052be98 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerApplyEnterHomeNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerApplyEnterHomeNotify.java @@ -8,7 +8,8 @@ public class PacketPlayerApplyEnterHomeNotify extends BasePacket { public PacketPlayerApplyEnterHomeNotify(Player requester) { super(PacketOpcodes.PlayerApplyEnterHomeNotify); - this.setData(PlayerApplyEnterHomeNotifyOuterClass.PlayerApplyEnterHomeNotify.newBuilder() - .setSrcPlayerInfo(requester.getOnlinePlayerInfo())); + this.setData( + PlayerApplyEnterHomeNotifyOuterClass.PlayerApplyEnterHomeNotify.newBuilder() + .setSrcPlayerInfo(requester.getOnlinePlayerInfo())); } } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerApplyEnterHomeResultNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerApplyEnterHomeResultNotify.java index 705d44a36..db1eec4f0 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerApplyEnterHomeResultNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerApplyEnterHomeResultNotify.java @@ -4,13 +4,18 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.PlayerApplyEnterHomeResultNotifyOuterClass; public class PacketPlayerApplyEnterHomeResultNotify extends BasePacket { - public PacketPlayerApplyEnterHomeResultNotify(int targetUid, String nickname, boolean agreed, PlayerApplyEnterHomeResultNotifyOuterClass.PlayerApplyEnterHomeResultNotify.Reason reason) { + public PacketPlayerApplyEnterHomeResultNotify( + int targetUid, + String nickname, + boolean agreed, + PlayerApplyEnterHomeResultNotifyOuterClass.PlayerApplyEnterHomeResultNotify.Reason reason) { super(PacketOpcodes.PlayerApplyEnterHomeResultNotify); - this.setData(PlayerApplyEnterHomeResultNotifyOuterClass.PlayerApplyEnterHomeResultNotify.newBuilder() - .setTargetUid(targetUid) - .setTargetNickname(nickname) - .setIsAgreed(agreed) - .setReason(reason)); + this.setData( + PlayerApplyEnterHomeResultNotifyOuterClass.PlayerApplyEnterHomeResultNotify.newBuilder() + .setTargetUid(targetUid) + .setTargetNickname(nickname) + .setIsAgreed(agreed) + .setReason(reason)); } } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerApplyEnterHomeResultRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerApplyEnterHomeResultRsp.java index e092338ee..4a3c1c708 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerApplyEnterHomeResultRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerApplyEnterHomeResultRsp.java @@ -7,8 +7,9 @@ public class PacketPlayerApplyEnterHomeResultRsp extends BasePacket { public PacketPlayerApplyEnterHomeResultRsp(int uid, boolean agreed) { super(PacketOpcodes.PlayerApplyEnterHomeResultRsp); - this.setData(PlayerApplyEnterHomeResultRspOuterClass.PlayerApplyEnterHomeResultRsp.newBuilder() - .setApplyUid(uid) - .setIsAgreed(agreed)); + this.setData( + PlayerApplyEnterHomeResultRspOuterClass.PlayerApplyEnterHomeResultRsp.newBuilder() + .setApplyUid(uid) + .setIsAgreed(agreed)); } } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerCookRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerCookRsp.java index 8578e7275..f677247a8 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerCookRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerCookRsp.java @@ -6,7 +6,6 @@ import emu.grasscutter.net.proto.CookRecipeDataOuterClass.CookRecipeData; import emu.grasscutter.net.proto.ItemParamOuterClass.ItemParam; import emu.grasscutter.net.proto.PlayerCookRspOuterClass.PlayerCookRsp; import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode; - import java.util.List; public class PacketPlayerCookRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerEnterSceneNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerEnterSceneNotify.java index 45ed81560..51878221d 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerEnterSceneNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerEnterSceneNotify.java @@ -20,30 +20,30 @@ public class PacketPlayerEnterSceneNotify extends BasePacket { player.setEnterSceneToken(Utils.randomRange(1000, 99999)); var proto = - PlayerEnterSceneNotify.newBuilder() - .setSceneId(player.getSceneId()) - .setPos(player.getPosition().toProto()) - .setSceneBeginTime(System.currentTimeMillis()) - .setType(EnterType.ENTER_TYPE_SELF) - .setTargetUid(player.getUid()) - .setEnterSceneToken(player.getEnterSceneToken()) - .setWorldLevel(player.getWorldLevel()) - .setEnterReason(EnterReason.Login.getValue()) - .setIsFirstLoginEnterScene(player.isFirstLoginEnterScene()) - .setWorldType(1) - .setSceneTransaction( - "3-" - + player.getUid() - + "-" - + (int) (System.currentTimeMillis() / 1000) - + "-" - + 18402); + PlayerEnterSceneNotify.newBuilder() + .setSceneId(player.getSceneId()) + .setPos(player.getPosition().toProto()) + .setSceneBeginTime(System.currentTimeMillis()) + .setType(EnterType.ENTER_TYPE_SELF) + .setTargetUid(player.getUid()) + .setEnterSceneToken(player.getEnterSceneToken()) + .setWorldLevel(player.getWorldLevel()) + .setEnterReason(EnterReason.Login.getValue()) + .setIsFirstLoginEnterScene(player.isFirstLoginEnterScene()) + .setWorldType(1) + .setSceneTransaction( + "3-" + + player.getUid() + + "-" + + (int) (System.currentTimeMillis() / 1000) + + "-" + + 18402); this.setData(proto); } public PacketPlayerEnterSceneNotify( - Player player, EnterType type, EnterReason reason, int newScene, Position newPos) { + Player player, EnterType type, EnterReason reason, int newScene, Position newPos) { this(player, player, type, reason, newScene, newPos); } @@ -52,52 +52,52 @@ public class PacketPlayerEnterSceneNotify extends BasePacket { } public PacketPlayerEnterSceneNotify( - Player player, - Player target, - EnterType type, - EnterReason reason, - int newScene, - Position newPos) { + Player player, + Player target, + EnterType type, + EnterReason reason, + int newScene, + Position newPos) { this( - player, - target, - TeleportProperties.builder() - .enterType(type) - .enterReason(reason) - .sceneId(newScene) - .teleportTo(newPos) - .build()); + player, + target, + TeleportProperties.builder() + .enterType(type) + .enterReason(reason) + .sceneId(newScene) + .teleportTo(newPos) + .build()); } // Teleport or go somewhere public PacketPlayerEnterSceneNotify( - Player player, Player target, TeleportProperties teleportProperties) { + Player player, Player target, TeleportProperties teleportProperties) { super(PacketOpcodes.PlayerEnterSceneNotify); player.setSceneLoadState(SceneLoadState.LOADING); player.setEnterSceneToken(Utils.randomRange(1000, 99999)); var proto = - PlayerEnterSceneNotify.newBuilder() - .setPrevSceneId(player.getSceneId()) - .setPrevPos(player.getPosition().toProto()) - .setSceneId(teleportProperties.getSceneId()) - .setPos(teleportProperties.getTeleportTo().toProto()) - .setSceneBeginTime(System.currentTimeMillis()) - .setType(teleportProperties.getEnterType()) - .setTargetUid(target.getUid()) - .setEnterSceneToken(player.getEnterSceneToken()) - .setWorldLevel(target.getWorld().getWorldLevel()) - .setEnterReason(teleportProperties.getEnterReason().getValue()) - .setWorldType(1) - .setSceneTransaction( - teleportProperties.getSceneId() - + "-" - + target.getUid() - + "-" - + (int) (System.currentTimeMillis() / 1000) - + "-" - + 18402); + PlayerEnterSceneNotify.newBuilder() + .setPrevSceneId(player.getSceneId()) + .setPrevPos(player.getPosition().toProto()) + .setSceneId(teleportProperties.getSceneId()) + .setPos(teleportProperties.getTeleportTo().toProto()) + .setSceneBeginTime(System.currentTimeMillis()) + .setType(teleportProperties.getEnterType()) + .setTargetUid(target.getUid()) + .setEnterSceneToken(player.getEnterSceneToken()) + .setWorldLevel(target.getWorld().getWorldLevel()) + .setEnterReason(teleportProperties.getEnterReason().getValue()) + .setWorldType(1) + .setSceneTransaction( + teleportProperties.getSceneId() + + "-" + + target.getUid() + + "-" + + (int) (System.currentTimeMillis() / 1000) + + "-" + + 18402); // Apply the dungeon ID to the packet if it's a dungeon. if (teleportProperties.getDungeonId() != 0) { @@ -109,32 +109,32 @@ public class PacketPlayerEnterSceneNotify extends BasePacket { // Go home public PacketPlayerEnterSceneNotify( - Player player, int targetUid, TeleportProperties teleportProperties, boolean other) { + Player player, int targetUid, TeleportProperties teleportProperties, boolean other) { super(PacketOpcodes.PlayerEnterSceneNotify); player.setSceneLoadState(SceneLoadState.LOADING); player.setEnterSceneToken(Utils.randomRange(1000, 99999)); var proto = - PlayerEnterSceneNotify.newBuilder() - .setPrevSceneId(player.getSceneId()) - .setPrevPos(player.getPosition().toProto()) - .setSceneId(teleportProperties.getSceneId()) - .setPos(teleportProperties.getTeleportTo().toProto()) - .setSceneBeginTime(System.currentTimeMillis()) - .setType(other ? EnterType.ENTER_TYPE_OTHER_HOME : EnterType.ENTER_TYPE_SELF_HOME) - .setTargetUid(targetUid) - .setEnterSceneToken(player.getEnterSceneToken()) - .setEnterReason(teleportProperties.getEnterReason().getValue()) - .setWorldType(64) - .setSceneTransaction( - teleportProperties.getSceneId() - + "-" - + targetUid - + "-" - + (int) (System.currentTimeMillis() / 1000) - + "-" - + 27573); + PlayerEnterSceneNotify.newBuilder() + .setPrevSceneId(player.getSceneId()) + .setPrevPos(player.getPosition().toProto()) + .setSceneId(teleportProperties.getSceneId()) + .setPos(teleportProperties.getTeleportTo().toProto()) + .setSceneBeginTime(System.currentTimeMillis()) + .setType(other ? EnterType.ENTER_TYPE_OTHER_HOME : EnterType.ENTER_TYPE_SELF_HOME) + .setTargetUid(targetUid) + .setEnterSceneToken(player.getEnterSceneToken()) + .setEnterReason(teleportProperties.getEnterReason().getValue()) + .setWorldType(64) + .setSceneTransaction( + teleportProperties.getSceneId() + + "-" + + targetUid + + "-" + + (int) (System.currentTimeMillis() / 1000) + + "-" + + 27573); this.setData(proto); } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerLevelRewardUpdateNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerLevelRewardUpdateNotify.java index 9f1baccfd..a0f9d57f6 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerLevelRewardUpdateNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerLevelRewardUpdateNotify.java @@ -2,7 +2,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.PlayerLevelRewardUpdateNotifyOuterClass.PlayerLevelRewardUpdateNotify; - import java.util.Set; public class PacketPlayerLevelRewardUpdateNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerLoginRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerLoginRsp.java index a9944a573..6db0767fd 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerLoginRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerLoginRsp.java @@ -1,5 +1,7 @@ package emu.grasscutter.server.packet.send; +import static emu.grasscutter.config.Configuration.*; + import com.google.protobuf.ByteString; import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter.ServerRunMode; @@ -10,11 +12,8 @@ import emu.grasscutter.net.proto.RegionInfoOuterClass.RegionInfo; import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.http.dispatch.RegionHandler; import emu.grasscutter.utils.Crypto; - import java.util.Objects; -import static emu.grasscutter.config.Configuration.*; - public class PacketPlayerLoginRsp extends BasePacket { private static QueryCurrRegionHttpRspOuterClass.QueryCurrRegionHttpRsp regionCache; diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerPreEnterMpNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerPreEnterMpNotify.java index 1dda55e77..7662e165e 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerPreEnterMpNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerPreEnterMpNotify.java @@ -8,9 +8,10 @@ public class PacketPlayerPreEnterMpNotify extends BasePacket { public PacketPlayerPreEnterMpNotify(Player player) { super(PacketOpcodes.PlayerPreEnterMpNotify); - this.setData(PlayerPreEnterMpNotifyOuterClass.PlayerPreEnterMpNotify.newBuilder() - .setUid(player.getUid()) - .setNickname(player.getNickname()) - .setState(PlayerPreEnterMpNotifyOuterClass.PlayerPreEnterMpNotify.State.START)); + this.setData( + PlayerPreEnterMpNotifyOuterClass.PlayerPreEnterMpNotify.newBuilder() + .setUid(player.getUid()) + .setNickname(player.getNickname()) + .setState(PlayerPreEnterMpNotifyOuterClass.PlayerPreEnterMpNotify.State.START)); } } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerStoreNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerStoreNotify.java index d2f4afbfd..4e63e8bd0 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerStoreNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerStoreNotify.java @@ -1,5 +1,7 @@ package emu.grasscutter.server.packet.send; +import static emu.grasscutter.config.Configuration.GAME_OPTIONS; + import emu.grasscutter.game.inventory.GameItem; import emu.grasscutter.game.player.Player; import emu.grasscutter.net.packet.*; @@ -7,8 +9,6 @@ import emu.grasscutter.net.proto.ItemOuterClass.Item; import emu.grasscutter.net.proto.PlayerStoreNotifyOuterClass.PlayerStoreNotify; import emu.grasscutter.net.proto.StoreTypeOuterClass.StoreType; -import static emu.grasscutter.config.Configuration.GAME_OPTIONS; - public class PacketPlayerStoreNotify extends BasePacket { public PacketPlayerStoreNotify(Player player) { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerWorldSceneInfoListNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerWorldSceneInfoListNotify.java index b3347ba50..e81ddb617 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerWorldSceneInfoListNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerWorldSceneInfoListNotify.java @@ -6,7 +6,6 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.MapLayerInfoOuterClass; import emu.grasscutter.net.proto.PlayerWorldSceneInfoListNotifyOuterClass.PlayerWorldSceneInfoListNotify; import emu.grasscutter.net.proto.PlayerWorldSceneInfoOuterClass.PlayerWorldSceneInfo; - import java.util.stream.IntStream; public class PacketPlayerWorldSceneInfoListNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketPullPrivateChatRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketPullPrivateChatRsp.java index a25c4eb49..dbcca76cc 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketPullPrivateChatRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketPullPrivateChatRsp.java @@ -4,7 +4,6 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.ChatInfoOuterClass.ChatInfo; import emu.grasscutter.net.proto.PullPrivateChatRspOuterClass.PullPrivateChatRsp; import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode; - import java.util.List; public class PacketPullPrivateChatRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketPullRecentChatRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketPullRecentChatRsp.java index 86826898a..1f65d4abf 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketPullRecentChatRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketPullRecentChatRsp.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.ChatInfoOuterClass.ChatInfo; import emu.grasscutter.net.proto.PullRecentChatRspOuterClass.PullRecentChatRsp; - import java.util.List; public class PacketPullRecentChatRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketQueryCodexMonsterBeKilledNumRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketQueryCodexMonsterBeKilledNumRsp.java index 452f271fd..6d88c0f2e 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketQueryCodexMonsterBeKilledNumRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketQueryCodexMonsterBeKilledNumRsp.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.game.player.Player; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.QueryCodexMonsterBeKilledNumRspOuterClass.QueryCodexMonsterBeKilledNumRsp; - import java.util.List; public class PacketQueryCodexMonsterBeKilledNumRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketQuestListUpdateNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketQuestListUpdateNotify.java index 497769e8a..ecec61924 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketQuestListUpdateNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketQuestListUpdateNotify.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.game.quest.GameQuest; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.QuestListUpdateNotifyOuterClass.QuestListUpdateNotify; - import java.util.List; public class PacketQuestListUpdateNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketQuestUpdateQuestVarNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketQuestUpdateQuestVarNotify.java index 174c8fe81..73c190d6c 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketQuestUpdateQuestVarNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketQuestUpdateQuestVarNotify.java @@ -2,7 +2,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.QuestUpdateQuestVarNotifyOuterClass.QuestUpdateQuestVarNotify; - import java.util.stream.IntStream; public class PacketQuestUpdateQuestVarNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketReliquaryDecomposeRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketReliquaryDecomposeRsp.java index 15ed7fe0a..469775ec7 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketReliquaryDecomposeRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketReliquaryDecomposeRsp.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.ReliquaryDecomposeRspOuterClass.ReliquaryDecomposeRsp; import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode; - import java.util.List; public class PacketReliquaryDecomposeRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketReliquaryUpgradeRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketReliquaryUpgradeRsp.java index 4fc775cbf..a6a4d5603 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketReliquaryUpgradeRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketReliquaryUpgradeRsp.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.game.inventory.GameItem; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.ReliquaryUpgradeRspOuterClass.ReliquaryUpgradeRsp; - import java.util.List; public class PacketReliquaryUpgradeRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketSceneAudioNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketSceneAudioNotify.java index 70c5d1c48..be9df688c 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketSceneAudioNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketSceneAudioNotify.java @@ -2,7 +2,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.SceneAudioNotifyOuterClass; - import java.util.List; public class PacketSceneAudioNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketSceneEntityAppearNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketSceneEntityAppearNotify.java index 5f4ccc25f..446c190a7 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketSceneEntityAppearNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketSceneEntityAppearNotify.java @@ -5,7 +5,6 @@ import emu.grasscutter.game.player.Player; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.SceneEntityAppearNotifyOuterClass.SceneEntityAppearNotify; import emu.grasscutter.net.proto.VisionTypeOuterClass.VisionType; - import java.util.Collection; public class PacketSceneEntityAppearNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketSceneEntityDisappearNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketSceneEntityDisappearNotify.java index 73f59c91a..0bc6c5ba1 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketSceneEntityDisappearNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketSceneEntityDisappearNotify.java @@ -4,7 +4,6 @@ import emu.grasscutter.game.entity.GameEntity; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.SceneEntityDisappearNotifyOuterClass.SceneEntityDisappearNotify; import emu.grasscutter.net.proto.VisionTypeOuterClass.VisionType; - import java.util.Collection; public class PacketSceneEntityDisappearNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketSceneEntityUpdateNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketSceneEntityUpdateNotify.java index 100bac49f..d10e5a3bf 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketSceneEntityUpdateNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketSceneEntityUpdateNotify.java @@ -5,7 +5,6 @@ import emu.grasscutter.game.player.Player; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.SceneEntityUpdateNotifyOuterClass.SceneEntityUpdateNotify; import emu.grasscutter.net.proto.VisionTypeOuterClass.VisionType; - import java.util.Collection; public class PacketSceneEntityUpdateNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketSceneForceLockNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketSceneForceLockNotify.java index 60f119829..011bda40f 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketSceneForceLockNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketSceneForceLockNotify.java @@ -2,9 +2,8 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.SceneForceLockNotifyOuterClass.SceneForceLockNotify; -import lombok.val; - import java.util.Collection; +import lombok.val; public class PacketSceneForceLockNotify extends BasePacket { public PacketSceneForceLockNotify(Collection locked) { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketSceneForceUnlockNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketSceneForceUnlockNotify.java index 28b301fdc..704d61348 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketSceneForceUnlockNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketSceneForceUnlockNotify.java @@ -2,9 +2,8 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.SceneForceUnlockNotifyOuterClass.SceneForceUnlockNotify; -import lombok.val; - import java.util.Collection; +import lombok.val; public class PacketSceneForceUnlockNotify extends BasePacket { public PacketSceneForceUnlockNotify(Collection unlocked, boolean isAdd) { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketScenePlayerSoundNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketScenePlayerSoundNotify.java index 316fdb796..aa9b5133b 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketScenePlayerSoundNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketScenePlayerSoundNotify.java @@ -5,7 +5,6 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.ScenePlayerSoundNotifyOuterClass.ScenePlayerSoundNotify; import emu.grasscutter.net.proto.ScenePlayerSoundNotifyOuterClass.ScenePlayerSoundNotify.PlaySoundType; import emu.grasscutter.net.proto.VectorOuterClass.Vector; - import java.util.Objects; public class PacketScenePlayerSoundNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketServerAnnounceNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketServerAnnounceNotify.java index 84b0d9527..d31b11d1a 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketServerAnnounceNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketServerAnnounceNotify.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.*; import emu.grasscutter.utils.Utils; - import java.util.List; public class PacketServerAnnounceNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketServerBuffChangeNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketServerBuffChangeNotify.java index 53058b115..ce7a263ab 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketServerBuffChangeNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketServerBuffChangeNotify.java @@ -5,7 +5,6 @@ import emu.grasscutter.game.player.PlayerBuffManager.PlayerBuff; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.ServerBuffChangeNotifyOuterClass.ServerBuffChangeNotify; import emu.grasscutter.net.proto.ServerBuffChangeNotifyOuterClass.ServerBuffChangeNotify.ServerBuffChangeType; - import java.util.Collection; import java.util.stream.Stream; diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketStoreItemChangeNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketStoreItemChangeNotify.java index 45c0ce1cb..6479354d7 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketStoreItemChangeNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketStoreItemChangeNotify.java @@ -4,7 +4,6 @@ import emu.grasscutter.game.inventory.GameItem; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.StoreItemChangeNotifyOuterClass.StoreItemChangeNotify; import emu.grasscutter.net.proto.StoreTypeOuterClass.StoreType; - import java.util.Collection; public class PacketStoreItemChangeNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketStoreItemDelNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketStoreItemDelNotify.java index 047cfe670..aa1ea7bed 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketStoreItemDelNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketStoreItemDelNotify.java @@ -4,7 +4,6 @@ import emu.grasscutter.game.inventory.GameItem; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.StoreItemDelNotifyOuterClass.StoreItemDelNotify; import emu.grasscutter.net.proto.StoreTypeOuterClass.StoreType; - import java.util.Collection; public class PacketStoreItemDelNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketStoreWeightLimitNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketStoreWeightLimitNotify.java index 33b8989ff..99b925747 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketStoreWeightLimitNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketStoreWeightLimitNotify.java @@ -1,11 +1,11 @@ package emu.grasscutter.server.packet.send; +import static emu.grasscutter.config.Configuration.INVENTORY_LIMITS; + import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.StoreTypeOuterClass.StoreType; import emu.grasscutter.net.proto.StoreWeightLimitNotifyOuterClass.StoreWeightLimitNotify; -import static emu.grasscutter.config.Configuration.INVENTORY_LIMITS; - public class PacketStoreWeightLimitNotify extends BasePacket { public PacketStoreWeightLimitNotify() { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketTakeAchievementGoalRewardRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketTakeAchievementGoalRewardRsp.java index 1d231a39d..5cc57ac3d 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketTakeAchievementGoalRewardRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketTakeAchievementGoalRewardRsp.java @@ -2,7 +2,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.*; - import java.util.List; public class PacketTakeAchievementGoalRewardRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketTakeAchievementRewardRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketTakeAchievementRewardRsp.java index 0c0246c62..82c79a299 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketTakeAchievementRewardRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketTakeAchievementRewardRsp.java @@ -2,7 +2,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.*; - import java.util.List; public class PacketTakeAchievementRewardRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketTakeBattlePassRewardRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketTakeBattlePassRewardRsp.java index 270e1fea1..585d283eb 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketTakeBattlePassRewardRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketTakeBattlePassRewardRsp.java @@ -5,7 +5,6 @@ import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.BattlePassRewardTakeOptionOuterClass.BattlePassRewardTakeOption; import emu.grasscutter.net.proto.ItemParamOuterClass.ItemParam; import emu.grasscutter.net.proto.TakeBattlePassRewardRspOuterClass.TakeBattlePassRewardRsp; - import java.util.List; public class PacketTakeBattlePassRewardRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketTakeFurnitureMakeRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketTakeFurnitureMakeRsp.java index 88c7108e9..c30b5c588 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketTakeFurnitureMakeRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketTakeFurnitureMakeRsp.java @@ -2,7 +2,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.*; - import java.util.List; public class PacketTakeFurnitureMakeRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketTowerAllDataRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketTowerAllDataRsp.java index bbb3e5408..49695555c 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketTowerAllDataRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketTowerAllDataRsp.java @@ -7,7 +7,6 @@ import emu.grasscutter.net.proto.TowerCurLevelRecordOuterClass.TowerCurLevelReco import emu.grasscutter.net.proto.TowerFloorRecordOuterClass.TowerFloorRecord; import emu.grasscutter.net.proto.TowerLevelRecordOuterClass; import emu.grasscutter.utils.helpers.DateHelper; - import java.util.*; import java.util.stream.*; diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketTryEnterHomeRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketTryEnterHomeRsp.java index d6c91fc8a..752e854af 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketTryEnterHomeRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketTryEnterHomeRsp.java @@ -20,9 +20,7 @@ public class PacketTryEnterHomeRsp extends BasePacket { super(PacketOpcodes.TryEnterHomeRsp); TryEnterHomeRspOuterClass.TryEnterHomeRsp proto = - TryEnterHomeRspOuterClass.TryEnterHomeRsp.newBuilder() - .setTargetUid(uid) - .build(); + TryEnterHomeRspOuterClass.TryEnterHomeRsp.newBuilder().setTargetUid(uid).build(); this.setData(proto); } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketUnlockedFurnitureFormulaDataNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketUnlockedFurnitureFormulaDataNotify.java index c5c33c294..a73523de2 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketUnlockedFurnitureFormulaDataNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketUnlockedFurnitureFormulaDataNotify.java @@ -2,7 +2,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.UnlockedFurnitureFormulaDataNotifyOuterClass; - import java.util.Set; public class PacketUnlockedFurnitureFormulaDataNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketUnlockedFurnitureSuiteDataNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketUnlockedFurnitureSuiteDataNotify.java index 336679926..50ef81cd7 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketUnlockedFurnitureSuiteDataNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketUnlockedFurnitureSuiteDataNotify.java @@ -2,7 +2,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.UnlockedFurnitureSuiteDataNotifyOuterClass; - import java.util.Set; public class PacketUnlockedFurnitureSuiteDataNotify extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketUpdatePlayerShowAvatarListRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketUpdatePlayerShowAvatarListRsp.java index f47eef050..cdf569030 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketUpdatePlayerShowAvatarListRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketUpdatePlayerShowAvatarListRsp.java @@ -2,7 +2,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.UpdatePlayerShowAvatarListRspOuterClass.UpdatePlayerShowAvatarListRsp; - import java.util.List; public class PacketUpdatePlayerShowAvatarListRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketUpdatePlayerShowNameCardListRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketUpdatePlayerShowNameCardListRsp.java index 9afcddb0b..f60ae7ff9 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketUpdatePlayerShowNameCardListRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketUpdatePlayerShowNameCardListRsp.java @@ -2,7 +2,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.UpdatePlayerShowNameCardListRspOuterClass; - import java.util.List; public class PacketUpdatePlayerShowNameCardListRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketWeaponUpgradeRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketWeaponUpgradeRsp.java index 06ff03c41..5d36e7fce 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketWeaponUpgradeRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketWeaponUpgradeRsp.java @@ -4,7 +4,6 @@ import emu.grasscutter.game.inventory.GameItem; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.ItemParamOuterClass.ItemParam; import emu.grasscutter.net.proto.WeaponUpgradeRspOuterClass.WeaponUpgradeRsp; - import java.util.List; public class PacketWeaponUpgradeRsp extends BasePacket { diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketWidgetGadgetDataNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketWidgetGadgetDataNotify.java index fa83095c8..69af57cda 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketWidgetGadgetDataNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketWidgetGadgetDataNotify.java @@ -2,7 +2,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.*; - import java.io.IOException; import java.util.List; diff --git a/src/main/java/emu/grasscutter/server/scheduler/AsyncServerTask.java b/src/main/java/emu/grasscutter/server/scheduler/AsyncServerTask.java index 264a80ff3..38e4c2a02 100644 --- a/src/main/java/emu/grasscutter/server/scheduler/AsyncServerTask.java +++ b/src/main/java/emu/grasscutter/server/scheduler/AsyncServerTask.java @@ -1,8 +1,7 @@ package emu.grasscutter.server.scheduler; -import lombok.Getter; - import javax.annotation.Nullable; +import lombok.Getter; /** A server task that should be run asynchronously. */ public final class AsyncServerTask implements Runnable { diff --git a/src/main/java/emu/grasscutter/task/TaskMap.java b/src/main/java/emu/grasscutter/task/TaskMap.java index 313032af0..f9da26241 100644 --- a/src/main/java/emu/grasscutter/task/TaskMap.java +++ b/src/main/java/emu/grasscutter/task/TaskMap.java @@ -1,12 +1,11 @@ package emu.grasscutter.task; import emu.grasscutter.Grasscutter; +import java.util.*; import org.quartz.*; import org.quartz.impl.StdSchedulerFactory; import org.reflections.Reflections; -import java.util.*; - @SuppressWarnings({"UnusedReturnValue", "unused"}) public final class TaskMap { private final Map tasks = new HashMap<>(); diff --git a/src/main/java/emu/grasscutter/task/tasks/AnnouncementTask.java b/src/main/java/emu/grasscutter/task/tasks/AnnouncementTask.java index ee9531aed..57f574f1b 100644 --- a/src/main/java/emu/grasscutter/task/tasks/AnnouncementTask.java +++ b/src/main/java/emu/grasscutter/task/tasks/AnnouncementTask.java @@ -3,11 +3,10 @@ package emu.grasscutter.task.tasks; import emu.grasscutter.Grasscutter; import emu.grasscutter.game.systems.AnnouncementSystem; import emu.grasscutter.task.*; -import org.quartz.*; - import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; +import org.quartz.*; @Task( taskName = "Announcement", diff --git a/src/main/java/emu/grasscutter/tools/Dumpers.java b/src/main/java/emu/grasscutter/tools/Dumpers.java index 6ba57689e..d3e7b35e5 100644 --- a/src/main/java/emu/grasscutter/tools/Dumpers.java +++ b/src/main/java/emu/grasscutter/tools/Dumpers.java @@ -7,12 +7,11 @@ import emu.grasscutter.game.inventory.ItemType; import emu.grasscutter.game.props.SceneType; import emu.grasscutter.utils.JsonUtils; import emu.grasscutter.utils.lang.Language; -import lombok.AllArgsConstructor; - import java.io.*; import java.nio.file.Files; import java.util.*; import java.util.stream.Collectors; +import lombok.AllArgsConstructor; public interface Dumpers { // See `src/handbook/data/README.md` for attributions. diff --git a/src/main/java/emu/grasscutter/tools/Tools.java b/src/main/java/emu/grasscutter/tools/Tools.java index e28ea00fa..a611acb89 100644 --- a/src/main/java/emu/grasscutter/tools/Tools.java +++ b/src/main/java/emu/grasscutter/tools/Tools.java @@ -1,5 +1,8 @@ package emu.grasscutter.tools; +import static emu.grasscutter.utils.FileUtils.getResourcePath; +import static emu.grasscutter.utils.lang.Language.getTextMapKey; + import emu.grasscutter.*; import emu.grasscutter.command.*; import emu.grasscutter.data.*; @@ -11,8 +14,6 @@ import emu.grasscutter.utils.*; import emu.grasscutter.utils.lang.Language; import emu.grasscutter.utils.lang.Language.TextStrings; import it.unimi.dsi.fastutil.ints.*; -import lombok.*; - import java.io.*; import java.nio.charset.StandardCharsets; import java.nio.file.*; @@ -21,9 +22,7 @@ import java.time.format.DateTimeFormatter; import java.util.*; import java.util.function.Function; import java.util.stream.*; - -import static emu.grasscutter.utils.FileUtils.getResourcePath; -import static emu.grasscutter.utils.lang.Language.getTextMapKey; +import lombok.*; public final class Tools { /** diff --git a/src/main/java/emu/grasscutter/utils/Crypto.java b/src/main/java/emu/grasscutter/utils/Crypto.java index 9a48f9601..d9f4a8403 100644 --- a/src/main/java/emu/grasscutter/utils/Crypto.java +++ b/src/main/java/emu/grasscutter/utils/Crypto.java @@ -2,14 +2,13 @@ package emu.grasscutter.utils; import emu.grasscutter.Grasscutter; import emu.grasscutter.server.http.objects.QueryCurRegionRspJson; - -import javax.crypto.Cipher; import java.io.ByteArrayOutputStream; import java.nio.file.Path; import java.security.*; import java.security.spec.*; import java.util.*; import java.util.regex.Pattern; +import javax.crypto.Cipher; public final class Crypto { diff --git a/src/main/java/emu/grasscutter/utils/DispatchUtils.java b/src/main/java/emu/grasscutter/utils/DispatchUtils.java index ab3beb013..3112c9bd6 100644 --- a/src/main/java/emu/grasscutter/utils/DispatchUtils.java +++ b/src/main/java/emu/grasscutter/utils/DispatchUtils.java @@ -1,5 +1,7 @@ package emu.grasscutter.utils; +import static emu.grasscutter.config.Configuration.DISPATCH_INFO; + import com.google.gson.JsonObject; import emu.grasscutter.Grasscutter; import emu.grasscutter.auth.AuthenticationSystem.AuthenticationRequest; @@ -10,11 +12,8 @@ import emu.grasscutter.server.http.handlers.GachaHandler; import emu.grasscutter.server.http.objects.LoginTokenRequestJson; import emu.grasscutter.utils.objects.*; import emu.grasscutter.utils.objects.HandbookBody.*; - -import javax.annotation.Nullable; import java.util.concurrent.*; - -import static emu.grasscutter.config.Configuration.DISPATCH_INFO; +import javax.annotation.Nullable; public interface DispatchUtils { /** diff --git a/src/main/java/emu/grasscutter/utils/FileUtils.java b/src/main/java/emu/grasscutter/utils/FileUtils.java index 97f100659..0b1ab4fd1 100644 --- a/src/main/java/emu/grasscutter/utils/FileUtils.java +++ b/src/main/java/emu/grasscutter/utils/FileUtils.java @@ -1,15 +1,14 @@ package emu.grasscutter.utils; import emu.grasscutter.Grasscutter; -import lombok.val; - import java.io.*; import java.net.URISyntaxException; import java.nio.charset.StandardCharsets; -import java.nio.file.FileSystem; import java.nio.file.*; +import java.nio.file.FileSystem; import java.util.*; import java.util.stream.*; +import lombok.val; public final class FileUtils { private static final Path DATA_DEFAULT_PATH; diff --git a/src/main/java/emu/grasscutter/utils/JsonAdapters.java b/src/main/java/emu/grasscutter/utils/JsonAdapters.java index 9eaf1f51e..a44e46bac 100644 --- a/src/main/java/emu/grasscutter/utils/JsonAdapters.java +++ b/src/main/java/emu/grasscutter/utils/JsonAdapters.java @@ -7,11 +7,10 @@ import emu.grasscutter.data.common.DynamicFloat; import emu.grasscutter.game.world.*; import it.unimi.dsi.fastutil.floats.FloatArrayList; import it.unimi.dsi.fastutil.ints.*; -import lombok.val; - import java.io.IOException; import java.lang.reflect.Field; import java.util.*; +import lombok.val; public interface JsonAdapters { class DynamicFloatAdapter extends TypeAdapter { diff --git a/src/main/java/emu/grasscutter/utils/JsonUtils.java b/src/main/java/emu/grasscutter/utils/JsonUtils.java index fab55908a..024b40a37 100644 --- a/src/main/java/emu/grasscutter/utils/JsonUtils.java +++ b/src/main/java/emu/grasscutter/utils/JsonUtils.java @@ -7,7 +7,6 @@ import emu.grasscutter.game.world.*; import emu.grasscutter.utils.JsonAdapters.*; import emu.grasscutter.utils.objects.JObject; import it.unimi.dsi.fastutil.ints.IntList; - import java.io.*; import java.lang.reflect.Type; import java.nio.charset.StandardCharsets; diff --git a/src/main/java/emu/grasscutter/utils/StartupArguments.java b/src/main/java/emu/grasscutter/utils/StartupArguments.java index 3b7e7cbdc..1aae558bb 100644 --- a/src/main/java/emu/grasscutter/utils/StartupArguments.java +++ b/src/main/java/emu/grasscutter/utils/StartupArguments.java @@ -1,15 +1,14 @@ package emu.grasscutter.utils; +import static emu.grasscutter.config.Configuration.*; + import ch.qos.logback.classic.*; import emu.grasscutter.*; import emu.grasscutter.net.packet.PacketOpcodesUtils; import emu.grasscutter.tools.Dumpers; -import org.slf4j.LoggerFactory; - import java.util.*; import java.util.function.Function; - -import static emu.grasscutter.config.Configuration.*; +import org.slf4j.LoggerFactory; /** A parser for start-up arguments. */ public interface StartupArguments { diff --git a/src/main/java/emu/grasscutter/utils/TsvUtils.java b/src/main/java/emu/grasscutter/utils/TsvUtils.java index d89497466..a61d75548 100644 --- a/src/main/java/emu/grasscutter/utils/TsvUtils.java +++ b/src/main/java/emu/grasscutter/utils/TsvUtils.java @@ -1,13 +1,13 @@ package emu.grasscutter.utils; +import static emu.grasscutter.utils.Utils.nonRegexSplit; + import com.google.gson.*; import com.google.gson.annotations.SerializedName; import emu.grasscutter.Grasscutter; import it.unimi.dsi.fastutil.Pair; import it.unimi.dsi.fastutil.ints.*; import it.unimi.dsi.fastutil.objects.Object2IntArrayMap; -import lombok.val; - import java.io.IOException; import java.lang.reflect.*; import java.nio.charset.StandardCharsets; @@ -15,8 +15,7 @@ import java.nio.file.*; import java.util.*; import java.util.function.Function; import java.util.stream.*; - -import static emu.grasscutter.utils.Utils.nonRegexSplit; +import lombok.val; // Throughout this file, commented System.out.println debug log calls are left in. // This is because the default logger will deadlock when operating on parallel streams. diff --git a/src/main/java/emu/grasscutter/utils/Utils.java b/src/main/java/emu/grasscutter/utils/Utils.java index b0a27c3fb..435d6d0f1 100644 --- a/src/main/java/emu/grasscutter/utils/Utils.java +++ b/src/main/java/emu/grasscutter/utils/Utils.java @@ -1,5 +1,8 @@ package emu.grasscutter.utils; +import static emu.grasscutter.utils.FileUtils.getResourcePath; +import static emu.grasscutter.utils.lang.Language.translate; + import emu.grasscutter.Grasscutter; import emu.grasscutter.config.ConfigContainer; import emu.grasscutter.data.DataLoader; @@ -8,9 +11,6 @@ import emu.grasscutter.utils.objects.Returnable; import io.javalin.http.Context; import io.netty.buffer.*; import it.unimi.dsi.fastutil.ints.*; -import org.slf4j.Logger; - -import javax.annotation.Nullable; import java.io.*; import java.lang.reflect.Field; import java.nio.charset.StandardCharsets; @@ -19,9 +19,8 @@ import java.time.*; import java.time.temporal.TemporalAdjusters; import java.util.*; import java.util.concurrent.ThreadLocalRandom; - -import static emu.grasscutter.utils.FileUtils.getResourcePath; -import static emu.grasscutter.utils.lang.Language.translate; +import javax.annotation.Nullable; +import org.slf4j.Logger; @SuppressWarnings({"UnusedReturnValue", "BooleanMethodIsAlwaysInverted"}) public final class Utils { diff --git a/src/main/java/emu/grasscutter/utils/lang/Language.java b/src/main/java/emu/grasscutter/utils/lang/Language.java index e0c1df11f..25bf8bdbd 100644 --- a/src/main/java/emu/grasscutter/utils/lang/Language.java +++ b/src/main/java/emu/grasscutter/utils/lang/Language.java @@ -1,5 +1,8 @@ package emu.grasscutter.utils.lang; +import static emu.grasscutter.config.Configuration.FALLBACK_LANGUAGE; +import static emu.grasscutter.utils.FileUtils.*; + import com.google.gson.*; import emu.grasscutter.Grasscutter; import emu.grasscutter.data.*; @@ -8,8 +11,6 @@ import emu.grasscutter.game.player.Player; import emu.grasscutter.utils.*; import it.unimi.dsi.fastutil.ints.*; import it.unimi.dsi.fastutil.objects.*; -import lombok.EqualsAndHashCode; - import java.io.*; import java.nio.charset.StandardCharsets; import java.nio.file.*; @@ -17,9 +18,7 @@ import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.regex.*; import java.util.stream.*; - -import static emu.grasscutter.config.Configuration.FALLBACK_LANGUAGE; -import static emu.grasscutter.utils.FileUtils.*; +import lombok.EqualsAndHashCode; public final class Language { private static final Map cachedLanguages = new ConcurrentHashMap<>(); diff --git a/src/main/java/emu/grasscutter/utils/objects/FieldFetch.java b/src/main/java/emu/grasscutter/utils/objects/FieldFetch.java index 7b864e743..34c1f4afe 100644 --- a/src/main/java/emu/grasscutter/utils/objects/FieldFetch.java +++ b/src/main/java/emu/grasscutter/utils/objects/FieldFetch.java @@ -3,7 +3,6 @@ package emu.grasscutter.utils.objects; import com.google.gson.*; import emu.grasscutter.server.dispatch.IDispatcher; import emu.grasscutter.utils.Utils; - import java.lang.reflect.Field; import java.util.HashMap; diff --git a/src/main/java/emu/grasscutter/utils/objects/JLineLogbackAppender.java b/src/main/java/emu/grasscutter/utils/objects/JLineLogbackAppender.java index 715faadbd..c56f81e3f 100644 --- a/src/main/java/emu/grasscutter/utils/objects/JLineLogbackAppender.java +++ b/src/main/java/emu/grasscutter/utils/objects/JLineLogbackAppender.java @@ -3,7 +3,6 @@ package emu.grasscutter.utils.objects; import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.ConsoleAppender; import emu.grasscutter.Grasscutter; - import java.util.Arrays; public final class JLineLogbackAppender extends ConsoleAppender { diff --git a/src/main/java/emu/grasscutter/utils/objects/JObject.java b/src/main/java/emu/grasscutter/utils/objects/JObject.java index 34a331b7d..78a1ac2f9 100644 --- a/src/main/java/emu/grasscutter/utils/objects/JObject.java +++ b/src/main/java/emu/grasscutter/utils/objects/JObject.java @@ -4,7 +4,6 @@ import com.google.gson.*; import com.google.gson.internal.LinkedTreeMap; import com.google.gson.stream.*; import emu.grasscutter.utils.JsonUtils; - import java.io.IOException; /* Replica of JsonObject. Includes chaining. */ diff --git a/src/main/java/emu/grasscutter/utils/objects/ServerLogEventAppender.java b/src/main/java/emu/grasscutter/utils/objects/ServerLogEventAppender.java index 2de8051fc..05a89f170 100644 --- a/src/main/java/emu/grasscutter/utils/objects/ServerLogEventAppender.java +++ b/src/main/java/emu/grasscutter/utils/objects/ServerLogEventAppender.java @@ -4,7 +4,6 @@ import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.AppenderBase; import ch.qos.logback.core.encoder.Encoder; import emu.grasscutter.server.event.internal.ServerLogEvent; - import java.nio.charset.StandardCharsets; public final class ServerLogEventAppender extends AppenderBase { diff --git a/src/main/java/emu/grasscutter/utils/objects/text/Style.java b/src/main/java/emu/grasscutter/utils/objects/text/Style.java index 3754e2e15..588a33f0c 100644 --- a/src/main/java/emu/grasscutter/utils/objects/text/Style.java +++ b/src/main/java/emu/grasscutter/utils/objects/text/Style.java @@ -1,9 +1,8 @@ package emu.grasscutter.utils.objects.text; -import lombok.*; - import java.awt.*; import java.util.*; +import lombok.*; /* Text style container. */ @Builder diff --git a/src/main/java/emu/grasscutter/utils/objects/text/Text.java b/src/main/java/emu/grasscutter/utils/objects/text/Text.java index 2ac900e35..9ffa89715 100644 --- a/src/main/java/emu/grasscutter/utils/objects/text/Text.java +++ b/src/main/java/emu/grasscutter/utils/objects/text/Text.java @@ -1,8 +1,7 @@ package emu.grasscutter.utils.objects.text; -import lombok.*; - import java.awt.*; +import lombok.*; /* An instance of text. */ public final class Text { From 1831d5c81f2fc47c68b316be30f26a359ba2a4d9 Mon Sep 17 00:00:00 2001 From: Moistcrafter <63527712+Moistcrafter@users.noreply.github.com> Date: Fri, 1 Sep 2023 17:35:54 -0700 Subject: [PATCH 03/10] SerializedName MonsterSpecialName (#2331) * SerializedName MonsterSpecialName * uh add space back * remove space --------- Co-authored-by: Magix <27646710+KingRainbow44@users.noreply.github.com> --- .../data/excels/monster/MonsterSpecialNameData.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/emu/grasscutter/data/excels/monster/MonsterSpecialNameData.java b/src/main/java/emu/grasscutter/data/excels/monster/MonsterSpecialNameData.java index f4966f0f5..69b517184 100644 --- a/src/main/java/emu/grasscutter/data/excels/monster/MonsterSpecialNameData.java +++ b/src/main/java/emu/grasscutter/data/excels/monster/MonsterSpecialNameData.java @@ -1,5 +1,6 @@ package emu.grasscutter.data.excels.monster; +import com.google.gson.annotations.SerializedName; import emu.grasscutter.data.*; import emu.grasscutter.data.ResourceType.LoadPriority; import lombok.*; @@ -8,7 +9,9 @@ import lombok.*; @EqualsAndHashCode(callSuper = false) @Data public class MonsterSpecialNameData extends GameResource { + @SerializedName(value = "specialNameId", alternate={"specialNameID"}) private int specialNameId; + @SerializedName(value = "specialNameLabId", alternate={"specialNameLabID"}) private int specialNameLabId; private long specialNameTextMapHash; From c1045103ed4a2c12e2018e00ea451ddfce904607 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 2 Sep 2023 00:37:43 +0000 Subject: [PATCH 04/10] Format code [skip actions] --- .../data/excels/monster/MonsterSpecialNameData.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/emu/grasscutter/data/excels/monster/MonsterSpecialNameData.java b/src/main/java/emu/grasscutter/data/excels/monster/MonsterSpecialNameData.java index 69b517184..b79083486 100644 --- a/src/main/java/emu/grasscutter/data/excels/monster/MonsterSpecialNameData.java +++ b/src/main/java/emu/grasscutter/data/excels/monster/MonsterSpecialNameData.java @@ -9,10 +9,16 @@ import lombok.*; @EqualsAndHashCode(callSuper = false) @Data public class MonsterSpecialNameData extends GameResource { - @SerializedName(value = "specialNameId", alternate={"specialNameID"}) + @SerializedName( + value = "specialNameId", + alternate = {"specialNameID"}) private int specialNameId; - @SerializedName(value = "specialNameLabId", alternate={"specialNameLabID"}) + + @SerializedName( + value = "specialNameLabId", + alternate = {"specialNameLabID"}) private int specialNameLabId; + private long specialNameTextMapHash; @Override From 97138d8c84a1e0fb88d1c899a27a69784cb46216 Mon Sep 17 00:00:00 2001 From: hamusuke Date: Sat, 2 Sep 2023 14:46:58 +0900 Subject: [PATCH 05/10] feat: implement home animals (#2329) --- .../java/emu/grasscutter/data/GameData.java | 48 ++++++++--- .../data/excels/HomeWorldAnimalData.java | 22 +++++ .../game/entity/EntityHomeAnimal.java | 80 +++++++++++++++++++ .../grasscutter/game/entity/Rebornable.java | 15 ++++ .../emu/grasscutter/game/home/HomeScene.java | 61 ++++++++++++++ .../grasscutter/game/home/HomeSceneItem.java | 22 ++++- .../emu/grasscutter/game/home/HomeWorld.java | 37 ++++++++- .../emu/grasscutter/game/world/Scene.java | 31 ++++--- .../grasscutter/server/game/GameServer.java | 26 ++++-- .../recv/HandlerEntityAiKillSelfNotify.java | 19 +++++ .../recv/HandlerHomeChangeEditModeReq.java | 17 +++- .../HandlerHomeEnterEditModeFinishReq.java | 10 ++- 12 files changed, 354 insertions(+), 34 deletions(-) create mode 100644 src/main/java/emu/grasscutter/data/excels/HomeWorldAnimalData.java create mode 100644 src/main/java/emu/grasscutter/game/entity/EntityHomeAnimal.java create mode 100644 src/main/java/emu/grasscutter/game/entity/Rebornable.java create mode 100644 src/main/java/emu/grasscutter/game/home/HomeScene.java create mode 100644 src/main/java/emu/grasscutter/server/packet/recv/HandlerEntityAiKillSelfNotify.java diff --git a/src/main/java/emu/grasscutter/data/GameData.java b/src/main/java/emu/grasscutter/data/GameData.java index 01a450fe5..e3394de82 100644 --- a/src/main/java/emu/grasscutter/data/GameData.java +++ b/src/main/java/emu/grasscutter/data/GameData.java @@ -4,29 +4,51 @@ import emu.grasscutter.Grasscutter; import emu.grasscutter.data.binout.*; import emu.grasscutter.data.binout.config.*; import emu.grasscutter.data.binout.routes.Route; -import emu.grasscutter.data.custom.*; +import emu.grasscutter.data.custom.TrialAvatarActivityCustomData; +import emu.grasscutter.data.custom.TrialAvatarCustomData; import emu.grasscutter.data.excels.*; -import emu.grasscutter.data.excels.achievement.*; -import emu.grasscutter.data.excels.activity.*; +import emu.grasscutter.data.excels.achievement.AchievementData; +import emu.grasscutter.data.excels.achievement.AchievementGoalData; +import emu.grasscutter.data.excels.activity.ActivityCondExcelConfigData; +import emu.grasscutter.data.excels.activity.ActivityData; +import emu.grasscutter.data.excels.activity.ActivityShopData; +import emu.grasscutter.data.excels.activity.ActivityWatcherData; import emu.grasscutter.data.excels.avatar.*; import emu.grasscutter.data.excels.codex.*; import emu.grasscutter.data.excels.dungeon.*; -import emu.grasscutter.data.excels.giving.*; -import emu.grasscutter.data.excels.monster.*; -import emu.grasscutter.data.excels.quest.*; -import emu.grasscutter.data.excels.reliquary.*; +import emu.grasscutter.data.excels.giving.GivingData; +import emu.grasscutter.data.excels.giving.GivingGroupData; +import emu.grasscutter.data.excels.monster.MonsterCurveData; +import emu.grasscutter.data.excels.monster.MonsterData; +import emu.grasscutter.data.excels.monster.MonsterDescribeData; +import emu.grasscutter.data.excels.monster.MonsterSpecialNameData; +import emu.grasscutter.data.excels.quest.QuestData; +import emu.grasscutter.data.excels.quest.QuestGlobalVarData; +import emu.grasscutter.data.excels.reliquary.ReliquaryAffixData; +import emu.grasscutter.data.excels.reliquary.ReliquaryLevelData; +import emu.grasscutter.data.excels.reliquary.ReliquaryMainPropData; +import emu.grasscutter.data.excels.reliquary.ReliquarySetData; import emu.grasscutter.data.excels.scene.*; -import emu.grasscutter.data.excels.tower.*; +import emu.grasscutter.data.excels.tower.TowerFloorData; +import emu.grasscutter.data.excels.tower.TowerLevelData; +import emu.grasscutter.data.excels.tower.TowerScheduleData; import emu.grasscutter.data.excels.trial.*; -import emu.grasscutter.data.excels.weapon.*; -import emu.grasscutter.data.excels.world.*; +import emu.grasscutter.data.excels.weapon.WeaponCurveData; +import emu.grasscutter.data.excels.weapon.WeaponLevelData; +import emu.grasscutter.data.excels.weapon.WeaponPromoteData; +import emu.grasscutter.data.excels.world.WeatherData; +import emu.grasscutter.data.excels.world.WorldAreaData; +import emu.grasscutter.data.excels.world.WorldLevelData; import emu.grasscutter.data.server.*; import emu.grasscutter.game.dungeons.DungeonDropEntry; -import emu.grasscutter.game.quest.*; +import emu.grasscutter.game.quest.QuestEncryptionKey; +import emu.grasscutter.game.quest.RewindData; +import emu.grasscutter.game.quest.TeleportData; import emu.grasscutter.game.quest.enums.QuestCond; import emu.grasscutter.game.world.GroupReplacementData; import emu.grasscutter.utils.Utils; import it.unimi.dsi.fastutil.ints.*; + import java.lang.reflect.Field; import java.util.*; import javax.annotation.Nullable; @@ -257,6 +279,10 @@ public final class GameData { private static final Int2ObjectMap guideTriggerDataMap = new Int2ObjectOpenHashMap<>(); + @Getter + private static final Int2ObjectMap homeWorldAnimalDataMap = + new Int2ObjectOpenHashMap<>(); + @Getter private static final Int2ObjectMap homeWorldBgmDataMap = new Int2ObjectOpenHashMap<>(); diff --git a/src/main/java/emu/grasscutter/data/excels/HomeWorldAnimalData.java b/src/main/java/emu/grasscutter/data/excels/HomeWorldAnimalData.java new file mode 100644 index 000000000..885867a39 --- /dev/null +++ b/src/main/java/emu/grasscutter/data/excels/HomeWorldAnimalData.java @@ -0,0 +1,22 @@ +package emu.grasscutter.data.excels; + +import emu.grasscutter.data.GameResource; +import emu.grasscutter.data.ResourceType; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.experimental.FieldDefaults; + +@ResourceType(name = "HomeworldAnimalExcelConfigData.json") +@FieldDefaults(level = AccessLevel.PRIVATE) +@Getter +public class HomeWorldAnimalData extends GameResource { + int furnitureID; + int monsterID; + int isRebirth; + int rebirthCD; + + @Override + public int getId() { + return this.furnitureID; + } +} diff --git a/src/main/java/emu/grasscutter/game/entity/EntityHomeAnimal.java b/src/main/java/emu/grasscutter/game/entity/EntityHomeAnimal.java new file mode 100644 index 000000000..65807e290 --- /dev/null +++ b/src/main/java/emu/grasscutter/game/entity/EntityHomeAnimal.java @@ -0,0 +1,80 @@ +package emu.grasscutter.game.entity; + +import emu.grasscutter.data.GameData; +import emu.grasscutter.data.excels.HomeWorldAnimalData; +import emu.grasscutter.game.props.ElementType; +import emu.grasscutter.game.world.Position; +import emu.grasscutter.game.world.Scene; +import emu.grasscutter.net.proto.VisionTypeOuterClass; +import emu.grasscutter.server.packet.send.PacketSceneEntityAppearNotify; +import emu.grasscutter.server.packet.send.PacketSceneEntityDisappearNotify; +import lombok.Getter; + +public class EntityHomeAnimal extends EntityMonster implements Rebornable { + private int rebornCDTickCount; + private final Position rebornPos; + @Getter + private final int rebirth; + @Getter + private final int rebirthCD; + private boolean disappeared; + + public EntityHomeAnimal(Scene scene, HomeWorldAnimalData data, Position pos) { + super(scene, GameData.getMonsterDataMap().get(data.getMonsterID()), pos, 1); + + this.rebornPos = pos.clone(); + this.rebirth = data.getIsRebirth(); + this.rebirthCD = data.getRebirthCD(); + } + + @Override + public void damage(float amount, int killerId, ElementType attackType) { + } + + @Override + public void onTick(int sceneTime) { + super.onTick(sceneTime); + + if (this.isInCD()) { + this.rebornCDTickCount--; + if (this.rebornCDTickCount <= 0) { + this.reborn(); + } + } + } + + @Override + public void onCreate() { + } + + @Override + public Position getRebornPos() { + return this.rebornPos; + } + + @Override + public int getRebornCD() { + return this.rebirthCD; + } + + @Override + public void onAiKillSelf() { + this.getScene().broadcastPacket(new PacketSceneEntityDisappearNotify(this, VisionTypeOuterClass.VisionType.VISION_TYPE_REMOVE)); + this.rebornCDTickCount = this.getRebornCD(); + this.disappeared = true; + } + + @Override + public void reborn() { + if (this.disappeared) { + this.disappeared = false; + this.getPosition().set(this.getRebornPos()); + this.getScene().broadcastPacket(new PacketSceneEntityAppearNotify(this)); + } + } + + @Override + public boolean isInCD() { + return this.disappeared; + } +} diff --git a/src/main/java/emu/grasscutter/game/entity/Rebornable.java b/src/main/java/emu/grasscutter/game/entity/Rebornable.java new file mode 100644 index 000000000..5fef23e1b --- /dev/null +++ b/src/main/java/emu/grasscutter/game/entity/Rebornable.java @@ -0,0 +1,15 @@ +package emu.grasscutter.game.entity; + +import emu.grasscutter.game.world.Position; + +public interface Rebornable { + Position getRebornPos(); + + int getRebornCD(); + + void onAiKillSelf(); + + void reborn(); + + boolean isInCD(); +} diff --git a/src/main/java/emu/grasscutter/game/home/HomeScene.java b/src/main/java/emu/grasscutter/game/home/HomeScene.java new file mode 100644 index 000000000..1325c23dd --- /dev/null +++ b/src/main/java/emu/grasscutter/game/home/HomeScene.java @@ -0,0 +1,61 @@ +package emu.grasscutter.game.home; + +import emu.grasscutter.data.excels.scene.SceneData; +import emu.grasscutter.game.entity.GameEntity; +import emu.grasscutter.game.player.Player; +import emu.grasscutter.game.world.Scene; +import emu.grasscutter.server.packet.send.PacketSceneTimeNotify; + +public class HomeScene extends Scene { + public HomeScene(HomeWorld world, SceneData sceneData) { + super(world, sceneData); + this.setDontDestroyWhenEmpty(true); + } + + @Override + public boolean isPaused() { + return false; + } + + @Override + public HomeWorld getWorld() { + return (HomeWorld) super.getWorld(); + } + + public GameHome getHome() { + return this.getWorld().getHome(); + } + + public HomeSceneItem getSceneItem() { + return this.getHome().getHomeSceneItem(this.getId()); + } + + @Override + public void setPaused(boolean paused) { + } + + @Override + public void onTick() { + this.getEntities().values().forEach(gameEntity -> gameEntity.onTick(this.getSceneTimeSeconds())); + + this.finishLoading(); + this.checkPlayerRespawn(); + if (this.tickCount++ % 10 == 0) this.broadcastPacket(new PacketSceneTimeNotify(this)); + } + + @Override + public void checkNpcGroup() { + } + + @Override + public void checkSpawns() { + } + + @Override + public void addItemEntity(int itemId, int amount, GameEntity bornForm) { + } + + @Override + public void loadNpcForPlayerEnter(Player player) { + } +} diff --git a/src/main/java/emu/grasscutter/game/home/HomeSceneItem.java b/src/main/java/emu/grasscutter/game/home/HomeSceneItem.java index 4157fcb28..18d7e2bb7 100644 --- a/src/main/java/emu/grasscutter/game/home/HomeSceneItem.java +++ b/src/main/java/emu/grasscutter/game/home/HomeSceneItem.java @@ -1,10 +1,17 @@ package emu.grasscutter.game.home; -import dev.morphia.annotations.*; +import dev.morphia.annotations.Entity; +import dev.morphia.annotations.Id; import emu.grasscutter.Grasscutter; +import emu.grasscutter.data.GameData; import emu.grasscutter.data.binout.HomeworldDefaultSaveData; +import emu.grasscutter.game.entity.EntityHomeAnimal; import emu.grasscutter.game.world.Position; +import emu.grasscutter.game.world.Scene; import emu.grasscutter.net.proto.HomeSceneArrangementInfoOuterClass.HomeSceneArrangementInfo; + +import java.util.Collection; +import java.util.List; import java.util.Map; import java.util.stream.Collectors; import lombok.*; @@ -71,6 +78,19 @@ public class HomeSceneItem { return mainHouse == null || mainHouse.getAsItem() == null; } + public List getAnimals(Scene scene) { + return this.blockItems.values().stream() + .map(HomeBlockItem::getDeployAnimalList) + .flatMap(Collection::stream) + .filter(homeAnimalItem -> GameData.getHomeWorldAnimalDataMap().containsKey(homeAnimalItem.getFurnitureId())) + .map(homeAnimalItem -> { + return new EntityHomeAnimal(scene, + GameData.getHomeWorldAnimalDataMap().get(homeAnimalItem.getFurnitureId()), + homeAnimalItem.getSpawnPos()); + }) + .toList(); + } + public int calComfort() { return this.blockItems.values().stream().mapToInt(HomeBlockItem::calComfort).sum(); } diff --git a/src/main/java/emu/grasscutter/game/home/HomeWorld.java b/src/main/java/emu/grasscutter/game/home/HomeWorld.java index 05f685362..85280564d 100644 --- a/src/main/java/emu/grasscutter/game/home/HomeWorld.java +++ b/src/main/java/emu/grasscutter/game/home/HomeWorld.java @@ -1,11 +1,14 @@ package emu.grasscutter.game.home; +import emu.grasscutter.data.GameData; import emu.grasscutter.game.entity.EntityTeam; import emu.grasscutter.game.player.Player; -import emu.grasscutter.game.world.*; +import emu.grasscutter.game.world.Scene; +import emu.grasscutter.game.world.World; import emu.grasscutter.net.packet.BasePacket; import emu.grasscutter.net.proto.ChatInfoOuterClass; import emu.grasscutter.server.game.GameServer; + import emu.grasscutter.server.packet.send.*; import java.util.List; import lombok.Getter; @@ -20,6 +23,21 @@ public class HomeWorld extends World { server.registerHomeWorld(this); } + @Override + public void registerScene(Scene scene) { + this.addAnimalsToScene((HomeScene) scene); + super.registerScene(scene); + } + + @Override + public void deregisterScene(Scene scene) { + super.deregisterScene(scene); + } + + private void addAnimalsToScene(HomeScene scene) { + scene.getSceneItem().getAnimals(scene).forEach(scene::addEntity); + } + @Override public synchronized void addPlayer(Player player) { // Check if player already in @@ -117,6 +135,23 @@ public class HomeWorld extends World { .build())); } + @Override + public HomeScene getSceneById(int sceneId) { + var scene = this.getScenes().get(sceneId); + if (scene instanceof HomeScene homeScene) { + return homeScene; + } + + var sceneData = GameData.getSceneDataMap().get(sceneId); + if (sceneData != null) { + scene = new HomeScene(this, sceneData); + this.registerScene(scene); + return (HomeScene) scene; + } + + return null; + } + @Override public int getNextPeerId() { return this.getPlayers().size() + 1; diff --git a/src/main/java/emu/grasscutter/game/world/Scene.java b/src/main/java/emu/grasscutter/game/world/Scene.java index a42c96a2c..17f4212f1 100644 --- a/src/main/java/emu/grasscutter/game/world/Scene.java +++ b/src/main/java/emu/grasscutter/game/world/Scene.java @@ -1,7 +1,8 @@ package emu.grasscutter.game.world; import emu.grasscutter.Grasscutter; -import emu.grasscutter.data.*; +import emu.grasscutter.data.GameData; +import emu.grasscutter.data.GameDepot; import emu.grasscutter.data.binout.SceneNpcBornEntry; import emu.grasscutter.data.binout.routes.Route; import emu.grasscutter.data.excels.ItemData; @@ -11,14 +12,16 @@ import emu.grasscutter.data.excels.scene.SceneData; import emu.grasscutter.data.excels.world.WorldLevelData; import emu.grasscutter.data.server.Grid; import emu.grasscutter.game.avatar.Avatar; -import emu.grasscutter.game.dungeons.*; +import emu.grasscutter.game.dungeons.DungeonManager; +import emu.grasscutter.game.dungeons.DungeonSettleListener; import emu.grasscutter.game.dungeons.challenge.WorldChallenge; import emu.grasscutter.game.dungeons.enums.DungeonPassConditionType; import emu.grasscutter.game.entity.*; import emu.grasscutter.game.entity.gadget.GadgetWorktop; import emu.grasscutter.game.inventory.GameItem; import emu.grasscutter.game.managers.blossom.BlossomManager; -import emu.grasscutter.game.player.*; +import emu.grasscutter.game.player.Player; +import emu.grasscutter.game.player.TeamInfo; import emu.grasscutter.game.props.*; import emu.grasscutter.game.quest.QuestGroupSuite; import emu.grasscutter.game.world.data.TeleportProperties; @@ -26,22 +29,27 @@ import emu.grasscutter.net.packet.BasePacket; import emu.grasscutter.net.proto.*; import emu.grasscutter.net.proto.AttackResultOuterClass.AttackResult; import emu.grasscutter.net.proto.VisionTypeOuterClass.VisionType; -import emu.grasscutter.scripts.*; +import emu.grasscutter.scripts.SceneIndexManager; +import emu.grasscutter.scripts.SceneScriptManager; import emu.grasscutter.scripts.constants.EventType; -import emu.grasscutter.scripts.data.*; +import emu.grasscutter.scripts.data.SceneBlock; +import emu.grasscutter.scripts.data.SceneGroup; +import emu.grasscutter.scripts.data.ScriptArgs; import emu.grasscutter.server.event.entity.EntityCreationEvent; import emu.grasscutter.server.event.player.PlayerTeleportEvent; import emu.grasscutter.server.packet.send.*; import emu.grasscutter.server.scheduler.ServerTaskScheduler; import emu.grasscutter.utils.objects.KahnsSort; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; + import java.util.*; -import java.util.concurrent.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.stream.Collectors; import javax.annotation.Nullable; import lombok.*; -public final class Scene { +public class Scene { @Getter private final World world; @Getter private final SceneData sceneData; @Getter private final List players; @@ -66,7 +74,7 @@ public final class Scene { @Getter @Setter private int killedMonsterCount; private Set npcBornEntrySet; @Getter private boolean finishedLoading = false; - @Getter private int tickCount = 0; + @Getter protected int tickCount = 0; @Getter private boolean isPaused = false; private final List afterLoadedCallbacks = new ArrayList<>(); @@ -456,7 +464,10 @@ public final class Scene { public void showOtherEntities(Player player) { GameEntity currentEntity = player.getTeamManager().getCurrentAvatarEntity(); List entities = - this.getEntities().values().stream().filter(entity -> entity != currentEntity).toList(); + this.getEntities().values().stream() + .filter(entity -> entity != currentEntity) + .filter(gameEntity -> !(gameEntity instanceof Rebornable rebornable) || !rebornable.isInCD()) + .toList(); player.sendPacket(new PacketSceneEntityAppearNotify(entities, VisionType.VISION_TYPE_MEET)); } @@ -583,7 +594,7 @@ public final class Scene { } /** Validates a player's current position. Teleports the player if the player is out of bounds. */ - private void checkPlayerRespawn() { + protected void checkPlayerRespawn() { if (this.getScriptManager().getConfig() == null) return; var diePos = this.getScriptManager().getConfig().die_y; diff --git a/src/main/java/emu/grasscutter/server/game/GameServer.java b/src/main/java/emu/grasscutter/server/game/GameServer.java index 39a3d9880..b2ebf1947 100644 --- a/src/main/java/emu/grasscutter/server/game/GameServer.java +++ b/src/main/java/emu/grasscutter/server/game/GameServer.java @@ -8,32 +8,41 @@ import emu.grasscutter.Grasscutter.ServerRunMode; import emu.grasscutter.database.DatabaseHelper; import emu.grasscutter.game.Account; import emu.grasscutter.game.battlepass.BattlePassSystem; -import emu.grasscutter.game.chat.*; +import emu.grasscutter.game.chat.ChatSystem; +import emu.grasscutter.game.chat.ChatSystemHandler; import emu.grasscutter.game.combine.CombineManger; -import emu.grasscutter.game.drop.*; +import emu.grasscutter.game.drop.DropSystem; +import emu.grasscutter.game.drop.DropSystemLegacy; import emu.grasscutter.game.dungeons.DungeonSystem; import emu.grasscutter.game.expedition.ExpeditionSystem; import emu.grasscutter.game.gacha.GachaSystem; -import emu.grasscutter.game.home.*; -import emu.grasscutter.game.managers.cooking.*; +import emu.grasscutter.game.home.HomeWorld; +import emu.grasscutter.game.home.HomeWorldMPSystem; +import emu.grasscutter.game.managers.cooking.CookingCompoundManager; +import emu.grasscutter.game.managers.cooking.CookingManager; import emu.grasscutter.game.managers.energy.EnergyManager; import emu.grasscutter.game.managers.stamina.StaminaManager; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.quest.QuestSystem; import emu.grasscutter.game.shop.ShopSystem; -import emu.grasscutter.game.systems.*; +import emu.grasscutter.game.systems.AnnouncementSystem; +import emu.grasscutter.game.systems.InventorySystem; +import emu.grasscutter.game.systems.MultiplayerSystem; import emu.grasscutter.game.talk.TalkSystem; import emu.grasscutter.game.tower.TowerSystem; -import emu.grasscutter.game.world.*; +import emu.grasscutter.game.world.World; +import emu.grasscutter.game.world.WorldDataSystem; import emu.grasscutter.net.packet.PacketHandler; import emu.grasscutter.net.proto.SocialDetailOuterClass.SocialDetail; import emu.grasscutter.server.dispatch.DispatchClient; import emu.grasscutter.server.event.game.ServerTickEvent; -import emu.grasscutter.server.event.internal.*; +import emu.grasscutter.server.event.internal.ServerStartEvent; +import emu.grasscutter.server.event.internal.ServerStopEvent; import emu.grasscutter.server.event.types.ServerEvent; import emu.grasscutter.server.scheduler.ServerTaskScheduler; import emu.grasscutter.task.TaskMap; import emu.grasscutter.utils.Utils; + import it.unimi.dsi.fastutil.ints.*; import java.net.*; import java.time.*; @@ -283,6 +292,9 @@ public final class GameServer extends KcpServer implements Iterable { // Tick worlds. this.worlds.removeIf(World::onTick); + // Tick Home Worlds (Not remove, HomeWorld is constant). + this.homeWorlds.values().forEach(HomeWorld::onTick); + // Tick players. this.players.values().forEach(Player::onTick); diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerEntityAiKillSelfNotify.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerEntityAiKillSelfNotify.java new file mode 100644 index 000000000..a083229b3 --- /dev/null +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerEntityAiKillSelfNotify.java @@ -0,0 +1,19 @@ +package emu.grasscutter.server.packet.recv; + +import emu.grasscutter.game.entity.Rebornable; +import emu.grasscutter.net.packet.Opcodes; +import emu.grasscutter.net.packet.PacketHandler; +import emu.grasscutter.net.packet.PacketOpcodes; +import emu.grasscutter.net.proto.EntityAiKillSelfNotifyOuterClass; +import emu.grasscutter.server.game.GameSession; + +@Opcodes(PacketOpcodes.EntityAiKillSelfNotify) +public class HandlerEntityAiKillSelfNotify extends PacketHandler { + @Override + public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { + var entityId = EntityAiKillSelfNotifyOuterClass.EntityAiKillSelfNotify.parseFrom(payload).getEntityId(); + if (session.getPlayer().getScene().getEntityById(entityId) instanceof Rebornable rebornable) { + rebornable.onAiKillSelf(); + } + } +} diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeEditModeReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeEditModeReq.java index b05a64999..0bdb51fbc 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeEditModeReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeEditModeReq.java @@ -1,9 +1,15 @@ package emu.grasscutter.server.packet.recv; -import emu.grasscutter.net.packet.*; -import emu.grasscutter.net.proto.*; +import emu.grasscutter.net.packet.Opcodes; +import emu.grasscutter.net.packet.PacketHandler; +import emu.grasscutter.net.packet.PacketOpcodes; +import emu.grasscutter.net.proto.HomeChangeEditModeReqOuterClass; +import emu.grasscutter.net.proto.RetcodeOuterClass; import emu.grasscutter.server.game.GameSession; -import emu.grasscutter.server.packet.send.*; +import emu.grasscutter.server.packet.send.PacketHomeBasicInfoNotify; +import emu.grasscutter.server.packet.send.PacketHomeChangeEditModeRsp; +import emu.grasscutter.server.packet.send.PacketHomeComfortInfoNotify; +import emu.grasscutter.server.packet.send.PacketHomePreChangeEditModeNotify; @Opcodes(PacketOpcodes.HomeChangeEditModeReq) public class HandlerHomeChangeEditModeReq extends PacketHandler { @@ -24,6 +30,11 @@ public class HandlerHomeChangeEditModeReq extends PacketHandler { session.send(new PacketHomeBasicInfoNotify(session.getPlayer(), req.getIsEnterEditMode())); session.send(new PacketHomeComfortInfoNotify(session.getPlayer())); + if (!req.getIsEnterEditMode()) { + var scene = session.getPlayer().getScene(); + scene.addEntities(session.getPlayer().getCurHomeWorld().getHome().getHomeSceneItem(scene.getId()).getAnimals(scene)); + } + session.send(new PacketHomeChangeEditModeRsp(req.getIsEnterEditMode())); } } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeEnterEditModeFinishReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeEnterEditModeFinishReq.java index 85f0655b5..214eabdb6 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeEnterEditModeFinishReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeEnterEditModeFinishReq.java @@ -1,6 +1,10 @@ package emu.grasscutter.server.packet.recv; -import emu.grasscutter.net.packet.*; +import emu.grasscutter.game.entity.EntityHomeAnimal; +import emu.grasscutter.net.packet.Opcodes; +import emu.grasscutter.net.packet.PacketHandler; +import emu.grasscutter.net.packet.PacketOpcodes; +import emu.grasscutter.net.proto.VisionTypeOuterClass; import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.packet.send.PacketHomeEnterEditModeFinishRsp; @@ -12,6 +16,10 @@ public class HandlerHomeEnterEditModeFinishReq extends PacketHandler { /* * This packet is about the edit mode */ + + var scene = session.getPlayer().getScene(); + scene.removeEntities(scene.getEntities().values().stream().filter(gameEntity -> gameEntity instanceof EntityHomeAnimal).toList(), VisionTypeOuterClass.VisionType.VISION_TYPE_REMOVE); + session.send(new PacketHomeEnterEditModeFinishRsp()); } } From a49f37edb358efe7a8dbd57e126b782894f179ed Mon Sep 17 00:00:00 2001 From: hamusuke Date: Sat, 2 Sep 2023 14:47:06 +0900 Subject: [PATCH 06/10] feat: finish home avatar talk (#2328) --- .../emu/grasscutter/game/home/GameHome.java | 39 ++++++++++++++++--- .../packet/recv/HandlerHomeAvatarTalkReq.java | 20 ++++++++++ .../recv/HandlerHomeChangeModuleReq.java | 13 +++++-- .../HandlerHomeUpdateArrangementInfoReq.java | 9 ++++- .../PacketHomeAvatarTalkFinishInfoNotify.java | 15 +++++++ .../packet/send/PacketHomeAvatarTalkRsp.java | 20 ++++++++++ 6 files changed, 106 insertions(+), 10 deletions(-) create mode 100644 src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeAvatarTalkReq.java create mode 100644 src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarTalkFinishInfoNotify.java create mode 100644 src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarTalkRsp.java diff --git a/src/main/java/emu/grasscutter/game/home/GameHome.java b/src/main/java/emu/grasscutter/game/home/GameHome.java index 3c179582c..b0b955a5c 100644 --- a/src/main/java/emu/grasscutter/game/home/GameHome.java +++ b/src/main/java/emu/grasscutter/game/home/GameHome.java @@ -9,8 +9,10 @@ import emu.grasscutter.database.DatabaseHelper; import emu.grasscutter.game.avatar.Avatar; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.props.SceneType; +import emu.grasscutter.net.proto.HomeAvatarTalkFinishInfoOuterClass; import emu.grasscutter.server.packet.send.*; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; + import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; import java.util.*; @@ -52,6 +54,7 @@ public class GameHome { ConcurrentHashMap sceneMap; Set unlockedHomeBgmList; int enterHomeOption; + Map> finishedTalkIdMap; public static GameHome getByUid(Integer uid) { var home = DatabaseHelper.getHomeByUid(uid); @@ -67,11 +70,12 @@ public class GameHome { public static GameHome create(Integer uid) { return GameHome.of() - .ownerUid(uid) - .level(1) - .sceneMap(new ConcurrentHashMap<>()) - .unlockedHomeBgmList(new HashSet<>()) - .build(); + .ownerUid(uid) + .level(1) + .sceneMap(new ConcurrentHashMap<>()) + .unlockedHomeBgmList(new HashSet<>()) + .finishedTalkIdMap(new HashMap<>()) + .build(); } public void save() { @@ -102,6 +106,7 @@ public class GameHome { player.getSession().send(new PacketHomeComfortInfoNotify(player)); player.getSession().send(new PacketFurnitureCurModuleArrangeCountNotify()); player.getSession().send(new PacketHomeMarkPointNotify(player)); + player.getSession().send(new PacketHomeAvatarTalkFinishInfoNotify(player)); player.getSession().send(new PacketHomeAllUnlockedBgmIdListNotify(player)); checkAccumulatedResources(player); player.getSession().send(new PacketHomeResourceNotify(player)); @@ -141,6 +146,30 @@ public class GameHome { return GameData.getHomeWorldLevelDataMap().get(level); } + public Set onTalkedWithAvatar(int avatarId, int talkId) { + if (this.finishedTalkIdMap == null) { + this.finishedTalkIdMap = new HashMap<>(); + } + + this.finishedTalkIdMap.computeIfAbsent(avatarId, HashSet::new).add(talkId); + this.save(); + + return this.finishedTalkIdMap.get(avatarId); + } + + public List toAvatarTalkFinishInfoProto() { + if (this.finishedTalkIdMap == null) { + this.finishedTalkIdMap = new HashMap<>(); + } + + return this.finishedTalkIdMap.entrySet().stream().map(e -> { + return HomeAvatarTalkFinishInfoOuterClass.HomeAvatarTalkFinishInfo.newBuilder() + .setAvatarId(e.getKey()) + .addAllFinishTalkIdList(e.getValue()) + .build(); + }).toList(); + } + public boolean addUnlockedHomeBgm(int homeBgmId) { if (!getUnlockedHomeBgmList().add(homeBgmId)) return false; diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeAvatarTalkReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeAvatarTalkReq.java new file mode 100644 index 000000000..383987329 --- /dev/null +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeAvatarTalkReq.java @@ -0,0 +1,20 @@ +package emu.grasscutter.server.packet.recv; + +import emu.grasscutter.net.packet.Opcodes; +import emu.grasscutter.net.packet.PacketHandler; +import emu.grasscutter.net.packet.PacketOpcodes; +import emu.grasscutter.net.proto.HomeAvatarTalkReqOuterClass; +import emu.grasscutter.server.game.GameSession; +import emu.grasscutter.server.packet.send.PacketHomeAvatarTalkFinishInfoNotify; +import emu.grasscutter.server.packet.send.PacketHomeAvatarTalkRsp; + +@Opcodes(PacketOpcodes.HomeAvatarTalkReq) +public class HandlerHomeAvatarTalkReq extends PacketHandler { + @Override + public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { + var req = HomeAvatarTalkReqOuterClass.HomeAvatarTalkReq.parseFrom(payload); + var talkIdSet = session.getPlayer().getCurHomeWorld().getHome().onTalkedWithAvatar(req.getAvatarId(), req.getTalkId()); + session.send(new PacketHomeAvatarTalkFinishInfoNotify(session.getPlayer())); + session.send(new PacketHomeAvatarTalkRsp(req.getAvatarId(), talkIdSet)); + } +} diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeModuleReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeModuleReq.java index 7e547f522..e4e397269 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeModuleReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeModuleReq.java @@ -1,11 +1,17 @@ package emu.grasscutter.server.packet.recv; -import emu.grasscutter.game.world.*; -import emu.grasscutter.net.packet.*; +import emu.grasscutter.game.world.Position; +import emu.grasscutter.game.world.Scene; +import emu.grasscutter.net.packet.Opcodes; +import emu.grasscutter.net.packet.PacketHandler; +import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.proto.HomeChangeModuleReqOuterClass; import emu.grasscutter.server.event.player.PlayerTeleportEvent.TeleportType; import emu.grasscutter.server.game.GameSession; -import emu.grasscutter.server.packet.send.*; +import emu.grasscutter.server.packet.send.PacketHomeAvatarTalkFinishInfoNotify; +import emu.grasscutter.server.packet.send.PacketHomeChangeModuleRsp; +import emu.grasscutter.server.packet.send.PacketHomeComfortInfoNotify; +import emu.grasscutter.server.packet.send.PacketPlayerHomeCompInfoNotify; @Opcodes(PacketOpcodes.HomeChangeModuleReq) public class HandlerHomeChangeModuleReq extends PacketHandler { @@ -15,6 +21,7 @@ public class HandlerHomeChangeModuleReq extends PacketHandler { HomeChangeModuleReqOuterClass.HomeChangeModuleReq req = HomeChangeModuleReqOuterClass.HomeChangeModuleReq.parseFrom(payload); session.getPlayer().setCurrentRealmId(req.getTargetModuleId()); + session.send(new PacketHomeAvatarTalkFinishInfoNotify(session.getPlayer())); session.send(new PacketHomeChangeModuleRsp(req.getTargetModuleId())); session.send(new PacketPlayerHomeCompInfoNotify(session.getPlayer())); session.send(new PacketHomeComfortInfoNotify(session.getPlayer())); diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeUpdateArrangementInfoReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeUpdateArrangementInfoReq.java index 906475a1d..be36159e4 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeUpdateArrangementInfoReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeUpdateArrangementInfoReq.java @@ -1,9 +1,13 @@ package emu.grasscutter.server.packet.recv; -import emu.grasscutter.net.packet.*; +import emu.grasscutter.net.packet.Opcodes; +import emu.grasscutter.net.packet.PacketHandler; +import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.proto.HomeUpdateArrangementInfoReqOuterClass; import emu.grasscutter.server.game.GameSession; -import emu.grasscutter.server.packet.send.*; +import emu.grasscutter.server.packet.send.PacketHomeAvatarTalkFinishInfoNotify; +import emu.grasscutter.server.packet.send.PacketHomeMarkPointNotify; +import emu.grasscutter.server.packet.send.PacketHomeUpdateArrangementInfoRsp; @Opcodes(PacketOpcodes.HomeUpdateArrangementInfoReq) public class HandlerHomeUpdateArrangementInfoReq extends PacketHandler { @@ -18,6 +22,7 @@ public class HandlerHomeUpdateArrangementInfoReq extends PacketHandler { homeScene.update(req.getSceneArrangementInfo()); + session.send(new PacketHomeAvatarTalkFinishInfoNotify(session.getPlayer())); session.send(new PacketHomeMarkPointNotify(session.getPlayer())); session.getPlayer().getHome().save(); diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarTalkFinishInfoNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarTalkFinishInfoNotify.java new file mode 100644 index 000000000..6ae06e3e1 --- /dev/null +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarTalkFinishInfoNotify.java @@ -0,0 +1,15 @@ +package emu.grasscutter.server.packet.send; + +import emu.grasscutter.game.player.Player; +import emu.grasscutter.net.packet.BasePacket; +import emu.grasscutter.net.packet.PacketOpcodes; +import emu.grasscutter.net.proto.HomeAvatarTalkFinishInfoNotifyOuterClass; + +public class PacketHomeAvatarTalkFinishInfoNotify extends BasePacket { + public PacketHomeAvatarTalkFinishInfoNotify(Player homeOwner) { + super(PacketOpcodes.HomeAvatarTalkFinishInfoNotify); + + this.setData(HomeAvatarTalkFinishInfoNotifyOuterClass.HomeAvatarTalkFinishInfoNotify.newBuilder() + .addAllAvatarTalkInfoList(homeOwner.getHome().toAvatarTalkFinishInfoProto())); + } +} diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarTalkRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarTalkRsp.java new file mode 100644 index 000000000..7068fa815 --- /dev/null +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarTalkRsp.java @@ -0,0 +1,20 @@ +package emu.grasscutter.server.packet.send; + +import emu.grasscutter.net.packet.BasePacket; +import emu.grasscutter.net.packet.PacketOpcodes; +import emu.grasscutter.net.proto.HomeAvatarTalkFinishInfoOuterClass; +import emu.grasscutter.net.proto.HomeAvatarTalkRspOuterClass; + +import java.util.Set; + +public class PacketHomeAvatarTalkRsp extends BasePacket { + public PacketHomeAvatarTalkRsp(int avatarId, Set talkIdSet) { + super(PacketOpcodes.HomeAvatarTalkRsp); + + this.setData(HomeAvatarTalkRspOuterClass.HomeAvatarTalkRsp.newBuilder() + .setAvatarTalkInfo(HomeAvatarTalkFinishInfoOuterClass.HomeAvatarTalkFinishInfo.newBuilder() + .setAvatarId(avatarId) + .addAllFinishTalkIdList(talkIdSet) + .build())); + } +} From 9c25060c7885cde81815fccf4d26b930d850601a Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 2 Sep 2023 05:48:12 +0000 Subject: [PATCH 07/10] Format code [skip actions] --- .../java/emu/grasscutter/data/GameData.java | 3 +-- .../game/entity/EntityHomeAnimal.java | 17 +++++++------- .../emu/grasscutter/game/home/HomeScene.java | 19 +++++++-------- .../grasscutter/game/home/HomeSceneItem.java | 23 +++++++++++-------- .../emu/grasscutter/game/home/HomeWorld.java | 1 - .../emu/grasscutter/game/world/Scene.java | 9 ++++---- .../grasscutter/server/game/GameServer.java | 1 - .../recv/HandlerEntityAiKillSelfNotify.java | 3 ++- .../recv/HandlerHomeChangeEditModeReq.java | 8 ++++++- .../HandlerHomeEnterEditModeFinishReq.java | 6 ++++- 10 files changed, 49 insertions(+), 41 deletions(-) diff --git a/src/main/java/emu/grasscutter/data/GameData.java b/src/main/java/emu/grasscutter/data/GameData.java index e3394de82..400cade1e 100644 --- a/src/main/java/emu/grasscutter/data/GameData.java +++ b/src/main/java/emu/grasscutter/data/GameData.java @@ -48,7 +48,6 @@ import emu.grasscutter.game.quest.enums.QuestCond; import emu.grasscutter.game.world.GroupReplacementData; import emu.grasscutter.utils.Utils; import it.unimi.dsi.fastutil.ints.*; - import java.lang.reflect.Field; import java.util.*; import javax.annotation.Nullable; @@ -281,7 +280,7 @@ public final class GameData { @Getter private static final Int2ObjectMap homeWorldAnimalDataMap = - new Int2ObjectOpenHashMap<>(); + new Int2ObjectOpenHashMap<>(); @Getter private static final Int2ObjectMap homeWorldBgmDataMap = diff --git a/src/main/java/emu/grasscutter/game/entity/EntityHomeAnimal.java b/src/main/java/emu/grasscutter/game/entity/EntityHomeAnimal.java index 65807e290..426849aa9 100644 --- a/src/main/java/emu/grasscutter/game/entity/EntityHomeAnimal.java +++ b/src/main/java/emu/grasscutter/game/entity/EntityHomeAnimal.java @@ -13,10 +13,8 @@ import lombok.Getter; public class EntityHomeAnimal extends EntityMonster implements Rebornable { private int rebornCDTickCount; private final Position rebornPos; - @Getter - private final int rebirth; - @Getter - private final int rebirthCD; + @Getter private final int rebirth; + @Getter private final int rebirthCD; private boolean disappeared; public EntityHomeAnimal(Scene scene, HomeWorldAnimalData data, Position pos) { @@ -28,8 +26,7 @@ public class EntityHomeAnimal extends EntityMonster implements Rebornable { } @Override - public void damage(float amount, int killerId, ElementType attackType) { - } + public void damage(float amount, int killerId, ElementType attackType) {} @Override public void onTick(int sceneTime) { @@ -44,8 +41,7 @@ public class EntityHomeAnimal extends EntityMonster implements Rebornable { } @Override - public void onCreate() { - } + public void onCreate() {} @Override public Position getRebornPos() { @@ -59,7 +55,10 @@ public class EntityHomeAnimal extends EntityMonster implements Rebornable { @Override public void onAiKillSelf() { - this.getScene().broadcastPacket(new PacketSceneEntityDisappearNotify(this, VisionTypeOuterClass.VisionType.VISION_TYPE_REMOVE)); + this.getScene() + .broadcastPacket( + new PacketSceneEntityDisappearNotify( + this, VisionTypeOuterClass.VisionType.VISION_TYPE_REMOVE)); this.rebornCDTickCount = this.getRebornCD(); this.disappeared = true; } diff --git a/src/main/java/emu/grasscutter/game/home/HomeScene.java b/src/main/java/emu/grasscutter/game/home/HomeScene.java index 1325c23dd..b07f798b0 100644 --- a/src/main/java/emu/grasscutter/game/home/HomeScene.java +++ b/src/main/java/emu/grasscutter/game/home/HomeScene.java @@ -31,12 +31,13 @@ public class HomeScene extends Scene { } @Override - public void setPaused(boolean paused) { - } + public void setPaused(boolean paused) {} @Override public void onTick() { - this.getEntities().values().forEach(gameEntity -> gameEntity.onTick(this.getSceneTimeSeconds())); + this.getEntities() + .values() + .forEach(gameEntity -> gameEntity.onTick(this.getSceneTimeSeconds())); this.finishLoading(); this.checkPlayerRespawn(); @@ -44,18 +45,14 @@ public class HomeScene extends Scene { } @Override - public void checkNpcGroup() { - } + public void checkNpcGroup() {} @Override - public void checkSpawns() { - } + public void checkSpawns() {} @Override - public void addItemEntity(int itemId, int amount, GameEntity bornForm) { - } + public void addItemEntity(int itemId, int amount, GameEntity bornForm) {} @Override - public void loadNpcForPlayerEnter(Player player) { - } + public void loadNpcForPlayerEnter(Player player) {} } diff --git a/src/main/java/emu/grasscutter/game/home/HomeSceneItem.java b/src/main/java/emu/grasscutter/game/home/HomeSceneItem.java index 18d7e2bb7..c2984a0cf 100644 --- a/src/main/java/emu/grasscutter/game/home/HomeSceneItem.java +++ b/src/main/java/emu/grasscutter/game/home/HomeSceneItem.java @@ -9,7 +9,6 @@ import emu.grasscutter.game.entity.EntityHomeAnimal; import emu.grasscutter.game.world.Position; import emu.grasscutter.game.world.Scene; import emu.grasscutter.net.proto.HomeSceneArrangementInfoOuterClass.HomeSceneArrangementInfo; - import java.util.Collection; import java.util.List; import java.util.Map; @@ -80,15 +79,19 @@ public class HomeSceneItem { public List getAnimals(Scene scene) { return this.blockItems.values().stream() - .map(HomeBlockItem::getDeployAnimalList) - .flatMap(Collection::stream) - .filter(homeAnimalItem -> GameData.getHomeWorldAnimalDataMap().containsKey(homeAnimalItem.getFurnitureId())) - .map(homeAnimalItem -> { - return new EntityHomeAnimal(scene, - GameData.getHomeWorldAnimalDataMap().get(homeAnimalItem.getFurnitureId()), - homeAnimalItem.getSpawnPos()); - }) - .toList(); + .map(HomeBlockItem::getDeployAnimalList) + .flatMap(Collection::stream) + .filter( + homeAnimalItem -> + GameData.getHomeWorldAnimalDataMap().containsKey(homeAnimalItem.getFurnitureId())) + .map( + homeAnimalItem -> { + return new EntityHomeAnimal( + scene, + GameData.getHomeWorldAnimalDataMap().get(homeAnimalItem.getFurnitureId()), + homeAnimalItem.getSpawnPos()); + }) + .toList(); } public int calComfort() { diff --git a/src/main/java/emu/grasscutter/game/home/HomeWorld.java b/src/main/java/emu/grasscutter/game/home/HomeWorld.java index 85280564d..f2ea9d3b6 100644 --- a/src/main/java/emu/grasscutter/game/home/HomeWorld.java +++ b/src/main/java/emu/grasscutter/game/home/HomeWorld.java @@ -8,7 +8,6 @@ import emu.grasscutter.game.world.World; import emu.grasscutter.net.packet.BasePacket; import emu.grasscutter.net.proto.ChatInfoOuterClass; import emu.grasscutter.server.game.GameServer; - import emu.grasscutter.server.packet.send.*; import java.util.List; import lombok.Getter; diff --git a/src/main/java/emu/grasscutter/game/world/Scene.java b/src/main/java/emu/grasscutter/game/world/Scene.java index 17f4212f1..eb0bd86ce 100644 --- a/src/main/java/emu/grasscutter/game/world/Scene.java +++ b/src/main/java/emu/grasscutter/game/world/Scene.java @@ -41,7 +41,6 @@ import emu.grasscutter.server.packet.send.*; import emu.grasscutter.server.scheduler.ServerTaskScheduler; import emu.grasscutter.utils.objects.KahnsSort; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; - import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CopyOnWriteArrayList; @@ -465,9 +464,11 @@ public class Scene { GameEntity currentEntity = player.getTeamManager().getCurrentAvatarEntity(); List entities = this.getEntities().values().stream() - .filter(entity -> entity != currentEntity) - .filter(gameEntity -> !(gameEntity instanceof Rebornable rebornable) || !rebornable.isInCD()) - .toList(); + .filter(entity -> entity != currentEntity) + .filter( + gameEntity -> + !(gameEntity instanceof Rebornable rebornable) || !rebornable.isInCD()) + .toList(); player.sendPacket(new PacketSceneEntityAppearNotify(entities, VisionType.VISION_TYPE_MEET)); } diff --git a/src/main/java/emu/grasscutter/server/game/GameServer.java b/src/main/java/emu/grasscutter/server/game/GameServer.java index b2ebf1947..4baf00b51 100644 --- a/src/main/java/emu/grasscutter/server/game/GameServer.java +++ b/src/main/java/emu/grasscutter/server/game/GameServer.java @@ -42,7 +42,6 @@ import emu.grasscutter.server.event.types.ServerEvent; import emu.grasscutter.server.scheduler.ServerTaskScheduler; import emu.grasscutter.task.TaskMap; import emu.grasscutter.utils.Utils; - import it.unimi.dsi.fastutil.ints.*; import java.net.*; import java.time.*; diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerEntityAiKillSelfNotify.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerEntityAiKillSelfNotify.java index a083229b3..098bfee42 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerEntityAiKillSelfNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerEntityAiKillSelfNotify.java @@ -11,7 +11,8 @@ import emu.grasscutter.server.game.GameSession; public class HandlerEntityAiKillSelfNotify extends PacketHandler { @Override public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { - var entityId = EntityAiKillSelfNotifyOuterClass.EntityAiKillSelfNotify.parseFrom(payload).getEntityId(); + var entityId = + EntityAiKillSelfNotifyOuterClass.EntityAiKillSelfNotify.parseFrom(payload).getEntityId(); if (session.getPlayer().getScene().getEntityById(entityId) instanceof Rebornable rebornable) { rebornable.onAiKillSelf(); } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeEditModeReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeEditModeReq.java index 0bdb51fbc..4d6ae5dfa 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeEditModeReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeEditModeReq.java @@ -32,7 +32,13 @@ public class HandlerHomeChangeEditModeReq extends PacketHandler { if (!req.getIsEnterEditMode()) { var scene = session.getPlayer().getScene(); - scene.addEntities(session.getPlayer().getCurHomeWorld().getHome().getHomeSceneItem(scene.getId()).getAnimals(scene)); + scene.addEntities( + session + .getPlayer() + .getCurHomeWorld() + .getHome() + .getHomeSceneItem(scene.getId()) + .getAnimals(scene)); } session.send(new PacketHomeChangeEditModeRsp(req.getIsEnterEditMode())); diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeEnterEditModeFinishReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeEnterEditModeFinishReq.java index 214eabdb6..7890726e0 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeEnterEditModeFinishReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeEnterEditModeFinishReq.java @@ -18,7 +18,11 @@ public class HandlerHomeEnterEditModeFinishReq extends PacketHandler { */ var scene = session.getPlayer().getScene(); - scene.removeEntities(scene.getEntities().values().stream().filter(gameEntity -> gameEntity instanceof EntityHomeAnimal).toList(), VisionTypeOuterClass.VisionType.VISION_TYPE_REMOVE); + scene.removeEntities( + scene.getEntities().values().stream() + .filter(gameEntity -> gameEntity instanceof EntityHomeAnimal) + .toList(), + VisionTypeOuterClass.VisionType.VISION_TYPE_REMOVE); session.send(new PacketHomeEnterEditModeFinishRsp()); } From decf4942344b4d8350a2ef4a177cbea07928acaa Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 2 Sep 2023 05:49:00 +0000 Subject: [PATCH 08/10] Format code [skip actions] --- .../emu/grasscutter/game/home/GameHome.java | 31 ++++++++++--------- .../packet/recv/HandlerHomeAvatarTalkReq.java | 7 ++++- .../PacketHomeAvatarTalkFinishInfoNotify.java | 5 +-- .../packet/send/PacketHomeAvatarTalkRsp.java | 13 ++++---- 4 files changed, 33 insertions(+), 23 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/home/GameHome.java b/src/main/java/emu/grasscutter/game/home/GameHome.java index b0b955a5c..b9ddd1d71 100644 --- a/src/main/java/emu/grasscutter/game/home/GameHome.java +++ b/src/main/java/emu/grasscutter/game/home/GameHome.java @@ -12,7 +12,6 @@ import emu.grasscutter.game.props.SceneType; import emu.grasscutter.net.proto.HomeAvatarTalkFinishInfoOuterClass; import emu.grasscutter.server.packet.send.*; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; - import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; import java.util.*; @@ -70,12 +69,12 @@ public class GameHome { public static GameHome create(Integer uid) { return GameHome.of() - .ownerUid(uid) - .level(1) - .sceneMap(new ConcurrentHashMap<>()) - .unlockedHomeBgmList(new HashSet<>()) - .finishedTalkIdMap(new HashMap<>()) - .build(); + .ownerUid(uid) + .level(1) + .sceneMap(new ConcurrentHashMap<>()) + .unlockedHomeBgmList(new HashSet<>()) + .finishedTalkIdMap(new HashMap<>()) + .build(); } public void save() { @@ -157,17 +156,21 @@ public class GameHome { return this.finishedTalkIdMap.get(avatarId); } - public List toAvatarTalkFinishInfoProto() { + public List + toAvatarTalkFinishInfoProto() { if (this.finishedTalkIdMap == null) { this.finishedTalkIdMap = new HashMap<>(); } - return this.finishedTalkIdMap.entrySet().stream().map(e -> { - return HomeAvatarTalkFinishInfoOuterClass.HomeAvatarTalkFinishInfo.newBuilder() - .setAvatarId(e.getKey()) - .addAllFinishTalkIdList(e.getValue()) - .build(); - }).toList(); + return this.finishedTalkIdMap.entrySet().stream() + .map( + e -> { + return HomeAvatarTalkFinishInfoOuterClass.HomeAvatarTalkFinishInfo.newBuilder() + .setAvatarId(e.getKey()) + .addAllFinishTalkIdList(e.getValue()) + .build(); + }) + .toList(); } public boolean addUnlockedHomeBgm(int homeBgmId) { diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeAvatarTalkReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeAvatarTalkReq.java index 383987329..6cd2d1ad0 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeAvatarTalkReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeAvatarTalkReq.java @@ -13,7 +13,12 @@ public class HandlerHomeAvatarTalkReq extends PacketHandler { @Override public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { var req = HomeAvatarTalkReqOuterClass.HomeAvatarTalkReq.parseFrom(payload); - var talkIdSet = session.getPlayer().getCurHomeWorld().getHome().onTalkedWithAvatar(req.getAvatarId(), req.getTalkId()); + var talkIdSet = + session + .getPlayer() + .getCurHomeWorld() + .getHome() + .onTalkedWithAvatar(req.getAvatarId(), req.getTalkId()); session.send(new PacketHomeAvatarTalkFinishInfoNotify(session.getPlayer())); session.send(new PacketHomeAvatarTalkRsp(req.getAvatarId(), talkIdSet)); } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarTalkFinishInfoNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarTalkFinishInfoNotify.java index 6ae06e3e1..665a944aa 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarTalkFinishInfoNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarTalkFinishInfoNotify.java @@ -9,7 +9,8 @@ public class PacketHomeAvatarTalkFinishInfoNotify extends BasePacket { public PacketHomeAvatarTalkFinishInfoNotify(Player homeOwner) { super(PacketOpcodes.HomeAvatarTalkFinishInfoNotify); - this.setData(HomeAvatarTalkFinishInfoNotifyOuterClass.HomeAvatarTalkFinishInfoNotify.newBuilder() - .addAllAvatarTalkInfoList(homeOwner.getHome().toAvatarTalkFinishInfoProto())); + this.setData( + HomeAvatarTalkFinishInfoNotifyOuterClass.HomeAvatarTalkFinishInfoNotify.newBuilder() + .addAllAvatarTalkInfoList(homeOwner.getHome().toAvatarTalkFinishInfoProto())); } } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarTalkRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarTalkRsp.java index 7068fa815..e015f1ae2 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarTalkRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeAvatarTalkRsp.java @@ -4,17 +4,18 @@ import emu.grasscutter.net.packet.BasePacket; import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.proto.HomeAvatarTalkFinishInfoOuterClass; import emu.grasscutter.net.proto.HomeAvatarTalkRspOuterClass; - import java.util.Set; public class PacketHomeAvatarTalkRsp extends BasePacket { public PacketHomeAvatarTalkRsp(int avatarId, Set talkIdSet) { super(PacketOpcodes.HomeAvatarTalkRsp); - this.setData(HomeAvatarTalkRspOuterClass.HomeAvatarTalkRsp.newBuilder() - .setAvatarTalkInfo(HomeAvatarTalkFinishInfoOuterClass.HomeAvatarTalkFinishInfo.newBuilder() - .setAvatarId(avatarId) - .addAllFinishTalkIdList(talkIdSet) - .build())); + this.setData( + HomeAvatarTalkRspOuterClass.HomeAvatarTalkRsp.newBuilder() + .setAvatarTalkInfo( + HomeAvatarTalkFinishInfoOuterClass.HomeAvatarTalkFinishInfo.newBuilder() + .setAvatarId(avatarId) + .addAllFinishTalkIdList(talkIdSet) + .build())); } } From ed97201473b44a445479ed350b506a43ff6f07ba Mon Sep 17 00:00:00 2001 From: hamusuke Date: Sun, 3 Sep 2023 00:52:56 +0900 Subject: [PATCH 09/10] fix: arrangement of main house is duplicated even if player changes module (#2325) * fix: arrangement of main house is duplicated even if player change module * removeIf * Update src/main/java/emu/grasscutter/game/home/GameHome.java Co-authored-by: Magix <27646710+KingRainbow44@users.noreply.github.com> --------- Co-authored-by: Magix <27646710+KingRainbow44@users.noreply.github.com> --- .../emu/grasscutter/game/home/GameHome.java | 83 ++++++++++++++----- .../game/home/HomeFurnitureItem.java | 3 +- .../grasscutter/game/home/HomeSceneItem.java | 7 +- .../recv/HandlerHomeChangeModuleReq.java | 7 ++ .../packet/recv/HandlerHomeSceneJumpReq.java | 6 +- .../HandlerHomeUpdateArrangementInfoReq.java | 7 ++ .../send/PacketHomeChangeModuleRsp.java | 11 ++- .../send/PacketHomeComfortInfoNotify.java | 2 +- .../send/PacketHomeMarkPointNotify.java | 52 ++++++------ 9 files changed, 126 insertions(+), 52 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/home/GameHome.java b/src/main/java/emu/grasscutter/game/home/GameHome.java index b9ddd1d71..e078b8f2d 100644 --- a/src/main/java/emu/grasscutter/game/home/GameHome.java +++ b/src/main/java/emu/grasscutter/game/home/GameHome.java @@ -12,6 +12,7 @@ import emu.grasscutter.game.props.SceneType; import emu.grasscutter.net.proto.HomeAvatarTalkFinishInfoOuterClass; import emu.grasscutter.server.packet.send.*; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; + import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; import java.util.*; @@ -51,6 +52,7 @@ public class GameHome { int storedFetterExp; List furnitureMakeSlotItemList; ConcurrentHashMap sceneMap; + ConcurrentHashMap mainHouseMap; Set unlockedHomeBgmList; int enterHomeOption; Map> finishedTalkIdMap; @@ -60,6 +62,9 @@ public class GameHome { if (home == null) { home = GameHome.create(uid); } + + home.fixMainHouseIfOld(); + return home; } @@ -69,12 +74,25 @@ public class GameHome { public static GameHome create(Integer uid) { return GameHome.of() - .ownerUid(uid) - .level(1) - .sceneMap(new ConcurrentHashMap<>()) - .unlockedHomeBgmList(new HashSet<>()) - .finishedTalkIdMap(new HashMap<>()) - .build(); + .ownerUid(uid) + .level(1) + .sceneMap(new ConcurrentHashMap<>()) + .mainHouseMap(new ConcurrentHashMap<>()) + .unlockedHomeBgmList(new HashSet<>()) + .finishedTalkIdMap(new HashMap<>()) + .build(); + } + + // Data fixer. + private void fixMainHouseIfOld() { + if (this.getMainHouseMap() == null) { + Grasscutter.getLogger().debug("Player {}'s main house will be deleted due to GC update! (ps. sorry XD)", this.getPlayer().getUid()); + this.mainHouseMap = new ConcurrentHashMap<>(); // assign. + } + + this.getSceneMap().values().removeIf(homeSceneItem -> homeSceneItem.getSceneId() > 2200); + + this.save(); } public void save() { @@ -82,6 +100,10 @@ public class GameHome { } public HomeSceneItem getHomeSceneItem(int sceneId) { + if (sceneId >= 2200) { + return this.getMainHouseItem(this.getPlayer().getCurrentRealmId() + 2000); + } + return sceneMap.computeIfAbsent( sceneId, e -> { @@ -98,8 +120,31 @@ public class GameHome { }); } + public HomeSceneItem getMainHouseItem(int outdoorSceneId) { + return this.getMainHouseMap().computeIfAbsent(outdoorSceneId, integer -> { + var curHomeSceneItem = this.getHomeSceneItem(outdoorSceneId); + var roomSceneId = curHomeSceneItem.getRoomSceneId(); + var defaultItem = GameData.getHomeworldDefaultSaveData().get(roomSceneId); + if (defaultItem == null) { + Grasscutter.getLogger().info("defaultItem == null! returns Liyue style house."); + return HomeSceneItem.parseFrom(GameData.getHomeworldDefaultSaveData().get(2202), 2202); // Liyue style + } + + Grasscutter.getLogger().info("Set player {} main house {} to initial setting", this.ownerUid, roomSceneId); + return HomeSceneItem.parseFrom(defaultItem, roomSceneId); + }); + } + + public void onMainHouseChanged() { + Grasscutter.getLogger().debug("main house changed!"); + var outdoor = this.getPlayer().getCurrentRealmId() + 2000; + this.getMainHouseMap().remove(outdoor); // delete main house in current scene. + this.getMainHouseItem(outdoor); // put new main house with default arrangement. + this.save(); + } + public void onOwnerLogin(Player player) { - if (this.player == null) this.player = player; + this.player = player; // update player pointer. (prevent offline player from sending packet) player.getSession().send(new PacketHomeBasicInfoNotify(player, false)); player.getSession().send(new PacketPlayerHomeCompInfoNotify(player)); player.getSession().send(new PacketHomeComfortInfoNotify(player)); @@ -273,19 +318,19 @@ public class GameHome { }); // Check as realm 5 inside is not in defaults and will be null - if (Objects.nonNull(sceneMap.get(player.getCurrentRealmId() + 2200))) { + if (Objects.nonNull(mainHouseMap.get(player.getCurrentRealmId() + 2000))) { // Indoors avatars - sceneMap - .get(player.getCurrentRealmId() + 2200) - .getBlockItems() - .forEach( - (i, e) -> { - e.getDeployNPCList() - .forEach( - id -> { - invitedAvatars.add(id.getAvatarId()); - }); - }); + mainHouseMap + .get(player.getCurrentRealmId() + 2000) + .getBlockItems() + .forEach( + (i, e) -> { + e.getDeployNPCList() + .forEach( + id -> { + invitedAvatars.add(id.getAvatarId()); + }); + }); } // Add exp to all avatars diff --git a/src/main/java/emu/grasscutter/game/home/HomeFurnitureItem.java b/src/main/java/emu/grasscutter/game/home/HomeFurnitureItem.java index 040f47347..2e1bd2703 100644 --- a/src/main/java/emu/grasscutter/game/home/HomeFurnitureItem.java +++ b/src/main/java/emu/grasscutter/game/home/HomeFurnitureItem.java @@ -5,6 +5,7 @@ import emu.grasscutter.data.GameData; import emu.grasscutter.data.binout.HomeworldDefaultSaveData; import emu.grasscutter.data.excels.ItemData; import emu.grasscutter.game.world.Position; + import emu.grasscutter.net.proto.*; import java.util.Set; import java.util.stream.Collectors; @@ -65,7 +66,7 @@ public class HomeFurnitureItem implements HomeMarkPointProtoFactory { } public ItemData getAsItem() { - return GameData.getItemDataMap().get(this.furnitureId); + return this.furnitureId == 0 ? null : GameData.getItemDataMap().get(this.furnitureId); } public int getComfort() { diff --git a/src/main/java/emu/grasscutter/game/home/HomeSceneItem.java b/src/main/java/emu/grasscutter/game/home/HomeSceneItem.java index c2984a0cf..a313c08dc 100644 --- a/src/main/java/emu/grasscutter/game/home/HomeSceneItem.java +++ b/src/main/java/emu/grasscutter/game/home/HomeSceneItem.java @@ -9,6 +9,7 @@ import emu.grasscutter.game.entity.EntityHomeAnimal; import emu.grasscutter.game.world.Position; import emu.grasscutter.game.world.Scene; import emu.grasscutter.net.proto.HomeSceneArrangementInfoOuterClass.HomeSceneArrangementInfo; + import java.util.Collection; import java.util.List; import java.util.Map; @@ -62,7 +63,11 @@ public class HomeSceneItem { this.bornRot = new Position(arrangementInfo.getBornRot()); this.djinnPos = new Position(arrangementInfo.getDjinnPos()); this.homeBgmId = arrangementInfo.getBgmId(); - this.mainHouse = HomeFurnitureItem.parseFrom(arrangementInfo.getMainHouse()); + + if (!this.isRoom() && arrangementInfo.hasMainHouse()) { + this.mainHouse = HomeFurnitureItem.parseFrom(arrangementInfo.getMainHouse()); + } + this.tmpVersion = arrangementInfo.getTmpVersion(); } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeModuleReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeModuleReq.java index e4e397269..ccb9262a3 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeModuleReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeModuleReq.java @@ -8,6 +8,7 @@ import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.proto.HomeChangeModuleReqOuterClass; import emu.grasscutter.server.event.player.PlayerTeleportEvent.TeleportType; import emu.grasscutter.server.game.GameSession; + import emu.grasscutter.server.packet.send.PacketHomeAvatarTalkFinishInfoNotify; import emu.grasscutter.server.packet.send.PacketHomeChangeModuleRsp; import emu.grasscutter.server.packet.send.PacketHomeComfortInfoNotify; @@ -20,6 +21,12 @@ public class HandlerHomeChangeModuleReq extends PacketHandler { public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { HomeChangeModuleReqOuterClass.HomeChangeModuleReq req = HomeChangeModuleReqOuterClass.HomeChangeModuleReq.parseFrom(payload); + + if (!session.getPlayer().getCurHomeWorld().getGuests().isEmpty()) { + session.send(new PacketHomeChangeModuleRsp()); + return; + } + session.getPlayer().setCurrentRealmId(req.getTargetModuleId()); session.send(new PacketHomeAvatarTalkFinishInfoNotify(session.getPlayer())); session.send(new PacketHomeChangeModuleRsp(req.getTargetModuleId())); diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeSceneJumpReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeSceneJumpReq.java index d365be12f..4764657c9 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeSceneJumpReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeSceneJumpReq.java @@ -1,6 +1,8 @@ package emu.grasscutter.server.packet.recv; -import emu.grasscutter.net.packet.*; +import emu.grasscutter.net.packet.Opcodes; +import emu.grasscutter.net.packet.PacketHandler; +import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.proto.HomeSceneJumpReqOuterClass; import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.packet.send.PacketHomeSceneJumpRsp; @@ -22,7 +24,7 @@ public class HandlerHomeSceneJumpReq extends PacketHandler { var scene = world.getSceneById(req.getIsEnterRoomScene() ? homeScene.getRoomSceneId() : realmId); var pos = scene.getScriptManager().getConfig().born_pos; - var rot = home.getSceneMap().get(scene.getId()).getBornRot(); + var rot = home.getHomeSceneItem(scene.getId()).getBornRot(); // Make player face correct direction when entering or exiting session.getPlayer().getRotation().set(rot); diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeUpdateArrangementInfoReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeUpdateArrangementInfoReq.java index be36159e4..84edb8c9d 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeUpdateArrangementInfoReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeUpdateArrangementInfoReq.java @@ -5,6 +5,8 @@ import emu.grasscutter.net.packet.PacketHandler; import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.proto.HomeUpdateArrangementInfoReqOuterClass; import emu.grasscutter.server.game.GameSession; + +import emu.grasscutter.server.packet.send.PacketHomeBasicInfoNotify; import emu.grasscutter.server.packet.send.PacketHomeAvatarTalkFinishInfoNotify; import emu.grasscutter.server.packet.send.PacketHomeMarkPointNotify; import emu.grasscutter.server.packet.send.PacketHomeUpdateArrangementInfoRsp; @@ -20,8 +22,13 @@ public class HandlerHomeUpdateArrangementInfoReq extends PacketHandler { var homeScene = session.getPlayer().getHome().getHomeSceneItem(session.getPlayer().getSceneId()); + var roomSceneId = homeScene.getRoomSceneId(); homeScene.update(req.getSceneArrangementInfo()); + if (roomSceneId != homeScene.getRoomSceneId()) { + session.getPlayer().getHome().onMainHouseChanged(); + } + session.send(new PacketHomeBasicInfoNotify(session.getPlayer(), session.getPlayer().isInEditMode())); session.send(new PacketHomeAvatarTalkFinishInfoNotify(session.getPlayer())); session.send(new PacketHomeMarkPointNotify(session.getPlayer())); diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeChangeModuleRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeChangeModuleRsp.java index de279cf3d..85055bf04 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeChangeModuleRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeChangeModuleRsp.java @@ -1,7 +1,9 @@ package emu.grasscutter.server.packet.send; -import emu.grasscutter.net.packet.*; +import emu.grasscutter.net.packet.BasePacket; +import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.proto.HomeChangeModuleRspOuterClass; +import emu.grasscutter.net.proto.RetcodeOuterClass; public class PacketHomeChangeModuleRsp extends BasePacket { @@ -16,4 +18,11 @@ public class PacketHomeChangeModuleRsp extends BasePacket { this.setData(proto); } + + public PacketHomeChangeModuleRsp() { + super(PacketOpcodes.HomeChangeModuleRsp); + + this.setData(HomeChangeModuleRspOuterClass.HomeChangeModuleRsp.newBuilder() + .setRetcode(RetcodeOuterClass.Retcode.RET_HOME_HAS_GUEST_VALUE)); + } } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeComfortInfoNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeComfortInfoNotify.java index 29604f58e..9197c4ff0 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeComfortInfoNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeComfortInfoNotify.java @@ -22,7 +22,7 @@ public class PacketHomeComfortInfoNotify extends BasePacket { var homeScene = player.getHome().getHomeSceneItem(moduleId + 2000); var blockComfortList = homeScene.getBlockItems().values().stream().map(HomeBlockItem::calComfort).toList(); - var homeRoomScene = player.getHome().getHomeSceneItem(homeScene.getRoomSceneId()); + var homeRoomScene = player.getHome().getMainHouseItem(moduleId + 2000); comfortInfoList.add( HomeModuleComfortInfoOuterClass.HomeModuleComfortInfo.newBuilder() diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeMarkPointNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeMarkPointNotify.java index c3b44eea8..9fff3088a 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeMarkPointNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeMarkPointNotify.java @@ -1,10 +1,13 @@ package emu.grasscutter.server.packet.send; -import emu.grasscutter.game.home.*; +import emu.grasscutter.game.home.HomeBlockItem; +import emu.grasscutter.game.home.HomeMarkPointProtoFactory; import emu.grasscutter.game.player.Player; + import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.*; import java.util.Collection; +import java.util.Set; public class PacketHomeMarkPointNotify extends BasePacket { @@ -20,38 +23,33 @@ public class PacketHomeMarkPointNotify extends BasePacket { return; } - for (var moduleId : owner.getRealmList()) { - var homeScene = home.getHomeSceneItem(moduleId + 2000); + // send current home mark points. + var moduleId = owner.getCurrentRealmId(); + var homeScene = home.getHomeSceneItem(moduleId + 2000); + var mainHouse = home.getMainHouseItem(moduleId + 2000); + Set.of(homeScene, mainHouse).forEach(homeSceneItem -> { var markPointData = - HomeMarkPointSceneDataOuterClass.HomeMarkPointSceneData.newBuilder() - .setModuleId(moduleId) - .setSceneId(moduleId + 2000) - .setSafePointPos( - homeScene.isRoom() - ? VectorOuterClass.Vector.newBuilder().build() - : world - .getSceneById(moduleId + 2000) - .getScriptManager() - .getConfig() - .born_pos - .toProto()) - .setTeapotSpiritPos( - homeScene.isRoom() - ? VectorOuterClass.Vector.newBuilder().build() - : homeScene.getDjinnPos().toProto()); + HomeMarkPointSceneDataOuterClass.HomeMarkPointSceneData.newBuilder() + .setModuleId(moduleId) + .setSceneId(homeSceneItem.getSceneId()); - var marks = - homeScene.getBlockItems().values().stream() - .map(HomeBlockItem::getMarkPointProtoFactories) - .flatMap(Collection::stream) - .filter(HomeMarkPointProtoFactory::isProtoConvertible) - .map(HomeMarkPointProtoFactory::toMarkPointProto) - .toList(); + if (!homeSceneItem.isRoom()) { + var config = world.getSceneById(moduleId + 2000).getScriptManager().getConfig(); + markPointData.setSafePointPos(config == null ? homeSceneItem.getBornPos().toProto() : config.born_pos.toProto()) + .setTeapotSpiritPos(homeSceneItem.getDjinnPos().toProto()); + } + + var marks = homeSceneItem.getBlockItems().values().stream() + .map(HomeBlockItem::getMarkPointProtoFactories) + .flatMap(Collection::stream) + .filter(HomeMarkPointProtoFactory::isProtoConvertible) + .map(HomeMarkPointProtoFactory::toMarkPointProto) + .toList(); markPointData.addAllFurnitureList(marks); proto.addMarkPointDataList(markPointData); - } + }); this.setData(proto); } From f8fb6732dec6133a54b3751e2f73e41de804d84d Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 2 Sep 2023 15:55:11 +0000 Subject: [PATCH 10/10] Format code [skip actions] --- .../emu/grasscutter/game/home/GameHome.java | 68 +++++++++++-------- .../game/home/HomeFurnitureItem.java | 1 - .../grasscutter/game/home/HomeSceneItem.java | 1 - .../recv/HandlerHomeChangeModuleReq.java | 1 - .../HandlerHomeUpdateArrangementInfoReq.java | 6 +- .../send/PacketHomeChangeModuleRsp.java | 5 +- .../send/PacketHomeMarkPointNotify.java | 46 +++++++------ 7 files changed, 70 insertions(+), 58 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/home/GameHome.java b/src/main/java/emu/grasscutter/game/home/GameHome.java index e078b8f2d..52f58e3f6 100644 --- a/src/main/java/emu/grasscutter/game/home/GameHome.java +++ b/src/main/java/emu/grasscutter/game/home/GameHome.java @@ -12,7 +12,6 @@ import emu.grasscutter.game.props.SceneType; import emu.grasscutter.net.proto.HomeAvatarTalkFinishInfoOuterClass; import emu.grasscutter.server.packet.send.*; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; - import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; import java.util.*; @@ -74,19 +73,22 @@ public class GameHome { public static GameHome create(Integer uid) { return GameHome.of() - .ownerUid(uid) - .level(1) - .sceneMap(new ConcurrentHashMap<>()) - .mainHouseMap(new ConcurrentHashMap<>()) - .unlockedHomeBgmList(new HashSet<>()) - .finishedTalkIdMap(new HashMap<>()) - .build(); + .ownerUid(uid) + .level(1) + .sceneMap(new ConcurrentHashMap<>()) + .mainHouseMap(new ConcurrentHashMap<>()) + .unlockedHomeBgmList(new HashSet<>()) + .finishedTalkIdMap(new HashMap<>()) + .build(); } // Data fixer. private void fixMainHouseIfOld() { if (this.getMainHouseMap() == null) { - Grasscutter.getLogger().debug("Player {}'s main house will be deleted due to GC update! (ps. sorry XD)", this.getPlayer().getUid()); + Grasscutter.getLogger() + .debug( + "Player {}'s main house will be deleted due to GC update! (ps. sorry XD)", + this.getPlayer().getUid()); this.mainHouseMap = new ConcurrentHashMap<>(); // assign. } @@ -121,18 +123,24 @@ public class GameHome { } public HomeSceneItem getMainHouseItem(int outdoorSceneId) { - return this.getMainHouseMap().computeIfAbsent(outdoorSceneId, integer -> { - var curHomeSceneItem = this.getHomeSceneItem(outdoorSceneId); - var roomSceneId = curHomeSceneItem.getRoomSceneId(); - var defaultItem = GameData.getHomeworldDefaultSaveData().get(roomSceneId); - if (defaultItem == null) { - Grasscutter.getLogger().info("defaultItem == null! returns Liyue style house."); - return HomeSceneItem.parseFrom(GameData.getHomeworldDefaultSaveData().get(2202), 2202); // Liyue style - } + return this.getMainHouseMap() + .computeIfAbsent( + outdoorSceneId, + integer -> { + var curHomeSceneItem = this.getHomeSceneItem(outdoorSceneId); + var roomSceneId = curHomeSceneItem.getRoomSceneId(); + var defaultItem = GameData.getHomeworldDefaultSaveData().get(roomSceneId); + if (defaultItem == null) { + Grasscutter.getLogger().info("defaultItem == null! returns Liyue style house."); + return HomeSceneItem.parseFrom( + GameData.getHomeworldDefaultSaveData().get(2202), 2202); // Liyue style + } - Grasscutter.getLogger().info("Set player {} main house {} to initial setting", this.ownerUid, roomSceneId); - return HomeSceneItem.parseFrom(defaultItem, roomSceneId); - }); + Grasscutter.getLogger() + .info( + "Set player {} main house {} to initial setting", this.ownerUid, roomSceneId); + return HomeSceneItem.parseFrom(defaultItem, roomSceneId); + }); } public void onMainHouseChanged() { @@ -321,16 +329,16 @@ public class GameHome { if (Objects.nonNull(mainHouseMap.get(player.getCurrentRealmId() + 2000))) { // Indoors avatars mainHouseMap - .get(player.getCurrentRealmId() + 2000) - .getBlockItems() - .forEach( - (i, e) -> { - e.getDeployNPCList() - .forEach( - id -> { - invitedAvatars.add(id.getAvatarId()); - }); - }); + .get(player.getCurrentRealmId() + 2000) + .getBlockItems() + .forEach( + (i, e) -> { + e.getDeployNPCList() + .forEach( + id -> { + invitedAvatars.add(id.getAvatarId()); + }); + }); } // Add exp to all avatars diff --git a/src/main/java/emu/grasscutter/game/home/HomeFurnitureItem.java b/src/main/java/emu/grasscutter/game/home/HomeFurnitureItem.java index 2e1bd2703..7b50292eb 100644 --- a/src/main/java/emu/grasscutter/game/home/HomeFurnitureItem.java +++ b/src/main/java/emu/grasscutter/game/home/HomeFurnitureItem.java @@ -5,7 +5,6 @@ import emu.grasscutter.data.GameData; import emu.grasscutter.data.binout.HomeworldDefaultSaveData; import emu.grasscutter.data.excels.ItemData; import emu.grasscutter.game.world.Position; - import emu.grasscutter.net.proto.*; import java.util.Set; import java.util.stream.Collectors; diff --git a/src/main/java/emu/grasscutter/game/home/HomeSceneItem.java b/src/main/java/emu/grasscutter/game/home/HomeSceneItem.java index a313c08dc..96de2ce33 100644 --- a/src/main/java/emu/grasscutter/game/home/HomeSceneItem.java +++ b/src/main/java/emu/grasscutter/game/home/HomeSceneItem.java @@ -9,7 +9,6 @@ import emu.grasscutter.game.entity.EntityHomeAnimal; import emu.grasscutter.game.world.Position; import emu.grasscutter.game.world.Scene; import emu.grasscutter.net.proto.HomeSceneArrangementInfoOuterClass.HomeSceneArrangementInfo; - import java.util.Collection; import java.util.List; import java.util.Map; diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeModuleReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeModuleReq.java index ccb9262a3..cff46aab2 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeModuleReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeChangeModuleReq.java @@ -8,7 +8,6 @@ import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.proto.HomeChangeModuleReqOuterClass; import emu.grasscutter.server.event.player.PlayerTeleportEvent.TeleportType; import emu.grasscutter.server.game.GameSession; - import emu.grasscutter.server.packet.send.PacketHomeAvatarTalkFinishInfoNotify; import emu.grasscutter.server.packet.send.PacketHomeChangeModuleRsp; import emu.grasscutter.server.packet.send.PacketHomeComfortInfoNotify; diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeUpdateArrangementInfoReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeUpdateArrangementInfoReq.java index 84edb8c9d..2b93ac718 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeUpdateArrangementInfoReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerHomeUpdateArrangementInfoReq.java @@ -5,9 +5,8 @@ import emu.grasscutter.net.packet.PacketHandler; import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.proto.HomeUpdateArrangementInfoReqOuterClass; import emu.grasscutter.server.game.GameSession; - -import emu.grasscutter.server.packet.send.PacketHomeBasicInfoNotify; import emu.grasscutter.server.packet.send.PacketHomeAvatarTalkFinishInfoNotify; +import emu.grasscutter.server.packet.send.PacketHomeBasicInfoNotify; import emu.grasscutter.server.packet.send.PacketHomeMarkPointNotify; import emu.grasscutter.server.packet.send.PacketHomeUpdateArrangementInfoRsp; @@ -28,7 +27,8 @@ public class HandlerHomeUpdateArrangementInfoReq extends PacketHandler { session.getPlayer().getHome().onMainHouseChanged(); } - session.send(new PacketHomeBasicInfoNotify(session.getPlayer(), session.getPlayer().isInEditMode())); + session.send( + new PacketHomeBasicInfoNotify(session.getPlayer(), session.getPlayer().isInEditMode())); session.send(new PacketHomeAvatarTalkFinishInfoNotify(session.getPlayer())); session.send(new PacketHomeMarkPointNotify(session.getPlayer())); diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeChangeModuleRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeChangeModuleRsp.java index 85055bf04..641d989ac 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeChangeModuleRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeChangeModuleRsp.java @@ -22,7 +22,8 @@ public class PacketHomeChangeModuleRsp extends BasePacket { public PacketHomeChangeModuleRsp() { super(PacketOpcodes.HomeChangeModuleRsp); - this.setData(HomeChangeModuleRspOuterClass.HomeChangeModuleRsp.newBuilder() - .setRetcode(RetcodeOuterClass.Retcode.RET_HOME_HAS_GUEST_VALUE)); + this.setData( + HomeChangeModuleRspOuterClass.HomeChangeModuleRsp.newBuilder() + .setRetcode(RetcodeOuterClass.Retcode.RET_HOME_HAS_GUEST_VALUE)); } } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeMarkPointNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeMarkPointNotify.java index 9fff3088a..6646efccb 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketHomeMarkPointNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketHomeMarkPointNotify.java @@ -3,7 +3,6 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.game.home.HomeBlockItem; import emu.grasscutter.game.home.HomeMarkPointProtoFactory; import emu.grasscutter.game.player.Player; - import emu.grasscutter.net.packet.*; import emu.grasscutter.net.proto.*; import java.util.Collection; @@ -28,28 +27,35 @@ public class PacketHomeMarkPointNotify extends BasePacket { var homeScene = home.getHomeSceneItem(moduleId + 2000); var mainHouse = home.getMainHouseItem(moduleId + 2000); - Set.of(homeScene, mainHouse).forEach(homeSceneItem -> { - var markPointData = - HomeMarkPointSceneDataOuterClass.HomeMarkPointSceneData.newBuilder() - .setModuleId(moduleId) - .setSceneId(homeSceneItem.getSceneId()); + Set.of(homeScene, mainHouse) + .forEach( + homeSceneItem -> { + var markPointData = + HomeMarkPointSceneDataOuterClass.HomeMarkPointSceneData.newBuilder() + .setModuleId(moduleId) + .setSceneId(homeSceneItem.getSceneId()); - if (!homeSceneItem.isRoom()) { - var config = world.getSceneById(moduleId + 2000).getScriptManager().getConfig(); - markPointData.setSafePointPos(config == null ? homeSceneItem.getBornPos().toProto() : config.born_pos.toProto()) - .setTeapotSpiritPos(homeSceneItem.getDjinnPos().toProto()); - } + if (!homeSceneItem.isRoom()) { + var config = world.getSceneById(moduleId + 2000).getScriptManager().getConfig(); + markPointData + .setSafePointPos( + config == null + ? homeSceneItem.getBornPos().toProto() + : config.born_pos.toProto()) + .setTeapotSpiritPos(homeSceneItem.getDjinnPos().toProto()); + } - var marks = homeSceneItem.getBlockItems().values().stream() - .map(HomeBlockItem::getMarkPointProtoFactories) - .flatMap(Collection::stream) - .filter(HomeMarkPointProtoFactory::isProtoConvertible) - .map(HomeMarkPointProtoFactory::toMarkPointProto) - .toList(); + var marks = + homeSceneItem.getBlockItems().values().stream() + .map(HomeBlockItem::getMarkPointProtoFactories) + .flatMap(Collection::stream) + .filter(HomeMarkPointProtoFactory::isProtoConvertible) + .map(HomeMarkPointProtoFactory::toMarkPointProto) + .toList(); - markPointData.addAllFurnitureList(marks); - proto.addMarkPointDataList(markPointData); - }); + markPointData.addAllFurnitureList(marks); + proto.addMarkPointDataList(markPointData); + }); this.setData(proto); }