mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2025-01-24 15:51:23 +01:00
Merge items in logger message
This commit is contained in:
parent
d84313716f
commit
a0505e995e
@ -3,12 +3,12 @@ package com.Acrobot.ChestShop.Listeners.PostTransaction;
|
|||||||
import com.Acrobot.Breeze.Utils.LocationUtil;
|
import com.Acrobot.Breeze.Utils.LocationUtil;
|
||||||
import com.Acrobot.ChestShop.ChestShop;
|
import com.Acrobot.ChestShop.ChestShop;
|
||||||
import com.Acrobot.ChestShop.Events.TransactionEvent;
|
import com.Acrobot.ChestShop.Events.TransactionEvent;
|
||||||
import com.Acrobot.ChestShop.UUIDs.NameManager;
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import static com.Acrobot.Breeze.Utils.InventoryUtil.mergeSimilarStacks;
|
||||||
import static com.Acrobot.Breeze.Utils.MaterialUtil.getSignName;
|
import static com.Acrobot.Breeze.Utils.MaterialUtil.getSignName;
|
||||||
import static com.Acrobot.ChestShop.Events.TransactionEvent.TransactionType.BUY;
|
import static com.Acrobot.ChestShop.Events.TransactionEvent.TransactionType.BUY;
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ public class TransactionLogger implements Listener {
|
|||||||
|
|
||||||
StringBuilder items = new StringBuilder(50);
|
StringBuilder items = new StringBuilder(50);
|
||||||
|
|
||||||
for (ItemStack item : event.getStock()) {
|
for (ItemStack item : mergeSimilarStacks(event.getStock())) {
|
||||||
items.append(item.getAmount()).append(' ').append(getSignName(item));
|
items.append(item.getAmount()).append(' ').append(getSignName(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user