Fixed mod not working without JEI
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
# Refined Storage Changelog
|
# Refined Storage Changelog
|
||||||
|
|
||||||
|
### 0.9.4
|
||||||
|
- Fixed mod not working without JEI (raoulvdberge)
|
||||||
|
|
||||||
### 0.9.3
|
### 0.9.3
|
||||||
- Updated German translation for Fluid Storage (0blu)
|
- Updated German translation for Fluid Storage (0blu)
|
||||||
- Updated Dutch translation for Fluid Storage (raoulvdberge)
|
- Updated Dutch translation for Fluid Storage (raoulvdberge)
|
||||||
|
@@ -28,6 +28,7 @@ import refinedstorage.gui.grid.stack.ClientStackItem;
|
|||||||
import refinedstorage.gui.grid.stack.IClientStack;
|
import refinedstorage.gui.grid.stack.IClientStack;
|
||||||
import refinedstorage.gui.sidebutton.*;
|
import refinedstorage.gui.sidebutton.*;
|
||||||
import refinedstorage.integration.jei.IntegrationJEI;
|
import refinedstorage.integration.jei.IntegrationJEI;
|
||||||
|
import refinedstorage.integration.jei.RefinedStorageJEIPlugin;
|
||||||
import refinedstorage.network.*;
|
import refinedstorage.network.*;
|
||||||
import refinedstorage.tile.grid.IGrid;
|
import refinedstorage.tile.grid.IGrid;
|
||||||
import refinedstorage.tile.grid.TileGrid;
|
import refinedstorage.tile.grid.TileGrid;
|
||||||
@@ -416,7 +417,7 @@ public class GuiGrid extends GuiBase {
|
|||||||
|
|
||||||
private void updateJEI() {
|
private void updateJEI() {
|
||||||
if (IntegrationJEI.isLoaded() && (grid.getSearchBoxMode() == TileGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED || grid.getSearchBoxMode() == TileGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED_AUTOSELECTED)) {
|
if (IntegrationJEI.isLoaded() && (grid.getSearchBoxMode() == TileGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED || grid.getSearchBoxMode() == TileGrid.SEARCH_BOX_MODE_JEI_SYNCHRONIZED_AUTOSELECTED)) {
|
||||||
IntegrationJEI.INSTANCE.getRuntime().getItemListOverlay().setFilterText(searchField.getText());
|
RefinedStorageJEIPlugin.INSTANCE.getRuntime().getItemListOverlay().setFilterText(searchField.getText());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,43 +1,8 @@
|
|||||||
package refinedstorage.integration.jei;
|
package refinedstorage.integration.jei;
|
||||||
|
|
||||||
import mezz.jei.api.IJeiRuntime;
|
|
||||||
import mezz.jei.api.IModPlugin;
|
|
||||||
import mezz.jei.api.IModRegistry;
|
|
||||||
import mezz.jei.api.JEIPlugin;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraftforge.fml.common.Loader;
|
import net.minecraftforge.fml.common.Loader;
|
||||||
import refinedstorage.RefinedStorageBlocks;
|
|
||||||
|
|
||||||
@JEIPlugin
|
|
||||||
public class IntegrationJEI implements IModPlugin {
|
|
||||||
public static IntegrationJEI INSTANCE;
|
|
||||||
|
|
||||||
private IJeiRuntime runtime;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void register(IModRegistry registry) {
|
|
||||||
INSTANCE = this;
|
|
||||||
|
|
||||||
registry.getRecipeTransferRegistry().addRecipeTransferHandler(new RecipeTransferHandlerGrid());
|
|
||||||
|
|
||||||
registry.addRecipeCategories(new RecipeCategorySolderer(registry.getJeiHelpers().getGuiHelper()));
|
|
||||||
|
|
||||||
registry.addRecipeHandlers(new RecipeHandlerSolderer());
|
|
||||||
|
|
||||||
registry.addRecipes(RecipeMakerSolderer.getRecipes());
|
|
||||||
|
|
||||||
registry.addRecipeCategoryCraftingItem(new ItemStack(RefinedStorageBlocks.SOLDERER), RecipeCategorySolderer.ID);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onRuntimeAvailable(IJeiRuntime runtime) {
|
|
||||||
this.runtime = runtime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IJeiRuntime getRuntime() {
|
|
||||||
return runtime;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public final class IntegrationJEI {
|
||||||
public static boolean isLoaded() {
|
public static boolean isLoaded() {
|
||||||
return Loader.isModLoaded("JEI");
|
return Loader.isModLoaded("JEI");
|
||||||
}
|
}
|
||||||
|
39
src/main/java/refinedstorage/integration/jei/RefinedStorageJEIPlugin.java
Executable file
39
src/main/java/refinedstorage/integration/jei/RefinedStorageJEIPlugin.java
Executable file
@@ -0,0 +1,39 @@
|
|||||||
|
package refinedstorage.integration.jei;
|
||||||
|
|
||||||
|
import mezz.jei.api.IJeiRuntime;
|
||||||
|
import mezz.jei.api.IModPlugin;
|
||||||
|
import mezz.jei.api.IModRegistry;
|
||||||
|
import mezz.jei.api.JEIPlugin;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import refinedstorage.RefinedStorageBlocks;
|
||||||
|
|
||||||
|
@JEIPlugin
|
||||||
|
public class RefinedStorageJEIPlugin implements IModPlugin {
|
||||||
|
public static RefinedStorageJEIPlugin INSTANCE;
|
||||||
|
|
||||||
|
private IJeiRuntime runtime;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void register(IModRegistry registry) {
|
||||||
|
INSTANCE = this;
|
||||||
|
|
||||||
|
registry.getRecipeTransferRegistry().addRecipeTransferHandler(new RecipeTransferHandlerGrid());
|
||||||
|
|
||||||
|
registry.addRecipeCategories(new RecipeCategorySolderer(registry.getJeiHelpers().getGuiHelper()));
|
||||||
|
|
||||||
|
registry.addRecipeHandlers(new RecipeHandlerSolderer());
|
||||||
|
|
||||||
|
registry.addRecipes(RecipeMakerSolderer.getRecipes());
|
||||||
|
|
||||||
|
registry.addRecipeCategoryCraftingItem(new ItemStack(RefinedStorageBlocks.SOLDERER), RecipeCategorySolderer.ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRuntimeAvailable(IJeiRuntime runtime) {
|
||||||
|
this.runtime = runtime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IJeiRuntime getRuntime() {
|
||||||
|
return runtime;
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user