summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandcondense.java52
-rw-r--r--Essentials/src/messages.properties2
-rw-r--r--Essentials/src/messages_cs.properties2
-rw-r--r--Essentials/src/messages_da.properties2
-rw-r--r--Essentials/src/messages_de.properties2
-rw-r--r--Essentials/src/messages_en.properties2
-rw-r--r--Essentials/src/messages_es.properties2
-rw-r--r--Essentials/src/messages_et.properties2
-rw-r--r--Essentials/src/messages_fi.properties2
-rw-r--r--Essentials/src/messages_fr.properties2
-rw-r--r--Essentials/src/messages_hu.properties2
-rw-r--r--Essentials/src/messages_it.properties2
-rw-r--r--Essentials/src/messages_ko.properties2
-rw-r--r--Essentials/src/messages_lt.properties2
-rw-r--r--Essentials/src/messages_nl.properties2
-rw-r--r--Essentials/src/messages_pl.properties2
-rw-r--r--Essentials/src/messages_pt.properties2
-rw-r--r--Essentials/src/messages_ro.properties2
-rw-r--r--Essentials/src/messages_ru.properties2
-rw-r--r--Essentials/src/messages_sv.properties2
-rw-r--r--Essentials/src/messages_tr.properties2
-rw-r--r--Essentials/src/messages_zh.properties2
-rw-r--r--Essentials/src/messages_zh_HK.properties2
-rw-r--r--Essentials/src/messages_zh_TW.properties2
24 files changed, 77 insertions, 21 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandcondense.java b/Essentials/src/com/earth2me/essentials/commands/Commandcondense.java
index 46c9e5e33..fd0408890 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandcondense.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandcondense.java
@@ -1,23 +1,19 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.ChargeException;
-import com.earth2me.essentials.Trade;
-import com.earth2me.essentials.Trade.OverflowType;
-import com.earth2me.essentials.User;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import net.ess3.api.MaxMoneyException;
-import org.bukkit.Bukkit;
+import static com.earth2me.essentials.I18n.tl;
+import java.util.*;
import org.bukkit.Material;
import org.bukkit.Server;
+import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.Recipe;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.ShapelessRecipe;
+import com.earth2me.essentials.ChargeException;
+import com.earth2me.essentials.Trade;
+import com.earth2me.essentials.Trade.OverflowType;
+import com.earth2me.essentials.User;
+import net.ess3.api.MaxMoneyException;
public class Commandcondense extends EssentialsCommand
@@ -32,12 +28,11 @@ public class Commandcondense extends EssentialsCommand
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
List<ItemStack> is = new ArrayList<ItemStack>();
- boolean validateReverse;
+ boolean validateReverse = false;
if (args.length > 0)
{
is = ess.getItemDb().getMatching(user, args);
- validateReverse = false;
}
else
{
@@ -52,14 +47,28 @@ public class Commandcondense extends EssentialsCommand
validateReverse = true;
}
+ boolean didConvert = false;
for (final ItemStack itemStack : is)
{
- condenseStack(user, itemStack, validateReverse);
+ if (condenseStack(user, itemStack, validateReverse))
+ {
+ didConvert = true;
+ }
}
user.getBase().updateInventory();
+
+ if (didConvert)
+ {
+ user.sendMessage(tl("itemsConverted"));
+ }
+ else
+ {
+ user.sendMessage(tl("itemsNotConverted"));
+ throw new NoChargeException();
+ }
}
- private void condenseStack(final User user, final ItemStack stack, final boolean validateReverse) throws ChargeException, MaxMoneyException
+ private boolean condenseStack(final User user, final ItemStack stack, final boolean validateReverse) throws ChargeException, MaxMoneyException
{
final SimpleRecipe condenseType = getCondenseType(stack);
if (condenseType != null)
@@ -72,7 +81,6 @@ public class Commandcondense extends EssentialsCommand
boolean pass = false;
for (Recipe revRecipe : ess.getServer().getRecipesFor(input))
{
-
if (getStackOnRecipeMatch(revRecipe, result) != null)
{
pass = true;
@@ -81,7 +89,7 @@ public class Commandcondense extends EssentialsCommand
}
if (!pass)
{
- return;
+ return false;
}
}
@@ -106,8 +114,10 @@ public class Commandcondense extends EssentialsCommand
final Trade add = new Trade(result, ess);
remove.charge(user);
add.pay(user, OverflowType.DROP);
+ return true;
}
}
+ return false;
}
private SimpleRecipe getCondenseType(final ItemStack stack)
@@ -186,12 +196,12 @@ public class Commandcondense extends EssentialsCommand
}
- class SimpleRecipe implements Recipe
+ private class SimpleRecipe implements Recipe
{
private ItemStack result;
private ItemStack input;
- SimpleRecipe(ItemStack result, ItemStack input)
+ private SimpleRecipe(ItemStack result, ItemStack input)
{
this.result = result;
this.input = input;
@@ -208,4 +218,4 @@ public class Commandcondense extends EssentialsCommand
return input.clone();
}
}
-} \ No newline at end of file
+}
diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties
index df414ce15..74f51eb40 100644
--- a/Essentials/src/messages.properties
+++ b/Essentials/src/messages.properties
@@ -549,3 +549,5 @@ mailDelay=Too many mails have been sent within the last minute. Maximum\: {0}
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.
diff --git a/Essentials/src/messages_cs.properties b/Essentials/src/messages_cs.properties
index 534ec2be0..9fd74f853 100644
--- a/Essentials/src/messages_cs.properties
+++ b/Essentials/src/messages_cs.properties
@@ -549,3 +549,5 @@ mailDelay=Bylo odeslano prilis mnoho mailu. Pockej minutu. Maximum\: {0}
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.
diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties
index fd3672d6b..ab1124973 100644
--- a/Essentials/src/messages_da.properties
+++ b/Essentials/src/messages_da.properties
@@ -549,3 +549,5 @@ mailDelay=Too many mails have been sent within the last minute. Maximum\: {0}
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.
diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties
index 1b66f8e40..83debd182 100644
--- a/Essentials/src/messages_de.properties
+++ b/Essentials/src/messages_de.properties
@@ -549,3 +549,5 @@ mailDelay=In der letzten Minute wurden zu viele Mails gesendet. Maximum\: {0}
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.
diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties
index df414ce15..74f51eb40 100644
--- a/Essentials/src/messages_en.properties
+++ b/Essentials/src/messages_en.properties
@@ -549,3 +549,5 @@ mailDelay=Too many mails have been sent within the last minute. Maximum\: {0}
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.
diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties
index a74b1d929..c7e1fea53 100644
--- a/Essentials/src/messages_es.properties
+++ b/Essentials/src/messages_es.properties
@@ -549,3 +549,5 @@ mailDelay=Demasiados correos han sido enviados en el \u00faltimo minuto. M\u00e1
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.
diff --git a/Essentials/src/messages_et.properties b/Essentials/src/messages_et.properties
index 47e970d23..c66777174 100644
--- a/Essentials/src/messages_et.properties
+++ b/Essentials/src/messages_et.properties
@@ -549,3 +549,5 @@ mailDelay=Saatsid liiga palju kirju viimase minuti jooskul. Maksimaalne kirjade
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.
diff --git a/Essentials/src/messages_fi.properties b/Essentials/src/messages_fi.properties
index 977050ec2..9340e0616 100644
--- a/Essentials/src/messages_fi.properties
+++ b/Essentials/src/messages_fi.properties
@@ -549,3 +549,5 @@ mailDelay=Too many mails have been sent within the last minute. Maximum\: {0}
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.
diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties
index 1f48c2abb..898736402 100644
--- a/Essentials/src/messages_fr.properties
+++ b/Essentials/src/messages_fr.properties
@@ -549,3 +549,5 @@ mailDelay=Trop de mails ont \u00e9t\u00e9 envoy\u00e9s durant la derni\u00e8re m
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.
diff --git a/Essentials/src/messages_hu.properties b/Essentials/src/messages_hu.properties
index 6c80c5f5e..f8c834175 100644
--- a/Essentials/src/messages_hu.properties
+++ b/Essentials/src/messages_hu.properties
@@ -549,3 +549,5 @@ mailDelay=T\u00fal sok lev\u00e9l lett elk\u00fcldve az utols\u00f3 percben. Max
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.
diff --git a/Essentials/src/messages_it.properties b/Essentials/src/messages_it.properties
index e82adc70f..93bf04fbc 100644
--- a/Essentials/src/messages_it.properties
+++ b/Essentials/src/messages_it.properties
@@ -549,3 +549,5 @@ mailDelay=Hai mandato troppe mail nell''ultimo minuto. Massimo\: {0}
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.
diff --git a/Essentials/src/messages_ko.properties b/Essentials/src/messages_ko.properties
index db6a98815..1b4a8546e 100644
--- a/Essentials/src/messages_ko.properties
+++ b/Essentials/src/messages_ko.properties
@@ -549,3 +549,5 @@ mailDelay=\ub108\ubb34 \ub9ce\uc740 \uc591\uc758 \uc774\uba54\uc77c\uc744 \ubcf4
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.
diff --git a/Essentials/src/messages_lt.properties b/Essentials/src/messages_lt.properties
index 77d97ad70..8e5736dcd 100644
--- a/Essentials/src/messages_lt.properties
+++ b/Essentials/src/messages_lt.properties
@@ -549,3 +549,5 @@ mailDelay=Per daug lai\u0161k\u0173 buvo i\u0161si\u0173stos per paskutin\u0119
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.
diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties
index 3b19daf22..078ddd139 100644
--- a/Essentials/src/messages_nl.properties
+++ b/Essentials/src/messages_nl.properties
@@ -549,3 +549,5 @@ mailDelay=Er zijn teveel mails verzonden in een minuut. Het maximale aantal beri
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.
diff --git a/Essentials/src/messages_pl.properties b/Essentials/src/messages_pl.properties
index 1336c09df..396be310b 100644
--- a/Essentials/src/messages_pl.properties
+++ b/Essentials/src/messages_pl.properties
@@ -549,3 +549,5 @@ mailDelay=\u00a74Za duzo wyslanych wiadomosci. Maksimum\: {0}
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.
diff --git a/Essentials/src/messages_pt.properties b/Essentials/src/messages_pt.properties
index 4585c77b2..1ededc935 100644
--- a/Essentials/src/messages_pt.properties
+++ b/Essentials/src/messages_pt.properties
@@ -549,3 +549,5 @@ mailDelay=Muitos e-mails foram enviados no \u00faltimo minuto. M\u00e1ximo\: {0}
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.
diff --git a/Essentials/src/messages_ro.properties b/Essentials/src/messages_ro.properties
index d3246037e..5f43b85bc 100644
--- a/Essentials/src/messages_ro.properties
+++ b/Essentials/src/messages_ro.properties
@@ -549,3 +549,5 @@ mailDelay=Prea multe mail-uri au fost trimise in ultimul minute.Maxim \: {0}
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.
diff --git a/Essentials/src/messages_ru.properties b/Essentials/src/messages_ru.properties
index 0abf86192..12f457a52 100644
--- a/Essentials/src/messages_ru.properties
+++ b/Essentials/src/messages_ru.properties
@@ -549,3 +549,5 @@ mailDelay=\u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u0
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.
diff --git a/Essentials/src/messages_sv.properties b/Essentials/src/messages_sv.properties
index 5ba6c8f64..9b5ffef96 100644
--- a/Essentials/src/messages_sv.properties
+++ b/Essentials/src/messages_sv.properties
@@ -549,3 +549,5 @@ mailDelay=F\u00f6r m\u00e5nga mails har skickats sen senaste minuten. Max\: {0}
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.
diff --git a/Essentials/src/messages_tr.properties b/Essentials/src/messages_tr.properties
index 1847464b1..04965cf56 100644
--- a/Essentials/src/messages_tr.properties
+++ b/Essentials/src/messages_tr.properties
@@ -549,3 +549,5 @@ mailDelay=Cok fazla posta gonderildi. Sinir\: {0}
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.
diff --git a/Essentials/src/messages_zh.properties b/Essentials/src/messages_zh.properties
index 6aabdb0af..7ba3d9a29 100644
--- a/Essentials/src/messages_zh.properties
+++ b/Essentials/src/messages_zh.properties
@@ -549,3 +549,5 @@ mailDelay=Too many mails have been sent within the last minute. Maximum\: {0}
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.
diff --git a/Essentials/src/messages_zh_HK.properties b/Essentials/src/messages_zh_HK.properties
index 6406bcbce..7e1db0418 100644
--- a/Essentials/src/messages_zh_HK.properties
+++ b/Essentials/src/messages_zh_HK.properties
@@ -549,3 +549,5 @@ mailDelay=Too many mails have been sent within the last minute. Maximum\: {0}
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.
diff --git a/Essentials/src/messages_zh_TW.properties b/Essentials/src/messages_zh_TW.properties
index 2093afe16..165d94f97 100644
--- a/Essentials/src/messages_zh_TW.properties
+++ b/Essentials/src/messages_zh_TW.properties
@@ -549,3 +549,5 @@ mailDelay=\u5728\u6700\u5f8c\u4e00\u5206\u9418\u5167\u767c\u9001\u592a\u591a\u90
seenAccounts=\u00a76Player has also been known as\:\u00a7c {0}
unableToSpawnItem=\u00a74Cannot spawn \u00a7c{0}\u00a74, this is not a spawnable item.
+itemsConverted=\u00a76Converted all items into blocks.
+itemsNotConverted=\u00a74You have no items that can be converted into blocks.