Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use default methods for the API where appropriate
- Loading branch information
Showing
37 changed files
with
100 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,9 @@ | ||
package mezz.jei.api; | ||
|
||
import mezz.jei.api.ingredients.IModIngredientRegistration; | ||
import mezz.jei.api.recipe.IRecipeCategoryRegistration; | ||
|
||
/** | ||
* An {@link IModPlugin} that does nothing, inherit from this to avoid implementing methods you don't need. | ||
* IModPlugin implementations must have the {@link JEIPlugin} annotation to get loaded by JEI. | ||
* @deprecated since JEI 4.6.0. This was replaced by default methods in {@link IModPlugin}. | ||
*/ | ||
@Deprecated | ||
public abstract class BlankModPlugin implements IModPlugin { | ||
@Override | ||
public void registerItemSubtypes(ISubtypeRegistry subtypeRegistry) { | ||
// override to register item subtypes | ||
} | ||
|
||
@Override | ||
public void registerCategories(IRecipeCategoryRegistration registry) { | ||
// override to register recipe categories | ||
} | ||
|
||
@Override | ||
public void registerIngredients(IModIngredientRegistration ingredientRegistry) { | ||
// override to register ingredients | ||
} | ||
|
||
@Override | ||
public void register(IModRegistry registry) { | ||
// override to register recipes | ||
} | ||
|
||
@Override | ||
public void onRuntimeAvailable(IJeiRuntime jeiRuntime) { | ||
// override to use the JEI runtime | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 4 additions & 14 deletions
18
src/api/java/mezz/jei/api/gui/BlankAdvancedGuiHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,11 @@ | ||
package mezz.jei.api.gui; | ||
|
||
import javax.annotation.Nullable; | ||
import java.awt.Rectangle; | ||
import java.util.List; | ||
|
||
import net.minecraft.client.gui.inventory.GuiContainer; | ||
|
||
/** | ||
* @deprecated since JEI 4.6.0. This was replaced by default methods in {@link IAdvancedGuiHandler}. | ||
*/ | ||
@Deprecated | ||
public abstract class BlankAdvancedGuiHandler<T extends GuiContainer> implements IAdvancedGuiHandler<T> { | ||
@Nullable | ||
@Override | ||
public List<Rectangle> getGuiExtraAreas(T guiContainer) { | ||
return null; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public Object getIngredientUnderMouse(T guiContainer, int mouseX, int mouseY) { | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/api/java/mezz/jei/api/ingredients/IIngredientBlacklist.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,9 @@ | ||
package mezz.jei.api.recipe; | ||
|
||
import javax.annotation.Nullable; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import mezz.jei.api.gui.IDrawable; | ||
import net.minecraft.client.Minecraft; | ||
|
||
/** | ||
* An {@link IRecipeCategory} that does nothing, inherit from this to avoid implementing methods you don't need. | ||
* @deprecated since JEI 4.6.0. This was replaced by default methods in {@link IRecipeCategory}. | ||
*/ | ||
@Deprecated | ||
public abstract class BlankRecipeCategory<T extends IRecipeWrapper> implements IRecipeCategory<T> { | ||
@Nullable | ||
@Override | ||
public IDrawable getIcon() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void drawExtras(Minecraft minecraft) { | ||
|
||
} | ||
|
||
@Override | ||
public List<String> getTooltipStrings(int mouseX, int mouseY) { | ||
return Collections.emptyList(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,8 @@ | ||
package mezz.jei.api.recipe; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import net.minecraft.client.Minecraft; | ||
|
||
/** | ||
* An {@link IRecipeWrapper} that does nothing, inherit from this to avoid implementing methods you don't need. | ||
* @deprecated since JEI 4.6.0. This was replaced by default methods in {@link IRecipeWrapper}. | ||
*/ | ||
public abstract class BlankRecipeWrapper implements IRecipeWrapper { | ||
@Override | ||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { | ||
// override to draw extra info about the recipe | ||
} | ||
|
||
@Override | ||
public List<String> getTooltipStrings(int mouseX, int mouseY) { | ||
return Collections.emptyList(); | ||
} | ||
|
||
@Override | ||
public boolean handleClick(Minecraft minecraft, int mouseX, int mouseY, int mouseButton) { | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.