Allow item/item trades still.

This commit is contained in:
KHobbits 2013-03-08 12:34:11 +00:00
parent 6436baf7a4
commit 6d552281d4
2 changed files with 4 additions and 10 deletions

View File

@ -164,7 +164,6 @@ public class MetaItemStack
{
List<String> pages = pager.getPages(split[1]);
meta.setPages(pages);
stack.setItemMeta(meta);
}
else
@ -397,8 +396,6 @@ public class MetaItemStack
stack.setItemMeta(pmeta);
resetPotionMeta();
}
}
}
@ -479,6 +476,7 @@ public class MetaItemStack
{
return null;
}
final String enchantmentName = enchantment.getName().toLowerCase(Locale.ENGLISH);
if (user != null && !user.isAuthorized("essentials.enchant." + enchantmentName))
{
@ -490,12 +488,7 @@ public class MetaItemStack
private boolean hasMetaPermission(final CommandSender sender, final String metaPerm, final boolean graceful, final IEssentials ess) throws Exception
{
final User user = ess.getUser(sender);
if (user == null)
{
return true;
}
if (user.isAuthorized("essentials.itemspawn.meta-" + metaPerm))
if (user == null || user.isAuthorized("essentials.itemspawn.meta-" + metaPerm))
{
return true;
}

View File

@ -2,6 +2,7 @@ package com.earth2me.essentials.signs;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.*;
import com.earth2me.essentials.Trade.TradeType;
import org.bukkit.inventory.ItemStack;
//TODO: TL exceptions
@ -20,7 +21,7 @@ public class SignTrade extends EssentialsSign
validateTrade(sign, 2, true, ess);
final Trade trade = getTrade(sign, 2, true, true, ess);
final Trade charge = getTrade(sign, 1, true, false, ess);
if (trade.getType() == charge.getType()) {
if (trade.getType() == charge.getType() && (trade.getType() != TradeType.ITEM || trade.getItemStack().getType().equals(charge.getItemStack().getType()))) {
throw new SignException("You cannot trade for the same item type.");
}
trade.isAffordableFor(player);