missing click cancel
This commit is contained in:
@@ -36,6 +36,8 @@ import com.google.common.base.Joiner;
|
|||||||
import com.google.common.base.Stopwatch;
|
import com.google.common.base.Stopwatch;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
|
import mezz.jei.api.JEIPlugin;
|
||||||
|
import mezz.jei.api.gui.IGhostIngredientHandler;
|
||||||
import net.minecraftforge.fml.common.Optional;
|
import net.minecraftforge.fml.common.Optional;
|
||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
import org.lwjgl.input.Keyboard;
|
import org.lwjgl.input.Keyboard;
|
||||||
@@ -92,6 +94,8 @@ import appeng.fluids.container.slots.IMEFluidSlot;
|
|||||||
import appeng.helpers.InventoryAction;
|
import appeng.helpers.InventoryAction;
|
||||||
import yalter.mousetweaks.api.IMTModGuiContainer2;
|
import yalter.mousetweaks.api.IMTModGuiContainer2;
|
||||||
|
|
||||||
|
import static appeng.integration.modules.jei.JEIPlugin.runtime;
|
||||||
|
|
||||||
|
|
||||||
@Optional.Interface( iface = "yalter.mousetweaks.api.IMTModGuiContainer2", modid = "mousetweaks" )
|
@Optional.Interface( iface = "yalter.mousetweaks.api.IMTModGuiContainer2", modid = "mousetweaks" )
|
||||||
public abstract class AEBaseGui extends GuiContainer implements IMTModGuiContainer2
|
public abstract class AEBaseGui extends GuiContainer implements IMTModGuiContainer2
|
||||||
@@ -106,6 +110,7 @@ public abstract class AEBaseGui extends GuiContainer implements IMTModGuiContain
|
|||||||
private Stopwatch dbl_clickTimer = Stopwatch.createStarted();
|
private Stopwatch dbl_clickTimer = Stopwatch.createStarted();
|
||||||
private ItemStack dbl_whichItem = ItemStack.EMPTY;
|
private ItemStack dbl_whichItem = ItemStack.EMPTY;
|
||||||
private Slot bl_clicked;
|
private Slot bl_clicked;
|
||||||
|
private final AEGuiHandler aeGuiHandler = new AEGuiHandler();
|
||||||
|
|
||||||
public List<GuiCustomSlot> getGuiSlots()
|
public List<GuiCustomSlot> getGuiSlots()
|
||||||
{
|
{
|
||||||
@@ -194,6 +199,14 @@ public abstract class AEBaseGui extends GuiContainer implements IMTModGuiContain
|
|||||||
this.drawTooltip( (ITooltip) c, mouseX, mouseY );
|
this.drawTooltip( (ITooltip) c, mouseX, mouseY );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( isPointInRegion( -guiLeft,-guiTop, mc.displayWidth, mc.displayHeight, mouseX,mouseY)){
|
||||||
|
Object o = runtime.getBookmarkOverlay().getIngredientUnderMouse();
|
||||||
|
if (o != null) {
|
||||||
|
aeGuiHandler.getTargets( this,o,true );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawGuiSlot( GuiCustomSlot slot, int mouseX, int mouseY, float partialTicks )
|
protected void drawGuiSlot( GuiCustomSlot slot, int mouseX, int mouseY, float partialTicks )
|
||||||
|
|||||||
@@ -5,14 +5,16 @@ import appeng.api.storage.data.IAEItemStack;
|
|||||||
import appeng.client.gui.implementations.*;
|
import appeng.client.gui.implementations.*;
|
||||||
import appeng.container.interfaces.IJEIGhostIngredients;
|
import appeng.container.interfaces.IJEIGhostIngredients;
|
||||||
import appeng.container.slot.SlotFake;
|
import appeng.container.slot.SlotFake;
|
||||||
import appeng.fluids.client.gui.*;
|
|
||||||
import appeng.fluids.client.gui.widgets.GuiFluidSlot;
|
import appeng.fluids.client.gui.widgets.GuiFluidSlot;
|
||||||
import mezz.jei.api.gui.IAdvancedGuiHandler;
|
import mezz.jei.api.gui.IAdvancedGuiHandler;
|
||||||
import mezz.jei.api.gui.IGhostIngredientHandler;
|
import mezz.jei.api.gui.IGhostIngredientHandler;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import org.lwjgl.input.Mouse;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -20,7 +22,6 @@ import java.util.List;
|
|||||||
|
|
||||||
public class AEGuiHandler implements IAdvancedGuiHandler<AEBaseGui>, IGhostIngredientHandler<AEBaseGui>
|
public class AEGuiHandler implements IAdvancedGuiHandler<AEBaseGui>, IGhostIngredientHandler<AEBaseGui>
|
||||||
{
|
{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<AEBaseGui> getGuiContainerClass()
|
public Class<AEBaseGui> getGuiContainerClass()
|
||||||
{
|
{
|
||||||
@@ -106,7 +107,7 @@ public class AEGuiHandler implements IAdvancedGuiHandler<AEBaseGui>, IGhostIngre
|
|||||||
}
|
}
|
||||||
if( doStart )
|
if( doStart )
|
||||||
{
|
{
|
||||||
if( GuiScreen.isShiftKeyDown() )
|
if( GuiScreen.isShiftKeyDown() && Mouse.isButtonDown( 0 ) )
|
||||||
{
|
{
|
||||||
if( gui instanceof GuiUpgradeable || gui instanceof GuiPatternTerm )
|
if( gui instanceof GuiUpgradeable || gui instanceof GuiPatternTerm )
|
||||||
{
|
{
|
||||||
@@ -117,7 +118,16 @@ public class AEGuiHandler implements IAdvancedGuiHandler<AEBaseGui>, IGhostIngre
|
|||||||
{
|
{
|
||||||
if( ( (SlotFake) ghostGui.getFakeSlotTargetMap().get( target ) ).getStack().isEmpty() )
|
if( ( (SlotFake) ghostGui.getFakeSlotTargetMap().get( target ) ).getStack().isEmpty() )
|
||||||
{
|
{
|
||||||
|
Minecraft.getMinecraft().player.inventory.setItemStack( ItemStack.EMPTY );
|
||||||
target.accept( ingredient );
|
target.accept( ingredient );
|
||||||
|
try
|
||||||
|
{
|
||||||
|
gui.handleMouseInput();
|
||||||
|
}
|
||||||
|
catch( IOException e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -125,7 +135,16 @@ public class AEGuiHandler implements IAdvancedGuiHandler<AEBaseGui>, IGhostIngre
|
|||||||
{
|
{
|
||||||
if( ( (GuiFluidSlot) ghostGui.getFakeSlotTargetMap().get( target ) ).getFluidStack() == null )
|
if( ( (GuiFluidSlot) ghostGui.getFakeSlotTargetMap().get( target ) ).getFluidStack() == null )
|
||||||
{
|
{
|
||||||
|
Minecraft.getMinecraft().player.inventory.setItemStack( ItemStack.EMPTY );
|
||||||
target.accept( ingredient );
|
target.accept( ingredient );
|
||||||
|
try
|
||||||
|
{
|
||||||
|
gui.handleMouseInput();
|
||||||
|
}
|
||||||
|
catch( IOException e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import appeng.client.gui.widgets.GuiCustomSlot;
|
import appeng.client.gui.widgets.GuiCustomSlot;
|
||||||
import appeng.container.interfaces.IJEIGhostIngredients;
|
import appeng.container.interfaces.IJEIGhostIngredients;
|
||||||
|
import appeng.container.slot.AppEngSlot;
|
||||||
import appeng.container.slot.IJEITargetSlot;
|
import appeng.container.slot.IJEITargetSlot;
|
||||||
import appeng.container.slot.SlotFake;
|
import appeng.container.slot.SlotFake;
|
||||||
import appeng.core.sync.packets.PacketInventoryAction;
|
import appeng.core.sync.packets.PacketInventoryAction;
|
||||||
@@ -34,12 +35,9 @@ import appeng.fluids.util.AEFluidStack;
|
|||||||
import appeng.helpers.InventoryAction;
|
import appeng.helpers.InventoryAction;
|
||||||
import appeng.util.item.AEItemStack;
|
import appeng.util.item.AEItemStack;
|
||||||
import mezz.jei.api.gui.IGhostIngredientHandler.Target;
|
import mezz.jei.api.gui.IGhostIngredientHandler.Target;
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraftforge.fluids.*;
|
import net.minecraftforge.fluids.*;
|
||||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
|
||||||
import org.lwjgl.input.Mouse;
|
import org.lwjgl.input.Mouse;
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
@@ -231,97 +229,90 @@ public class GuiUpgradeable extends AEBaseGui implements IJEIGhostIngredients
|
|||||||
if( ingredient instanceof ItemStack )
|
if( ingredient instanceof ItemStack )
|
||||||
{
|
{
|
||||||
itemStack = (ItemStack) ingredient;
|
itemStack = (ItemStack) ingredient;
|
||||||
|
fluidStack = FluidUtil.getFluidContained( itemStack );
|
||||||
if( itemStack.hasCapability( CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY, null ) )
|
|
||||||
{
|
|
||||||
fluidStack = ( itemStack.getCapability( CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY, null ).drain( Integer.MAX_VALUE, false ) );
|
|
||||||
}
|
|
||||||
if( fluidStack == null )
|
|
||||||
{
|
|
||||||
NBTTagCompound tagCompound = itemStack.getTagCompound();
|
|
||||||
if( tagCompound != null && tagCompound.hasKey( "Fluid" ) )
|
|
||||||
{
|
|
||||||
Fluid fluid = FluidRegistry.getFluid( tagCompound.getString( "Fluid" ) );
|
|
||||||
fluidStack = new FluidStack( fluid, 1000 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if( fluidStack == null )
|
|
||||||
{
|
|
||||||
Block maybeFluidBlock = Block.getBlockFromItem( itemStack.getItem() );
|
|
||||||
if( Block.getBlockFromItem( itemStack.getItem() ) instanceof BlockFluidBase )
|
|
||||||
{
|
|
||||||
Fluid fluid = ( (BlockFluidBase) maybeFluidBlock ).getFluid();
|
|
||||||
fluidStack = new FluidStack( fluid, 1000 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if( ingredient instanceof FluidStack )
|
else if( ingredient instanceof FluidStack )
|
||||||
{
|
{
|
||||||
fluidStack = (FluidStack) ingredient;
|
fluidStack = (FluidStack) ingredient;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( !( ingredient instanceof ItemStack ) && !( ingredient instanceof FluidStack ) )
|
||||||
|
return Collections.emptyList();
|
||||||
|
|
||||||
List<Target<?>> targets = new ArrayList<>();
|
List<Target<?>> targets = new ArrayList<>();
|
||||||
|
|
||||||
List<IJEITargetSlot> slots = new ArrayList<>();
|
List<IJEITargetSlot> slots = new ArrayList<>();
|
||||||
if (this.inventorySlots.inventorySlots.size() > 0) {
|
if( this.inventorySlots.inventorySlots.size() > 0 )
|
||||||
for (Slot slot : this.inventorySlots.inventorySlots) {
|
{
|
||||||
if (slot instanceof SlotFake) {
|
for( Slot slot : this.inventorySlots.inventorySlots )
|
||||||
slots.add((IJEITargetSlot) slot);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(this.getGuiSlots().size() > 0) {
|
|
||||||
for (GuiCustomSlot slot : this.getGuiSlots()) {
|
|
||||||
if (slot instanceof GuiFluidSlot) {
|
|
||||||
slots.add((IJEITargetSlot) slot);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for( Object slot : slots )
|
|
||||||
{
|
{
|
||||||
ItemStack finalItemStack = itemStack;
|
if( slot instanceof SlotFake && ( !itemStack.isEmpty() || this instanceof GuiCellWorkbench && fluidStack != null && !( (AppEngSlot) slot ).isItemValid( itemStack ) ) )
|
||||||
FluidStack finalFluidStack = fluidStack;
|
{
|
||||||
Target<Object> targetItem = new Target<Object>()
|
slots.add( (IJEITargetSlot) slot );
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public Rectangle getArea()
|
|
||||||
{
|
|
||||||
if (slot instanceof SlotFake)
|
|
||||||
return new Rectangle( getGuiLeft() + ((SlotFake)slot).xPos, getGuiTop() + ((SlotFake)slot).yPos, 16, 16 );
|
|
||||||
else {
|
|
||||||
return new Rectangle( getGuiLeft() + ((GuiFluidSlot)slot).xPos(), getGuiTop() + ((GuiFluidSlot)slot).yPos(), 16, 16 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void accept( Object ingredient )
|
|
||||||
{
|
|
||||||
PacketInventoryAction p = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (slot instanceof SlotFake) {
|
|
||||||
if (finalItemStack.isEmpty() && finalFluidStack != null) {
|
|
||||||
p = new PacketInventoryAction( InventoryAction.PLACE_JEI_GHOST_ITEM, (IJEITargetSlot) slot, AEItemStack.fromItemStack( FluidUtil.getFilledBucket(finalFluidStack) ) );
|
|
||||||
}
|
|
||||||
else if (!finalItemStack.isEmpty()){
|
|
||||||
p = new PacketInventoryAction(InventoryAction.PLACE_JEI_GHOST_ITEM, (IJEITargetSlot) slot, AEItemStack.fromItemStack(finalItemStack));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
p = new PacketInventoryAction(InventoryAction.PLACE_JEI_GHOST_ITEM, (IJEITargetSlot) slot, AEItemStack.fromItemStack(AEFluidStack.fromFluidStack(finalFluidStack).asItemStackRepresentation()));
|
|
||||||
}
|
|
||||||
NetworkHandler.instance().sendToServer( p );
|
|
||||||
|
|
||||||
}
|
|
||||||
catch( IOException e )
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
targets.add( targetItem );
|
|
||||||
mapTargetSlot.putIfAbsent( targetItem, slot );
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( this.getGuiSlots().size() > 0 )
|
||||||
|
{
|
||||||
|
for( GuiCustomSlot slot : this.getGuiSlots() )
|
||||||
|
{
|
||||||
|
if( slot instanceof GuiFluidSlot && fluidStack != null )
|
||||||
|
{
|
||||||
|
slots.add( (IJEITargetSlot) slot );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for( Object slot : slots )
|
||||||
|
{
|
||||||
|
ItemStack finalItemStack = itemStack;
|
||||||
|
FluidStack finalFluidStack = fluidStack;
|
||||||
|
Target<Object> targetItem = new Target<Object>()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public Rectangle getArea()
|
||||||
|
{
|
||||||
|
if( slot instanceof SlotFake )
|
||||||
|
return new Rectangle( getGuiLeft() + ( (SlotFake) slot ).xPos, getGuiTop() + ( (SlotFake) slot ).yPos, 16, 16 );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return new Rectangle( getGuiLeft() + ( (GuiFluidSlot) slot ).xPos(), getGuiTop() + ( (GuiFluidSlot) slot ).yPos(), 16, 16 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void accept( Object ingredient )
|
||||||
|
{
|
||||||
|
PacketInventoryAction p = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if( slot instanceof SlotFake )
|
||||||
|
{
|
||||||
|
if( finalItemStack.isEmpty() && finalFluidStack != null )
|
||||||
|
{
|
||||||
|
p = new PacketInventoryAction( InventoryAction.PLACE_JEI_GHOST_ITEM, (IJEITargetSlot) slot, AEItemStack.fromItemStack( FluidUtil.getFilledBucket( finalFluidStack ) ) );
|
||||||
|
}
|
||||||
|
else if( !finalItemStack.isEmpty() )
|
||||||
|
{
|
||||||
|
p = new PacketInventoryAction( InventoryAction.PLACE_JEI_GHOST_ITEM, (IJEITargetSlot) slot, AEItemStack.fromItemStack( finalItemStack ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if( finalFluidStack == null ) return;
|
||||||
|
p = new PacketInventoryAction( InventoryAction.PLACE_JEI_GHOST_ITEM, (IJEITargetSlot) slot, AEItemStack.fromItemStack( AEFluidStack.fromFluidStack( finalFluidStack ).asItemStackRepresentation() ) );
|
||||||
|
}
|
||||||
|
NetworkHandler.instance().sendToServer( p );
|
||||||
|
|
||||||
|
}
|
||||||
|
catch( IOException e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
targets.add( targetItem );
|
||||||
|
mapTargetSlot.putIfAbsent( targetItem, slot );
|
||||||
|
}
|
||||||
return targets;
|
return targets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -197,7 +197,17 @@ public class PacketInventoryAction extends AppEngPacket
|
|||||||
{
|
{
|
||||||
if( sender.openContainer.inventorySlots.get( this.slot ) instanceof SlotFake )
|
if( sender.openContainer.inventorySlots.get( this.slot ) instanceof SlotFake )
|
||||||
{
|
{
|
||||||
if( this.slotItem != null ) sender.openContainer.inventorySlots.get( this.slot ).putStack( this.slotItem.asItemStackRepresentation() );
|
if( this.slotItem != null ) {
|
||||||
|
sender.openContainer.inventorySlots.get( this.slot ).putStack( this.slotItem.asItemStackRepresentation() );
|
||||||
|
if (sender.openContainer.inventorySlots.get( this.slot ).getStack().isEmpty()){
|
||||||
|
IAEFluidStack aefs = AEFluidStack.fromNBT( this.slotItem.getDefinition().getTagCompound() );
|
||||||
|
if( aefs != null )
|
||||||
|
{
|
||||||
|
FluidStack fluid = aefs.getFluidStack();
|
||||||
|
sender.openContainer.inventorySlots.get( this.slot ).putStack( AEFluidStack.fromFluidStack( fluid ).asItemStackRepresentation() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else sender.openContainer.inventorySlots.get( this.slot ).putStack( ItemStack.EMPTY );
|
else sender.openContainer.inventorySlots.get( this.slot ).putStack( ItemStack.EMPTY );
|
||||||
}
|
}
|
||||||
if( Minecraft.getMinecraft().currentScreen instanceof GuiUpgradeable )
|
if( Minecraft.getMinecraft().currentScreen instanceof GuiUpgradeable )
|
||||||
@@ -209,11 +219,11 @@ public class PacketInventoryAction extends AppEngPacket
|
|||||||
GuiFluidSlot gfs = (GuiFluidSlot) ct;
|
GuiFluidSlot gfs = (GuiFluidSlot) ct;
|
||||||
if( this.slotItem != null )
|
if( this.slotItem != null )
|
||||||
{
|
{
|
||||||
IAEFluidStack aefs = AEFluidStack.fromNBT(this.slotItem.getDefinition().getTagCompound());
|
IAEFluidStack aefs = AEFluidStack.fromNBT( this.slotItem.getDefinition().getTagCompound() );
|
||||||
if (aefs != null)
|
if( aefs != null )
|
||||||
{
|
{
|
||||||
FluidStack fluid = aefs.getFluidStack();
|
FluidStack fluid = aefs.getFluidStack();
|
||||||
gfs.setFluidStack(AEFluidStack.fromFluidStack(fluid));
|
gfs.setFluidStack( AEFluidStack.fromFluidStack( fluid ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -19,6 +19,8 @@
|
|||||||
package appeng.integration.modules.jei;
|
package appeng.integration.modules.jei;
|
||||||
|
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -27,14 +29,11 @@ import appeng.client.gui.AEGuiHandler;
|
|||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
|
import mezz.jei.api.*;
|
||||||
import mezz.jei.config.Constants;
|
import mezz.jei.config.Constants;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import mezz.jei.api.IJeiRuntime;
|
|
||||||
import mezz.jei.api.IModPlugin;
|
|
||||||
import mezz.jei.api.IModRegistry;
|
|
||||||
import mezz.jei.api.ISubtypeRegistry;
|
|
||||||
import mezz.jei.api.recipe.IRecipeCategoryRegistration;
|
import mezz.jei.api.recipe.IRecipeCategoryRegistration;
|
||||||
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
|
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
|
||||||
|
|
||||||
@@ -55,8 +54,10 @@ import appeng.items.parts.ItemFacade;
|
|||||||
|
|
||||||
|
|
||||||
@mezz.jei.api.JEIPlugin
|
@mezz.jei.api.JEIPlugin
|
||||||
public class JEIPlugin implements IModPlugin
|
public class JEIPlugin implements IModPlugin, IBookmarkOverlay
|
||||||
{
|
{
|
||||||
|
public static IJeiRuntime runtime;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerItemSubtypes( ISubtypeRegistry subtypeRegistry )
|
public void registerItemSubtypes( ISubtypeRegistry subtypeRegistry )
|
||||||
{
|
{
|
||||||
@@ -220,5 +221,13 @@ public class JEIPlugin implements IModPlugin
|
|||||||
{
|
{
|
||||||
JEIModule jeiModule = (JEIModule) Integrations.jei();
|
JEIModule jeiModule = (JEIModule) Integrations.jei();
|
||||||
jeiModule.setJei( new JeiRuntimeAdapter( jeiRuntime ) );
|
jeiModule.setJei( new JeiRuntimeAdapter( jeiRuntime ) );
|
||||||
|
runtime = jeiRuntime;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public Object getIngredientUnderMouse()
|
||||||
|
{
|
||||||
|
return runtime.getBookmarkOverlay().getIngredientUnderMouse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user