Save existing vehicles if we had to load player (#22)
This commit is contained in:
		@@ -465,6 +465,9 @@ public class OpenInv extends JavaPlugin implements IOpenInv {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Replace stored player with our own version
 | 
			
		||||
        this.playerCache.put(key, this.accessor.getPlayerDataManager().inject(player));
 | 
			
		||||
 | 
			
		||||
        if (this.inventories.containsKey(key)) {
 | 
			
		||||
            this.inventories.get(key).setPlayerOffline();
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -35,6 +35,14 @@ public interface IPlayerDataManager {
 | 
			
		||||
    @Nullable
 | 
			
		||||
    Player loadPlayer(@NotNull OfflinePlayer offline);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Creates a new Player from an existing one that will function slightly better offline.
 | 
			
		||||
     *
 | 
			
		||||
     * @return the Player
 | 
			
		||||
     */
 | 
			
		||||
    @NotNull
 | 
			
		||||
    Player inject(@NotNull Player player);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Opens an ISpecialInventory for a Player.
 | 
			
		||||
     *
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user