From f22b92b08fbc79436c10aa55c4ad40cfafe47dfd Mon Sep 17 00:00:00 2001 From: Melledy <52122272+Melledy@users.noreply.github.com> Date: Wed, 20 Jul 2022 02:01:56 -0700 Subject: [PATCH] Add a `save()` function to player managers --- .../grasscutter/game/managers/mapmark/MapMarksManager.java | 4 ---- .../emu/grasscutter/game/player/BasePlayerManager.java | 7 +++++++ 2 files changed, 7 insertions(+), 4 deletions(-) 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 225aa834a..703385bc6 100644 --- a/src/main/java/emu/grasscutter/game/managers/mapmark/MapMarksManager.java +++ b/src/main/java/emu/grasscutter/game/managers/mapmark/MapMarksManager.java @@ -66,10 +66,6 @@ public class MapMarksManager extends BasePlayerManager { } } - private void save() { - player.save(); - } - private void teleport(Player player, MapMark mapMark) { float y; try { diff --git a/src/main/java/emu/grasscutter/game/player/BasePlayerManager.java b/src/main/java/emu/grasscutter/game/player/BasePlayerManager.java index 24023f726..7508995c0 100644 --- a/src/main/java/emu/grasscutter/game/player/BasePlayerManager.java +++ b/src/main/java/emu/grasscutter/game/player/BasePlayerManager.java @@ -12,4 +12,11 @@ public abstract class BasePlayerManager { public Player getPlayer() { return this.player; } + + /** + * Saves the player to the database + */ + public void save() { + getPlayer().save(); + } }