mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-02-02 11:21:20 +01:00
Fixed a 1.12 bug with the recipe manager
This commit is contained in:
parent
f576f7b2dd
commit
9027120973
@ -59,6 +59,7 @@ 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.RecipeManagerLegacy;
|
||||
import net.Indyuce.mmoitems.manager.SetManager;
|
||||
import net.Indyuce.mmoitems.manager.StatManager;
|
||||
import net.Indyuce.mmoitems.manager.TierManager;
|
||||
@ -233,7 +234,8 @@ public class MMOItems extends JavaPlugin {
|
||||
|
||||
// advanced recipes
|
||||
getLogger().log(Level.INFO, "Loading recipes, please wait...");
|
||||
recipeManager = new RecipeManager();
|
||||
recipeManager = MMOLib.plugin.getVersion().isStrictlyHigher(1, 12) ?
|
||||
new RecipeManager() : new RecipeManagerLegacy();
|
||||
|
||||
// commands
|
||||
getCommand("mmoitems").setExecutor(new MMOItemsCommand());
|
||||
|
@ -3,6 +3,7 @@ package net.Indyuce.mmoitems.manager;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
@ -30,7 +31,10 @@ public class RecipeManagerLegacy extends RecipeManager {
|
||||
private List<Recipe> loadedRecipes = new ArrayList<>();
|
||||
private Collection<NamespacedKey> keys = new ArrayList<>();
|
||||
|
||||
public RecipeManagerLegacy() { load(); }
|
||||
public RecipeManagerLegacy() {
|
||||
MMOItems.plugin.getLogger().log(Level.INFO, "1.12 detected! Loading the Legacy recipe manager...");
|
||||
load();
|
||||
}
|
||||
|
||||
private void load() {
|
||||
for (Type type : MMOItems.plugin.getTypes().getAll()) {
|
||||
|
Loading…
Reference in New Issue
Block a user