boolean found = false;
for (MinecartMember<?> cart : carts) {
if (!(cart instanceof MinecartMemberFurnace)) {
continue;
}
MinecartMemberFurnace member = (MinecartMemberFurnace) cart;
if (!member.getEntity().hasFuel()) {
found = false;
for (Chest chest : chests) {
Inventory inv = chest.getInventory();
for (i = 0; i < inv.getSize(); i++) {
org.bukkit.inventory.ItemStack item = inv.getItem(i);
if (!LogicUtil.nullOrEmpty(item) && item.getType() == Material.COAL) {
ItemUtil.subtractAmount(item, 1);
inv.setItem(i, item);
found = true;
member.addFuelTicks(3600);
if (TrainCarts.showTransferAnimations) {
ItemAnimation.start(chest, member, new ItemStack(Material.COAL, 1));
}
break;
}