From b9b0f002324c5937818fef7339c00c9a6b070fb5 Mon Sep 17 00:00:00 2001 From: Melledy <52122272+Melledy@users.noreply.github.com> Date: Wed, 20 Jul 2022 03:17:59 -0700 Subject: [PATCH] Move PlayerManagers and GameServerSystems around --- .../managers/collection/CollectionData.java | 30 ------------------- .../emu/grasscutter/game/player/Player.java | 9 +++--- .../PlayerCollectionRecords.java} | 4 +-- .../AnnouncementSystem.java | 2 +- .../InventorySystem.java | 2 +- .../MultiplayerSystem.java | 2 +- .../grasscutter/server/game/GameServer.java | 6 ++-- .../task/tasks/AnnouncementTask.java | 2 +- 8 files changed, 13 insertions(+), 44 deletions(-) delete mode 100644 src/main/java/emu/grasscutter/game/managers/collection/CollectionData.java rename src/main/java/emu/grasscutter/game/{managers/collection/CollectionRecordStore.java => player/PlayerCollectionRecords.java} (94%) rename src/main/java/emu/grasscutter/game/{managers => systems}/AnnouncementSystem.java (98%) rename src/main/java/emu/grasscutter/game/{managers => systems}/InventorySystem.java (99%) rename src/main/java/emu/grasscutter/game/{managers => systems}/MultiplayerSystem.java (99%) diff --git a/src/main/java/emu/grasscutter/game/managers/collection/CollectionData.java b/src/main/java/emu/grasscutter/game/managers/collection/CollectionData.java deleted file mode 100644 index ee3123283..000000000 --- a/src/main/java/emu/grasscutter/game/managers/collection/CollectionData.java +++ /dev/null @@ -1,30 +0,0 @@ -package emu.grasscutter.game.managers.collection; - - -import emu.grasscutter.game.props.FightProperty; -import emu.grasscutter.utils.Position; - -public class CollectionData { - Gadget gadget; - MotionInfo motionInfo; - Prop[] fightPropList; - static class GatherGadget{ - int itemId; - } - static class Gadget{ - int gadgetId; - int authorityPeerId; - int configId; - int groupId; - boolean isEnableInteract; - GatherGadget gatherGadget; - } - static class MotionInfo{ - Position pos; - Position rot; - } - static class Prop{ - int propType; - float propValue; - } -} diff --git a/src/main/java/emu/grasscutter/game/player/Player.java b/src/main/java/emu/grasscutter/game/player/Player.java index 4172368e2..df4bad584 100644 --- a/src/main/java/emu/grasscutter/game/player/Player.java +++ b/src/main/java/emu/grasscutter/game/player/Player.java @@ -31,7 +31,6 @@ import emu.grasscutter.game.mail.MailHandler; import emu.grasscutter.game.managers.CookingManager; import emu.grasscutter.game.managers.FurnitureManager; import emu.grasscutter.game.managers.ResinManager; -import emu.grasscutter.game.managers.collection.CollectionRecordStore; import emu.grasscutter.game.managers.deforestation.DeforestationManager; import emu.grasscutter.game.managers.energy.EnergyManager; import emu.grasscutter.game.managers.forging.ActiveForgeData; @@ -158,7 +157,7 @@ public class Player { private TowerData towerData; private PlayerGachaInfo gachaInfo; private PlayerOpenStateManager openStateManager; - private CollectionRecordStore collectionRecordStore; + private PlayerCollectionRecords collectionRecordStore; private ArrayList shopLimit; @Getter private transient GameHome home; @@ -213,7 +212,7 @@ public class Player { this.flyCloakList = new HashSet<>(); this.costumeList = new HashSet<>(); this.towerData = new TowerData(); - this.collectionRecordStore = new CollectionRecordStore(); + this.collectionRecordStore = new PlayerCollectionRecords(); this.unlockedForgingBlueprints = new HashSet<>(); this.unlockedCombines = new HashSet<>(); this.unlockedFurniture = new HashSet<>(); @@ -1148,9 +1147,9 @@ public class Player { this.battlePassManager.getMissions().values().removeIf(mission -> mission.getData() == null); } - public CollectionRecordStore getCollectionRecordStore() { + public PlayerCollectionRecords getCollectionRecordStore() { if(this.collectionRecordStore==null){ - this.collectionRecordStore = new CollectionRecordStore(); + this.collectionRecordStore = new PlayerCollectionRecords(); } return collectionRecordStore; } diff --git a/src/main/java/emu/grasscutter/game/managers/collection/CollectionRecordStore.java b/src/main/java/emu/grasscutter/game/player/PlayerCollectionRecords.java similarity index 94% rename from src/main/java/emu/grasscutter/game/managers/collection/CollectionRecordStore.java rename to src/main/java/emu/grasscutter/game/player/PlayerCollectionRecords.java index be250998d..6b75a1f7e 100644 --- a/src/main/java/emu/grasscutter/game/managers/collection/CollectionRecordStore.java +++ b/src/main/java/emu/grasscutter/game/player/PlayerCollectionRecords.java @@ -1,4 +1,4 @@ -package emu.grasscutter.game.managers.collection; +package emu.grasscutter.game.player; import java.util.HashMap; import java.util.Map; @@ -6,7 +6,7 @@ import java.util.Map; import dev.morphia.annotations.Entity; @Entity -public class CollectionRecordStore { +public class PlayerCollectionRecords { private Map records; private Map getRecords() { diff --git a/src/main/java/emu/grasscutter/game/managers/AnnouncementSystem.java b/src/main/java/emu/grasscutter/game/systems/AnnouncementSystem.java similarity index 98% rename from src/main/java/emu/grasscutter/game/managers/AnnouncementSystem.java rename to src/main/java/emu/grasscutter/game/systems/AnnouncementSystem.java index 22f23ffcf..5d2161b94 100644 --- a/src/main/java/emu/grasscutter/game/managers/AnnouncementSystem.java +++ b/src/main/java/emu/grasscutter/game/systems/AnnouncementSystem.java @@ -1,4 +1,4 @@ -package emu.grasscutter.game.managers; +package emu.grasscutter.game.systems; import com.google.gson.reflect.TypeToken; import emu.grasscutter.Grasscutter; diff --git a/src/main/java/emu/grasscutter/game/managers/InventorySystem.java b/src/main/java/emu/grasscutter/game/systems/InventorySystem.java similarity index 99% rename from src/main/java/emu/grasscutter/game/managers/InventorySystem.java rename to src/main/java/emu/grasscutter/game/systems/InventorySystem.java index bf38f64cb..37b988ff8 100644 --- a/src/main/java/emu/grasscutter/game/managers/InventorySystem.java +++ b/src/main/java/emu/grasscutter/game/systems/InventorySystem.java @@ -1,4 +1,4 @@ -package emu.grasscutter.game.managers; +package emu.grasscutter.game.systems; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/main/java/emu/grasscutter/game/managers/MultiplayerSystem.java b/src/main/java/emu/grasscutter/game/systems/MultiplayerSystem.java similarity index 99% rename from src/main/java/emu/grasscutter/game/managers/MultiplayerSystem.java rename to src/main/java/emu/grasscutter/game/systems/MultiplayerSystem.java index d64a34572..a3f23a448 100644 --- a/src/main/java/emu/grasscutter/game/managers/MultiplayerSystem.java +++ b/src/main/java/emu/grasscutter/game/systems/MultiplayerSystem.java @@ -1,4 +1,4 @@ -package emu.grasscutter.game.managers; +package emu.grasscutter.game.systems; import emu.grasscutter.game.CoopRequest; import emu.grasscutter.game.props.EnterReason; diff --git a/src/main/java/emu/grasscutter/server/game/GameServer.java b/src/main/java/emu/grasscutter/server/game/GameServer.java index 84c4c2605..f115b2c3b 100644 --- a/src/main/java/emu/grasscutter/server/game/GameServer.java +++ b/src/main/java/emu/grasscutter/server/game/GameServer.java @@ -12,10 +12,7 @@ import emu.grasscutter.game.dungeons.DungeonSystem; import emu.grasscutter.game.dungeons.challenge.DungeonChallenge; import emu.grasscutter.game.expedition.ExpeditionSystem; import emu.grasscutter.game.gacha.GachaSystem; -import emu.grasscutter.game.managers.AnnouncementSystem; import emu.grasscutter.game.managers.CookingManager; -import emu.grasscutter.game.managers.InventorySystem; -import emu.grasscutter.game.managers.MultiplayerSystem; import emu.grasscutter.game.managers.chat.ChatManager; import emu.grasscutter.game.managers.chat.ChatManagerHandler; import emu.grasscutter.game.managers.energy.EnergyManager; @@ -23,6 +20,9 @@ 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.AnnouncementSystem; +import emu.grasscutter.game.systems.InventorySystem; +import emu.grasscutter.game.systems.MultiplayerSystem; import emu.grasscutter.game.tower.TowerSystem; import emu.grasscutter.game.world.World; import emu.grasscutter.game.world.WorldDataSystem; diff --git a/src/main/java/emu/grasscutter/task/tasks/AnnouncementTask.java b/src/main/java/emu/grasscutter/task/tasks/AnnouncementTask.java index c6ec1619b..a8d99698e 100644 --- a/src/main/java/emu/grasscutter/task/tasks/AnnouncementTask.java +++ b/src/main/java/emu/grasscutter/task/tasks/AnnouncementTask.java @@ -1,7 +1,7 @@ package emu.grasscutter.task.tasks; import emu.grasscutter.Grasscutter; -import emu.grasscutter.game.managers.AnnouncementSystem; +import emu.grasscutter.game.systems.AnnouncementSystem; import emu.grasscutter.task.Task; import emu.grasscutter.task.TaskHandler; import org.quartz.JobExecutionContext;