diff options
Diffstat (limited to 'src/main/java/gregtech/api/gui')
3 files changed, 24 insertions, 25 deletions
diff --git a/src/main/java/gregtech/api/gui/modularui/GT_UIInfos.java b/src/main/java/gregtech/api/gui/modularui/GT_UIInfos.java index 2d776ce71e..d1e699bb40 100644 --- a/src/main/java/gregtech/api/gui/modularui/GT_UIInfos.java +++ b/src/main/java/gregtech/api/gui/modularui/GT_UIInfos.java @@ -70,9 +70,9 @@ public class GT_UIInfos { side, UIBuilder.of() .container((player, world, x, y, z) -> { - TileEntity te = world.getTileEntity(x, y, z); + final TileEntity te = world.getTileEntity(x, y, z); if (!(te instanceof ICoverable)) return null; - ICoverable gtTileEntity = (ICoverable) te; + final ICoverable gtTileEntity = (ICoverable) te; GT_CoverBehaviorBase<?> cover = gtTileEntity.getCoverBehaviorAtSideNew(side); return createCoverContainer( player, @@ -84,10 +84,10 @@ public class GT_UIInfos { }) .gui((player, world, x, y, z) -> { if (!world.isRemote) return null; - TileEntity te = world.getTileEntity(x, y, z); + final TileEntity te = world.getTileEntity(x, y, z); if (!(te instanceof ICoverable)) return null; - ICoverable gtTileEntity = (ICoverable) te; - GT_CoverBehaviorBase<?> cover = gtTileEntity.getCoverBehaviorAtSideNew(side); + final ICoverable gtTileEntity = (ICoverable) te; + final GT_CoverBehaviorBase<?> cover = gtTileEntity.getCoverBehaviorAtSideNew(side); return createCoverGuiContainer( player, cover::createWindow, @@ -148,11 +148,9 @@ public class GT_UIInfos { Function<UIBuildContext, ModularWindow> windowCreator, Runnable onWidgetUpdate, ContainerConstructor containerCreator) { - UIBuildContext buildContext = new UIBuildContext(player); - ModularWindow window = windowCreator.apply(buildContext); - if (window == null) { - return null; - } + final UIBuildContext buildContext = new UIBuildContext(player); + final ModularWindow window = windowCreator.apply(buildContext); + if (window == null) return null; return containerCreator.of(new ModularUIContext(buildContext, onWidgetUpdate), window); } @@ -161,10 +159,9 @@ public class GT_UIInfos { EntityPlayer player, Function<UIBuildContext, ModularWindow> windowCreator, ContainerConstructor containerConstructor) { - ModularUIContainer container = createTileEntityContainer(player, windowCreator, null, containerConstructor); - if (container == null) { - return null; - } + final ModularUIContainer container = + createTileEntityContainer(player, windowCreator, null, containerConstructor); + if (container == null) return null; return new ModularGui(container); } @@ -175,11 +172,9 @@ public class GT_UIInfos { int coverID, byte side, ICoverable tile) { - GT_CoverUIBuildContext buildContext = new GT_CoverUIBuildContext(player, coverID, side, tile, false); - ModularWindow window = windowCreator.apply(buildContext); - if (window == null) { - return null; - } + final GT_CoverUIBuildContext buildContext = new GT_CoverUIBuildContext(player, coverID, side, tile, false); + final ModularWindow window = windowCreator.apply(buildContext); + if (window == null) return null; return new ModularUIContainer(new ModularUIContext(buildContext, onWidgetUpdate), window); } @@ -190,7 +185,7 @@ public class GT_UIInfos { int coverID, byte side, ICoverable tile) { - ModularUIContainer container = createCoverContainer(player, windowCreator, null, coverID, side, tile); + final ModularUIContainer container = createCoverContainer(player, windowCreator, null, coverID, side, tile); if (container == null) { return null; } diff --git a/src/main/java/gregtech/api/gui/modularui/GT_UITextures.java b/src/main/java/gregtech/api/gui/modularui/GT_UITextures.java index a92ff64df6..3ca1e6d45e 100644 --- a/src/main/java/gregtech/api/gui/modularui/GT_UITextures.java +++ b/src/main/java/gregtech/api/gui/modularui/GT_UITextures.java @@ -347,4 +347,8 @@ public class GT_UITextures { public static final UITexture PICTURE_SQUARE_LIGHT_GRAY = UITexture.fullImage(MODID, "gui/picture/square_light_gray"); public static final UITexture PICTURE_GAUGE = UITexture.fullImage(MODID, "gui/picture/gauge"); + public static final UITexture PICTURE_ITEM_IN = UITexture.fullImage(MODID, "gui/picture/item_in"); + public static final UITexture PICTURE_ITEM_OUT = UITexture.fullImage(MODID, "gui/picture/item_out"); + public static final UITexture PICTURE_FLUID_IN = UITexture.fullImage(MODID, "gui/picture/fluid_in"); + public static final UITexture PICTURE_FLUID_OUT = UITexture.fullImage(MODID, "gui/picture/fluid_out"); } diff --git a/src/main/java/gregtech/api/gui/widgets/GT_GuiCoverTabLine.java b/src/main/java/gregtech/api/gui/widgets/GT_GuiCoverTabLine.java index 525618589b..d5e383ed50 100644 --- a/src/main/java/gregtech/api/gui/widgets/GT_GuiCoverTabLine.java +++ b/src/main/java/gregtech/api/gui/widgets/GT_GuiCoverTabLine.java @@ -79,7 +79,7 @@ public class GT_GuiCoverTabLine extends GT_GuiTabLine { */ private void setupTabs() { for (byte tSide = 0; tSide < 6; tSide++) { - ItemStack cover = tile.getCoverItemAtSide(tSide); + final ItemStack cover = tile.getCoverItemAtSide(tSide); if (cover != null) { addCoverToTabs(tSide, cover); } @@ -114,7 +114,7 @@ public class GT_GuiCoverTabLine extends GT_GuiTabLine { * @param cover */ private void addCoverToTabs(byte side, ItemStack cover) { - boolean enabled = this.tile.getCoverBehaviorAtSideNew(side).hasCoverGUI(); + final boolean enabled = this.tile.getCoverBehaviorAtSideNew(side).hasCoverGUI(); this.setTab(side, cover, null, getTooltipForCoverTab(side, cover, enabled)); this.setTabEnabled(side, enabled); } @@ -127,7 +127,7 @@ public class GT_GuiCoverTabLine extends GT_GuiTabLine { * @return This cover tab's tooltip */ private String[] getTooltipForCoverTab(byte side, ItemStack cover, boolean enabled) { - List<String> tooltip = cover.getTooltip(Minecraft.getMinecraft().thePlayer, true); + final List<String> tooltip = cover.getTooltip(Minecraft.getMinecraft().thePlayer, true); tooltip.set( 0, (enabled ? EnumChatFormatting.UNDERLINE : EnumChatFormatting.DARK_GRAY) @@ -158,9 +158,9 @@ public class GT_GuiCoverTabLine extends GT_GuiTabLine { static class CoverTabLineNEIHandler extends INEIGuiAdapter { @Override public boolean hideItemPanelSlot(GuiContainer gui, int x, int y, int w, int h) { - Rectangle neiSlotArea = new Rectangle(x, y, w, h); + final Rectangle neiSlotArea = new Rectangle(x, y, w, h); if (gui instanceof GT_GUIContainerMetaTile_Machine) { - GT_GuiTabLine tabLine = ((GT_GUIContainerMetaTile_Machine) gui).coverTabs; + final GT_GuiTabLine tabLine = ((GT_GUIContainerMetaTile_Machine) gui).coverTabs; if (!tabLine.visible) { return false; } |