Fix message amount display error when buying from admin shops

Also fix that the stock items were modified when buying from the admin shop
This commit is contained in:
Phoenix616 2019-04-07 13:48:16 +01:00
parent 53ae07b779
commit 28fb5cbeff

View File

@ -32,6 +32,7 @@ import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import java.util.Arrays;
import java.util.logging.Level;
import static com.Acrobot.Breeze.Utils.BlockUtil.isSign;
@ -203,7 +204,7 @@ public class PlayerInteract implements Listener {
ItemStack[] items = InventoryUtil.getItemsStacked(item);
if (adminShop) {
ownerInventory = new AdminInventory(items);
ownerInventory = new AdminInventory(action == buy ? Arrays.stream(items).map(ItemStack::clone).toArray(ItemStack[]::new) : new ItemStack[0]);
}
TransactionType transactionType = (action == buy ? BUY : SELL);