-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Close #3168 Implement IJeiFeatures to let mods disable the InventoryE…
…ffectRendererGuiHandler
- Loading branch information
Showing
8 changed files
with
71 additions
and
4 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
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package mezz.jei.common; | ||
|
||
import mezz.jei.api.runtime.IJeiFeatures; | ||
|
||
public class JeiFeatures implements IJeiFeatures { | ||
private boolean inventoryEffectRendererGuiHandlerEnabled = true; | ||
|
||
@Override | ||
public void disableInventoryEffectRendererGuiHandler() { | ||
inventoryEffectRendererGuiHandlerEnabled = false; | ||
} | ||
|
||
public boolean getInventoryEffectRendererGuiHandlerEnabled() { | ||
return inventoryEffectRendererGuiHandlerEnabled; | ||
} | ||
} |
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
23 changes: 23 additions & 0 deletions
23
CommonApi/src/main/java/mezz/jei/api/runtime/IJeiFeatures.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package mezz.jei.api.runtime; | ||
|
||
import mezz.jei.api.gui.handlers.IGuiContainerHandler; | ||
import mezz.jei.api.registration.IAdvancedRegistration; | ||
|
||
/** | ||
* Provides access for mod plugins to disable various JEI features. | ||
* This may be needed by mods that substantially change hard-coded vanilla behaviors. | ||
* | ||
* Get an instance from {@link IAdvancedRegistration#getJeiFeatures()} | ||
* | ||
* @since 17.3.0 | ||
*/ | ||
public interface IJeiFeatures { | ||
/** | ||
* Disable JEI's Inventory Effect Renderer {@link IGuiContainerHandler}. | ||
* This is used by JEI in order to move out of the way of potion effects shown next to the inventory. | ||
* It can be disabled by mods that remove this behavior or substitute their own. | ||
* | ||
* @since 17.3.0 | ||
*/ | ||
void disableInventoryEffectRendererGuiHandler(); | ||
} |
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