mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-02-02 21:41:21 +01:00
Strip out legacy ItemDb code, pt 3
This commit is contained in:
parent
56fb8b06cd
commit
de2298cf0a
@ -365,28 +365,17 @@ public class ItemDb implements IConf, net.ess3.api.IItemDb {
|
||||
|
||||
@Override
|
||||
public Material getFromLegacyId(int id) {
|
||||
ItemData data = this.legacyIds.get(id);
|
||||
if (data == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return data.getMaterial();
|
||||
return provider.getFromLegacyId(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLegacyId(Material material) throws Exception {
|
||||
for(Map.Entry<String, Integer> entry : items.entrySet()) {
|
||||
if(material.name().toLowerCase(Locale.ENGLISH).equalsIgnoreCase(entry.getKey())) {
|
||||
return entry.getValue();
|
||||
}
|
||||
}
|
||||
|
||||
throw new Exception("Itemid not found for material: " + material.name());
|
||||
return provider.getLegacyId(material);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> listNames() {
|
||||
return primaryName.values();
|
||||
return provider.listNames();
|
||||
}
|
||||
|
||||
static class ItemData {
|
||||
|
Loading…
Reference in New Issue
Block a user