From e8d60c6edf00aff6a43d33d8cd76f6b1becb3920 Mon Sep 17 00:00:00 2001 From: KingRainbow44 Date: Sat, 30 Apr 2022 16:11:00 -0400 Subject: [PATCH] Move join & quit to player event --- .../emu/grasscutter/game/player/Player.java | 5 ++--- .../server/event/game/PlayerJoinEvent.java | 17 ----------------- .../server/event/game/PlayerQuitEvent.java | 16 ---------------- .../server/event/player/PlayerJoinEvent.java | 11 +++++++++++ .../server/event/player/PlayerQuitEvent.java | 11 +++++++++++ 5 files changed, 24 insertions(+), 36 deletions(-) delete mode 100644 src/main/java/emu/grasscutter/server/event/game/PlayerJoinEvent.java delete mode 100644 src/main/java/emu/grasscutter/server/event/game/PlayerQuitEvent.java create mode 100644 src/main/java/emu/grasscutter/server/event/player/PlayerJoinEvent.java create mode 100644 src/main/java/emu/grasscutter/server/event/player/PlayerQuitEvent.java diff --git a/src/main/java/emu/grasscutter/game/player/Player.java b/src/main/java/emu/grasscutter/game/player/Player.java index 68035a39f..2637fb10c 100644 --- a/src/main/java/emu/grasscutter/game/player/Player.java +++ b/src/main/java/emu/grasscutter/game/player/Player.java @@ -21,7 +21,6 @@ import emu.grasscutter.game.inventory.Inventory; import emu.grasscutter.game.mail.Mail; import emu.grasscutter.game.props.ActionReason; import emu.grasscutter.game.props.PlayerProperty; -import emu.grasscutter.game.shop.ShopInfo; import emu.grasscutter.game.shop.ShopLimit; import emu.grasscutter.game.world.Scene; import emu.grasscutter.game.world.World; @@ -37,8 +36,8 @@ import emu.grasscutter.net.proto.PlayerWorldLocationInfoOuterClass; import emu.grasscutter.net.proto.ProfilePictureOuterClass.ProfilePicture; import emu.grasscutter.net.proto.SocialDetailOuterClass.SocialDetail; import emu.grasscutter.net.proto.SocialShowAvatarInfoOuterClass; -import emu.grasscutter.server.event.game.PlayerJoinEvent; -import emu.grasscutter.server.event.game.PlayerQuitEvent; +import emu.grasscutter.server.event.player.PlayerJoinEvent; +import emu.grasscutter.server.event.player.PlayerQuitEvent; import emu.grasscutter.server.event.player.PlayerReceiveMailEvent; import emu.grasscutter.server.game.GameServer; import emu.grasscutter.server.game.GameSession; diff --git a/src/main/java/emu/grasscutter/server/event/game/PlayerJoinEvent.java b/src/main/java/emu/grasscutter/server/event/game/PlayerJoinEvent.java deleted file mode 100644 index 1683acce8..000000000 --- a/src/main/java/emu/grasscutter/server/event/game/PlayerJoinEvent.java +++ /dev/null @@ -1,17 +0,0 @@ -package emu.grasscutter.server.event.game; - -import emu.grasscutter.game.player.Player; -import emu.grasscutter.server.event.Cancellable; -import emu.grasscutter.server.event.types.GameEvent; - -public final class PlayerJoinEvent extends GameEvent implements Cancellable { - private final Player player; - - public PlayerJoinEvent(Player player) { - this.player = player; - } - - public Player getPlayer() { - return this.player; - } -} diff --git a/src/main/java/emu/grasscutter/server/event/game/PlayerQuitEvent.java b/src/main/java/emu/grasscutter/server/event/game/PlayerQuitEvent.java deleted file mode 100644 index df730442d..000000000 --- a/src/main/java/emu/grasscutter/server/event/game/PlayerQuitEvent.java +++ /dev/null @@ -1,16 +0,0 @@ -package emu.grasscutter.server.event.game; - -import emu.grasscutter.game.player.Player; -import emu.grasscutter.server.event.types.GameEvent; - -public final class PlayerQuitEvent extends GameEvent { - private final Player player; - - public PlayerQuitEvent(Player player) { - this.player = player; - } - - public Player getPlayer() { - return this.player; - } -} diff --git a/src/main/java/emu/grasscutter/server/event/player/PlayerJoinEvent.java b/src/main/java/emu/grasscutter/server/event/player/PlayerJoinEvent.java new file mode 100644 index 000000000..59769c1c8 --- /dev/null +++ b/src/main/java/emu/grasscutter/server/event/player/PlayerJoinEvent.java @@ -0,0 +1,11 @@ +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; + +public final class PlayerJoinEvent extends PlayerEvent implements Cancellable { + public PlayerJoinEvent(Player player) { + super(player); + } +} diff --git a/src/main/java/emu/grasscutter/server/event/player/PlayerQuitEvent.java b/src/main/java/emu/grasscutter/server/event/player/PlayerQuitEvent.java new file mode 100644 index 000000000..4ac1b2f3b --- /dev/null +++ b/src/main/java/emu/grasscutter/server/event/player/PlayerQuitEvent.java @@ -0,0 +1,11 @@ +package emu.grasscutter.server.event.player; + +import emu.grasscutter.game.player.Player; +import emu.grasscutter.server.event.types.GameEvent; +import emu.grasscutter.server.event.types.PlayerEvent; + +public final class PlayerQuitEvent extends PlayerEvent { + public PlayerQuitEvent(Player player) { + super(player); + } +}