1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-17 12:01:20 +02:00

Reduce restrictions on same item trading, so only identical items are blocked.

This commit is contained in:
KHobbits
2013-06-20 21:14:28 +01:00
parent be6e699d86
commit 8bbcf575b7

View File

@@ -32,7 +32,8 @@ public class SignTrade extends EssentialsSign
validateTrade(sign, 2, true, ess); validateTrade(sign, 2, true, ess);
final Trade trade = getTrade(sign, 2, AmountType.ROUNDED, true, ess); final Trade trade = getTrade(sign, 2, AmountType.ROUNDED, true, ess);
final Trade charge = getTrade(sign, 1, AmountType.ROUNDED, false, ess); final Trade charge = getTrade(sign, 1, AmountType.ROUNDED, false, ess);
if (trade.getType() == charge.getType() && (trade.getType() != TradeType.ITEM || trade.getItemStack().getType().equals(charge.getItemStack().getType()))) if (trade.getType() == charge.getType()
&& (trade.getType() != TradeType.ITEM || trade.getItemStack().isSimilar(charge.getItemStack())))
{ {
throw new SignException("You cannot trade for the same item type."); throw new SignException("You cannot trade for the same item type.");
} }