From aacf15757fdf185629874a6da63dfe662694d6c2 Mon Sep 17 00:00:00 2001 From: Hannes Greule Date: Mon, 17 Aug 2020 15:32:17 +0200 Subject: [PATCH] Use less confusing variable name --- .../plotsquared/bukkit/util/BukkitInventoryUtil.java | 4 ++-- .../com/plotsquared/core/plot/PlotInventory.java | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitInventoryUtil.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitInventoryUtil.java index b50e370cd..dd312fe51 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitInventoryUtil.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitInventoryUtil.java @@ -51,10 +51,10 @@ import java.util.stream.IntStream; @Override public void open(PlotInventory inv) { BukkitPlayer bp = (BukkitPlayer) inv.getPlayer(); - Inventory inventory = Bukkit.createInventory(null, inv.getSize() * 9, + Inventory inventory = Bukkit.createInventory(null, inv.getLines() * 9, ChatColor.translateAlternateColorCodes('&', inv.getTitle())); PlotItemStack[] items = inv.getItems(); - for (int i = 0; i < inv.getSize() * 9; i++) { + for (int i = 0; i < inv.getLines() * 9; i++) { PlotItemStack item = items[i]; if (item != null) { inventory.setItem(i, getItem(item)); diff --git a/Core/src/main/java/com/plotsquared/core/plot/PlotInventory.java b/Core/src/main/java/com/plotsquared/core/plot/PlotInventory.java index 2b7132c7b..368b6922a 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/PlotInventory.java +++ b/Core/src/main/java/com/plotsquared/core/plot/PlotInventory.java @@ -39,18 +39,18 @@ public class PlotInventory { private static final Logger logger = LoggerFactory.getLogger("P2/" + PlotInventory.class.getSimpleName()); private final PlotPlayer player; - private final int size; + private final int lines; private final PlotItemStack[] items; private String title; private boolean open = false; private final InventoryUtil inventoryUtil; public PlotInventory(@Nonnull final InventoryUtil inventoryUtil, - PlotPlayer player, int size, String name) { - this.size = size; + PlotPlayer player, int lines, String name) { + this.lines = lines; this.title = name == null ? "" : name; this.player = player; - this.items = new PlotItemStack[size * 9]; + this.items = new PlotItemStack[lines * 9]; this.inventoryUtil = inventoryUtil; } @@ -144,7 +144,7 @@ public class PlotInventory { return player; } - public int getSize() { - return size; + public int getLines() { + return lines; } }