mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-27 19:47:42 +01:00
Merge branch 'master' of github.com:khobbits/Essentials
This commit is contained in:
commit
6f88e7bb98
@ -10,6 +10,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class SignTrade extends EssentialsSign
|
||||
{
|
||||
|
||||
public SignTrade()
|
||||
{
|
||||
super("Trade");
|
||||
@ -32,12 +33,19 @@ public class SignTrade extends EssentialsSign
|
||||
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
|
||||
{
|
||||
if (sign.getLine(3).substring(2).equalsIgnoreCase(username))
|
||||
{
|
||||
try
|
||||
{
|
||||
final Trade stored = getTrade(sign, 1, true, true, ess);
|
||||
substractAmount(sign, 1, stored, ess);
|
||||
stored.pay(player);
|
||||
Trade.log("Sign", "Trade", "OwnerInteract", username, null, username, stored, sign.getBlock().getLocation(), ess);
|
||||
}
|
||||
catch (SignException e)
|
||||
{
|
||||
throw new SignException(Util.i18n("tradeSignEmptyOwner"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
final Trade charge = getTrade(sign, 1, false, false, ess);
|
||||
@ -154,6 +162,8 @@ public class SignTrade extends EssentialsSign
|
||||
final String[] split = line.split("[ :]+");
|
||||
|
||||
if (split.length == 2)
|
||||
{
|
||||
try
|
||||
{
|
||||
final Double money = getMoney(split[0]);
|
||||
final Double amount = notEmpty ? getDoublePositive(split[1]) : getDouble(split[1]);
|
||||
@ -162,6 +172,11 @@ public class SignTrade extends EssentialsSign
|
||||
return new Trade(fullAmount ? amount : money, ess);
|
||||
}
|
||||
}
|
||||
catch (SignException e)
|
||||
{
|
||||
throw new SignException(Util.i18n("tradeSignEmpty"));
|
||||
}
|
||||
}
|
||||
|
||||
if (split.length == 3)
|
||||
{
|
||||
@ -171,7 +186,7 @@ public class SignTrade extends EssentialsSign
|
||||
amount -= amount % stackamount;
|
||||
if (notEmpty && (amount < 1 || stackamount < 1 || item.getTypeId() == 0))
|
||||
{
|
||||
throw new SignException(Util.i18n("moreThanZero"));
|
||||
throw new SignException(Util.i18n("tradeSignEmpty"));
|
||||
}
|
||||
item.setAmount(fullAmount ? amount : stackamount);
|
||||
return new Trade(item, ess);
|
||||
|
@ -296,7 +296,8 @@ timeSetPermission = \u00a7cYou are not authorized to set the time.
|
||||
timeWorldCurrent = The current time in {0} is \u00a73{1}
|
||||
timeWorldSet = The time was set to {0} in: \u00a7c{1}
|
||||
tradeCompleted = \u00a77Trade completed.
|
||||
tradeSignEmpty = The trade sign does not have enough supply left.
|
||||
tradeSignEmpty = The trade sign has nothing available for you.
|
||||
tradeSignEmptyOwner = There is nothing to collect from this trade sign.
|
||||
treeFailure = \u00a7cTree generation failure. Try again on grass or dirt.
|
||||
treeSpawned = \u00a77Tree spawned.
|
||||
typeTpaccept = \u00a77To teleport, type \u00a7c/tpaccept\u00a77.
|
||||
|
@ -297,6 +297,7 @@ timeWorldCurrent = The current time in {0} is \u00a73{1}
|
||||
timeWorldSet = The time was set to {0} in: \u00a7c{1}
|
||||
tradeCompleted = \u00a77Forhandling fuldf\u00f8rt.
|
||||
tradeSignEmpty = Forhandlings skiltet har ikke nok forsyning tilbage.
|
||||
tradeSignEmptyOwner = There is nothing to collect from this trade sign.
|
||||
treeFailure = \u00a7cTr\u00e6 genererings fejl. Pr\u00f8v igen p\u00e5 gr\u00e6s eller jord.
|
||||
treeSpawned = \u00a77Tr\u00e6 fremkaldt.
|
||||
typeTpaccept = \u00a77For at teleportere, skriv \u00a7c/tpaccept\u00a77.
|
||||
|
@ -297,6 +297,7 @@ timeWorldCurrent = The current time in {0} is \u00a73{1}
|
||||
timeWorldSet = The time was set to {0} in: \u00a7c{1}
|
||||
tradeCompleted = \u00a77Handel abgeschlossen.
|
||||
tradeSignEmpty = Der Bestand des Trade-Schild ist aufgebraucht.
|
||||
tradeSignEmptyOwner = There is nothing to collect from this trade sign.
|
||||
treeFailure = \u00a7cBaumpflanzung gescheitert. Versuche es auf Gras oder Dreck.
|
||||
treeSpawned = \u00a77Baum gepflanzt.
|
||||
typeTpaccept = \u00a77Um zu teleportieren, schreibe \u00a7c/tpaccept\u00a77.
|
||||
|
@ -297,6 +297,7 @@ timeWorldCurrent = The current time in {0} is \u00a73{1}
|
||||
timeWorldSet = The time was set to {0} in: \u00a7c{1}
|
||||
tradeCompleted = \u00a77Trade completed.
|
||||
tradeSignEmpty = The trade sign does not have enough supply left.
|
||||
tradeSignEmptyOwner = There is nothing to collect from this trade sign.
|
||||
treeFailure = \u00a7cTree generation failure. Try again on grass or dirt.
|
||||
treeSpawned = \u00a77Tree spawned.
|
||||
typeTpaccept = \u00a77To teleport, type \u00a7c/tpaccept\u00a77.
|
||||
|
@ -297,6 +297,7 @@ timeWorldCurrent = The current time in {0} is \u00a73{1}
|
||||
timeWorldSet = The time was set to {0} in: \u00a7c{1}
|
||||
tradeCompleted = \u00a77\u00c9change termin\u00e9.
|
||||
tradeSignEmpty = Le panneau de vente n''as pas encore assez de stock.
|
||||
tradeSignEmptyOwner = There is nothing to collect from this trade sign.
|
||||
treeFailure = \u00a7cEchec de la g\u00e9n\u00e9ration de l''arbre. Essayez de nouveau sur de l''herbe ou de la terre.
|
||||
treeSpawned = \u00a77Arbre cr\u00e9\u00e9.
|
||||
typeTpaccept = \u00a77Pour le t\u00e9l\u00e9porter, tapez \u00a7c/tpaccept\u00a77.
|
||||
|
@ -297,6 +297,7 @@ timeWorldCurrent = The current time in {0} is \u00a73{1}
|
||||
timeWorldSet = The time was set to {0} in: \u00a7c{1}
|
||||
tradeCompleted = \u00a77Ruil verricht.
|
||||
tradeSignEmpty = Het handelsbordje heeft een te kleine voorraad.
|
||||
tradeSignEmptyOwner = There is nothing to collect from this trade sign.
|
||||
treeFailure = \u00a7cFout bij het genereren van boom. Pobeer het opnieuw op gras of dirt.
|
||||
treeSpawned = \u00a77Boom gespawned.
|
||||
typeTpaccept = \u00a77Om te teleporten, type \u00a7c/tpaccept\u00a77.
|
||||
|
Loading…
Reference in New Issue
Block a user