aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-01-30 00:12:47 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-01-30 00:12:47 +0800
commit973868ece23dd75080cfe6ef7b48f8284070ce4e (patch)
tree4eb02c5643701791294dbe85fd704c5505bae272 /src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java
parent39b05dc455edac3e9ce115214d6173e1b3824ff4 (diff)
downloadRoughlyEnoughItems-973868ece23dd75080cfe6ef7b48f8284070ce4e.tar.gz
RoughlyEnoughItems-973868ece23dd75080cfe6ef7b48f8284070ce4e.tar.bz2
RoughlyEnoughItems-973868ece23dd75080cfe6ef7b48f8284070ce4e.zip
Fixes Bugs
Close #13 Close #15 Close #18
Diffstat (limited to 'src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java')
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java47
1 files changed, 24 insertions, 23 deletions
diff --git a/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java b/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java
index 1ac5a609b..eb8d61783 100644
--- a/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java
+++ b/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java
@@ -1,6 +1,7 @@
package me.shedaniel.rei.plugin;
import com.google.common.collect.Lists;
+import me.shedaniel.rei.RoughlyEnoughItemsCore;
import me.shedaniel.rei.api.IRecipePlugin;
import me.shedaniel.rei.api.SpeedCraftFunctional;
import me.shedaniel.rei.client.RecipeHelper;
@@ -42,41 +43,41 @@ public class DefaultPlugin implements IRecipePlugin {
@Override
public void registerPluginCategories() {
- RecipeHelper.registerCategory(new DefaultCraftingCategory());
- RecipeHelper.registerCategory(new DefaultSmeltingCategory());
- RecipeHelper.registerCategory(new DefaultSmokingCategory());
- RecipeHelper.registerCategory(new DefaultBlastingCategory());
- RecipeHelper.registerCategory(new DefaultCampfireCategory());
- RecipeHelper.registerCategory(new DefaultStoneCuttingCategory());
- RecipeHelper.registerCategory(new DefaultBrewingCategory());
+ RoughlyEnoughItemsCore.getRecipeHelper().registerCategory(new DefaultCraftingCategory());
+ RoughlyEnoughItemsCore.getRecipeHelper().registerCategory(new DefaultSmeltingCategory());
+ RoughlyEnoughItemsCore.getRecipeHelper().registerCategory(new DefaultSmokingCategory());
+ RoughlyEnoughItemsCore.getRecipeHelper().registerCategory(new DefaultBlastingCategory());
+ RoughlyEnoughItemsCore.getRecipeHelper().registerCategory(new DefaultCampfireCategory());
+ RoughlyEnoughItemsCore.getRecipeHelper().registerCategory(new DefaultStoneCuttingCategory());
+ RoughlyEnoughItemsCore.getRecipeHelper().registerCategory(new DefaultBrewingCategory());
}
@Override
public void registerRecipes() {
- for(Recipe recipe : RecipeHelper.getRecipeManager().values())
+ for(Recipe recipe : RoughlyEnoughItemsCore.getRecipeHelper().getRecipeManager().values())
if (recipe instanceof ShapelessRecipe)
- RecipeHelper.registerRecipe(CRAFTING, new DefaultShapelessDisplay((ShapelessRecipe) recipe));
+ RoughlyEnoughItemsCore.getRecipeHelper().registerRecipe(CRAFTING, new DefaultShapelessDisplay((ShapelessRecipe) recipe));
else if (recipe instanceof ShapedRecipe)
- RecipeHelper.registerRecipe(CRAFTING, new DefaultShapedDisplay((ShapedRecipe) recipe));
+ RoughlyEnoughItemsCore.getRecipeHelper().registerRecipe(CRAFTING, new DefaultShapedDisplay((ShapedRecipe) recipe));
else if (recipe instanceof SmeltingRecipe)
- RecipeHelper.registerRecipe(SMELTING, new DefaultSmeltingDisplay((SmeltingRecipe) recipe));
+ RoughlyEnoughItemsCore.getRecipeHelper().registerRecipe(SMELTING, new DefaultSmeltingDisplay((SmeltingRecipe) recipe));
else if (recipe instanceof SmokingRecipe)
- RecipeHelper.registerRecipe(SMOKING, new DefaultSmokingDisplay((SmokingRecipe) recipe));
+ RoughlyEnoughItemsCore.getRecipeHelper().registerRecipe(SMOKING, new DefaultSmokingDisplay((SmokingRecipe) recipe));
else if (recipe instanceof BlastingRecipe)
- RecipeHelper.registerRecipe(BLASTING, new DefaultBlastingDisplay((BlastingRecipe) recipe));
+ RoughlyEnoughItemsCore.getRecipeHelper().registerRecipe(BLASTING, new DefaultBlastingDisplay((BlastingRecipe) recipe));
else if (recipe instanceof CampfireCookingRecipe)
- RecipeHelper.registerRecipe(CAMPFIRE, new DefaultCampfireDisplay((CampfireCookingRecipe) recipe));
+ RoughlyEnoughItemsCore.getRecipeHelper().registerRecipe(CAMPFIRE, new DefaultCampfireDisplay((CampfireCookingRecipe) recipe));
else if (recipe instanceof StonecuttingRecipe)
- RecipeHelper.registerRecipe(STONE_CUTTING, new DefaultStoneCuttingDisplay((StonecuttingRecipe) recipe));
- BREWING_DISPLAYS.forEach(display -> RecipeHelper.registerRecipe(BREWING, display));
+ RoughlyEnoughItemsCore.getRecipeHelper().registerRecipe(STONE_CUTTING, new DefaultStoneCuttingDisplay((StonecuttingRecipe) recipe));
+ BREWING_DISPLAYS.stream().forEachOrdered(display -> RoughlyEnoughItemsCore.getRecipeHelper().registerRecipe(BREWING, display));
}
@Override
public void registerSpeedCraft() {
- RecipeHelper.registerSpeedCraftButtonArea(DefaultPlugin.CAMPFIRE, null);
- RecipeHelper.registerSpeedCraftButtonArea(DefaultPlugin.STONE_CUTTING, null);
- RecipeHelper.registerSpeedCraftButtonArea(DefaultPlugin.BREWING, null);
- RecipeHelper.registerSpeedCraftFunctional(DefaultPlugin.CRAFTING, new SpeedCraftFunctional<DefaultCraftingDisplay>() {
+ RoughlyEnoughItemsCore.getRecipeHelper().registerSpeedCraftButtonArea(DefaultPlugin.CAMPFIRE, null);
+ RoughlyEnoughItemsCore.getRecipeHelper().registerSpeedCraftButtonArea(DefaultPlugin.STONE_CUTTING, null);
+ RoughlyEnoughItemsCore.getRecipeHelper().registerSpeedCraftButtonArea(DefaultPlugin.BREWING, null);
+ RoughlyEnoughItemsCore.getRecipeHelper().registerSpeedCraftFunctional(DefaultPlugin.CRAFTING, new SpeedCraftFunctional<DefaultCraftingDisplay>() {
@Override
public Class[] getFunctioningFor() {
return new Class[]{PlayerInventoryGui.class, CraftingTableGui.class};
@@ -99,7 +100,7 @@ public class DefaultPlugin implements IRecipePlugin {
return gui instanceof CraftingTableGui || (gui instanceof PlayerInventoryGui && recipe.getHeight() < 3 && recipe.getWidth() < 3);
}
});
- RecipeHelper.registerSpeedCraftFunctional(DefaultPlugin.SMELTING, new SpeedCraftFunctional<DefaultSmeltingDisplay>() {
+ RoughlyEnoughItemsCore.getRecipeHelper().registerSpeedCraftFunctional(DefaultPlugin.SMELTING, new SpeedCraftFunctional<DefaultSmeltingDisplay>() {
@Override
public Class[] getFunctioningFor() {
return new Class[]{FurnaceGui.class};
@@ -120,7 +121,7 @@ public class DefaultPlugin implements IRecipePlugin {
return gui instanceof FurnaceGui;
}
});
- RecipeHelper.registerSpeedCraftFunctional(DefaultPlugin.SMOKING, new SpeedCraftFunctional<DefaultSmokingDisplay>() {
+ RoughlyEnoughItemsCore.getRecipeHelper().registerSpeedCraftFunctional(DefaultPlugin.SMOKING, new SpeedCraftFunctional<DefaultSmokingDisplay>() {
@Override
public Class[] getFunctioningFor() {
return new Class[]{SmokerGui.class};
@@ -141,7 +142,7 @@ public class DefaultPlugin implements IRecipePlugin {
return gui instanceof SmokerGui;
}
});
- RecipeHelper.registerSpeedCraftFunctional(DefaultPlugin.BLASTING, new SpeedCraftFunctional<DefaultBlastingDisplay>() {
+ RoughlyEnoughItemsCore.getRecipeHelper().registerSpeedCraftFunctional(DefaultPlugin.BLASTING, new SpeedCraftFunctional<DefaultBlastingDisplay>() {
@Override
public Class[] getFunctioningFor() {
return new Class[]{BlastFurnaceGui.class};