Merge pull request #98 from DerTyan/change-inventory-access-modifiers

Made some field in PlayerInventory protected for allowing usage in child classes
This commit is contained in:
TheMode 2021-01-08 14:49:27 +01:00 committed by GitHub
commit 57166b2d23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,8 +34,8 @@ public class PlayerInventory implements InventoryModifier, InventoryClickHandler
public static final int INVENTORY_SIZE = 46;
private final Player player;
private final ItemStack[] items = new ItemStack[INVENTORY_SIZE];
protected final Player player;
protected final ItemStack[] items = new ItemStack[INVENTORY_SIZE];
private ItemStack cursorItem = ItemStack.getAirItem();
private final List<InventoryCondition> inventoryConditions = new CopyOnWriteArrayList<>();
@ -261,7 +261,7 @@ public class PlayerInventory implements InventoryModifier, InventoryClickHandler
* @throws IllegalArgumentException if the slot {@code slot} does not exist
* @throws NullPointerException if {@code itemStack} is null
*/
private synchronized void safeItemInsert(int slot, @NotNull ItemStack itemStack) {
protected synchronized void safeItemInsert(int slot, @NotNull ItemStack itemStack) {
Check.argCondition(!MathUtils.isBetween(slot, 0, getSize()),
"The slot " + slot + " does not exist for player");
Check.notNull(itemStack, "The ItemStack cannot be null, you can set air instead");