Replaced all instances of Guava's Optional type with Java 8's Optional type, as discussed in #81. (#90)
This commit is contained in:
committed by
Sebastian Hartte
parent
c2a239a12f
commit
e276aa682f
@@ -100,38 +100,26 @@ public class GuiCraftAmount extends AEBaseGui
|
||||
|
||||
if( target instanceof WirelessTerminalGuiObject )
|
||||
{
|
||||
for( final ItemStack wirelessTerminalStack : definitions.items().wirelessTerminal().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
myIcon = wirelessTerminalStack;
|
||||
}
|
||||
myIcon = definitions.items().wirelessTerminal().maybeStack( 1 ).orElse( myIcon );
|
||||
|
||||
this.originalGui = GuiBridge.GUI_WIRELESS_TERM;
|
||||
}
|
||||
|
||||
if( target instanceof PartTerminal )
|
||||
{
|
||||
for( final ItemStack stack : parts.terminal().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
myIcon = stack;
|
||||
}
|
||||
myIcon = parts.terminal().maybeStack( 1 ).orElse( null );
|
||||
this.originalGui = GuiBridge.GUI_ME;
|
||||
}
|
||||
|
||||
if( target instanceof PartCraftingTerminal )
|
||||
{
|
||||
for( final ItemStack stack : parts.craftingTerminal().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
myIcon = stack;
|
||||
}
|
||||
myIcon = parts.craftingTerminal().maybeStack( 1 ).orElse( null );
|
||||
this.originalGui = GuiBridge.GUI_CRAFTING_TERMINAL;
|
||||
}
|
||||
|
||||
if( target instanceof PartPatternTerminal )
|
||||
{
|
||||
for( final ItemStack stack : parts.patternTerminal().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
myIcon = stack;
|
||||
}
|
||||
myIcon = parts.patternTerminal().maybeStack( 1 ).orElse( null );
|
||||
this.originalGui = GuiBridge.GUI_PATTERN_TERMINAL;
|
||||
}
|
||||
|
||||
|
||||
@@ -70,38 +70,29 @@ public class GuiCraftingStatus extends GuiCraftingCPU
|
||||
|
||||
if( target instanceof WirelessTerminalGuiObject )
|
||||
{
|
||||
for( final ItemStack wirelessTerminalStack : definitions.items().wirelessTerminal().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
this.myIcon = wirelessTerminalStack;
|
||||
}
|
||||
myIcon = definitions.items().wirelessTerminal().maybeStack( 1 ).orElse( null );
|
||||
|
||||
this.originalGui = GuiBridge.GUI_WIRELESS_TERM;
|
||||
}
|
||||
|
||||
if( target instanceof PartTerminal )
|
||||
{
|
||||
for( final ItemStack stack : parts.terminal().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
this.myIcon = stack;
|
||||
}
|
||||
myIcon = parts.terminal().maybeStack( 1 ).orElse( null );
|
||||
|
||||
this.originalGui = GuiBridge.GUI_ME;
|
||||
}
|
||||
|
||||
if( target instanceof PartCraftingTerminal )
|
||||
{
|
||||
for( final ItemStack stack : parts.craftingTerminal().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
this.myIcon = stack;
|
||||
}
|
||||
myIcon = parts.craftingTerminal().maybeStack( 1 ).orElse( null );
|
||||
|
||||
this.originalGui = GuiBridge.GUI_CRAFTING_TERMINAL;
|
||||
}
|
||||
|
||||
if( target instanceof PartPatternTerminal )
|
||||
{
|
||||
for( final ItemStack stack : parts.patternTerminal().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
this.myIcon = stack;
|
||||
}
|
||||
myIcon = parts.patternTerminal().maybeStack( 1 ).orElse( null );
|
||||
|
||||
this.originalGui = GuiBridge.GUI_PATTERN_TERMINAL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ import org.lwjgl.input.Mouse;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.FullnessMode;
|
||||
@@ -94,15 +93,9 @@ public class GuiIOPort extends GuiUpgradeable
|
||||
|
||||
final IDefinitions definitions = AEApi.instance().definitions();
|
||||
|
||||
for( final ItemStack cell1kStack : definitions.items().cell1k().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
this.drawItem( offsetX + 66 - 8, offsetY + 17, cell1kStack );
|
||||
}
|
||||
definitions.items().cell1k().maybeStack( 1 ).ifPresent( cell1kStack -> this.drawItem( offsetX + 66 - 8, offsetY + 17, cell1kStack ) );
|
||||
|
||||
for( final ItemStack driveStack : definitions.blocks().drive().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
this.drawItem( offsetX + 94 + 8, offsetY + 17, driveStack );
|
||||
}
|
||||
definitions.blocks().drive().maybeStack( 1 ).ifPresent( driveStack -> this.drawItem( offsetX + 94 + 8, offsetY + 17, driveStack ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -100,58 +100,37 @@ public class GuiPriority extends AEBaseGui
|
||||
|
||||
if( target instanceof PartStorageBus )
|
||||
{
|
||||
for( final ItemStack storageBusStack : parts.storageBus().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
myIcon = storageBusStack;
|
||||
}
|
||||
myIcon = parts.storageBus().maybeStack( 1 ).orElse( myIcon );
|
||||
this.OriginalGui = GuiBridge.GUI_STORAGEBUS;
|
||||
}
|
||||
|
||||
if( target instanceof PartFormationPlane )
|
||||
{
|
||||
for( final ItemStack formationPlaneStack : parts.formationPlane().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
myIcon = formationPlaneStack;
|
||||
}
|
||||
myIcon = parts.formationPlane().maybeStack( 1 ).orElse( myIcon );
|
||||
this.OriginalGui = GuiBridge.GUI_FORMATION_PLANE;
|
||||
}
|
||||
|
||||
if( target instanceof TileDrive )
|
||||
{
|
||||
for( final ItemStack driveStack : blocks.drive().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
myIcon = driveStack;
|
||||
}
|
||||
|
||||
myIcon = blocks.drive().maybeStack( 1 ).orElse( myIcon );
|
||||
this.OriginalGui = GuiBridge.GUI_DRIVE;
|
||||
}
|
||||
|
||||
if( target instanceof TileChest )
|
||||
{
|
||||
for( final ItemStack chestStack : blocks.chest().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
myIcon = chestStack;
|
||||
}
|
||||
|
||||
myIcon = blocks.chest().maybeStack( 1 ).orElse( myIcon );
|
||||
this.OriginalGui = GuiBridge.GUI_CHEST;
|
||||
}
|
||||
|
||||
if( target instanceof TileInterface )
|
||||
{
|
||||
for( final ItemStack interfaceStack : blocks.iface().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
myIcon = interfaceStack;
|
||||
}
|
||||
|
||||
myIcon = blocks.iface().maybeStack( 1 ).orElse( myIcon );
|
||||
this.OriginalGui = GuiBridge.GUI_INTERFACE;
|
||||
}
|
||||
|
||||
if( target instanceof PartInterface )
|
||||
{
|
||||
for( final ItemStack interfaceStack : parts.iface().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
myIcon = interfaceStack;
|
||||
}
|
||||
myIcon = parts.iface().maybeStack( 1 ).orElse( myIcon );
|
||||
this.OriginalGui = GuiBridge.GUI_INTERFACE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user