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; import io.github.Cnly.WowSuchCleaner.WowSuchCleaner.ItemPreCleanEvent;
public class WowSuchCleanerListener implements Listener { public class WowSuchCleanerListener implements Listener {
@EventHandler @EventHandler
public void onWSCClear(final ItemPreCleanEvent e) { public void onWSCClear(final ItemPreCleanEvent e) {
final List<Item> clearList = new ArrayList<Item>(); final List<Item> clearList = new ArrayList<Item>();
final List<ItemStack> aucList = new ArrayList<ItemStack>(); final List<ItemStack> aucList = new ArrayList<ItemStack>();
for (final Item item : e.getItemsToClean()) { final List<Item> cleanList = e.getItemsToClean();
if (MarkUtil.hasMark(item.getItemStack())) { final List<ItemStack> acList = e.getItemsToAuction();
clearList.add(item); if (cleanList != null) {
} for (final Item item : cleanList) {
} if (MarkUtil.hasMark(item.getItemStack())) {
for (final ItemStack itemStack : e.getItemsToAuction()) { clearList.add(item);
if (MarkUtil.hasMark(itemStack)) { }
aucList.add(itemStack); }
} e.getItemsToClean().removeAll(clearList);
} }
e.getItemsToClean().removeAll(clearList); if (acList != null) {
e.getItemsToAuction().removeAll(aucList); for (final ItemStack itemStack : acList) {
} if (MarkUtil.hasMark(itemStack)) {
aucList.add(itemStack);
}
}
e.getItemsToAuction().removeAll(aucList);
}
}
} }