1
0
mirror of https://e.coding.net/circlecloud/QuickShop.git synced 2024-11-22 01:58:54 +00:00

修复扫地大妈返回null时的报错...

Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
502647092 2016-01-12 13:22:13 +08:00
parent 79ea58412a
commit ceeeb5802c

View File

@ -12,21 +12,27 @@ import org.maxgamer.QuickShop.Util.MarkUtil;
import io.github.Cnly.WowSuchCleaner.WowSuchCleaner.ItemPreCleanEvent;
public class WowSuchCleanerListener implements Listener {
@EventHandler
public void onWSCClear(final ItemPreCleanEvent e) {
final List<Item> clearList = new ArrayList<Item>();
final List<ItemStack> aucList = new ArrayList<ItemStack>();
for (final Item item : e.getItemsToClean()) {
if (MarkUtil.hasMark(item.getItemStack())) {
clearList.add(item);
}
}
for (final ItemStack itemStack : e.getItemsToAuction()) {
if (MarkUtil.hasMark(itemStack)) {
aucList.add(itemStack);
}
}
e.getItemsToClean().removeAll(clearList);
e.getItemsToAuction().removeAll(aucList);
}
@EventHandler
public void onWSCClear(final ItemPreCleanEvent e) {
final List<Item> clearList = new ArrayList<Item>();
final List<ItemStack> aucList = new ArrayList<ItemStack>();
final List<Item> cleanList = e.getItemsToClean();
final List<ItemStack> acList = e.getItemsToAuction();
if (cleanList != null) {
for (final Item item : cleanList) {
if (MarkUtil.hasMark(item.getItemStack())) {
clearList.add(item);
}
}
e.getItemsToClean().removeAll(clearList);
}
if (acList != null) {
for (final ItemStack itemStack : acList) {
if (MarkUtil.hasMark(itemStack)) {
aucList.add(itemStack);
}
}
e.getItemsToAuction().removeAll(aucList);
}
}
}