mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-03 04:21:37 +00:00
Cleanup various aspects of code, fix some formatting, more netbeans 7.4 stuff
This commit is contained in:
parent
d5196e31b2
commit
3e725ef060
65 changed files with 432 additions and 443 deletions
|
@ -13,12 +13,6 @@ import org.bukkit.inventory.ItemStack;
|
|||
public class ItemDb implements IConf, net.ess3.api.IItemDb
|
||||
{
|
||||
private final transient IEssentials ess;
|
||||
|
||||
public ItemDb(final IEssentials ess)
|
||||
{
|
||||
this.ess = ess;
|
||||
file = new ManagedFile("items.csv", ess);
|
||||
}
|
||||
private final transient Map<String, Integer> items = new HashMap<String, Integer>();
|
||||
private final transient Map<ItemData, List<String>> names = new HashMap<ItemData, List<String>>();
|
||||
private final transient Map<ItemData, String> primaryName = new HashMap<ItemData, String>();
|
||||
|
@ -26,6 +20,12 @@ public class ItemDb implements IConf, net.ess3.api.IItemDb
|
|||
private final transient ManagedFile file;
|
||||
private final transient Pattern splitPattern = Pattern.compile("[:+',;.]");
|
||||
|
||||
public ItemDb(final IEssentials ess)
|
||||
{
|
||||
this.ess = ess;
|
||||
file = new ManagedFile("items.csv", ess);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reloadConfig()
|
||||
{
|
||||
|
@ -70,7 +70,7 @@ public class ItemDb implements IConf, net.ess3.api.IItemDb
|
|||
Collections.sort(nameList, new LengthCompare());
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
List<String> nameList = new ArrayList<String>();
|
||||
nameList.add(itemName);
|
||||
names.put(itemData, nameList);
|
||||
|
@ -184,16 +184,16 @@ public class ItemDb implements IConf, net.ess3.api.IItemDb
|
|||
{
|
||||
is.add(get(args[0]));
|
||||
}
|
||||
|
||||
|
||||
if (is.isEmpty() || is.get(0).getType() == Material.AIR)
|
||||
{
|
||||
throw new Exception(_("itemSellAir"));
|
||||
}
|
||||
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public String names(ItemStack item)
|
||||
{
|
||||
ItemData itemData = new ItemData(item.getTypeId(), item.getDurability());
|
||||
|
@ -214,7 +214,7 @@ public class ItemDb implements IConf, net.ess3.api.IItemDb
|
|||
}
|
||||
return StringUtil.joinList(", ", nameList);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String name(ItemStack item)
|
||||
{
|
||||
|
@ -231,7 +231,7 @@ public class ItemDb implements IConf, net.ess3.api.IItemDb
|
|||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
static class ItemData
|
||||
{
|
||||
final private int itemNo;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue