mirror of
https://github.com/Ellpeck/PrettyPipes.git
synced 2024-11-22 19:58:35 +01:00
fixed JEI favorites overlapping buttons in the item terminal
Closes #45
This commit is contained in:
parent
dc9f7ed154
commit
e32ff7bb02
1 changed files with 16 additions and 0 deletions
|
@ -2,16 +2,20 @@ package de.ellpeck.prettypipes.compat.jei;
|
||||||
|
|
||||||
import de.ellpeck.prettypipes.PrettyPipes;
|
import de.ellpeck.prettypipes.PrettyPipes;
|
||||||
import de.ellpeck.prettypipes.misc.PlayerPrefs;
|
import de.ellpeck.prettypipes.misc.PlayerPrefs;
|
||||||
|
import de.ellpeck.prettypipes.terminal.containers.CraftingTerminalGui;
|
||||||
import de.ellpeck.prettypipes.terminal.containers.ItemTerminalGui;
|
import de.ellpeck.prettypipes.terminal.containers.ItemTerminalGui;
|
||||||
import mezz.jei.api.IModPlugin;
|
import mezz.jei.api.IModPlugin;
|
||||||
import mezz.jei.api.JeiPlugin;
|
import mezz.jei.api.JeiPlugin;
|
||||||
import mezz.jei.api.constants.VanillaRecipeCategoryUid;
|
import mezz.jei.api.constants.VanillaRecipeCategoryUid;
|
||||||
|
import mezz.jei.api.gui.handlers.IGuiContainerHandler;
|
||||||
|
import mezz.jei.api.registration.IGuiHandlerRegistration;
|
||||||
import mezz.jei.api.registration.IRecipeTransferRegistration;
|
import mezz.jei.api.registration.IRecipeTransferRegistration;
|
||||||
import mezz.jei.api.runtime.IIngredientFilter;
|
import mezz.jei.api.runtime.IIngredientFilter;
|
||||||
import mezz.jei.api.runtime.IJeiRuntime;
|
import mezz.jei.api.runtime.IJeiRuntime;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
import net.minecraft.client.gui.widget.button.Button;
|
import net.minecraft.client.gui.widget.button.Button;
|
||||||
|
import net.minecraft.client.renderer.Rectangle2d;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.text.StringTextComponent;
|
import net.minecraft.util.text.StringTextComponent;
|
||||||
|
@ -26,6 +30,8 @@ import net.minecraftforge.event.TickEvent.ClientTickEvent;
|
||||||
import net.minecraftforge.event.world.PistonEvent;
|
import net.minecraftforge.event.world.PistonEvent;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
@JeiPlugin
|
@JeiPlugin
|
||||||
|
@ -56,6 +62,16 @@ public class JEIPrettyPipesPlugin implements IModPlugin {
|
||||||
registration.addUniversalRecipeTransferHandler(new CraftingModuleTransferHandler());
|
registration.addUniversalRecipeTransferHandler(new CraftingModuleTransferHandler());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerGuiHandlers(IGuiHandlerRegistration registration) {
|
||||||
|
registration.addGuiContainerHandler(ItemTerminalGui.class, new IGuiContainerHandler<ItemTerminalGui>() {
|
||||||
|
@Override
|
||||||
|
public List<Rectangle2d> getGuiExtraAreas(ItemTerminalGui containerScreen) {
|
||||||
|
return Collections.singletonList(new Rectangle2d(containerScreen.getGuiLeft() - 22, containerScreen.getGuiTop(), 22, 64));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onInitGui(InitGuiEvent.Post event) {
|
public void onInitGui(InitGuiEvent.Post event) {
|
||||||
Screen screen = event.getGui();
|
Screen screen = event.getGui();
|
||||||
|
|
Loading…
Reference in a new issue