mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-01-09 07:37:34 +01:00
Let the PlayerData load before trying to update items on player join
- Fixes a NPE on the players first join with items that need updated
This commit is contained in:
parent
279b008122
commit
6e2fb4c19d
@ -36,7 +36,7 @@ import java.util.Map;
|
|||||||
public class PlayerListener implements Listener {
|
public class PlayerListener implements Listener {
|
||||||
private final Map<Player, ArrayList<ItemStack>> deathItems = new HashMap<>();
|
private final Map<Player, ArrayList<ItemStack>> deathItems = new HashMap<>();
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler(priority = EventPriority.NORMAL)
|
||||||
public void loadPlayerData(PlayerJoinEvent event) {
|
public void loadPlayerData(PlayerJoinEvent event) {
|
||||||
MMOItems.plugin.getRecipes().refreshRecipeBook(event.getPlayer());
|
MMOItems.plugin.getRecipes().refreshRecipeBook(event.getPlayer());
|
||||||
PlayerData.load(event.getPlayer());
|
PlayerData.load(event.getPlayer());
|
||||||
|
@ -14,6 +14,7 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
@ -56,7 +57,7 @@ public class UpdaterManager implements Listener {
|
|||||||
/**
|
/**
|
||||||
* Updates a player inventory when joining
|
* Updates a player inventory when joining
|
||||||
*/
|
*/
|
||||||
@EventHandler
|
@EventHandler(priority = EventPriority.HIGH)
|
||||||
public void updateOnJoin(PlayerJoinEvent event) {
|
public void updateOnJoin(PlayerJoinEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user