Added back ItemManager for compatibility purposes

This commit is contained in:
Indyuce 2020-08-10 21:42:33 +02:00
parent d53e28e7f7
commit 0c406f1277
2 changed files with 51 additions and 0 deletions

View File

@ -71,6 +71,7 @@ import net.Indyuce.mmoitems.manager.ConfigManager;
import net.Indyuce.mmoitems.manager.CraftingManager;
import net.Indyuce.mmoitems.manager.DropTableManager;
import net.Indyuce.mmoitems.manager.EntityManager;
import net.Indyuce.mmoitems.manager.ItemManager;
import net.Indyuce.mmoitems.manager.PluginUpdateManager;
import net.Indyuce.mmoitems.manager.RecipeManager;
import net.Indyuce.mmoitems.manager.SetManager;
@ -93,6 +94,7 @@ public class MMOItems extends JavaPlugin {
private final EntityManager entityManager = new EntityManager();
private final TypeManager typeManager = new TypeManager();
private final TemplateManager templateManager = new TemplateManager();
private final ItemManager itemManager = new ItemManager();
private DropTableManager dropTableManager;
private WorldGenManager worldGenManager;
@ -410,6 +412,11 @@ public class MMOItems extends JavaPlugin {
return templateManager;
}
@Deprecated
public ItemManager getItems() {
return itemManager;
}
public List<StringInputParser> getStringInputParsers() {
return stringInputParsers;
}

View File

@ -0,0 +1,44 @@
package net.Indyuce.mmoitems.manager;
import org.bukkit.inventory.ItemStack;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.Type;
import net.Indyuce.mmoitems.api.item.mmoitem.MMOItem;
/**
* ItemStack and MMOItem getters were moved over to MMOItems. There is no longer
* any item manager because the normal items are now all item templates. All
* register methods are now in the TemplateManager.
*
* @author cympe
*
*/
public class ItemManager {
/**
* @param type
* The item type
* @param id
* The item id
* @return The corresponding MMOItem
* @deprecated Use MMOItems.plugin.getMMOItem(Type, String) instead
*/
@Deprecated
public MMOItem getMMOItem(Type type, String id) {
return MMOItems.plugin.getMMOItem(type, id);
}
/**
* @param type
* The item type
* @param id
* The item id
* @return Generates an ItemStack using an MMOItem
* @deprecated Use MMOItems.plugin.getItem(Type, String) instead
*/
@Deprecated
public ItemStack getItem(Type type, String id) {
return MMOItems.plugin.getItem(type, id);
}
}