Skip to content

Commit

Permalink
Fix loadPreviousLocation using the new LocationWrapper + NullCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelillo15 committed May 18, 2024
1 parent 574eb2b commit 03753b2
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
import com.nookure.staff.api.model.StaffDataModel;
import com.nookure.staff.api.util.Scheduler;
import com.nookure.staff.paper.data.StaffModeData;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.NamespacedKey;
import org.bukkit.Registry;
import org.bukkit.*;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;
Expand Down Expand Up @@ -258,7 +255,9 @@ public void saveLocation() {
}

public void loadPreviousLocation() {
player.teleport(staffModeData.record().enabledLocation());
Location location = staffModeData.record().enabledLocation();
if (location == null) return;
player.teleport(location);
}

private void writeVanishState(boolean state) {
Expand Down

0 comments on commit 03753b2

Please sign in to comment.