Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Close #164 Show JEI description pages last
- Loading branch information
Showing
4 changed files
with
107 additions
and
82 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 |
---|---|---|
|
@@ -5,4 +5,4 @@ curse_project_id=238222 | |
|
||
version_major=2 | ||
version_minor=27 | ||
version_patch=2 | ||
version_patch=3 |
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
161 changes: 81 additions & 80 deletions
161
.../java/mezz/jei/plugins/jei/JEIPlugin.java → ...zz/jei/plugins/jei/JEIInternalPlugin.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,80 +1,81 @@ | ||
package mezz.jei.plugins.jei; | ||
|
||
import mezz.jei.api.BlankModPlugin; | ||
import mezz.jei.api.IGuiHelper; | ||
import mezz.jei.api.IJeiHelpers; | ||
import mezz.jei.api.IModRegistry; | ||
import mezz.jei.api.gui.IAdvancedGuiHandler; | ||
import mezz.jei.config.Config; | ||
import mezz.jei.plugins.jei.debug.DebugRecipe; | ||
import mezz.jei.plugins.jei.debug.DebugRecipeCategory; | ||
import mezz.jei.plugins.jei.debug.DebugRecipeHandler; | ||
import mezz.jei.plugins.jei.description.ItemDescriptionRecipeCategory; | ||
import mezz.jei.plugins.jei.description.ItemDescriptionRecipeHandler; | ||
import net.minecraft.client.gui.inventory.GuiBrewingStand; | ||
import net.minecraft.init.Items; | ||
import net.minecraft.item.ItemStack; | ||
|
||
import javax.annotation.Nonnull; | ||
import javax.annotation.Nullable; | ||
import java.awt.*; | ||
import java.util.Arrays; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
@mezz.jei.api.JEIPlugin | ||
public class JEIPlugin extends BlankModPlugin { | ||
@Override | ||
public void register(@Nonnull IModRegistry registry) { | ||
IJeiHelpers jeiHelpers = registry.getJeiHelpers(); | ||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); | ||
|
||
registry.addRecipeCategories( | ||
new ItemDescriptionRecipeCategory(guiHelper) | ||
); | ||
|
||
registry.addRecipeHandlers( | ||
new ItemDescriptionRecipeHandler() | ||
); | ||
|
||
if (Config.isDebugModeEnabled()) { | ||
registry.addDescription(Arrays.asList( | ||
new ItemStack(Items.oak_door), | ||
new ItemStack(Items.spruce_door), | ||
new ItemStack(Items.birch_door), | ||
new ItemStack(Items.jungle_door), | ||
new ItemStack(Items.acacia_door), | ||
new ItemStack(Items.dark_oak_door) | ||
), | ||
"description.jei.wooden.door.1", // actually 2 lines | ||
"description.jei.wooden.door.2", | ||
"description.jei.wooden.door.3" | ||
); | ||
|
||
registry.addRecipeCategories(new DebugRecipeCategory(guiHelper)); | ||
registry.addRecipeHandlers(new DebugRecipeHandler()); | ||
registry.addRecipes(Arrays.asList( | ||
new DebugRecipe(), | ||
new DebugRecipe() | ||
)); | ||
|
||
registry.addAdvancedGuiHandlers(new IAdvancedGuiHandler<GuiBrewingStand>() { | ||
@Nonnull | ||
@Override | ||
public Class<GuiBrewingStand> getGuiContainerClass() { | ||
return GuiBrewingStand.class; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public List<Rectangle> getGuiExtraAreas(GuiBrewingStand guiContainer) { | ||
int widthMovement = (int) ((System.currentTimeMillis() / 100) % 100); | ||
int size = 25 + widthMovement; | ||
return Collections.singletonList( | ||
new Rectangle(guiContainer.guiLeft + guiContainer.xSize, guiContainer.guiTop + 40, size, size) | ||
); | ||
} | ||
}); | ||
} | ||
} | ||
} | ||
package mezz.jei.plugins.jei; | ||
|
||
import mezz.jei.api.BlankModPlugin; | ||
import mezz.jei.api.IGuiHelper; | ||
import mezz.jei.api.IJeiHelpers; | ||
import mezz.jei.api.IModRegistry; | ||
import mezz.jei.api.JEIPlugin; | ||
import mezz.jei.api.gui.IAdvancedGuiHandler; | ||
import mezz.jei.config.Config; | ||
import mezz.jei.plugins.jei.debug.DebugRecipe; | ||
import mezz.jei.plugins.jei.debug.DebugRecipeCategory; | ||
import mezz.jei.plugins.jei.debug.DebugRecipeHandler; | ||
import mezz.jei.plugins.jei.description.ItemDescriptionRecipeCategory; | ||
import mezz.jei.plugins.jei.description.ItemDescriptionRecipeHandler; | ||
import net.minecraft.client.gui.inventory.GuiBrewingStand; | ||
import net.minecraft.init.Items; | ||
import net.minecraft.item.ItemStack; | ||
|
||
import javax.annotation.Nonnull; | ||
import javax.annotation.Nullable; | ||
import java.awt.*; | ||
import java.util.Arrays; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
@JEIPlugin | ||
public class JEIInternalPlugin extends BlankModPlugin { | ||
@Override | ||
public void register(@Nonnull IModRegistry registry) { | ||
IJeiHelpers jeiHelpers = registry.getJeiHelpers(); | ||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); | ||
|
||
registry.addRecipeCategories( | ||
new ItemDescriptionRecipeCategory(guiHelper) | ||
); | ||
|
||
registry.addRecipeHandlers( | ||
new ItemDescriptionRecipeHandler() | ||
); | ||
|
||
if (Config.isDebugModeEnabled()) { | ||
registry.addDescription(Arrays.asList( | ||
new ItemStack(Items.oak_door), | ||
new ItemStack(Items.spruce_door), | ||
new ItemStack(Items.birch_door), | ||
new ItemStack(Items.jungle_door), | ||
new ItemStack(Items.acacia_door), | ||
new ItemStack(Items.dark_oak_door) | ||
), | ||
"description.jei.wooden.door.1", // actually 2 lines | ||
"description.jei.wooden.door.2", | ||
"description.jei.wooden.door.3" | ||
); | ||
|
||
registry.addRecipeCategories(new DebugRecipeCategory(guiHelper)); | ||
registry.addRecipeHandlers(new DebugRecipeHandler()); | ||
registry.addRecipes(Arrays.asList( | ||
new DebugRecipe(), | ||
new DebugRecipe() | ||
)); | ||
|
||
registry.addAdvancedGuiHandlers(new IAdvancedGuiHandler<GuiBrewingStand>() { | ||
@Nonnull | ||
@Override | ||
public Class<GuiBrewingStand> getGuiContainerClass() { | ||
return GuiBrewingStand.class; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public List<Rectangle> getGuiExtraAreas(GuiBrewingStand guiContainer) { | ||
int widthMovement = (int) ((System.currentTimeMillis() / 100) % 100); | ||
int size = 25 + widthMovement; | ||
return Collections.singletonList( | ||
new Rectangle(guiContainer.guiLeft + guiContainer.xSize, guiContainer.guiTop + 40, size, size) | ||
); | ||
} | ||
}); | ||
} | ||
} | ||
} |