Removed stream usage from MultiSellChoose clientpacket.
This commit is contained in:
@@ -19,7 +19,6 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.OptionalLong;
|
||||
|
||||
import org.l2jmobius.commons.network.ReadablePacket;
|
||||
import org.l2jmobius.gameserver.data.ItemTable;
|
||||
@@ -561,10 +560,17 @@ public class MultiSellChoose implements ClientPacket
|
||||
// Finally, give the tax to the castle.
|
||||
if ((npc != null) && list.isApplyTaxes())
|
||||
{
|
||||
final OptionalLong taxPaid = entry.getIngredients().stream().filter(i -> i.getId() == Inventory.ADENA_ID).mapToLong(i -> Math.round(i.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount).reduce(Math::multiplyExact);
|
||||
if (taxPaid.isPresent())
|
||||
long taxPaid = 0;
|
||||
for (ItemChanceHolder ingredient : entry.getIngredients())
|
||||
{
|
||||
npc.handleTaxPayment(taxPaid.getAsLong());
|
||||
if (ingredient.getId() == Inventory.ADENA_ID)
|
||||
{
|
||||
taxPaid += Math.round(ingredient.getCount() * list.getIngredientMultiplier() * list.getTaxRate()) * _amount;
|
||||
}
|
||||
}
|
||||
if (taxPaid > 0)
|
||||
{
|
||||
npc.handleTaxPayment(taxPaid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user