apply JEI extra areas to missing GUIs
This commit is contained in:
@@ -61,7 +61,7 @@ import appeng.parts.automation.PartImportBus;
|
||||
|
||||
public class GuiUpgradeable extends AEBaseGui implements IJEIGhostIngredients
|
||||
{
|
||||
private final Map<Target<?>,Object> mapTargetSlot = new HashMap<>();
|
||||
private final Map<Target<?>, Object> mapTargetSlot = new HashMap<>();
|
||||
protected final ContainerUpgradeable cvb;
|
||||
protected final IUpgradeableHost bc;
|
||||
|
||||
@@ -97,6 +97,20 @@ public class GuiUpgradeable extends AEBaseGui implements IJEIGhostIngredients
|
||||
this.addButtons();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Rectangle> getJEIExclusionArea()
|
||||
{
|
||||
List<Rectangle> exclusionArea = new ArrayList<>();
|
||||
|
||||
int yOffset = guiTop + 8;
|
||||
|
||||
int visibleButtons = (int) this.buttonList.stream().filter( v -> v.enabled && v.x < guiLeft ).count();
|
||||
Rectangle sortDir = new Rectangle( guiLeft - 18, yOffset, 18, visibleButtons * 18 + visibleButtons - 2 );
|
||||
exclusionArea.add( sortDir );
|
||||
|
||||
return exclusionArea;
|
||||
}
|
||||
|
||||
protected void addButtons()
|
||||
{
|
||||
this.redstoneMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE );
|
||||
@@ -218,7 +232,7 @@ public class GuiUpgradeable extends AEBaseGui implements IJEIGhostIngredients
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Target<?>> getPhantomTargets(Object ingredient)
|
||||
public List<Target<?>> getPhantomTargets( Object ingredient )
|
||||
{
|
||||
mapTargetSlot.clear();
|
||||
|
||||
@@ -236,7 +250,9 @@ public class GuiUpgradeable extends AEBaseGui implements IJEIGhostIngredients
|
||||
}
|
||||
|
||||
if( !( ingredient instanceof ItemStack ) && !( ingredient instanceof FluidStack ) )
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<Target<?>> targets = new ArrayList<>();
|
||||
|
||||
@@ -300,7 +316,10 @@ public class GuiUpgradeable extends AEBaseGui implements IJEIGhostIngredients
|
||||
}
|
||||
else
|
||||
{
|
||||
if( finalFluidStack == null ) return;
|
||||
if( finalFluidStack == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
p = new PacketInventoryAction( InventoryAction.PLACE_JEI_GHOST_ITEM, (IJEITargetSlot) slot, AEItemStack.fromItemStack( AEFluidStack.fromFluidStack( finalFluidStack ).asItemStackRepresentation() ) );
|
||||
}
|
||||
NetworkHandler.instance().sendToServer( p );
|
||||
|
||||
Reference in New Issue
Block a user