use of com.earth2me.essentials.api.IItemDb in project MagicPlugin by elBukkit.
the class MagicItemDb method register.
public static boolean register(final MagicController controller, final Plugin essentialsPlugin) throws Exception {
IEssentials essentials = (IEssentials) essentialsPlugin;
IItemDb itemDb = essentials.getItemDb();
if (itemDb instanceof AbstractItemDb) {
((AbstractItemDb) itemDb).registerResolver(controller.getPlugin(), "Magic", new MagicItemDb(controller));
} else {
return false;
}
return true;
}
use of com.earth2me.essentials.api.IItemDb in project Essentials by drtshock.
the class Settings method _getItemSpawnBlacklist.
private List<Material> _getItemSpawnBlacklist() {
final List<Material> epItemSpwn = new ArrayList<>();
// noinspection deprecation
final IItemDb itemDb = ess.getItemDb();
if (itemDb == null || !itemDb.isReady()) {
logger.log(Level.FINE, "Skipping item spawn blacklist read; item DB not yet loaded.");
return epItemSpwn;
}
for (String itemName : config.getString("item-spawn-blacklist", "").split(",")) {
itemName = itemName.trim();
if (itemName.isEmpty()) {
continue;
}
try {
final ItemStack iStack = itemDb.get(itemName);
epItemSpwn.add(iStack.getType());
} catch (final Exception ex) {
logger.log(Level.SEVERE, tl("unknownItemInList", itemName, "item-spawn-blacklist"), ex);
}
}
return epItemSpwn;
}
use of com.earth2me.essentials.api.IItemDb in project Essentials by EssentialsX.
the class Settings method _getItemSpawnBlacklist.
private List<Material> _getItemSpawnBlacklist() {
final List<Material> epItemSpwn = new ArrayList<>();
// noinspection deprecation
final IItemDb itemDb = ess.getItemDb();
if (itemDb == null || !itemDb.isReady()) {
logger.log(Level.FINE, "Skipping item spawn blacklist read; item DB not yet loaded.");
return epItemSpwn;
}
for (String itemName : config.getString("item-spawn-blacklist", "").split(",")) {
itemName = itemName.trim();
if (itemName.isEmpty()) {
continue;
}
try {
final ItemStack iStack = itemDb.get(itemName);
epItemSpwn.add(iStack.getType());
} catch (final Exception ex) {
logger.log(Level.SEVERE, tl("unknownItemInList", itemName, "item-spawn-blacklist"), ex);
}
}
return epItemSpwn;
}
Aggregations