diff options
| author | Daniel She <shekwancheung0528@gmail.com> | 2019-02-14 14:38:18 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-14 14:38:18 +0100 |
| commit | 93dc019f11596f7a9386a6e3f597667fa1b50eb8 (patch) | |
| tree | 063961a16d01e45461b61e22c9d71659a99bff05 /src/main/java/me/shedaniel/rei/client/RecipeHelper.java | |
| parent | 32cc30ef0d63e64915ef647978b0546a9c0e800a (diff) | |
| download | RoughlyEnoughItems-2.3.0.51.tar.gz RoughlyEnoughItems-2.3.0.51.tar.bz2 RoughlyEnoughItems-2.3.0.51.zip | |
REI Update v2.3 (#35)v2.3.0.51
* Fixes #33
* Fixes #32
* Fix #29
* Highlight Cursor
* Fix #15
* Remove Unwanted Imports
* Making it actually v2.3
* LOLCATS & Upside Down Lanuage + Credits Screen
* better credits
* Better Config
* Better Config Button Handling + Campfire text using container sub-colour
* Better Plugin Handling
* Split ItemRegisterer out from ClientHelper
* Option to disable default plugin.
Diffstat (limited to 'src/main/java/me/shedaniel/rei/client/RecipeHelper.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/client/RecipeHelper.java | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/main/java/me/shedaniel/rei/client/RecipeHelper.java b/src/main/java/me/shedaniel/rei/client/RecipeHelper.java index 80d76c5f1..96490c6dd 100644 --- a/src/main/java/me/shedaniel/rei/client/RecipeHelper.java +++ b/src/main/java/me/shedaniel/rei/client/RecipeHelper.java @@ -59,7 +59,7 @@ public class RecipeHelper { recipeCategoryListMap.put(category.getIdentifier(), Lists.newLinkedList()); } - public void registerRecipe(Identifier categoryIdentifier, IRecipeDisplay display) { + public void registerDisplay(Identifier categoryIdentifier, IRecipeDisplay display) { if (!recipeCategoryListMap.containsKey(categoryIdentifier)) return; recipeCategoryListMap.get(categoryIdentifier).add(display); @@ -147,6 +147,7 @@ public class RecipeHelper { speedCraftFunctionalMap.put(category, list); } + @SuppressWarnings("deprecation") public void recipesLoaded(RecipeManager recipeManager) { this.recipeManager = recipeManager; this.recipeCategoryListMap.clear(); @@ -162,10 +163,20 @@ public class RecipeHelper { return identifier == null ? "NULL" : identifier.toString(); }).collect(Collectors.toList()))); Collections.reverse(plugins); + RoughlyEnoughItemsCore.getItemRegisterer().getModifiableItemList().clear(); + IPluginDisabler pluginDisabler = RoughlyEnoughItemsCore.getPluginDisabler(); plugins.forEach(plugin -> { - plugin.registerPluginCategories(); - plugin.registerRecipes(); - plugin.registerSpeedCraft(); + Identifier identifier = RoughlyEnoughItemsCore.getPluginIdentifier(plugin); + if (identifier == null) + identifier = new Identifier("null"); + if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_ITEMS)) + plugin.registerItems(RoughlyEnoughItemsCore.getItemRegisterer()); + if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_CATEGORIES)) + plugin.registerPluginCategories(this); + if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_RECIPE_DISPLAYS)) + plugin.registerRecipeDisplays(this); + if (pluginDisabler.isFunctionEnabled(identifier, PluginFunction.REGISTER_SPEED_CRAFT)) + plugin.registerSpeedCraft(this); }); RoughlyEnoughItemsCore.LOGGER.info("Registered REI Categories: " + String.join(", ", categories.stream().map(category -> { return category.getCategoryName(); |
