1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-16 11:37:30 +02:00

Fix #682 line numbers of trade signs corrected

This commit is contained in:
snowleo
2011-07-15 22:02:43 +02:00
parent 5d479e8fe1
commit 47d4b083c2

View File

@@ -136,7 +136,7 @@ public class SignTrade extends EssentialsSign
sign.setLine(index, stackamount + " " + split[1] + ":" + amount); sign.setLine(index, stackamount + " " + split[1] + ":" + amount);
return; return;
} }
throw new SignException(Util.format("invalidSignLine", index)); throw new SignException(Util.format("invalidSignLine", index+1));
} }
protected final Trade getTrade(final ISign sign, final int index, final boolean fullAmount, final boolean notEmpty, final IEssentials ess) throws SignException protected final Trade getTrade(final ISign sign, final int index, final boolean fullAmount, final boolean notEmpty, final IEssentials ess) throws SignException
@@ -171,7 +171,7 @@ public class SignTrade extends EssentialsSign
item.setAmount(fullAmount ? amount : stackamount); item.setAmount(fullAmount ? amount : stackamount);
return new Trade(item, ess); return new Trade(item, ess);
} }
throw new SignException(Util.format("invalidSignLine", index)); throw new SignException(Util.format("invalidSignLine", index+1));
} }
protected final void substractAmount(final ISign sign, final int index, final Trade trade) throws SignException protected final void substractAmount(final ISign sign, final int index, final Trade trade) throws SignException
@@ -230,6 +230,6 @@ public class SignTrade extends EssentialsSign
sign.setLine(index, stackamount + " " + split[1] + ":" + (amount + Math.round(value))); sign.setLine(index, stackamount + " " + split[1] + ":" + (amount + Math.round(value)));
return; return;
} }
throw new SignException(Util.format("invalidSignLine", index)); throw new SignException(Util.format("invalidSignLine", index+1));
} }
} }