Fix advancement-related memory leak (#104)
Fix memory leak with loaded players' advancements Fix missing transaction transfer for player inventories Fix incorrect transaction transfer for ender chests Minor code health
This commit is contained in:
@@ -476,8 +476,9 @@ public class OpenInv extends JavaPlugin implements IOpenInv {
|
||||
|
||||
if (!disableSaving()
|
||||
&& current != null
|
||||
&& current.getPlayer() instanceof Player player && !player.isOnline()) {
|
||||
this.accessor.getPlayerDataManager().inject(player).saveData();
|
||||
&& current.getPlayer() instanceof Player player
|
||||
&& !player.isOnline()) {
|
||||
this.accessor.getPlayerDataManager().inject(player).saveData();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2021 lishid. All rights reserved.
|
||||
* Copyright (C) 2011-2022 lishid. All rights reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@@ -27,13 +27,17 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class OpenInventoryView extends InventoryView {
|
||||
|
||||
private final Player player;
|
||||
private final ISpecialInventory inventory;
|
||||
private final String titleKey;
|
||||
private final String titleDefaultSuffix;
|
||||
private final @NotNull Player player;
|
||||
private final @NotNull ISpecialInventory inventory;
|
||||
private final @NotNull String titleKey;
|
||||
private final @NotNull String titleDefaultSuffix;
|
||||
private String title;
|
||||
|
||||
public OpenInventoryView(Player player, ISpecialInventory inventory, String titleKey, String titleDefaultSuffix) {
|
||||
public OpenInventoryView(
|
||||
@NotNull Player player,
|
||||
@NotNull ISpecialInventory inventory,
|
||||
@NotNull String titleKey,
|
||||
@NotNull String titleDefaultSuffix) {
|
||||
this.player = player;
|
||||
this.inventory = inventory;
|
||||
this.titleKey = titleKey;
|
||||
|
Reference in New Issue
Block a user